From 11a66f442a23f45f1c9338f575ffa73fccbcdde8 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 30 Apr 2024 05:05:45 +0000 Subject: [PATCH] feat: Update Compute Engine API to revision 20240421 (#899) Source-Link: https://github.com/googleapis/googleapis/commit/55499b55001daf2f59359b4d9f90b7d5459347e9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/cf5049b70792820065db38e7127f32eab7705944 Copy-Tag: eyJwIjoiQ29tcHV0ZS8uT3dsQm90LnlhbWwiLCJoIjoiY2Y1MDQ5YjcwNzkyODIwMDY1ZGIzOGU3MTI3ZjMyZWFiNzcwNTk0NCJ9 --- .../Google/Cloud/Compute/V1/Compute.php | Bin 0 -> 666201 bytes .../Cloud/Compute/V1/AWSV4Signature.php | 210 + ...onInstancesInstanceGroupManagerRequest.php | 242 + ...ancesRegionInstanceGroupManagerRequest.php | 242 + .../Cloud/Compute/V1/AcceleratorConfig.php | 121 + .../Cloud/Compute/V1/AcceleratorType.php | 429 ++ .../V1/AcceleratorTypeAggregatedList.php | 320 + .../Cloud/Compute/V1/AcceleratorTypeList.php | 287 + .../Compute/V1/AcceleratorTypesScopedList.php | 110 + .../Google/Cloud/Compute/V1/Accelerators.php | 120 + .../Google/Cloud/Compute/V1/AccessConfig.php | 481 ++ .../Compute/V1/AccessConfig/NetworkTier.php | 78 + .../Cloud/Compute/V1/AccessConfig/Type.php | 60 + .../V1/AddAccessConfigInstanceRequest.php | 278 + .../AddAssociationFirewallPolicyRequest.php | 214 + ...ssociationNetworkFirewallPolicyRequest.php | 250 + ...tionRegionNetworkFirewallPolicyRequest.php | 286 + .../V1/AddHealthCheckTargetPoolRequest.php | 242 + .../V1/AddInstanceTargetPoolRequest.php | 242 + .../V1/AddInstancesInstanceGroupRequest.php | 242 + .../Compute/V1/AddNodesNodeGroupRequest.php | 242 + .../Compute/V1/AddPeeringNetworkRequest.php | 206 + .../V1/AddResourcePoliciesDiskRequest.php | 242 + .../V1/AddResourcePoliciesInstanceRequest.php | 242 + .../AddResourcePoliciesRegionDiskRequest.php | 242 + .../V1/AddRuleFirewallPolicyRequest.php | 170 + .../AddRuleNetworkFirewallPolicyRequest.php | 294 + ...RuleRegionNetworkFirewallPolicyRequest.php | 330 + .../V1/AddRuleRegionSecurityPolicyRequest.php | 242 + .../V1/AddRuleSecurityPolicyRequest.php | 206 + .../AddSignedUrlKeyBackendBucketRequest.php | 206 + .../AddSignedUrlKeyBackendServiceRequest.php | 206 + .../src/Google/Cloud/Compute/V1/Address.php | 917 +++ .../Cloud/Compute/V1/Address/AddressType.php | 69 + .../Cloud/Compute/V1/Address/IpVersion.php | 65 + .../Compute/V1/Address/Ipv6EndpointType.php | 64 + .../Cloud/Compute/V1/Address/NetworkTier.php | 78 + .../Cloud/Compute/V1/Address/Purpose.php | 106 + .../Cloud/Compute/V1/Address/Status.php | 71 + .../Compute/V1/AddressAggregatedList.php | 320 + .../Google/Cloud/Compute/V1/AddressList.php | 287 + .../Cloud/Compute/V1/AddressesScopedList.php | 110 + .../Compute/V1/AdvancedMachineFeatures.php | 209 + .../AggregatedListAcceleratorTypesRequest.php | 388 ++ .../V1/AggregatedListAddressesRequest.php | 388 ++ .../V1/AggregatedListAutoscalersRequest.php | 388 ++ .../AggregatedListBackendServicesRequest.php | 388 ++ .../V1/AggregatedListDiskTypesRequest.php | 388 ++ .../Compute/V1/AggregatedListDisksRequest.php | 388 ++ .../AggregatedListForwardingRulesRequest.php | 388 ++ .../AggregatedListGlobalOperationsRequest.php | 388 ++ .../V1/AggregatedListHealthChecksRequest.php | 388 ++ ...egatedListInstanceGroupManagersRequest.php | 388 ++ .../AggregatedListInstanceGroupsRequest.php | 388 ++ ...AggregatedListInstanceTemplatesRequest.php | 388 ++ .../V1/AggregatedListInstancesRequest.php | 388 ++ .../AggregatedListInstantSnapshotsRequest.php | 388 ++ ...atedListInterconnectAttachmentsRequest.php | 388 ++ .../V1/AggregatedListMachineTypesRequest.php | 388 ++ ...ggregatedListNetworkAttachmentsRequest.php | 388 ++ ...ListNetworkEdgeSecurityServicesRequest.php | 388 ++ ...egatedListNetworkEndpointGroupsRequest.php | 388 ++ .../V1/AggregatedListNodeGroupsRequest.php | 388 ++ .../V1/AggregatedListNodeTemplatesRequest.php | 388 ++ .../V1/AggregatedListNodeTypesRequest.php | 388 ++ .../AggregatedListPacketMirroringsRequest.php | 388 ++ ...atedListPublicDelegatedPrefixesRequest.php | 388 ++ ...AggregatedListRegionCommitmentsRequest.php | 388 ++ .../V1/AggregatedListReservationsRequest.php | 388 ++ .../AggregatedListResourcePoliciesRequest.php | 388 ++ .../V1/AggregatedListRoutersRequest.php | 388 ++ .../AggregatedListSecurityPoliciesRequest.php | 388 ++ ...ggregatedListServiceAttachmentsRequest.php | 388 ++ .../AggregatedListSslCertificatesRequest.php | 388 ++ .../V1/AggregatedListSslPoliciesRequest.php | 388 ++ .../AggregatedListStoragePoolTypesRequest.php | 388 ++ .../V1/AggregatedListStoragePoolsRequest.php | 388 ++ .../V1/AggregatedListSubnetworksRequest.php | 388 ++ ...AggregatedListTargetHttpProxiesRequest.php | 388 ++ ...ggregatedListTargetHttpsProxiesRequest.php | 388 ++ .../AggregatedListTargetInstancesRequest.php | 388 ++ .../V1/AggregatedListTargetPoolsRequest.php | 388 ++ .../AggregatedListTargetTcpProxiesRequest.php | 388 ++ ...AggregatedListTargetVpnGatewaysRequest.php | 388 ++ .../V1/AggregatedListUrlMapsRequest.php | 388 ++ .../V1/AggregatedListVpnGatewaysRequest.php | 388 ++ .../V1/AggregatedListVpnTunnelsRequest.php | 388 ++ .../Google/Cloud/Compute/V1/AliasIpRange.php | 121 + .../V1/AllocationAggregateReservation.php | 197 + .../VmFamily.php | 65 + .../WorkloadType.php | 69 + ...gregateReservationReservedResourceInfo.php | 76 + ...rvationReservedResourceInfoAccelerator.php | 120 + .../Compute/V1/AllocationResourceStatus.php | 77 + ...ionResourceStatusSpecificSKUAllocation.php | 77 + ...llocatedInstancePropertiesReservedDisk.php | 124 + .../PBInterface.php | 60 + ...KUAllocationReservedInstanceProperties.php | 233 + .../V1/AllocationSpecificSKUReservation.php | 253 + .../src/Google/Cloud/Compute/V1/Allowed.php | 110 + ...AnnouncePublicAdvertisedPrefixeRequest.php | 160 + .../AnnouncePublicDelegatedPrefixeRequest.php | 196 + ...ToInstancesInstanceGroupManagerRequest.php | 198 + ...ancesRegionInstanceGroupManagerRequest.php | 198 + .../Compute/V1/AttachDiskInstanceRequest.php | 286 + ...ointsGlobalNetworkEndpointGroupRequest.php | 206 + ...rkEndpointsNetworkEndpointGroupRequest.php | 242 + ...ointsRegionNetworkEndpointGroupRequest.php | 242 + .../Google/Cloud/Compute/V1/AttachedDisk.php | 825 +++ .../Compute/V1/AttachedDisk/Architecture.php | 71 + .../Cloud/Compute/V1/AttachedDisk/Mode.php | 64 + .../Compute/V1/AttachedDisk/PBInterface.php | 60 + .../Compute/V1/AttachedDisk/SavedState.php | 64 + .../Cloud/Compute/V1/AttachedDisk/Type.php | 60 + .../V1/AttachedDiskInitializeParams.php | 827 +++ .../Architecture.php | 71 + .../OnUpdateAction.php | 71 + .../Google/Cloud/Compute/V1/AuditConfig.php | 145 + .../Cloud/Compute/V1/AuditLogConfig.php | 159 + .../Compute/V1/AuditLogConfig/LogType.php | 78 + .../V1/AuthorizationLoggingOptions.php | 81 + .../PermissionType.php | 85 + .../Google/Cloud/Compute/V1/Autoscaler.php | 633 ++ .../Cloud/Compute/V1/Autoscaler/Status.php | 78 + .../Compute/V1/AutoscalerAggregatedList.php | 320 + .../Cloud/Compute/V1/AutoscalerList.php | 287 + .../Compute/V1/AutoscalerStatusDetails.php | 124 + .../V1/AutoscalerStatusDetails/Type.php | 188 + .../Compute/V1/AutoscalersScopedList.php | 110 + .../Cloud/Compute/V1/AutoscalingPolicy.php | 406 ++ .../Compute/V1/AutoscalingPolicy/Mode.php | 78 + .../V1/AutoscalingPolicyCpuUtilization.php | 125 + .../PredictiveMethod.php | 64 + ...toscalingPolicyCustomMetricUtilization.php | 257 + .../UtilizationTargetType.php | 71 + ...oscalingPolicyLoadBalancingUtilization.php | 77 + .../V1/AutoscalingPolicyScaleInControl.php | 121 + .../V1/AutoscalingPolicyScalingSchedule.php | 297 + .../src/Google/Cloud/Compute/V1/Backend.php | 613 ++ .../Compute/V1/Backend/BalancingMode.php | 71 + .../Cloud/Compute/V1/Backend/Preference.php | 75 + .../Google/Cloud/Compute/V1/BackendBucket.php | 555 ++ .../V1/BackendBucket/CompressionMode.php | 64 + .../Compute/V1/BackendBucketCdnPolicy.php | 535 ++ .../V1/BackendBucketCdnPolicy/CacheMode.php | 76 + ...ketCdnPolicyBypassCacheOnRequestHeader.php | 77 + .../BackendBucketCdnPolicyCacheKeyPolicy.php | 101 + ...ndBucketCdnPolicyNegativeCachingPolicy.php | 121 + .../Cloud/Compute/V1/BackendBucketList.php | 287 + .../Cloud/Compute/V1/BackendService.php | 1793 +++++ .../V1/BackendService/CompressionMode.php | 64 + .../V1/BackendService/LoadBalancingScheme.php | 90 + .../V1/BackendService/LocalityLbPolicy.php | 104 + .../Compute/V1/BackendService/Protocol.php | 102 + .../V1/BackendService/SessionAffinity.php | 106 + .../V1/BackendServiceAggregatedList.php | 321 + .../Compute/V1/BackendServiceCdnPolicy.php | 535 ++ .../V1/BackendServiceCdnPolicy/CacheMode.php | 76 + ...iceCdnPolicyBypassCacheOnRequestHeader.php | 77 + ...dServiceCdnPolicyNegativeCachingPolicy.php | 121 + ...BackendServiceConnectionTrackingPolicy.php | 217 + ...nnectionPersistenceOnUnhealthyBackends.php | 65 + .../TrackingMode.php | 65 + .../V1/BackendServiceFailoverPolicy.php | 165 + .../Compute/V1/BackendServiceGroupHealth.php | 144 + .../Cloud/Compute/V1/BackendServiceIAP.php | 209 + .../Cloud/Compute/V1/BackendServiceList.php | 287 + .../Compute/V1/BackendServiceListUsable.php | 287 + ...rviceLocalityLoadBalancingPolicyConfig.php | 107 + ...yLoadBalancingPolicyConfigCustomPolicy.php | 121 + ...ocalityLoadBalancingPolicyConfigPolicy.php | 81 + .../Name.php | 104 + .../Compute/V1/BackendServiceLogConfig.php | 203 + .../BackendServiceLogConfig/OptionalMode.php | 71 + .../Compute/V1/BackendServiceReference.php | 69 + .../Cloud/Compute/V1/BackendServiceUsedBy.php | 69 + .../Compute/V1/BackendServicesScopedList.php | 110 + .../src/Google/Cloud/Compute/V1/BfdPacket.php | 744 +++ .../Cloud/Compute/V1/BfdPacket/Diagnostic.php | 100 + .../Cloud/Compute/V1/BfdPacket/State.php | 75 + .../src/Google/Cloud/Compute/V1/BfdStatus.php | 475 ++ .../BfdSessionInitializationMode.php | 65 + .../Compute/V1/BfdStatus/LocalDiagnostic.php | 100 + .../Cloud/Compute/V1/BfdStatus/LocalState.php | 75 + .../Compute/V1/BfdStatusPacketCounts.php | 208 + .../src/Google/Cloud/Compute/V1/Binding.php | 199 + .../Compute/V1/BulkInsertDiskRequest.php | 206 + .../Compute/V1/BulkInsertDiskResource.php | 77 + .../Compute/V1/BulkInsertInstanceRequest.php | 206 + .../Compute/V1/BulkInsertInstanceResource.php | 331 + ...tInstanceResourcePerInstanceProperties.php | 121 + .../Compute/V1/BulkInsertOperationStatus.php | 256 + .../V1/BulkInsertOperationStatus/Status.php | 76 + .../V1/BulkInsertRegionDiskRequest.php | 206 + .../V1/BulkInsertRegionInstanceRequest.php | 206 + .../Compute/V1/CacheInvalidationRule.php | 113 + .../Cloud/Compute/V1/CacheKeyPolicy.php | 301 + ...stanceGroupManagerResizeRequestRequest.php | 232 + .../Cloud/Compute/V1/CircuitBreakers.php | 253 + .../V1/CloneRulesFirewallPolicyRequest.php | 168 + ...CloneRulesNetworkFirewallPolicyRequest.php | 204 + ...ulesRegionNetworkFirewallPolicyRequest.php | 240 + .../Google/Cloud/Compute/V1/Commitment.php | 933 +++ .../Cloud/Compute/V1/Commitment/Category.php | 65 + .../Cloud/Compute/V1/Commitment/Plan.php | 65 + .../Cloud/Compute/V1/Commitment/Status.php | 77 + .../Cloud/Compute/V1/Commitment/Type.php | 140 + .../Compute/V1/CommitmentAggregatedList.php | 320 + .../Cloud/Compute/V1/CommitmentList.php | 287 + .../Compute/V1/CommitmentsScopedList.php | 110 + .../src/Google/Cloud/Compute/V1/Condition.php | 255 + .../Google/Cloud/Compute/V1/Condition/Iam.php | 101 + .../Google/Cloud/Compute/V1/Condition/Op.php | 92 + .../Google/Cloud/Compute/V1/Condition/Sys.php | 80 + .../Compute/V1/ConfidentialInstanceConfig.php | 77 + .../Cloud/Compute/V1/ConnectionDraining.php | 77 + .../V1/ConsistentHashLoadBalancerSettings.php | 165 + ...tentHashLoadBalancerSettingsHttpCookie.php | 165 + .../Google/Cloud/Compute/V1/CorsPolicy.php | 335 + ...teInstancesInstanceGroupManagerRequest.php | 242 + ...ancesRegionInstanceGroupManagerRequest.php | 242 + .../Compute/V1/CreateSnapshotDiskRequest.php | 286 + .../V1/CreateSnapshotRegionDiskRequest.php | 242 + .../Compute/V1/CustomerEncryptionKey.php | 252 + .../V1/CustomerEncryptionKeyProtectedDisk.php | 120 + .../src/Google/Cloud/Compute/V1/Data.php | 120 + .../V1/DeleteAccessConfigInstanceRequest.php | 268 + .../Cloud/Compute/V1/DeleteAddressRequest.php | 196 + .../Compute/V1/DeleteAutoscalerRequest.php | 196 + .../Compute/V1/DeleteBackendBucketRequest.php | 160 + .../V1/DeleteBackendServiceRequest.php | 160 + .../Cloud/Compute/V1/DeleteDiskRequest.php | 196 + .../V1/DeleteExternalVpnGatewayRequest.php | 160 + .../V1/DeleteFirewallPolicyRequest.php | 124 + .../Compute/V1/DeleteFirewallRequest.php | 160 + .../V1/DeleteForwardingRuleRequest.php | 196 + .../Compute/V1/DeleteGlobalAddressRequest.php | 160 + .../V1/DeleteGlobalForwardingRuleRequest.php | 160 + ...eleteGlobalNetworkEndpointGroupRequest.php | 160 + .../V1/DeleteGlobalOperationRequest.php | 116 + .../V1/DeleteGlobalOperationResponse.php | 33 + ...leteGlobalOrganizationOperationRequest.php | 124 + ...eteGlobalOrganizationOperationResponse.php | 33 + ...eteGlobalPublicDelegatedPrefixeRequest.php | 160 + .../Compute/V1/DeleteHealthCheckRequest.php | 160 + .../Cloud/Compute/V1/DeleteImageRequest.php | 160 + .../V1/DeleteInstanceGroupManagerRequest.php | 196 + ...stanceGroupManagerResizeRequestRequest.php | 232 + .../Compute/V1/DeleteInstanceGroupRequest.php | 196 + .../Compute/V1/DeleteInstanceRequest.php | 196 + .../V1/DeleteInstanceTemplateRequest.php | 160 + ...teInstancesInstanceGroupManagerRequest.php | 242 + ...ancesRegionInstanceGroupManagerRequest.php | 242 + .../V1/DeleteInstantSnapshotRequest.php | 196 + .../DeleteInterconnectAttachmentRequest.php | 196 + .../Compute/V1/DeleteInterconnectRequest.php | 160 + .../Cloud/Compute/V1/DeleteLicenseRequest.php | 160 + .../Compute/V1/DeleteMachineImageRequest.php | 160 + .../V1/DeleteNetworkAttachmentRequest.php | 196 + ...eleteNetworkEdgeSecurityServiceRequest.php | 196 + .../V1/DeleteNetworkEndpointGroupRequest.php | 196 + .../V1/DeleteNetworkFirewallPolicyRequest.php | 160 + .../Cloud/Compute/V1/DeleteNetworkRequest.php | 160 + .../Compute/V1/DeleteNodeGroupRequest.php | 196 + .../Compute/V1/DeleteNodeTemplateRequest.php | 196 + .../V1/DeleteNodesNodeGroupRequest.php | 242 + .../V1/DeletePacketMirroringRequest.php | 196 + ...anceConfigsInstanceGroupManagerRequest.php | 198 + ...nfigsRegionInstanceGroupManagerRequest.php | 198 + .../DeletePublicAdvertisedPrefixeRequest.php | 160 + .../DeletePublicDelegatedPrefixeRequest.php | 196 + .../V1/DeleteRegionAutoscalerRequest.php | 196 + .../V1/DeleteRegionBackendServiceRequest.php | 196 + .../Compute/V1/DeleteRegionDiskRequest.php | 196 + .../V1/DeleteRegionHealthCheckRequest.php | 196 + .../DeleteRegionHealthCheckServiceRequest.php | 196 + ...eleteRegionInstanceGroupManagerRequest.php | 196 + .../DeleteRegionInstanceTemplateRequest.php | 196 + .../V1/DeleteRegionInstantSnapshotRequest.php | 196 + ...eleteRegionNetworkEndpointGroupRequest.php | 196 + ...leteRegionNetworkFirewallPolicyRequest.php | 196 + ...eleteRegionNotificationEndpointRequest.php | 196 + .../V1/DeleteRegionOperationRequest.php | 152 + .../V1/DeleteRegionOperationResponse.php | 33 + .../V1/DeleteRegionSecurityPolicyRequest.php | 196 + .../V1/DeleteRegionSslCertificateRequest.php | 196 + .../V1/DeleteRegionSslPolicyRequest.php | 196 + .../V1/DeleteRegionTargetHttpProxyRequest.php | 196 + .../DeleteRegionTargetHttpsProxyRequest.php | 196 + .../V1/DeleteRegionTargetTcpProxyRequest.php | 196 + .../Compute/V1/DeleteRegionUrlMapRequest.php | 196 + .../Compute/V1/DeleteReservationRequest.php | 196 + .../V1/DeleteResourcePolicyRequest.php | 196 + .../Cloud/Compute/V1/DeleteRouteRequest.php | 160 + .../Cloud/Compute/V1/DeleteRouterRequest.php | 196 + .../V1/DeleteSecurityPolicyRequest.php | 160 + .../V1/DeleteServiceAttachmentRequest.php | 196 + ...DeleteSignedUrlKeyBackendBucketRequest.php | 196 + ...eleteSignedUrlKeyBackendServiceRequest.php | 196 + .../Compute/V1/DeleteSnapshotRequest.php | 160 + .../V1/DeleteSslCertificateRequest.php | 160 + .../Compute/V1/DeleteSslPolicyRequest.php | 160 + .../Compute/V1/DeleteStoragePoolRequest.php | 196 + .../Compute/V1/DeleteSubnetworkRequest.php | 196 + .../V1/DeleteTargetGrpcProxyRequest.php | 160 + .../V1/DeleteTargetHttpProxyRequest.php | 160 + .../V1/DeleteTargetHttpsProxyRequest.php | 160 + .../V1/DeleteTargetInstanceRequest.php | 196 + .../Compute/V1/DeleteTargetPoolRequest.php | 196 + .../V1/DeleteTargetSslProxyRequest.php | 160 + .../V1/DeleteTargetTcpProxyRequest.php | 160 + .../V1/DeleteTargetVpnGatewayRequest.php | 196 + .../Cloud/Compute/V1/DeleteUrlMapRequest.php | 160 + .../Compute/V1/DeleteVpnGatewayRequest.php | 196 + .../Compute/V1/DeleteVpnTunnelRequest.php | 196 + .../Compute/V1/DeleteZoneOperationRequest.php | 152 + .../V1/DeleteZoneOperationResponse.php | 33 + .../src/Google/Cloud/Compute/V1/Denied.php | 110 + .../Compute/V1/DeprecateImageRequest.php | 206 + .../Cloud/Compute/V1/DeprecationStatus.php | 257 + .../Compute/V1/DeprecationStatus/State.php | 70 + .../Compute/V1/DetachDiskInstanceRequest.php | 232 + ...ointsGlobalNetworkEndpointGroupRequest.php | 206 + ...rkEndpointsNetworkEndpointGroupRequest.php | 242 + ...ointsRegionNetworkEndpointGroupRequest.php | 242 + .../V1/DisableXpnHostProjectRequest.php | 124 + .../V1/DisableXpnResourceProjectRequest.php | 170 + .../src/Google/Cloud/Compute/V1/Disk.php | 2117 ++++++ .../Cloud/Compute/V1/Disk/Architecture.php | 71 + .../Google/Cloud/Compute/V1/Disk/Status.php | 92 + .../Cloud/Compute/V1/DiskAggregatedList.php | 320 + .../Cloud/Compute/V1/DiskAsyncReplication.php | 208 + .../Compute/V1/DiskAsyncReplicationList.php | 69 + .../Compute/V1/DiskInstantiationConfig.php | 213 + .../InstantiateFrom.php | 103 + .../src/Google/Cloud/Compute/V1/DiskList.php | 287 + .../Cloud/Compute/V1/DiskMoveRequest.php | 120 + .../Google/Cloud/Compute/V1/DiskParams.php | 67 + .../Cloud/Compute/V1/DiskResourceStatus.php | 103 + ...skResourceStatusAsyncReplicationStatus.php | 80 + .../State.php | 89 + .../src/Google/Cloud/Compute/V1/DiskType.php | 517 ++ .../Compute/V1/DiskTypeAggregatedList.php | 320 + .../Google/Cloud/Compute/V1/DiskTypeList.php | 287 + .../Cloud/Compute/V1/DiskTypesScopedList.php | 110 + .../V1/DisksAddResourcePoliciesRequest.php | 66 + .../V1/DisksRemoveResourcePoliciesRequest.php | 66 + .../Cloud/Compute/V1/DisksResizeRequest.php | 76 + .../Cloud/Compute/V1/DisksScopedList.php | 110 + .../V1/DisksStartAsyncReplicationRequest.php | 76 + ...DisksStopGroupAsyncReplicationResource.php | 77 + .../Google/Cloud/Compute/V1/DisplayDevice.php | 77 + .../Cloud/Compute/V1/DistributionPolicy.php | 114 + .../V1/DistributionPolicy/TargetShape.php | 78 + .../DistributionPolicyZoneConfiguration.php | 76 + .../src/Google/Cloud/Compute/V1/Duration.php | 121 + .../V1/EnableXpnHostProjectRequest.php | 124 + .../V1/EnableXpnResourceProjectRequest.php | 170 + .../src/Google/Cloud/Compute/V1/Error.php | 67 + .../Google/Cloud/Compute/V1/ErrorDetails.php | 180 + .../src/Google/Cloud/Compute/V1/ErrorInfo.php | 155 + .../src/Google/Cloud/Compute/V1/Errors.php | 198 + .../Compute/V1/ExchangedPeeringRoute.php | 256 + .../Compute/V1/ExchangedPeeringRoute/Type.php | 71 + .../Compute/V1/ExchangedPeeringRoutesList.php | 286 + .../V1/ExpandIpCidrRangeSubnetworkRequest.php | 242 + .../src/Google/Cloud/Compute/V1/Expr.php | 209 + .../Cloud/Compute/V1/ExternalVpnGateway.php | 457 ++ .../V1/ExternalVpnGateway/RedundancyType.php | 71 + .../V1/ExternalVpnGatewayInterface.php | 165 + .../Compute/V1/ExternalVpnGatewayList.php | 324 + .../Cloud/Compute/V1/FileContentBuffer.php | 124 + .../Compute/V1/FileContentBuffer/FileType.php | 65 + .../src/Google/Cloud/Compute/V1/Firewall.php | 793 +++ .../Cloud/Compute/V1/Firewall/Direction.php | 64 + .../Google/Cloud/Compute/V1/FirewallList.php | 287 + .../Cloud/Compute/V1/FirewallLogConfig.php | 125 + .../Compute/V1/FirewallLogConfig/Metadata.php | 60 + ...rewallPoliciesListAssociationsResponse.php | 110 + .../Cloud/Compute/V1/FirewallPolicy.php | 673 ++ .../Compute/V1/FirewallPolicyAssociation.php | 252 + .../Cloud/Compute/V1/FirewallPolicyList.php | 242 + .../Cloud/Compute/V1/FirewallPolicyRule.php | 667 ++ .../V1/FirewallPolicyRule/Direction.php | 60 + .../Compute/V1/FirewallPolicyRuleMatcher.php | 441 ++ .../FirewallPolicyRuleMatcherLayer4Config.php | 110 + .../V1/FirewallPolicyRuleSecureTag.php | 124 + .../V1/FirewallPolicyRuleSecureTag/State.php | 60 + .../Cloud/Compute/V1/FixedOrPercent.php | 165 + .../Cloud/Compute/V1/ForwardingRule.php | 1543 +++++ .../V1/ForwardingRule/IPProtocolEnum.php | 85 + .../Compute/V1/ForwardingRule/IpVersion.php | 65 + .../V1/ForwardingRule/LoadBalancingScheme.php | 80 + .../Compute/V1/ForwardingRule/NetworkTier.php | 78 + .../V1/ForwardingRule/PscConnectionStatus.php | 89 + .../V1/ForwardingRuleAggregatedList.php | 320 + .../Cloud/Compute/V1/ForwardingRuleList.php | 287 + .../Compute/V1/ForwardingRuleReference.php | 69 + ...ardingRuleServiceDirectoryRegistration.php | 165 + .../Compute/V1/ForwardingRulesScopedList.php | 110 + .../Cloud/Compute/V1/GRPCHealthCheck.php | 212 + .../V1/GRPCHealthCheck/PortSpecification.php | 71 + .../Compute/V1/GetAcceleratorTypeRequest.php | 152 + .../Cloud/Compute/V1/GetAddressRequest.php | 152 + .../GetAssociationFirewallPolicyRequest.php | 124 + ...ssociationNetworkFirewallPolicyRequest.php | 160 + ...tionRegionNetworkFirewallPolicyRequest.php | 196 + .../Cloud/Compute/V1/GetAutoscalerRequest.php | 152 + .../Compute/V1/GetBackendBucketRequest.php | 116 + .../Compute/V1/GetBackendServiceRequest.php | 116 + .../V1/GetDiagnosticsInterconnectRequest.php | 116 + .../Cloud/Compute/V1/GetDiskRequest.php | 152 + .../Cloud/Compute/V1/GetDiskTypeRequest.php | 152 + .../GetEffectiveFirewallsInstanceRequest.php | 188 + .../GetEffectiveFirewallsNetworkRequest.php | 116 + ...allsRegionNetworkFirewallPolicyRequest.php | 152 + .../V1/GetExternalVpnGatewayRequest.php | 116 + .../Compute/V1/GetFirewallPolicyRequest.php | 80 + .../Cloud/Compute/V1/GetFirewallRequest.php | 116 + .../Compute/V1/GetForwardingRuleRequest.php | 152 + .../Compute/V1/GetFromFamilyImageRequest.php | 116 + .../Compute/V1/GetGlobalAddressRequest.php | 116 + .../V1/GetGlobalForwardingRuleRequest.php | 116 + .../GetGlobalNetworkEndpointGroupRequest.php | 116 + .../Compute/V1/GetGlobalOperationRequest.php | 116 + .../GetGlobalOrganizationOperationRequest.php | 124 + ...GetGlobalPublicDelegatedPrefixeRequest.php | 116 + .../V1/GetGuestAttributesInstanceRequest.php | 240 + .../V1/GetHealthBackendServiceRequest.php | 155 + .../Compute/V1/GetHealthCheckRequest.php | 116 + .../GetHealthRegionBackendServiceRequest.php | 191 + .../Compute/V1/GetHealthTargetPoolRequest.php | 198 + .../V1/GetIamPolicyBackendBucketRequest.php | 160 + .../V1/GetIamPolicyBackendServiceRequest.php | 160 + .../Compute/V1/GetIamPolicyDiskRequest.php | 196 + .../V1/GetIamPolicyFirewallPolicyRequest.php | 124 + .../Compute/V1/GetIamPolicyImageRequest.php | 160 + .../V1/GetIamPolicyInstanceRequest.php | 196 + .../GetIamPolicyInstanceTemplateRequest.php | 160 + .../V1/GetIamPolicyInstantSnapshotRequest.php | 196 + .../Compute/V1/GetIamPolicyLicenseRequest.php | 160 + .../V1/GetIamPolicyMachineImageRequest.php | 160 + .../GetIamPolicyNetworkAttachmentRequest.php | 196 + ...tIamPolicyNetworkFirewallPolicyRequest.php | 160 + .../V1/GetIamPolicyNodeGroupRequest.php | 196 + .../V1/GetIamPolicyNodeTemplateRequest.php | 196 + ...etIamPolicyRegionBackendServiceRequest.php | 196 + .../V1/GetIamPolicyRegionDiskRequest.php | 196 + ...tIamPolicyRegionInstantSnapshotRequest.php | 196 + ...licyRegionNetworkFirewallPolicyRequest.php | 196 + .../V1/GetIamPolicyReservationRequest.php | 196 + .../V1/GetIamPolicyResourcePolicyRequest.php | 196 + .../GetIamPolicyServiceAttachmentRequest.php | 196 + .../V1/GetIamPolicySnapshotRequest.php | 160 + .../V1/GetIamPolicyStoragePoolRequest.php | 196 + .../V1/GetIamPolicySubnetworkRequest.php | 196 + .../Compute/V1/GetImageFamilyViewRequest.php | 152 + .../Cloud/Compute/V1/GetImageRequest.php | 116 + .../V1/GetInstanceGroupManagerRequest.php | 152 + ...stanceGroupManagerResizeRequestRequest.php | 188 + .../Compute/V1/GetInstanceGroupRequest.php | 152 + .../Cloud/Compute/V1/GetInstanceRequest.php | 152 + .../Compute/V1/GetInstanceSettingRequest.php | 116 + .../Compute/V1/GetInstanceTemplateRequest.php | 116 + .../Compute/V1/GetInstantSnapshotRequest.php | 152 + .../V1/GetInterconnectAttachmentRequest.php | 152 + .../V1/GetInterconnectLocationRequest.php | 116 + .../GetInterconnectRemoteLocationRequest.php | 116 + .../Compute/V1/GetInterconnectRequest.php | 116 + .../Compute/V1/GetLicenseCodeRequest.php | 116 + .../Cloud/Compute/V1/GetLicenseRequest.php | 116 + .../Compute/V1/GetMachineImageRequest.php | 116 + .../Compute/V1/GetMachineTypeRequest.php | 152 + .../V1/GetMacsecConfigInterconnectRequest.php | 116 + .../Compute/V1/GetNatIpInfoRouterRequest.php | 196 + .../V1/GetNatMappingInfoRoutersRequest.php | 416 ++ .../V1/GetNetworkAttachmentRequest.php | 152 + .../GetNetworkEdgeSecurityServiceRequest.php | 152 + .../V1/GetNetworkEndpointGroupRequest.php | 152 + .../V1/GetNetworkFirewallPolicyRequest.php | 116 + .../Cloud/Compute/V1/GetNetworkRequest.php | 116 + .../Cloud/Compute/V1/GetNodeGroupRequest.php | 152 + .../Compute/V1/GetNodeTemplateRequest.php | 152 + .../Cloud/Compute/V1/GetNodeTypeRequest.php | 152 + .../Compute/V1/GetPacketMirroringRequest.php | 152 + .../Cloud/Compute/V1/GetProjectRequest.php | 80 + .../V1/GetPublicAdvertisedPrefixeRequest.php | 116 + .../V1/GetPublicDelegatedPrefixeRequest.php | 152 + .../Compute/V1/GetRegionAutoscalerRequest.php | 152 + .../V1/GetRegionBackendServiceRequest.php | 152 + .../Compute/V1/GetRegionCommitmentRequest.php | 152 + .../Cloud/Compute/V1/GetRegionDiskRequest.php | 152 + .../Compute/V1/GetRegionDiskTypeRequest.php | 152 + .../V1/GetRegionHealthCheckRequest.php | 152 + .../V1/GetRegionHealthCheckServiceRequest.php | 152 + .../GetRegionInstanceGroupManagerRequest.php | 152 + .../V1/GetRegionInstanceGroupRequest.php | 152 + .../V1/GetRegionInstanceTemplateRequest.php | 152 + .../V1/GetRegionInstantSnapshotRequest.php | 152 + .../GetRegionNetworkEndpointGroupRequest.php | 152 + .../GetRegionNetworkFirewallPolicyRequest.php | 152 + .../GetRegionNotificationEndpointRequest.php | 152 + .../Compute/V1/GetRegionOperationRequest.php | 152 + .../Cloud/Compute/V1/GetRegionRequest.php | 116 + .../V1/GetRegionSecurityPolicyRequest.php | 152 + .../V1/GetRegionSslCertificateRequest.php | 152 + .../Compute/V1/GetRegionSslPolicyRequest.php | 152 + .../V1/GetRegionTargetHttpProxyRequest.php | 152 + .../V1/GetRegionTargetHttpsProxyRequest.php | 152 + .../V1/GetRegionTargetTcpProxyRequest.php | 152 + .../Compute/V1/GetRegionUrlMapRequest.php | 152 + .../Compute/V1/GetReservationRequest.php | 152 + .../Compute/V1/GetResourcePolicyRequest.php | 152 + .../Cloud/Compute/V1/GetRouteRequest.php | 116 + .../Cloud/Compute/V1/GetRouterRequest.php | 152 + .../V1/GetRouterStatusRouterRequest.php | 152 + .../V1/GetRuleFirewallPolicyRequest.php | 124 + .../GetRuleNetworkFirewallPolicyRequest.php | 160 + ...RuleRegionNetworkFirewallPolicyRequest.php | 196 + .../V1/GetRuleRegionSecurityPolicyRequest.php | 196 + .../V1/GetRuleSecurityPolicyRequest.php | 160 + .../V1/GetScreenshotInstanceRequest.php | 152 + .../Compute/V1/GetSecurityPolicyRequest.php | 116 + .../V1/GetSerialPortOutputInstanceRequest.php | 240 + .../V1/GetServiceAttachmentRequest.php | 152 + ...hieldedInstanceIdentityInstanceRequest.php | 152 + .../Cloud/Compute/V1/GetSnapshotRequest.php | 116 + .../Compute/V1/GetSnapshotSettingRequest.php | 80 + .../Compute/V1/GetSslCertificateRequest.php | 116 + .../Cloud/Compute/V1/GetSslPolicyRequest.php | 116 + .../Compute/V1/GetStatusVpnGatewayRequest.php | 152 + .../Compute/V1/GetStoragePoolRequest.php | 152 + .../Compute/V1/GetStoragePoolTypeRequest.php | 152 + .../Cloud/Compute/V1/GetSubnetworkRequest.php | 152 + .../Compute/V1/GetTargetGrpcProxyRequest.php | 116 + .../Compute/V1/GetTargetHttpProxyRequest.php | 116 + .../Compute/V1/GetTargetHttpsProxyRequest.php | 116 + .../Compute/V1/GetTargetInstanceRequest.php | 152 + .../Cloud/Compute/V1/GetTargetPoolRequest.php | 152 + .../Compute/V1/GetTargetSslProxyRequest.php | 116 + .../Compute/V1/GetTargetTcpProxyRequest.php | 116 + .../Compute/V1/GetTargetVpnGatewayRequest.php | 152 + .../Cloud/Compute/V1/GetUrlMapRequest.php | 116 + .../Cloud/Compute/V1/GetVpnGatewayRequest.php | 152 + .../Cloud/Compute/V1/GetVpnTunnelRequest.php | 152 + .../Compute/V1/GetXpnHostProjectRequest.php | 80 + .../V1/GetXpnResourcesProjectsRequest.php | 300 + .../Compute/V1/GetZoneOperationRequest.php | 152 + .../Cloud/Compute/V1/GetZoneRequest.php | 116 + .../Compute/V1/GlobalAddressesMoveRequest.php | 120 + ...rkEndpointGroupsAttachEndpointsRequest.php | 66 + ...rkEndpointGroupsDetachEndpointsRequest.php | 66 + .../V1/GlobalOrganizationSetPolicyRequest.php | 154 + .../Compute/V1/GlobalSetLabelsRequest.php | 110 + .../Compute/V1/GlobalSetPolicyRequest.php | 154 + .../Cloud/Compute/V1/GuestAttributes.php | 297 + .../Cloud/Compute/V1/GuestAttributesEntry.php | 165 + .../Cloud/Compute/V1/GuestAttributesValue.php | 60 + .../Cloud/Compute/V1/GuestOsFeature.php | 81 + .../Cloud/Compute/V1/GuestOsFeature/Type.php | 110 + .../Cloud/Compute/V1/HTTP2HealthCheck.php | 348 + .../V1/HTTP2HealthCheck/PortSpecification.php | 71 + .../V1/HTTP2HealthCheck/ProxyHeader.php | 60 + .../Cloud/Compute/V1/HTTPHealthCheck.php | 348 + .../V1/HTTPHealthCheck/PortSpecification.php | 71 + .../V1/HTTPHealthCheck/ProxyHeader.php | 60 + .../Cloud/Compute/V1/HTTPSHealthCheck.php | 348 + .../V1/HTTPSHealthCheck/PortSpecification.php | 71 + .../V1/HTTPSHealthCheck/ProxyHeader.php | 60 + .../Google/Cloud/Compute/V1/HealthCheck.php | 831 +++ .../Cloud/Compute/V1/HealthCheck/Type.php | 85 + .../Cloud/Compute/V1/HealthCheckList.php | 287 + .../Cloud/Compute/V1/HealthCheckLogConfig.php | 77 + .../Cloud/Compute/V1/HealthCheckReference.php | 70 + .../Cloud/Compute/V1/HealthCheckService.php | 535 ++ .../HealthStatusAggregationPolicy.php | 68 + .../V1/HealthCheckServiceReference.php | 70 + .../Compute/V1/HealthCheckServicesList.php | 286 + .../Compute/V1/HealthChecksAggregatedList.php | 320 + .../Compute/V1/HealthChecksScopedList.php | 110 + .../Google/Cloud/Compute/V1/HealthStatus.php | 419 ++ .../Compute/V1/HealthStatus/HealthState.php | 60 + .../Compute/V1/HealthStatus/WeightError.php | 77 + .../V1/HealthStatusForNetworkEndpoint.php | 256 + .../HealthState.php | 78 + .../src/Google/Cloud/Compute/V1/Help.php | 67 + .../src/Google/Cloud/Compute/V1/HelpLink.php | 121 + .../src/Google/Cloud/Compute/V1/HostRule.php | 155 + .../Cloud/Compute/V1/HttpFaultAbort.php | 121 + .../Cloud/Compute/V1/HttpFaultDelay.php | 121 + .../Cloud/Compute/V1/HttpFaultInjection.php | 121 + .../Cloud/Compute/V1/HttpHeaderAction.php | 169 + .../Cloud/Compute/V1/HttpHeaderMatch.php | 385 ++ .../Cloud/Compute/V1/HttpHeaderOption.php | 165 + .../Compute/V1/HttpQueryParameterMatch.php | 209 + .../Cloud/Compute/V1/HttpRedirectAction.php | 301 + .../RedirectResponseCode.php | 85 + .../Cloud/Compute/V1/HttpRetryPolicy.php | 155 + .../Cloud/Compute/V1/HttpRouteAction.php | 374 ++ .../Google/Cloud/Compute/V1/HttpRouteRule.php | 331 + .../Cloud/Compute/V1/HttpRouteRuleMatch.php | 355 + .../src/Google/Cloud/Compute/V1/Image.php | 1491 +++++ .../Cloud/Compute/V1/Image/Architecture.php | 71 + .../Cloud/Compute/V1/Image/SourceType.php | 55 + .../Google/Cloud/Compute/V1/Image/Status.php | 78 + .../Cloud/Compute/V1/ImageFamilyView.php | 76 + .../src/Google/Cloud/Compute/V1/ImageList.php | 287 + .../Cloud/Compute/V1/InitialStateConfig.php | 179 + .../Cloud/Compute/V1/InsertAddressRequest.php | 206 + .../Compute/V1/InsertAutoscalerRequest.php | 206 + .../Compute/V1/InsertBackendBucketRequest.php | 170 + .../V1/InsertBackendServiceRequest.php | 170 + .../Cloud/Compute/V1/InsertDiskRequest.php | 250 + .../V1/InsertExternalVpnGatewayRequest.php | 170 + .../V1/InsertFirewallPolicyRequest.php | 170 + .../Compute/V1/InsertFirewallRequest.php | 170 + .../V1/InsertForwardingRuleRequest.php | 206 + .../Compute/V1/InsertGlobalAddressRequest.php | 170 + .../V1/InsertGlobalForwardingRuleRequest.php | 170 + ...nsertGlobalNetworkEndpointGroupRequest.php | 170 + ...ertGlobalPublicDelegatedPrefixeRequest.php | 170 + .../Compute/V1/InsertHealthCheckRequest.php | 170 + .../Cloud/Compute/V1/InsertImageRequest.php | 214 + .../V1/InsertInstanceGroupManagerRequest.php | 206 + ...stanceGroupManagerResizeRequestRequest.php | 242 + .../Compute/V1/InsertInstanceGroupRequest.php | 206 + .../Compute/V1/InsertInstanceRequest.php | 294 + .../V1/InsertInstanceTemplateRequest.php | 170 + .../V1/InsertInstantSnapshotRequest.php | 206 + .../InsertInterconnectAttachmentRequest.php | 250 + .../Compute/V1/InsertInterconnectRequest.php | 170 + .../Cloud/Compute/V1/InsertLicenseRequest.php | 170 + .../Compute/V1/InsertMachineImageRequest.php | 214 + .../V1/InsertNetworkAttachmentRequest.php | 206 + ...nsertNetworkEdgeSecurityServiceRequest.php | 250 + .../V1/InsertNetworkEndpointGroupRequest.php | 206 + .../V1/InsertNetworkFirewallPolicyRequest.php | 170 + .../Cloud/Compute/V1/InsertNetworkRequest.php | 170 + .../Compute/V1/InsertNodeGroupRequest.php | 242 + .../Compute/V1/InsertNodeTemplateRequest.php | 206 + .../V1/InsertPacketMirroringRequest.php | 206 + .../InsertPublicAdvertisedPrefixeRequest.php | 170 + .../InsertPublicDelegatedPrefixeRequest.php | 206 + .../V1/InsertRegionAutoscalerRequest.php | 206 + .../V1/InsertRegionBackendServiceRequest.php | 206 + .../V1/InsertRegionCommitmentRequest.php | 206 + .../Compute/V1/InsertRegionDiskRequest.php | 250 + .../V1/InsertRegionHealthCheckRequest.php | 206 + .../InsertRegionHealthCheckServiceRequest.php | 206 + ...nsertRegionInstanceGroupManagerRequest.php | 206 + .../InsertRegionInstanceTemplateRequest.php | 206 + .../V1/InsertRegionInstantSnapshotRequest.php | 206 + ...nsertRegionNetworkEndpointGroupRequest.php | 206 + ...sertRegionNetworkFirewallPolicyRequest.php | 206 + ...nsertRegionNotificationEndpointRequest.php | 206 + .../V1/InsertRegionSecurityPolicyRequest.php | 250 + .../V1/InsertRegionSslCertificateRequest.php | 206 + .../V1/InsertRegionSslPolicyRequest.php | 206 + .../V1/InsertRegionTargetHttpProxyRequest.php | 206 + .../InsertRegionTargetHttpsProxyRequest.php | 206 + .../V1/InsertRegionTargetTcpProxyRequest.php | 206 + .../Compute/V1/InsertRegionUrlMapRequest.php | 206 + .../Compute/V1/InsertReservationRequest.php | 206 + .../V1/InsertResourcePolicyRequest.php | 206 + .../Cloud/Compute/V1/InsertRouteRequest.php | 170 + .../Cloud/Compute/V1/InsertRouterRequest.php | 206 + .../V1/InsertSecurityPolicyRequest.php | 214 + .../V1/InsertServiceAttachmentRequest.php | 206 + .../Compute/V1/InsertSnapshotRequest.php | 170 + .../V1/InsertSslCertificateRequest.php | 170 + .../Compute/V1/InsertSslPolicyRequest.php | 170 + .../Compute/V1/InsertStoragePoolRequest.php | 206 + .../Compute/V1/InsertSubnetworkRequest.php | 206 + .../V1/InsertTargetGrpcProxyRequest.php | 170 + .../V1/InsertTargetHttpProxyRequest.php | 170 + .../V1/InsertTargetHttpsProxyRequest.php | 170 + .../V1/InsertTargetInstanceRequest.php | 206 + .../Compute/V1/InsertTargetPoolRequest.php | 206 + .../V1/InsertTargetSslProxyRequest.php | 170 + .../V1/InsertTargetTcpProxyRequest.php | 170 + .../V1/InsertTargetVpnGatewayRequest.php | 206 + .../Cloud/Compute/V1/InsertUrlMapRequest.php | 170 + .../Compute/V1/InsertVpnGatewayRequest.php | 206 + .../Compute/V1/InsertVpnTunnelRequest.php | 206 + .../src/Google/Cloud/Compute/V1/Instance.php | 1981 ++++++ .../V1/Instance/KeyRevocationActionType.php | 71 + .../V1/Instance/PrivateIpv6GoogleAccess.php | 71 + .../Cloud/Compute/V1/Instance/Status.php | 120 + .../Compute/V1/InstanceAggregatedList.php | 320 + .../Compute/V1/InstanceConsumptionData.php | 120 + .../Compute/V1/InstanceConsumptionInfo.php | 208 + .../Google/Cloud/Compute/V1/InstanceGroup.php | 595 ++ .../V1/InstanceGroupAggregatedList.php | 320 + .../Cloud/Compute/V1/InstanceGroupList.php | 287 + .../Cloud/Compute/V1/InstanceGroupManager.php | 1097 +++ .../ListManagedInstancesResults.php | 64 + .../V1/InstanceGroupManagerActionsSummary.php | 604 ++ .../V1/InstanceGroupManagerAggregatedList.php | 320 + ...InstanceGroupManagerAllInstancesConfig.php | 76 + .../InstanceGroupManagerAutoHealingPolicy.php | 120 + ...nceGroupManagerInstanceLifecyclePolicy.php | 128 + .../DefaultActionOnFailure.php | 64 + .../ForceUpdateOnRepair.php | 60 + .../Compute/V1/InstanceGroupManagerList.php | 287 + .../V1/InstanceGroupManagerResizeRequest.php | 565 ++ .../State.php | 92 + ...nstanceGroupManagerResizeRequestStatus.php | 120 + ...pManagerResizeRequestStatusLastAttempt.php | 76 + ...GroupManagerResizeRequestsListResponse.php | 287 + .../Compute/V1/InstanceGroupManagerStatus.php | 252 + ...ceGroupManagerStatusAllInstancesConfig.php | 120 + .../V1/InstanceGroupManagerStatusStateful.php | 120 + ...anagerStatusStatefulPerInstanceConfigs.php | 76 + ...nstanceGroupManagerStatusVersionTarget.php | 76 + .../V1/InstanceGroupManagerUpdatePolicy.php | 360 + .../InstanceRedistributionType.php | 53 + .../MinimalAction.php | 55 + .../MostDisruptiveAllowedAction.php | 55 + .../ReplacementMethod.php | 64 + .../InstanceGroupManagerUpdatePolicy/Type.php | 59 + .../V1/InstanceGroupManagerVersion.php | 164 + ...ceGroupManagersAbandonInstancesRequest.php | 66 + ...stanceGroupManagersApplyUpdatesRequest.php | 207 + .../MinimalAction.php | 55 + .../MostDisruptiveAllowedAction.php | 55 + ...nceGroupManagersCreateInstancesRequest.php | 67 + ...nceGroupManagersDeleteInstancesRequest.php | 110 + ...oupManagersDeletePerInstanceConfigsReq.php | 67 + ...nstanceGroupManagersListErrorsResponse.php | 110 + ...upManagersListManagedInstancesResponse.php | 110 + ...roupManagersListPerInstanceConfigsResp.php | 154 + ...roupManagersPatchPerInstanceConfigsReq.php | 67 + ...eGroupManagersRecreateInstancesRequest.php | 66 + .../V1/InstanceGroupManagersScopedList.php | 110 + ...roupManagersSetInstanceTemplateRequest.php | 76 + ...anceGroupManagersSetTargetPoolsRequest.php | 110 + ...oupManagersUpdatePerInstanceConfigsReq.php | 67 + .../V1/InstanceGroupsAddInstancesRequest.php | 66 + .../V1/InstanceGroupsListInstances.php | 286 + .../V1/InstanceGroupsListInstancesRequest.php | 80 + .../InstanceState.php | 64 + .../InstanceGroupsRemoveInstancesRequest.php | 66 + .../Compute/V1/InstanceGroupsScopedList.php | 110 + .../V1/InstanceGroupsSetNamedPortsRequest.php | 110 + .../Google/Cloud/Compute/V1/InstanceList.php | 287 + .../Compute/V1/InstanceListReferrers.php | 287 + .../Compute/V1/InstanceManagedByIgmError.php | 164 + ...ManagedByIgmErrorInstanceActionDetails.php | 168 + .../Action.php | 141 + ...eManagedByIgmErrorManagedInstanceError.php | 120 + .../Cloud/Compute/V1/InstanceMoveRequest.php | 120 + .../Cloud/Compute/V1/InstanceParams.php | 67 + .../Cloud/Compute/V1/InstanceProperties.php | 894 +++ .../KeyRevocationActionType.php | 71 + .../PrivateIpv6GoogleAccess.php | 71 + .../Compute/V1/InstancePropertiesPatch.php | 101 + .../Cloud/Compute/V1/InstanceReference.php | 76 + .../Cloud/Compute/V1/InstanceSettings.php | 209 + .../Compute/V1/InstanceSettingsMetadata.php | 110 + .../Cloud/Compute/V1/InstanceTemplate.php | 473 ++ .../V1/InstanceTemplateAggregatedList.php | 287 + .../Cloud/Compute/V1/InstanceTemplateList.php | 287 + .../V1/InstanceTemplatesScopedList.php | 110 + .../Compute/V1/InstanceWithNamedPorts.php | 158 + .../V1/InstanceWithNamedPorts/Status.php | 120 + .../InstancesAddResourcePoliciesRequest.php | 66 + .../InstancesBulkInsertOperationMetadata.php | 66 + ...InstancesGetEffectiveFirewallsResponse.php | 100 + ...rewallsResponseEffectiveFirewallPolicy.php | 246 + .../Type.php | 70 + ...InstancesRemoveResourcePoliciesRequest.php | 66 + .../Cloud/Compute/V1/InstancesScopedList.php | 110 + .../Compute/V1/InstancesSetLabelsRequest.php | 103 + .../InstancesSetMachineResourcesRequest.php | 66 + .../V1/InstancesSetMachineTypeRequest.php | 76 + .../V1/InstancesSetMinCpuPlatformRequest.php | 76 + .../Compute/V1/InstancesSetNameRequest.php | 120 + .../V1/InstancesSetSecurityPolicyRequest.php | 110 + .../V1/InstancesSetServiceAccountRequest.php | 110 + ...InstancesStartWithEncryptionKeyRequest.php | 66 + .../Cloud/Compute/V1/InstantSnapshot.php | 867 +++ .../V1/InstantSnapshot/Architecture.php | 71 + .../Compute/V1/InstantSnapshot/Status.php | 85 + .../V1/InstantSnapshotAggregatedList.php | 320 + .../Cloud/Compute/V1/InstantSnapshotList.php | 287 + .../V1/InstantSnapshotResourceStatus.php | 76 + .../Compute/V1/InstantSnapshotsScopedList.php | 110 + .../Cloud/Compute/V1/Int64RangeMatch.php | 121 + .../Google/Cloud/Compute/V1/Interconnect.php | 1317 ++++ .../V1/Interconnect/AvailableFeatures.php | 52 + .../V1/Interconnect/InterconnectType.php | 71 + .../Compute/V1/Interconnect/LinkType.php | 64 + .../V1/Interconnect/OperationalStatus.php | 64 + .../V1/Interconnect/RequestedFeatures.php | 52 + .../Cloud/Compute/V1/Interconnect/State.php | 64 + .../Compute/V1/InterconnectAttachment.php | 1781 +++++ .../V1/InterconnectAttachment/Bandwidth.php | 134 + .../EdgeAvailabilityDomain.php | 65 + .../V1/InterconnectAttachment/Encryption.php | 64 + .../OperationalStatus.php | 64 + .../V1/InterconnectAttachment/StackType.php | 64 + .../V1/InterconnectAttachment/State.php | 97 + .../V1/InterconnectAttachment/Type.php | 71 + .../InterconnectAttachmentAggregatedList.php | 320 + ...nectAttachmentConfigurationConstraints.php | 114 + .../BgpMd5.php | 71 + ...onfigurationConstraintsBgpPeerASNRange.php | 106 + .../Compute/V1/InterconnectAttachmentList.php | 287 + .../InterconnectAttachmentPartnerMetadata.php | 165 + .../V1/InterconnectAttachmentPrivateInfo.php | 77 + .../V1/InterconnectAttachmentsScopedList.php | 110 + .../Compute/V1/InterconnectCircuitInfo.php | 165 + .../Compute/V1/InterconnectDiagnostics.php | 241 + .../BundleAggregationType.php | 64 + .../BundleOperationalStatus.php | 64 + .../V1/InterconnectDiagnosticsARPEntry.php | 121 + .../InterconnectDiagnosticsLinkLACPStatus.php | 168 + .../State.php | 64 + ...nterconnectDiagnosticsLinkOpticalPower.php | 124 + .../State.php | 85 + .../V1/InterconnectDiagnosticsLinkStatus.php | 371 + .../OperationalStatus.php | 64 + .../InterconnectDiagnosticsMacsecStatus.php | 121 + .../Cloud/Compute/V1/InterconnectList.php | 287 + .../Cloud/Compute/V1/InterconnectLocation.php | 811 +++ .../AvailableFeatures.php | 56 + .../AvailableLinkTypes.php | 63 + .../V1/InterconnectLocation/Continent.php | 100 + .../V1/InterconnectLocation/Status.php | 64 + .../Compute/V1/InterconnectLocationList.php | 287 + .../V1/InterconnectLocationRegionInfo.php | 169 + .../LocationPresence.php | 82 + .../Cloud/Compute/V1/InterconnectMacsec.php | 111 + .../Compute/V1/InterconnectMacsecConfig.php | 67 + .../InterconnectMacsecConfigPreSharedKey.php | 209 + .../V1/InterconnectMacsecPreSharedKey.php | 121 + .../V1/InterconnectOutageNotification.php | 387 ++ .../IssueType.php | 78 + .../InterconnectOutageNotification/Source.php | 64 + .../InterconnectOutageNotification/State.php | 85 + .../Compute/V1/InterconnectRemoteLocation.php | 915 +++ .../InterconnectRemoteLocation/Continent.php | 75 + .../V1/InterconnectRemoteLocation/Lacp.php | 64 + .../V1/InterconnectRemoteLocation/Status.php | 64 + .../InterconnectRemoteLocationConstraints.php | 172 + .../PortPairRemoteLocation.php | 64 + .../PortPairVlan.php | 64 + ...teLocationConstraintsSubnetLengthRange.php | 106 + .../V1/InterconnectRemoteLocationList.php | 287 + ...nectRemoteLocationPermittedConnections.php | 76 + .../InterconnectsGetDiagnosticsResponse.php | 70 + .../InterconnectsGetMacsecConfigResponse.php | 114 + .../V1/InvalidateCacheUrlMapRequest.php | 206 + .../src/Google/Cloud/Compute/V1/Items.php | 121 + .../src/Google/Cloud/Compute/V1/License.php | 466 ++ .../Google/Cloud/Compute/V1/LicenseCode.php | 423 ++ .../Cloud/Compute/V1/LicenseCode/State.php | 83 + .../Compute/V1/LicenseCodeLicenseAlias.php | 120 + .../Compute/V1/LicenseResourceCommitment.php | 165 + .../V1/LicenseResourceRequirements.php | 120 + .../Cloud/Compute/V1/LicensesListResponse.php | 242 + .../V1/ListAcceleratorTypesRequest.php | 336 + .../Cloud/Compute/V1/ListAddressesRequest.php | 336 + .../ListAssociationsFirewallPolicyRequest.php | 77 + .../Compute/V1/ListAutoscalersRequest.php | 336 + ...ilableFeaturesRegionSslPoliciesRequest.php | 336 + ...istAvailableFeaturesSslPoliciesRequest.php | 300 + .../Compute/V1/ListBackendBucketsRequest.php | 300 + .../Compute/V1/ListBackendServicesRequest.php | 300 + .../Cloud/Compute/V1/ListDiskTypesRequest.php | 336 + .../Cloud/Compute/V1/ListDisksRequest.php | 336 + .../V1/ListDisksStoragePoolsRequest.php | 372 ++ ...ListErrorsInstanceGroupManagersRequest.php | 372 ++ ...rorsRegionInstanceGroupManagersRequest.php | 372 ++ .../V1/ListExternalVpnGatewaysRequest.php | 300 + .../V1/ListFirewallPoliciesRequest.php | 297 + .../Cloud/Compute/V1/ListFirewallsRequest.php | 300 + .../Compute/V1/ListForwardingRulesRequest.php | 336 + .../Compute/V1/ListGlobalAddressesRequest.php | 300 + .../V1/ListGlobalForwardingRulesRequest.php | 300 + ...ListGlobalNetworkEndpointGroupsRequest.php | 300 + .../V1/ListGlobalOperationsRequest.php | 300 + ...istGlobalOrganizationOperationsRequest.php | 297 + ...stGlobalPublicDelegatedPrefixesRequest.php | 300 + .../Compute/V1/ListHealthChecksRequest.php | 300 + .../Cloud/Compute/V1/ListImagesRequest.php | 300 + ...tanceGroupManagerResizeRequestsRequest.php | 372 ++ .../V1/ListInstanceGroupManagersRequest.php | 336 + .../Compute/V1/ListInstanceGroupsRequest.php | 336 + .../V1/ListInstanceTemplatesRequest.php | 300 + .../V1/ListInstancesInstanceGroupsRequest.php | 418 ++ ...stInstancesRegionInstanceGroupsRequest.php | 418 ++ .../Cloud/Compute/V1/ListInstancesRequest.php | 336 + .../V1/ListInstantSnapshotsRequest.php | 336 + .../V1/ListInterconnectAttachmentsRequest.php | 336 + .../V1/ListInterconnectLocationsRequest.php | 300 + ...ListInterconnectRemoteLocationsRequest.php | 300 + .../Compute/V1/ListInterconnectsRequest.php | 300 + .../Cloud/Compute/V1/ListLicensesRequest.php | 300 + .../Compute/V1/ListMachineImagesRequest.php | 300 + .../Compute/V1/ListMachineTypesRequest.php | 336 + ...dInstancesInstanceGroupManagersRequest.php | 372 ++ ...ncesRegionInstanceGroupManagersRequest.php | 372 ++ .../V1/ListNetworkAttachmentsRequest.php | 336 + .../V1/ListNetworkEndpointGroupsRequest.php | 336 + ...intsGlobalNetworkEndpointGroupsRequest.php | 336 + ...kEndpointsNetworkEndpointGroupsRequest.php | 418 ++ ...intsRegionNetworkEndpointGroupsRequest.php | 372 ++ .../V1/ListNetworkFirewallPoliciesRequest.php | 300 + .../Cloud/Compute/V1/ListNetworksRequest.php | 300 + .../Compute/V1/ListNodeGroupsRequest.php | 336 + .../Compute/V1/ListNodeTemplatesRequest.php | 336 + .../Cloud/Compute/V1/ListNodeTypesRequest.php | 336 + .../Compute/V1/ListNodesNodeGroupsRequest.php | 372 ++ .../V1/ListPacketMirroringsRequest.php | 336 + .../V1/ListPeeringRoutesNetworksRequest.php | 472 ++ .../Direction.php | 64 + ...nceConfigsInstanceGroupManagersRequest.php | 372 ++ ...figsRegionInstanceGroupManagersRequest.php | 372 ++ ...dExpressionSetsSecurityPoliciesRequest.php | 300 + .../ListPublicAdvertisedPrefixesRequest.php | 300 + .../V1/ListPublicDelegatedPrefixesRequest.php | 336 + .../V1/ListReferrersInstancesRequest.php | 372 ++ .../V1/ListRegionAutoscalersRequest.php | 336 + .../V1/ListRegionBackendServicesRequest.php | 336 + .../V1/ListRegionCommitmentsRequest.php | 336 + .../Compute/V1/ListRegionDiskTypesRequest.php | 336 + .../Compute/V1/ListRegionDisksRequest.php | 336 + .../ListRegionHealthCheckServicesRequest.php | 336 + .../V1/ListRegionHealthChecksRequest.php | 336 + ...ListRegionInstanceGroupManagersRequest.php | 336 + .../V1/ListRegionInstanceGroupsRequest.php | 336 + .../V1/ListRegionInstanceTemplatesRequest.php | 336 + .../V1/ListRegionInstantSnapshotsRequest.php | 336 + ...ListRegionNetworkEndpointGroupsRequest.php | 336 + ...stRegionNetworkFirewallPoliciesRequest.php | 336 + ...ListRegionNotificationEndpointsRequest.php | 336 + .../V1/ListRegionOperationsRequest.php | 336 + .../V1/ListRegionSecurityPoliciesRequest.php | 336 + .../V1/ListRegionSslCertificatesRequest.php | 336 + .../V1/ListRegionSslPoliciesRequest.php | 336 + .../V1/ListRegionTargetHttpProxiesRequest.php | 336 + .../ListRegionTargetHttpsProxiesRequest.php | 336 + .../V1/ListRegionTargetTcpProxiesRequest.php | 336 + .../Compute/V1/ListRegionUrlMapsRequest.php | 336 + .../Compute/V1/ListRegionZonesRequest.php | 336 + .../Cloud/Compute/V1/ListRegionsRequest.php | 300 + .../Compute/V1/ListReservationsRequest.php | 336 + .../V1/ListResourcePoliciesRequest.php | 336 + .../Cloud/Compute/V1/ListRoutersRequest.php | 336 + .../Cloud/Compute/V1/ListRoutesRequest.php | 300 + .../V1/ListSecurityPoliciesRequest.php | 300 + .../V1/ListServiceAttachmentsRequest.php | 336 + .../Cloud/Compute/V1/ListSnapshotsRequest.php | 300 + .../Compute/V1/ListSslCertificatesRequest.php | 300 + .../Compute/V1/ListSslPoliciesRequest.php | 300 + .../V1/ListStoragePoolTypesRequest.php | 336 + .../Compute/V1/ListStoragePoolsRequest.php | 336 + .../Compute/V1/ListSubnetworksRequest.php | 336 + .../V1/ListTargetGrpcProxiesRequest.php | 300 + .../V1/ListTargetHttpProxiesRequest.php | 300 + .../V1/ListTargetHttpsProxiesRequest.php | 300 + .../Compute/V1/ListTargetInstancesRequest.php | 336 + .../Compute/V1/ListTargetPoolsRequest.php | 336 + .../V1/ListTargetSslProxiesRequest.php | 300 + .../V1/ListTargetTcpProxiesRequest.php | 300 + .../V1/ListTargetVpnGatewaysRequest.php | 336 + .../Cloud/Compute/V1/ListUrlMapsRequest.php | 300 + .../V1/ListUsableBackendServicesRequest.php | 300 + ...ListUsableRegionBackendServicesRequest.php | 336 + .../V1/ListUsableSubnetworksRequest.php | 300 + .../Compute/V1/ListVpnGatewaysRequest.php | 336 + .../Compute/V1/ListVpnTunnelsRequest.php | 336 + .../V1/ListXpnHostsProjectsRequest.php | 346 + .../Compute/V1/ListZoneOperationsRequest.php | 336 + .../Cloud/Compute/V1/ListZonesRequest.php | 300 + .../src/Google/Cloud/Compute/V1/LocalDisk.php | 164 + .../Cloud/Compute/V1/LocalizedMessage.php | 121 + .../Cloud/Compute/V1/LocationPolicy.php | 115 + .../Compute/V1/LocationPolicy/TargetShape.php | 71 + .../Compute/V1/LocationPolicyLocation.php | 124 + .../V1/LocationPolicyLocation/Preference.php | 71 + .../V1/LocationPolicyLocationConstraints.php | 77 + .../src/Google/Cloud/Compute/V1/LogConfig.php | 165 + .../Compute/V1/LogConfigCloudAuditOptions.php | 125 + .../V1/LogConfigCloudAuditOptions/LogName.php | 71 + .../Compute/V1/LogConfigCounterOptions.php | 155 + .../V1/LogConfigCounterOptionsCustomField.php | 121 + .../Compute/V1/LogConfigDataAccessOptions.php | 81 + .../V1/LogConfigDataAccessOptions/LogMode.php | 64 + .../Google/Cloud/Compute/V1/MachineImage.php | 799 +++ .../Cloud/Compute/V1/MachineImage/Status.php | 75 + .../Cloud/Compute/V1/MachineImageList.php | 287 + .../Google/Cloud/Compute/V1/MachineType.php | 717 ++ .../Compute/V1/MachineTypeAggregatedList.php | 320 + .../Cloud/Compute/V1/MachineTypeList.php | 287 + .../Compute/V1/MachineTypesScopedList.php | 110 + .../Cloud/Compute/V1/ManagedInstance.php | 471 ++ .../V1/ManagedInstance/CurrentAction.php | 130 + .../V1/ManagedInstance/InstanceStatus.php | 119 + .../V1/ManagedInstanceInstanceHealth.php | 124 + .../DetailedHealthState.php | 85 + .../Compute/V1/ManagedInstanceLastAttempt.php | 76 + .../Compute/V1/ManagedInstanceVersion.php | 120 + .../src/Google/Cloud/Compute/V1/Metadata.php | 155 + .../Cloud/Compute/V1/MetadataFilter.php | 115 + .../V1/MetadataFilter/FilterMatchCriteria.php | 71 + .../Compute/V1/MetadataFilterLabelMatch.php | 121 + .../Cloud/Compute/V1/MoveAddressRequest.php | 242 + .../Compute/V1/MoveDiskProjectRequest.php | 170 + .../Compute/V1/MoveFirewallPolicyRequest.php | 160 + .../Compute/V1/MoveGlobalAddressRequest.php | 206 + .../Compute/V1/MoveInstanceProjectRequest.php | 170 + .../src/Google/Cloud/Compute/V1/NamedPort.php | 121 + .../src/Google/Cloud/Compute/V1/NatIpInfo.php | 111 + .../Compute/V1/NatIpInfoNatIpInfoMapping.php | 173 + .../V1/NatIpInfoNatIpInfoMapping/Mode.php | 60 + .../V1/NatIpInfoNatIpInfoMapping/Usage.php | 60 + .../Cloud/Compute/V1/NatIpInfoResponse.php | 66 + .../src/Google/Cloud/Compute/V1/Network.php | 809 +++ .../NetworkFirewallPolicyEnforcementOrder.php | 60 + .../Cloud/Compute/V1/NetworkAttachment.php | 657 ++ .../ConnectionPreference.php | 64 + .../V1/NetworkAttachmentAggregatedList.php | 280 + .../V1/NetworkAttachmentConnectedEndpoint.php | 335 + .../Status.php | 90 + .../Compute/V1/NetworkAttachmentList.php | 279 + .../V1/NetworkAttachmentsScopedList.php | 110 + .../Compute/V1/NetworkEdgeSecurityService.php | 473 ++ ...tworkEdgeSecurityServiceAggregatedList.php | 357 + .../NetworkEdgeSecurityServicesScopedList.php | 110 + .../Cloud/Compute/V1/NetworkEndpoint.php | 243 + .../Cloud/Compute/V1/NetworkEndpointGroup.php | 856 +++ .../NetworkEndpointType.php | 99 + .../V1/NetworkEndpointGroupAggregatedList.php | 320 + .../V1/NetworkEndpointGroupAppEngine.php | 165 + .../V1/NetworkEndpointGroupCloudFunction.php | 121 + .../V1/NetworkEndpointGroupCloudRun.php | 165 + .../Compute/V1/NetworkEndpointGroupList.php | 286 + .../V1/NetworkEndpointGroupPscData.php | 169 + .../PscConnectionStatus.php | 90 + ...rkEndpointGroupsAttachEndpointsRequest.php | 66 + ...rkEndpointGroupsDetachEndpointsRequest.php | 66 + ...workEndpointGroupsListEndpointsRequest.php | 80 + .../HealthStatus.php | 64 + ...workEndpointGroupsListNetworkEndpoints.php | 242 + .../V1/NetworkEndpointGroupsScopedList.php | 110 + .../V1/NetworkEndpointWithHealthStatus.php | 110 + .../Cloud/Compute/V1/NetworkInterface.php | 719 ++ .../V1/NetworkInterface/Ipv6AccessType.php | 69 + .../Compute/V1/NetworkInterface/NicType.php | 71 + .../Compute/V1/NetworkInterface/StackType.php | 69 + .../Google/Cloud/Compute/V1/NetworkList.php | 287 + .../Cloud/Compute/V1/NetworkPeering.php | 569 ++ .../Compute/V1/NetworkPeering/StackType.php | 64 + .../Cloud/Compute/V1/NetworkPeering/State.php | 64 + .../Compute/V1/NetworkPerformanceConfig.php | 80 + .../TotalEgressBandwidthTier.php | 63 + .../Cloud/Compute/V1/NetworkRoutingConfig.php | 81 + .../V1/NetworkRoutingConfig/RoutingMode.php | 64 + .../Compute/V1/NetworksAddPeeringRequest.php | 208 + .../NetworksGetEffectiveFirewallsResponse.php | 100 + ...rewallsResponseEffectiveFirewallPolicy.php | 246 + .../Type.php | 65 + .../V1/NetworksRemovePeeringRequest.php | 76 + .../V1/NetworksUpdatePeeringRequest.php | 69 + .../src/Google/Cloud/Compute/V1/NodeGroup.php | 779 +++ .../V1/NodeGroup/MaintenanceInterval.php | 64 + .../V1/NodeGroup/MaintenancePolicy.php | 80 + .../Cloud/Compute/V1/NodeGroup/Status.php | 69 + .../Compute/V1/NodeGroupAggregatedList.php | 320 + .../Compute/V1/NodeGroupAutoscalingPolicy.php | 168 + .../V1/NodeGroupAutoscalingPolicy/Mode.php | 76 + .../Google/Cloud/Compute/V1/NodeGroupList.php | 287 + .../Compute/V1/NodeGroupMaintenanceWindow.php | 121 + .../Google/Cloud/Compute/V1/NodeGroupNode.php | 616 ++ .../V1/NodeGroupNode/CpuOvercommitType.php | 65 + .../Cloud/Compute/V1/NodeGroupNode/Status.php | 74 + .../Compute/V1/NodeGroupsAddNodesRequest.php | 76 + .../V1/NodeGroupsDeleteNodesRequest.php | 66 + .../Cloud/Compute/V1/NodeGroupsListNodes.php | 286 + .../NodeGroupsPerformMaintenanceRequest.php | 110 + .../Cloud/Compute/V1/NodeGroupsScopedList.php | 110 + .../V1/NodeGroupsSetNodeTemplateRequest.php | 76 + ...eGroupsSimulateMaintenanceEventRequest.php | 66 + .../Google/Cloud/Compute/V1/NodeTemplate.php | 701 ++ .../V1/NodeTemplate/CpuOvercommitType.php | 65 + .../Cloud/Compute/V1/NodeTemplate/Status.php | 78 + .../Compute/V1/NodeTemplateAggregatedList.php | 320 + .../Cloud/Compute/V1/NodeTemplateList.php | 287 + .../V1/NodeTemplateNodeTypeFlexibility.php | 143 + .../Compute/V1/NodeTemplatesScopedList.php | 110 + .../src/Google/Cloud/Compute/V1/NodeType.php | 561 ++ .../Compute/V1/NodeTypeAggregatedList.php | 320 + .../Google/Cloud/Compute/V1/NodeTypeList.php | 287 + .../Cloud/Compute/V1/NodeTypesScopedList.php | 110 + .../Cloud/Compute/V1/NotificationEndpoint.php | 385 ++ .../V1/NotificationEndpointGrpcSettings.php | 253 + .../Compute/V1/NotificationEndpointList.php | 286 + .../src/Google/Cloud/Compute/V1/Operation.php | 1160 ++++ .../Cloud/Compute/V1/Operation/Status.php | 65 + .../Compute/V1/OperationAggregatedList.php | 320 + .../Google/Cloud/Compute/V1/OperationList.php | 287 + .../Cloud/Compute/V1/OperationsScopedList.php | 110 + .../Cloud/Compute/V1/OutlierDetection.php | 517 ++ .../Cloud/Compute/V1/PacketIntervals.php | 305 + .../Compute/V1/PacketIntervals/Duration.php | 72 + .../Cloud/Compute/V1/PacketIntervals/Type.php | 76 + .../Cloud/Compute/V1/PacketMirroring.php | 609 ++ .../Compute/V1/PacketMirroring/Enable.php | 60 + .../V1/PacketMirroringAggregatedList.php | 321 + .../Compute/V1/PacketMirroringFilter.php | 148 + .../V1/PacketMirroringFilter/Direction.php | 71 + .../V1/PacketMirroringForwardingRuleInfo.php | 120 + .../Cloud/Compute/V1/PacketMirroringList.php | 287 + .../PacketMirroringMirroredResourceInfo.php | 134 + ...roringMirroredResourceInfoInstanceInfo.php | 120 + ...irroringMirroredResourceInfoSubnetInfo.php | 120 + .../Compute/V1/PacketMirroringNetworkInfo.php | 120 + .../Compute/V1/PacketMirroringsScopedList.php | 110 + .../Compute/V1/PatchAutoscalerRequest.php | 250 + .../Compute/V1/PatchBackendBucketRequest.php | 206 + .../Compute/V1/PatchBackendServiceRequest.php | 206 + .../Compute/V1/PatchFirewallPolicyRequest.php | 170 + .../Cloud/Compute/V1/PatchFirewallRequest.php | 206 + .../Compute/V1/PatchForwardingRuleRequest.php | 242 + .../V1/PatchGlobalForwardingRuleRequest.php | 206 + ...tchGlobalPublicDelegatedPrefixeRequest.php | 206 + .../Compute/V1/PatchHealthCheckRequest.php | 206 + .../Cloud/Compute/V1/PatchImageRequest.php | 206 + .../V1/PatchInstanceGroupManagerRequest.php | 242 + .../V1/PatchInstanceSettingRequest.php | 250 + .../V1/PatchInterconnectAttachmentRequest.php | 242 + .../Compute/V1/PatchInterconnectRequest.php | 206 + .../V1/PatchNetworkAttachmentRequest.php | 242 + ...PatchNetworkEdgeSecurityServiceRequest.php | 323 + .../V1/PatchNetworkFirewallPolicyRequest.php | 206 + .../Cloud/Compute/V1/PatchNetworkRequest.php | 206 + .../Compute/V1/PatchNodeGroupRequest.php | 242 + .../V1/PatchPacketMirroringRequest.php | 242 + ...anceConfigsInstanceGroupManagerRequest.php | 242 + ...nfigsRegionInstanceGroupManagerRequest.php | 242 + .../PatchPublicAdvertisedPrefixeRequest.php | 206 + .../V1/PatchPublicDelegatedPrefixeRequest.php | 242 + .../V1/PatchRegionAutoscalerRequest.php | 250 + .../V1/PatchRegionBackendServiceRequest.php | 242 + .../V1/PatchRegionHealthCheckRequest.php | 242 + .../PatchRegionHealthCheckServiceRequest.php | 242 + ...PatchRegionInstanceGroupManagerRequest.php | 242 + ...atchRegionNetworkFirewallPolicyRequest.php | 242 + .../V1/PatchRegionSecurityPolicyRequest.php | 286 + .../V1/PatchRegionSslPolicyRequest.php | 242 + .../V1/PatchRegionTargetHttpsProxyRequest.php | 242 + .../Compute/V1/PatchRegionUrlMapRequest.php | 242 + .../Compute/V1/PatchResourcePolicyRequest.php | 286 + .../Cloud/Compute/V1/PatchRouterRequest.php | 242 + .../V1/PatchRuleFirewallPolicyRequest.php | 214 + .../PatchRuleNetworkFirewallPolicyRequest.php | 250 + ...RuleRegionNetworkFirewallPolicyRequest.php | 286 + .../PatchRuleRegionSecurityPolicyRequest.php | 330 + .../V1/PatchRuleSecurityPolicyRequest.php | 294 + .../Compute/V1/PatchSecurityPolicyRequest.php | 250 + .../V1/PatchServiceAttachmentRequest.php | 242 + .../V1/PatchSnapshotSettingRequest.php | 214 + .../Compute/V1/PatchSslPolicyRequest.php | 206 + .../Compute/V1/PatchSubnetworkRequest.php | 286 + .../V1/PatchTargetGrpcProxyRequest.php | 206 + .../V1/PatchTargetHttpProxyRequest.php | 206 + .../V1/PatchTargetHttpsProxyRequest.php | 206 + .../Cloud/Compute/V1/PatchUrlMapRequest.php | 206 + .../Google/Cloud/Compute/V1/PathMatcher.php | 365 + .../src/Google/Cloud/Compute/V1/PathRule.php | 199 + .../Cloud/Compute/V1/PerInstanceConfig.php | 212 + .../Compute/V1/PerInstanceConfig/Status.php | 92 + .../V1/PerformMaintenanceInstanceRequest.php | 196 + .../V1/PerformMaintenanceNodeGroupRequest.php | 242 + .../src/Google/Cloud/Compute/V1/Policy.php | 260 + .../Cloud/Compute/V1/PreconfiguredWafSet.php | 66 + .../Cloud/Compute/V1/PreservedState.php | 169 + .../V1/PreservedStatePreservedDisk.php | 172 + .../AutoDelete.php | 60 + .../V1/PreservedStatePreservedDisk/Mode.php | 64 + .../V1/PreservedStatePreservedNetworkIp.php | 124 + .../AutoDelete.php | 60 + ...servedStatePreservedNetworkIpIpAddress.php | 120 + .../Cloud/Compute/V1/PreviewRouterRequest.php | 198 + .../src/Google/Cloud/Compute/V1/Project.php | 689 ++ .../Compute/V1/Project/CloudArmorTier.php | 71 + .../Compute/V1/Project/DefaultNetworkTier.php | 78 + .../Cloud/Compute/V1/Project/VmDnsSetting.php | 70 + .../Compute/V1/Project/XpnProjectStatus.php | 60 + .../V1/ProjectsDisableXpnResourceRequest.php | 76 + .../V1/ProjectsEnableXpnResourceRequest.php | 76 + .../Compute/V1/ProjectsGetXpnResources.php | 154 + .../V1/ProjectsListXpnHostsRequest.php | 76 + .../V1/ProjectsSetCloudArmorTierRequest.php | 80 + .../CloudArmorTier.php | 71 + .../ProjectsSetDefaultNetworkTierRequest.php | 80 + .../NetworkTier.php | 78 + .../Compute/V1/PublicAdvertisedPrefix.php | 651 ++ .../ByoipApiVersion.php | 64 + .../V1/PublicAdvertisedPrefix/PdpScope.php | 75 + .../V1/PublicAdvertisedPrefix/Status.php | 113 + .../Compute/V1/PublicAdvertisedPrefixList.php | 286 + ...cAdvertisedPrefixPublicDelegatedPrefix.php | 253 + .../Compute/V1/PublicDelegatedPrefix.php | 739 ++ .../PublicDelegatedPrefix/ByoipApiVersion.php | 64 + .../Compute/V1/PublicDelegatedPrefix/Mode.php | 64 + .../V1/PublicDelegatedPrefix/Status.php | 92 + .../PublicDelegatedPrefixAggregatedList.php | 320 + .../Compute/V1/PublicDelegatedPrefixList.php | 286 + ...elegatedPrefixPublicDelegatedSubPrefix.php | 437 ++ .../Mode.php | 64 + .../Status.php | 60 + .../V1/PublicDelegatedPrefixesScopedList.php | 110 + .../src/Google/Cloud/Compute/V1/Quota.php | 213 + .../Google/Cloud/Compute/V1/Quota/Metric.php | 869 +++ .../Cloud/Compute/V1/QuotaExceededInfo.php | 291 + .../V1/QuotaExceededInfo/RolloutStatus.php | 64 + .../Cloud/Compute/V1/QuotaStatusWarning.php | 159 + .../Compute/V1/QuotaStatusWarning/Code.php | 246 + .../src/Google/Cloud/Compute/V1/RawDisk.php | 169 + .../Compute/V1/RawDisk/ContainerType.php | 55 + ...teInstancesInstanceGroupManagerRequest.php | 242 + ...ancesRegionInstanceGroupManagerRequest.php | 242 + .../src/Google/Cloud/Compute/V1/Reference.php | 209 + .../src/Google/Cloud/Compute/V1/Region.php | 545 ++ .../Google/Cloud/Compute/V1/Region/Status.php | 60 + .../Compute/V1/RegionAddressesMoveRequest.php | 120 + .../Cloud/Compute/V1/RegionAutoscalerList.php | 287 + .../Cloud/Compute/V1/RegionDiskTypeList.php | 286 + .../RegionDisksAddResourcePoliciesRequest.php | 66 + ...gionDisksRemoveResourcePoliciesRequest.php | 66 + .../Compute/V1/RegionDisksResizeRequest.php | 76 + ...egionDisksStartAsyncReplicationRequest.php | 76 + .../Compute/V1/RegionInstanceGroupList.php | 287 + ...nceGroupManagerDeleteInstanceConfigReq.php | 67 + .../V1/RegionInstanceGroupManagerList.php | 287 + ...anceGroupManagerPatchInstanceConfigReq.php | 67 + ...nceGroupManagerUpdateInstanceConfigReq.php | 67 + ...ceGroupManagersAbandonInstancesRequest.php | 66 + ...stanceGroupManagersApplyUpdatesRequest.php | 207 + .../MinimalAction.php | 55 + .../MostDisruptiveAllowedAction.php | 55 + ...nceGroupManagersCreateInstancesRequest.php | 67 + ...nceGroupManagersDeleteInstancesRequest.php | 110 + ...nstanceGroupManagersListErrorsResponse.php | 110 + ...ceGroupManagersListInstanceConfigsResp.php | 154 + ...anceGroupManagersListInstancesResponse.php | 110 + ...onInstanceGroupManagersRecreateRequest.php | 66 + ...anceGroupManagersSetTargetPoolsRequest.php | 110 + ...nstanceGroupManagersSetTemplateRequest.php | 76 + .../V1/RegionInstanceGroupsListInstances.php | 286 + ...gionInstanceGroupsListInstancesRequest.php | 124 + .../InstanceState.php | 64 + ...gionInstanceGroupsSetNamedPortsRequest.php | 110 + .../Google/Cloud/Compute/V1/RegionList.php | 287 + ...rkEndpointGroupsAttachEndpointsRequest.php | 66 + ...rkEndpointGroupsDetachEndpointsRequest.php | 66 + ...lPoliciesGetEffectiveFirewallsResponse.php | 100 + ...rewallsResponseEffectiveFirewallPolicy.php | 202 + .../Type.php | 70 + .../Compute/V1/RegionSetLabelsRequest.php | 110 + .../Compute/V1/RegionSetPolicyRequest.php | 154 + ...tHttpsProxiesSetSslCertificatesRequest.php | 66 + .../V1/RegionUrlMapsValidateRequest.php | 76 + ...RemoveAssociationFirewallPolicyRequest.php | 168 + ...ssociationNetworkFirewallPolicyRequest.php | 204 + ...tionRegionNetworkFirewallPolicyRequest.php | 240 + .../V1/RemoveHealthCheckTargetPoolRequest.php | 242 + .../V1/RemoveInstanceTargetPoolRequest.php | 242 + .../RemoveInstancesInstanceGroupRequest.php | 242 + .../V1/RemovePeeringNetworkRequest.php | 206 + .../V1/RemoveResourcePoliciesDiskRequest.php | 242 + .../RemoveResourcePoliciesInstanceRequest.php | 242 + ...emoveResourcePoliciesRegionDiskRequest.php | 242 + .../V1/RemoveRuleFirewallPolicyRequest.php | 168 + ...RemoveRuleNetworkFirewallPolicyRequest.php | 204 + ...RuleRegionNetworkFirewallPolicyRequest.php | 240 + .../RemoveRuleRegionSecurityPolicyRequest.php | 196 + .../V1/RemoveRuleSecurityPolicyRequest.php | 160 + .../Cloud/Compute/V1/RequestMirrorPolicy.php | 77 + .../Google/Cloud/Compute/V1/Reservation.php | 731 ++ .../Cloud/Compute/V1/Reservation/Status.php | 83 + .../Cloud/Compute/V1/ReservationAffinity.php | 159 + .../ConsumeReservationType.php | 76 + .../Compute/V1/ReservationAggregatedList.php | 321 + .../Cloud/Compute/V1/ReservationList.php | 286 + .../Compute/V1/ReservationsResizeRequest.php | 76 + .../Compute/V1/ReservationsScopedList.php | 110 + .../Cloud/Compute/V1/ResetInstanceRequest.php | 196 + .../Cloud/Compute/V1/ResizeDiskRequest.php | 242 + .../V1/ResizeInstanceGroupManagerRequest.php | 232 + .../Compute/V1/ResizeRegionDiskRequest.php | 242 + ...esizeRegionInstanceGroupManagerRequest.php | 232 + .../Compute/V1/ResizeReservationRequest.php | 242 + .../Cloud/Compute/V1/ResourceCommitment.php | 169 + .../Compute/V1/ResourceCommitment/Type.php | 75 + .../Compute/V1/ResourceGroupReference.php | 76 + .../Compute/V1/ResourcePoliciesScopedList.php | 110 + .../Cloud/Compute/V1/ResourcePolicy.php | 595 ++ .../Compute/V1/ResourcePolicy/Status.php | 83 + .../V1/ResourcePolicyAggregatedList.php | 358 + .../Compute/V1/ResourcePolicyDailyCycle.php | 165 + ...sourcePolicyDiskConsistencyGroupPolicy.php | 33 + .../V1/ResourcePolicyGroupPlacementPolicy.php | 169 + .../Collocation.php | 60 + .../Compute/V1/ResourcePolicyHourlyCycle.php | 165 + .../ResourcePolicyInstanceSchedulePolicy.php | 253 + ...cePolicyInstanceSchedulePolicySchedule.php | 77 + .../Cloud/Compute/V1/ResourcePolicyList.php | 323 + .../V1/ResourcePolicyResourceStatus.php | 77 + ...urceStatusInstanceSchedulePolicyStatus.php | 120 + .../ResourcePolicySnapshotSchedulePolicy.php | 165 + ...ySnapshotSchedulePolicyRetentionPolicy.php | 125 + .../OnSourceDiskDelete.php | 65 + ...cePolicySnapshotSchedulePolicySchedule.php | 144 + ...apshotSchedulePolicySnapshotProperties.php | 189 + .../Compute/V1/ResourcePolicyWeeklyCycle.php | 67 + .../V1/ResourcePolicyWeeklyCycleDayOfWeek.php | 168 + .../Day.php | 90 + .../Cloud/Compute/V1/ResourceStatus.php | 114 + .../Compute/V1/ResumeInstanceRequest.php | 196 + .../src/Google/Cloud/Compute/V1/Route.php | 979 +++ .../Cloud/Compute/V1/Route/RouteStatus.php | 78 + .../Cloud/Compute/V1/Route/RouteType.php | 74 + .../Google/Cloud/Compute/V1/RouteAsPath.php | 114 + .../V1/RouteAsPath/PathSegmentType.php | 70 + .../src/Google/Cloud/Compute/V1/RouteList.php | 287 + .../src/Google/Cloud/Compute/V1/Router.php | 609 ++ .../Compute/V1/RouterAdvertisedIpRange.php | 121 + .../Cloud/Compute/V1/RouterAggregatedList.php | 321 + .../src/Google/Cloud/Compute/V1/RouterBgp.php | 284 + .../Compute/V1/RouterBgp/AdvertiseMode.php | 64 + .../Compute/V1/RouterBgp/AdvertisedGroups.php | 56 + .../Google/Cloud/Compute/V1/RouterBgpPeer.php | 1054 +++ .../V1/RouterBgpPeer/AdvertiseMode.php | 64 + .../V1/RouterBgpPeer/AdvertisedGroups.php | 56 + .../Cloud/Compute/V1/RouterBgpPeer/Enable.php | 60 + .../V1/RouterBgpPeer/ManagementType.php | 64 + .../Cloud/Compute/V1/RouterBgpPeerBfd.php | 212 + .../SessionInitializationMode.php | 65 + .../V1/RouterBgpPeerCustomLearnedIpRange.php | 76 + .../Cloud/Compute/V1/RouterInterface.php | 436 ++ .../Compute/V1/RouterInterface/IpVersion.php | 60 + .../V1/RouterInterface/ManagementType.php | 64 + .../Google/Cloud/Compute/V1/RouterList.php | 287 + .../Compute/V1/RouterMd5AuthenticationKey.php | 120 + .../src/Google/Cloud/Compute/V1/RouterNat.php | 876 +++ .../Compute/V1/RouterNat/AutoNetworkTier.php | 78 + .../Compute/V1/RouterNat/EndpointTypes.php | 70 + .../V1/RouterNat/NatIpAllocateOption.php | 64 + .../SourceSubnetworkIpRangesToNat.php | 71 + .../Cloud/Compute/V1/RouterNat/Type.php | 68 + .../Cloud/Compute/V1/RouterNatLogConfig.php | 125 + .../Compute/V1/RouterNatLogConfig/Filter.php | 71 + .../Google/Cloud/Compute/V1/RouterNatRule.php | 208 + .../Cloud/Compute/V1/RouterNatRuleAction.php | 168 + .../Compute/V1/RouterNatSubnetworkToNat.php | 149 + .../SourceIpRangesToNat.php | 70 + .../Google/Cloud/Compute/V1/RouterStatus.php | 198 + .../Compute/V1/RouterStatusBgpPeerStatus.php | 903 +++ .../V1/RouterStatusBgpPeerStatus/Status.php | 65 + .../StatusReason.php | 76 + .../Compute/V1/RouterStatusNatStatus.php | 369 + .../V1/RouterStatusNatStatusNatRuleStatus.php | 233 + .../Cloud/Compute/V1/RouterStatusResponse.php | 113 + .../Compute/V1/RoutersPreviewResponse.php | 76 + .../Cloud/Compute/V1/RoutersScopedList.php | 110 + .../src/Google/Cloud/Compute/V1/Rule.php | 295 + .../Google/Cloud/Compute/V1/Rule/Action.php | 92 + .../Cloud/Compute/V1/SSLHealthCheck.php | 304 + .../V1/SSLHealthCheck/PortSpecification.php | 71 + .../Compute/V1/SSLHealthCheck/ProxyHeader.php | 60 + .../Cloud/Compute/V1/SavedAttachedDisk.php | 733 ++ .../Compute/V1/SavedAttachedDisk/Mode.php | 64 + .../V1/SavedAttachedDisk/PBInterface.php | 60 + .../SavedAttachedDisk/StorageBytesStatus.php | 60 + .../Compute/V1/SavedAttachedDisk/Type.php | 60 + .../src/Google/Cloud/Compute/V1/SavedDisk.php | 261 + .../Compute/V1/SavedDisk/Architecture.php | 71 + .../V1/SavedDisk/StorageBytesStatus.php | 60 + .../Compute/V1/ScalingScheduleStatus.php | 168 + .../V1/ScalingScheduleStatus/State.php | 78 + .../Google/Cloud/Compute/V1/Scheduling.php | 431 ++ .../Scheduling/InstanceTerminationAction.php | 71 + .../V1/Scheduling/OnHostMaintenance.php | 64 + .../V1/Scheduling/ProvisioningModel.php | 64 + .../Compute/V1/SchedulingNodeAffinity.php | 159 + .../V1/SchedulingNodeAffinity/Operator.php | 69 + .../Google/Cloud/Compute/V1/ScratchDisks.php | 76 + .../Google/Cloud/Compute/V1/Screenshot.php | 121 + .../V1/SecurityPoliciesAggregatedList.php | 357 + ...istPreconfiguredExpressionSetsResponse.php | 69 + .../Compute/V1/SecurityPoliciesScopedList.php | 110 + .../Compute/V1/SecurityPoliciesWafConfig.php | 69 + .../Cloud/Compute/V1/SecurityPolicy.php | 727 ++ .../Cloud/Compute/V1/SecurityPolicy/Type.php | 65 + ...SecurityPolicyAdaptiveProtectionConfig.php | 77 + ...rotectionConfigLayer7DdosDefenseConfig.php | 159 + .../RuleVisibility.php | 60 + ...Layer7DdosDefenseConfigThresholdConfig.php | 224 + .../SecurityPolicyAdvancedOptionsConfig.php | 206 + .../JsonParsing.php | 64 + .../LogLevel.php | 59 + ...yAdvancedOptionsConfigJsonCustomConfig.php | 66 + .../V1/SecurityPolicyDdosProtectionConfig.php | 80 + .../DdosProtection.php | 59 + .../Cloud/Compute/V1/SecurityPolicyList.php | 242 + .../SecurityPolicyRecaptchaOptionsConfig.php | 76 + .../Compute/V1/SecurityPolicyReference.php | 69 + .../Cloud/Compute/V1/SecurityPolicyRule.php | 517 ++ .../V1/SecurityPolicyRuleHttpHeaderAction.php | 66 + ...cyRuleHttpHeaderActionHttpHeaderOption.php | 120 + .../Compute/V1/SecurityPolicyRuleMatcher.php | 213 + .../VersionedExpr.php | 57 + .../V1/SecurityPolicyRuleMatcherConfig.php | 66 + .../SecurityPolicyRuleMatcherExprOptions.php | 76 + ...RuleMatcherExprOptionsRecaptchaOptions.php | 100 + .../V1/SecurityPolicyRuleNetworkMatcher.php | 305 + ...uleNetworkMatcherUserDefinedFieldMatch.php | 110 + ...curityPolicyRulePreconfiguredWafConfig.php | 66 + ...icyRulePreconfiguredWafConfigExclusion.php | 246 + ...onfiguredWafConfigExclusionFieldParams.php | 124 + .../Op.php | 85 + .../V1/SecurityPolicyRuleRateLimitOptions.php | 422 ++ .../EnforceOnKey.php | 100 + ...RuleRateLimitOptionsEnforceOnKeyConfig.php | 124 + .../EnforceOnKeyType.php | 100 + ...ityPolicyRuleRateLimitOptionsThreshold.php | 120 + .../V1/SecurityPolicyRuleRedirectOptions.php | 124 + .../Type.php | 60 + .../V1/SecurityPolicyUserDefinedField.php | 256 + .../SecurityPolicyUserDefinedField/Base.php | 70 + .../Cloud/Compute/V1/SecuritySettings.php | 155 + ...SendDiagnosticInterruptInstanceRequest.php | 152 + ...endDiagnosticInterruptInstanceResponse.php | 33 + .../Cloud/Compute/V1/SerialPortOutput.php | 253 + .../Google/Cloud/Compute/V1/ServerBinding.php | 80 + .../Cloud/Compute/V1/ServerBinding/Type.php | 68 + .../Cloud/Compute/V1/ServiceAccount.php | 111 + .../Cloud/Compute/V1/ServiceAttachment.php | 823 +++ .../ConnectionPreference.php | 65 + .../V1/ServiceAttachmentAggregatedList.php | 321 + .../V1/ServiceAttachmentConnectedEndpoint.php | 213 + .../Status.php | 90 + .../ServiceAttachmentConsumerProjectLimit.php | 164 + .../Compute/V1/ServiceAttachmentList.php | 286 + .../V1/ServiceAttachmentsScopedList.php | 110 + ...SetBackendServiceTargetSslProxyRequest.php | 206 + ...SetBackendServiceTargetTcpProxyRequest.php | 206 + .../Compute/V1/SetBackupTargetPoolRequest.php | 286 + ...tCertificateMapTargetHttpsProxyRequest.php | 206 + ...SetCertificateMapTargetSslProxyRequest.php | 206 + .../V1/SetCloudArmorTierProjectRequest.php | 170 + ...ommonInstanceMetadataOperationMetadata.php | 110 + ...rationMetadataPerLocationOperationInfo.php | 124 + .../State.php | 90 + ...etCommonInstanceMetadataProjectRequest.php | 170 + .../SetDefaultNetworkTierProjectRequest.php | 170 + .../SetDeletionProtectionInstanceRequest.php | 240 + .../V1/SetDiskAutoDeleteInstanceRequest.php | 268 + ...EdgeSecurityPolicyBackendBucketRequest.php | 206 + ...dgeSecurityPolicyBackendServiceRequest.php | 206 + .../V1/SetIamPolicyBackendBucketRequest.php | 162 + .../V1/SetIamPolicyBackendServiceRequest.php | 162 + .../Compute/V1/SetIamPolicyDiskRequest.php | 198 + .../V1/SetIamPolicyFirewallPolicyRequest.php | 126 + .../Compute/V1/SetIamPolicyImageRequest.php | 162 + .../V1/SetIamPolicyInstanceRequest.php | 198 + .../SetIamPolicyInstanceTemplateRequest.php | 162 + .../V1/SetIamPolicyInstantSnapshotRequest.php | 198 + .../Compute/V1/SetIamPolicyLicenseRequest.php | 162 + .../V1/SetIamPolicyMachineImageRequest.php | 162 + .../SetIamPolicyNetworkAttachmentRequest.php | 198 + ...tIamPolicyNetworkFirewallPolicyRequest.php | 162 + .../V1/SetIamPolicyNodeGroupRequest.php | 198 + .../V1/SetIamPolicyNodeTemplateRequest.php | 198 + ...etIamPolicyRegionBackendServiceRequest.php | 198 + .../V1/SetIamPolicyRegionDiskRequest.php | 198 + ...tIamPolicyRegionInstantSnapshotRequest.php | 198 + ...licyRegionNetworkFirewallPolicyRequest.php | 198 + .../V1/SetIamPolicyReservationRequest.php | 198 + .../V1/SetIamPolicyResourcePolicyRequest.php | 198 + .../SetIamPolicyServiceAttachmentRequest.php | 198 + .../V1/SetIamPolicySnapshotRequest.php | 162 + .../V1/SetIamPolicyStoragePoolRequest.php | 198 + .../V1/SetIamPolicySubnetworkRequest.php | 198 + ...nceTemplateInstanceGroupManagerRequest.php | 242 + ...plateRegionInstanceGroupManagerRequest.php | 242 + .../Compute/V1/SetLabelsAddressRequest.php | 242 + .../Cloud/Compute/V1/SetLabelsDiskRequest.php | 242 + .../V1/SetLabelsExternalVpnGatewayRequest.php | 162 + .../V1/SetLabelsForwardingRuleRequest.php | 242 + .../V1/SetLabelsGlobalAddressRequest.php | 162 + .../SetLabelsGlobalForwardingRuleRequest.php | 162 + .../Compute/V1/SetLabelsImageRequest.php | 162 + .../Compute/V1/SetLabelsInstanceRequest.php | 242 + .../V1/SetLabelsInstantSnapshotRequest.php | 242 + ...SetLabelsInterconnectAttachmentRequest.php | 242 + .../V1/SetLabelsInterconnectRequest.php | 162 + .../Compute/V1/SetLabelsRegionDiskRequest.php | 242 + .../SetLabelsRegionInstantSnapshotRequest.php | 242 + .../V1/SetLabelsSecurityPolicyRequest.php | 162 + .../Compute/V1/SetLabelsSnapshotRequest.php | 162 + .../V1/SetLabelsTargetVpnGatewayRequest.php | 242 + .../Compute/V1/SetLabelsVpnGatewayRequest.php | 242 + .../Compute/V1/SetLabelsVpnTunnelRequest.php | 242 + .../V1/SetMachineResourcesInstanceRequest.php | 242 + .../V1/SetMachineTypeInstanceRequest.php | 242 + .../Compute/V1/SetMetadataInstanceRequest.php | 242 + .../V1/SetMinCpuPlatformInstanceRequest.php | 242 + .../Compute/V1/SetNameInstanceRequest.php | 242 + .../V1/SetNamedPortsInstanceGroupRequest.php | 242 + ...etNamedPortsRegionInstanceGroupRequest.php | 242 + .../V1/SetNodeTemplateNodeGroupRequest.php | 242 + ...PrivateIpGoogleAccessSubnetworkRequest.php | 242 + .../SetProxyHeaderTargetSslProxyRequest.php | 206 + .../SetProxyHeaderTargetTcpProxyRequest.php | 206 + ...SetQuicOverrideTargetHttpsProxyRequest.php | 206 + .../V1/SetSchedulingInstanceRequest.php | 242 + ...SetSecurityPolicyBackendServiceRequest.php | 206 + .../V1/SetSecurityPolicyInstanceRequest.php | 242 + ...urityPolicyRegionBackendServiceRequest.php | 242 + ...SetSecurityPolicyTargetInstanceRequest.php | 242 + .../V1/SetSecurityPolicyTargetPoolRequest.php | 242 + .../V1/SetServiceAccountInstanceRequest.php | 242 + ...InstanceIntegrityPolicyInstanceRequest.php | 242 + ...tificatesRegionTargetHttpsProxyRequest.php | 242 + ...SslCertificatesTargetHttpsProxyRequest.php | 206 + ...etSslCertificatesTargetSslProxyRequest.php | 206 + .../SetSslPolicyTargetHttpsProxyRequest.php | 206 + .../V1/SetSslPolicyTargetSslProxyRequest.php | 206 + .../Compute/V1/SetTagsInstanceRequest.php | 242 + .../V1/SetTargetForwardingRuleRequest.php | 242 + .../SetTargetGlobalForwardingRuleRequest.php | 206 + ...TargetPoolsInstanceGroupManagerRequest.php | 242 + ...PoolsRegionInstanceGroupManagerRequest.php | 242 + .../SetUrlMapRegionTargetHttpProxyRequest.php | 242 + ...SetUrlMapRegionTargetHttpsProxyRequest.php | 242 + .../V1/SetUrlMapTargetHttpProxyRequest.php | 206 + .../V1/SetUrlMapTargetHttpsProxyRequest.php | 206 + .../V1/SetUsageExportBucketProjectRequest.php | 170 + .../Google/Cloud/Compute/V1/ShareSettings.php | 115 + .../Compute/V1/ShareSettings/ShareType.php | 78 + .../Compute/V1/ShareSettingsProjectConfig.php | 77 + .../Compute/V1/ShieldedInstanceConfig.php | 165 + .../Compute/V1/ShieldedInstanceIdentity.php | 165 + .../V1/ShieldedInstanceIdentityEntry.php | 121 + .../V1/ShieldedInstanceIntegrityPolicy.php | 77 + .../Google/Cloud/Compute/V1/SignedUrlKey.php | 121 + ...imulateMaintenanceEventInstanceRequest.php | 240 + ...mulateMaintenanceEventNodeGroupRequest.php | 242 + .../src/Google/Cloud/Compute/V1/Snapshot.php | 1583 +++++ .../Compute/V1/Snapshot/Architecture.php | 71 + .../Compute/V1/Snapshot/SnapshotType.php | 60 + .../Cloud/Compute/V1/Snapshot/Status.php | 85 + .../V1/Snapshot/StorageBytesStatus.php | 60 + .../Google/Cloud/Compute/V1/SnapshotList.php | 287 + .../Cloud/Compute/V1/SnapshotSettings.php | 76 + ...napshotSettingsStorageLocationSettings.php | 114 + .../Policy.php | 76 + ...ationSettingsStorageLocationPreference.php | 77 + .../Compute/V1/SourceDiskEncryptionKey.php | 120 + .../Cloud/Compute/V1/SourceInstanceParams.php | 67 + .../Compute/V1/SourceInstanceProperties.php | 603 ++ .../KeyRevocationActionType.php | 71 + .../Cloud/Compute/V1/SslCertificate.php | 643 ++ .../Cloud/Compute/V1/SslCertificate/Type.php | 69 + .../V1/SslCertificateAggregatedList.php | 320 + .../Cloud/Compute/V1/SslCertificateList.php | 287 + .../SslCertificateManagedSslCertificate.php | 149 + .../Status.php | 90 + ...slCertificateSelfManagedSslCertificate.php | 121 + .../Compute/V1/SslCertificatesScopedList.php | 110 + .../Compute/V1/SslPoliciesAggregatedList.php | 357 + .../Cloud/Compute/V1/SslPoliciesList.php | 286 + ...lPoliciesListAvailableFeaturesResponse.php | 59 + .../Compute/V1/SslPoliciesScopedList.php | 110 + .../src/Google/Cloud/Compute/V1/SslPolicy.php | 583 ++ .../Compute/V1/SslPolicy/MinTlsVersion.php | 71 + .../Cloud/Compute/V1/SslPolicy/Profile.php | 78 + .../Cloud/Compute/V1/SslPolicyReference.php | 76 + .../V1/StartAsyncReplicationDiskRequest.php | 242 + ...StartAsyncReplicationRegionDiskRequest.php | 242 + .../Cloud/Compute/V1/StartInstanceRequest.php | 196 + .../StartWithEncryptionKeyInstanceRequest.php | 242 + .../Cloud/Compute/V1/StatefulPolicy.php | 69 + .../V1/StatefulPolicyPreservedState.php | 135 + ...StatefulPolicyPreservedStateDiskDevice.php | 80 + .../AutoDelete.php | 60 + .../StatefulPolicyPreservedStateNetworkIp.php | 80 + .../AutoDelete.php | 60 + .../src/Google/Cloud/Compute/V1/Status.php | 155 + .../V1/StopAsyncReplicationDiskRequest.php | 196 + .../StopAsyncReplicationRegionDiskRequest.php | 196 + .../StopGroupAsyncReplicationDiskRequest.php | 206 + ...GroupAsyncReplicationRegionDiskRequest.php | 206 + .../Cloud/Compute/V1/StopInstanceRequest.php | 240 + .../Google/Cloud/Compute/V1/StoragePool.php | 871 +++ .../StoragePool/CapacityProvisioningType.php | 54 + .../PerformanceProvisioningType.php | 54 + .../Cloud/Compute/V1/StoragePool/State.php | 78 + .../Compute/V1/StoragePoolAggregatedList.php | 357 + .../Cloud/Compute/V1/StoragePoolDisk.php | 500 ++ .../Compute/V1/StoragePoolDisk/Status.php | 92 + .../Cloud/Compute/V1/StoragePoolList.php | 358 + .../Cloud/Compute/V1/StoragePoolListDisks.php | 357 + .../Compute/V1/StoragePoolResourceStatus.php | 473 ++ .../Cloud/Compute/V1/StoragePoolType.php | 770 +++ .../V1/StoragePoolTypeAggregatedList.php | 286 + .../Cloud/Compute/V1/StoragePoolTypeList.php | 287 + .../Compute/V1/StoragePoolTypesScopedList.php | 110 + .../Compute/V1/StoragePoolsScopedList.php | 110 + .../Google/Cloud/Compute/V1/Subnetwork.php | 1147 ++++ .../Compute/V1/Subnetwork/Ipv6AccessType.php | 69 + .../V1/Subnetwork/PrivateIpv6GoogleAccess.php | 71 + .../Cloud/Compute/V1/Subnetwork/Purpose.php | 103 + .../Cloud/Compute/V1/Subnetwork/Role.php | 64 + .../Cloud/Compute/V1/Subnetwork/StackType.php | 69 + .../Cloud/Compute/V1/Subnetwork/State.php | 64 + .../Compute/V1/SubnetworkAggregatedList.php | 320 + .../Cloud/Compute/V1/SubnetworkList.php | 287 + .../Cloud/Compute/V1/SubnetworkLogConfig.php | 295 + .../AggregationInterval.php | 80 + .../V1/SubnetworkLogConfig/Metadata.php | 65 + .../Compute/V1/SubnetworkSecondaryRange.php | 165 + .../SubnetworksExpandIpCidrRangeRequest.php | 76 + .../Compute/V1/SubnetworksScopedList.php | 110 + ...etworksSetPrivateIpGoogleAccessRequest.php | 69 + .../Google/Cloud/Compute/V1/Subsetting.php | 81 + .../Cloud/Compute/V1/Subsetting/Policy.php | 63 + .../Compute/V1/SuspendInstanceRequest.php | 240 + .../V1/SwitchToCustomModeNetworkRequest.php | 160 + .../Cloud/Compute/V1/TCPHealthCheck.php | 304 + .../V1/TCPHealthCheck/PortSpecification.php | 71 + .../Compute/V1/TCPHealthCheck/ProxyHeader.php | 60 + .../src/Google/Cloud/Compute/V1/Tags.php | 111 + .../Cloud/Compute/V1/TargetGrpcProxy.php | 473 ++ .../Cloud/Compute/V1/TargetGrpcProxyList.php | 286 + .../V1/TargetHttpProxiesScopedList.php | 110 + .../Cloud/Compute/V1/TargetHttpProxy.php | 517 ++ .../V1/TargetHttpProxyAggregatedList.php | 276 + .../Cloud/Compute/V1/TargetHttpProxyList.php | 287 + .../V1/TargetHttpsProxiesScopedList.php | 110 + ...etHttpsProxiesSetCertificateMapRequest.php | 76 + ...rgetHttpsProxiesSetQuicOverrideRequest.php | 80 + .../QuicOverride.php | 71 + ...tHttpsProxiesSetSslCertificatesRequest.php | 66 + .../Cloud/Compute/V1/TargetHttpsProxy.php | 775 +++ .../V1/TargetHttpsProxy/QuicOverride.php | 71 + .../V1/TargetHttpsProxyAggregatedList.php | 320 + .../Cloud/Compute/V1/TargetHttpsProxyList.php | 287 + .../Cloud/Compute/V1/TargetInstance.php | 521 ++ .../Compute/V1/TargetInstance/NatPolicy.php | 57 + .../V1/TargetInstanceAggregatedList.php | 320 + .../Cloud/Compute/V1/TargetInstanceList.php | 287 + .../Compute/V1/TargetInstancesScopedList.php | 110 + .../Google/Cloud/Compute/V1/TargetPool.php | 589 ++ .../Compute/V1/TargetPool/SessionAffinity.php | 106 + .../Compute/V1/TargetPoolAggregatedList.php | 320 + .../Compute/V1/TargetPoolInstanceHealth.php | 103 + .../Cloud/Compute/V1/TargetPoolList.php | 287 + .../V1/TargetPoolsAddHealthCheckRequest.php | 66 + .../V1/TargetPoolsAddInstanceRequest.php | 66 + .../TargetPoolsRemoveHealthCheckRequest.php | 66 + .../V1/TargetPoolsRemoveInstanceRequest.php | 66 + .../Compute/V1/TargetPoolsScopedList.php | 110 + .../Cloud/Compute/V1/TargetReference.php | 69 + ...rgetSslProxiesSetBackendServiceRequest.php | 76 + ...rgetSslProxiesSetCertificateMapRequest.php | 76 + .../TargetSslProxiesSetProxyHeaderRequest.php | 80 + .../ProxyHeader.php | 60 + ...getSslProxiesSetSslCertificatesRequest.php | 66 + .../Cloud/Compute/V1/TargetSslProxy.php | 511 ++ .../Compute/V1/TargetSslProxy/ProxyHeader.php | 60 + .../Cloud/Compute/V1/TargetSslProxyList.php | 287 + .../Compute/V1/TargetTcpProxiesScopedList.php | 110 + ...rgetTcpProxiesSetBackendServiceRequest.php | 76 + .../TargetTcpProxiesSetProxyHeaderRequest.php | 80 + .../ProxyHeader.php | 60 + .../Cloud/Compute/V1/TargetTcpProxy.php | 477 ++ .../Compute/V1/TargetTcpProxy/ProxyHeader.php | 60 + .../V1/TargetTcpProxyAggregatedList.php | 320 + .../Cloud/Compute/V1/TargetTcpProxyList.php | 287 + .../Cloud/Compute/V1/TargetVpnGateway.php | 579 ++ .../Compute/V1/TargetVpnGateway/Status.php | 70 + .../V1/TargetVpnGatewayAggregatedList.php | 320 + .../Cloud/Compute/V1/TargetVpnGatewayList.php | 287 + .../V1/TargetVpnGatewaysScopedList.php | 110 + .../Google/Cloud/Compute/V1/TestFailure.php | 418 ++ ...TestIamPermissionsBackendBucketRequest.php | 162 + ...estIamPermissionsBackendServiceRequest.php | 162 + .../V1/TestIamPermissionsDiskRequest.php | 198 + ...amPermissionsExternalVpnGatewayRequest.php | 162 + ...estIamPermissionsFirewallPolicyRequest.php | 126 + .../V1/TestIamPermissionsImageRequest.php | 162 + .../V1/TestIamPermissionsInstanceRequest.php | 198 + ...tIamPermissionsInstanceTemplateRequest.php | 162 + ...stIamPermissionsInstantSnapshotRequest.php | 198 + .../TestIamPermissionsLicenseCodeRequest.php | 162 + .../V1/TestIamPermissionsLicenseRequest.php | 162 + .../TestIamPermissionsMachineImageRequest.php | 162 + ...IamPermissionsNetworkAttachmentRequest.php | 198 + ...PermissionsNetworkEndpointGroupRequest.php | 198 + ...ermissionsNetworkFirewallPolicyRequest.php | 162 + .../V1/TestIamPermissionsNodeGroupRequest.php | 198 + .../TestIamPermissionsNodeTemplateRequest.php | 198 + ...stIamPermissionsPacketMirroringRequest.php | 198 + ...PermissionsRegionBackendServiceRequest.php | 198 + .../TestIamPermissionsRegionDiskRequest.php | 198 + ...ermissionsRegionInstantSnapshotRequest.php | 198 + ...ionsRegionNetworkFirewallPolicyRequest.php | 198 + .../TestIamPermissionsReservationRequest.php | 198 + ...estIamPermissionsResourcePolicyRequest.php | 198 + ...IamPermissionsServiceAttachmentRequest.php | 198 + .../V1/TestIamPermissionsSnapshotRequest.php | 162 + .../TestIamPermissionsStoragePoolRequest.php | 198 + .../TestIamPermissionsSubnetworkRequest.php | 198 + .../TestIamPermissionsVpnGatewayRequest.php | 198 + .../Compute/V1/TestPermissionsRequest.php | 66 + .../Compute/V1/TestPermissionsResponse.php | 66 + .../src/Google/Cloud/Compute/V1/Uint128.php | 106 + .../Cloud/Compute/V1/UpcomingMaintenance.php | 305 + .../UpcomingMaintenance/MaintenanceStatus.php | 70 + .../Compute/V1/UpcomingMaintenance/Type.php | 71 + .../V1/UpdateAccessConfigInstanceRequest.php | 278 + .../Compute/V1/UpdateAutoscalerRequest.php | 250 + .../Compute/V1/UpdateBackendBucketRequest.php | 206 + .../V1/UpdateBackendServiceRequest.php | 206 + .../Cloud/Compute/V1/UpdateDiskRequest.php | 323 + .../V1/UpdateDisplayDeviceInstanceRequest.php | 242 + .../Compute/V1/UpdateFirewallRequest.php | 206 + .../Compute/V1/UpdateHealthCheckRequest.php | 206 + .../Compute/V1/UpdateInstanceRequest.php | 338 + .../UpdateInstanceRequest/MinimalAction.php | 55 + .../MostDisruptiveAllowedAction.php | 55 + .../UpdateNetworkInterfaceInstanceRequest.php | 278 + .../V1/UpdatePeeringNetworkRequest.php | 206 + ...anceConfigsInstanceGroupManagerRequest.php | 242 + ...nfigsRegionInstanceGroupManagerRequest.php | 242 + .../V1/UpdateRegionAutoscalerRequest.php | 250 + .../V1/UpdateRegionBackendServiceRequest.php | 242 + .../V1/UpdateRegionCommitmentRequest.php | 323 + .../Compute/V1/UpdateRegionDiskRequest.php | 323 + .../V1/UpdateRegionHealthCheckRequest.php | 242 + .../Compute/V1/UpdateRegionUrlMapRequest.php | 242 + .../Compute/V1/UpdateReservationRequest.php | 323 + .../Cloud/Compute/V1/UpdateRouterRequest.php | 242 + ...eShieldedInstanceConfigInstanceRequest.php | 242 + .../Compute/V1/UpdateStoragePoolRequest.php | 286 + .../Cloud/Compute/V1/UpdateUrlMapRequest.php | 206 + .../src/Google/Cloud/Compute/V1/UrlMap.php | 663 ++ .../Google/Cloud/Compute/V1/UrlMapList.php | 287 + .../Cloud/Compute/V1/UrlMapReference.php | 69 + .../Google/Cloud/Compute/V1/UrlMapTest.php | 331 + .../Cloud/Compute/V1/UrlMapTestHeader.php | 121 + .../Compute/V1/UrlMapValidationResult.php | 175 + .../Compute/V1/UrlMapsAggregatedList.php | 320 + .../Cloud/Compute/V1/UrlMapsScopedList.php | 110 + .../Compute/V1/UrlMapsValidateRequest.php | 114 + .../LoadBalancingSchemes.php | 70 + .../Compute/V1/UrlMapsValidateResponse.php | 69 + .../Google/Cloud/Compute/V1/UrlRewrite.php | 165 + .../Cloud/Compute/V1/UsableSubnetwork.php | 479 ++ .../V1/UsableSubnetwork/Ipv6AccessType.php | 64 + .../Compute/V1/UsableSubnetwork/Purpose.php | 103 + .../Compute/V1/UsableSubnetwork/Role.php | 64 + .../Compute/V1/UsableSubnetwork/StackType.php | 64 + .../V1/UsableSubnetworkSecondaryRange.php | 121 + .../V1/UsableSubnetworksAggregatedList.php | 286 + .../Cloud/Compute/V1/UsageExportLocation.php | 121 + .../V1/ValidateRegionUrlMapRequest.php | 198 + .../Compute/V1/ValidateUrlMapRequest.php | 162 + .../Compute/V1/VmEndpointNatMappings.php | 104 + ...ndpointNatMappingsInterfaceNatMappings.php | 311 + ...ngsInterfaceNatMappingsNatRuleMappings.php | 233 + .../Compute/V1/VmEndpointNatMappingsList.php | 287 + .../Google/Cloud/Compute/V1/VpnGateway.php | 593 ++ .../V1/VpnGateway/GatewayIpVersion.php | 64 + .../Cloud/Compute/V1/VpnGateway/StackType.php | 64 + .../Compute/V1/VpnGatewayAggregatedList.php | 320 + .../Cloud/Compute/V1/VpnGatewayList.php | 287 + .../Cloud/Compute/V1/VpnGatewayStatus.php | 66 + ...StatusHighAvailabilityRequirementState.php | 129 + .../State.php | 64 + .../UnsatisfiedReason.php | 55 + .../Compute/V1/VpnGatewayStatusTunnel.php | 165 + .../V1/VpnGatewayStatusVpnConnection.php | 199 + .../V1/VpnGatewayVpnGatewayInterface.php | 209 + .../V1/VpnGatewaysGetStatusResponse.php | 69 + .../Compute/V1/VpnGatewaysScopedList.php | 110 + .../src/Google/Cloud/Compute/V1/VpnTunnel.php | 1063 +++ .../Cloud/Compute/V1/VpnTunnel/Status.php | 141 + .../Compute/V1/VpnTunnelAggregatedList.php | 320 + .../Google/Cloud/Compute/V1/VpnTunnelList.php | 287 + .../Cloud/Compute/V1/VpnTunnelsScopedList.php | 110 + .../Cloud/Compute/V1/WafExpressionSet.php | 144 + .../Compute/V1/WafExpressionSetExpression.php | 120 + .../Compute/V1/WaitGlobalOperationRequest.php | 116 + .../Compute/V1/WaitRegionOperationRequest.php | 152 + .../Compute/V1/WaitZoneOperationRequest.php | 152 + .../src/Google/Cloud/Compute/V1/Warning.php | 159 + .../Google/Cloud/Compute/V1/Warning/Code.php | 246 + .../src/Google/Cloud/Compute/V1/Warnings.php | 158 + .../Google/Cloud/Compute/V1/Warnings/Code.php | 246 + .../Compute/V1/WeightedBackendService.php | 165 + ...WithdrawPublicAdvertisedPrefixeRequest.php | 160 + .../WithdrawPublicDelegatedPrefixeRequest.php | 196 + .../Google/Cloud/Compute/V1/XpnHostList.php | 286 + .../Google/Cloud/Compute/V1/XpnResourceId.php | 125 + .../Cloud/Compute/V1/XpnResourceId/Type.php | 60 + .../src/Google/Cloud/Compute/V1/Zone.php | 511 ++ .../Google/Cloud/Compute/V1/Zone/Status.php | 60 + .../src/Google/Cloud/Compute/V1/ZoneList.php | 287 + .../Cloud/Compute/V1/ZoneSetLabelsRequest.php | 110 + .../Cloud/Compute/V1/ZoneSetPolicyRequest.php | 154 + .../aggregated_list.php | 68 + .../samples/V1/AcceleratorTypesClient/get.php | 69 + .../V1/AcceleratorTypesClient/list.php | 70 + .../V1/AddressesClient/aggregated_list.php | 68 + .../V1/samples/V1/AddressesClient/delete.php | 78 + .../V1/samples/V1/AddressesClient/get.php | 69 + .../V1/samples/V1/AddressesClient/insert.php | 80 + .../V1/samples/V1/AddressesClient/list.php | 70 + .../V1/samples/V1/AddressesClient/move.php | 87 + .../samples/V1/AddressesClient/set_labels.php | 87 + .../V1/AutoscalersClient/aggregated_list.php | 68 + .../samples/V1/AutoscalersClient/delete.php | 78 + .../V1/samples/V1/AutoscalersClient/get.php | 69 + .../samples/V1/AutoscalersClient/insert.php | 80 + .../V1/samples/V1/AutoscalersClient/list.php | 70 + .../V1/samples/V1/AutoscalersClient/patch.php | 80 + .../samples/V1/AutoscalersClient/update.php | 80 + .../add_signed_url_key.php | 80 + .../V1/BackendBucketsClient/delete.php | 76 + .../delete_signed_url_key.php | 81 + .../samples/V1/BackendBucketsClient/get.php | 67 + .../BackendBucketsClient/get_iam_policy.php | 67 + .../V1/BackendBucketsClient/insert.php | 78 + .../samples/V1/BackendBucketsClient/list.php | 68 + .../samples/V1/BackendBucketsClient/patch.php | 80 + .../set_edge_security_policy.php | 84 + .../BackendBucketsClient/set_iam_policy.php | 75 + .../test_iam_permissions.php | 75 + .../V1/BackendBucketsClient/update.php | 80 + .../add_signed_url_key.php | 84 + .../BackendServicesClient/aggregated_list.php | 68 + .../V1/BackendServicesClient/delete.php | 76 + .../delete_signed_url_key.php | 81 + .../samples/V1/BackendServicesClient/get.php | 67 + .../V1/BackendServicesClient/get_health.php | 75 + .../BackendServicesClient/get_iam_policy.php | 67 + .../V1/BackendServicesClient/insert.php | 78 + .../samples/V1/BackendServicesClient/list.php | 68 + .../V1/BackendServicesClient/list_usable.php | 68 + .../V1/BackendServicesClient/patch.php | 80 + .../set_edge_security_policy.php | 84 + .../BackendServicesClient/set_iam_policy.php | 75 + .../set_security_policy.php | 84 + .../test_iam_permissions.php | 75 + .../V1/BackendServicesClient/update.php | 80 + .../V1/DiskTypesClient/aggregated_list.php | 68 + .../V1/samples/V1/DiskTypesClient/get.php | 69 + .../V1/samples/V1/DiskTypesClient/list.php | 70 + .../V1/DisksClient/add_resource_policies.php | 87 + .../V1/DisksClient/aggregated_list.php | 68 + .../V1/samples/V1/DisksClient/bulk_insert.php | 80 + .../V1/DisksClient/create_snapshot.php | 82 + .../V1/samples/V1/DisksClient/delete.php | 78 + .../Compute/V1/samples/V1/DisksClient/get.php | 69 + .../samples/V1/DisksClient/get_iam_policy.php | 69 + .../V1/samples/V1/DisksClient/insert.php | 80 + .../V1/samples/V1/DisksClient/list.php | 70 + .../DisksClient/remove_resource_policies.php | 87 + .../V1/samples/V1/DisksClient/resize.php | 82 + .../samples/V1/DisksClient/set_iam_policy.php | 73 + .../V1/samples/V1/DisksClient/set_labels.php | 82 + .../DisksClient/start_async_replication.php | 87 + .../V1/DisksClient/stop_async_replication.php | 78 + .../stop_group_async_replication.php | 84 + .../V1/DisksClient/test_iam_permissions.php | 78 + .../V1/samples/V1/DisksClient/update.php | 82 + .../V1/ExternalVpnGatewaysClient/delete.php | 76 + .../V1/ExternalVpnGatewaysClient/get.php | 67 + .../V1/ExternalVpnGatewaysClient/insert.php | 78 + .../V1/ExternalVpnGatewaysClient/list.php | 68 + .../ExternalVpnGatewaysClient/set_labels.php | 84 + .../test_iam_permissions.php | 75 + .../add_association.php | 81 + .../V1/FirewallPoliciesClient/add_rule.php | 78 + .../V1/FirewallPoliciesClient/clone_rules.php | 74 + .../V1/FirewallPoliciesClient/delete.php | 74 + .../samples/V1/FirewallPoliciesClient/get.php | 65 + .../get_association.php | 65 + .../FirewallPoliciesClient/get_iam_policy.php | 65 + .../V1/FirewallPoliciesClient/get_rule.php | 65 + .../V1/FirewallPoliciesClient/insert.php | 78 + .../V1/FirewallPoliciesClient/list.php | 56 + .../list_associations.php | 53 + .../V1/FirewallPoliciesClient/move.php | 76 + .../V1/FirewallPoliciesClient/patch.php | 78 + .../V1/FirewallPoliciesClient/patch_rule.php | 78 + .../remove_association.php | 74 + .../V1/FirewallPoliciesClient/remove_rule.php | 74 + .../FirewallPoliciesClient/set_iam_policy.php | 72 + .../test_iam_permissions.php | 69 + .../V1/samples/V1/FirewallsClient/delete.php | 76 + .../V1/samples/V1/FirewallsClient/get.php | 67 + .../V1/samples/V1/FirewallsClient/insert.php | 78 + .../V1/samples/V1/FirewallsClient/list.php | 68 + .../V1/samples/V1/FirewallsClient/patch.php | 80 + .../V1/samples/V1/FirewallsClient/update.php | 80 + .../ForwardingRulesClient/aggregated_list.php | 68 + .../V1/ForwardingRulesClient/delete.php | 78 + .../samples/V1/ForwardingRulesClient/get.php | 69 + .../V1/ForwardingRulesClient/insert.php | 80 + .../samples/V1/ForwardingRulesClient/list.php | 70 + .../V1/ForwardingRulesClient/patch.php | 87 + .../V1/ForwardingRulesClient/set_labels.php | 87 + .../V1/ForwardingRulesClient/set_target.php | 87 + .../V1/GlobalAddressesClient/delete.php | 76 + .../samples/V1/GlobalAddressesClient/get.php | 67 + .../V1/GlobalAddressesClient/insert.php | 78 + .../samples/V1/GlobalAddressesClient/list.php | 68 + .../samples/V1/GlobalAddressesClient/move.php | 80 + .../V1/GlobalAddressesClient/set_labels.php | 80 + .../V1/GlobalForwardingRulesClient/delete.php | 76 + .../V1/GlobalForwardingRulesClient/get.php | 67 + .../V1/GlobalForwardingRulesClient/insert.php | 78 + .../V1/GlobalForwardingRulesClient/list.php | 68 + .../V1/GlobalForwardingRulesClient/patch.php | 80 + .../set_labels.php | 84 + .../set_target.php | 84 + .../attach_network_endpoints.php | 84 + .../delete.php | 76 + .../detach_network_endpoints.php | 84 + .../GlobalNetworkEndpointGroupsClient/get.php | 67 + .../insert.php | 78 + .../list.php | 68 + .../list_network_endpoints.php | 73 + .../aggregated_list.php | 68 + .../V1/GlobalOperationsClient/delete.php | 67 + .../samples/V1/GlobalOperationsClient/get.php | 67 + .../V1/GlobalOperationsClient/list.php | 68 + .../V1/GlobalOperationsClient/wait.php | 67 + .../delete.php | 65 + .../get.php | 65 + .../list.php | 56 + .../delete.php | 76 + .../get.php | 67 + .../insert.php | 78 + .../list.php | 68 + .../patch.php | 84 + .../V1/HealthChecksClient/aggregated_list.php | 68 + .../samples/V1/HealthChecksClient/delete.php | 76 + .../V1/samples/V1/HealthChecksClient/get.php | 67 + .../samples/V1/HealthChecksClient/insert.php | 78 + .../V1/samples/V1/HealthChecksClient/list.php | 68 + .../samples/V1/HealthChecksClient/patch.php | 80 + .../samples/V1/HealthChecksClient/update.php | 80 + .../samples/V1/ImageFamilyViewsClient/get.php | 69 + .../V1/samples/V1/ImagesClient/delete.php | 76 + .../V1/samples/V1/ImagesClient/deprecate.php | 80 + .../V1/samples/V1/ImagesClient/get.php | 67 + .../V1/ImagesClient/get_from_family.php | 67 + .../V1/ImagesClient/get_iam_policy.php | 67 + .../V1/samples/V1/ImagesClient/insert.php | 78 + .../V1/samples/V1/ImagesClient/list.php | 68 + .../V1/samples/V1/ImagesClient/patch.php | 80 + .../V1/ImagesClient/set_iam_policy.php | 71 + .../V1/samples/V1/ImagesClient/set_labels.php | 80 + .../V1/ImagesClient/test_iam_permissions.php | 71 + .../cancel.php | 89 + .../delete.php | 89 + .../get.php | 80 + .../insert.php | 87 + .../list.php | 72 + .../abandon_instances.php | 90 + .../aggregated_list.php | 68 + .../apply_updates_to_instances.php | 90 + .../create_instances.php | 90 + .../V1/InstanceGroupManagersClient/delete.php | 78 + .../delete_instances.php | 90 + .../delete_per_instance_configs.php | 90 + .../V1/InstanceGroupManagersClient/get.php | 69 + .../V1/InstanceGroupManagersClient/insert.php | 80 + .../V1/InstanceGroupManagersClient/list.php | 70 + .../list_errors.php | 72 + .../list_managed_instances.php | 79 + .../list_per_instance_configs.php | 79 + .../V1/InstanceGroupManagersClient/patch.php | 87 + .../patch_per_instance_configs.php | 90 + .../recreate_instances.php | 90 + .../V1/InstanceGroupManagersClient/resize.php | 84 + .../set_instance_template.php | 90 + .../set_target_pools.php | 90 + .../update_per_instance_configs.php | 90 + .../V1/InstanceGroupsClient/add_instances.php | 87 + .../InstanceGroupsClient/aggregated_list.php | 68 + .../V1/InstanceGroupsClient/delete.php | 78 + .../samples/V1/InstanceGroupsClient/get.php | 69 + .../V1/InstanceGroupsClient/insert.php | 80 + .../samples/V1/InstanceGroupsClient/list.php | 70 + .../InstanceGroupsClient/list_instances.php | 81 + .../InstanceGroupsClient/remove_instances.php | 87 + .../InstanceGroupsClient/set_named_ports.php | 87 + .../V1/InstanceSettingsServiceClient/get.php | 67 + .../InstanceSettingsServiceClient/patch.php | 80 + .../aggregated_list.php | 68 + .../V1/InstanceTemplatesClient/delete.php | 76 + .../V1/InstanceTemplatesClient/get.php | 67 + .../get_iam_policy.php | 67 + .../V1/InstanceTemplatesClient/insert.php | 78 + .../V1/InstanceTemplatesClient/list.php | 68 + .../set_iam_policy.php | 75 + .../test_iam_permissions.php | 75 + .../V1/InstancesClient/add_access_config.php | 94 + .../InstancesClient/add_resource_policies.php | 87 + .../V1/InstancesClient/aggregated_list.php | 68 + .../V1/InstancesClient/attach_disk.php | 82 + .../V1/InstancesClient/bulk_insert.php | 80 + .../V1/samples/V1/InstancesClient/delete.php | 78 + .../InstancesClient/delete_access_config.php | 93 + .../V1/InstancesClient/detach_disk.php | 84 + .../V1/samples/V1/InstancesClient/get.php | 69 + .../get_effective_firewalls.php | 75 + .../InstancesClient/get_guest_attributes.php | 69 + .../V1/InstancesClient/get_iam_policy.php | 69 + .../V1/InstancesClient/get_screenshot.php | 69 + .../get_serial_port_output.php | 69 + .../get_shielded_instance_identity.php | 72 + .../V1/samples/V1/InstancesClient/insert.php | 80 + .../V1/samples/V1/InstancesClient/list.php | 70 + .../V1/InstancesClient/list_referrers.php | 72 + .../InstancesClient/perform_maintenance.php | 78 + .../remove_resource_policies.php | 87 + .../V1/samples/V1/InstancesClient/reset.php | 78 + .../V1/samples/V1/InstancesClient/resume.php | 78 + .../send_diagnostic_interrupt.php | 69 + .../set_deletion_protection.php | 78 + .../InstancesClient/set_disk_auto_delete.php | 93 + .../V1/InstancesClient/set_iam_policy.php | 78 + .../samples/V1/InstancesClient/set_labels.php | 87 + .../InstancesClient/set_machine_resources.php | 87 + .../V1/InstancesClient/set_machine_type.php | 87 + .../V1/InstancesClient/set_metadata.php | 82 + .../InstancesClient/set_min_cpu_platform.php | 87 + .../samples/V1/InstancesClient/set_name.php | 82 + .../V1/InstancesClient/set_scheduling.php | 82 + .../InstancesClient/set_security_policy.php | 87 + .../InstancesClient/set_service_account.php | 87 + ...set_shielded_instance_integrity_policy.php | 90 + .../samples/V1/InstancesClient/set_tags.php | 82 + .../simulate_maintenance_event.php | 78 + .../V1/samples/V1/InstancesClient/start.php | 78 + .../start_with_encryption_key.php | 87 + .../V1/samples/V1/InstancesClient/stop.php | 78 + .../V1/samples/V1/InstancesClient/suspend.php | 78 + .../InstancesClient/test_iam_permissions.php | 78 + .../V1/samples/V1/InstancesClient/update.php | 82 + .../InstancesClient/update_access_config.php | 94 + .../InstancesClient/update_display_device.php | 87 + .../update_network_interface.php | 94 + .../update_shielded_instance_config.php | 90 + .../aggregated_list.php | 68 + .../V1/InstantSnapshotsClient/delete.php | 78 + .../samples/V1/InstantSnapshotsClient/get.php | 69 + .../InstantSnapshotsClient/get_iam_policy.php | 69 + .../V1/InstantSnapshotsClient/insert.php | 80 + .../V1/InstantSnapshotsClient/list.php | 70 + .../InstantSnapshotsClient/set_iam_policy.php | 78 + .../V1/InstantSnapshotsClient/set_labels.php | 87 + .../test_iam_permissions.php | 78 + .../aggregated_list.php | 68 + .../InterconnectAttachmentsClient/delete.php | 78 + .../V1/InterconnectAttachmentsClient/get.php | 69 + .../InterconnectAttachmentsClient/insert.php | 84 + .../V1/InterconnectAttachmentsClient/list.php | 70 + .../InterconnectAttachmentsClient/patch.php | 87 + .../set_labels.php | 87 + .../V1/InterconnectLocationsClient/get.php | 67 + .../V1/InterconnectLocationsClient/list.php | 68 + .../InterconnectRemoteLocationsClient/get.php | 67 + .../list.php | 68 + .../samples/V1/InterconnectsClient/delete.php | 76 + .../V1/samples/V1/InterconnectsClient/get.php | 67 + .../InterconnectsClient/get_diagnostics.php | 67 + .../InterconnectsClient/get_macsec_config.php | 67 + .../samples/V1/InterconnectsClient/insert.php | 78 + .../samples/V1/InterconnectsClient/list.php | 68 + .../samples/V1/InterconnectsClient/patch.php | 80 + .../V1/InterconnectsClient/set_labels.php | 80 + .../V1/samples/V1/LicenseCodesClient/get.php | 67 + .../test_iam_permissions.php | 75 + .../V1/samples/V1/LicensesClient/delete.php | 76 + .../V1/samples/V1/LicensesClient/get.php | 67 + .../V1/LicensesClient/get_iam_policy.php | 67 + .../V1/samples/V1/LicensesClient/insert.php | 78 + .../V1/samples/V1/LicensesClient/list.php | 68 + .../V1/LicensesClient/set_iam_policy.php | 71 + .../LicensesClient/test_iam_permissions.php | 75 + .../samples/V1/MachineImagesClient/delete.php | 76 + .../V1/samples/V1/MachineImagesClient/get.php | 67 + .../V1/MachineImagesClient/get_iam_policy.php | 67 + .../samples/V1/MachineImagesClient/insert.php | 78 + .../samples/V1/MachineImagesClient/list.php | 68 + .../V1/MachineImagesClient/set_iam_policy.php | 75 + .../test_iam_permissions.php | 75 + .../V1/MachineTypesClient/aggregated_list.php | 68 + .../V1/samples/V1/MachineTypesClient/get.php | 69 + .../V1/samples/V1/MachineTypesClient/list.php | 70 + .../aggregated_list.php | 68 + .../V1/NetworkAttachmentsClient/delete.php | 78 + .../V1/NetworkAttachmentsClient/get.php | 69 + .../get_iam_policy.php | 69 + .../V1/NetworkAttachmentsClient/insert.php | 80 + .../V1/NetworkAttachmentsClient/list.php | 70 + .../V1/NetworkAttachmentsClient/patch.php | 87 + .../set_iam_policy.php | 78 + .../test_iam_permissions.php | 78 + .../aggregated_list.php | 68 + .../delete.php | 82 + .../NetworkEdgeSecurityServicesClient/get.php | 69 + .../insert.php | 84 + .../patch.php | 87 + .../aggregated_list.php | 68 + .../attach_network_endpoints.php | 90 + .../V1/NetworkEndpointGroupsClient/delete.php | 78 + .../detach_network_endpoints.php | 90 + .../V1/NetworkEndpointGroupsClient/get.php | 69 + .../V1/NetworkEndpointGroupsClient/insert.php | 80 + .../V1/NetworkEndpointGroupsClient/list.php | 70 + .../list_network_endpoints.php | 84 + .../test_iam_permissions.php | 78 + .../add_association.php | 84 + .../add_rule.php | 84 + .../clone_rules.php | 76 + .../NetworkFirewallPoliciesClient/delete.php | 76 + .../V1/NetworkFirewallPoliciesClient/get.php | 67 + .../get_association.php | 67 + .../get_iam_policy.php | 67 + .../get_rule.php | 67 + .../NetworkFirewallPoliciesClient/insert.php | 78 + .../V1/NetworkFirewallPoliciesClient/list.php | 68 + .../NetworkFirewallPoliciesClient/patch.php | 84 + .../patch_rule.php | 84 + .../remove_association.php | 76 + .../remove_rule.php | 76 + .../set_iam_policy.php | 75 + .../test_iam_permissions.php | 75 + .../samples/V1/NetworksClient/add_peering.php | 80 + .../V1/samples/V1/NetworksClient/delete.php | 76 + .../V1/samples/V1/NetworksClient/get.php | 67 + .../get_effective_firewalls.php | 67 + .../V1/samples/V1/NetworksClient/insert.php | 78 + .../V1/samples/V1/NetworksClient/list.php | 68 + .../V1/NetworksClient/list_peering_routes.php | 70 + .../V1/samples/V1/NetworksClient/patch.php | 80 + .../V1/NetworksClient/remove_peering.php | 84 + .../NetworksClient/switch_to_custom_mode.php | 76 + .../V1/NetworksClient/update_peering.php | 84 + .../samples/V1/NodeGroupsClient/add_nodes.php | 87 + .../V1/NodeGroupsClient/aggregated_list.php | 68 + .../V1/samples/V1/NodeGroupsClient/delete.php | 78 + .../V1/NodeGroupsClient/delete_nodes.php | 87 + .../V1/samples/V1/NodeGroupsClient/get.php | 69 + .../V1/NodeGroupsClient/get_iam_policy.php | 69 + .../V1/samples/V1/NodeGroupsClient/insert.php | 82 + .../V1/samples/V1/NodeGroupsClient/list.php | 70 + .../V1/NodeGroupsClient/list_nodes.php | 72 + .../V1/samples/V1/NodeGroupsClient/patch.php | 82 + .../NodeGroupsClient/perform_maintenance.php | 87 + .../V1/NodeGroupsClient/set_iam_policy.php | 78 + .../V1/NodeGroupsClient/set_node_template.php | 87 + .../simulate_maintenance_event.php | 87 + .../NodeGroupsClient/test_iam_permissions.php | 78 + .../NodeTemplatesClient/aggregated_list.php | 68 + .../samples/V1/NodeTemplatesClient/delete.php | 78 + .../V1/samples/V1/NodeTemplatesClient/get.php | 69 + .../V1/NodeTemplatesClient/get_iam_policy.php | 69 + .../samples/V1/NodeTemplatesClient/insert.php | 80 + .../samples/V1/NodeTemplatesClient/list.php | 70 + .../V1/NodeTemplatesClient/set_iam_policy.php | 78 + .../test_iam_permissions.php | 78 + .../V1/NodeTypesClient/aggregated_list.php | 68 + .../V1/samples/V1/NodeTypesClient/get.php | 69 + .../V1/samples/V1/NodeTypesClient/list.php | 70 + .../aggregated_list.php | 68 + .../V1/PacketMirroringsClient/delete.php | 78 + .../samples/V1/PacketMirroringsClient/get.php | 69 + .../V1/PacketMirroringsClient/insert.php | 80 + .../V1/PacketMirroringsClient/list.php | 70 + .../V1/PacketMirroringsClient/patch.php | 87 + .../test_iam_permissions.php | 78 + .../V1/ProjectsClient/disable_xpn_host.php | 74 + .../ProjectsClient/disable_xpn_resource.php | 81 + .../V1/ProjectsClient/enable_xpn_host.php | 74 + .../V1/ProjectsClient/enable_xpn_resource.php | 78 + .../V1/samples/V1/ProjectsClient/get.php | 65 + .../V1/ProjectsClient/get_xpn_host.php | 65 + .../V1/ProjectsClient/get_xpn_resources.php | 68 + .../V1/ProjectsClient/list_xpn_hosts.php | 72 + .../samples/V1/ProjectsClient/move_disk.php | 78 + .../V1/ProjectsClient/move_instance.php | 78 + .../ProjectsClient/set_cloud_armor_tier.php | 78 + .../set_common_instance_metadata.php | 78 + .../set_default_network_tier.php | 81 + .../set_usage_export_bucket.php | 78 + .../announce.php | 76 + .../PublicAdvertisedPrefixesClient/delete.php | 76 + .../V1/PublicAdvertisedPrefixesClient/get.php | 67 + .../PublicAdvertisedPrefixesClient/insert.php | 78 + .../PublicAdvertisedPrefixesClient/list.php | 68 + .../PublicAdvertisedPrefixesClient/patch.php | 84 + .../withdraw.php | 76 + .../aggregated_list.php | 68 + .../announce.php | 78 + .../PublicDelegatedPrefixesClient/delete.php | 78 + .../V1/PublicDelegatedPrefixesClient/get.php | 69 + .../PublicDelegatedPrefixesClient/insert.php | 84 + .../V1/PublicDelegatedPrefixesClient/list.php | 70 + .../PublicDelegatedPrefixesClient/patch.php | 87 + .../withdraw.php | 78 + .../V1/RegionAutoscalersClient/delete.php | 78 + .../V1/RegionAutoscalersClient/get.php | 69 + .../V1/RegionAutoscalersClient/insert.php | 80 + .../V1/RegionAutoscalersClient/list.php | 70 + .../V1/RegionAutoscalersClient/patch.php | 80 + .../V1/RegionAutoscalersClient/update.php | 80 + .../V1/RegionBackendServicesClient/delete.php | 78 + .../V1/RegionBackendServicesClient/get.php | 69 + .../get_health.php | 78 + .../get_iam_policy.php | 69 + .../V1/RegionBackendServicesClient/insert.php | 80 + .../V1/RegionBackendServicesClient/list.php | 70 + .../list_usable.php | 70 + .../V1/RegionBackendServicesClient/patch.php | 87 + .../set_iam_policy.php | 78 + .../set_security_policy.php | 87 + .../test_iam_permissions.php | 78 + .../V1/RegionBackendServicesClient/update.php | 87 + .../aggregated_list.php | 68 + .../V1/RegionCommitmentsClient/get.php | 69 + .../V1/RegionCommitmentsClient/insert.php | 80 + .../V1/RegionCommitmentsClient/list.php | 70 + .../V1/RegionCommitmentsClient/update.php | 82 + .../samples/V1/RegionDiskTypesClient/get.php | 69 + .../samples/V1/RegionDiskTypesClient/list.php | 70 + .../add_resource_policies.php | 87 + .../V1/RegionDisksClient/bulk_insert.php | 80 + .../V1/RegionDisksClient/create_snapshot.php | 82 + .../samples/V1/RegionDisksClient/delete.php | 78 + .../V1/samples/V1/RegionDisksClient/get.php | 69 + .../V1/RegionDisksClient/get_iam_policy.php | 69 + .../samples/V1/RegionDisksClient/insert.php | 80 + .../V1/samples/V1/RegionDisksClient/list.php | 70 + .../remove_resource_policies.php | 87 + .../samples/V1/RegionDisksClient/resize.php | 82 + .../V1/RegionDisksClient/set_iam_policy.php | 78 + .../V1/RegionDisksClient/set_labels.php | 87 + .../start_async_replication.php | 87 + .../stop_async_replication.php | 78 + .../stop_group_async_replication.php | 84 + .../test_iam_permissions.php | 78 + .../samples/V1/RegionDisksClient/update.php | 82 + .../delete.php | 78 + .../RegionHealthCheckServicesClient/get.php | 69 + .../insert.php | 84 + .../RegionHealthCheckServicesClient/list.php | 70 + .../RegionHealthCheckServicesClient/patch.php | 87 + .../V1/RegionHealthChecksClient/delete.php | 78 + .../V1/RegionHealthChecksClient/get.php | 69 + .../V1/RegionHealthChecksClient/insert.php | 80 + .../V1/RegionHealthChecksClient/list.php | 70 + .../V1/RegionHealthChecksClient/patch.php | 82 + .../V1/RegionHealthChecksClient/update.php | 87 + .../abandon_instances.php | 90 + .../apply_updates_to_instances.php | 90 + .../create_instances.php | 90 + .../delete.php | 78 + .../delete_instances.php | 90 + .../delete_per_instance_configs.php | 90 + .../RegionInstanceGroupManagersClient/get.php | 69 + .../insert.php | 84 + .../list.php | 70 + .../list_errors.php | 76 + .../list_managed_instances.php | 79 + .../list_per_instance_configs.php | 79 + .../patch.php | 87 + .../patch_per_instance_configs.php | 90 + .../recreate_instances.php | 90 + .../resize.php | 89 + .../set_instance_template.php | 90 + .../set_target_pools.php | 90 + .../update_per_instance_configs.php | 90 + .../V1/RegionInstanceGroupsClient/get.php | 69 + .../V1/RegionInstanceGroupsClient/list.php | 70 + .../list_instances.php | 81 + .../set_named_ports.php | 87 + .../RegionInstanceTemplatesClient/delete.php | 78 + .../V1/RegionInstanceTemplatesClient/get.php | 69 + .../RegionInstanceTemplatesClient/insert.php | 80 + .../V1/RegionInstanceTemplatesClient/list.php | 70 + .../V1/RegionInstancesClient/bulk_insert.php | 84 + .../RegionInstantSnapshotsClient/delete.php | 78 + .../V1/RegionInstantSnapshotsClient/get.php | 69 + .../get_iam_policy.php | 69 + .../RegionInstantSnapshotsClient/insert.php | 80 + .../V1/RegionInstantSnapshotsClient/list.php | 70 + .../set_iam_policy.php | 78 + .../set_labels.php | 87 + .../test_iam_permissions.php | 78 + .../attach_network_endpoints.php | 90 + .../delete.php | 78 + .../detach_network_endpoints.php | 90 + .../RegionNetworkEndpointGroupsClient/get.php | 69 + .../insert.php | 84 + .../list.php | 70 + .../list_network_endpoints.php | 79 + .../add_association.php | 87 + .../add_rule.php | 87 + .../clone_rules.php | 78 + .../delete.php | 78 + .../get.php | 69 + .../get_association.php | 73 + .../get_effective_firewalls.php | 73 + .../get_iam_policy.php | 69 + .../get_rule.php | 69 + .../insert.php | 84 + .../list.php | 70 + .../patch.php | 87 + .../patch_rule.php | 87 + .../remove_association.php | 82 + .../remove_rule.php | 78 + .../set_iam_policy.php | 78 + .../test_iam_permissions.php | 78 + .../delete.php | 78 + .../RegionNotificationEndpointsClient/get.php | 69 + .../insert.php | 84 + .../list.php | 70 + .../V1/RegionOperationsClient/delete.php | 69 + .../samples/V1/RegionOperationsClient/get.php | 69 + .../V1/RegionOperationsClient/list.php | 70 + .../V1/RegionOperationsClient/wait.php | 69 + .../RegionSecurityPoliciesClient/add_rule.php | 87 + .../RegionSecurityPoliciesClient/delete.php | 78 + .../V1/RegionSecurityPoliciesClient/get.php | 69 + .../RegionSecurityPoliciesClient/get_rule.php | 69 + .../RegionSecurityPoliciesClient/insert.php | 80 + .../V1/RegionSecurityPoliciesClient/list.php | 70 + .../V1/RegionSecurityPoliciesClient/patch.php | 87 + .../patch_rule.php | 87 + .../remove_rule.php | 78 + .../V1/RegionSslCertificatesClient/delete.php | 78 + .../V1/RegionSslCertificatesClient/get.php | 69 + .../V1/RegionSslCertificatesClient/insert.php | 80 + .../V1/RegionSslCertificatesClient/list.php | 70 + .../V1/RegionSslPoliciesClient/delete.php | 78 + .../V1/RegionSslPoliciesClient/get.php | 69 + .../V1/RegionSslPoliciesClient/insert.php | 80 + .../V1/RegionSslPoliciesClient/list.php | 70 + .../list_available_features.php | 67 + .../V1/RegionSslPoliciesClient/patch.php | 82 + .../RegionTargetHttpProxiesClient/delete.php | 78 + .../V1/RegionTargetHttpProxiesClient/get.php | 69 + .../RegionTargetHttpProxiesClient/insert.php | 80 + .../V1/RegionTargetHttpProxiesClient/list.php | 70 + .../set_url_map.php | 87 + .../RegionTargetHttpsProxiesClient/delete.php | 78 + .../V1/RegionTargetHttpsProxiesClient/get.php | 69 + .../RegionTargetHttpsProxiesClient/insert.php | 80 + .../RegionTargetHttpsProxiesClient/list.php | 70 + .../RegionTargetHttpsProxiesClient/patch.php | 87 + .../set_ssl_certificates.php | 90 + .../set_url_map.php | 87 + .../RegionTargetTcpProxiesClient/delete.php | 78 + .../V1/RegionTargetTcpProxiesClient/get.php | 69 + .../RegionTargetTcpProxiesClient/insert.php | 80 + .../V1/RegionTargetTcpProxiesClient/list.php | 70 + .../samples/V1/RegionUrlMapsClient/delete.php | 78 + .../V1/samples/V1/RegionUrlMapsClient/get.php | 69 + .../samples/V1/RegionUrlMapsClient/insert.php | 80 + .../samples/V1/RegionUrlMapsClient/list.php | 70 + .../samples/V1/RegionUrlMapsClient/patch.php | 82 + .../samples/V1/RegionUrlMapsClient/update.php | 82 + .../V1/RegionUrlMapsClient/validate.php | 78 + .../V1/samples/V1/RegionZonesClient/list.php | 70 + .../V1/samples/V1/RegionsClient/get.php | 67 + .../V1/samples/V1/RegionsClient/list.php | 68 + .../V1/ReservationsClient/aggregated_list.php | 68 + .../samples/V1/ReservationsClient/delete.php | 78 + .../V1/samples/V1/ReservationsClient/get.php | 69 + .../V1/ReservationsClient/get_iam_policy.php | 69 + .../samples/V1/ReservationsClient/insert.php | 80 + .../V1/samples/V1/ReservationsClient/list.php | 70 + .../samples/V1/ReservationsClient/resize.php | 87 + .../V1/ReservationsClient/set_iam_policy.php | 78 + .../test_iam_permissions.php | 78 + .../samples/V1/ReservationsClient/update.php | 82 + .../aggregated_list.php | 68 + .../V1/ResourcePoliciesClient/delete.php | 78 + .../samples/V1/ResourcePoliciesClient/get.php | 69 + .../ResourcePoliciesClient/get_iam_policy.php | 69 + .../V1/ResourcePoliciesClient/insert.php | 80 + .../V1/ResourcePoliciesClient/list.php | 70 + .../V1/ResourcePoliciesClient/patch.php | 87 + .../ResourcePoliciesClient/set_iam_policy.php | 78 + .../test_iam_permissions.php | 78 + .../V1/RoutersClient/aggregated_list.php | 68 + .../V1/samples/V1/RoutersClient/delete.php | 78 + .../V1/samples/V1/RoutersClient/get.php | 69 + .../V1/RoutersClient/get_nat_ip_info.php | 69 + .../V1/RoutersClient/get_nat_mapping_info.php | 72 + .../V1/RoutersClient/get_router_status.php | 69 + .../V1/samples/V1/RoutersClient/insert.php | 80 + .../V1/samples/V1/RoutersClient/list.php | 70 + .../V1/samples/V1/RoutersClient/patch.php | 82 + .../V1/samples/V1/RoutersClient/preview.php | 73 + .../V1/samples/V1/RoutersClient/update.php | 82 + .../V1/samples/V1/RoutesClient/delete.php | 76 + .../V1/samples/V1/RoutesClient/get.php | 67 + .../V1/samples/V1/RoutesClient/insert.php | 78 + .../V1/samples/V1/RoutesClient/list.php | 68 + .../V1/SecurityPoliciesClient/add_rule.php | 84 + .../aggregated_list.php | 68 + .../V1/SecurityPoliciesClient/delete.php | 76 + .../samples/V1/SecurityPoliciesClient/get.php | 67 + .../V1/SecurityPoliciesClient/get_rule.php | 67 + .../V1/SecurityPoliciesClient/insert.php | 78 + .../V1/SecurityPoliciesClient/list.php | 68 + .../list_preconfigured_expression_sets.php | 65 + .../V1/SecurityPoliciesClient/patch.php | 80 + .../V1/SecurityPoliciesClient/patch_rule.php | 84 + .../V1/SecurityPoliciesClient/remove_rule.php | 76 + .../V1/SecurityPoliciesClient/set_labels.php | 84 + .../aggregated_list.php | 68 + .../V1/ServiceAttachmentsClient/delete.php | 78 + .../V1/ServiceAttachmentsClient/get.php | 69 + .../get_iam_policy.php | 69 + .../V1/ServiceAttachmentsClient/insert.php | 80 + .../V1/ServiceAttachmentsClient/list.php | 70 + .../V1/ServiceAttachmentsClient/patch.php | 87 + .../set_iam_policy.php | 78 + .../test_iam_permissions.php | 78 + .../V1/SnapshotSettingsServiceClient/get.php | 65 + .../SnapshotSettingsServiceClient/patch.php | 78 + .../V1/samples/V1/SnapshotsClient/delete.php | 76 + .../V1/samples/V1/SnapshotsClient/get.php | 67 + .../V1/SnapshotsClient/get_iam_policy.php | 67 + .../V1/samples/V1/SnapshotsClient/insert.php | 78 + .../V1/samples/V1/SnapshotsClient/list.php | 68 + .../V1/SnapshotsClient/set_iam_policy.php | 71 + .../samples/V1/SnapshotsClient/set_labels.php | 80 + .../SnapshotsClient/test_iam_permissions.php | 75 + .../SslCertificatesClient/aggregated_list.php | 68 + .../V1/SslCertificatesClient/delete.php | 76 + .../samples/V1/SslCertificatesClient/get.php | 67 + .../V1/SslCertificatesClient/insert.php | 78 + .../samples/V1/SslCertificatesClient/list.php | 68 + .../V1/SslPoliciesClient/aggregated_list.php | 68 + .../samples/V1/SslPoliciesClient/delete.php | 76 + .../V1/samples/V1/SslPoliciesClient/get.php | 67 + .../samples/V1/SslPoliciesClient/insert.php | 78 + .../V1/samples/V1/SslPoliciesClient/list.php | 68 + .../list_available_features.php | 65 + .../V1/samples/V1/SslPoliciesClient/patch.php | 80 + .../aggregated_list.php | 68 + .../samples/V1/StoragePoolTypesClient/get.php | 69 + .../V1/StoragePoolTypesClient/list.php | 70 + .../V1/StoragePoolsClient/aggregated_list.php | 68 + .../samples/V1/StoragePoolsClient/delete.php | 78 + .../V1/samples/V1/StoragePoolsClient/get.php | 69 + .../V1/StoragePoolsClient/get_iam_policy.php | 69 + .../samples/V1/StoragePoolsClient/insert.php | 80 + .../V1/samples/V1/StoragePoolsClient/list.php | 67 + .../V1/StoragePoolsClient/list_disks.php | 69 + .../V1/StoragePoolsClient/set_iam_policy.php | 78 + .../test_iam_permissions.php | 78 + .../samples/V1/StoragePoolsClient/update.php | 82 + .../V1/SubnetworksClient/aggregated_list.php | 68 + .../samples/V1/SubnetworksClient/delete.php | 78 + .../expand_ip_cidr_range.php | 87 + .../V1/samples/V1/SubnetworksClient/get.php | 69 + .../V1/SubnetworksClient/get_iam_policy.php | 69 + .../samples/V1/SubnetworksClient/insert.php | 80 + .../V1/samples/V1/SubnetworksClient/list.php | 70 + .../V1/SubnetworksClient/list_usable.php | 68 + .../V1/samples/V1/SubnetworksClient/patch.php | 82 + .../V1/SubnetworksClient/set_iam_policy.php | 78 + .../set_private_ip_google_access.php | 90 + .../test_iam_permissions.php | 78 + .../V1/TargetGrpcProxiesClient/delete.php | 76 + .../V1/TargetGrpcProxiesClient/get.php | 67 + .../V1/TargetGrpcProxiesClient/insert.php | 78 + .../V1/TargetGrpcProxiesClient/list.php | 68 + .../V1/TargetGrpcProxiesClient/patch.php | 80 + .../aggregated_list.php | 68 + .../V1/TargetHttpProxiesClient/delete.php | 76 + .../V1/TargetHttpProxiesClient/get.php | 67 + .../V1/TargetHttpProxiesClient/insert.php | 78 + .../V1/TargetHttpProxiesClient/list.php | 68 + .../V1/TargetHttpProxiesClient/patch.php | 80 + .../TargetHttpProxiesClient/set_url_map.php | 84 + .../aggregated_list.php | 68 + .../V1/TargetHttpsProxiesClient/delete.php | 76 + .../V1/TargetHttpsProxiesClient/get.php | 67 + .../V1/TargetHttpsProxiesClient/insert.php | 78 + .../V1/TargetHttpsProxiesClient/list.php | 68 + .../V1/TargetHttpsProxiesClient/patch.php | 84 + .../set_certificate_map.php | 84 + .../set_quic_override.php | 84 + .../set_ssl_certificates.php | 84 + .../set_ssl_policy.php | 84 + .../TargetHttpsProxiesClient/set_url_map.php | 84 + .../TargetInstancesClient/aggregated_list.php | 68 + .../V1/TargetInstancesClient/delete.php | 78 + .../samples/V1/TargetInstancesClient/get.php | 69 + .../V1/TargetInstancesClient/insert.php | 80 + .../samples/V1/TargetInstancesClient/list.php | 70 + .../set_security_policy.php | 87 + .../V1/TargetPoolsClient/add_health_check.php | 87 + .../V1/TargetPoolsClient/add_instance.php | 87 + .../V1/TargetPoolsClient/aggregated_list.php | 68 + .../samples/V1/TargetPoolsClient/delete.php | 78 + .../V1/samples/V1/TargetPoolsClient/get.php | 69 + .../V1/TargetPoolsClient/get_health.php | 78 + .../samples/V1/TargetPoolsClient/insert.php | 80 + .../V1/samples/V1/TargetPoolsClient/list.php | 70 + .../TargetPoolsClient/remove_health_check.php | 87 + .../V1/TargetPoolsClient/remove_instance.php | 87 + .../V1/TargetPoolsClient/set_backup.php | 82 + .../TargetPoolsClient/set_security_policy.php | 87 + .../V1/TargetSslProxiesClient/delete.php | 76 + .../samples/V1/TargetSslProxiesClient/get.php | 67 + .../V1/TargetSslProxiesClient/insert.php | 78 + .../V1/TargetSslProxiesClient/list.php | 68 + .../set_backend_service.php | 84 + .../set_certificate_map.php | 84 + .../set_proxy_header.php | 84 + .../set_ssl_certificates.php | 84 + .../TargetSslProxiesClient/set_ssl_policy.php | 84 + .../aggregated_list.php | 68 + .../V1/TargetTcpProxiesClient/delete.php | 76 + .../samples/V1/TargetTcpProxiesClient/get.php | 67 + .../V1/TargetTcpProxiesClient/insert.php | 78 + .../V1/TargetTcpProxiesClient/list.php | 68 + .../set_backend_service.php | 84 + .../set_proxy_header.php | 84 + .../aggregated_list.php | 68 + .../V1/TargetVpnGatewaysClient/delete.php | 78 + .../V1/TargetVpnGatewaysClient/get.php | 69 + .../V1/TargetVpnGatewaysClient/insert.php | 80 + .../V1/TargetVpnGatewaysClient/list.php | 70 + .../V1/TargetVpnGatewaysClient/set_labels.php | 87 + .../V1/UrlMapsClient/aggregated_list.php | 68 + .../V1/samples/V1/UrlMapsClient/delete.php | 76 + .../V1/samples/V1/UrlMapsClient/get.php | 67 + .../V1/samples/V1/UrlMapsClient/insert.php | 78 + .../V1/UrlMapsClient/invalidate_cache.php | 80 + .../V1/samples/V1/UrlMapsClient/list.php | 68 + .../V1/samples/V1/UrlMapsClient/patch.php | 80 + .../V1/samples/V1/UrlMapsClient/update.php | 80 + .../V1/samples/V1/UrlMapsClient/validate.php | 71 + .../V1/VpnGatewaysClient/aggregated_list.php | 68 + .../samples/V1/VpnGatewaysClient/delete.php | 78 + .../V1/samples/V1/VpnGatewaysClient/get.php | 69 + .../V1/VpnGatewaysClient/get_status.php | 69 + .../samples/V1/VpnGatewaysClient/insert.php | 80 + .../V1/samples/V1/VpnGatewaysClient/list.php | 70 + .../V1/VpnGatewaysClient/set_labels.php | 87 + .../test_iam_permissions.php | 78 + .../V1/VpnTunnelsClient/aggregated_list.php | 68 + .../V1/samples/V1/VpnTunnelsClient/delete.php | 78 + .../V1/samples/V1/VpnTunnelsClient/get.php | 69 + .../V1/samples/V1/VpnTunnelsClient/insert.php | 80 + .../V1/samples/V1/VpnTunnelsClient/list.php | 70 + .../V1/VpnTunnelsClient/set_labels.php | 87 + .../V1/ZoneOperationsClient/delete.php | 69 + .../samples/V1/ZoneOperationsClient/get.php | 69 + .../samples/V1/ZoneOperationsClient/list.php | 70 + .../samples/V1/ZoneOperationsClient/wait.php | 69 + .../Compute/V1/samples/V1/ZonesClient/get.php | 67 + .../V1/samples/V1/ZonesClient/list.php | 68 + .../V1/src/V1/AcceleratorTypesClient.php | 34 + .../Compute/V1/src/V1/AddressesClient.php | 34 + .../Compute/V1/src/V1/AutoscalersClient.php | 34 + .../V1/src/V1/BackendBucketsClient.php | 34 + .../V1/src/V1/BackendServicesClient.php | 34 + .../src/V1/Client/AcceleratorTypesClient.php | 256 + .../V1/src/V1/Client/AddressesClient.php | 410 ++ .../V1/src/V1/Client/AutoscalersClient.php | 410 ++ .../V1/src/V1/Client/BackendBucketsClient.php | 541 ++ .../src/V1/Client/BackendServicesClient.php | 647 ++ .../V1/src/V1/Client/DiskTypesClient.php | 253 + .../Compute/V1/src/V1/Client/DisksClient.php | 698 ++ .../V1/Client/ExternalVpnGatewaysClient.php | 385 ++ .../src/V1/Client/FirewallPoliciesClient.php | 699 ++ .../V1/src/V1/Client/FirewallsClient.php | 383 ++ .../src/V1/Client/ForwardingRulesClient.php | 436 ++ .../src/V1/Client/GlobalAddressesClient.php | 383 ++ .../V1/Client/GlobalForwardingRulesClient.php | 409 ++ .../GlobalNetworkEndpointGroupsClient.php | 412 ++ .../src/V1/Client/GlobalOperationsClient.php | 305 + .../GlobalOrganizationOperationsClient.php | 253 + .../GlobalPublicDelegatedPrefixesClient.php | 357 + .../V1/src/V1/Client/HealthChecksClient.php | 409 ++ .../src/V1/Client/ImageFamilyViewsClient.php | 200 + .../Compute/V1/src/V1/Client/ImagesClient.php | 515 ++ ...stanceGroupManagerResizeRequestsClient.php | 363 + .../V1/Client/InstanceGroupManagersClient.php | 759 +++ .../V1/src/V1/Client/InstanceGroupsClient.php | 462 ++ .../Client/InstanceSettingsServiceClient.php | 279 + .../src/V1/Client/InstanceTemplatesClient.php | 437 ++ .../V1/src/V1/Client/InstancesClient.php | 1487 +++++ .../src/V1/Client/InstantSnapshotsClient.php | 464 ++ .../Client/InterconnectAttachmentsClient.php | 411 ++ .../V1/Client/InterconnectLocationsClient.php | 227 + .../InterconnectRemoteLocationsClient.php | 227 + .../V1/src/V1/Client/InterconnectsClient.php | 437 ++ .../V1/src/V1/Client/LicenseCodesClient.php | 227 + .../V1/src/V1/Client/LicensesClient.php | 411 ++ .../V1/src/V1/Client/MachineImagesClient.php | 411 ++ .../V1/src/V1/Client/MachineTypesClient.php | 253 + .../V1/Client/NetworkAttachmentsClient.php | 465 ++ .../NetworkEdgeSecurityServicesClient.php | 359 + .../V1/Client/NetworkEndpointGroupsClient.php | 467 ++ .../Client/NetworkFirewallPoliciesClient.php | 651 ++ .../V1/src/V1/Client/NetworksClient.php | 514 ++ .../V1/src/V1/Client/NodeGroupsClient.php | 620 ++ .../V1/src/V1/Client/NodeTemplatesClient.php | 438 ++ .../V1/src/V1/Client/NodeTypesClient.php | 253 + .../src/V1/Client/PacketMirroringsClient.php | 411 ++ .../V1/src/V1/Client/ProjectsClient.php | 591 ++ .../Client/PublicAdvertisedPrefixesClient.php | 409 ++ .../Client/PublicDelegatedPrefixesClient.php | 437 ++ .../src/V1/Client/RegionAutoscalersClient.php | 384 ++ .../V1/Client/RegionBackendServicesClient.php | 545 ++ .../src/V1/Client/RegionCommitmentsClient.php | 358 + .../src/V1/Client/RegionDiskTypesClient.php | 227 + .../V1/src/V1/Client/RegionDisksClient.php | 673 ++ .../RegionHealthCheckServicesClient.php | 358 + .../V1/Client/RegionHealthChecksClient.php | 384 ++ .../RegionInstanceGroupManagersClient.php | 735 ++ .../V1/Client/RegionInstanceGroupsClient.php | 332 + .../Client/RegionInstanceTemplatesClient.php | 332 + .../src/V1/Client/RegionInstancesClient.php | 252 + .../Client/RegionInstantSnapshotsClient.php | 439 ++ .../RegionNetworkEndpointGroupsClient.php | 413 ++ .../RegionNetworkFirewallPoliciesClient.php | 687 ++ .../RegionNotificationEndpointsClient.php | 332 + .../src/V1/Client/RegionOperationsClient.php | 279 + .../Client/RegionSecurityPoliciesClient.php | 463 ++ .../V1/Client/RegionSslCertificatesClient.php | 332 + .../src/V1/Client/RegionSslPoliciesClient.php | 386 ++ .../Client/RegionTargetHttpProxiesClient.php | 358 + .../Client/RegionTargetHttpsProxiesClient.php | 411 ++ .../Client/RegionTargetTcpProxiesClient.php | 332 + .../V1/src/V1/Client/RegionUrlMapsClient.php | 411 ++ .../V1/src/V1/Client/RegionZonesClient.php | 200 + .../V1/src/V1/Client/RegionsClient.php | 227 + .../V1/src/V1/Client/ReservationsClient.php | 490 ++ .../src/V1/Client/ResourcePoliciesClient.php | 464 ++ .../V1/src/V1/Client/RoutersClient.php | 517 ++ .../Compute/V1/src/V1/Client/RoutesClient.php | 331 + .../src/V1/Client/SecurityPoliciesClient.php | 542 ++ .../V1/Client/ServiceAttachmentsClient.php | 465 ++ .../Client/SnapshotSettingsServiceClient.php | 278 + .../V1/src/V1/Client/SnapshotsClient.php | 437 ++ .../src/V1/Client/SslCertificatesClient.php | 357 + .../V1/src/V1/Client/SslPoliciesClient.php | 410 ++ .../src/V1/Client/StoragePoolTypesClient.php | 253 + .../V1/src/V1/Client/StoragePoolsClient.php | 492 ++ .../V1/src/V1/Client/SubnetworksClient.php | 542 ++ .../src/V1/Client/TargetGrpcProxiesClient.php | 357 + .../src/V1/Client/TargetHttpProxiesClient.php | 409 ++ .../V1/Client/TargetHttpsProxiesClient.php | 514 ++ .../src/V1/Client/TargetInstancesClient.php | 384 ++ .../V1/src/V1/Client/TargetPoolsClient.php | 541 ++ .../src/V1/Client/TargetSslProxiesClient.php | 461 ++ .../src/V1/Client/TargetTcpProxiesClient.php | 409 ++ .../src/V1/Client/TargetVpnGatewaysClient.php | 384 ++ .../V1/src/V1/Client/UrlMapsClient.php | 462 ++ .../V1/src/V1/Client/VpnGatewaysClient.php | 438 ++ .../V1/src/V1/Client/VpnTunnelsClient.php | 384 ++ .../V1/src/V1/Client/ZoneOperationsClient.php | 279 + .../Compute/V1/src/V1/Client/ZonesClient.php | 227 + .../Compute/V1/src/V1/DiskTypesClient.php | 34 + .../Compute/V1/src/V1/DisksClient.php | 34 + .../src/V1/Enums/AccessConfig/NetworkTier.php | 42 + .../V1/src/V1/Enums/AccessConfig/Type.php | 38 + .../V1/src/V1/Enums/Address/AddressType.php | 40 + .../V1/src/V1/Enums/Address/IpVersion.php | 40 + .../src/V1/Enums/Address/Ipv6EndpointType.php | 38 + .../V1/src/V1/Enums/Address/NetworkTier.php | 42 + .../V1/src/V1/Enums/Address/Purpose.php | 50 + .../V1/src/V1/Enums/Address/Status.php | 40 + .../VmFamily.php | 40 + .../WorkloadType.php | 41 + .../PBInterface.php | 40 + .../V1/Enums/AttachedDisk/Architecture.php | 40 + .../V1/src/V1/Enums/AttachedDisk/Mode.php | 38 + .../src/V1/Enums/AttachedDisk/PBInterface.php | 38 + .../src/V1/Enums/AttachedDisk/SavedState.php | 38 + .../V1/src/V1/Enums/AttachedDisk/Type.php | 38 + .../Architecture.php | 41 + .../OnUpdateAction.php | 41 + .../src/V1/Enums/AuditLogConfig/LogType.php | 42 + .../PermissionType.php | 45 + .../V1/src/V1/Enums/Autoscaler/Status.php | 42 + .../V1/Enums/AutoscalerStatusDetails/Type.php | 74 + .../src/V1/Enums/AutoscalingPolicy/Mode.php | 42 + .../PredictiveMethod.php | 40 + .../UtilizationTargetType.php | 42 + .../V1/src/V1/Enums/Backend/BalancingMode.php | 40 + .../V1/src/V1/Enums/Backend/Preference.php | 40 + .../Enums/BackendBucket/CompressionMode.php | 38 + .../BackendBucketCdnPolicy/CacheMode.php | 42 + .../Enums/BackendService/CompressionMode.php | 38 + .../BackendService/LoadBalancingScheme.php | 47 + .../Enums/BackendService/LocalityLbPolicy.php | 50 + .../src/V1/Enums/BackendService/Protocol.php | 50 + .../Enums/BackendService/SessionAffinity.php | 50 + .../BackendServiceCdnPolicy/CacheMode.php | 42 + ...nnectionPersistenceOnUnhealthyBackends.php | 42 + .../TrackingMode.php | 41 + .../Name.php | 51 + .../BackendServiceLogConfig/OptionalMode.php | 40 + .../V1/src/V1/Enums/BfdPacket/Diagnostic.php | 54 + .../V1/src/V1/Enums/BfdPacket/State.php | 44 + .../BfdSessionInitializationMode.php | 41 + .../V1/Enums/BfdStatus/LocalDiagnostic.php | 54 + .../V1/src/V1/Enums/BfdStatus/LocalState.php | 44 + .../BulkInsertOperationStatus/Status.php | 42 + .../V1/src/V1/Enums/Commitment/Category.php | 40 + .../V1/src/V1/Enums/Commitment/Plan.php | 40 + .../V1/src/V1/Enums/Commitment/Status.php | 44 + .../V1/src/V1/Enums/Commitment/Type.php | 70 + .../Compute/V1/src/V1/Enums/Condition/Iam.php | 48 + .../Compute/V1/src/V1/Enums/Condition/Op.php | 46 + .../Compute/V1/src/V1/Enums/Condition/Sys.php | 42 + .../src/V1/Enums/DeprecationStatus/State.php | 42 + .../V1/src/V1/Enums/Disk/Architecture.php | 40 + .../Compute/V1/src/V1/Enums/Disk/Status.php | 46 + .../InstantiateFrom.php | 49 + .../State.php | 47 + .../Enums/DistributionPolicy/TargetShape.php | 42 + .../V1/Enums/ExchangedPeeringRoute/Type.php | 40 + .../ExternalVpnGateway/RedundancyType.php | 40 + .../V1/Enums/FileContentBuffer/FileType.php | 40 + .../V1/src/V1/Enums/Firewall/Direction.php | 38 + .../V1/Enums/FirewallLogConfig/Metadata.php | 38 + .../V1/Enums/FirewallPolicyRule/Direction.php | 38 + .../FirewallPolicyRuleSecureTag/State.php | 38 + .../Enums/ForwardingRule/IPProtocolEnum.php | 48 + .../src/V1/Enums/ForwardingRule/IpVersion.php | 40 + .../ForwardingRule/LoadBalancingScheme.php | 47 + .../V1/Enums/ForwardingRule/NetworkTier.php | 42 + .../ForwardingRule/PscConnectionStatus.php | 47 + .../GRPCHealthCheck/PortSpecification.php | 41 + .../V1/src/V1/Enums/GuestOsFeature/Type.php | 58 + .../HTTP2HealthCheck/PortSpecification.php | 41 + .../V1/Enums/HTTP2HealthCheck/ProxyHeader.php | 38 + .../HTTPHealthCheck/PortSpecification.php | 41 + .../V1/Enums/HTTPHealthCheck/ProxyHeader.php | 38 + .../HTTPSHealthCheck/PortSpecification.php | 41 + .../V1/Enums/HTTPSHealthCheck/ProxyHeader.php | 38 + .../V1/src/V1/Enums/HealthCheck/Type.php | 48 + .../HealthStatusAggregationPolicy.php | 40 + .../src/V1/Enums/HealthStatus/HealthState.php | 38 + .../src/V1/Enums/HealthStatus/WeightError.php | 42 + .../HealthState.php | 43 + .../RedirectResponseCode.php | 45 + .../V1/src/V1/Enums/Image/Architecture.php | 40 + .../V1/src/V1/Enums/Image/SourceType.php | 36 + .../Compute/V1/src/V1/Enums/Image/Status.php | 42 + .../Instance/KeyRevocationActionType.php | 41 + .../Instance/PrivateIpv6GoogleAccess.php | 41 + .../V1/src/V1/Enums/Instance/Status.php | 54 + .../ListManagedInstancesResults.php | 40 + .../DefaultActionOnFailure.php | 40 + .../ForceUpdateOnRepair.php | 40 + .../State.php | 46 + .../InstanceRedistributionType.php | 36 + .../MinimalAction.php | 35 + .../MostDisruptiveAllowedAction.php | 36 + .../ReplacementMethod.php | 40 + .../InstanceGroupManagerUpdatePolicy/Type.php | 36 + .../MinimalAction.php | 36 + .../MostDisruptiveAllowedAction.php | 36 + .../InstanceState.php | 39 + .../Action.php | 61 + .../KeyRevocationActionType.php | 41 + .../PrivateIpv6GoogleAccess.php | 41 + .../Enums/InstanceWithNamedPorts/Status.php | 54 + .../Type.php | 43 + .../V1/Enums/InstantSnapshot/Architecture.php | 40 + .../src/V1/Enums/InstantSnapshot/Status.php | 44 + .../Enums/Interconnect/AvailableFeatures.php | 34 + .../Enums/Interconnect/InterconnectType.php | 40 + .../V1/src/V1/Enums/Interconnect/LinkType.php | 38 + .../Enums/Interconnect/OperationalStatus.php | 38 + .../Enums/Interconnect/RequestedFeatures.php | 34 + .../V1/src/V1/Enums/Interconnect/State.php | 38 + .../InterconnectAttachment/Bandwidth.php | 58 + .../EdgeAvailabilityDomain.php | 42 + .../InterconnectAttachment/Encryption.php | 38 + .../OperationalStatus.php | 39 + .../InterconnectAttachment/StackType.php | 38 + .../V1/Enums/InterconnectAttachment/State.php | 48 + .../V1/Enums/InterconnectAttachment/Type.php | 40 + .../BgpMd5.php | 41 + .../BundleAggregationType.php | 40 + .../BundleOperationalStatus.php | 40 + .../State.php | 38 + .../State.php | 45 + .../OperationalStatus.php | 40 + .../AvailableFeatures.php | 37 + .../AvailableLinkTypes.php | 39 + .../Enums/InterconnectLocation/Continent.php | 54 + .../V1/Enums/InterconnectLocation/Status.php | 38 + .../LocationPresence.php | 44 + .../IssueType.php | 42 + .../InterconnectOutageNotification/Source.php | 38 + .../InterconnectOutageNotification/State.php | 44 + .../InterconnectRemoteLocation/Continent.php | 44 + .../Enums/InterconnectRemoteLocation/Lacp.php | 38 + .../InterconnectRemoteLocation/Status.php | 38 + .../PortPairRemoteLocation.php | 40 + .../PortPairVlan.php | 39 + .../V1/src/V1/Enums/LicenseCode/State.php | 44 + .../Direction.php | 39 + .../V1/Enums/LocationPolicy/TargetShape.php | 40 + .../LocationPolicyLocation/Preference.php | 40 + .../LogConfigCloudAuditOptions/LogName.php | 40 + .../LogConfigDataAccessOptions/LogMode.php | 38 + .../V1/src/V1/Enums/MachineImage/Status.php | 44 + .../Enums/ManagedInstance/CurrentAction.php | 56 + .../Enums/ManagedInstance/InstanceStatus.php | 54 + .../DetailedHealthState.php | 46 + .../MetadataFilter/FilterMatchCriteria.php | 41 + .../Enums/NatIpInfoNatIpInfoMapping/Mode.php | 38 + .../Enums/NatIpInfoNatIpInfoMapping/Usage.php | 38 + .../NetworkFirewallPolicyEnforcementOrder.php | 40 + .../ConnectionPreference.php | 41 + .../Status.php | 46 + .../NetworkEndpointType.php | 49 + .../PscConnectionStatus.php | 48 + .../HealthStatus.php | 40 + .../Enums/NetworkInterface/Ipv6AccessType.php | 40 + .../src/V1/Enums/NetworkInterface/NicType.php | 40 + .../V1/Enums/NetworkInterface/StackType.php | 40 + .../src/V1/Enums/NetworkPeering/StackType.php | 38 + .../V1/src/V1/Enums/NetworkPeering/State.php | 38 + .../TotalEgressBandwidthTier.php | 40 + .../NetworkRoutingConfig/RoutingMode.php | 38 + .../Type.php | 41 + .../Enums/NodeGroup/MaintenanceInterval.php | 38 + .../V1/Enums/NodeGroup/MaintenancePolicy.php | 42 + .../V1/src/V1/Enums/NodeGroup/Status.php | 42 + .../Enums/NodeGroupAutoscalingPolicy/Mode.php | 42 + .../Enums/NodeGroupNode/CpuOvercommitType.php | 40 + .../V1/src/V1/Enums/NodeGroupNode/Status.php | 44 + .../Enums/NodeTemplate/CpuOvercommitType.php | 40 + .../V1/src/V1/Enums/NodeTemplate/Status.php | 42 + .../V1/src/V1/Enums/Operation/Status.php | 40 + .../src/V1/Enums/PacketIntervals/Duration.php | 42 + .../V1/src/V1/Enums/PacketIntervals/Type.php | 42 + .../src/V1/Enums/PacketMirroring/Enable.php | 38 + .../Enums/PacketMirroringFilter/Direction.php | 40 + .../src/V1/Enums/PerInstanceConfig/Status.php | 46 + .../AutoDelete.php | 38 + .../PreservedStatePreservedDisk/Mode.php | 38 + .../AutoDelete.php | 39 + .../src/V1/Enums/Project/CloudArmorTier.php | 40 + .../V1/Enums/Project/DefaultNetworkTier.php | 42 + .../V1/src/V1/Enums/Project/VmDnsSetting.php | 42 + .../src/V1/Enums/Project/XpnProjectStatus.php | 38 + .../CloudArmorTier.php | 41 + .../NetworkTier.php | 43 + .../ByoipApiVersion.php | 39 + .../Enums/PublicAdvertisedPrefix/PdpScope.php | 40 + .../Enums/PublicAdvertisedPrefix/Status.php | 52 + .../PublicDelegatedPrefix/ByoipApiVersion.php | 38 + .../V1/Enums/PublicDelegatedPrefix/Mode.php | 38 + .../V1/Enums/PublicDelegatedPrefix/Status.php | 46 + .../Mode.php | 39 + .../Status.php | 39 + .../Compute/V1/src/V1/Enums/Quota/Metric.php | 360 + .../Enums/QuotaExceededInfo/RolloutStatus.php | 38 + .../src/V1/Enums/QuotaStatusWarning/Code.php | 90 + .../V1/src/V1/Enums/RawDisk/ContainerType.php | 36 + .../Compute/V1/src/V1/Enums/Region/Status.php | 38 + .../MinimalAction.php | 36 + .../MostDisruptiveAllowedAction.php | 36 + .../InstanceState.php | 40 + .../Type.php | 43 + .../V1/src/V1/Enums/Reservation/Status.php | 44 + .../ConsumeReservationType.php | 43 + .../src/V1/Enums/ResourceCommitment/Type.php | 44 + .../V1/src/V1/Enums/ResourcePolicy/Status.php | 44 + .../Collocation.php | 39 + .../OnSourceDiskDelete.php | 42 + .../Day.php | 50 + .../V1/src/V1/Enums/Route/RouteStatus.php | 42 + .../V1/src/V1/Enums/Route/RouteType.php | 42 + .../V1/Enums/RouteAsPath/PathSegmentType.php | 42 + .../src/V1/Enums/RouterBgp/AdvertiseMode.php | 38 + .../V1/Enums/RouterBgp/AdvertisedGroups.php | 36 + .../V1/Enums/RouterBgpPeer/AdvertiseMode.php | 38 + .../Enums/RouterBgpPeer/AdvertisedGroups.php | 36 + .../V1/src/V1/Enums/RouterBgpPeer/Enable.php | 38 + .../V1/Enums/RouterBgpPeer/ManagementType.php | 38 + .../SessionInitializationMode.php | 41 + .../V1/Enums/RouterInterface/IpVersion.php | 38 + .../Enums/RouterInterface/ManagementType.php | 38 + .../V1/Enums/RouterNat/AutoNetworkTier.php | 42 + .../src/V1/Enums/RouterNat/EndpointTypes.php | 40 + .../Enums/RouterNat/NatIpAllocateOption.php | 38 + .../SourceSubnetworkIpRangesToNat.php | 41 + .../V1/src/V1/Enums/RouterNat/Type.php | 38 + .../V1/Enums/RouterNatLogConfig/Filter.php | 40 + .../SourceIpRangesToNat.php | 41 + .../RouterStatusBgpPeerStatus/Status.php | 40 + .../StatusReason.php | 42 + .../Compute/V1/src/V1/Enums/Rule/Action.php | 46 + .../SSLHealthCheck/PortSpecification.php | 41 + .../V1/Enums/SSLHealthCheck/ProxyHeader.php | 38 + .../src/V1/Enums/SavedAttachedDisk/Mode.php | 38 + .../Enums/SavedAttachedDisk/PBInterface.php | 38 + .../SavedAttachedDisk/StorageBytesStatus.php | 39 + .../src/V1/Enums/SavedAttachedDisk/Type.php | 38 + .../src/V1/Enums/SavedDisk/Architecture.php | 40 + .../V1/Enums/SavedDisk/StorageBytesStatus.php | 38 + .../V1/Enums/ScalingScheduleStatus/State.php | 42 + .../Scheduling/InstanceTerminationAction.php | 41 + .../V1/Enums/Scheduling/OnHostMaintenance.php | 38 + .../V1/Enums/Scheduling/ProvisioningModel.php | 38 + .../Enums/SchedulingNodeAffinity/Operator.php | 40 + .../V1/src/V1/Enums/SecurityPolicy/Type.php | 40 + .../RuleVisibility.php | 40 + .../JsonParsing.php | 41 + .../LogLevel.php | 38 + .../DdosProtection.php | 39 + .../VersionedExpr.php | 37 + .../Op.php | 45 + .../EnforceOnKey.php | 55 + .../EnforceOnKeyType.php | 56 + .../Type.php | 38 + .../SecurityPolicyUserDefinedField/Base.php | 42 + .../V1/src/V1/Enums/ServerBinding/Type.php | 40 + .../ConnectionPreference.php | 41 + .../Status.php | 46 + .../State.php | 47 + .../src/V1/Enums/ShareSettings/ShareType.php | 42 + .../V1/src/V1/Enums/Snapshot/Architecture.php | 40 + .../V1/src/V1/Enums/Snapshot/SnapshotType.php | 38 + .../V1/src/V1/Enums/Snapshot/Status.php | 44 + .../V1/Enums/Snapshot/StorageBytesStatus.php | 38 + .../Policy.php | 43 + .../KeyRevocationActionType.php | 42 + .../V1/src/V1/Enums/SslCertificate/Type.php | 40 + .../Status.php | 46 + .../src/V1/Enums/SslPolicy/MinTlsVersion.php | 40 + .../V1/src/V1/Enums/SslPolicy/Profile.php | 42 + .../AutoDelete.php | 39 + .../AutoDelete.php | 39 + .../StoragePool/CapacityProvisioningType.php | 35 + .../PerformanceProvisioningType.php | 35 + .../V1/src/V1/Enums/StoragePool/State.php | 42 + .../src/V1/Enums/StoragePoolDisk/Status.php | 46 + .../V1/Enums/Subnetwork/Ipv6AccessType.php | 40 + .../Subnetwork/PrivateIpv6GoogleAccess.php | 41 + .../V1/src/V1/Enums/Subnetwork/Purpose.php | 48 + .../V1/src/V1/Enums/Subnetwork/Role.php | 38 + .../V1/src/V1/Enums/Subnetwork/StackType.php | 40 + .../V1/src/V1/Enums/Subnetwork/State.php | 38 + .../AggregationInterval.php | 47 + .../V1/Enums/SubnetworkLogConfig/Metadata.php | 40 + .../V1/src/V1/Enums/Subsetting/Policy.php | 38 + .../TCPHealthCheck/PortSpecification.php | 41 + .../V1/Enums/TCPHealthCheck/ProxyHeader.php | 38 + .../QuicOverride.php | 42 + .../Enums/TargetHttpsProxy/QuicOverride.php | 40 + .../src/V1/Enums/TargetInstance/NatPolicy.php | 36 + .../V1/Enums/TargetPool/SessionAffinity.php | 50 + .../ProxyHeader.php | 39 + .../V1/Enums/TargetSslProxy/ProxyHeader.php | 38 + .../ProxyHeader.php | 39 + .../V1/Enums/TargetTcpProxy/ProxyHeader.php | 38 + .../src/V1/Enums/TargetVpnGateway/Status.php | 42 + .../UpcomingMaintenance/MaintenanceStatus.php | 41 + .../src/V1/Enums/UpcomingMaintenance/Type.php | 40 + .../UpdateInstanceRequest/MinimalAction.php | 34 + .../MostDisruptiveAllowedAction.php | 36 + .../LoadBalancingSchemes.php | 41 + .../Enums/UsableSubnetwork/Ipv6AccessType.php | 38 + .../src/V1/Enums/UsableSubnetwork/Purpose.php | 48 + .../V1/src/V1/Enums/UsableSubnetwork/Role.php | 38 + .../V1/Enums/UsableSubnetwork/StackType.php | 38 + .../V1/Enums/VpnGateway/GatewayIpVersion.php | 38 + .../V1/src/V1/Enums/VpnGateway/StackType.php | 38 + .../State.php | 39 + .../UnsatisfiedReason.php | 38 + .../V1/src/V1/Enums/VpnTunnel/Status.php | 60 + .../Compute/V1/src/V1/Enums/Warning/Code.php | 90 + .../Compute/V1/src/V1/Enums/Warnings/Code.php | 90 + .../V1/src/V1/Enums/XpnResourceId/Type.php | 38 + .../Compute/V1/src/V1/Enums/Zone/Status.php | 38 + .../V1/src/V1/ExternalVpnGatewaysClient.php | 34 + .../V1/src/V1/FirewallPoliciesClient.php | 34 + .../Compute/V1/src/V1/FirewallsClient.php | 34 + .../V1/src/V1/ForwardingRulesClient.php | 34 + .../V1/Gapic/AcceleratorTypesGapicClient.php | 425 ++ .../V1/src/V1/Gapic/AddressesGapicClient.php | 791 +++ .../src/V1/Gapic/AutoscalersGapicClient.php | 793 +++ .../V1/Gapic/BackendBucketsGapicClient.php | 1057 +++ .../V1/Gapic/BackendServicesGapicClient.php | 1366 ++++ .../V1/src/V1/Gapic/DiskTypesGapicClient.php | 422 ++ .../V1/src/V1/Gapic/DisksGapicClient.php | 1623 +++++ .../Gapic/ExternalVpnGatewaysGapicClient.php | 646 ++ .../V1/Gapic/FirewallPoliciesGapicClient.php | 1379 ++++ .../V1/src/V1/Gapic/FirewallsGapicClient.php | 678 ++ .../V1/Gapic/ForwardingRulesGapicClient.php | 871 +++ .../V1/Gapic/GlobalAddressesGapicClient.php | 674 ++ .../GlobalForwardingRulesGapicClient.php | 750 +++ ...GlobalNetworkEndpointGroupsGapicClient.php | 771 +++ .../V1/Gapic/GlobalOperationsGapicClient.php | 502 ++ ...lobalOrganizationOperationsGapicClient.php | 351 + ...obalPublicDelegatedPrefixesGapicClient.php | 602 ++ .../src/V1/Gapic/HealthChecksGapicClient.php | 764 +++ .../V1/Gapic/ImageFamilyViewsGapicClient.php | 224 + .../V1/src/V1/Gapic/ImagesGapicClient.php | 948 +++ ...eGroupManagerResizeRequestsGapicClient.php | 642 ++ .../InstanceGroupManagersGapicClient.php | 1883 ++++++ .../V1/Gapic/InstanceGroupsGapicClient.php | 984 +++ .../InstanceSettingsServiceGapicClient.php | 355 + .../V1/Gapic/InstanceTemplatesGapicClient.php | 760 +++ .../V1/src/V1/Gapic/InstancesGapicClient.php | 3922 +++++++++++ .../V1/Gapic/InstantSnapshotsGapicClient.php | 870 +++ .../InterconnectAttachmentsGapicClient.php | 796 +++ .../InterconnectLocationsGapicClient.php | 305 + ...InterconnectRemoteLocationsGapicClient.php | 305 + .../src/V1/Gapic/InterconnectsGapicClient.php | 763 +++ .../src/V1/Gapic/LicenseCodesGapicClient.php | 268 + .../V1/src/V1/Gapic/LicensesGapicClient.php | 674 ++ .../src/V1/Gapic/MachineImagesGapicClient.php | 680 ++ .../src/V1/Gapic/MachineTypesGapicClient.php | 422 ++ .../Gapic/NetworkAttachmentsGapicClient.php | 869 +++ ...NetworkEdgeSecurityServicesGapicClient.php | 636 ++ .../NetworkEndpointGroupsGapicClient.php | 942 +++ .../NetworkFirewallPoliciesGapicClient.php | 1342 ++++ .../V1/src/V1/Gapic/NetworksGapicClient.php | 1061 +++ .../V1/src/V1/Gapic/NodeGroupsGapicClient.php | 1385 ++++ .../src/V1/Gapic/NodeTemplatesGapicClient.php | 789 +++ .../V1/src/V1/Gapic/NodeTypesGapicClient.php | 422 ++ .../V1/Gapic/PacketMirroringsGapicClient.php | 762 +++ .../V1/src/V1/Gapic/ProjectsGapicClient.php | 1228 ++++ .../PublicAdvertisedPrefixesGapicClient.php | 748 +++ .../PublicDelegatedPrefixesGapicClient.php | 863 +++ .../V1/Gapic/RegionAutoscalersGapicClient.php | 708 ++ .../RegionBackendServicesGapicClient.php | 1088 +++ .../V1/Gapic/RegionCommitmentsGapicClient.php | 643 ++ .../V1/Gapic/RegionDiskTypesGapicClient.php | 314 + .../src/V1/Gapic/RegionDisksGapicClient.php | 1519 +++++ .../RegionHealthCheckServicesGapicClient.php | 624 ++ .../Gapic/RegionHealthChecksGapicClient.php | 704 ++ ...RegionInstanceGroupManagersGapicClient.php | 1785 +++++ .../Gapic/RegionInstanceGroupsGapicClient.php | 547 ++ .../RegionInstanceTemplatesGapicClient.php | 544 ++ .../V1/Gapic/RegionInstancesGapicClient.php | 329 + .../RegionInstantSnapshotsGapicClient.php | 785 +++ ...RegionNetworkEndpointGroupsGapicClient.php | 801 +++ ...gionNetworkFirewallPoliciesGapicClient.php | 1456 ++++ ...RegionNotificationEndpointsGapicClient.php | 544 ++ .../V1/Gapic/RegionOperationsGapicClient.php | 410 ++ .../RegionSecurityPoliciesGapicClient.php | 941 +++ .../RegionSslCertificatesGapicClient.php | 544 ++ .../V1/Gapic/RegionSslPoliciesGapicClient.php | 699 ++ .../RegionTargetHttpProxiesGapicClient.php | 625 ++ .../RegionTargetHttpsProxiesGapicClient.php | 786 +++ .../RegionTargetTcpProxiesGapicClient.php | 544 ++ .../src/V1/Gapic/RegionUrlMapsGapicClient.php | 757 +++ .../src/V1/Gapic/RegionZonesGapicClient.php | 276 + .../V1/src/V1/Gapic/RegionsGapicClient.php | 305 + .../src/V1/Gapic/ReservationsGapicClient.php | 961 +++ .../V1/Gapic/ResourcePoliciesGapicClient.php | 875 +++ .../V1/src/V1/Gapic/RoutersGapicClient.php | 1045 +++ .../V1/src/V1/Gapic/RoutesGapicClient.php | 526 ++ .../V1/Gapic/SecurityPoliciesGapicClient.php | 1143 ++++ .../Gapic/ServiceAttachmentsGapicClient.php | 869 +++ .../SnapshotSettingsServiceGapicClient.php | 345 + .../V1/src/V1/Gapic/SnapshotsGapicClient.php | 745 +++ .../V1/Gapic/SslCertificatesGapicClient.php | 612 ++ .../src/V1/Gapic/SslPoliciesGapicClient.php | 759 +++ .../V1/Gapic/StoragePoolTypesGapicClient.php | 422 ++ .../src/V1/Gapic/StoragePoolsGapicClient.php | 939 +++ .../src/V1/Gapic/SubnetworksGapicClient.php | 1123 ++++ .../V1/Gapic/TargetGrpcProxiesGapicClient.php | 602 ++ .../V1/Gapic/TargetHttpProxiesGapicClient.php | 765 +++ .../Gapic/TargetHttpsProxiesGapicClient.php | 1073 +++ .../V1/Gapic/TargetInstancesGapicClient.php | 710 ++ .../src/V1/Gapic/TargetPoolsGapicClient.php | 1188 ++++ .../V1/Gapic/TargetSslProxiesGapicClient.php | 911 +++ .../V1/Gapic/TargetTcpProxiesGapicClient.php | 766 +++ .../V1/Gapic/TargetVpnGatewaysGapicClient.php | 710 ++ .../V1/src/V1/Gapic/UrlMapsGapicClient.php | 890 +++ .../src/V1/Gapic/VpnGatewaysGapicClient.php | 812 +++ .../V1/src/V1/Gapic/VpnTunnelsGapicClient.php | 710 ++ .../V1/Gapic/ZoneOperationsGapicClient.php | 410 ++ .../V1/src/V1/Gapic/ZonesGapicClient.php | 305 + .../V1/src/V1/GlobalAddressesClient.php | 34 + .../V1/src/V1/GlobalForwardingRulesClient.php | 34 + .../V1/GlobalNetworkEndpointGroupsClient.php | 34 + .../V1/src/V1/GlobalOperationsClient.php | 34 + .../V1/GlobalOrganizationOperationsClient.php | 34 + .../GlobalPublicDelegatedPrefixesClient.php | 34 + .../Compute/V1/src/V1/HealthChecksClient.php | 34 + .../V1/src/V1/ImageFamilyViewsClient.php | 34 + .../Compute/V1/src/V1/ImagesClient.php | 34 + ...stanceGroupManagerResizeRequestsClient.php | 34 + .../V1/src/V1/InstanceGroupManagersClient.php | 34 + .../V1/src/V1/InstanceGroupsClient.php | 34 + .../src/V1/InstanceSettingsServiceClient.php | 34 + .../V1/src/V1/InstanceTemplatesClient.php | 34 + .../Compute/V1/src/V1/InstancesClient.php | 34 + .../V1/src/V1/InstantSnapshotsClient.php | 34 + .../src/V1/InterconnectAttachmentsClient.php | 34 + .../V1/src/V1/InterconnectLocationsClient.php | 34 + .../V1/InterconnectRemoteLocationsClient.php | 34 + .../Compute/V1/src/V1/InterconnectsClient.php | 34 + .../Compute/V1/src/V1/LicenseCodesClient.php | 34 + .../Compute/V1/src/V1/LicensesClient.php | 34 + .../Compute/V1/src/V1/MachineImagesClient.php | 34 + .../Compute/V1/src/V1/MachineTypesClient.php | 34 + .../V1/src/V1/NetworkAttachmentsClient.php | 34 + .../V1/NetworkEdgeSecurityServicesClient.php | 34 + .../V1/src/V1/NetworkEndpointGroupsClient.php | 34 + .../src/V1/NetworkFirewallPoliciesClient.php | 34 + .../Compute/V1/src/V1/NetworksClient.php | 34 + .../Compute/V1/src/V1/NodeGroupsClient.php | 34 + .../Compute/V1/src/V1/NodeTemplatesClient.php | 34 + .../Compute/V1/src/V1/NodeTypesClient.php | 34 + .../V1/src/V1/PacketMirroringsClient.php | 34 + .../Compute/V1/src/V1/ProjectsClient.php | 34 + .../src/V1/PublicAdvertisedPrefixesClient.php | 34 + .../src/V1/PublicDelegatedPrefixesClient.php | 34 + .../V1/src/V1/RegionAutoscalersClient.php | 34 + .../V1/src/V1/RegionBackendServicesClient.php | 34 + .../V1/src/V1/RegionCommitmentsClient.php | 34 + .../V1/src/V1/RegionDiskTypesClient.php | 34 + .../Compute/V1/src/V1/RegionDisksClient.php | 34 + .../V1/RegionHealthCheckServicesClient.php | 34 + .../V1/src/V1/RegionHealthChecksClient.php | 34 + .../V1/RegionInstanceGroupManagersClient.php | 34 + .../V1/src/V1/RegionInstanceGroupsClient.php | 34 + .../src/V1/RegionInstanceTemplatesClient.php | 34 + .../V1/src/V1/RegionInstancesClient.php | 34 + .../src/V1/RegionInstantSnapshotsClient.php | 34 + .../V1/RegionNetworkEndpointGroupsClient.php | 34 + .../RegionNetworkFirewallPoliciesClient.php | 34 + .../V1/RegionNotificationEndpointsClient.php | 34 + .../V1/src/V1/RegionOperationsClient.php | 34 + .../src/V1/RegionSecurityPoliciesClient.php | 34 + .../V1/src/V1/RegionSslCertificatesClient.php | 34 + .../V1/src/V1/RegionSslPoliciesClient.php | 34 + .../src/V1/RegionTargetHttpProxiesClient.php | 34 + .../src/V1/RegionTargetHttpsProxiesClient.php | 34 + .../src/V1/RegionTargetTcpProxiesClient.php | 34 + .../Compute/V1/src/V1/RegionUrlMapsClient.php | 34 + .../Compute/V1/src/V1/RegionZonesClient.php | 34 + .../Compute/V1/src/V1/RegionsClient.php | 34 + .../Compute/V1/src/V1/ReservationsClient.php | 34 + .../V1/src/V1/ResourcePoliciesClient.php | 34 + .../Compute/V1/src/V1/RoutersClient.php | 34 + .../Compute/V1/src/V1/RoutesClient.php | 34 + .../V1/src/V1/SecurityPoliciesClient.php | 34 + .../V1/src/V1/ServiceAttachmentsClient.php | 34 + .../src/V1/SnapshotSettingsServiceClient.php | 34 + .../Compute/V1/src/V1/SnapshotsClient.php | 34 + .../V1/src/V1/SslCertificatesClient.php | 34 + .../Compute/V1/src/V1/SslPoliciesClient.php | 34 + .../V1/src/V1/StoragePoolTypesClient.php | 34 + .../Compute/V1/src/V1/StoragePoolsClient.php | 34 + .../Compute/V1/src/V1/SubnetworksClient.php | 34 + .../V1/src/V1/TargetGrpcProxiesClient.php | 34 + .../V1/src/V1/TargetHttpProxiesClient.php | 34 + .../V1/src/V1/TargetHttpsProxiesClient.php | 34 + .../V1/src/V1/TargetInstancesClient.php | 34 + .../Compute/V1/src/V1/TargetPoolsClient.php | 34 + .../V1/src/V1/TargetSslProxiesClient.php | 34 + .../V1/src/V1/TargetTcpProxiesClient.php | 34 + .../V1/src/V1/TargetVpnGatewaysClient.php | 34 + .../Compute/V1/src/V1/UrlMapsClient.php | 34 + .../Compute/V1/src/V1/VpnGatewaysClient.php | 34 + .../Compute/V1/src/V1/VpnTunnelsClient.php | 34 + .../V1/src/V1/ZoneOperationsClient.php | 34 + .../Compute/V1/src/V1/ZonesClient.php | 34 + .../Compute/V1/src/V1/gapic_metadata.json | 4726 +++++++++++++ .../accelerator_types_client_config.json | 50 + .../accelerator_types_descriptor_config.php | 98 + .../accelerator_types_rest_client_config.php | 76 + .../V1/resources/addresses_client_config.json | 80 + .../resources/addresses_descriptor_config.php | 244 + .../addresses_rest_client_config.php | 239 + .../resources/autoscalers_client_config.json | 80 + .../autoscalers_descriptor_config.php | 232 + .../autoscalers_rest_client_config.php | 229 + .../backend_buckets_client_config.json | 105 + .../backend_buckets_descriptor_config.php | 331 + .../backend_buckets_rest_client_config.php | 292 + .../backend_services_client_config.json | 125 + .../backend_services_descriptor_config.php | 420 ++ .../backend_services_rest_client_config.php | 348 + .../resources/disk_types_client_config.json | 50 + .../disk_types_descriptor_config.php | 98 + .../disk_types_rest_client_config.php | 76 + .../src/V1/resources/disks_client_config.json | 135 + .../V1/resources/disks_descriptor_config.php | 608 ++ .../V1/resources/disks_rest_client_config.php | 469 ++ .../external_vpn_gateways_client_config.json | 75 + ...xternal_vpn_gateways_descriptor_config.php | 171 + ...ternal_vpn_gateways_rest_client_config.php | 189 + .../firewall_policies_client_config.json | 135 + .../firewall_policies_descriptor_config.php | 338 + .../firewall_policies_rest_client_config.php | 246 + .../V1/resources/firewalls_client_config.json | 75 + .../resources/firewalls_descriptor_config.php | 184 + .../firewalls_rest_client_config.php | 189 + .../forwarding_rules_client_config.json | 85 + .../forwarding_rules_descriptor_config.php | 282 + .../forwarding_rules_rest_client_config.php | 261 + .../global_addresses_client_config.json | 75 + .../global_addresses_descriptor_config.php | 184 + .../global_addresses_rest_client_config.php | 189 + ...global_forwarding_rules_client_config.json | 80 + ...bal_forwarding_rules_descriptor_config.php | 215 + ...al_forwarding_rules_rest_client_config.php | 206 + ...network_endpoint_groups_client_config.json | 80 + ...work_endpoint_groups_descriptor_config.php | 210 + ...ork_endpoint_groups_rest_client_config.php | 205 + .../global_operations_client_config.json | 70 + .../global_operations_descriptor_config.php | 122 + .../global_operations_rest_client_config.php | 98 + ...organization_operations_client_config.json | 60 + ...anization_operations_descriptor_config.php | 64 + ...nization_operations_rest_client_config.php | 54 + ...blic_delegated_prefixes_client_config.json | 70 + ...c_delegated_prefixes_descriptor_config.php | 153 + ..._delegated_prefixes_rest_client_config.php | 172 + .../health_checks_client_config.json | 80 + .../health_checks_descriptor_config.php | 204 + .../health_checks_rest_client_config.php | 200 + .../image_family_views_client_config.json | 40 + .../image_family_views_descriptor_config.php | 52 + .../image_family_views_rest_client_config.php | 49 + .../V1/resources/images_client_config.json | 100 + .../V1/resources/images_descriptor_config.php | 287 + .../resources/images_rest_client_config.php | 272 + ...manager_resize_requests_client_config.json | 70 + ...ager_resize_requests_descriptor_config.php | 216 + ...ger_resize_requests_rest_client_config.php | 230 + ...instance_group_managers_client_config.json | 145 + ...tance_group_managers_descriptor_config.php | 720 ++ ...ance_group_managers_rest_client_config.php | 524 ++ .../instance_groups_client_config.json | 90 + .../instance_groups_descriptor_config.php | 314 + .../instance_groups_rest_client_config.php | 283 + ...stance_settings_service_client_config.json | 55 + ...nce_settings_service_descriptor_config.php | 78 + ...ce_settings_service_rest_client_config.php | 142 + .../instance_templates_client_config.json | 85 + .../instance_templates_descriptor_config.php | 196 + .../instance_templates_rest_client_config.php | 216 + .../V1/resources/instances_client_config.json | 285 + .../resources/instances_descriptor_config.php | 1664 +++++ .../instances_rest_client_config.php | 1140 ++++ .../instant_snapshots_client_config.json | 90 + .../instant_snapshots_descriptor_config.php | 278 + .../instant_snapshots_rest_client_config.php | 282 + ...nterconnect_attachments_client_config.json | 80 + ...rconnect_attachments_descriptor_config.php | 244 + ...connect_attachments_rest_client_config.php | 239 + .../interconnect_locations_client_config.json | 45 + ...terconnect_locations_descriptor_config.php | 66 + ...erconnect_locations_rest_client_config.php | 55 + ...onnect_remote_locations_client_config.json | 45 + ...ect_remote_locations_descriptor_config.php | 66 + ...ct_remote_locations_rest_client_config.php | 55 + .../interconnects_client_config.json | 85 + .../interconnects_descriptor_config.php | 220 + .../interconnects_rest_client_config.php | 221 + .../license_codes_client_config.json | 55 + .../license_codes_descriptor_config.php | 64 + .../license_codes_rest_client_config.php | 61 + .../V1/resources/licenses_client_config.json | 80 + .../resources/licenses_descriptor_config.php | 176 + .../resources/licenses_rest_client_config.php | 205 + .../machine_images_client_config.json | 80 + .../machine_images_descriptor_config.php | 176 + .../machine_images_rest_client_config.php | 205 + .../machine_types_client_config.json | 50 + .../machine_types_descriptor_config.php | 98 + .../machine_types_rest_client_config.php | 76 + .../network_attachments_client_config.json | 90 + .../network_attachments_descriptor_config.php | 278 + ...network_attachments_rest_client_config.php | 282 + ..._edge_security_services_client_config.json | 70 + ...ge_security_services_descriptor_config.php | 180 + ...e_security_services_rest_client_config.php | 201 + ...network_endpoint_groups_client_config.json | 90 + ...work_endpoint_groups_descriptor_config.php | 300 + ...ork_endpoint_groups_rest_client_config.php | 283 + ...twork_firewall_policies_client_config.json | 125 + ...rk_firewall_policies_descriptor_config.php | 429 ++ ...k_firewall_policies_rest_client_config.php | 353 + .../V1/resources/networks_client_config.json | 100 + .../resources/networks_descriptor_config.php | 321 + .../resources/networks_rest_client_config.php | 271 + .../resources/node_groups_client_config.json | 120 + .../node_groups_descriptor_config.php | 500 ++ .../node_groups_rest_client_config.php | 416 ++ .../node_templates_client_config.json | 85 + .../node_templates_descriptor_config.php | 240 + .../node_templates_rest_client_config.php | 260 + .../resources/node_types_client_config.json | 50 + .../node_types_descriptor_config.php | 98 + .../node_types_rest_client_config.php | 76 + .../packet_mirrorings_client_config.json | 80 + .../packet_mirrorings_descriptor_config.php | 230 + .../packet_mirrorings_rest_client_config.php | 239 + .../V1/resources/projects_client_config.json | 115 + .../resources/projects_descriptor_config.php | 342 + .../resources/projects_rest_client_config.php | 263 + ...lic_advertised_prefixes_client_config.json | 80 + ..._advertised_prefixes_descriptor_config.php | 215 + ...advertised_prefixes_rest_client_config.php | 204 + ...blic_delegated_prefixes_client_config.json | 85 + ...c_delegated_prefixes_descriptor_config.php | 282 + ..._delegated_prefixes_rest_client_config.php | 259 + .../region_autoscalers_client_config.json | 75 + .../region_autoscalers_descriptor_config.php | 212 + .../region_autoscalers_rest_client_config.php | 218 + ...region_backend_services_client_config.json | 105 + ...ion_backend_services_descriptor_config.php | 384 ++ ...on_backend_services_rest_client_config.php | 353 + .../region_commitments_client_config.json | 70 + .../region_commitments_descriptor_config.php | 168 + .../region_commitments_rest_client_config.php | 196 + .../region_disk_types_client_config.json | 45 + .../region_disk_types_descriptor_config.php | 78 + .../region_disk_types_rest_client_config.php | 65 + .../resources/region_disks_client_config.json | 130 + .../region_disks_descriptor_config.php | 588 ++ .../region_disks_rest_client_config.php | 458 ++ ...n_health_check_services_client_config.json | 70 + ...ealth_check_services_descriptor_config.php | 186 + ...alth_check_services_rest_client_config.php | 206 + .../region_health_checks_client_config.json | 75 + ...region_health_checks_descriptor_config.php | 224 + ...egion_health_checks_rest_client_config.php | 228 + ...instance_group_managers_client_config.json | 140 + ...tance_group_managers_descriptor_config.php | 700 ++ ...ance_group_managers_rest_client_config.php | 513 ++ .../region_instance_groups_client_config.json | 65 + ...gion_instance_groups_descriptor_config.php | 148 + ...ion_instance_groups_rest_client_config.php | 190 + ...gion_instance_templates_client_config.json | 65 + ...n_instance_templates_descriptor_config.php | 148 + ..._instance_templates_rest_client_config.php | 184 + .../region_instances_client_config.json | 37 + .../region_instances_descriptor_config.php | 60 + .../region_instances_rest_client_config.php | 126 + ...egion_instant_snapshots_client_config.json | 85 + ...on_instant_snapshots_descriptor_config.php | 258 + ...n_instant_snapshots_rest_client_config.php | 271 + ...network_endpoint_groups_client_config.json | 80 + ...work_endpoint_groups_descriptor_config.php | 256 + ...ork_endpoint_groups_rest_client_config.php | 249 + ...twork_firewall_policies_client_config.json | 130 + ...rk_firewall_policies_descriptor_config.php | 552 ++ ...k_firewall_policies_rest_client_config.php | 461 ++ ..._notification_endpoints_client_config.json | 65 + ...tification_endpoints_descriptor_config.php | 148 + ...ification_endpoints_rest_client_config.php | 184 + .../region_operations_client_config.json | 65 + .../region_operations_descriptor_config.php | 126 + .../region_operations_rest_client_config.php | 107 + ...egion_security_policies_client_config.json | 90 + ...on_security_policies_descriptor_config.php | 324 + ...n_security_policies_rest_client_config.php | 292 + ...region_ssl_certificates_client_config.json | 65 + ...ion_ssl_certificates_descriptor_config.php | 148 + ...on_ssl_certificates_rest_client_config.php | 184 + .../region_ssl_policies_client_config.json | 75 + .../region_ssl_policies_descriptor_config.php | 204 + ...region_ssl_policies_rest_client_config.php | 222 + ...ion_target_http_proxies_client_config.json | 70 + ..._target_http_proxies_descriptor_config.php | 186 + ...target_http_proxies_rest_client_config.php | 206 + ...on_target_https_proxies_client_config.json | 80 + ...target_https_proxies_descriptor_config.php | 262 + ...arget_https_proxies_rest_client_config.php | 250 + ...gion_target_tcp_proxies_client_config.json | 65 + ...n_target_tcp_proxies_descriptor_config.php | 148 + ..._target_tcp_proxies_rest_client_config.php | 184 + .../region_url_maps_client_config.json | 80 + .../region_url_maps_descriptor_config.php | 248 + .../region_url_maps_rest_client_config.php | 250 + .../resources/region_zones_client_config.json | 40 + .../region_zones_descriptor_config.php | 54 + .../region_zones_rest_client_config.php | 44 + .../V1/resources/regions_client_config.json | 45 + .../resources/regions_descriptor_config.php | 66 + .../resources/regions_rest_client_config.php | 55 + .../resources/reservations_client_config.json | 95 + .../reservations_descriptor_config.php | 316 + .../reservations_rest_client_config.php | 304 + .../resource_policies_client_config.json | 90 + .../resource_policies_descriptor_config.php | 278 + .../resource_policies_rest_client_config.php | 282 + .../V1/resources/routers_client_config.json | 100 + .../resources/routers_descriptor_config.php | 348 + .../resources/routers_rest_client_config.php | 324 + .../V1/resources/routes_client_config.json | 65 + .../V1/resources/routes_descriptor_config.php | 122 + .../resources/routes_rest_client_config.php | 155 + .../security_policies_client_config.json | 105 + .../security_policies_descriptor_config.php | 327 + .../security_policies_rest_client_config.php | 277 + .../service_attachments_client_config.json | 90 + .../service_attachments_descriptor_config.php | 278 + ...service_attachments_rest_client_config.php | 282 + ...apshot_settings_service_client_config.json | 55 + ...hot_settings_service_descriptor_config.php | 65 + ...ot_settings_service_rest_client_config.php | 123 + .../V1/resources/snapshots_client_config.json | 85 + .../resources/snapshots_descriptor_config.php | 207 + .../snapshots_rest_client_config.php | 222 + .../ssl_certificates_client_config.json | 70 + .../ssl_certificates_descriptor_config.php | 142 + .../ssl_certificates_rest_client_config.php | 166 + .../resources/ssl_policies_client_config.json | 80 + .../ssl_policies_descriptor_config.php | 185 + .../ssl_policies_rest_client_config.php | 194 + .../storage_pool_types_client_config.json | 50 + .../storage_pool_types_descriptor_config.php | 98 + .../storage_pool_types_rest_client_config.php | 76 + .../storage_pools_client_config.json | 95 + .../storage_pools_descriptor_config.php | 294 + .../storage_pools_rest_client_config.php | 303 + .../resources/subnetworks_client_config.json | 105 + .../subnetworks_descriptor_config.php | 374 ++ .../subnetworks_rest_client_config.php | 337 + .../target_grpc_proxies_client_config.json | 70 + .../target_grpc_proxies_descriptor_config.php | 153 + ...target_grpc_proxies_rest_client_config.php | 172 + .../target_http_proxies_client_config.json | 80 + .../target_http_proxies_descriptor_config.php | 204 + ...target_http_proxies_rest_client_config.php | 200 + .../target_https_proxies_client_config.json | 100 + ...target_https_proxies_descriptor_config.php | 328 + ...arget_https_proxies_rest_client_config.php | 268 + .../target_instances_client_config.json | 75 + .../target_instances_descriptor_config.php | 206 + .../target_instances_rest_client_config.php | 217 + .../resources/target_pools_client_config.json | 105 + .../target_pools_descriptor_config.php | 420 ++ .../target_pools_rest_client_config.php | 349 + .../target_ssl_proxies_client_config.json | 90 + .../target_ssl_proxies_descriptor_config.php | 277 + .../target_ssl_proxies_rest_client_config.php | 240 + .../target_tcp_proxies_client_config.json | 80 + .../target_tcp_proxies_descriptor_config.php | 204 + .../target_tcp_proxies_rest_client_config.php | 200 + .../target_vpn_gateways_client_config.json | 75 + .../target_vpn_gateways_descriptor_config.php | 206 + ...target_vpn_gateways_rest_client_config.php | 217 + .../V1/resources/url_maps_client_config.json | 90 + .../resources/url_maps_descriptor_config.php | 253 + .../resources/url_maps_rest_client_config.php | 234 + .../resources/vpn_gateways_client_config.json | 85 + .../vpn_gateways_descriptor_config.php | 254 + .../vpn_gateways_rest_client_config.php | 260 + .../resources/vpn_tunnels_client_config.json | 75 + .../vpn_tunnels_descriptor_config.php | 206 + .../vpn_tunnels_rest_client_config.php | 217 + .../zone_operations_client_config.json | 65 + .../zone_operations_descriptor_config.php | 126 + .../zone_operations_rest_client_config.php | 107 + .../src/V1/resources/zones_client_config.json | 45 + .../V1/resources/zones_descriptor_config.php | 66 + .../V1/resources/zones_rest_client_config.php | 55 + .../Unit/V1/AcceleratorTypesClientTest.php | 299 + .../V1/tests/Unit/V1/AddressesClientTest.php | 809 +++ .../tests/Unit/V1/AutoscalersClientTest.php | 785 +++ .../Unit/V1/BackendBucketsClientTest.php | 1252 ++++ .../Unit/V1/BackendServicesClientTest.php | 1616 +++++ .../V1/Client/AcceleratorTypesClientTest.php | 364 + .../Unit/V1/Client/AddressesClientTest.php | 914 +++ .../Unit/V1/Client/AutoscalersClientTest.php | 886 +++ .../V1/Client/BackendBucketsClientTest.php | 1415 ++++ .../V1/Client/BackendServicesClientTest.php | 1807 +++++ .../Unit/V1/Client/DiskTypesClientTest.php | 368 + .../tests/Unit/V1/Client/DisksClientTest.php | 2289 +++++++ .../Client/ExternalVpnGatewaysClientTest.php | 742 ++ .../V1/Client/FirewallPoliciesClientTest.php | 1897 ++++++ .../Unit/V1/Client/FirewallsClientTest.php | 793 +++ .../V1/Client/ForwardingRulesClientTest.php | 1072 +++ .../V1/Client/GlobalAddressesClientTest.php | 811 +++ .../GlobalForwardingRulesClientTest.php | 962 +++ .../GlobalNetworkEndpointGroupsClientTest.php | 892 +++ .../V1/Client/GlobalOperationsClientTest.php | 559 ++ ...GlobalOrganizationOperationsClientTest.php | 329 + ...lobalPublicDelegatedPrefixesClientTest.php | 676 ++ .../Unit/V1/Client/HealthChecksClientTest.php | 860 +++ .../V1/Client/ImageFamilyViewsClientTest.php | 171 + .../tests/Unit/V1/Client/ImagesClientTest.php | 1294 ++++ ...ceGroupManagerResizeRequestsClientTest.php | 732 ++ .../InstanceGroupManagersClientTest.php | 2543 +++++++ .../V1/Client/InstanceGroupsClientTest.php | 1165 ++++ .../InstanceSettingsServiceClientTest.php | 305 + .../V1/Client/InstanceTemplatesClientTest.php | 833 +++ .../Unit/V1/Client/InstancesClientTest.php | 5944 +++++++++++++++++ .../V1/Client/InstantSnapshotsClientTest.php | 1030 +++ .../InterconnectAttachmentsClientTest.php | 943 +++ .../InterconnectLocationsClientTest.php | 301 + .../InterconnectRemoteLocationsClientTest.php | 309 + .../V1/Client/InterconnectsClientTest.php | 962 +++ .../Unit/V1/Client/LicenseCodesClientTest.php | 270 + .../Unit/V1/Client/LicensesClientTest.php | 770 +++ .../V1/Client/MachineImagesClientTest.php | 778 +++ .../Unit/V1/Client/MachineTypesClientTest.php | 374 ++ .../Client/NetworkAttachmentsClientTest.php | 1017 +++ .../NetworkEdgeSecurityServicesClientTest.php | 680 ++ .../NetworkEndpointGroupsClientTest.php | 1087 +++ .../NetworkFirewallPoliciesClientTest.php | 1825 +++++ .../Unit/V1/Client/NetworksClientTest.php | 1342 ++++ .../Unit/V1/Client/NodeGroupsClientTest.php | 1825 +++++ .../V1/Client/NodeTemplatesClientTest.php | 883 +++ .../Unit/V1/Client/NodeTypesClientTest.php | 370 + .../V1/Client/PacketMirroringsClientTest.php | 843 +++ .../Unit/V1/Client/ProjectsClientTest.php | 1664 +++++ .../PublicAdvertisedPrefixesClientTest.php | 914 +++ .../PublicDelegatedPrefixesClientTest.php | 1028 +++ .../V1/Client/RegionAutoscalersClientTest.php | 828 +++ .../RegionBackendServicesClientTest.php | 1421 ++++ .../V1/Client/RegionCommitmentsClientTest.php | 646 ++ .../V1/Client/RegionDiskTypesClientTest.php | 297 + .../Unit/V1/Client/RegionDisksClientTest.php | 2207 ++++++ .../RegionHealthCheckServicesClientTest.php | 702 ++ .../Client/RegionHealthChecksClientTest.php | 842 +++ .../RegionInstanceGroupManagersClientTest.php | 2461 +++++++ .../Client/RegionInstanceGroupsClientTest.php | 544 ++ .../RegionInstanceTemplatesClientTest.php | 566 ++ .../V1/Client/RegionInstancesClientTest.php | 261 + .../RegionInstantSnapshotsClientTest.php | 972 +++ .../RegionNetworkEndpointGroupsClientTest.php | 943 +++ ...egionNetworkFirewallPoliciesClientTest.php | 2011 ++++++ .../RegionNotificationEndpointsClientTest.php | 564 ++ .../V1/Client/RegionOperationsClientTest.php | 492 ++ .../RegionSecurityPoliciesClientTest.php | 1188 ++++ .../RegionSslCertificatesClientTest.php | 572 ++ .../V1/Client/RegionSslPoliciesClientTest.php | 774 +++ .../RegionTargetHttpProxiesClientTest.php | 707 ++ .../RegionTargetHttpsProxiesClientTest.php | 986 +++ .../RegionTargetTcpProxiesClientTest.php | 570 ++ .../V1/Client/RegionUrlMapsClientTest.php | 919 +++ .../Unit/V1/Client/RegionZonesClientTest.php | 194 + .../Unit/V1/Client/RegionsClientTest.php | 273 + .../Unit/V1/Client/ReservationsClientTest.php | 1152 ++++ .../V1/Client/ResourcePoliciesClientTest.php | 1017 +++ .../Unit/V1/Client/RoutersClientTest.php | 1223 ++++ .../tests/Unit/V1/Client/RoutesClientTest.php | 557 ++ .../V1/Client/SecurityPoliciesClientTest.php | 1399 ++++ .../Client/ServiceAttachmentsClientTest.php | 1021 +++ .../SnapshotSettingsServiceClientTest.php | 276 + .../Unit/V1/Client/SnapshotsClientTest.php | 938 +++ .../V1/Client/SslCertificatesClientTest.php | 604 ++ .../Unit/V1/Client/SslPoliciesClientTest.php | 797 +++ .../V1/Client/StoragePoolTypesClientTest.php | 378 ++ .../Unit/V1/Client/StoragePoolsClientTest.php | 1111 +++ .../Unit/V1/Client/SubnetworksClientTest.php | 1392 ++++ .../V1/Client/TargetGrpcProxiesClientTest.php | 666 ++ .../V1/Client/TargetHttpProxiesClientTest.php | 859 +++ .../Client/TargetHttpsProxiesClientTest.php | 1381 ++++ .../V1/Client/TargetInstancesClientTest.php | 765 +++ .../Unit/V1/Client/TargetPoolsClientTest.php | 1553 +++++ .../V1/Client/TargetSslProxiesClientTest.php | 1179 ++++ .../V1/Client/TargetTcpProxiesClientTest.php | 858 +++ .../V1/Client/TargetVpnGatewaysClientTest.php | 763 +++ .../Unit/V1/Client/UrlMapsClientTest.php | 1059 +++ .../Unit/V1/Client/VpnGatewaysClientTest.php | 924 +++ .../Unit/V1/Client/VpnTunnelsClientTest.php | 785 +++ .../V1/Client/ZoneOperationsClientTest.php | 492 ++ .../tests/Unit/V1/Client/ZonesClientTest.php | 277 + .../V1/tests/Unit/V1/DiskTypesClientTest.php | 303 + .../V1/tests/Unit/V1/DisksClientTest.php | 2043 ++++++ .../Unit/V1/ExternalVpnGatewaysClientTest.php | 635 ++ .../Unit/V1/FirewallPoliciesClientTest.php | 1733 +++++ .../V1/tests/Unit/V1/FirewallsClientTest.php | 686 ++ .../Unit/V1/ForwardingRulesClientTest.php | 956 +++ .../Unit/V1/GlobalAddressesClientTest.php | 704 ++ .../V1/GlobalForwardingRulesClientTest.php | 846 +++ .../GlobalNetworkEndpointGroupsClientTest.php | 774 +++ .../Unit/V1/GlobalOperationsClientTest.php | 484 ++ ...GlobalOrganizationOperationsClientTest.php | 289 + ...lobalPublicDelegatedPrefixesClientTest.php | 578 ++ .../tests/Unit/V1/HealthChecksClientTest.php | 767 +++ .../Unit/V1/ImageFamilyViewsClientTest.php | 127 + .../V1/tests/Unit/V1/ImagesClientTest.php | 1146 ++++ ...ceGroupManagerResizeRequestsClientTest.php | 607 ++ .../V1/InstanceGroupManagersClientTest.php | 2273 +++++++ .../Unit/V1/InstanceGroupsClientTest.php | 1010 +++ .../V1/InstanceSettingsServiceClientTest.php | 252 + .../Unit/V1/InstanceTemplatesClientTest.php | 733 ++ .../V1/tests/Unit/V1/InstancesClientTest.php | 5378 +++++++++++++++ .../Unit/V1/InstantSnapshotsClientTest.php | 905 +++ .../V1/InterconnectAttachmentsClientTest.php | 838 +++ .../V1/InterconnectLocationsClientTest.php | 228 + .../InterconnectRemoteLocationsClientTest.php | 232 + .../tests/Unit/V1/InterconnectsClientTest.php | 841 +++ .../tests/Unit/V1/LicenseCodesClientTest.php | 207 + .../V1/tests/Unit/V1/LicensesClientTest.php | 656 ++ .../tests/Unit/V1/MachineImagesClientTest.php | 664 ++ .../tests/Unit/V1/MachineTypesClientTest.php | 309 + .../Unit/V1/NetworkAttachmentsClientTest.php | 892 +++ .../NetworkEdgeSecurityServicesClientTest.php | 591 ++ .../V1/NetworkEndpointGroupsClientTest.php | 960 +++ .../V1/NetworkFirewallPoliciesClientTest.php | 1636 +++++ .../V1/tests/Unit/V1/NetworksClientTest.php | 1192 ++++ .../V1/tests/Unit/V1/NodeGroupsClientTest.php | 1606 +++++ .../tests/Unit/V1/NodeTemplatesClientTest.php | 769 +++ .../V1/tests/Unit/V1/NodeTypesClientTest.php | 305 + .../Unit/V1/PacketMirroringsClientTest.php | 738 ++ .../V1/tests/Unit/V1/ProjectsClientTest.php | 1517 +++++ .../V1/PublicAdvertisedPrefixesClientTest.php | 802 +++ .../V1/PublicDelegatedPrefixesClientTest.php | 916 +++ .../Unit/V1/RegionAutoscalersClientTest.php | 708 ++ .../V1/RegionBackendServicesClientTest.php | 1237 ++++ .../Unit/V1/RegionCommitmentsClientTest.php | 561 ++ .../Unit/V1/RegionDiskTypesClientTest.php | 226 + .../tests/Unit/V1/RegionDisksClientTest.php | 1966 ++++++ .../RegionHealthCheckServicesClientTest.php | 589 ++ .../Unit/V1/RegionHealthChecksClientTest.php | 718 ++ .../RegionInstanceGroupManagersClientTest.php | 2196 ++++++ .../V1/RegionInstanceGroupsClientTest.php | 447 ++ .../V1/RegionInstanceTemplatesClientTest.php | 464 ++ .../Unit/V1/RegionInstancesClientTest.php | 184 + .../V1/RegionInstantSnapshotsClientTest.php | 828 +++ .../RegionNetworkEndpointGroupsClientTest.php | 806 +++ ...egionNetworkFirewallPoliciesClientTest.php | 1776 +++++ .../RegionNotificationEndpointsClientTest.php | 462 ++ .../Unit/V1/RegionOperationsClientTest.php | 423 ++ .../V1/RegionSecurityPoliciesClientTest.php | 1031 +++ .../V1/RegionSslCertificatesClientTest.php | 470 ++ .../Unit/V1/RegionSslPoliciesClientTest.php | 654 ++ .../V1/RegionTargetHttpProxiesClientTest.php | 594 ++ .../V1/RegionTargetHttpsProxiesClientTest.php | 851 +++ .../V1/RegionTargetTcpProxiesClientTest.php | 468 ++ .../tests/Unit/V1/RegionUrlMapsClientTest.php | 784 +++ .../tests/Unit/V1/RegionZonesClientTest.php | 140 + .../V1/tests/Unit/V1/RegionsClientTest.php | 214 + .../tests/Unit/V1/ReservationsClientTest.php | 1016 +++ .../Unit/V1/ResourcePoliciesClientTest.php | 890 +++ .../V1/tests/Unit/V1/RoutersClientTest.php | 1080 +++ .../V1/tests/Unit/V1/RoutesClientTest.php | 468 ++ .../Unit/V1/SecurityPoliciesClientTest.php | 1246 ++++ .../Unit/V1/ServiceAttachmentsClientTest.php | 896 +++ .../V1/SnapshotSettingsServiceClientTest.php | 237 + .../V1/tests/Unit/V1/SnapshotsClientTest.php | 815 +++ .../Unit/V1/SslCertificatesClientTest.php | 529 ++ .../tests/Unit/V1/SslPoliciesClientTest.php | 706 ++ .../Unit/V1/StoragePoolTypesClientTest.php | 313 + .../tests/Unit/V1/StoragePoolsClientTest.php | 975 +++ .../tests/Unit/V1/SubnetworksClientTest.php | 1240 ++++ .../Unit/V1/TargetGrpcProxiesClientTest.php | 568 ++ .../Unit/V1/TargetHttpProxiesClientTest.php | 766 +++ .../Unit/V1/TargetHttpsProxiesClientTest.php | 1252 ++++ .../Unit/V1/TargetInstancesClientTest.php | 671 ++ .../tests/Unit/V1/TargetPoolsClientTest.php | 1365 ++++ .../Unit/V1/TargetSslProxiesClientTest.php | 1045 +++ .../Unit/V1/TargetTcpProxiesClientTest.php | 765 +++ .../Unit/V1/TargetVpnGatewaysClientTest.php | 669 ++ .../V1/tests/Unit/V1/UrlMapsClientTest.php | 948 +++ .../tests/Unit/V1/VpnGatewaysClientTest.php | 810 +++ .../V1/tests/Unit/V1/VpnTunnelsClientTest.php | 691 ++ .../Unit/V1/ZoneOperationsClientTest.php | 423 ++ .../V1/tests/Unit/V1/ZonesClientTest.php | 216 + 3689 files changed, 809916 insertions(+) create mode 100644 owl-bot-staging/Compute/V1/proto/src/GPBMetadata/Google/Cloud/Compute/V1/Compute.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AWSV4Signature.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AbandonInstancesInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AbandonInstancesRegionInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AcceleratorConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AcceleratorType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AcceleratorTypeAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AcceleratorTypeList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AcceleratorTypesScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Accelerators.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AccessConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AccessConfig/NetworkTier.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AccessConfig/Type.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddAccessConfigInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddAssociationFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddAssociationNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddAssociationRegionNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddHealthCheckTargetPoolRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddInstanceTargetPoolRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddInstancesInstanceGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddNodesNodeGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddPeeringNetworkRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddResourcePoliciesDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddResourcePoliciesInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddResourcePoliciesRegionDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddRuleFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddRuleNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddRuleRegionNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddRuleRegionSecurityPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddRuleSecurityPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddSignedUrlKeyBackendBucketRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddSignedUrlKeyBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/AddressType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/IpVersion.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/Ipv6EndpointType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/NetworkTier.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/Purpose.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddressAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddressList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddressesScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AdvancedMachineFeatures.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListAcceleratorTypesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListAddressesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListAutoscalersRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListBackendServicesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListDiskTypesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListDisksRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListForwardingRulesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListGlobalOperationsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListHealthChecksRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInstanceGroupManagersRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInstanceGroupsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInstanceTemplatesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInstancesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInstantSnapshotsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInterconnectAttachmentsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListMachineTypesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNetworkAttachmentsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNetworkEdgeSecurityServicesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNetworkEndpointGroupsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNodeGroupsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNodeTemplatesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNodeTypesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListPacketMirroringsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListPublicDelegatedPrefixesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListRegionCommitmentsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListReservationsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListResourcePoliciesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListRoutersRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListSecurityPoliciesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListServiceAttachmentsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListSslCertificatesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListSslPoliciesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListStoragePoolTypesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListStoragePoolsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListSubnetworksRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetHttpProxiesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetHttpsProxiesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetInstancesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetPoolsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetTcpProxiesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetVpnGatewaysRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListUrlMapsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListVpnGatewaysRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListVpnTunnelsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AliasIpRange.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationAggregateReservation.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationAggregateReservation/VmFamily.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationAggregateReservation/WorkloadType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationAggregateReservationReservedResourceInfo.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationAggregateReservationReservedResourceInfoAccelerator.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationResourceStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationResourceStatusSpecificSKUAllocation.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk/PBInterface.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationSpecificSKUAllocationReservedInstanceProperties.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationSpecificSKUReservation.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Allowed.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AnnouncePublicAdvertisedPrefixeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AnnouncePublicDelegatedPrefixeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ApplyUpdatesToInstancesInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachDiskInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachNetworkEndpointsNetworkEndpointGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachNetworkEndpointsRegionNetworkEndpointGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk/Architecture.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk/Mode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk/PBInterface.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk/SavedState.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk/Type.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDiskInitializeParams.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDiskInitializeParams/Architecture.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDiskInitializeParams/OnUpdateAction.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AuditConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AuditLogConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AuditLogConfig/LogType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AuthorizationLoggingOptions.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AuthorizationLoggingOptions/PermissionType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Autoscaler.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Autoscaler/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalerAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalerList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalerStatusDetails.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalerStatusDetails/Type.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalersScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicy/Mode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyCpuUtilization.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyCpuUtilization/PredictiveMethod.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyCustomMetricUtilization.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyCustomMetricUtilization/UtilizationTargetType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyLoadBalancingUtilization.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyScaleInControl.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyScalingSchedule.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Backend.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Backend/BalancingMode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Backend/Preference.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucket.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucket/CompressionMode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketCdnPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketCdnPolicy/CacheMode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketCdnPolicyBypassCacheOnRequestHeader.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketCdnPolicyCacheKeyPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketCdnPolicyNegativeCachingPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/CompressionMode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/LoadBalancingScheme.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/LocalityLbPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/Protocol.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/SessionAffinity.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceCdnPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceCdnPolicy/CacheMode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceCdnPolicyBypassCacheOnRequestHeader.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceCdnPolicyNegativeCachingPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceConnectionTrackingPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceConnectionTrackingPolicy/ConnectionPersistenceOnUnhealthyBackends.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceConnectionTrackingPolicy/TrackingMode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceFailoverPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceGroupHealth.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceIAP.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceListUsable.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLocalityLoadBalancingPolicyConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLocalityLoadBalancingPolicyConfigPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLocalityLoadBalancingPolicyConfigPolicy/Name.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLogConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLogConfig/OptionalMode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceReference.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceUsedBy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServicesScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdPacket.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdPacket/Diagnostic.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdPacket/State.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdStatus/BfdSessionInitializationMode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdStatus/LocalDiagnostic.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdStatus/LocalState.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdStatusPacketCounts.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Binding.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertDiskResource.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertInstanceResource.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertInstanceResourcePerInstanceProperties.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertOperationStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertOperationStatus/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertRegionDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertRegionInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CacheInvalidationRule.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CacheKeyPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CancelInstanceGroupManagerResizeRequestRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CircuitBreakers.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CloneRulesFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CloneRulesNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CloneRulesRegionNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Commitment.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Commitment/Category.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Commitment/Plan.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Commitment/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Commitment/Type.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CommitmentAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CommitmentList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CommitmentsScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Condition.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Condition/Iam.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Condition/Op.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Condition/Sys.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ConfidentialInstanceConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ConnectionDraining.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ConsistentHashLoadBalancerSettings.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ConsistentHashLoadBalancerSettingsHttpCookie.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CorsPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CreateInstancesInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CreateInstancesRegionInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CreateSnapshotDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CreateSnapshotRegionDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CustomerEncryptionKey.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CustomerEncryptionKeyProtectedDisk.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Data.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteAccessConfigInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteAddressRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteAutoscalerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteBackendBucketRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteExternalVpnGatewayRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteFirewallRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteForwardingRuleRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalAddressRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalForwardingRuleRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalNetworkEndpointGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalOperationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalOperationResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalOrganizationOperationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalOrganizationOperationResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalPublicDelegatedPrefixeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteHealthCheckRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteImageRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstanceGroupManagerResizeRequestRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstanceGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstanceTemplateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstancesInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstancesRegionInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstantSnapshotRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInterconnectAttachmentRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInterconnectRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteLicenseRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteMachineImageRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNetworkAttachmentRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNetworkEdgeSecurityServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNetworkEndpointGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNetworkRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNodeGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNodeTemplateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNodesNodeGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeletePacketMirroringRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeletePerInstanceConfigsInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeletePublicAdvertisedPrefixeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeletePublicDelegatedPrefixeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionAutoscalerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionHealthCheckRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionHealthCheckServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionInstanceTemplateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionInstantSnapshotRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionNetworkEndpointGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionNotificationEndpointRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionOperationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionOperationResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionSecurityPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionSslCertificateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionSslPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionTargetHttpProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionTargetHttpsProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionTargetTcpProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionUrlMapRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteReservationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteResourcePolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRouteRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRouterRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSecurityPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteServiceAttachmentRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSignedUrlKeyBackendBucketRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSignedUrlKeyBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSnapshotRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSslCertificateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSslPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteStoragePoolRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSubnetworkRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetGrpcProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetHttpProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetHttpsProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetPoolRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetSslProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetTcpProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetVpnGatewayRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteUrlMapRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteVpnGatewayRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteVpnTunnelRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteZoneOperationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteZoneOperationResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Denied.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeprecateImageRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeprecationStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeprecationStatus/State.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DetachDiskInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DetachNetworkEndpointsNetworkEndpointGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DetachNetworkEndpointsRegionNetworkEndpointGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisableXpnHostProjectRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisableXpnResourceProjectRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Disk.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Disk/Architecture.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Disk/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskAsyncReplication.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskAsyncReplicationList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskInstantiationConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskInstantiationConfig/InstantiateFrom.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskMoveRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskParams.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskResourceStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskResourceStatusAsyncReplicationStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskResourceStatusAsyncReplicationStatus/State.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskTypeAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskTypeList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskTypesScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksAddResourcePoliciesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksRemoveResourcePoliciesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksResizeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksStartAsyncReplicationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksStopGroupAsyncReplicationResource.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisplayDevice.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DistributionPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DistributionPolicy/TargetShape.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DistributionPolicyZoneConfiguration.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Duration.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/EnableXpnHostProjectRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/EnableXpnResourceProjectRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Error.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ErrorDetails.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ErrorInfo.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Errors.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExchangedPeeringRoute.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExchangedPeeringRoute/Type.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExchangedPeeringRoutesList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExpandIpCidrRangeSubnetworkRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Expr.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExternalVpnGateway.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExternalVpnGateway/RedundancyType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExternalVpnGatewayInterface.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExternalVpnGatewayList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FileContentBuffer.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FileContentBuffer/FileType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Firewall.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Firewall/Direction.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallLogConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallLogConfig/Metadata.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPoliciesListAssociationsResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyAssociation.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRule.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRule/Direction.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRuleMatcher.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRuleMatcherLayer4Config.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRuleSecureTag.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRuleSecureTag/State.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FixedOrPercent.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule/IPProtocolEnum.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule/IpVersion.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule/LoadBalancingScheme.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule/NetworkTier.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule/PscConnectionStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRuleAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRuleList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRuleReference.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRuleServiceDirectoryRegistration.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRulesScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GRPCHealthCheck.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GRPCHealthCheck/PortSpecification.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAcceleratorTypeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAddressRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAssociationFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAssociationNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAssociationRegionNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAutoscalerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetBackendBucketRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetDiagnosticsInterconnectRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetDiskTypeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetEffectiveFirewallsInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetEffectiveFirewallsNetworkRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetExternalVpnGatewayRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetFirewallRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetForwardingRuleRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetFromFamilyImageRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalAddressRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalForwardingRuleRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalNetworkEndpointGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalOperationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalOrganizationOperationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalPublicDelegatedPrefixeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGuestAttributesInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetHealthBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetHealthCheckRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetHealthRegionBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetHealthTargetPoolRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyBackendBucketRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyImageRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyInstanceTemplateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyInstantSnapshotRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyLicenseRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyMachineImageRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyNetworkAttachmentRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyNodeGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyNodeTemplateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyRegionBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyRegionDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyRegionInstantSnapshotRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyRegionNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyReservationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyResourcePolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyServiceAttachmentRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicySnapshotRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyStoragePoolRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicySubnetworkRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetImageFamilyViewRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetImageRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceGroupManagerResizeRequestRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceSettingRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceTemplateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstantSnapshotRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInterconnectAttachmentRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInterconnectLocationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInterconnectRemoteLocationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInterconnectRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetLicenseCodeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetLicenseRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetMachineImageRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetMachineTypeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetMacsecConfigInterconnectRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNatIpInfoRouterRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNatMappingInfoRoutersRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNetworkAttachmentRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNetworkEdgeSecurityServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNetworkEndpointGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNetworkRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNodeGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNodeTemplateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNodeTypeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetPacketMirroringRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetProjectRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetPublicAdvertisedPrefixeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetPublicDelegatedPrefixeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionAutoscalerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionCommitmentRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionDiskTypeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionHealthCheckRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionHealthCheckServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionInstanceGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionInstanceTemplateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionInstantSnapshotRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionNetworkEndpointGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionNotificationEndpointRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionOperationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionSecurityPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionSslCertificateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionSslPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionTargetHttpProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionTargetHttpsProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionTargetTcpProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionUrlMapRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetReservationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetResourcePolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRouteRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRouterRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRouterStatusRouterRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRuleFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRuleNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRuleRegionNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRuleRegionSecurityPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRuleSecurityPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetScreenshotInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSecurityPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSerialPortOutputInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetServiceAttachmentRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetShieldedInstanceIdentityInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSnapshotRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSnapshotSettingRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSslCertificateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSslPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetStatusVpnGatewayRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetStoragePoolRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetStoragePoolTypeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSubnetworkRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetGrpcProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetHttpProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetHttpsProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetPoolRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetSslProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetTcpProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetVpnGatewayRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetUrlMapRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetVpnGatewayRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetVpnTunnelRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetXpnHostProjectRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetXpnResourcesProjectsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetZoneOperationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetZoneRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalAddressesMoveRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalNetworkEndpointGroupsAttachEndpointsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalNetworkEndpointGroupsDetachEndpointsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalOrganizationSetPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalSetLabelsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalSetPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GuestAttributes.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GuestAttributesEntry.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GuestAttributesValue.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GuestOsFeature.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GuestOsFeature/Type.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTP2HealthCheck.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTP2HealthCheck/PortSpecification.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTP2HealthCheck/ProxyHeader.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPHealthCheck.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPHealthCheck/PortSpecification.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPHealthCheck/ProxyHeader.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPSHealthCheck.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPSHealthCheck/PortSpecification.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPSHealthCheck/ProxyHeader.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheck.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheck/Type.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckLogConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckReference.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckService.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckService/HealthStatusAggregationPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckServiceReference.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckServicesList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthChecksAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthChecksScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatus/HealthState.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatus/WeightError.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatusForNetworkEndpoint.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatusForNetworkEndpoint/HealthState.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Help.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HelpLink.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HostRule.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpFaultAbort.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpFaultDelay.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpFaultInjection.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpHeaderAction.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpHeaderMatch.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpHeaderOption.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpQueryParameterMatch.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRedirectAction.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRedirectAction/RedirectResponseCode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRetryPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRouteAction.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRouteRule.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRouteRuleMatch.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Image.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Image/Architecture.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Image/SourceType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Image/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ImageFamilyView.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ImageList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InitialStateConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertAddressRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertAutoscalerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertBackendBucketRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertExternalVpnGatewayRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertFirewallRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertForwardingRuleRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertGlobalAddressRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertGlobalForwardingRuleRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertGlobalNetworkEndpointGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertGlobalPublicDelegatedPrefixeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertHealthCheckRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertImageRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstanceGroupManagerResizeRequestRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstanceGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstanceTemplateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstantSnapshotRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInterconnectAttachmentRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInterconnectRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertLicenseRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertMachineImageRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNetworkAttachmentRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNetworkEdgeSecurityServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNetworkEndpointGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNetworkRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNodeGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNodeTemplateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertPacketMirroringRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertPublicAdvertisedPrefixeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertPublicDelegatedPrefixeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionAutoscalerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionCommitmentRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionHealthCheckRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionHealthCheckServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionInstanceTemplateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionInstantSnapshotRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionNetworkEndpointGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionNotificationEndpointRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionSecurityPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionSslCertificateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionSslPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionTargetHttpProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionTargetHttpsProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionTargetTcpProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionUrlMapRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertReservationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertResourcePolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRouteRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRouterRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertSecurityPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertServiceAttachmentRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertSnapshotRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertSslCertificateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertSslPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertStoragePoolRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertSubnetworkRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetGrpcProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetHttpProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetHttpsProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetPoolRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetSslProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetTcpProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetVpnGatewayRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertUrlMapRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertVpnGatewayRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertVpnTunnelRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Instance.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Instance/KeyRevocationActionType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Instance/PrivateIpv6GoogleAccess.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Instance/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceConsumptionData.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceConsumptionInfo.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroup.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManager.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManager/ListManagedInstancesResults.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerActionsSummary.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerAllInstancesConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerAutoHealingPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerInstanceLifecyclePolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerInstanceLifecyclePolicy/DefaultActionOnFailure.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerInstanceLifecyclePolicy/ForceUpdateOnRepair.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerResizeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerResizeRequest/State.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerResizeRequestStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerResizeRequestStatusLastAttempt.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerResizeRequestsListResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStatusAllInstancesConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStatusStateful.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStatusStatefulPerInstanceConfigs.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStatusVersionTarget.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy/InstanceRedistributionType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy/MinimalAction.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy/MostDisruptiveAllowedAction.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy/ReplacementMethod.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy/Type.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerVersion.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersAbandonInstancesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersApplyUpdatesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersApplyUpdatesRequest/MinimalAction.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersApplyUpdatesRequest/MostDisruptiveAllowedAction.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersCreateInstancesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersDeleteInstancesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersDeletePerInstanceConfigsReq.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersListErrorsResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersListManagedInstancesResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersListPerInstanceConfigsResp.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersPatchPerInstanceConfigsReq.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersRecreateInstancesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersSetInstanceTemplateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersSetTargetPoolsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersUpdatePerInstanceConfigsReq.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsAddInstancesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsListInstances.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsListInstancesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsListInstancesRequest/InstanceState.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsRemoveInstancesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsSetNamedPortsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceListReferrers.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceManagedByIgmError.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceManagedByIgmErrorInstanceActionDetails.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceManagedByIgmErrorInstanceActionDetails/Action.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceManagedByIgmErrorManagedInstanceError.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceMoveRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceParams.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceProperties.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceProperties/KeyRevocationActionType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceProperties/PrivateIpv6GoogleAccess.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancePropertiesPatch.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceReference.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceSettings.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceSettingsMetadata.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceTemplate.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceTemplateAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceTemplateList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceTemplatesScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceWithNamedPorts.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceWithNamedPorts/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesAddResourcePoliciesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesBulkInsertOperationMetadata.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesGetEffectiveFirewallsResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy/Type.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesRemoveResourcePoliciesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetLabelsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetMachineResourcesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetMachineTypeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetMinCpuPlatformRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetNameRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetSecurityPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetServiceAccountRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesStartWithEncryptionKeyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshot.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshot/Architecture.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshot/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshotAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshotList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshotResourceStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshotsScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Int64RangeMatch.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/AvailableFeatures.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/InterconnectType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/LinkType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/OperationalStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/RequestedFeatures.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/State.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/Bandwidth.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/EdgeAvailabilityDomain.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/Encryption.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/OperationalStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/StackType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/State.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/Type.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentConfigurationConstraints.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentConfigurationConstraints/BgpMd5.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentPartnerMetadata.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentPrivateInfo.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentsScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectCircuitInfo.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnostics.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnostics/BundleAggregationType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnostics/BundleOperationalStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsARPEntry.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkLACPStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkLACPStatus/State.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkOpticalPower.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkOpticalPower/State.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkStatus/OperationalStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsMacsecStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocation.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocation/AvailableFeatures.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocation/AvailableLinkTypes.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocation/Continent.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocation/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocationList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocationRegionInfo.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocationRegionInfo/LocationPresence.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectMacsec.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectMacsecConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectMacsecConfigPreSharedKey.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectMacsecPreSharedKey.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectOutageNotification.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectOutageNotification/IssueType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectOutageNotification/Source.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectOutageNotification/State.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocation.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocation/Continent.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocation/Lacp.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocation/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationConstraints.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationConstraints/PortPairRemoteLocation.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationConstraints/PortPairVlan.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationConstraintsSubnetLengthRange.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationPermittedConnections.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectsGetDiagnosticsResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectsGetMacsecConfigResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InvalidateCacheUrlMapRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Items.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/License.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicenseCode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicenseCode/State.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicenseCodeLicenseAlias.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicenseResourceCommitment.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicenseResourceRequirements.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicensesListResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAcceleratorTypesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAddressesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAssociationsFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAutoscalersRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAvailableFeaturesRegionSslPoliciesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAvailableFeaturesSslPoliciesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListBackendBucketsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListBackendServicesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListDiskTypesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListDisksRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListDisksStoragePoolsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListErrorsInstanceGroupManagersRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListErrorsRegionInstanceGroupManagersRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListExternalVpnGatewaysRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListFirewallPoliciesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListFirewallsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListForwardingRulesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalAddressesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalForwardingRulesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalNetworkEndpointGroupsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalOperationsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalOrganizationOperationsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalPublicDelegatedPrefixesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListHealthChecksRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListImagesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstanceGroupManagerResizeRequestsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstanceGroupManagersRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstanceGroupsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstanceTemplatesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstancesInstanceGroupsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstancesRegionInstanceGroupsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstancesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstantSnapshotsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInterconnectAttachmentsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInterconnectLocationsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInterconnectRemoteLocationsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInterconnectsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListLicensesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListMachineImagesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListMachineTypesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListManagedInstancesInstanceGroupManagersRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListManagedInstancesRegionInstanceGroupManagersRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkAttachmentsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkEndpointGroupsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkEndpointsNetworkEndpointGroupsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkEndpointsRegionNetworkEndpointGroupsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkFirewallPoliciesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworksRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNodeGroupsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNodeTemplatesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNodeTypesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNodesNodeGroupsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPacketMirroringsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPeeringRoutesNetworksRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPeeringRoutesNetworksRequest/Direction.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPerInstanceConfigsInstanceGroupManagersRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPerInstanceConfigsRegionInstanceGroupManagersRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPreconfiguredExpressionSetsSecurityPoliciesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPublicAdvertisedPrefixesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPublicDelegatedPrefixesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListReferrersInstancesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionAutoscalersRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionBackendServicesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionCommitmentsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionDiskTypesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionDisksRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionHealthCheckServicesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionHealthChecksRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionInstanceGroupManagersRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionInstanceGroupsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionInstanceTemplatesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionInstantSnapshotsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionNetworkEndpointGroupsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionNetworkFirewallPoliciesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionNotificationEndpointsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionOperationsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionSecurityPoliciesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionSslCertificatesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionSslPoliciesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionTargetHttpProxiesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionTargetHttpsProxiesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionTargetTcpProxiesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionUrlMapsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionZonesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListReservationsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListResourcePoliciesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRoutersRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRoutesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListSecurityPoliciesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListServiceAttachmentsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListSnapshotsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListSslCertificatesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListSslPoliciesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListStoragePoolTypesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListStoragePoolsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListSubnetworksRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetGrpcProxiesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetHttpProxiesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetHttpsProxiesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetInstancesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetPoolsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetSslProxiesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetTcpProxiesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetVpnGatewaysRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListUrlMapsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListUsableBackendServicesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListUsableRegionBackendServicesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListUsableSubnetworksRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListVpnGatewaysRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListVpnTunnelsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListXpnHostsProjectsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListZoneOperationsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListZonesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocalDisk.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocalizedMessage.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocationPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocationPolicy/TargetShape.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocationPolicyLocation.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocationPolicyLocation/Preference.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocationPolicyLocationConstraints.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigCloudAuditOptions.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigCloudAuditOptions/LogName.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigCounterOptions.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigCounterOptionsCustomField.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigDataAccessOptions.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigDataAccessOptions/LogMode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineImage.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineImage/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineImageList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineTypeAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineTypeList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineTypesScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstance.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstance/CurrentAction.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstance/InstanceStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstanceInstanceHealth.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstanceInstanceHealth/DetailedHealthState.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstanceLastAttempt.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstanceVersion.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Metadata.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MetadataFilter.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MetadataFilter/FilterMatchCriteria.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MetadataFilterLabelMatch.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MoveAddressRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MoveDiskProjectRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MoveFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MoveGlobalAddressRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MoveInstanceProjectRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NamedPort.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NatIpInfo.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NatIpInfoNatIpInfoMapping.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NatIpInfoNatIpInfoMapping/Mode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NatIpInfoNatIpInfoMapping/Usage.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NatIpInfoResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Network.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Network/NetworkFirewallPolicyEnforcementOrder.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachment.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachment/ConnectionPreference.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachmentAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachmentConnectedEndpoint.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachmentConnectedEndpoint/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachmentList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachmentsScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEdgeSecurityService.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEdgeSecurityServiceAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEdgeSecurityServicesScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpoint.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroup.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroup/NetworkEndpointType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupAppEngine.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupCloudFunction.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupCloudRun.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupPscData.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupPscData/PscConnectionStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsAttachEndpointsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsDetachEndpointsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsListEndpointsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsListEndpointsRequest/HealthStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsListNetworkEndpoints.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointWithHealthStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkInterface.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkInterface/Ipv6AccessType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkInterface/NicType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkInterface/StackType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkPeering.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkPeering/StackType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkPeering/State.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkPerformanceConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkPerformanceConfig/TotalEgressBandwidthTier.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkRoutingConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkRoutingConfig/RoutingMode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksAddPeeringRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksGetEffectiveFirewallsResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy/Type.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksRemovePeeringRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksUpdatePeeringRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroup.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroup/MaintenanceInterval.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroup/MaintenancePolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroup/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupAutoscalingPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupAutoscalingPolicy/Mode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupMaintenanceWindow.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupNode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupNode/CpuOvercommitType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupNode/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsAddNodesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsDeleteNodesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsListNodes.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsPerformMaintenanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsSetNodeTemplateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsSimulateMaintenanceEventRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplate.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplate/CpuOvercommitType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplate/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplateAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplateList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplateNodeTypeFlexibility.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplatesScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTypeAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTypeList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTypesScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NotificationEndpoint.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NotificationEndpointGrpcSettings.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NotificationEndpointList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Operation.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Operation/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/OperationAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/OperationList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/OperationsScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/OutlierDetection.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketIntervals.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketIntervals/Duration.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketIntervals/Type.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroring.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroring/Enable.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringFilter.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringFilter/Direction.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringForwardingRuleInfo.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringMirroredResourceInfo.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringMirroredResourceInfoInstanceInfo.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringMirroredResourceInfoSubnetInfo.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringNetworkInfo.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringsScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchAutoscalerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchBackendBucketRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchFirewallRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchForwardingRuleRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchGlobalForwardingRuleRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchGlobalPublicDelegatedPrefixeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchHealthCheckRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchImageRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchInstanceSettingRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchInterconnectAttachmentRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchInterconnectRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchNetworkAttachmentRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchNetworkEdgeSecurityServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchNetworkRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchNodeGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchPacketMirroringRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchPerInstanceConfigsInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchPublicAdvertisedPrefixeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchPublicDelegatedPrefixeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionAutoscalerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionHealthCheckRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionHealthCheckServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionSecurityPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionSslPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionTargetHttpsProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionUrlMapRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchResourcePolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRouterRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRuleFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRuleNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRuleRegionNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRuleRegionSecurityPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRuleSecurityPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchSecurityPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchServiceAttachmentRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchSnapshotSettingRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchSslPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchSubnetworkRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchTargetGrpcProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchTargetHttpProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchTargetHttpsProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchUrlMapRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PathMatcher.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PathRule.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PerInstanceConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PerInstanceConfig/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PerformMaintenanceInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PerformMaintenanceNodeGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Policy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreconfiguredWafSet.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedState.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedDisk.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedDisk/AutoDelete.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedDisk/Mode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedNetworkIp.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedNetworkIp/AutoDelete.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedNetworkIpIpAddress.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreviewRouterRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Project.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Project/CloudArmorTier.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Project/DefaultNetworkTier.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Project/VmDnsSetting.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Project/XpnProjectStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsDisableXpnResourceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsEnableXpnResourceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsGetXpnResources.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsListXpnHostsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsSetCloudArmorTierRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsSetCloudArmorTierRequest/CloudArmorTier.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsSetDefaultNetworkTierRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsSetDefaultNetworkTierRequest/NetworkTier.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefix.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefix/ByoipApiVersion.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefix/PdpScope.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefix/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefixList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefixPublicDelegatedPrefix.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefix.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefix/ByoipApiVersion.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefix/Mode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefix/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixPublicDelegatedSubPrefix.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixPublicDelegatedSubPrefix/Mode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixPublicDelegatedSubPrefix/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixesScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Quota.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Quota/Metric.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/QuotaExceededInfo.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/QuotaExceededInfo/RolloutStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/QuotaStatusWarning.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/QuotaStatusWarning/Code.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RawDisk.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RawDisk/ContainerType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RecreateInstancesInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RecreateInstancesRegionInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Reference.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Region.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Region/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionAddressesMoveRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionAutoscalerList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionDiskTypeList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionDisksAddResourcePoliciesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionDisksRemoveResourcePoliciesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionDisksResizeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionDisksStartAsyncReplicationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagerDeleteInstanceConfigReq.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagerList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagerPatchInstanceConfigReq.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagerUpdateInstanceConfigReq.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersAbandonInstancesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersApplyUpdatesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersApplyUpdatesRequest/MinimalAction.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersApplyUpdatesRequest/MostDisruptiveAllowedAction.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersCreateInstancesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersDeleteInstancesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersListErrorsResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersListInstanceConfigsResp.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersListInstancesResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersRecreateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersSetTargetPoolsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersSetTemplateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupsListInstances.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupsListInstancesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupsListInstancesRequest/InstanceState.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupsSetNamedPortsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionNetworkEndpointGroupsAttachEndpointsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionNetworkEndpointGroupsDetachEndpointsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy/Type.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionSetLabelsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionSetPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionTargetHttpsProxiesSetSslCertificatesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionUrlMapsValidateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveAssociationFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveAssociationNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveAssociationRegionNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveHealthCheckTargetPoolRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveInstanceTargetPoolRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveInstancesInstanceGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemovePeeringNetworkRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveResourcePoliciesDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveResourcePoliciesInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveResourcePoliciesRegionDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveRuleFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveRuleNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveRuleRegionNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveRuleRegionSecurityPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveRuleSecurityPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RequestMirrorPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Reservation.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Reservation/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationAffinity.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationAffinity/ConsumeReservationType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationsResizeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationsScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResetInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResizeDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResizeInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResizeRegionDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResizeRegionInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResizeReservationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourceCommitment.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourceCommitment/Type.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourceGroupReference.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePoliciesScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicy/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyDailyCycle.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyDiskConsistencyGroupPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyGroupPlacementPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyGroupPlacementPolicy/Collocation.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyHourlyCycle.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyInstanceSchedulePolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyInstanceSchedulePolicySchedule.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyResourceStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicySnapshotSchedulePolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicySnapshotSchedulePolicyRetentionPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicySnapshotSchedulePolicyRetentionPolicy/OnSourceDiskDelete.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicySnapshotSchedulePolicySchedule.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicySnapshotSchedulePolicySnapshotProperties.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyWeeklyCycle.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyWeeklyCycleDayOfWeek.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyWeeklyCycleDayOfWeek/Day.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourceStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResumeInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Route.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Route/RouteStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Route/RouteType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouteAsPath.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouteAsPath/PathSegmentType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouteList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Router.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterAdvertisedIpRange.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgp.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgp/AdvertiseMode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgp/AdvertisedGroups.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeer.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeer/AdvertiseMode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeer/AdvertisedGroups.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeer/Enable.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeer/ManagementType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeerBfd.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeerBfd/SessionInitializationMode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeerCustomLearnedIpRange.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterInterface.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterInterface/IpVersion.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterInterface/ManagementType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterMd5AuthenticationKey.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat/AutoNetworkTier.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat/EndpointTypes.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat/NatIpAllocateOption.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat/SourceSubnetworkIpRangesToNat.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat/Type.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatLogConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatLogConfig/Filter.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatRule.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatRuleAction.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatSubnetworkToNat.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatSubnetworkToNat/SourceIpRangesToNat.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusBgpPeerStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusBgpPeerStatus/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusBgpPeerStatus/StatusReason.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusNatStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusNatStatusNatRuleStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RoutersPreviewResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RoutersScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Rule.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Rule/Action.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SSLHealthCheck.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SSLHealthCheck/PortSpecification.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SSLHealthCheck/ProxyHeader.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedAttachedDisk.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedAttachedDisk/Mode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedAttachedDisk/PBInterface.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedAttachedDisk/StorageBytesStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedAttachedDisk/Type.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedDisk.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedDisk/Architecture.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedDisk/StorageBytesStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ScalingScheduleStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ScalingScheduleStatus/State.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Scheduling.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Scheduling/InstanceTerminationAction.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Scheduling/OnHostMaintenance.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Scheduling/ProvisioningModel.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SchedulingNodeAffinity.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SchedulingNodeAffinity/Operator.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ScratchDisks.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Screenshot.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPoliciesAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPoliciesListPreconfiguredExpressionSetsResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPoliciesScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPoliciesWafConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicy/Type.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig/RuleVisibility.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdvancedOptionsConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdvancedOptionsConfig/JsonParsing.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdvancedOptionsConfig/LogLevel.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdvancedOptionsConfigJsonCustomConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyDdosProtectionConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyDdosProtectionConfig/DdosProtection.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRecaptchaOptionsConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyReference.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRule.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleHttpHeaderAction.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleHttpHeaderActionHttpHeaderOption.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleMatcher.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleMatcher/VersionedExpr.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleMatcherConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleMatcherExprOptions.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleNetworkMatcher.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRulePreconfiguredWafConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRulePreconfiguredWafConfigExclusion.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams/Op.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRateLimitOptions.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRateLimitOptions/EnforceOnKey.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig/EnforceOnKeyType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRateLimitOptionsThreshold.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRedirectOptions.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRedirectOptions/Type.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyUserDefinedField.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyUserDefinedField/Base.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecuritySettings.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SendDiagnosticInterruptInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SendDiagnosticInterruptInstanceResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SerialPortOutput.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServerBinding.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServerBinding/Type.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAccount.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachment.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachment/ConnectionPreference.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentConnectedEndpoint.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentConnectedEndpoint/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentConsumerProjectLimit.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentsScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetBackendServiceTargetSslProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetBackendServiceTargetTcpProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetBackupTargetPoolRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCertificateMapTargetHttpsProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCertificateMapTargetSslProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCloudArmorTierProjectRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCommonInstanceMetadataOperationMetadata.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo/State.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCommonInstanceMetadataProjectRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetDefaultNetworkTierProjectRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetDeletionProtectionInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetDiskAutoDeleteInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetEdgeSecurityPolicyBackendBucketRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetEdgeSecurityPolicyBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyBackendBucketRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyImageRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyInstanceTemplateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyInstantSnapshotRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyLicenseRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyMachineImageRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyNetworkAttachmentRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyNodeGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyNodeTemplateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyRegionBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyRegionDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyRegionInstantSnapshotRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyRegionNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyReservationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyResourcePolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyServiceAttachmentRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicySnapshotRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyStoragePoolRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicySubnetworkRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetInstanceTemplateInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetInstanceTemplateRegionInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsAddressRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsExternalVpnGatewayRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsForwardingRuleRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsGlobalAddressRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsGlobalForwardingRuleRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsImageRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsInstantSnapshotRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsInterconnectAttachmentRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsInterconnectRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsRegionDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsRegionInstantSnapshotRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsSecurityPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsSnapshotRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsTargetVpnGatewayRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsVpnGatewayRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsVpnTunnelRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetMachineResourcesInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetMachineTypeInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetMetadataInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetMinCpuPlatformInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetNameInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetNamedPortsInstanceGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetNamedPortsRegionInstanceGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetNodeTemplateNodeGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetPrivateIpGoogleAccessSubnetworkRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetProxyHeaderTargetSslProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetProxyHeaderTargetTcpProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetQuicOverrideTargetHttpsProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSchedulingInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSecurityPolicyBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSecurityPolicyInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSecurityPolicyRegionBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSecurityPolicyTargetInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSecurityPolicyTargetPoolRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetServiceAccountInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetShieldedInstanceIntegrityPolicyInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSslCertificatesRegionTargetHttpsProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSslCertificatesTargetHttpsProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSslCertificatesTargetSslProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSslPolicyTargetHttpsProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSslPolicyTargetSslProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetTagsInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetTargetForwardingRuleRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetTargetGlobalForwardingRuleRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetTargetPoolsInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetTargetPoolsRegionInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetUrlMapRegionTargetHttpProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetUrlMapRegionTargetHttpsProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetUrlMapTargetHttpProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetUrlMapTargetHttpsProxyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetUsageExportBucketProjectRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShareSettings.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShareSettings/ShareType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShareSettingsProjectConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShieldedInstanceConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShieldedInstanceIdentity.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShieldedInstanceIdentityEntry.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShieldedInstanceIntegrityPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SignedUrlKey.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SimulateMaintenanceEventInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SimulateMaintenanceEventNodeGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Snapshot.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Snapshot/Architecture.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Snapshot/SnapshotType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Snapshot/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Snapshot/StorageBytesStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SnapshotList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SnapshotSettings.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SnapshotSettingsStorageLocationSettings.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SnapshotSettingsStorageLocationSettings/Policy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SnapshotSettingsStorageLocationSettingsStorageLocationPreference.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SourceDiskEncryptionKey.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SourceInstanceParams.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SourceInstanceProperties.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SourceInstanceProperties/KeyRevocationActionType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificate.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificate/Type.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificateAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificateList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificateManagedSslCertificate.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificateManagedSslCertificate/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificateSelfManagedSslCertificate.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificatesScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPoliciesAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPoliciesList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPoliciesListAvailableFeaturesResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPoliciesScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPolicy/MinTlsVersion.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPolicy/Profile.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPolicyReference.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StartAsyncReplicationDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StartAsyncReplicationRegionDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StartInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StartWithEncryptionKeyInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicyPreservedState.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicyPreservedStateDiskDevice.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicyPreservedStateDiskDevice/AutoDelete.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicyPreservedStateNetworkIp.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicyPreservedStateNetworkIp/AutoDelete.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopAsyncReplicationDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopAsyncReplicationRegionDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopGroupAsyncReplicationDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopGroupAsyncReplicationRegionDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePool.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePool/CapacityProvisioningType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePool/PerformanceProvisioningType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePool/State.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolDisk.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolDisk/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolListDisks.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolResourceStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolTypeAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolTypeList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolTypesScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolsScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/Ipv6AccessType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/PrivateIpv6GoogleAccess.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/Purpose.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/Role.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/StackType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/State.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkLogConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkLogConfig/AggregationInterval.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkLogConfig/Metadata.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkSecondaryRange.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworksExpandIpCidrRangeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworksScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworksSetPrivateIpGoogleAccessRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subsetting.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subsetting/Policy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SuspendInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SwitchToCustomModeNetworkRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TCPHealthCheck.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TCPHealthCheck/PortSpecification.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TCPHealthCheck/ProxyHeader.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Tags.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetGrpcProxy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetGrpcProxyList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpProxiesScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpProxy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpProxyAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpProxyList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxiesScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxiesSetCertificateMapRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxiesSetQuicOverrideRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxiesSetQuicOverrideRequest/QuicOverride.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxiesSetSslCertificatesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxy/QuicOverride.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxyAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxyList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetInstance.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetInstance/NatPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetInstanceAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetInstanceList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetInstancesScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPool.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPool/SessionAffinity.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolInstanceHealth.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolsAddHealthCheckRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolsAddInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolsRemoveHealthCheckRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolsRemoveInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolsScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetReference.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxiesSetBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxiesSetCertificateMapRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxiesSetProxyHeaderRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxiesSetProxyHeaderRequest/ProxyHeader.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxiesSetSslCertificatesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxy/ProxyHeader.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxyList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxiesScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxiesSetBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxiesSetProxyHeaderRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxiesSetProxyHeaderRequest/ProxyHeader.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxy/ProxyHeader.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxyAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxyList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetVpnGateway.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetVpnGateway/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetVpnGatewayAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetVpnGatewayList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetVpnGatewaysScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestFailure.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsBackendBucketRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsExternalVpnGatewayRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsImageRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsInstanceTemplateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsInstantSnapshotRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsLicenseCodeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsLicenseRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsMachineImageRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsNetworkAttachmentRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsNetworkEndpointGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsNodeGroupRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsNodeTemplateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsPacketMirroringRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsRegionBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsRegionDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsRegionInstantSnapshotRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsRegionNetworkFirewallPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsReservationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsResourcePolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsServiceAttachmentRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsSnapshotRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsStoragePoolRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsSubnetworkRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsVpnGatewayRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestPermissionsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestPermissionsResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Uint128.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpcomingMaintenance.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpcomingMaintenance/MaintenanceStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpcomingMaintenance/Type.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateAccessConfigInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateAutoscalerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateBackendBucketRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateDisplayDeviceInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateFirewallRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateHealthCheckRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateInstanceRequest/MinimalAction.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateInstanceRequest/MostDisruptiveAllowedAction.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateNetworkInterfaceInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdatePeeringNetworkRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdatePerInstanceConfigsInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionAutoscalerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionBackendServiceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionCommitmentRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionDiskRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionHealthCheckRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionUrlMapRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateReservationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRouterRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateShieldedInstanceConfigInstanceRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateStoragePoolRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateUrlMapRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMap.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapReference.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapTest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapTestHeader.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapValidationResult.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapsAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapsScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapsValidateRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapsValidateRequest/LoadBalancingSchemes.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapsValidateResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlRewrite.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetwork.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetwork/Ipv6AccessType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetwork/Purpose.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetwork/Role.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetwork/StackType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetworkSecondaryRange.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetworksAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsageExportLocation.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ValidateRegionUrlMapRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ValidateUrlMapRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VmEndpointNatMappings.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VmEndpointNatMappingsInterfaceNatMappings.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VmEndpointNatMappingsList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGateway.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGateway/GatewayIpVersion.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGateway/StackType.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatus.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatusHighAvailabilityRequirementState.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatusHighAvailabilityRequirementState/State.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatusHighAvailabilityRequirementState/UnsatisfiedReason.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatusTunnel.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatusVpnConnection.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayVpnGatewayInterface.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewaysGetStatusResponse.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewaysScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnTunnel.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnTunnel/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnTunnelAggregatedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnTunnelList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnTunnelsScopedList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WafExpressionSet.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WafExpressionSetExpression.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WaitGlobalOperationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WaitRegionOperationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WaitZoneOperationRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Warning.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Warning/Code.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Warnings.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Warnings/Code.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WeightedBackendService.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WithdrawPublicAdvertisedPrefixeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WithdrawPublicDelegatedPrefixeRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/XpnHostList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/XpnResourceId.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/XpnResourceId/Type.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Zone.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Zone/Status.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ZoneList.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ZoneSetLabelsRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ZoneSetPolicyRequest.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/AcceleratorTypesClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/AcceleratorTypesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/AcceleratorTypesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/AddressesClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/AddressesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/AddressesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/AddressesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/AddressesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/AddressesClient/move.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/AddressesClient/set_labels.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/update.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/add_signed_url_key.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/delete_signed_url_key.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/set_edge_security_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/update.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/add_signed_url_key.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/delete_signed_url_key.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/get_health.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/list_usable.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/set_edge_security_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/set_security_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/update.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/DiskTypesClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/DiskTypesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/DiskTypesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/DisksClient/add_resource_policies.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/DisksClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/DisksClient/bulk_insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/DisksClient/create_snapshot.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/DisksClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/DisksClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/DisksClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/DisksClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/DisksClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/DisksClient/remove_resource_policies.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/DisksClient/resize.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/DisksClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/DisksClient/set_labels.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/DisksClient/start_async_replication.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/DisksClient/stop_async_replication.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/DisksClient/stop_group_async_replication.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/DisksClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/DisksClient/update.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/set_labels.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/add_association.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/add_rule.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/clone_rules.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/get_association.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/get_rule.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/list_associations.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/move.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/patch_rule.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/remove_association.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/remove_rule.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/update.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/set_labels.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/set_target.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/move.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/set_labels.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/set_labels.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/set_target.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/attach_network_endpoints.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/detach_network_endpoints.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/list_network_endpoints.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/wait.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalOrganizationOperationsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalOrganizationOperationsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalOrganizationOperationsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/update.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ImageFamilyViewsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ImagesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ImagesClient/deprecate.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ImagesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ImagesClient/get_from_family.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ImagesClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ImagesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ImagesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ImagesClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ImagesClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ImagesClient/set_labels.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ImagesClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/cancel.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/abandon_instances.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/apply_updates_to_instances.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/create_instances.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/delete_instances.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/delete_per_instance_configs.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/list_errors.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/list_managed_instances.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/list_per_instance_configs.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/patch_per_instance_configs.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/recreate_instances.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/resize.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/set_instance_template.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/set_target_pools.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/update_per_instance_configs.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/add_instances.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/list_instances.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/remove_instances.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/set_named_ports.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceSettingsServiceClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceSettingsServiceClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/add_access_config.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/add_resource_policies.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/attach_disk.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/bulk_insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/delete_access_config.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/detach_disk.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_effective_firewalls.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_guest_attributes.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_screenshot.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_serial_port_output.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_shielded_instance_identity.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/list_referrers.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/perform_maintenance.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/remove_resource_policies.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/reset.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/resume.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/send_diagnostic_interrupt.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_deletion_protection.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_disk_auto_delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_labels.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_machine_resources.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_machine_type.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_metadata.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_min_cpu_platform.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_name.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_scheduling.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_security_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_service_account.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_shielded_instance_integrity_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_tags.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/simulate_maintenance_event.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/start.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/start_with_encryption_key.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/stop.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/suspend.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update_access_config.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update_display_device.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update_network_interface.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update_shielded_instance_config.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/set_labels.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/set_labels.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InterconnectLocationsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InterconnectLocationsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InterconnectRemoteLocationsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InterconnectRemoteLocationsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/get_diagnostics.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/get_macsec_config.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/set_labels.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/LicenseCodesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/LicenseCodesClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/LicensesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/LicensesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/LicensesClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/LicensesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/LicensesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/LicensesClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/LicensesClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/MachineTypesClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/MachineTypesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/MachineTypesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/attach_network_endpoints.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/detach_network_endpoints.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/list_network_endpoints.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/add_association.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/add_rule.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/clone_rules.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/get_association.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/get_rule.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/patch_rule.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/remove_association.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/remove_rule.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworksClient/add_peering.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworksClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworksClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworksClient/get_effective_firewalls.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworksClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworksClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworksClient/list_peering_routes.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworksClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworksClient/remove_peering.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworksClient/switch_to_custom_mode.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworksClient/update_peering.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/add_nodes.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/delete_nodes.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/list_nodes.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/perform_maintenance.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/set_node_template.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/simulate_maintenance_event.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeTypesClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeTypesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NodeTypesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/disable_xpn_host.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/disable_xpn_resource.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/enable_xpn_host.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/enable_xpn_resource.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/get_xpn_host.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/get_xpn_resources.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/list_xpn_hosts.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/move_disk.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/move_instance.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/set_cloud_armor_tier.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/set_common_instance_metadata.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/set_default_network_tier.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/set_usage_export_bucket.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/announce.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/withdraw.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/announce.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/withdraw.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/update.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/get_health.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/list_usable.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/set_security_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/update.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/update.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionDiskTypesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionDiskTypesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/add_resource_policies.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/bulk_insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/create_snapshot.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/remove_resource_policies.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/resize.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/set_labels.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/start_async_replication.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/stop_async_replication.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/stop_group_async_replication.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/update.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/update.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/abandon_instances.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/apply_updates_to_instances.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/create_instances.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/delete_instances.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/delete_per_instance_configs.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/list_errors.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/list_managed_instances.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/list_per_instance_configs.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/patch_per_instance_configs.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/recreate_instances.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/resize.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/set_instance_template.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/set_target_pools.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/update_per_instance_configs.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupsClient/list_instances.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupsClient/set_named_ports.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceTemplatesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceTemplatesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceTemplatesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceTemplatesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstancesClient/bulk_insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/set_labels.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/attach_network_endpoints.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/detach_network_endpoints.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/list_network_endpoints.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/add_association.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/add_rule.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/clone_rules.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get_association.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get_effective_firewalls.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get_rule.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/patch_rule.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/remove_association.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/remove_rule.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNotificationEndpointsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNotificationEndpointsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNotificationEndpointsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionNotificationEndpointsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionOperationsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionOperationsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionOperationsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionOperationsClient/wait.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/add_rule.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/get_rule.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/patch_rule.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/remove_rule.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionSslCertificatesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionSslCertificatesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionSslCertificatesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionSslCertificatesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/list_available_features.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/set_url_map.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/set_ssl_certificates.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/set_url_map.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionTargetTcpProxiesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionTargetTcpProxiesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionTargetTcpProxiesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionTargetTcpProxiesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/update.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/validate.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionZonesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/resize.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/update.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RoutersClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RoutersClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RoutersClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RoutersClient/get_nat_ip_info.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RoutersClient/get_nat_mapping_info.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RoutersClient/get_router_status.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RoutersClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RoutersClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RoutersClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RoutersClient/preview.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RoutersClient/update.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RoutesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RoutesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RoutesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RoutesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/add_rule.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/get_rule.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/list_preconfigured_expression_sets.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/patch_rule.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/remove_rule.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/set_labels.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SnapshotSettingsServiceClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SnapshotSettingsServiceClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/set_labels.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/list_available_features.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/StoragePoolTypesClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/StoragePoolTypesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/StoragePoolTypesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/list_disks.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/update.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/expand_ip_cidr_range.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/get_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/list_usable.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/set_iam_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/set_private_ip_google_access.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/set_url_map.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_certificate_map.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_quic_override.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_ssl_certificates.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_ssl_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_url_map.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/set_security_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/add_health_check.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/add_instance.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/get_health.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/remove_health_check.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/remove_instance.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/set_backup.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/set_security_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_backend_service.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_certificate_map.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_proxy_header.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_ssl_certificates.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_ssl_policy.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/set_backend_service.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/set_proxy_header.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/set_labels.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/invalidate_cache.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/patch.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/update.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/validate.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/get_status.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/set_labels.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/test_iam_permissions.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/aggregated_list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/insert.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/set_labels.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ZoneOperationsClient/delete.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ZoneOperationsClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ZoneOperationsClient/list.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ZoneOperationsClient/wait.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ZonesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/ZonesClient/list.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/AcceleratorTypesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/AddressesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/AutoscalersClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/BackendBucketsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/BackendServicesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/AcceleratorTypesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/AddressesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/AutoscalersClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/BackendBucketsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/BackendServicesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/DiskTypesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/DisksClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/ExternalVpnGatewaysClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/FirewallPoliciesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/FirewallsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/ForwardingRulesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/GlobalAddressesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/GlobalForwardingRulesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/GlobalNetworkEndpointGroupsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/GlobalOperationsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/GlobalOrganizationOperationsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/GlobalPublicDelegatedPrefixesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/HealthChecksClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/ImageFamilyViewsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/ImagesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/InstanceGroupManagerResizeRequestsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/InstanceGroupManagersClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/InstanceGroupsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/InstanceSettingsServiceClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/InstanceTemplatesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/InstancesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/InstantSnapshotsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/InterconnectAttachmentsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/InterconnectLocationsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/InterconnectRemoteLocationsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/InterconnectsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/LicenseCodesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/LicensesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/MachineImagesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/MachineTypesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/NetworkAttachmentsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/NetworkEdgeSecurityServicesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/NetworkEndpointGroupsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/NetworkFirewallPoliciesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/NetworksClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/NodeGroupsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/NodeTemplatesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/NodeTypesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/PacketMirroringsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/ProjectsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/PublicAdvertisedPrefixesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/PublicDelegatedPrefixesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionAutoscalersClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionBackendServicesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionCommitmentsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionDiskTypesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionDisksClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionHealthCheckServicesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionHealthChecksClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionInstanceGroupManagersClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionInstanceGroupsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionInstanceTemplatesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionInstancesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionInstantSnapshotsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionNetworkEndpointGroupsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionNetworkFirewallPoliciesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionNotificationEndpointsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionOperationsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionSecurityPoliciesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionSslCertificatesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionSslPoliciesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionTargetHttpProxiesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionTargetHttpsProxiesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionTargetTcpProxiesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionUrlMapsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionZonesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RegionsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/ReservationsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/ResourcePoliciesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RoutersClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/RoutesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/SecurityPoliciesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/ServiceAttachmentsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/SnapshotSettingsServiceClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/SnapshotsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/SslCertificatesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/SslPoliciesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/StoragePoolTypesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/StoragePoolsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/SubnetworksClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/TargetGrpcProxiesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/TargetHttpProxiesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/TargetHttpsProxiesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/TargetInstancesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/TargetPoolsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/TargetSslProxiesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/TargetTcpProxiesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/TargetVpnGatewaysClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/UrlMapsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/VpnGatewaysClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/VpnTunnelsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/ZoneOperationsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Client/ZonesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/DiskTypesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/DisksClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/AccessConfig/NetworkTier.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/AccessConfig/Type.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Address/AddressType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Address/IpVersion.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Address/Ipv6EndpointType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Address/NetworkTier.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Address/Purpose.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Address/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/AllocationAggregateReservation/VmFamily.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/AllocationAggregateReservation/WorkloadType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk/PBInterface.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/AttachedDisk/Architecture.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/AttachedDisk/Mode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/AttachedDisk/PBInterface.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/AttachedDisk/SavedState.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/AttachedDisk/Type.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/AttachedDiskInitializeParams/Architecture.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/AttachedDiskInitializeParams/OnUpdateAction.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/AuditLogConfig/LogType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/AuthorizationLoggingOptions/PermissionType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Autoscaler/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/AutoscalerStatusDetails/Type.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/AutoscalingPolicy/Mode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/AutoscalingPolicyCpuUtilization/PredictiveMethod.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/AutoscalingPolicyCustomMetricUtilization/UtilizationTargetType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Backend/BalancingMode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Backend/Preference.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/BackendBucket/CompressionMode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/BackendBucketCdnPolicy/CacheMode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/BackendService/CompressionMode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/BackendService/LoadBalancingScheme.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/BackendService/LocalityLbPolicy.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/BackendService/Protocol.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/BackendService/SessionAffinity.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/BackendServiceCdnPolicy/CacheMode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/BackendServiceConnectionTrackingPolicy/ConnectionPersistenceOnUnhealthyBackends.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/BackendServiceConnectionTrackingPolicy/TrackingMode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/BackendServiceLocalityLoadBalancingPolicyConfigPolicy/Name.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/BackendServiceLogConfig/OptionalMode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/BfdPacket/Diagnostic.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/BfdPacket/State.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/BfdStatus/BfdSessionInitializationMode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/BfdStatus/LocalDiagnostic.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/BfdStatus/LocalState.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/BulkInsertOperationStatus/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Commitment/Category.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Commitment/Plan.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Commitment/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Commitment/Type.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Condition/Iam.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Condition/Op.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Condition/Sys.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/DeprecationStatus/State.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Disk/Architecture.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Disk/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/DiskInstantiationConfig/InstantiateFrom.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/DiskResourceStatusAsyncReplicationStatus/State.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/DistributionPolicy/TargetShape.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ExchangedPeeringRoute/Type.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ExternalVpnGateway/RedundancyType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/FileContentBuffer/FileType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Firewall/Direction.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/FirewallLogConfig/Metadata.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/FirewallPolicyRule/Direction.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/FirewallPolicyRuleSecureTag/State.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ForwardingRule/IPProtocolEnum.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ForwardingRule/IpVersion.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ForwardingRule/LoadBalancingScheme.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ForwardingRule/NetworkTier.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ForwardingRule/PscConnectionStatus.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/GRPCHealthCheck/PortSpecification.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/GuestOsFeature/Type.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/HTTP2HealthCheck/PortSpecification.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/HTTP2HealthCheck/ProxyHeader.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/HTTPHealthCheck/PortSpecification.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/HTTPHealthCheck/ProxyHeader.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/HTTPSHealthCheck/PortSpecification.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/HTTPSHealthCheck/ProxyHeader.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/HealthCheck/Type.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/HealthCheckService/HealthStatusAggregationPolicy.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/HealthStatus/HealthState.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/HealthStatus/WeightError.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/HealthStatusForNetworkEndpoint/HealthState.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/HttpRedirectAction/RedirectResponseCode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Image/Architecture.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Image/SourceType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Image/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Instance/KeyRevocationActionType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Instance/PrivateIpv6GoogleAccess.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Instance/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InstanceGroupManager/ListManagedInstancesResults.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InstanceGroupManagerInstanceLifecyclePolicy/DefaultActionOnFailure.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InstanceGroupManagerInstanceLifecyclePolicy/ForceUpdateOnRepair.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InstanceGroupManagerResizeRequest/State.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InstanceGroupManagerUpdatePolicy/InstanceRedistributionType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InstanceGroupManagerUpdatePolicy/MinimalAction.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InstanceGroupManagerUpdatePolicy/MostDisruptiveAllowedAction.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InstanceGroupManagerUpdatePolicy/ReplacementMethod.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InstanceGroupManagerUpdatePolicy/Type.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InstanceGroupManagersApplyUpdatesRequest/MinimalAction.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InstanceGroupManagersApplyUpdatesRequest/MostDisruptiveAllowedAction.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InstanceGroupsListInstancesRequest/InstanceState.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InstanceManagedByIgmErrorInstanceActionDetails/Action.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InstanceProperties/KeyRevocationActionType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InstanceProperties/PrivateIpv6GoogleAccess.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InstanceWithNamedPorts/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy/Type.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InstantSnapshot/Architecture.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InstantSnapshot/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Interconnect/AvailableFeatures.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Interconnect/InterconnectType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Interconnect/LinkType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Interconnect/OperationalStatus.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Interconnect/RequestedFeatures.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Interconnect/State.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectAttachment/Bandwidth.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectAttachment/EdgeAvailabilityDomain.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectAttachment/Encryption.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectAttachment/OperationalStatus.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectAttachment/StackType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectAttachment/State.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectAttachment/Type.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectAttachmentConfigurationConstraints/BgpMd5.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectDiagnostics/BundleAggregationType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectDiagnostics/BundleOperationalStatus.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectDiagnosticsLinkLACPStatus/State.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectDiagnosticsLinkOpticalPower/State.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectDiagnosticsLinkStatus/OperationalStatus.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectLocation/AvailableFeatures.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectLocation/AvailableLinkTypes.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectLocation/Continent.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectLocation/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectLocationRegionInfo/LocationPresence.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectOutageNotification/IssueType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectOutageNotification/Source.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectOutageNotification/State.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectRemoteLocation/Continent.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectRemoteLocation/Lacp.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectRemoteLocation/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectRemoteLocationConstraints/PortPairRemoteLocation.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/InterconnectRemoteLocationConstraints/PortPairVlan.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/LicenseCode/State.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ListPeeringRoutesNetworksRequest/Direction.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/LocationPolicy/TargetShape.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/LocationPolicyLocation/Preference.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/LogConfigCloudAuditOptions/LogName.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/LogConfigDataAccessOptions/LogMode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/MachineImage/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ManagedInstance/CurrentAction.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ManagedInstance/InstanceStatus.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ManagedInstanceInstanceHealth/DetailedHealthState.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/MetadataFilter/FilterMatchCriteria.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NatIpInfoNatIpInfoMapping/Mode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NatIpInfoNatIpInfoMapping/Usage.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Network/NetworkFirewallPolicyEnforcementOrder.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkAttachment/ConnectionPreference.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkAttachmentConnectedEndpoint/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkEndpointGroup/NetworkEndpointType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkEndpointGroupPscData/PscConnectionStatus.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkEndpointGroupsListEndpointsRequest/HealthStatus.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkInterface/Ipv6AccessType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkInterface/NicType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkInterface/StackType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkPeering/StackType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkPeering/State.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkPerformanceConfig/TotalEgressBandwidthTier.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkRoutingConfig/RoutingMode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy/Type.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NodeGroup/MaintenanceInterval.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NodeGroup/MaintenancePolicy.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NodeGroup/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NodeGroupAutoscalingPolicy/Mode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NodeGroupNode/CpuOvercommitType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NodeGroupNode/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NodeTemplate/CpuOvercommitType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NodeTemplate/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Operation/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/PacketIntervals/Duration.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/PacketIntervals/Type.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/PacketMirroring/Enable.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/PacketMirroringFilter/Direction.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/PerInstanceConfig/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/PreservedStatePreservedDisk/AutoDelete.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/PreservedStatePreservedDisk/Mode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/PreservedStatePreservedNetworkIp/AutoDelete.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Project/CloudArmorTier.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Project/DefaultNetworkTier.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Project/VmDnsSetting.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Project/XpnProjectStatus.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ProjectsSetCloudArmorTierRequest/CloudArmorTier.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ProjectsSetDefaultNetworkTierRequest/NetworkTier.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/PublicAdvertisedPrefix/ByoipApiVersion.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/PublicAdvertisedPrefix/PdpScope.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/PublicAdvertisedPrefix/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/PublicDelegatedPrefix/ByoipApiVersion.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/PublicDelegatedPrefix/Mode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/PublicDelegatedPrefix/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/PublicDelegatedPrefixPublicDelegatedSubPrefix/Mode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/PublicDelegatedPrefixPublicDelegatedSubPrefix/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Quota/Metric.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/QuotaExceededInfo/RolloutStatus.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/QuotaStatusWarning/Code.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RawDisk/ContainerType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Region/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RegionInstanceGroupManagersApplyUpdatesRequest/MinimalAction.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RegionInstanceGroupManagersApplyUpdatesRequest/MostDisruptiveAllowedAction.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RegionInstanceGroupsListInstancesRequest/InstanceState.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy/Type.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Reservation/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ReservationAffinity/ConsumeReservationType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ResourceCommitment/Type.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ResourcePolicy/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ResourcePolicyGroupPlacementPolicy/Collocation.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ResourcePolicySnapshotSchedulePolicyRetentionPolicy/OnSourceDiskDelete.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ResourcePolicyWeeklyCycleDayOfWeek/Day.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Route/RouteStatus.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Route/RouteType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RouteAsPath/PathSegmentType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RouterBgp/AdvertiseMode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RouterBgp/AdvertisedGroups.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RouterBgpPeer/AdvertiseMode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RouterBgpPeer/AdvertisedGroups.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RouterBgpPeer/Enable.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RouterBgpPeer/ManagementType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RouterBgpPeerBfd/SessionInitializationMode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RouterInterface/IpVersion.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RouterInterface/ManagementType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RouterNat/AutoNetworkTier.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RouterNat/EndpointTypes.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RouterNat/NatIpAllocateOption.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RouterNat/SourceSubnetworkIpRangesToNat.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RouterNat/Type.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RouterNatLogConfig/Filter.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RouterNatSubnetworkToNat/SourceIpRangesToNat.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RouterStatusBgpPeerStatus/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/RouterStatusBgpPeerStatus/StatusReason.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Rule/Action.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SSLHealthCheck/PortSpecification.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SSLHealthCheck/ProxyHeader.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SavedAttachedDisk/Mode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SavedAttachedDisk/PBInterface.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SavedAttachedDisk/StorageBytesStatus.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SavedAttachedDisk/Type.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SavedDisk/Architecture.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SavedDisk/StorageBytesStatus.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ScalingScheduleStatus/State.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Scheduling/InstanceTerminationAction.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Scheduling/OnHostMaintenance.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Scheduling/ProvisioningModel.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SchedulingNodeAffinity/Operator.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SecurityPolicy/Type.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig/RuleVisibility.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SecurityPolicyAdvancedOptionsConfig/JsonParsing.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SecurityPolicyAdvancedOptionsConfig/LogLevel.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SecurityPolicyDdosProtectionConfig/DdosProtection.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SecurityPolicyRuleMatcher/VersionedExpr.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams/Op.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SecurityPolicyRuleRateLimitOptions/EnforceOnKey.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig/EnforceOnKeyType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SecurityPolicyRuleRedirectOptions/Type.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SecurityPolicyUserDefinedField/Base.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ServerBinding/Type.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ServiceAttachment/ConnectionPreference.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ServiceAttachmentConnectedEndpoint/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo/State.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/ShareSettings/ShareType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Snapshot/Architecture.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Snapshot/SnapshotType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Snapshot/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Snapshot/StorageBytesStatus.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SnapshotSettingsStorageLocationSettings/Policy.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SourceInstanceProperties/KeyRevocationActionType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SslCertificate/Type.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SslCertificateManagedSslCertificate/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SslPolicy/MinTlsVersion.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SslPolicy/Profile.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/StatefulPolicyPreservedStateDiskDevice/AutoDelete.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/StatefulPolicyPreservedStateNetworkIp/AutoDelete.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/StoragePool/CapacityProvisioningType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/StoragePool/PerformanceProvisioningType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/StoragePool/State.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/StoragePoolDisk/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Subnetwork/Ipv6AccessType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Subnetwork/PrivateIpv6GoogleAccess.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Subnetwork/Purpose.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Subnetwork/Role.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Subnetwork/StackType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Subnetwork/State.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SubnetworkLogConfig/AggregationInterval.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/SubnetworkLogConfig/Metadata.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Subsetting/Policy.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/TCPHealthCheck/PortSpecification.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/TCPHealthCheck/ProxyHeader.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/TargetHttpsProxiesSetQuicOverrideRequest/QuicOverride.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/TargetHttpsProxy/QuicOverride.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/TargetInstance/NatPolicy.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/TargetPool/SessionAffinity.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/TargetSslProxiesSetProxyHeaderRequest/ProxyHeader.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/TargetSslProxy/ProxyHeader.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/TargetTcpProxiesSetProxyHeaderRequest/ProxyHeader.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/TargetTcpProxy/ProxyHeader.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/TargetVpnGateway/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/UpcomingMaintenance/MaintenanceStatus.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/UpcomingMaintenance/Type.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/UpdateInstanceRequest/MinimalAction.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/UpdateInstanceRequest/MostDisruptiveAllowedAction.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/UrlMapsValidateRequest/LoadBalancingSchemes.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/UsableSubnetwork/Ipv6AccessType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/UsableSubnetwork/Purpose.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/UsableSubnetwork/Role.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/UsableSubnetwork/StackType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/VpnGateway/GatewayIpVersion.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/VpnGateway/StackType.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/VpnGatewayStatusHighAvailabilityRequirementState/State.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/VpnGatewayStatusHighAvailabilityRequirementState/UnsatisfiedReason.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/VpnTunnel/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Warning/Code.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Warnings/Code.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/XpnResourceId/Type.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/Zone/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/ExternalVpnGatewaysClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/FirewallPoliciesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/FirewallsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/ForwardingRulesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/AcceleratorTypesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/AddressesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/AutoscalersGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/BackendBucketsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/BackendServicesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/DiskTypesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/DisksGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/ExternalVpnGatewaysGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/FirewallPoliciesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/FirewallsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/ForwardingRulesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalAddressesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalForwardingRulesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalNetworkEndpointGroupsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalOperationsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalOrganizationOperationsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalPublicDelegatedPrefixesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/HealthChecksGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/ImageFamilyViewsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/ImagesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceGroupManagerResizeRequestsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceGroupManagersGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceGroupsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceSettingsServiceGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceTemplatesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/InstancesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/InstantSnapshotsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/InterconnectAttachmentsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/InterconnectLocationsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/InterconnectRemoteLocationsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/InterconnectsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/LicenseCodesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/LicensesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/MachineImagesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/MachineTypesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/NetworkAttachmentsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/NetworkEdgeSecurityServicesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/NetworkEndpointGroupsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/NetworkFirewallPoliciesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/NetworksGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/NodeGroupsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/NodeTemplatesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/NodeTypesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/PacketMirroringsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/ProjectsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/PublicAdvertisedPrefixesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/PublicDelegatedPrefixesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionAutoscalersGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionBackendServicesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionCommitmentsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionDiskTypesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionDisksGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionHealthCheckServicesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionHealthChecksGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstanceGroupManagersGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstanceGroupsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstanceTemplatesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstancesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstantSnapshotsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionNetworkEndpointGroupsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionNetworkFirewallPoliciesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionNotificationEndpointsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionOperationsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionSecurityPoliciesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionSslCertificatesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionSslPoliciesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionTargetHttpProxiesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionTargetHttpsProxiesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionTargetTcpProxiesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionUrlMapsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionZonesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RegionsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/ReservationsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/ResourcePoliciesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RoutersGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/RoutesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/SecurityPoliciesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/ServiceAttachmentsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/SnapshotSettingsServiceGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/SnapshotsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/SslCertificatesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/SslPoliciesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/StoragePoolTypesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/StoragePoolsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/SubnetworksGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/TargetGrpcProxiesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/TargetHttpProxiesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/TargetHttpsProxiesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/TargetInstancesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/TargetPoolsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/TargetSslProxiesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/TargetTcpProxiesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/TargetVpnGatewaysGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/UrlMapsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/VpnGatewaysGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/VpnTunnelsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/ZoneOperationsGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Gapic/ZonesGapicClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/GlobalAddressesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/GlobalForwardingRulesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/GlobalNetworkEndpointGroupsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/GlobalOperationsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/GlobalOrganizationOperationsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/GlobalPublicDelegatedPrefixesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/HealthChecksClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/ImageFamilyViewsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/ImagesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/InstanceGroupManagerResizeRequestsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/InstanceGroupManagersClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/InstanceGroupsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/InstanceSettingsServiceClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/InstanceTemplatesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/InstancesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/InstantSnapshotsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/InterconnectAttachmentsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/InterconnectLocationsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/InterconnectRemoteLocationsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/InterconnectsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/LicenseCodesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/LicensesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/MachineImagesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/MachineTypesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/NetworkAttachmentsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/NetworkEdgeSecurityServicesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/NetworkEndpointGroupsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/NetworkFirewallPoliciesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/NetworksClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/NodeGroupsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/NodeTemplatesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/NodeTypesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/PacketMirroringsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/ProjectsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/PublicAdvertisedPrefixesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/PublicDelegatedPrefixesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionAutoscalersClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionBackendServicesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionCommitmentsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionDiskTypesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionDisksClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionHealthCheckServicesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionHealthChecksClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionInstanceGroupManagersClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionInstanceGroupsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionInstanceTemplatesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionInstancesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionInstantSnapshotsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionNetworkEndpointGroupsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionNetworkFirewallPoliciesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionNotificationEndpointsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionOperationsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionSecurityPoliciesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionSslCertificatesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionSslPoliciesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionTargetHttpProxiesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionTargetHttpsProxiesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionTargetTcpProxiesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionUrlMapsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionZonesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RegionsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/ReservationsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/ResourcePoliciesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RoutersClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/RoutesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/SecurityPoliciesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/ServiceAttachmentsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/SnapshotSettingsServiceClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/SnapshotsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/SslCertificatesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/SslPoliciesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/StoragePoolTypesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/StoragePoolsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/SubnetworksClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/TargetGrpcProxiesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/TargetHttpProxiesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/TargetHttpsProxiesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/TargetInstancesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/TargetPoolsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/TargetSslProxiesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/TargetTcpProxiesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/TargetVpnGatewaysClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/UrlMapsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/VpnGatewaysClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/VpnTunnelsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/ZoneOperationsClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/ZonesClient.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/accelerator_types_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/accelerator_types_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/accelerator_types_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/addresses_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/addresses_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/addresses_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/autoscalers_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/autoscalers_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/autoscalers_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/backend_buckets_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/backend_buckets_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/backend_buckets_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/backend_services_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/backend_services_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/backend_services_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/disk_types_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/disk_types_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/disk_types_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/disks_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/disks_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/disks_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/external_vpn_gateways_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/external_vpn_gateways_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/external_vpn_gateways_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/firewall_policies_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/firewall_policies_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/firewall_policies_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/firewalls_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/firewalls_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/firewalls_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/forwarding_rules_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/forwarding_rules_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/forwarding_rules_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/global_addresses_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/global_addresses_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/global_addresses_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/global_forwarding_rules_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/global_forwarding_rules_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/global_forwarding_rules_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/global_network_endpoint_groups_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/global_network_endpoint_groups_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/global_network_endpoint_groups_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/global_operations_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/global_operations_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/global_operations_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/global_organization_operations_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/global_organization_operations_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/global_organization_operations_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/global_public_delegated_prefixes_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/global_public_delegated_prefixes_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/global_public_delegated_prefixes_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/health_checks_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/health_checks_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/health_checks_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/image_family_views_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/image_family_views_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/image_family_views_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/images_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/images_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/images_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/instance_group_manager_resize_requests_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/instance_group_manager_resize_requests_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/instance_group_manager_resize_requests_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/instance_group_managers_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/instance_group_managers_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/instance_group_managers_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/instance_groups_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/instance_groups_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/instance_groups_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/instance_settings_service_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/instance_settings_service_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/instance_settings_service_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/instance_templates_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/instance_templates_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/instance_templates_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/instances_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/instances_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/instances_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/instant_snapshots_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/instant_snapshots_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/instant_snapshots_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/interconnect_attachments_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/interconnect_attachments_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/interconnect_attachments_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/interconnect_locations_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/interconnect_locations_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/interconnect_locations_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/interconnect_remote_locations_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/interconnect_remote_locations_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/interconnect_remote_locations_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/interconnects_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/interconnects_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/interconnects_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/license_codes_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/license_codes_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/license_codes_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/licenses_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/licenses_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/licenses_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/machine_images_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/machine_images_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/machine_images_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/machine_types_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/machine_types_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/machine_types_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/network_attachments_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/network_attachments_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/network_attachments_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/network_edge_security_services_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/network_edge_security_services_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/network_edge_security_services_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/network_endpoint_groups_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/network_endpoint_groups_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/network_endpoint_groups_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/network_firewall_policies_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/network_firewall_policies_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/network_firewall_policies_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/networks_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/networks_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/networks_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/node_groups_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/node_groups_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/node_groups_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/node_templates_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/node_templates_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/node_templates_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/node_types_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/node_types_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/node_types_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/packet_mirrorings_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/packet_mirrorings_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/packet_mirrorings_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/projects_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/projects_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/projects_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/public_advertised_prefixes_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/public_advertised_prefixes_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/public_advertised_prefixes_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/public_delegated_prefixes_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/public_delegated_prefixes_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/public_delegated_prefixes_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_autoscalers_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_autoscalers_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_autoscalers_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_backend_services_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_backend_services_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_backend_services_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_commitments_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_commitments_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_commitments_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_disk_types_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_disk_types_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_disk_types_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_disks_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_disks_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_disks_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_health_check_services_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_health_check_services_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_health_check_services_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_health_checks_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_health_checks_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_health_checks_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_instance_group_managers_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_instance_group_managers_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_instance_group_managers_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_instance_groups_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_instance_groups_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_instance_groups_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_instance_templates_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_instance_templates_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_instance_templates_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_instances_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_instances_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_instances_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_instant_snapshots_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_instant_snapshots_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_instant_snapshots_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_network_endpoint_groups_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_network_endpoint_groups_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_network_endpoint_groups_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_network_firewall_policies_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_network_firewall_policies_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_network_firewall_policies_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_notification_endpoints_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_notification_endpoints_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_notification_endpoints_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_operations_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_operations_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_operations_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_security_policies_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_security_policies_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_security_policies_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_certificates_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_certificates_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_certificates_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_policies_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_policies_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_policies_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_target_http_proxies_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_target_http_proxies_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_target_http_proxies_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_target_https_proxies_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_target_https_proxies_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_target_https_proxies_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_target_tcp_proxies_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_target_tcp_proxies_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_target_tcp_proxies_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_url_maps_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_url_maps_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_url_maps_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_zones_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_zones_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/region_zones_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/regions_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/regions_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/regions_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/reservations_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/reservations_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/reservations_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/resource_policies_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/resource_policies_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/resource_policies_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/routers_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/routers_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/routers_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/routes_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/routes_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/routes_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/security_policies_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/security_policies_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/security_policies_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/service_attachments_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/service_attachments_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/service_attachments_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/snapshot_settings_service_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/snapshot_settings_service_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/snapshot_settings_service_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/snapshots_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/snapshots_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/snapshots_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/ssl_certificates_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/ssl_certificates_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/ssl_certificates_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/ssl_policies_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/ssl_policies_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/ssl_policies_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/storage_pool_types_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/storage_pool_types_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/storage_pool_types_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/storage_pools_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/storage_pools_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/storage_pools_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/subnetworks_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/subnetworks_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/subnetworks_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_grpc_proxies_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_grpc_proxies_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_grpc_proxies_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_http_proxies_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_http_proxies_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_http_proxies_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_https_proxies_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_https_proxies_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_https_proxies_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_instances_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_instances_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_instances_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_pools_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_pools_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_pools_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_ssl_proxies_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_ssl_proxies_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_ssl_proxies_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_tcp_proxies_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_tcp_proxies_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_tcp_proxies_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_vpn_gateways_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_vpn_gateways_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/target_vpn_gateways_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/url_maps_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/url_maps_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/url_maps_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/vpn_gateways_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/vpn_gateways_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/vpn_gateways_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/vpn_tunnels_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/vpn_tunnels_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/vpn_tunnels_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/zone_operations_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/zone_operations_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/zone_operations_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/zones_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/zones_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/zones_rest_client_config.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/AcceleratorTypesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/AddressesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/AutoscalersClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/BackendBucketsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/BackendServicesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/AcceleratorTypesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/AddressesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/AutoscalersClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/BackendBucketsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/BackendServicesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/DiskTypesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/DisksClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ExternalVpnGatewaysClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/FirewallPoliciesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/FirewallsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ForwardingRulesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalAddressesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalForwardingRulesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalNetworkEndpointGroupsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalOperationsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalOrganizationOperationsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalPublicDelegatedPrefixesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/HealthChecksClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ImageFamilyViewsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ImagesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstanceGroupManagerResizeRequestsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstanceGroupManagersClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstanceGroupsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstanceSettingsServiceClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstanceTemplatesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstancesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstantSnapshotsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InterconnectAttachmentsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InterconnectLocationsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InterconnectRemoteLocationsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InterconnectsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/LicenseCodesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/LicensesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/MachineImagesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/MachineTypesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworkAttachmentsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworkEdgeSecurityServicesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworkEndpointGroupsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworkFirewallPoliciesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworksClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NodeGroupsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NodeTemplatesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NodeTypesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/PacketMirroringsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ProjectsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/PublicAdvertisedPrefixesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/PublicDelegatedPrefixesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionAutoscalersClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionBackendServicesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionCommitmentsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionDiskTypesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionDisksClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionHealthCheckServicesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionHealthChecksClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionInstanceGroupManagersClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionInstanceGroupsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionInstanceTemplatesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionInstancesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionInstantSnapshotsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionNetworkEndpointGroupsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionNetworkFirewallPoliciesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionNotificationEndpointsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionOperationsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionSecurityPoliciesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionSslCertificatesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionSslPoliciesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionTargetHttpProxiesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionTargetHttpsProxiesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionTargetTcpProxiesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionUrlMapsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionZonesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ReservationsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ResourcePoliciesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RoutersClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RoutesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SecurityPoliciesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ServiceAttachmentsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SnapshotSettingsServiceClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SnapshotsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SslCertificatesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SslPoliciesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/StoragePoolTypesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/StoragePoolsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SubnetworksClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetGrpcProxiesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetHttpProxiesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetHttpsProxiesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetInstancesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetPoolsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetSslProxiesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetTcpProxiesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetVpnGatewaysClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/UrlMapsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/VpnGatewaysClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/VpnTunnelsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ZoneOperationsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ZonesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/DiskTypesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/DisksClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/ExternalVpnGatewaysClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/FirewallPoliciesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/FirewallsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/ForwardingRulesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalAddressesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalForwardingRulesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalNetworkEndpointGroupsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalOperationsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalOrganizationOperationsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalPublicDelegatedPrefixesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/HealthChecksClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/ImageFamilyViewsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/ImagesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/InstanceGroupManagerResizeRequestsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/InstanceGroupManagersClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/InstanceGroupsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/InstanceSettingsServiceClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/InstanceTemplatesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/InstancesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/InstantSnapshotsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/InterconnectAttachmentsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/InterconnectLocationsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/InterconnectRemoteLocationsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/InterconnectsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/LicenseCodesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/LicensesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/MachineImagesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/MachineTypesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/NetworkAttachmentsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/NetworkEdgeSecurityServicesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/NetworkEndpointGroupsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/NetworkFirewallPoliciesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/NetworksClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/NodeGroupsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/NodeTemplatesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/NodeTypesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/PacketMirroringsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/ProjectsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/PublicAdvertisedPrefixesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/PublicDelegatedPrefixesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionAutoscalersClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionBackendServicesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionCommitmentsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionDiskTypesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionDisksClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionHealthCheckServicesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionHealthChecksClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionInstanceGroupManagersClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionInstanceGroupsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionInstanceTemplatesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionInstancesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionInstantSnapshotsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionNetworkEndpointGroupsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionNetworkFirewallPoliciesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionNotificationEndpointsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionOperationsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionSecurityPoliciesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionSslCertificatesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionSslPoliciesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionTargetHttpProxiesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionTargetHttpsProxiesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionTargetTcpProxiesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionUrlMapsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionZonesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RegionsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/ReservationsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/ResourcePoliciesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RoutersClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/RoutesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/SecurityPoliciesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/ServiceAttachmentsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/SnapshotSettingsServiceClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/SnapshotsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/SslCertificatesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/SslPoliciesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/StoragePoolTypesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/StoragePoolsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/SubnetworksClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/TargetGrpcProxiesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/TargetHttpProxiesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/TargetHttpsProxiesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/TargetInstancesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/TargetPoolsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/TargetSslProxiesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/TargetTcpProxiesClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/TargetVpnGatewaysClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/UrlMapsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/VpnGatewaysClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/VpnTunnelsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/ZoneOperationsClientTest.php create mode 100644 owl-bot-staging/Compute/V1/tests/Unit/V1/ZonesClientTest.php diff --git a/owl-bot-staging/Compute/V1/proto/src/GPBMetadata/Google/Cloud/Compute/V1/Compute.php b/owl-bot-staging/Compute/V1/proto/src/GPBMetadata/Google/Cloud/Compute/V1/Compute.php new file mode 100644 index 0000000000000000000000000000000000000000..b68815909706962ca230c559e36e95eebe21fcb1 GIT binary patch literal 666201 zcmeEvd3==Bxql~N%L&UcY_A}S<5I1PHMX|e+IEr*BsE*JptjyScSr`98fJ3mognG` z^<9ml%=@1A zoaa2}oaa3I^V{DyjcXEz4jUPXMH1m;q+!_TmSM?pkzq}VcrsoeZyYwddCZtdVpx5A zd{eYBk{CX0SaIdBiptty!Q#@|L-45{Z%))lP98Qk9v|BnIj+7j-rR5;HE&Kvj+=12 z@#k>vQHWT0d_->w*GGnptST&zB*P8iWcbXH{PCGZ^zoTR^5Zi{9se64>KntlK1@9l z|09OszozEVjnVpHdNQ2EKZiy2P&5`zM#GKKzhMTa3>y<})Fb#dz3rIhSbZ`Yj}4;_ zDr5DLBaa#;`=qvqHN`RGQ-&GfR1p$@fHO;D$w(p=ZalL%qSq&)P04to3QbQwd2A$U zqK=*%d6XKKx{Hn(cBF*yZOy~l! zmXlAmCS-k|>8n6f^vpmk7AM@rV|x2OENYBKV#)S>Ga?#kY$%M33r~o~6Ycx7I-)jL zn`b9CP;g>05^IPwR5sD3cAqA%_p!f=s?`lNG?JRO78XUEaodd9VSaj@;PF@(_2XoXSL-~d~L zghHEob%c5)Pi92nCKNZ3Bis33^N8Mo(`rWjq9!^v7RFAD_=X4(uCI^idg!c3i+0{S zYv1w=^BkF1@{s$A%`d@yXi`Rv{M1IKXqtGjQ+kRrm!U3Y6{fQcc8#?;+Z^#ix z2S$fu4e?lM42Kd&UpM|3nTR(xm4{>Dv5`b|2 z1cIZx;4a7&;L5#2#;{~D=JYFEx)-N?}P0<@oxG@kng3t<3*m0NSpt9=>kys$$=m%qhh z5$%>I-s9yg6#Oke#ffS;;!556@6@A)Z!T(_xePH$!#bZ#U-B%k8jfMzVwOS*3KF!L_?%05veCuLtD0H z-42PQ$#-6D!Jw-j`l`vKDiX3d}d4ut!O9>GY zUw_f%tZ1x3yL{J^vRxN?`ZFg|O`^T<)%$-(4_!;Tsvd}S z(WdQqM)uH+o(>jydZckos4*HlOS@#|W3S40-PIS4V^q=uPnlw+2yK=MDED~6`5UtsK5oDy1>vMA`E z4TXx_*NCpsWMsUqt$J?Pal>*!vI4HFmbLHUrPNI@mQ1vyuM4m4!Jj@v?dof$Bmr)o?~JC$jg8f=dTX|Z zrOhuG<~oJbWYZGbD1*a7*nrL#xpW=!Qu_);*9qaq=7^TV9iHIYVG2(4ntI&8jO>$h ze(gzHVW04ZQjn0cnnLslsR{XS&k_An25?!%lhc;*$hLy~eXQ2LFUohs*exD0I0a+2 zCGm}Pl2oF4y0++%+rRYi)^9t`_HBZ64;R`O_zI8cX#-dH9VrHlB~HaboF(PI{N;Q3 z;#QRZ%%6&Z=}q|pn03utHjb@uu+T#3ExFUe1H_;V@Ax)&ysLyw*VTOl&XCwll9)o# zrU@r%ufKTCH-);&>mzl`tkcG1M4|jZKczp8I;w)6}}Fr1fdEn`u0rI_a@G z{N2I2hN7V+ZO@izzeXo{e1gGf_KZc6XU7v~;c|*3v=>*rzEeWP)SYl7rOHrKG7)Ns zj}L<<Fe3DB~yIRCOuN$oQNh{LQQdqp)J~sDNp~2M`Eν{HvK)YB*rQWnz zt3KFGJ@nukfKCx3f5n2=WWRY>Z2zSmkzXMptObC$Sq9cs6bDC?Rs@Sf6~WrmDyvTo z)s_aUy+82{6un23o{r}=wSkJ_Ky|VA$pzyfZCq+t;p;h-k`c74{W<@XWqIJRtAnD|5s_kOJwT8JpQ) z=M2`hLJSP^Yp_|wd|ABwW#8_+mlia?;P9*z)#zFB>YC^gRq}y0>*m*b&_d&eTC!ho+-KVja+pvFHouSK7RO*TRBo7Mm z5^vNldhg4j7Sa5h7;bwB9ZW+*XdFWuswZ%9h*MNB*RObNk|f(Fxsn-clDc#DYR*h; zQc1woIpRRHHZBmWk4}LoUHmK!QN~4-j-)SMynn4k(ur+Ek}>UU7+RbohS@OWRLB`v zI!N?3;bKjkwqgASmIWn^{~s~j`Ccx%@k~#j%$qB2c|}glBqDg+9 zzDt&0vg|&&OWfHHH7KD%fzg4xBbA=amCUJO6k)C_8qtfR`dP-TAzC!xr#64y1Ge=) zTO31A<$Mj*v*gY2efrF=`|{1La^}BwJs&hGO*<8u4xB%%4{bjkASM0`;25XYK#)7P z{eR-;7RdZuatzjH;oHIG)2o`pE49=|6%e4SS}H%9iAhySw}nkx7t(4D!}w8?L+ zIGgG3(XNwA85^I=Yp@+Nd0t9#G!sR@QaV*Ou+}BH?{h-X*g(S#)d0-KP_}4S-!f-D zt-R7|9f;RZ(U`CQdCpz`$8TAK+=eacf-q7pv5vt$xO`w6E_HM4$`MD=i2_PHL>~Du zBevDE-=UbFqX@r=`5L92b802pupwH7JB#X1p25F}p()y?kn?;$vf|uTl6tux@D%vX z0}fL;3=L7Z%S1x)SYwN}{HwQg?D!sR-(xkK&%-(@ za$txw)Fm2EjkFYo>tR1?C~U?*NrMf5OfgzM4~^y*+KzYMI2y=Qs<$>^#$^+;gjy*E z=?p@sInhY26BdO(=el{U_06UvbbwD@2C3BMLl58Ij&^c7HIc-GXgz3<^kM)7H|D9! zH`+z3ZktJ4@W(OJ4|&)*ThXSF;nT8e`wJIKaM+lD0mv39dmaVvsrR%OGJ?TAGt*JTD z6xSo#g0DVRmXu!fW?-7u*_IN~=P!)zp+$R>1a>FS@|!@(b_zYcKSuA18XJ(vQKSpS@?} zlgpl4F8rqoZz(oqQ0+;c$S`rBeT-2jhJqEvRh59(m`+d86}G3cLhrIUw;$^3E^1JsT&#>+$syJx3M= z&53)LJi22%5a}zestFc_c@=ktX@wH@R>jB$VC{R~h>Am%?^DA%y231v; zjtbNULp8zbQKjh3_~Owob`ONDOwjXSbs6@FcjM!GCwY7ai$OIdfod#&S!JNOFi;k# zC<<1GMwM21*T1;zVgf6FR8>)^Dj2LTtr+QDynXsZ9)GpyCY@j~7wjR!ItYVaZCwp! z*h_RPtq9d&w$D7fs0VF5OqPZ&_TIGfl4m`>z9LUPp*~;z;`SZV$gGGbbGddx>gKHC z;+;a?dKOjWkJIU(W!)oxqcm#AuPvLOwDYCg{Kyl~L3Y?!t_V$Gp6HGnmxRj{mkD|y z=?7n_7Rm76lPd*bo*m$g6yX%~VlACB9IUVHFf|VN- zXqZ60xDDm-*NVm>Bj7*?$79_G6IUcg4qUMH>u^d7O^7Cv&E(b=Xl`v-vDahue_tery^Y|TmSAwHV^Fn5y zX<98A>HrVF1jTKH^k(*{(C)teId;qGA)PL%r4n2~?%AU`6l)$o8k5|;fVsha0VM)BVS)vmC4I za>XG|x>sWPF77{5o#ss4k_&%n$NgkD&aj`Giq74?V4Y^c7Uja!>b_w6SE|#j)J?hK zh|DWh8ySy?hU9+UqBHA|3_7^~M0J`ImCgXlMM~Dh!cF?Pcyj+*b(*!hEms_qO8uZD zNAO+@`7r{?Bn%JZk<@1Yl69ITOXt~@b!fj%sZ;5cZq5~F{?vK4lt1zQW7P@GQ+MVf zbkf1GtJMlNjExu`qWjhBoz1G4E*Trkrd+vXh}wRYQ)f{*EzCuXtn-{1;d=X-j84O3 zT%U`8v9wj%FA@I;yecT_bU!QDsaU~uiMWaa5|ZW7L;~Skv9bFpU#Fpb=@M}j=PD{j z0zpmySH;30^^ ziIbTdsTKCGRcBeN1-S^mcW~>~apafZ@3Gl=?x^(RWayOkAE(ZyQ_7&ZRf@m;n%hpO zxlMP5uF)HdA_$!r6Qxwz`-Q7cBV4727htLO6Tr?!05e=xNT-i<R&`bX}6nOj?pmHld`{M5F}VFZXs9xi~;64`-({E2cB*a;b;`+)n^I&25#=sLN%lt>1rHbvB{Ojk6fl6dMUG#o6JO{RgYl z9ISMWI`So!!+m`}^VeCJzw|3=|4HhE+Szn}KP*#iGvW*OGZLN0JarBgP-~2a_0p#5 zFp_Ih=~*PJtB*D$LJ4}HJ^jpkGC?Qja6Li{u+qcH7P21LgLj_8bpi4?p%mxcb@WrH ziGj#xWF(`sed>Rw3lao1HpZc|M{YXPo@sLr@I{3eX{M2`(o7kvYcKAa{D@4=b*g)! z&#c|b5h7-`{?gc(xbLsRmte;PWY@wUZ28u;XW!ir;SzTpI@SRqZ^HP{nDF>05*Kg1 z|JmPgnkYsz5{Ob+w#In4K_*H)_nW2X%Jfx~zSV!LNAwsqeguDtBv;6AY2-Z|RUR4< zC@(EL1E~*>7KfQXLq%nkbx5pPRTnBNMOMb*piIhG`^z%#yXUSx!FQZE(zS6_CCaLm zaS}(gukvnxX-5wf3iW6Dz~1&3Ro<7^y|&Zi|4-5LG&LVmBqKHHAPZ!w;zk)CZTU3| z1GPmZ-nkD>KFHTwbmt6`NY1$R#+5xN38XEbr+3bSSA6Z^jD{vIdHXrg=U?Fw1=%-Q z#@&z<`Bc|T6@S&XJi3Hy@Z}eb>cBl`%Uve3R#PTP+pzwn9&t+hfwy)0!`H&Sk;;&m zrw_R0gQW6w#*qoSDN;{%x{!WWGbLbCr(gT@+b916ry##zL>mz7?6yXAS#xTgHL^q~ zm2h+!(f|L%u~zdo^oT<>M9#)6iW@@dRt_1adf#7tdhRdHbIeu!vb6RiL+c1@_>5Cf zuOnu$9Voa^k{1OV!IhE=RiuHk)=)}fDjE^eqklumo6*`mb3f$7!nraXG!h6~1@rEE zZNsNFYVtee*rjssR7}rFO*qx-h(Hmgibaauic#f3@1}GA!6|lYifT%|H=Hw1RtB(- z&BxIk%|9nsoYcxBjhPraA#0AlKMG%3`AuE>bnVnPB>8tQlWaQyss`r-A!w^1wVvLf zYmZESaXeG?P#ZSecUl{eb7PB#kkK)ztvhGtjdB5)+*92Knd?zf`#YCD%>~M3dPY>K zrm7D0P0bO1IucMesH~6Ae0k9nsbgf|2Z*k+#OkHj&Oa6~zJ8!xs4!Cl^0k z^otrL;+xDJt<7KX$`~d9)%&_8?psM_XFN)1ZYNS(^~mZ4a#<)@Bcl~X7_F%n_7L49 z5*Weu`4tWn{Vj@M&8TpQI3VOUAQDh_C;XosX`u648fv19j>&jEO1Q1u`6d@vSCyub zue&LpKo-iGpY1N7eBBIz{R{s!9^^EL#Zc(HJ|exBkw}y%g&t{8?#qT8+lE~JM+!|9 z5DlBXsPw|xf?ZGjoOWNktE@caLFP^eh^Y?N?SK%8Fb63R8w@vX1H#Q4?+9BEwpzs^ zOW}glIs-T5fR$)!YHX=%qOucuZQLMQy77lSJBu-&Bg8;+zmHACo10LoJO16%89|mg9mwO)1*<;?8GfX;AkX*zMb|!Gzi?B8T+3NDo28ShcV_Qequ}H1r{+o|(J&ftrNLRY$K4sSx@Gr;_ z2T1QTy5kLW87L}8*fGkVR(8S27qS-7q@WBQM-3-1nzEPSjn^iLy zE^W%1?a%T()#h{RvH)~}r=s+g9C3VRlx9O_+o7HA5hrDyS6lEsb@?zxcd;wFGeMaZ z(fhuCng7YUe<}TcLJ{g{ga4nd+f`DBOt2f>lI3>X1wJmg<4VoR+Tsg}zEY}+ z>!C3!zr40?(}#z%Ky>C$T>%=|jMVd$y2?q9vLaohv4+S*?S*w)kHcKLmT=9U(?#EC zEJ|6-Ng72$^YC~bm(smd$vwZ|m#)3rm#Nh3po+gQ;Zi>?ax9nYNvj{kwR-xC9*tO- zn2rSRFI+H*6Z+>-Eran0nboe_&NY1VO1N+jN*?K9NYq>qBci=}^TJ2v#^AC&XPzkz z*2hI7jSXmFGHGg}>XXTjZu|>R@@Usds)>;{Bq9aV5~KEy6cn_1&##u%jkxv?Kutnv zrma}ORkHF*sOpdZuh`VKO^os^11*(Wpt`68TE3#%x@r>Lhd~=-dlIrM(3Y&9|A5Db znl^#z@)LjI{c6oeL!oo)cKWYR4B_V!*MIP|$NwD_1peQPF6BTrs=oBLU@WgJCfK}G zeg(?E$_nT#mtVQ{XcS}-{N%K1Ou_roocF5zA(V@ubzz+O4iE#ZZfXK33~p`FG8)FDk?NoQyZ+P_0HL` z;dLr_)4issnzfX#?fq=4)PdNE3a8e$krA%pLWF}~*k}a{jv2@Uvp)P>X>`(gA(BS< z^c7Osn6v}uRKr*`X1a^6A=>*4iEX<~x$2`^lv z6!M@3rrSch_?1Whi)YQW8!ezEpt=}wRP+l)<4wA@e&y6N&>~loUt$&PO;A`P-aK|3 zrl!q$@Pe-ixw(>@YNA&n(ggY#4*dDr`wFCIkd1>b**0fsnXh^nDvc&x7NnK$h& zsd}q$C2?7C01XYRgH`_0T67wWB@->a14UnR$fh`ef{s&r`>M5q0m6l5=uyT)aMteG zJVj%qFzp9zHubXf8a%t>vRyJ`$MSuG6Lqk*9<%k9JmX8+@|RT$iD>%5Oj9&2y1Q z^sbCaRZD;m1N4!DE$Uy1(q2`?RAwwtR4Yrt4G_JmgGIPO$jXJgz`Je!&Mh7)hjXyw zd8l+msHU>6no5(E1S&?NAlRgfK3+-H`TC+^IF2K%vbm?SbBltQ2I8v06O zs}~+34o-cRvb*Itw*Be9!h;f2%?;6{(!GxmeZ%xK)EFNNIt!u;S~BzF&!ObZ1y7iT z<>X$<;$u}uLxeXn5f&FJfHXcrb#HX-iZ^z|m`I?qBH2X1?`g{~x%5tXKv>EZqDM%* z@?V}Kdbg)n?43cVUCM=z#zh+&LJ|PbUtODf>3xTQ3@9zh0bn*UKfZA`EVzmb+e)Lj zf1>D)Nz{`0bD;29Tez%pq+$64=MyL{N4YxUf4nz5_24N~oetYOAfHTI@z@Lx)z0Hb zl0W+R{COzAH$?O|`f>0(&piEdX(8FaT)^jwKL*79FFj&NpgB1X*-2zcDF8eciApN@ zV%EV&_JQeXd{n2aM^19_oDaXUu5cVCEJRJL&cDkAspy9ckNf}JiNtI=HZ{;9k@4(-uNnnkC-2BUIU786Rx)L25IjR70`3NB zF-UkJmQs6v=ia|zHeJ~tB~#^57Uk+;tyNgi>&HbJP9BtIK9k(vLRl@Ugch1CIV>y1Y z{FbJl3@64$lG==ScasE{Co8=Iox~Vvw>51n4g6XY7zm zt^Q{#B`zVZ(d{=X=$-Pxg|kV#=}{ak3)1D~z3IlOdsw^+R##V6dp9pzb1=D7RH3LT zz23F>GcOkhOW*DMxE^KUSYeTjj)&kM9^a(o7n5Bt>?(3$_;!jHT&%L6=nLJKbJMk{ z3?)^hl#9W=68`-ULB;SO!X!u?y7rd-nvB_PeM?j%#-Z*UHEl7FU7y5$M$<|Pa; z*I{aj*ir1`u2~ctD7YIaD?>eBXirdTw+2^bNia}WTXKf?{mU*{?eQHh4k`>3oeElE zR`D&aM7xU0TFD-J=gz(EFJKD>7X_-SpoT#W;PSxfp^Cb4Ff3K@7z@;RUw!dlRIWU% zsII2AvOH8CtgS9B3NZu2Rh3aCy0S7(Yu*fwIzK?@RZs z3`6DEn^>gapXvf-H8h;}pI6@E@f|4+Va@^!yYpk)P~JChzWP{lTr*m-+nKC1%$z=P zS`sSn3pZW5oeLY2o+?y1VuW|ujO#0?oV0uZbycXQC{TuXb+z7i?)jL@CR^|7s=S}S zHuLAuNDVEotPX~1A!9(v6%3_d)ceModrRP2HxP(3nO8%kNOdH+~>vhPH3 zTuo6)u(+-aD`qYJNEVr@C7@KvnP*qc7=C!mSG|0{5XWTtjw(2(e^grGUH#C|Mt7`!O?H4H0f?V_&$f2swGy#;09#J~74zEb8 zTQ~dd`BZj&;GYSF>GQw)x%mxT?pU1;OF0EA-vH}0*(jRtxA5*Wj~VnD_g<{HnKn_J z4yyP1QFqbT01up|S+e-?enDX2La zHA}!wyZ&9J=J<81WYZk3sHwTm>O;Ekj1zs0@Cyg+_O_v81hr{HajZ z6*W`Ap0Msq*Pgq4<4{H{bJi$`OTJQ$77M>z_$`s!uG0Dfa_h7oFq{1s;U#7{0%a`8 zxXA<*HLpDIENk5I3)-h= zy^n9-TtZZaAA{;ne}2!qp29(509GLV2(j>&a%u{PiXl)-z}GtC9+bXwDLck=sIzYp zraG)zC*GG9%f1u*J3UB(oQf3Z;UiaF)NpTzLf17RLT7JWyg^$%=R&SatbD;BOxli! zVwJULx9%p_IS-#-cwBqo^QHR1p+h&mgT)Y=BwigXE@i2K?&OlnVpvbe#S`?^d+)O| z`4+CMsx2)q{WFwn@+vBY>-ZVoy&pW*l`RfwfU?Mt4jM7i2PJ{jR;_*IGivNHD_N&QXd#c!|B+%)dK;|bVP`5Sj5m*DFzb#=Ho?nSc{5p*)VGq zRywOTaYS@tq@gkaB^7MKNvWNIcAwLJB$^qna5;$lJc>C z1^Lyc9(0-ocB!HM0GA7w0aJ{&S-tpfhawS*WGeRFpzZnM3U(CeA+Kf_LK>PAQYbq@_anw&nU|8*F49{9~b3p&)-9>j**BBJ5w?&fqzP)hG z>}MpXj3#I#>%&dq`e?F6Zis|-$rJ0@@jb`DmJ6C0TkvWd1Km*^ezMx#qr#lb#d4f)Hl{XqP@QI$%o}~vX<;{EW3K;9PjnTUz~y-a!Ocf zmfFl5==Ce^BJ(6~srfec8qSHBN;F0y;Ol4ZK@Nid6`G7Mc2%?TnpYJQi# z`eZ)_hH1bMAq>M_LrnYU-8(p5qK9PT9g2KD){rI6!p);yzUxVeKt9oU>Qv2AI$E7u-b}07lS-*6r zr1`dm=8a)3Ei=NYi_=!!F>&dc@X2FXD0J5`lSNgJG>!@3YCX&Ubayc@^EUEL5C@NL zX#!h_lM4ex2=*((FVolqPp{nap%kS`+qp>#x#uG4xH6{vHBnL*JIfcs&gB8&@n>w7 zPhbA>RBV>~f>YW#4vzo_Ky@_u1_ULR1Ms0(_2fIfcpvhyp?8f@usNY*vQhhT`c`_^ z)#kA{CfwX8Uw*Rp1L?oVCxz6EAP4l-j0-o+l=loD0Eosh%7{KwbxJ+ z0qv*i2z^p|fGSW!qIFZmeC~niv;+0FM<1lDGhFsW|~BAYLz;KRH_vhxPbP_f4V+ zDyNxYqQ9*u>Rj)aC3y4+&; zt$7#Cylb#Lr93ffBg&I3XG{KInXTSThY7I#*xZ2Y z0{P&~J7daMNH#-P#vx)LHemuBC^Tiz&S0Y@BaKl#sV#lwoCBzdf1Efv^H`ZTHfVo6 zRz%zOI?MfCrI_LqxpX48PVUZImn9Q&=A)*C-9#5Uul^-DqOW5p7emXh(+n*~w2d15 zTiIG3Jy7&k*s76!BQPWk3Xd5>-jpq*K{_iMA-pmjnETP)OC>F2(tD!lFFiL=*MRaIF~)YwcOY&dh(}3uYzq3yyS!rbvEN zsJ=0Eqp5efW-?lQHT+5RvxJ{eLm~`Jf#@!o{^{$4n*4&J-A6QqregJ(l&Q{wuGxGQ zN+y6)I!21MdUex!3PZ{-_`Pe#Dflt_s#RU7`%zxK1_N@z3rl)2LHTZsDszvmGOEl? zLX}`}S)qndOuPSyC(Z^cdPpg7l;~rKFvenB{rS=Y#+ADdzjHB0DCt@)0Sk|y(l}p; zeQW}`Olt3~+a5=sQhLN4)(iM(OpXiT`m8@o*KWK0gAJ0-{!ZjZ!%f;Nw{&9=+?{Zo zAe08Gq=UVK^X^UTd>ZFXuJt~sP*SwPq^cMn(H_0{VK|r&s9tIp75zD!oG3-(Xo(_n zS)Kp+RYlC@l(=pvCxm5j(hVhBtc?ZqNQ`0U!BdV@YH35YXb*k4;dcy9UjnC`qT3DM zI&J>C)f{4;U(i;%0%tEdT8WRk8zK4;4}?1{5*{BiG)~$Tixv%K^dI6nxniXQD(Of4 zl!-j3CBq1o4eQ$VFHP;js5#N~YbR=kLw7B|4Z;-CLM!H!iu%(SgG6@~rKH_<*ZFcc z4UjnLi<%hVffM8FB{*ivi0&)qFFul2>i~KKha(wZrG4?tHKcdSD;Z4B$Wcbk4?nPg{gbjysYZQelB@%%I~Rd+D7}NLrE-}JjfQ|q zbWVF^#;d<)BBl6hig_|Ne~UI_I_Ch$D>;b1hp>RC8y4A(D^l~-~wHTi=O z$P1+Apo3Wbaks(Nn9WOuNg(q{d5C4^J9_)7nMVLwT}uw3mxZD`@&>`M)1qB@ z%?rp;M82lSx~{r&@73YU!j{25hr@w$6FU5AdfDw^d2H1Begtv<29N0HAQ3f8mLLWl zZ0WyJTpGw?kE9(xfrYF`@bubXbw!}eyXMBdUTjUT@c>5niU2u4PrG~O7wkXAi9e|6 z%5AgHr}O1Co|tX-zWiZdXiEl|FKU8iBh0tY&RN$4BgjxgR>=(3o`2jh+2eo9BfKUF z94+Y{yd4g-Pm0_cYR?Fj6~aFQekGLN=m62z?A?64?88}e>74c|3kGUx;VJN^x?oMM zclV=L4fORA-O2+a%Yvi4AJ6&t*W@!RC8aN`uqW-zk->@}sep^&2U2-zY0!JuvrjK&4;v}fhDMYI%Zj}> zUAQqs6C`{XEx*2QGBmk%Qzl!s3<8wG(`VFXrLfbPRa}(t1DvEX1DKpJ8{cftQ`lK) ze>T}kW=#O&`0BQ1-9Xv}%}wb>Wy_FxwX&MqxJ~Vjq#UwfT!~Gra8^o(lxvdv zGu4HrV#0BS@nWamT0BSVo?=|uE*<|Gl;U#U9ZpwLXjOBN9BSTRzQ$R2tWJ}^-5ofx zb^RmsQvEM?C)I%cGR-e2XyZ+7bL*lDIBieU4v9r3CJ~AZm0mIqD@Mv*piOypI6<pRBr~eq+R~OtNCcBJWpVTjW&SE zuw8xH1*^ZH7RsuG1hOW>!v?7(8+ZJc2O{MmrLsH{ItIlv!3W0x6EU6!kZQ)d?__bJ zB>`A20^}+sgYgl$N%5bC(>k1o*;l;=yeixT17)WL&Zse3d(ZpuMjx@G${!#E>x$$> ziTPf;=-MC&4Hdyr@WWCAc;8+$z0jW&Jq=v5F~^a*w6+>Ul3bwdIV=vbuX@P&>XFGS z2N6)@=4DOAyJ_b$N0J~xj}^!5y=%qCqY94`$J&|8Ru_~#lrpa&Gc>8o#<}erE9Kwq zN#$Xjx;yxPAEsP=?4Yp*n0A@LZ)$I^-9}zmDkAbIaXy?M+U3tY zM%gme_Bu%PHaa06muOu3=JLD9wJC>{(}f7bJlya$$_hf^fnqQia+gurrNcRp{}LqH zavrsjl%%bMHIcr*i2N|J)*%Xw9e%Fgx%`)`NGNLKjb!U50= zFeARS0zTZNs5soUe+ih34I!>%%)tf1n>JP}iVJ4EsVo229@C1X>>|*jLSXAI z_ZVDKXOreptugdG@i5{>3k>ric-=MA-<&0NrEH3ZKHAv?I;;eu?KZuAlZ@hLcPyl3 z$kYm1DZ&N6JW>1L;w>_{DiIU5M=Ef5k2}9aNE&$;I3LPEIR-k@3pI}a)*Rt;?gkel z+DU0ld=^g3*<<>uF`l6QOJP*CSu3WHMoT%mxajNHHnVRr31rv*jvVu{9HBXAdFj#0#(*-{TD1%@%A zn;PxTr|&+RM{`g9(azD-IJEouR&vaa#e6xm|9`}9+S#>zB6Qx!2B9r}>wZa>SPaKg zr#*q;AgekxHkB5XiSd{199>R~#&wQBsm${uO%121X5WM1;xDYu`( zgpesExON@!$Y4j=A9lm#Q%dntvI_nQqNhw+5N=H8+9<4{63T6ZYeW3B3>ozP^P5HY zaWaMA=|yFAi2EbI9HY7SkvHzDg2ualX+?&Y%eUS6t%tX(oGR~S2mGuxvVrWcOvPBW z;ZaMO7Dh{69YzhA&*Gw0x3MFZ@@65GMoJT8vFh*Kqtb#w1}f8AR$KGU))9#(7gl)U}%*S*WZkZNK^U?V4h6?P{72^F&_Zn1(9CQxZnofy9Eq zs2`Q3Bq$ZIj-T2W|9F&a))qesNr|GWD4TYS0(2T8O_UY^O_$&PCK)#sKZBS!Pl$T}@`N&7=$Hha5i2w(g*eBpTAYV8Q3Sui?|t>x^C{s$FX{q%frq-sDg}2g^*Zl zN=Jfl0ZPL@!}GZNn|tqMqZgTAteL;R`r^N`OS?IvJ(oRo5&1V9R84{|Tm@Zbe)IAt z-}Cs#i>@SLL||d*V@cvhsy#DV4TEs!TZ>L1qYMAI7VeVtgDgkh%T`=SCi1@godYvZ zJ^#Qa4~6z2YH!{E7GX0VVV37yPc0K&c~DtTZyil`yyw%%ZR7!DYmm!{V-rXEAu}I4 zj}?z*9VFXNIy)?rq#hS#+GuQK(D+cW9HY(w50t+1{aXc-IwkKN2Oabn3J8{_bu;mw z3<=_^a_-fW$Kh0}fWhO$LBJmTNQ}I4q`<-8B#ZRKZ(>hSOU2@%v6lLH<%SVRvcv==E4ycDWTI^3NyP3 zR8%UhOvz;&@c|TjTNOZ50rJmG-TCrHkN=|_(Wi_A85?zW1R|7G!kllXRQqYPb?dZ` zMo$!iQB6lK0y1mMj4HAGy^(9m7TO9K;>2;;DGvuF8Anc@Cq-+Re##?h9dG8LxOcYRC{SdIk4E}tW; z3Z zKW5W@%1CU;PV1YmJbId(=)c2*m`drv1y)2TXD+H&H0$%5nNw3Y#jiyk76WPeh$)-* z+9J}v<`)cgC2PTnO$m8r^rOr)G8^BOGw(;*Wb%v$I|xQQqV1f-Ze6Ne4aFH)ATa99 zLHUBDZ~U8S4VoLN>H&(F6eDrBimdT92>)oj0IN)Ih)FyPSXWsNjX$)PcF(zpP@7+n zCFU%pf7wSzWYq_nor%K=#il^c=Og(ca|%YJ1k%EfN7zzENKlpSU^OpbNEu67LL5tI zxa7WZ?X7v3rVh^_yJ4t!wc)%~m%p2G}OB`XxE|4rk>J7x2sMel+coVrg z<`%r*7aCeqS)(P`xgBP)bD~B4BjF zj3wN2-&CZYAxvfwqKVAYM@nC&1kpU=Rwdx?-2BjP>LphOFe70s>7Br&Bq348w2jx@ z{20Affy@aM&w*F0xx8?!QDACc-}mMTY=6k2)MNvx7jZWW$L6O*!{Ow-Jj;lOzNT4XN@bvBg3?E{qD zjK@J4!FtAJ_n!aXyv)3R)3lGQ-=wg8;{!{DcU7*PE>vPW@P;GSqM4a(&ISlZ8KoBG zmiy-BYgf{qQUOZf$7Rt3Ta#@Yp628QUFGhFIgm_m=mZrOWPet7n^$fb!o3-nA>Hw? zh<$$bJ!DZ-8Wvo&GCQF4;f`x&a>$=d&I5YdO#$6scr9j^SfM(y4kJM#CkTeP?Y(d1 z{8w36EvC#T=iUR!wV&t-ai7y@kxALRdj6~b1J=qXzjuhRPp_TUpBa@@)bPVpWUw6T zI(@#d<&623Pno3ub7W_=HioR5(J8ORR*Q>3$7J1p+M07-l^G^j!d5&+5@!#t(in7tQP?DK15_giE3sB|g0-8rpboBa{nJy>`*GT$C)dfReB8;L zL5-#M0q^|}BNwC7GYnd&o@SUMb^O-(mvaF+r8jLg3UZhjV0=$>h^hrr@SLvQxpdu8 z%ngD(7%dDpPVKqpH(o}NDwXTuR;;Bxq*A+j`+4ukW=tCVDG`^W8zG5v#O0L53ppQF zTcR?VE*lUrekg5|@xTC)&B(?>J5c_2Jz{tfr5kEAb|f46RbKn*2xZw-d(_yfZ7l=W zh7vwm4iQ|rdxKr0+AHduY3H4H-&oovlDBOSa|**wpOjcZ3Q{2#UvQY|Sy1@e!8%d{ z(yPOx(ttwOK3sGWXPQyB0pic7nF3NrK+~PQ0Hty!Iz|k!zvZMD){xq&+4tT;d!no4 zccAH!tr3KaUAN`h2g%!3-Uv)j>8awguz~9?dVCw7TDeHs78v_T$pxvM-1^#1^2d@% z$5R9iR>M?xzQ;L!my3W5TA7zh+t(#t z)f=gHkOMrLq{L{X2!OgBMyE(Da<;a2&h=X*h2;YbjuPSq6f21q?VH^fNgo}h$M7+; zL-LEMN7nAX^a-kir<_z=lc=yx7Ugh37i=HjdF$M_c;ic3*&$*;WFq`WB;_FcCtrKI z_WA`EqlPRg7Ht0XU8EfiH=ol9it{VgK|?HyKVg~@o!Z*R6b7uw1b?!oI`h?vA1lin&Sa}^rL`2@D z;z3(~&)$dRnsWIP3Tp&Ii)15)=|S7Q_@8I~l=qBT{wjstXImh0fJvqp+3jTJ;}uVR zbcyVm!*#Lp&dkRYoa-MA9$#%>XT%j*`bJh(Q$!PN`Nl5?SO3zA4?gG2wN&%I0(prS zUh~-^eo&5V9Ho#GZoFpuTOR)zqDvLl(&@uN_B-?qt++C290f7*mTd4uxmIAZetCEcX86 z`5lN9L_}D|*P*}(-Upw1_Edm00nqyLV6LWGg8z zLcs#>V++2%G~>I90`JCaU-&J5Dn|E%FQ398=cfaty>GoYMzWe05Z7~u+M^+=0 zy|k#thPfBNTtAEg=E{S}GJS^a#Z#Z$f-u4%NLQWmCRBcc_koKyO=gTDfpj$@KdtXV ze?Gyx{MD&*D0JCNNh%!&W9HYdKQ9Z0S~mxWWf^w`8!*$a2j-A$*$&w`#&HLvIUo`% zo=Un+RfQB}aP(MamT}aqbFqTEsOX6cZDMXPg&Ns~Z%X;*Bsn}D5gD#SVBH3-MtQZT z4uM;@Kf(yF4yi+6;lt*H)B)jLRENOo+r_i@mua58?h)x$XC!|+xe#WVewNj2wJTO_=3sIG)djrXxzZ(Yo>;elEdIw(ZuO3GXPB{$roQgB zrJpg0g&wjPA=R+EBZ)r9t#{@7=ik6L61}Mj!LS~z=1w+0_rL;9@%2YkQYamP+6vMY zi9VXT@P^Uga(W|Ca2@rJxc5L=xp(RAFTe8m6Ud$21a_dO1$Si?z=i`4>Z76d87c)7 zd*Au?+yAA)pR%rk_n{BBy}-UX2yI{Fqqf8;sF!OVgIf|JfHqNC!F?JHagDXlP^j*;rp&Ydy01@gQ-a8A@&I5{d(^ z4C${CK6IKpXnT4%9ris@AdQ7F3^m1?fW9vOO0kp)6ifa+2SKwQ1P$7fh zB76yJ4V5Jso$y}U``(*=>jr~@-Jp%yteao!VZ9+o!ASD#c!E6K;JPy=j1>EuSIy_@ z4eI`D!$Hb+PTFJtyV`@Gc{$sL1}KwtV}jVTVfjS+;+{7-2&L`NeV1dNdOjC=#2^Ks zD!LI#7(gl`hfXC#657jqU)X6Q)IT5=QOJ6*gi%Fk$t3y)m@wEHp;a=~y0+upH;%UU z#CL-<6=9dalf(f`jU-M6G})rhI)d9th39fan@f0Fzg)i?CfeneIScok1S>d^TCdWx&=ZeYFAEk4^6UyRA_w2)CKLbwoUY98Kg=K!$Y#5VEA3FG2~t(Y{&q z1}AL)*U+Q$%(FhSF^>8*fexgb?O3{hnAem9<9ozjJD|G8gPz};0DtBS(~zE`?KHMma7&A+Cem3Aq}_?P)pvjY?jtOT)c(NC>rZ8;!NpkOh{_VM( zmRos;Q@ITDrT=JgR2v3V(4n%sqjgpDXqac{dm?!aRE`IgwG0HcfdUY7+{B$AHLvQ0 zVs_Duwt3?nVH0z(n6=qmaH>aWa!xWsN)hFdHh==R4yB8kT3UO5@%8`s-nLMS@JT>Q z$3uT%fB+sdO24(&U-?YeNup-v%9DS@1T|9d#p z-DqA9j^#172v|WwFi@m!!}<+JbktsH*Lsiz$hjT{knYmU54c@scnp$iAhI@sgb*M{ z2AB|~OkAQYI=|E2JLmrI@7R;R(}}Y0UEkTj!dW(b=XsCcT8RzRZhdFUL=;v#f~9TO zHY9y#8Yn+9eP`>7wELnh2!N(la!(s7^=!s&w-ZM_4MD6>muuCIyW(l<=TjN2GIMe_aA{sO;WSR>klc;J$PL2j4fTJ4gQdENw zVxm+F?Td?cv3=uTBP)PmIUs!k2H5bAwu7xrf9hhgC$=5bcC7s04K+dP8uy*6spZ>93`0dE4 zz}G@4SdE$dD}}>$-BnO!`5k-5P@A;Z`~SP~QK>o<^KdJK8v7ta;gpV`;id6nDS^M0jCIP3}vB6WLER4G!x^ESK8Y9)=_Skw%=4iMu0URdy%@T^1-qX5xpmmu!Jw`* zdHo+y_t=pq9lmW!1uQpapu??|9SQASCKD#1b!L_{4p4`f3Of>PY-42%mSA^?MX@6R zggHw|7ZSklMN!?60OQ;pE(t>#z$tcPME%+o>}KlH*XO z!+v_zB)&(nv?HNUJG&J~)`&6^YQQQx~(zWYj~YWi?R06121vbfqxBy|5rn! zD))bTY`Jd6WJ*JqU{=zs9?IObWn@kpOPO(@+fu3(*}~8dIn@*2Gj+>WNGi_ZMe8_>67<^o9~$Le1$eT)NrC;&OP_t}zE`d{ zb!Bp6*CiUu!%YSm{=T;e{7#z_$d8Uv;1|z2=XQ56;j*HfL2M}z+5u%2*%UgdeE7l| zc^0&_Q#V+2pj`^9TTSmaBlp4&PKq%RnZ7|0iph(1o$7krOuv?D1i7_`^k%~*++v`N zM1uII-uw6j*P)?6>8Ds3YHa%We%~98E?XW@d+N4NM!14^vAL4_e5q!`5oOSD7CF_7 z!r&S2Ovvv_&Qwxbx)tmDMjX=kD|?dN;JWSR=NGykTI5bTLN0PmbZjir0NQdYyzeQ~ zcC4X&PSfyEh2y@AVchcBCv07BI}4a)EmG+?P;K}$W&k=xNN!zY@`J%W$@K3@xALcZ zG4|pFw#M^pUU|q>(Zh5Ocy!5@sqV{dJ2d;s(`8vGW;ENwvQ0J(RWeRAV_HXn{uI1wzW_;AT!jZ8Gvx0f}{wzL+{Iu<=E4(jW>?xeC@ z60NO4v@dLS+aPKy7j5~{NgNSG?dG4efwT|oG2|x|rXpc7^mgsoW7!}AAy#~^VQ|qV zUpkv}hJUBSAc1Y?k^PQ`Az#gekMu?FeaQuhGO`8JQ; zF-ElDpOHnhLo|j6$o?Dp(r$U;JqtPhp$3Ib8AoXg|0uc@M`F=P14TNQhFCk0jMsy0 zSh@2}&JJv*+UeR9PoO~1%+GcgPzDK3qH6!b{}MBs2=Jg>VGifM)5Q>!VB;5L99OBg z45?K6?85gK5XkujKXc7_SZsY?!$}00_EA#*??2q)p&W`{G~t)yBYj%;26oJD(5~Ec z)4Pmw8NLkG#h5Otge+ULj*FV9KyYx*@zFZ!UqBeXa@u2y<#(L)7~4D%feU+mggjfd znOCh;c_ldp98)F4*=np&2)I9-wT4$}7D43QDMo5PltJ_E-u2Q+2$L4Y!K&&YWl1dd zF1v2`M#_TNqq4B3l3IDM+_Ldt4jflgWj@E69H#{_ro%blY!k35VEJKTgcB@zMndj+`U5FA%WW#^>0{HoUU8{stCN-a>VhOQJR8chu>Sr*< z-EzB!{F@jKO9sISLL|WtO#~NXT+ig4MyZ?32ioHG8|#@Eo$PvDtC{QR04ik2>$@G( zz5M`W_Mns_U{t~h1Q1XblIBE2d+~)kxWIs7RQ@DjcGKp)SIWGICuZ$-IQI*svHY4w(t{{b z+k)gT-!<2Ehi72n!ijB7smHYvk(5U!6N>AhF~|glRnfI|n?5`od}7v$Mf5U3E!+?4vwcO4n$n?r$se_4e0yQf-2~63+3B zyl*PN2EMm&oz`wT{}svzmy6tXJ=7cIdb?l}glNir4qtS$+z9*_u@f} zwgZt!$zkZCDiLpAwN~)kGSSC;D+Lhkk*{`9#<~20qqFXeYSpRa`%C%}6j&l1E-E@| zn!^zMx2U%8jU_4xVE+v7b#00HegM5k48NJlSi5BAV_YLJuVkQ{VRx?VF?O`}>ay^>4|B$b-_Rri;1K=V_9ROgyF#8HlLQrxjwE?*@ z+9(4-d^G2=xbd#b;tcCy)QqxkrR3>9oSwTH7D|qw*PzwTEd6KxlpcFU*JjuVb?t(y z=KhjTVydE|GsWZOFD|d{lUoMMcViLg5$HE-P8-6l0j33>A}Z}d^^E+ zjL^$ILLN2u|5fx1*q9ES-+@-L-9R;J22kbjy6PYj;10t~Y)>5d)t9WF|A2>5=?1FH zPyB`Vt2G}DrJTH{|N6ubem-&i2TyyjoUN1wNUv^&CoI-ey|bHcoQh%u=u}l8UwPRL zsDFkbkutdW4DaMeEYaQBAb`x{AOkR4oq_mIb{_Us?2+hjl!5 zW{b1GOJ2y%UbQtTJQdhuvJo+p>`}TnF256rQEpKgoT5^z;s@vCO-mi$U-&|48~_)Z z&3J2DZ&EL6PE+r=YpqjfavJd_Mbd~cL8sDVQ=R&A54N#>$$D-ZzDdA6jYS7riL&U+U&r+cnAo`^> zL2sHEXg+ojOM4vwO225gwVG7~_zz-F{I}*JO$;#BY9WD=w0!j0WeR79Kf)3Mql73$ zw51Y+90d4Rb^@GV;9f7DFl)Q+cf;;JF ze;67OC@;m>7eDpFVNA(wSY)zo$D69;Vyff$N>lXK#E$>U9B>?1CYRzG$E6W7_X^|G z&A(Myjb_n@=2RY^V0uqNFoxWZdS|?yS#Z@>zVqqtcz-g{!2VPg;RbxGO?&PgdFnYs zEtSei{hrs!_KE*y4{SO3RtoQsI0l&9gbD`^CBtKNZO^=EcS(iFZ?m$_vY+9G^sBiGvYaaA@D$EqrPeCz#NUnG$dU*iFN{l)Xw-srJe8qez@2~#a8eC#H%Jqq86J4g-o~bWAWnD8) z6)0Y}p3Xs*M8FXf>Fm=&3v8EJGQe1f0n!UE^!pBgB(bRIL$?K%lbQAdo zi2)#0>G(`F98(5*8y?a`JmOV2qdDdFPH-etiljsQehTCk+kIay@{wSV(>8E&%61eh zlR;V9ZRKv*$lU3Vkp2F%JNx|`Cp9`IE7>IscPtCOFh}$>(CorroRGF+SxUXAZSZf! zW6Y*V2{kbr_IttXXn4@Sh{OMU>ti-AtFJjGrQXwBmnJ8>14hr2 zuuz#%8i<~_{?=ddqGjcGQ+g+NIVpBF%Pi3TvqXL^hfLPcXig0*BnSB<^mbf1=jGiS-ebYir=SkT!>zQ41N&HqzX=l9_qY>8&Hi#*RFqQY8R$K?&d19%i-n5XVMvg zx%#jUVd2s1XBT3^Ql&Nc=c0E?%T~m0R$WVAmEnPUrNWopcyOJ_2YD!H+g_LHUgb>w zAbLq;k@*B$Nt^cg*XPP@czE{RW9&URy&6^)ZTUkF$`A~*Fp{w^rcS!$2`P7&Rrv@S zb}}_SXWFAa@V|k&O<3G)u$J6dmnMYDg_3bZifXe~OyQjAk}$YPxa>H+Z_F62 zUYb-&GAEVI@@`(M#kLE>!+#+G}5I>dNQq z7g^3%YDuF~qu5xwD9i^XyI&n^qfX7>SNE%SfH2(dbb+((RARAe3koR|S8ax$Wvsr1 z1zGK?XYXNMTwV#Qxm*rAsk++h*MZ2<-qq%4q|1OEZ+PR+${Y@ zz~B-pt*U`p$9U`g=!I{0k%!GeiqkKxLgD1vV0A^Htc zF0R{k?(MF6wbcFDRpc5bJ))PAb4hiIWJ=CjH0fO6z^apQ`DY?*FnudqTgJ8{dr7tc zClF-9s1UdDpBq=pdyh9TgtKVVgcHrzS1tSWTHD>Oz^7AY^})6%`&a(;IbvWsP<;7d z^MD%}tIc}hLD?@;1sjyg@OMhumE`X2mp)YbNns+A?LOk8F+Nsh{nh5LTg?|`Hp_*9<+Au#sREH?H;r7g zZ6QN~@e(#HWMY-OO228B(_uJED=!{}r?0-bE5vB>o35K?&JkH^6;8%mrgKmtq%p&J zm2I6X?_US!Rl@P1VvwOvan@;txAgR@z_C-Kfu<3bzn*&4w?pZ(RfoBE#GBo_VN(1$qe*uebq(e-5m@2KgH_x7omi_6Jz#M0OVK|WZ;5B zSr@fimu{|M7Mz-ebyjYW7j+tB z%!50SOkO1E<6CzP-9gqM{>d=bIFaF^D>^BSF+cOCZ6q@3l%;JK%)W8ngvqq6l}Qt1 z*ZthnEfo!Xig13zlFz$)&q|7mQYy*pWN6}fmu(--Xl255pqZ=&iX3(|2l-p~8RE={-K#YddU9u=p5!05?9r>< zl6RiFZpFF5Y2FB1LD*w$cx>A^O>*~Z)TvBF6Zn4Z`IWCxSYZ#2@9QXblRRhSW>Y?$ zrq>Y@ITsd_Jo}y7hL1Wc8A$QPdn28xG#4{7RXsoq0^gZw#iSpjg$w_exvA9Dwy$7> z?#Fs6&e#W!#q(zhE=>>4|znmtxF$#TA!4FX116yBY80l;2&u?K%1Q z00b%Gu{GltCrw33Wt!6v;iXrO3D17_YSP)~`Tm4Nlz3@B6jLsLRxyJ6b|?-L8g-cw zg^NGE36+*Guz##LJpE)TisC>B$R%cllP`1CES>+=J2rI%Le5fh)et9P`@oOHu|v{F zvd(bYZOYelx-TR%_C;A;A))UGju=5g;;5i^>h^n+6lqmjVLdx{{p=Z1v%{J?I%Di{ z=|`$U@W&G)4V4L$*Qp0HNL&<*srAiN0<}SV@Wo5smJFT&9#v>YaN@J~4+k~rY8u#3 z{)ax-9(!`(1M&k>E-)Kob;tI7?tpD<>Kp%p{(!=)zD_$7P~=nMA4BtZ`y~&_m}rIq zia&c+AX^?GzN5iL{(ttqJg}PZu*a9Ye&wIYCig{;G}Bc8Lwe(s%+z zf-khd8=UX7AXOoaWMhY_!1oraA!54%hN(eXg%(VnS;^O$5~lGO)qB|Yv2^=-X^`VQ zaH@C|3!AmCR4YwUefL|R{feo>S>f2@PET838VjUVPiCE!ThCeE`93~?GlDssNm|-F z4*Ngg{2Q98Ys15;8(`~)fD(>Db{G}WmtX$GeS-X)G@hr0lsXGZv;l4nL_$2f2FV`@ z@CB5<4Fe@UBB{~oZ{S38KLZwLnqwy`M3R>JNK}8}k&QdVs5k{2aaWB^VM?XIl^6-* zwh?jtbJx9l3{#mC!GUl=dtExBzrTG`9WNs%fqVEA43vk`riKBOs+>YcAxZ!ByQWQ~ zetU}aaAfhi-XV6;8q*(I`JqU7;aqVaO_5W=1N1mf{ch5ZRi-r|9W((ygYF0f9&zSE zO#klwHUD6;=Onq}5*%09&(L1EtvODkm*zO$b^6CQZh2bJn6u5X1ZqIMavNqpE3ixp zIMJzT3MP?S`^MJsiLf)gSFJGg3yc*MTzBAl!e~8sVAAh3v-Ig zLXT}8pMvCEt>}!fO8!~7W7hzBUXfE-7Fsj*<`nv_GN&xG?9yKJ&#K(A(9}u2jB~ZL z!sa1@CBT$_m~9Yc;URhD6~ahKJ(UePGc<0^1P(dFA7_Owr9Y4~R8>+@mX}jFxG*o* z{N$?V=WE8}2sbUlQO#B-wSo^SWZh$}eu_$w;;a&+JmrQaF1Q+bQHY9DUbE0+pI$dE1%|ee`o(;A&&wYk3RBtP=7Wm7 zqQU0V=dNGZj6M%8EE$qjRG1rj`P)x-rxLM-FLhn6joi3swQ$8Np+!<394X~(ON!lj^k zd0}o|McCEa6PHeYBgL2pnwG_CAmYihPWcqAF(*ySDssX(r6nc8$V>yOtf~++&C1Ei zDZD zLSN6?8lu%H&-(+~$EV+ozqkV4hz!w{+iculH<9_x8Ea zImtKR2It_EVFC*r0w|ZX<=9ofYdTrG5lMeOW}=YRmxMy=mSus+x>z|)(f=y7RH8Vk z=zdq5Wj3*!=*h5UziN2KewPc6(7I39JmtC!WbU%-S8+wyjb9E=fJiI1b7EdwJMR@n zFO#8iQ-XyWt9xiiIYq>TDHr7)?}v#Oe-BQ)$Z{rL#Id_LgeqGCKqq8C z-$w>KNBf;(z;m?NUISi$@WQsv_8Irs66y}7@H6f?&x_sESE>zk(yKfIcRHB|00q*| zty+9{*XtJu35V1r=69}Fj3-jGA3Ix&D@4JRM#51HRc|Bu##vWXu{guZ7^OUjQ?1Xx zViK$oDtI&l1w7U1c8Yokrds>R-6!yytR>RK&Gu#Jx8Tc1YDXv@EghChUPM$W!nlrb zPQtcLGa%BtW(|AEO>1Oub38+^b04*D(V6o0C44qj>z7|%mSZc`NSY9%y(==Y0Q%C* zE3z!|LZKjLtdG5aJ&{%_+*l80(fq-LOF!&y(vkuY_z_wC>bbTR1+P8z$r=HXMEltI zAMMaGG+JSQ1smxoOVBDSEk~|_kkkO&Dg-;^hgVe~^_&G4dL#7S_>F%iS%!W_lquvH z{`v9eSKLi7S|R$qBCmW132Xdh&APAdP2oGmGjYDRXy|;!o73YP*gGSmK|3Np(vk)J zy&(e4p(#q?Au3@7$}=5Zsa8z^@yB(+;KHYHKN4PxXSW zuM8AlE_`DXZ~X+VdsQaU{&4LCYTt5$OSi{1zZw;Z~@f)o0cJ) zwKE8IcgZA1{g#jJr6dnoupx-10qtLdlGo@U5Akg@eWEJFEu8#Dtp%FJT#6&3*r-*EXKd|oo*7xx6Qo;olgY1 z97TgTAG@rvy1`p50EV-Od>FRF`j310K@P}HFv;KY=}{{wasd^|NZyLef{g;+aq4UJ z9UPVFJN<%P8@4C0wgv#}Fioe3quPrn_r;%HAXSU`N+sNx!PTSc8^#olLN0{r58+6| z`B(kD1#jPy%;<}luL;cX4&R(GJ{<#Eh}JrrBE|?l!@=<8iU`T$RtKF|V+a#jbmb|^ zaGaKgj9_61)jyo|3CnER8j5D^%4frJF#C*YCzDAv^?T;mKyFWv#;inM!5X>d19e7LAanM^P?_9t3(du$eyvScCi) zZa4Z^-@NJmYLhV=D^Tf@dLu+%)S=@%)kquIY~T=J#>IsLJ9Kk(%Lsk(g>Q>`kRk*f zx7m5s(RxM>1dyP9%f<6bXiUQM<$I&E9m8so?Hu+t$ks`lS*QZ?;_tLeIs+-)DilHZ zabaJV+9LiXtl9bt-+f9k!0DMk4>XFD%XcL@zHEYdi&3f_ZcZR)M5M;NvtdrRmv7hK zpEdoOWSGV4;u;ks5qC+a6DB~~+baZHo}vvhDOSl5TK4KrC|@D~uxcWHtF`65m)JiO zFQi&Pht=T3*;gu%VFcX*r3wuR6yv5U zT3xY4f<%=LGC~xKKgCXZIhRi3(_O_FAuyA|Z><3^8yrQO_R4YceLT{Iu~!H)J$r>lgnE}8_;VjQPhtclPEy7VIJqWQd#qMhnp zl)c8Qx@cC*gwk*FFsRq?o3f3jD{hd$o1!CJ3=q|1g0atmgX20Z;0InDU9=ePOI<32 z`{kuR)1@`+6VWv}(a(Jbd`i=I=B3dkXTW`BSRgcAag4iY|JSe;n)P5|>mO1d8Lh_O zW>ddEOEIz#@c?FF_aY#_p`QNMH?IGf%Lc`FRT!h$P^wH@Eb>W|a5Y$pMVDHpw024; za{bA#w^Qw{_PO=opZ*CAUN-IQ*#`O9X~O_$B@A5vu~Wt@{o;!kaU{1Ok*}p0jtjOH z*+;2Hga)02(Ko!ff$^;3(>!1?|H@u1MGw^pPMGRMpK{M@z1vOiKZp$}CsGk<0hUFb z>Lu`Y@F&VSY-&|QbxYaswyGhA0VKwD3H`mXk0xcN9%UP*N3^nPJcLzw82z11Z$6TQ z{X2l@|1GSoHgCH3hB`$XXm_{U@@@4mFZ=rHWI7LEGAR5^ZVJ1PpD+_CX+W(E@+%yj zD-1pT=~p(2^y~PW&1huLo4pG{Y!M$P5&jiO#Jd?4a#jDpVApn6Z-TmcnKN)+{F+$EaE_IOtJ3Lx2Z-bl*3t zcsB_jU=UFPeJFIGxN&{uoX-ZE>%}>(suN>pDw_l_oZ{-{X0SVJOlF7~UB#SPqeLn7r7|II7^qZfVNa@XegjdpkDvb66hTRmcjYLshQ{TL2MG?2i z!L5`=WMLn!oVPrUpK+R7n+ZUU@@NEQS{vb1jiSa*Lpatda_tsOf1Y!kdW-zHAW~6k zv6wpN1lT6)pd$aFW+Y`_2;LHDvXqEU8Y6g$KI8V!|3Iq~pP2*>0!rc?!O5(~1AVfWLXg@O`3cqqMrf_oodlQkp-2UYbv*^ZM**_F=z(f5H zmU@Nlud@PHg9O7EGmv<;-}VQYCN;sFrctBnTkPH!%3C*o)TdmxoogkxmqY%Q<9@{i z?bcxI|F(pr2GMUg`=hPq?ebK6LQ{kK8O67p=*O0LppHyCgLMK|=)YKc^K|FB-H;J) z4-qmiwT(Bw{zNi7C}^_(k8fAeyHfs~db^MwJ8Urs8bCAq5_|@r=-qCWJgCRf%yOJP zcBZ}?xYDhBi`zTyRBbqDzJQV@2}<H$`t^(=;o z#i@ujba09UZh-EZ#q6Hi^OisWVU@$MpMMd}SkTha42kS~pf3nE+vfQp8%_oujzC)k zy>tE;{rx5D8Ei{*Yv*@Xx3P}(3ti9FZ%lT)W!^3kecc1m*G7wN3yF>^YdSpLknFal zM$Pt}m$rUx9Z#c%bp)}XRnZ2R3EE9u3CfVR^h1s)N7+`*lR!-xI_Du>*js!EiYl5jk*c_$&k;E`ZcjlS}| zkI%5q(z$~1I4neg1PQn*n2r0GfdE29(JaFJBp?~YzY`9&tsRXJ9RU@my;qb!z8)tP zrfX?9E22_~0hkhs{38IK4(j&7JqD`%4y-ui?iB4uawwg0OSfY{K^M4lptp(8L!y~v z+VVL(`73z^7P!%5`k01UN^mZ%V&Qg>Trqs=1dm6R7*)ZFAcfl+9n** zj*BYd_qD3`yuQu zWd4)EzqzTYL4WJ%F9dcMHy9v_2o=WGjotVX*cH6S_O1k^z@oA9##{S1pubu+C3&Mn z0=o*L9<7uKj-!7z<2{>i*BHuMP>81a(dL@uL}E+iW;g~Ra)0~K1B^f}R>j_M@-n{F zaG)$Ny!2wk)Nqngd@|DdNap3DX*c@_Bs(mYQXa3DQ3(1)ldiKnmHmz1Vtqwt_LQ!` zj)K=WPU6)N+mz^VC#7j2AVE%vH91zOo_*wLJMXo(o3u(}wHv6qM4594s&oS9z&#>o zVrL+$FW9liI)8Bfkg*_1MJZSzitvH$gh9t=cf*)bqnpZBz_T?dfu_yd27X(jNej24 zUvurMTuX~NgLjR8+0>wpj5|_U*~M2-3R%mdqsgUAtwFZOE$!=jX0LRB@0tD5LF1&% z;lw^>2470xOKykz_#Yg1^=A~k?My3}KZE%l17lEM7Ww_*RRV4x=w^c)Y50*?F&Dm8 z(G>BD-~ln0ps7`5Aq9BzX8fmidT^F~ObDFHm}v$<47Ttw zlp!;w-#7V@d`1a9B`|^6Wgt$_ITaGE8PR2(BZb9~S^u`|e8`GUW$!Gl_b^m0f&Vn7 zU-{JZr2>F9xb9T8c$rq-r&if7wS%OAR z0&`SD6QFc4YEfiQZAe`AaUgwJWhwQ6^!-iX()ssehxTnFj;eq4I^#k6oc5cQSWZ}C zP8bB*08XrB87AZpZNNa;f6&sw0f2jOUUfq&s>;rpd^T^9p9L?Av(q8;odDL32b&iN zp}?_4aEh7W2x1_gZGZ4Lbcb<(5MwcMX#lDMBF0NN4a{p1Jhmq(KbUY| z3;Ipg(>qSn2j>9_wp>)$b0D>DeEgX`DH(@oz4C{Y6y}6(obu#xj4zy9HaN6yEAWL; zlD@dAsIn0CC&Lw7LOAsN#<>NAOJ9+fLv3c4mR5!yc^%#;^o}2ggmbdWva*ZvLX)q1 z@<#w6=uf{D0nt8OT$o>u+Ew)I@|(YTBn9O&2lzY;56KM8T{E`~RpZyeaDl5w}ZJu?a^awy>=`%m!66SLE;8&*=hc`~gQ2YQ- zdeE%r(Pyw5dU=_F`m%eP~CWckuf-3tO z8xZJ8>8#vV~Oe>x{zke8LqAj$xmE-5X^3qAbY)eMv@9uGM^bnoWLWWNR2*c?z_`TbCSq6uxG)!!ATXU_zjHRmg-T>`hrO-`ZBlX ziz2Y_2P@BKOBC4=k?IE2#p5pZ4`#e~3K~ey3|5a^XtV{aZNttf+Cg1x6eEJmr2&QD zuDTP72o0I9mSQb~ta_Pr@mM{+Hh+FE?(s)~;-mYv6cOM>=#m`%j@A~>cw;$r8E*nE zwkryPm59N`oXst|VaM~Lx%i{AA7D`q(NQ^t3$1u0ZLYBLhkzQm!NOYsQ;*TJ%&MOS zT$=?wFtYE&ub!nrr*X|LAD?0YS7Qkfy}1I*A5gvm?g9sCAO7gcae@|cK#(gcifrR6 z;KD6vjO=}m#x9z51qVT=XU1s^wIu9~afug#nZkC5dz??j_N7--Zd$JbF2@1_IOSC? zqjG}QzqL{HZr`12AA6M&PI?tkNfl%a2FtV%7--XnZX16ISEis16dFGk0xM)$-khOX zQ@=S*{Z$cKO@FxyJy1yukSDa|BCd`h3uTB(0iNTYYyklR`DYuvow}^FdM3J*zv828V7wS0KrcHKvE$I`yMrR_tY|MgOI-Cqza)2 z-fO%h;1ITw8oF8gmM=XNp0kf4hHLeM4WjVeY1(n}5$;lyI|*0U)nN;ZD^{Arc5c~t zK66&S^c*~%uQ(5n=UQGKzAQ_34V396W}KzS5P^~M`tSQt**Q>SfNwx%OrQ0}H*kW| zJ6^w#xPb!rJKaS{V>(*UUifHL7rT0(cDNdx5ZPqZg0Ub~8|ZC67QmBG0J$D%J28Ff^Iub;!*~Ud zy{-PBSkv+z+92B$V`^(gY6ECj=Am71P0Qeh_rq!}e+{nI@_&_SksR{zuv+Z|si*;l zFjKh`O10bp1G#_WFjNMx;PlMoZsPV`n`FA=8X=>rqmA&B7#n(Nhln8xCYVv8rB^qC z-7?3I>C<=2r*duSnP(-C55(uEW?A0~dvH9cZIO)&CC*iA1ZAJ}@%K(H=SzmKGwWWZ zYbm0C_R-@at53)met~R4B}3c?Dn=>C+omrziJ%#?z_Qb_$QKpv|Iv~9x)Ck^z^acUcFO1rV5jTGPRIr_UXbJ&TnP(v2VyU+FwSoQhJGeRK$IN z?}a1Ev>hz2pmRcdW^G(Yb?DNnO4Luw7u~lh#kdSr)Q0ld^Js+5_J-ya<`-0kQS_`- zR#B5B*uvsT=&gz0E+F%B-{QiG3aUCHf1iB)q=i&}E~Ba>Ye-gM5m}Sfvk%{S8bg6; zTDHzM#oIqx`MGcD92Tg(i_KQT5kep4^<^ueiX`F0WNQ&EizJEHVnMh8``Q>E_SBBC z?`xo*yF8j1}d%leSq^a&}4S(2~%st;?Sid(gGWekGmk8<0g9uJ9&zq(i2$ zzsXzG_>I=HAkxsBafa5bp}uisOkZ^S6{j=HJU(y_(Fa9%8DWgQ)xY7Ah!;u#zZ!B7 z^v^Fl*yM_yzyb1_;U(i=Xce}5+Di#qMTt|g^2hYm-!BlwrLlzMAry7Q;TXAL$z>ws z$v;+sG#dN+M!nXT0@4Oo16m<#7y@Kz1Z<)ra-j_BgoV$c6ga^xu#=UdS48<^D3AJ0 z?=LLCvlOc{+ouAdz+azIN-V>idSN5Q{6Lk+fEZFubkOHLeeF+qEOCrI=J!lGF(fn~W^>W@Cw`W6 z156J=Msl0-5I9zu+cI{i!2gDI!jXojC`$~rh+={`u7%`z{2qfgPnW0u!JPXI-qUd` zfM#o@%{+0`W%p@~uxHMT=(j(A%?LD@mQkz?RPG>mr(Z6(r(at;JxLqn*PQHi-PmtW zpk9r6Jzym<2h1hRX`e>UudZnkTVEe{<1Md=+g%0&qzjq|kdr;jR&X&CrZB1f^^KGq zFTcIznO(9ZHtXB$Y^0(L^6@L%cmE3unWmU#ACzo}Az)iRUbgER0+s14gp@oa3{^M6 zu!1tiH6!#VXU?VK;qgqnKz%vu%yRmMCngNVoOe_gQA2ok;Z2;dBkaByf2?)5HNclY zn6p~Uog^FPGd9xj-!@_}PqfdUe-LFT#HhJ`rDKxZhHYNr?}#}-Zo)n$1GR!|J67&7 z%*r+p-CPx3GLT(96d?wWZ~Nr$Om@Cj5gHeb0Kf`}AP>F2jqqATnRDOS+1p|HS$=8& znsy*tL_GL2lf2ySFLw$?d#^q#( z!ZgYwqS~Nj2*5j{>j6eg@w0x-)LX>1VFDxiWCT8nStlmn4d3r z?6a|AU-4|98^~Q^zVXplZ*j?ac{W6tqUfCPdf4eMAfd*;a@$(b78{*F8C1cBn8;x* z`r9{tO&N#+C&zd=MLSGQtz5Q3a8ns4YR6ducX?iJVL2-8hRad+xwHi3_i{>eN%V$+ zdvGb<3%#@CyJIts*N!Mg?O>Ga%PU8DWK{1hI>#&rz3#>b9%fnDe2CUWv!PEnUjz9X zVtYkiUbwWf0Dk!QKA-y{zh0SFj2eGg<>y$h&w6j+M=5-A9BaVAI8L&Q<3+c&q9Y4A zF4{^&A3tL9*0GV#cqm2i$MOhbdZaZB6h;AUbOAC)V)_-c$C4FLUgJ4fN&q9_ZFa=L zGoe3v-*V|HN#gS5&5wHF)cP1IuwGkFmq<*X`}P}b1>_;x`WG{Fc4>UkOAeb72jw2l z($Z_1aFa>n<;81mT|(O?J@bS>@hk`Li%E+cxKbN1oa7n!BIT{FTD$(*kEN&WCxNZe zxngn1lnKP?7_9XtU?z|~QavhME5#7~hP&=Mn#Y#})%X-uXostNb`;~ssKH(M*7qa0 zrJn|ltz2C90(VAEnXS5mDFTL;LXz#C_b)q=+X{Ax3jSg47jb+2Mmt!#FZ8!>dh7~8 z`6On>nmCq@@@}J%(NS0i^~HN;U6^R;5Wrq8UKckTDn<#t5Hg`l5s2yQR=jqHh!G7g z=9hPO5VYQR+5^oZNg?2+6eWzG{HJEYwa2@yOc_{QQ zDf8a+#DiSHDNUF#;)~N&+CUZoKoKd8iB>T252h?Z${7tQ*t|pA$4{6GlDudW36p|z z75JRmNXBfyXL4RynRXFeZc0=)7G-F?7zdctjOr-reY8NeL}aS|!utEKqE(P9jgT3B zd>%mW2n%=Em=;WW)#aP!(@Qd&H9^RXJa$@b1kwZGK_j*LgR9qlCD`td1MiVs`8swz zSu$H=LbVArY4Fj*bO;Yh47P5VzVN0GQDB-z%H01a+L4h)E*%GPV0b-ev?2@$KvhTr z#%=J)tArocTkv@pZQT_Xg#!?vc6Aib8*Yk)hl_|_F#fkbJSoxEbVUI>+?*WBQl%Zn zaLjOA)YeMr#j)IfUWv?3vLR3w^betLFfOaaHjc)X_^)e=8RARU_! zhK7SUk07Rh|M)VfpR~_|SB!U*JtqKRt$pm6t1*4%xK|EGD?Q*^>n)$e^!4K}fIWyb zcaH+Y0X4rtaBTHx)Eh_b*%zPN&WIf8nZY?2<<+AJBdmZUZlEy4;CP4)hkzMw{#U&| z_4U~dMb^83gJ@jOWBP3KImg8WczZc4hQJeJGEEwS9IR2ulg2+FXHsw(yA>{4zUf@- zsd&7qjp4rwN z)1MapSgo(UanzlB_1TrLh~5vQ7r-#(3j#lU;pR&io~7V$dJ4iEX@Be<-R#Leh2;Z55;j{sNG3I;k~FjK@g-*n|~`30R`2y4g47Ss#wA-;Cyhs+4uKExxa z1Moz52N>o0>uz9_^@2h4j*e|$Nly`eKsyNL&26_Y9Ku6Cihe)Z%6wL6 z%Q5|?PalN9g(K9)G#pe6JtWJ<|DEogtn!?K!b+&G$Pj?eiWCIxZ5AHTHw2Mr>p6dC+?=YV@q>VHjMF^f7zsM~K}D}znW|-YugQ#m*Lu_ri|O+(Jt%=_ z0%d@%))rXAvtgA+A`5(MwZqPj={rAsG?856`|-#K{Blpc@=V)5{;ihUJW~Hw*gk@# zDNnCr$54P`^GIVA%#Ve@vX8d7N_hjJPlhHy;urf@-+BET9|-X=SZI>X2&9hVHE%+5 zAKvy`dQx%5j1;(@|3c2Ue(#F+SPtSc z;M?-~NB4vlBg0!vNZNR^TVd*Hk*2YXGHswT91Y_K*1T?bZiSSLP7dTBjy5}EZtmeD zH~L7&@J-h|o0bsfpsVp?2Qr$Fx!0zRee*7{*W&2tat6xsMUZ~5fvdfxn|RT#Jr`$r z+*9}@MLSeXfm8uS_}^-M_&PR6yLIjCLwFk<9Y}5ZzB7m%EHX<&b<*3*b6XlH19+^M zZQl9t6*X2jc;Pb6)s99$H9rg!Km}EWA6-4h+Ir*PylS&pxnRSyxB1Q>jeGIn0h9aB zA0`j`Z+JaSxYcB&5_PQ26wsLY|>Nc%$sJe$(RMA!9Kb?+rY?B5BYephs228ab5d%ZQ3xASEy8}eI~BpIY+&V zuy(9}48OJIW<0xbm)LT_F>8KZB)#w2Ft?3>xU^3#e$jy>Zo0o~$H^)Oh^?Vq3HX{! z->a1B#(nb&;k?E(Q235R5TFgSLzQA(%ns&zBp7mJzv5(PYlp)ZV5S{f>ofDo=@c4~ zWbkoUtjc;sPl<7}Vx>k5(-rs_40Wu}NA$H5rvD8C?JXR$K=)yV%$mry<=@Q{8!dsx z)zLYS9Kd(GeR%G>@iUVjU}|h|^uyHun|5ryvPagz-_;CRuk>ug|8yHbBJu_GxakRPD=k|Q6lCjh{)U+UDnbR^S z^v%}q$dMT@dQ-L2DO358rYkd+I*-Z|sV{wU*=;Oj3fK3E+F|llRlkiHk^cCmd0d=F zcq-eVhGrkB9idEECM8tw9FFYQAH|;?4I03-peRu(%Q7m;R%wGg?OA7J!p9R6C7!z* z?hI198ReS*OSVtLQxKz4J3`C?8PAQ?&4gxbO=9(|@e2jh4|ZsaS(xp1#w6NgWtf?& zouFn2#SSjbMtE_(D8bd*agJJzRs}U{zB{Mi5#e(Y9JXSw{AYEN^sGA~#>45+2LYG$ zhz5v+n;IL&=<|2I8RJWvFHOppj>@mA`GmDo|?k(CUO^h~3U-y`nK35e=So)N6)g17e7eD3*#(3^g*-TfA6~c)mvn)*M5WI@D z0S?Y)?Y@s^eR~w|zF;!j8|;js!<%I~5hZ8V7u~RDvBi*G48`tV5PYL1Vr)hcd9kmg zs$m@rwYi3BM=Dju@8I3Ibxkc#J=hZLX*%iocjU~urf)1vHT5^8Rs~l~Y|u_tllHBc zXf6HS(>A^e^e$9tD*v}$cNqXb9VW?jqH&_zgT`3dc z2=y{7g^NtqG_^Li=$}3_!@zKRiNV0r!q0@hXwGT&gS)nh18M{xP}N^&Osh>B4XTa2 zak!qQOHjp)BWh~O-z~PY;I-E&93(w6_{Om}nDo3lljFW?O0WT?JR!llOLNvH<&0HixndRf+^cTg&Yao@=3OqP z=5%GM>Fp~IX=l#Vy@=i#uUJH@#;bL}zM1xD3m>p}=`gBZ>^|W+Uzq_1ViEVMkGLai z6yJ&L64||e;!UQyBIexc z8}-^6$E~wiD`ob-PtkFnR7>&hrD5(Q|~?&%g&tbN2XR~pRH+tRF}^_Gi-L| zTz9&6b$3^tJ9F}%rf8?w8JV1W_fn!ebHW}T7O$G}-?U?V!TT%;WcsfA8DS(Io{e7* z`$QPIE>%T%h*Rxf^Dqe=p(6{D@kcnSoE4NUa_*irp^gQ*I3az`Q42zL)N22}OV&oA zEuX^8dxJ905`PwDCcHR>QZwQvBsxdUlyM6#FPoaa+yd@u(Oo@9Nb&?8>kg)SX8dIr zC9?fsdcvsZJ2Ur{B`T0nMkH4iP*+x0&#zJ&BQ8=j&F5#YgU{bzME%a_tB? zTeJ9`HP_W!SLP);pUz?X&h%N+$|%k!AOUQ}zq@*dSz3tFwoxnGn%LV{EiB`S1=o)f zgY=ybBBNwPSGiRp@^vRB+K0|j`>xxaW<;9+JP@DB-23C|8y<%{p-Ppxa?mW{!Y08Y9MDZ>Y zU#*MMR-n3*293yRM+s|_`(Cklr{G$_u+6s7@MdY#MTtqtbUSYq?5;lDv{Gi#Z0l4% z{@Ucjm{AA246L#G9*-wY6-vl+o}$}H%q-sdK+K~QGp*9x*7((26Kd}@vi8gCM@n*5N6dbrqqyQi$q73Vu!~ozVlv}D^#Ri)^ zVAVT!aIK-ZmIddi+Rg}GFd2bp$zCo!iR02CX{}H@OisSJsfhsDgygJGd;KoL;E9*m zYYo=-3|ZN$;zhb_?B&^$m|48dXX%@4F`<^N(J$SzF^5MV$5Q4TRZ>%EhfbZ`6uM4j zhV9P51iT5UNvuPMc372Z2JuaIz3{2)CrY6R})rpiAfVR~%w}t_n+=5Yz(r10Vj%OtSdlSIRG42~s{wPtBAQH*AOK5h4 zL;3Od4=~`i!0aW!B^x@AzWdUbR?^th1m4>(0g8@X|CqjG&8nX9~PfNCT(1bzGX#sA5BAUJCZU(y%3{DHug10JAnfh~rH`-7GtKFc&J_70W&s zEVQi=@lG%Ll+N zalWGi!wwaz8ma;IhnNb0u@ht}{)LjDYp1PyLF^vJiNg+*uQfH>-g;-_7Dn?;6NMC! z4kq4ejWq-M6=&LNaKb%b+#?#4=x>Lp^Uf4`VBRV!t0>XmfQhHzG4;7S<_nG!j2oap zF$);o?Kog-);ES7hwkf}Kc%Wm{H>U@O97kG4H$_L5Szk+*!U%D{(+*;+ z&X|75_Sq+4UUB7U#grIqJtiRJusxfj_2*H-QGN4yXNBvUn(7(|H5OBj=~u3~a3E8Q z(d5dVChuy%-Xqw0jQ;4ucb?6C$3sgtP32kgvjPT?J4!oL$;84fM*!Jx-?By{l(&om z*gBQ18QYOi;-1{~^?8XVS}wn-;7cP|u{c6{Sk* z^lMk&|FF0Z;%M^b>jg&>qFn&Q;xY6LFtDaIu!f`7WBR=1vo98~OL3%ZWdjr+Wt;=| zwg;(EZnyapCm+O=3l0dbkl(7EBKO*{G{gqY@HS27qYe<$CffD&cV1e;o%||rOS?Ov z(%MIk;#Bq^$%)Bjmz8)jN<88s$Zm1Rg2yDR%3x810Xc;v!7~mP2{@k~jL>v^ zD=C2UMqQV+2X(XF^Gl3lgshv@1om$SN>V zTzi0PPP15S-2hB6!Q2JVCyN@2&okYLv-3ZQTN{gdaMl{{|Aa+Ji##ZpiE%ibjqZm9 zN&g&Nkn}h9`j6?E!E&Y&Tw9mSaCxd814NMH!uO#K8tGQ3G& z|NeU-948no->11kd@9TpzC}410f4rmyE|qBinSWB6#0#n8i)5x6UsH1F7U`#KLboq zs$kDxH84*Q&@uqMW3^#m%C8##J^Olk3D}M!w6swuK!&;|qlW3%Tr=~R{3V0lLv$v_ z!zqZ|@}tx5t7mHb0(Ey#c61z!KZcI%)XghA_RU7E67m2m7t8BoHSHgrt)SjKiA+U^?&dKYIA;?*i2n z$BuKhydN^xa4>WIy_2~H+aeqk>0AywJC$)vt)&crhyImk0fSACj^X~GV4`pB%gOo{ zwTcDmSw=)VjKD(cdHhnrs&yzc)dcdk@NXpPd$(3mg+WS}C;FqF$Nry^=cUV7bAi-hfvZo@>^ z0AEh=T7}J? zQC#(BKil@5upR|x-NA5fekTnhe7gi$&$-UFjpOwc#MRJ$R}hzI(H7dM>D*9zO) zn-w|~w6cc!;gOm#H8B4*i*ZhV=-CZooVjfxl-e{!szEscw!IrRyfTH-rN1}!(QCxQ zs#|DeePgYD?biSvrz?<6=|9(wX#iCu#$TiqY3`OQ*`a{#FNb`!ar?c^Y;#VAG zkS0o{bm)HexrW&SA7I>Ln>nnQq$xyDZAwvg+>;vwsAW9Up8Q4al2QNJZJXB-yO9bJv@lT$ z1&Tge2FvsdWphb97-`9+z$TnI(^37PZ7vtFX7ka z55Z@m{NeWNmftV>qB_Ln3MC#1y{b;1b@R3`f5sO8o|qpkUAmo|V^UAxCr!=G^v#!B zFU#a7%$_lfnDFe;v%7b1?ZeNQNrMsM4A&1ILyuNYy;o`;#E)5!x9H7!tC}fWzSJLX zqVk)HjA9>waNL|lEBU9Qj{H;2jhj#;;6EHs5TVKw<*%%{v1)2g$9TO*z^PN8ONU>}Cb=J9B$hZ{kWWQd#a&ShGrXc_WPTdxA zSUz~ug26Zf@#0fdyNJ<~UzJe-P!_0p*ICUOR|$XzFZc3@$uQd30Uq@CXHA!K6zjVP z9Z+~!I6es6K<=yl+SaB2&F7UZN>sba-h^cIqPCm)k?}>U_7gP)`vR!nT%umakF+Cd zBciOUjCVlf!|>|*2CBZeVfmdTPsrknRH<4(K}%+iH&GNosqEcC+x)+=sxuxL}6pX5INT*yR=!rkK^iVN!t)+BMt|b@rL1B~;UGXgVc7soA{J>F4)w2bB;UML z8RWuyZ#|rkC<_UPYrSw?qIBrw3A4}SpIMdrlUE!0eVgtz$68bf)kG^{3vyMAN^Gb3?Lm($da2a_lXWYKNl?3t}lG=-?Oy2$5E;tOo^v*$9Jg%d+ z=&@V5Zl1G_-VxfN+@8aEy>jj1w?zHm(fzf}-pj5zjOSRTl8cw8wtiSU5cN4_PYa2%vtxGFPC0mDBFAX+j z5Gc7t3uaX2?3JR$LuEg?bC|}JDcVo{j;a`jm--Zpr7R%`sjVklk^c6jcV#g3`L>3m zGJ?{Fu+^Ry(PzBy3MHzDC~pptaDUAMHa{@73hb$XO{S<0^K}0a)x5^StOuVgtmFFD z4_~6|QPx;#(GG*CZ&^*mOR%$T_(qoWDQ?G>RAWF$sG^*(&Bp{^BtwwT*mwc`hGUG- z&QuNA8Hree;NCLe_9fevNjrVQsGR#4EnAniE6DF^{xSQrr+c2vDGcts-)vpfeL-|*)0iQ*9RHp+p&yZZca ztQ7`Q{hF22t`esyj=gp;piXN`qga<3lvfk1pit{at+X~)p9f8a8NyeqCoXGiTP#*0 znh^FIM5r{#5OV$6D=r)>hRj^xRPC5ih6MmOR+WGxg*l;*7H(dX!U1#f_9*izb60Z2m1}n~k9F=6 zHqFN07i@R-ZUwfq(c)9#MamHM99(&1;fS+p&?wum&8Nc$3LDAkjA895*Voe!H;mnN z&gg8!u}-ta*=0F4a{X_eSe7sbtEs{yaf(>72>S!nX^GAa<^%?aVX%+HmHHQ2X+@nHPddgZAxKqsiYC z70V&3dBn4LzxP?Z^vvKyBG1KY+?Ep1V=e`ydVBO=%S;5&k3RW8R>V+9#dF1ikrj!?$?NNt>I<_$A?>*Mn)R-DUVzt{L{oWn8&%^Fz!#$ zPWPQIsa8I|J)vslYln{FFbSLESbyW@d)Vcfo*4{i;A*jbV+Mlj&jZKow?MJxjNf`l z+=fk?aG0nne(>n(D0{wcdGk6Qn=W2CouT4YA!CxG&b2Dp6w@W!GyY$|WZC5HH`{;0 zpdL?HrtrBoOy0=Te&$Q zc4iwFqy#WNDfxR;Bw~D>yVD{rD{~CBb`>Ga>9+L>QVo4N|d0(oXp>SrGs94n456XHp)vee&38*AJd%P6nU6{N-+`9WGtTWNxgyLg{ zBC~4jR98%0N13GI1cKHP8vAXJjK12z_S_woed?7$%3VPdrxGC+x554y)pVYhS#^9n z0nUMt5p7-BI9iU@&m34Cu;!X$`jTaD&Jlrq$;MlD5)Xrch$<}E2O4Rywy0XRxcsCe z0bd@LGc{E^L=7mw4R?m;1@X_G&x14q2ulWtAdhQdV|WNv_BceRkDVi#Uzb<+nUe)73BGp@pzaRaL^m2J;$X z4kkRk1X-mpQ{^H$k$s&rXI#45m3@nDq!o(-A+}8XZaimwmgfydh$9C_%=m6gF^vX) zS7w!SJKI0|KB=uv?4ky>+w@O2J|aw;QqDYBj-{Q={JV{ei~XyJgIPDW_qP@KBN>?Lt_h;0i5vXS^uFdf2Q z;mG9fjj_TBD{aLCA$+Jd0)KRflOF&L>1@!DEKTud32|30csaC$b#bwygoKfa;UH!HV*A=(oxU(wUcw}Ul zPMquL8rZ3DHCH2ps#?faKhx5S_*UgV6NyuUeh!bh{rf~87{9i1Yb_1hSJz<^a=Mmg z`lt+)>?G|CZoh-l}NmA+>OM|5+_m(`e|@hgjb9<=VRR7 z(^?Z{z)zG5%S#g|jq(z8ERZ?hKOy2LZ8&ZsjM*o{l4ZJhA7)v22Vb9Hi1LJ>*wT$aw?)b21+8!SyXz<5D}snM34biL3PN`Rs&?=ihkTozHtMp5K>)odQ;y)u#5D zmPvsbG%WbU<=7S1^vuL*r)ut%5+fYNmc=eTGdPULXNICXVdb+WPsZ{iEqN*kTa|MKQDy8lHncuBV$(y>zh}Bjbdu!ct#Qm{*=vo>Op6Xv*?g z#}oLZ!oR$7&4WOv9H@ol5Aa0fGw^0;-aC8#jBKs+suDm><`fPtMC#P_OK$i!g|l|- zG-3Ich$C{a&7t$}9ECdA%FdOZ@%A0tDKHft2W~rp1ED}^dO|yfl7|R z4->PG+NSsh)go05knly!IVNwPE%h2+a$nZLXUqPTdA5wv&RO_Z{5v|HaXgJ83z0|O zYKMKEe95Xmn*J_!T)EybhPpeBQV9V7{5G{VA|Fn~StHLhG78RT{g&$|P}-r)5I+=o zrZq^LkLkDHcy%dQVVcOgqgOE_GiN`B>nPen@>E`9O>_){G&07qXua4|`5-v+DyJ2Y z5ThbdM?)~R55ZWLru7qB%q&fxfz_&xqIw0rMw#v}tiPWVN905jWE-<;6sV*# z<32@KS^?unA<*CUlrpeieRd^-f~OTQh!n^b z6H?>0+ZR$XZdqyp#C6)j2->NQT-!k2ZkBD^0;+z1EieIBeqm)^PNe`)K;Quh0qPe= zp7iV&Z(W>{afsF{tGxKEGef&pe{?kB-VXZHug(hN&lS@@Se1h0-1s2b-V|+bAOqSY zL)lDN?$vbuB630?H$q?3fWku?M_5E6K3-Ya)KCBzN;(M;BKL-&CF#3|5d zvLmu}k#ey;H=fCG?Isdn}!8cd?mhpms=WBPS42 z-W~3aJ1%LVyQ7`r8rzSmgY8GzPBkhKESpJhn*>UFlxKhW#o9Y}gx#<(H3llXO>qt)XA{?wU>s?r<65h)+p_FM>PzOw9iwHKIkZ+~uUXjt9bR4IoE+%sAP}h-pWoKPe*$4SUTdE-02JTvUNl99ys}wNT{z zW)>yG0FOiR695lCzVd%~yzv5RtnrreXC+N7^~39hRf)1NW%(XtnN`=;;;xD5caFPD z)^B2Q5cQknJ5iNeK*Gj``Imh!#2FS39bzO)gC}Y_)p}9OMNk`1;wWzzu|VrTStS;M z(?@J?v5jH%4KI8p+Ge@W!#h~&i!YFJa7&(#KpM}3XpO@mjbcMH(hZO8&GAciim|Z> z2(&(BqtoXE)XQEg8%c2R3RV+YCo$CiJ10{@M1g+321|6@IMewvN8t_!uD%^%51j;t1tj zt1G}y#MQC9s6_+YAshcfJ2Xor@2jeU&LnYD)C>;>v=F3Zpo2oBhTq)Uf@FAr;(Vkf zRu`6_z)DVONeLutRZa&+Hed@CqSOvV+vjh-7WHOi&708kmyf@Li@cN}9=9Z~ zJT!CN)J-Wyz1F)3;7#1eK&`*kM^RzP*{W?r8)W_&Mk;$=IgEAT(@#4sKU`EE`f%IW zsZ{Fd2;X=3mAe*w(QN!(JG9i=W)-~4oYW{SgO!l7^^vwuX)slUm5Pa#R&e6|ki5{c zZ=V@N#zOp3Rbm#t!HkzKn-w)cZ)pyQ)cVuAJnxTH2uVgJzm48--_d9SprN2JP<%By zzvP1n*QI120pHp6#uYE`ND&#z_FE`OO9*LwfygRM1kC>Vg0od!WHH^tjk)fN5C2sn zi~w1+b`2K^WNAH)szJh_$n zz95uomSB(92B3yfZ9StKb3Hs!DFLpUNv|Exat1s?)+_4iu6G~$CqF$!8(7oO)Cwp! zT7Qep-hgWd+QPY!ZI}pqyJ2aT^JQCYB<8q75=n zjh8}Syte!{F$oqF0NCPv*+!%M`|G)OVPBxflA@kHo-92sNX&1`{Vg)WeX87bFH#M z`bD>I6825L^b-nYECe`&GPVi9g3YtTT9XW|U%B$~k=!F=g_FqE49NrXFjljXU}J<# zh--NMws}tokpm1^x_4HN8X$Pmegn zWjhndIxHAq-3USy@oE(OsBhl-B4azJ6|iW)Popi3IHJ|DMt$5*YvTm4x+V#wNdh9S#?rh{QWkW8pG8v=|kpV`pP+<5wvYu0aw9{BaS7k zaY+tIFzJz^^6ljL6Hyk28s_SfURmup8YuP0m0!XQk;Xdk>+#DMj-$_d6&z2`u|HUj zH~p9f{R-XeJRE5X5dGC@nWz6#zh(3F|IQzsfX8h$j((b=rDdxN19FQ^zM?d(p@q4X z1p<9CyR3o)s^ZXsDQgFke^mUCAG&hFwu`BH-$DFCerW4`i|!#gt~dRiNncF)Zk_o> z=4tt%=dZGTk(nQwG{^SE8T7@MAG|lb+82L3?~>la7@qfU(5QENO8OifC?%+qq2rDdF~8J2LFmzxhvC1GYQEGn!#C!AYa zoK*;vCM>|=J`cjDhhF>krMqc;d>?0qHu7T>TJ-xmtK^)}{ExqWAjQbiG|Ml8ti8i* zgDS}>KL>D61QtbR;li?tyqwUiY4;qDpogAj?a93$#}=Z_B5ik;${k~bRGedq<&ca~ z$?{AtXBis1d6h=8GXGLqQglw}?$sMK*>g_?A(4a^&Z$DZ$YQ7#cVF~*DRz55^+2f{Z+*M#;gpOx zFsc5sH5`D!cvxP&2fI{t$T|*IIix1RDnl-5KVL8Wz)xr=iP#kJIF-~TKB=3KqwihM zED3{=v%F930)=QGNYo0_9wHM`Bn~OCs%sTqQgLDUT#lTn^HDhH>LtddT5g|FDn7LD96fyPT(>?q}TI4C|== zR`)e8OyCu3_sUQu4CiGip7QmVP$S`-1@l(36cq8H{p#Xr(q+Yu9QTv)ZVw71^SjcW z9uuFa-9LNG_yuviF^Rj_51le2f}JvjPNz&;1uC1Zz7u>i4>CTm-x36AR^WOE536eq zkE;EJe%a>jT+u^@5{%aR(-YRjaR|a}T#xA&KDzTA671uL(Y0j^*>%ljFdAl6l$4Vn zz!(N8rmnfT_7^as9BN&>+4*JR;@n^0)g3L`2EGVAN>)hUCVhRz5}s$9T+f7Xgz?EsK2+0^ol+r;*NfU zine}@_>CPF%#Nzh&*uNvHyV$nlJCZ^=Kzmd+YopB8va2=WiRF`7Jk!osYC)k(t1(& zQ*QbEY3Vj#UlVj)#p5}cRBaPFZfg|LL(koJfzT}|W<~;5x!UI# zDSL~e2#47SkVcR9U;Q#m%Yqox+f*`^u6vHrSj84&L!5eMEK3P$&BkIfs*-TBq-O@h zPWX?vo&Ij3Iv+#@>h=^@mbJ*}_LwP&r55gqD69^(`Zbqt>ceZqD+rr{G<}+mx?26~ zE57+JYZ;H%Lh==>kvXq#62f2wIu@*)3s%4cR!g^$-_1cvW zFgm{E=qQ;Y-}K5r`ljpOq5@13VH_awWbuvZi*CPyup5G*Xq4g+bvhcN_3VkLg+ z7q5Rtn&Ig57?-7JhiCH)lq`Y?uu^l9cD#-Md5Cg?vyj}=r4H(&)uQ%dkvor5wD6vCJLgVH< z^hydm|7zqu?^TtBmRz*6h}DaL6=oqca7|f`wGrO>s&#P^SwZIc(c8wa$Lx&7PTOcn4$&>&CkR z`PBC$(?KakC@D%~mjP)y3bDss429VneimsIU)=cs6jxV&Ah5t7VqF=e@fxp_0GCi|z9k81jMzpH3EK2Ceb7HxG4HeOD!ZFB zzyv{XWC6>SP1c-X`l9CO2?1Q)zHvxPsTtX*UveR7B$A;czRD&F=<8Q(`42qoEiiaV zO~DsD8QWXNJ*m#fg8*d(*h8-5(UX$08~mVDlnojs+ge9SWzmt|t$eXxE_`E?xVDrO z>u~mQ@by(|SDeku#y4A{P_^SwsYXSVSf2ZsKI^5O+f1ii4LphZCl5%c3|);-Hqu~O z0|W!2uJngCuKgW%$sXba&R6C*5D#nt3i|F#Us@^V#UWn^-GVb&I563jUkgrj#T|EZ z6){ou0VOn!_Pm3le)21b0ppfD_ahz@J8&HiOZL%voQ>>-^*H(1@p`g$I2kv<9&3j= zI$7|@r!rQJU9f-D4ngrv5~@Yq->%J{T`Pq4KmLElx51N6V0onT80ldy>Rs zV2j6CqPP{0WCrt4431)*RD+`Z0YD$a8wPWg*o97S7=oDq5{Ob6=!|?4gUb=g6xwym z-0Rubl~qxg6)wxl3GLZ&<-e2XDkm&o*>TM*gCd>qgL-G@q)Xo5uX4h9RpsFJq1#qH z6()Z~4vIIHS3+chlY-j6;pRs#A`b>0Q~(6gdhpie^B!ZTn{43D7goKdj|4du15YY>WRl$uQ<&e*c*(H=fpl!QHC5-+Ve~#Dxe{Oe5q`2J}s%4eV=NFK1^yvGfS@t7ZTL>!UQ zy}h{t((s`agiIK~IMMRSv{hgIgeoV?KfkzZ(qCa3>FauH(!xoD0k&~a1W{=_T}$gLm0(rC1zCe(pwjvPc{|&BEH0HFI=QxXYr6dXUiepUwL26i(Oh?2CMW88^t(ZRN!S~mT zOES5=C?(}*^)&=k8$O~wsNu**{}t<$-r0eX9$$A%m)>)jGFoQ?mWwD%|# zBMF+R@1=)}xZd`Kl~4KfD;qzy_&_%CDBl;2e>pu2givPldzCBHH2}Imoo{Vu(QmzK zVK%ddjBEjx5$u8uxm6yp?BT) zd^sU6ZFh6TX`m0V^&O?7*E3Vqk3IkQlIuB~tZ(FuryB42&# z1J@7d^$dnHk|e#MSWht+CYFL%A!9))z}}1qE}q;`>Dq#5ZGUD0U1nq9xk#b zYwLB}Y$@Q{P8Fv>qc$*hvNd{_5tmx9kJY%gC!z`jp>sfII1MstsH`p>3$x~uzF^Xd zzO<3W{Svssy#9_A<~8@MFt0lR9MoKJUaMpJ`pNGc#<5MoT*@|5`Ohr+)N3k|CX+NX zmDC2{#QLGX$pk_}z*5pCfTufNtO~&v6;==gQEq7Wi}QAnZ{Xm(67j>-Ia`Lny~DMY z;Km@E#Kz4V|0`Zz1>Q!+IEpTDcKEa}Zyw#=ePi0-oT4mM-+~>lCBg=M$F@M3upn9o zuD&$S`O=(r279jUb`{5Hj9Y+)DEm~$FsEr0ltwzl1ZP`4ilF24SMK=euh@&0;k%{@ zJ0C6#;H`>{tY7=gl775hc|#7=4ptAAjenw)AJD$!i$gTZhGtJY91STyHBbuUNZ0V} zTmtY0{Rz#at`()B80=5LC`^Cx%Xf)~OVJGZZS>YC7=EH-!lQ=iAH4kPR`HxkG(bCy z(E?q~a7=^aLt_GPqvd$GvL$FH>K@z9pFFRb97^b3DrEfP%~3CfFbgMZy!1h zaRue3Y8wdBgD93tA}i1ZQJ@=`7)?=jlhOiVIiOh|G`zk6QkwqFb<{s2GieMBh?RpdGCkFfdydOn-g{jjDG6^DXd82gIAW{z(WEvyicT=D68FsfNm8 zf;Bo$)%Wk#n8RBLWK(Iv-HKjbf0dB0lBOe{@6M&zU$v8XpT%NLHT8T+##~6ea>qfG zf~%u0(qf5~yFdN-4QuP!i@jm{vD85eGJxA}ZE1=j{ty*3yVa5;O?tYJ_sSMtk*fWS zDW>9U6oQEGo>s&V!wC*FwABoZw~@aV279BjXpo zq3l-tuVp_ytzAGK6g?eeBTq$y(SHxnN8b3xz4GeK1vKmdQ6=2cghLchRGEn&SK3cR zul;lv?X^4cg;YdVD_T`R76#m4SyNNP{z^AMU@N4}W=unW>*+6Mvmhnp!M!DFe2}W0 zOl0L^+A#t0Srf@ezJ9Z;o|~A!Cu;)){wGkJ>gY?@`5Li2QT@rUx1UE!gqYL+ZoTBQ zRPCo0rBxgpEENc9+yCj^9c4chRXm0%em<0BAV&>pZp?>WXms_M#Cy71?$s_3X`r03 zk-?$x?IXnk#uwNSU>76*!P>WP;)I?wVLeDnDkd9fduc>wJG1wAm-cm1$WatKu$Pqh z_mC8i2RB8LZC#7dYw{m;FZy&xKBd%({D!7s)eYU#Zk5#eBRgMv&)*T+KvlrV{LO2{Ov4Ybgz@RFKKnFy!8aF%q08+ z1X8RV=^MgqCMguHt8T3S7u$ySEw%O!8DUncc8bNZ%36oPTAK?eP94P0TI4niuRp(= z-HZG3G~S5f=R~c7NOeQYh@26Tn*G%p(gl~_HL2R6M4ZA=R9|8LbewbnSw5965m;c?MpFOc~8|6tJ82G z(97Q}q~hZQy{t-v`{(_z*MyP9sp{6S5_4BJf_MTX-|+*$k~3lI0Iig;Sor?Q-n+mAqP7i^$VLE7?SO&E z9(``0gfJTwC3Oyjqa`-+Y)#cpqmw2Ae`-xRRQ+TBk5WncM%-)C*f*)#S$;J4QCs%w zc&zRy$t_IPjwaemU+DoMn83A@OR`bc;2)5id9NM$x8;#{(Jt0yj(g&IjUpa^>YsB! zfHe4BvU>Y-wy4v6l^oUu($V)l#AW8Dvg_|8?PziBWXaQaVv6=l|CNxoF10*9rqwHN zn0pl4y0Qb)9DV0T98QISD6K*mSohUx@3oV*GvK6&%hi`!9n&t7-wB;e`|fzXPM3xz zNoN%=*)3Dok`@fRfKw?2SJFwH(f!Qq+XaNVFI797(P$Hu4Cr1vu{)mK3wnysaH{P{`36+(H0HiY0lHcX+#`nP)W5&- z0;+2yK}7uW<{1biNZ@BA5TIc+3VlkS^U$~^D`LX;>@$Ey0JsJtV^C2*F@8}qaMs!j zM)MFE(q|yZbw80#7oH8ma1ivm;hWlWvK*8C9s5@ z@i6Cy##)86wCCnW~GJ+Jk)M2sN8gryc=`GZB40QqBo z1NT}WgM!5!lhsWTrMly0L`D}UQ3}dQfS+!OVACC`=iGM|f@9*7yf@Elcch$33K#pX zdm;mMN4m|EsCgFM4(zo=cuGrBwG&CQ6Ew4>6CU7mN&59wNQ8%i2R2`#&9_wM-wV zeT(_h1`pW2H~Kkmk#22-?~Z5JX{G{3cMe(S`TTaXz>MxlJ*SzfyCR%-N6I;c=Sr?} zP|(uSTo!FQe;>hN?pJK@G3itj_k~5j*Z~42mr>!oHv|DIYYyzcBn?+8^ik|TQ6BGr zl$S`#a~hfd+|+pBj!g)Jb#1DaVVMcK*B;xK-fop}3-mSA#SmqL4n)$%t^Z&tS)x=@ zw+z+kj?x-Jw#6Bwc+YNDPO3Z7OMys=_}KmPRCYmtj)DR1)>`_$)xf+jDRjFG zn(yW&(=GVMz$sTepxCE*qA z&a~=|Cr}CNf`;8y5!{!%Oex6+_f zK~t=SVv7C&IG66F@ic0uG|O>`GCAirH-<;haJ^-6u3!7yKatX%o_S^@g&L@N zOUK>54{}untteuoo5ltw%@+5X0(y0-7NXVceqlCA)2a(Js7WbW8kNszpw!?Dz!cQt z|KXaZ*2Wh7)48_}#WCqs@NXzAoN=^v2tT9Ze&M=d`ofz&ypBM^dKEDC0i!(O(-uIu z>9>4z?@tLcp@6^-vWYoc&1MtMki8{|UL?OY{_+>B6O9P{)D{C!1%($0jIn`!i|DW2 z^2(QtO(sUAYX^@K@939aaPJE7ga*X465nKNTJNxY%UGYP^`+)pfYZVOA7e6#wKRH> zeu?RC%$fXD%Kzu?$^)CK(*1wGm|N8fIhoT z)2hsyc>|)d2?&U&pn!k~h#)8kBC?4HsNjOiBI=-^fTD<^qQ2kvopZM&H%+n5;$P6* zd(ZNn?|l1mW@`|KD;$Y~{rijcKV$xyhWbGSs0I#Tjl>3)0T_qhdvdzD;vQw@{OW^D z(fa!6AdTPg{6@6Bp{%Mgsbe-xR@WIzkRsh(I`l>3jB#}K-aiRJZC>Rwk0!dC`!5Old-;QY>;}8;H%a{U0t?FatuIbED+z8NVk3YGYC0=)tN!Q%Zd9B^fK79DX*j3qIS zo6GSQB9|>GJS^M5xnxwA-J~wtr^m*RAjrtu#&^Pa=$+GwZs`Dgj9NpUYXH)!+Qy1V zSz|?IgSK_ehwCIvFHZqe^>Ge;=%eq7>looBFn=f7^PP{@Yscp8+8~F!G>zeiP(;zJ*Qrw_>#grRM2nJ=_jFQ0^EJ}+uB^)O(S zuw75NIIXO)VIT_p$$rX_s@eeqP`fTtE8(FXo&50t#!zSB0EJJ?0WcSRudkPB<;kK0 zhLz>y9y~I3741KR>7@61(H>tEl~qS^;XEc@78K`2ihPBHl_!eMzFgFMi}+9ju6H2Z z*FAOTflV%tM`Y&u!an?*;}3=0_q?{|&z@5Ww+-Zs7^8f6aQ9kQ_L<^zAcaoL)4H z=LFG~$J4%Cz5HT^5(5zQzB<}aUs`J5qp7VtJVu>4 z&Ef6CXI_XWiDzC|oJ(hZlITKb*UJ|uh~yL$hd^k?&;59w%X5n8P7mlc8yQ;i=`BAt zPLC$_KAs^uTAR^$yuwpnA7#E4X{ZDPY$&U))0T{VwzCQ7Q*l|NvGV###(wSCux-zo z&<1v84rrtfll`k2V*|Ba6Amn;ryZEDgE6$Ktk5R+z%Om`xs*|f=%&|Aia;8#qvWAz zOuO&?*Zbq8%&ZF>DT?k!f!wXW%Gc}ZU0+#Kq22j86QzuNF3R`^acZ?}yA!FT#>}Xz zUtT|mw-6y#`t7%SzoLa^W?k$!qeP8pz2Ers>gXU@!Z86;s9YmhLZ=vj83Vq?B6WYM z)TZy6_pSs-ha}Hq+C1ZV20j0!$c&ZU5UpV0C#J1Dxauh>Xm}mh7^3%crDT>7i&piA zYEyH)HhTOsZ^%;;G;m*WiVR?tVwD{hF>TS&7Z=KjoC$iUwz0lEN;BEO;W<-uQA6wJ zsx7lJeHOq%?UqDR~t)|3BY>!x?)L0sm%NuE0i0(7MDp%4Ra8yaKUCsUX9#+hd1 zccR}<6J0@#>gn*S4B_qGgNvuoRx>no!=RQ zcw?enhzExj;x=h{_oi*h;EU@dnx&tc@_C@ z%jL^%D_Tb?E3!`%-Hi^g7D#6k!J?azeTFzKlIn8sn?wk+-J)~EhS3SX#8?h75HH&! z+>yA`&OS|?691cZT^XW1&VUY(m!9NMNV;)b2^VQ;R^p=$~qirn06Y%V#*n!OHK5q21|mAHgWlF+<#Y+H;8A(&MjAt3Ej^{`y0#ZYryxl zDZB5|nADuLFMge!BqZyp+WAhtZuAEG2HqXP%&E5ph))U&mj8q1WfQR6=yoV z8qu}n*%LPe@I~u=a9{L#%#zZ`U=P-5sEqG2jj<$TDTEfSV zP6N*&_0;)%L-Grv<}p$-l3_8^R?PVqn2@xGpWQ>-l9bhnKCu>WU_k=8qQ~ax=~&)X zbWt2yKP09xwsSE_*D2y;kgnvw&pu1^bbP3TTdGYugiT7E%F=;CJ9w^gEqGMwXq`vZjWe5z#Q@T zNmh?P2w_?D@tG?u@Q8)VA>=WT$y}l1%5hS}*{wtu%is=2cSXX{ot@6n{h)ZqRF^o> z0x8Qe!0ObgS_#x-z>8@^b`3d~$xM1+IzHqg<%o58ox8n|L1$S5q0VT32(h~}Dk;Ot z(*TPCnJlywvqzUQxnc#*#u%8hC#&8nS$arx(dF34z-U=j!$58Q_!UbeL3OtG#Vtt} zRb_=c4+IHgP$jDFoIf?hD`a6IC^}Y^L5V7Bz|F5~&}KgT(2GQGGqaoxHgQuH;CrNh z(C3C;WLIXH<%Pv5VAGTU2$n}{iAMU@LuH4h3Wg)?o&C37!t?(AzZ{Vtb~E`s@$IPO zl%)>C*40*3mJiZiTCkGaMPz2BKQ8myfM}2E&r~s6dwtm}vn5O}aa>v)OnS>t^NAOG zZ*3(yShkOo_RkcW z{!64!Ae@h~`;nkO91QqF?h)%(Zce5TWQsOLWIKK0h4Eyv5vb&^s}Ki9eKXwU=}N!# z3i?C&H1+In4iw7QpmhXUuQ>eS{=0c(yi>|`|L1-+;#K~|cxTnLQSZ|)8NL0%K(D?u z(wx<|ckmu`iOxEHO34eF(#a+u0!0`C#?OeMn{lw_YQ;t5*i;)Scjc;7aeWC z9z3#rBrQH8=r8dFf;8jAnA^Q<9-!o?*e zuxZSH^1#b#Blv+{`E<(zvw0(-Qkbz|rp|Rg`Q#FfK%#!3w;p`u?jsDjus;Zh_`-N? z#;22S%q9WDP9Ai2LY6K4Ub5n%|DmfRkNK)&Bs5YA^TAoCLx-Q1urz=!z3tGB<)hbG_Y z>;8J~j;;JdI8f-v6>zU!wErKB3Z+H*JL{Is-^uTk7F}Ib+^5Jr_t3f*T-lm9F_Lt1 z>_f0_$6F?P#KFlz^gLIJb|~Ua8qWSVUuC~jX4V;wl)}%ivT2*`gz{7GpNaq3xQn78 z(1N-e=s{Gr3baq#GvrAHV1|E!gwBS-?!sfBSw#QTKqc>Rm*`N4Qy~jAY(DKwLEE$SFgGueCiqJeB$U$~_s7y$a@m9hbIUBe6w-6NW8wMIm(r`U3TAsxf#}qq z|A&jv51|m+gGcs_m)y|VUSl7lfIciF4aIYgI6;k8%^C}=ikPIbOk1^ONxi|ay)~kn zoSwhRQ7_r?v{#@2H$7753+LoVa)JT;5%4jdX2{>*wsG&>JH9uOK=lheH;eY+7to`k zVtBaxVfT`IZYg3MOu8=bbwYF8Ou}h14y11_9)%p~!rB|6zKRM^5+hau{>n1>i}vZ# zH+S;=l>r4kMSB&%pxtxV>MDX)cBi*|tv<=qe}|;e4hjmf%TJ%5md$T;AG93qxgw(ub_mF@fYg?^@7*Dvb>Y)9ACUvzgj#Bl z9&!PDu_W2IHf=NmiVUc#?FY+fQz&xy<45mk3Po&_Cqa>xJ%#7sfuSwy3^Wdt{vb{_ zhCe2M;GP&C8~@Qq!8X}FHskPSa{#jN)AyBi z+O01Q7feD}jRUQ1q~H&2`d9Zz&m36^y+0Lg*pucFolUt$dC}m(_mzf=-3#XZucwn} zSLiD$^%c0+Fa7*V?=MAL1d<|@q?_nsepedu<&pe@m*H z-gfw_c`gPut(=7kxmb1#^7_2L6J3q12BWb$gat%BKP6fnYpiO}?z>}YHUr+-&trV< zJ=g)(9mcD$x}FWg9JrbFqIdykpfwzH93%5F@eW=FzSBDA;sB8wL_Ty7}SzPT<{ip;u0Vo6>?y&%82gJxPQa-f1pzj#|2% z4f;*^6ccznKNFXmSFFe%?o%ARI?@Y0?fO7$i1akUD{6)QrgE{^}Qp<~jx&9!o z;c4PTUoR5;ateH*P$0+n$i3y*_5kFcld}Ez%AffB;K4_y%cva7mC5cQG>U&nc1fJf z+!ShJ@rY-WP1*_hS*?u27PfEO5L{PCrROdIkqrSoyPaqg0k)bH{zCC%xP}^TtgXMk zX{2OT*p5hXek4*=5>DScyB)}voWv|J;`xK<4x>?x?AmCwt&eHD9#}b9DhSSD9|@xY zJ82}eNUN!+tHovZK(RIUly#eBk%b}?mh(z%$h*@#Vwc!LD~ z%%lnxBGu^_eJJypVx1{YfGA(lSRSqCD5$yy4oOBtz`fi5M0W{(b@Pq-C`D7NH*Ws= zOTKNy72{-mHgq}pbC}wtzTHgx9B=nuMR#>f&@W&F)Pv`2=7XH#q9WOtGGa!@;ohDk z+!T~l0s|Y^FZ8iMj{DBf51obZo=)n4;>EiTe*7rg32Z)d*3pt8M7r0MuB}z;Ro-&L zr$GN9>4j}G>eQHaB1rbCrHkkwFD>NX z*;8L?Bym{9q#c+$<8cxZx)k~SxuJ+J90vP_+1R~e)B`iw6ihZ;vem2luFlKTK9XX8R0zUo|B2N~%#Hk58v|Lfo)uLOC5?0{p zf;W)_W;meV+=i$Nidbk4EBo* z<60hg_weULu~H>RB^#KNTzaWdt5 z6Ph@aE=m!M_Ai6clMhOJ`tw7aP0&^fsE(YJ*`0+zw@DSC39Pd-OXh3IbaB>+;gqaV zQb|;uvdmF@dHrKoGS6haxCl19Sb2opwAyn!9`rK2oHKxu9Yaa1oU%glIdJnV;i2*L zEICPQwD;D`MRYDn;(Ba*ypGSY?G7w}EqK^I#g=MAR=q|ewasUvos(kV#*HL~Xbz?W0ecU%56Lgl*lKOcf5;$1egaAc@xRY z!LPwUZv=^8Ci%i!6P8Y+433lZ2O)p3cL1wV77h2hPro>kV@~k9KUhHdRXf*zJy<5M znwMY3o7k=`3oyoIbCRAo>D6*K65?mmGFVVJMN({L!l@%LuOSipoXs6XSqZ7)RVezM z17&x$HgsnjiLeVlNn-Y|O^~sArOUjS2H7V_DP6HRo=Uo6p5<`0n0&Rcbj5~|{?5`> zo|O+~W?k7Vz*t0_7O;&VcIdRYdo97Qvn<@Y_DW#V9v?k+kwvhE@X%Oa1wUi#dTqtn znU^tn?$_X#yCqtIXXXrNzIJV z{MXpyP7){3))Sy44RP^sVRKtjNO&8?1<4L0Cav5$78(&!y+qfVIDsvu%^$Zsk98mC zD4@7G9H*ri$?}2U+q5%X;{3R!Fe#1E#Z8zMIZBq0Ph>qkzHRyACUN!pMMpE1voVH{ zfRjwmswIY#vlS6}9Lh&AgRf^zc6sQJt08E8yL_^XeUi3$yz^S6SZ3V%V@VkM?-J-u z+We~z+|IU5K|Zy+?$cxC$ESG{r%%iHV9mOF(q(vl^dppqYG$&aD#JH8 zg?8Jxk*9zjW@e>*gJpP8H_t1BLUF!ThUpToKRsDG3~A=q4=iG zm6OFLK$oeohEH@s*_pB!`DHlfCZ;_-bZ1dhL(nIIx*!GVqz>`DK%8QaWFg0QbWgo?S<_9+Fgs zg<@y77R$v6_cMjjI+-5MR%_S~beu4~1KKN-#$L}{k`31|rt9w@G)Noq=)3*+A#3=M zrD`gnQB!@PaqHK}P$*XMVOKyDYGV{IqOwJAADzUTYn#uSJ*mc^_^L9|xW`9rk~?QL z-AQjI_1rrMsT4Q?2~E~>PZvE*@*61WeTAyUp{uyy)c$KpZ$;GErrBS+DXv~BtN7um zgLmEP@|-PBwHEA17-ZIGGbd63oAyPOLhXKI$)?v_-b#@H8KnGrp2Jol2M)TNtMyqBUX3OG1d4R; zE8Ii&Z4?x6&A${E74&sKxan0vwQ{UmvV8x>)^THGRF2g*Pw5jW?m;$P`FNB~^aql1 zN^HXnmm!L+@P}1k9hXdeW35~N87Rggw~kf((1J)(8#YiUPC53XQhH{Q6jU5!@~i|N z>6{|2M*2aC;mg~J&T3zJtQ)9+H6Dw?m0*G2_0A&V4IQLm^jvXb^d_XQf}ARUZbZGe zW#jse{2mJkXN&I9o5&!H1RyR~L#ww^4n1znAyNrD$nZxHQ@i;xbtn<29>o?? zT$r|X%%q+esI3eHa-wTY5)nH~dI%`xh{*!514Y;>Sb{y@*L} zA)4St88Zyk5EpJszJCh0ML+@9HuAe~dvC;DoDhbjE~<9qckjRZ3z*%gNJb*2WS=Zf ziX=ylY|>Yf;Y0Sh;%xmvs&nE2lASsakj6nLCq$&w>n9jbQK*;^pNA~GLGaQ~#tRRZ zuK$-nz^SdTE<>F&C8$7>HZ%QtY%7^#ILx;j(6 z&tc!TVs=4fqaoOYt0PIY$}1>Fu{!sRk3QN@VP*(F$%8J9U#1=yd?7Ot>s;PjS|MIt z67d*PC={8}^E%R@Rtfi+X;XkgJY?V|9X|G^Ex7#vYSWMeoOWoi^t=E*j6iBYZR=Y* zxQ1Q^(<-N%LhO+P-lSvIwibqibxiLz)1Mm4i#GWC_ov8DGv5W;xr%F#33pt?YfM|S z@febcNYE~IR2g(AryMDW`M4vOGh8lca;0*oL3{>TPM~ES_!={c51-ib zfkjrwj4T2#zkj>@l|*!JP_$t|&XyFR1VspJ`M9XQU`~Et_r!H`ds2q3a?-fRY+j5M z-fkk(BEh*Qt-SjyS>+L#S;p2)`o@t~#tQj&T9fzJMuZUXg)(sB?o$G^SXI?A)%!Q| z^U^wa;^IGVp-aV+Cb<>fQ3821$ns#-9)&AeREbd~QjjK<*Y(C*A5`)sP7y4i58*@P zx%yn5u9R<@@T4;RaCDWjzUCBk#M+w8kE&~GcKZtZTVZ8yub1*A$rEeD*Ugz?LCp6~NN^(v1+?Yj4!1 zJpR$O>B6$mTuLAQS{Bqvz$jMvu(cW-f{~7^P1-Z+UU^$s>vM1du}`*_=*%U9;Gbw9 zo)puDj=S^kyv%bQFL8*9429GOG7AGMv-@e;dz&P%ll`}N+wP(z$1Uo(cC+j|K$Z@i z0HW4TH<@-JvbGU~$vOS3YN8YwSRtIPz7W(sKPA+^v+wN>ImaHg2xK7y_xjy0{{Hvg z*)Gx5GK0iY1gAqq)$7Gt$CsHK%xLYhz&Yad#P@6=p4%3_>&3t)7Y6czmD&tOYQORPbDHJatV(XY zKbMNF+3p+5o7P*wDlyKNXS6<$cPim$d5cV{Of%TfJ}$J5N+sA)o4;kpucb;Gkz;oH zu4oN^xYJWb)~IK<%%95zSe024l!~QvBZreXk~fkfDH8!3 z3Drx#nmGb#ASgav+^d)S#dq3x+KX0*BH!H&86%y^vJ?sB_)vwKs!gmvyf2?o*;udq zOJ5;lF|Elv14UqrEjt)xev*KvDbh0alleiJW#(ED!$SQfU-jhM`F=$s%Fn@JsjYh8 zDWoQm{^Bfl=c<>bpo45^Xt$7Ksralm^8F9H;&bU4PauB!G`fnczVeREupB9!ttZ#9 z;-PbVIhk-(#Y3e*m!dYVbZ%B4I9b-TjA>(ztez_O=v*pQ&kx5y@QrfKS<1VXTSnPY zR2qyx^sO(it*)-b-pOA5+L$|TF!t^N3R1;`nD*J`jTf1YH$W>Q+M6*rWC4J z?u5`~EhcI$f6G!R3072?sy@;W0vu_?BW65M&Ipx4u;MSWM{nguaFX?8~hMfb)!oH6MJ7G|v-n)Vpg?#Rq? zt}sxlzO&ptmS(+w61ZIM zG@x0kGsiem&yH|P9#XhtO&ua_Fb+YOLM1z4YEW^q!DYy5M1L6J3kV27I7uauOr*&3 z0;OAO?u!e43&c?M{V9?!>3iNwp#|%FCzcDc)eyB!;1+FZ)R^|@tl?R7SH1IFAu7}O zg!mqRki=_$WdieazIw)p^q(IT1MDZxGBy`e##PH*)UAIBfTrp!$ru_N6xb$Wa69ik zWbHK0#1ba(3-~zkyB-?w=&gsnO|SrCn3l>l2#Yg~F=NnL>5s4~dZlkZg$m8vO;9#q z{5jt;DhlXQ4J`{;{Wl;TOdmc0w%$3YUT{nTZMQD%io1@CJr3eVJARMm*gY+`TkV*7O(%+czGXGDk zgwJlT7LYO6fRsdzV8hWFkYV7ZX+%{m)pTh2bMLd}BqREJ{9LNc$)MRp4$Qxr`Tr9P zEK~p^8B0&IAbz|>MYkI>TQ`uA0}+kCtf=W6|IU^Xn`~+o4*03<)VF%&IS^MEL#mE&T_aF(k*Kvq0R%=(H(3C&FMT~9qtDuHI1Pt zLJMm0|LugE_KOQ1(>Cp0E;U1Dub|ju`9v>{ScSH5whIcgcWarn3F0&goheDZDx%;Xcy56s>jSU38ke(??WilQh87LXq)zv?eXRp|XFaZ2zeT_cx^xGFx*bpiHOxqRe4^UAgH-p1FP% zH|@&IN|C>xWG#6Z#c(Y%<+hREW~+@!^eQIS4#bu0r%qHezE&O?1#Fv6pp=HpZYc_4 zYtG_b+KQ|biAQ1u139k{97sJFp>eJqgH&Qz))W&(#AH+@dTSG(oFW6^_(&*_s%%hI zZCQnkteNuol(F(d25XM!0`oAwHDeu~dtx|u#!1WP!6$*>j(RjM92C(V8bE+@ZPyET zQmda%oCnX`!B{?rAnOa3fmxO{a)rUTRq<&gP9ie~lR(aaEHx`*Fv+k#C=&HlN0DK4 z(ngGaxALk=F87HZQ0)GqI+=S%zo~Tn7P1;iRF&?rM`!Q7f{~cf=%=DB*R0ou&zvCL z6wbxqx!Ap|umDGZXJA7EN>xw+e8Wib#+MuZL}O>S-j~-#dQmPECt6-qMvZb%W9`5# zN4Z9FTY9^-j0Lh$9QLSy_`z$0{*H3>6XxuDL0%;m-)*zs9QTai#cWYVIiE zS&cM2c3rK$ZS{|_xK!4v0Q&4w5K=4~L*WlhYaEtdz}<)kvfIyCHat1bnMFHu$vO?V zujZOKU5ie7@xck*_%Jvm2pwq5ci5jd{)}4} z1s*uu$AQ*zwT4?=;u6Fj!N*r!U0Xwdi$#_zs)>EOiDcyV1*q`xbX=%mYfDa@Q$ z7rENGG&NHI{@QZSmDQ5N=q*26uD{N)iM0du^b4MSfjHklMZ}w@ywa?@(={}mb!6f* z@m9ZQ?4vV(rmMy5P`^#i7P~BQDM?n%xg>Fs1*t83%%cs=V|~zqY`ibRFaD1aEM*{i zlS*83f~6cr{SVaQS|V7=fQChpXaO~jB8QBj9R#N4L=G8a{h*|zyW!L{c4j#M(&TD& zu7oDL3%-?<)j6!i7^S7mY}?xjcX49_2xvVL{AJl{k6(EDmBr8VXwV- zF7rxf!f%gbLWncP3ZZZur9?>CDyB_ayyXevxou^-?uFtM>q~kC@c!uQ)L0+YzFa!; zS@|~W8W)OFWmS0!AF+PNWE(ARU)~bsu~{0tLY$NQ?f6-??;g2A&cb#&%B17k>@-WP zQ6>^Y{)%cVKHB~J-}3})zWXH=fRoY1+B466+a+D_u;PehIf~3PfDA+^hwQA~{ouPD zcnTI6FF>DY%L*b0oZ%*`18ZX_68ib{?HpXDa@zn*+spN;&CCt8RVdn_J-`3%+vGOc zEO@>++4gpN7^In;_zCId4+OhgIEWD|~lmW!8We6OkVO{st?wmaCcX*0KdGbU%+0{!sde@9;gfy917dt8;@$2QTXA+BS%54g7 z#-EVH!azfxJ~NJR-PAR|eV6tZ=Z@?;f+`K3SB;hIr}fI%GSPIKfyiu|QW`$im3F2dNy1=VhuS)@lKq zq^qF9VtsE-USFcjhoX!Z~8^T6>u&A6gT1zN_+a;CC-Z5UouvJiq(k$ z`I%Yy>5`3PW9lY9VgsH?@&-?tSc~FDQ{pVc*@9bovbmToj^;A?PhFF(tnltYuSDK^HXR78rH!Ou z>D!0Xp`ZL6)>e9;9r?$u3y3nyb(e^f?9WXo-2K9{TthH3%Q?E=Hs^PR1Tnez-Mz(l zh?7+_g%Dqfa{K!B&?it|KJ2LUL>sy45m~-fE+;6oxHrrl&KRR9=ER{1wU+VX95JOt&2VoO?^xaTXO5;InHMENMVggwql7i%>cv82!LfU$a0)H1Eb~F>*tJE7g^6UQcgc>@6Memd)dob zt`;X)ADfGRXzff270Apw+mVA>W=k8-o3X29s7b-Q3RI(Auf87?G^?b)wH+^gaEW;y zSBcL2v$=s!)_t>3l1=A`2_E_TSo=f-FUhqluRWKNDJ-kO$_>E=R(W_&As(h^&T|K08rPmp}-jo$FyF|EWY zHn^yOHvM#aiyp>S;nwB4E9Nc-&wgQ~JW}T%1AUun;8=@n5kW4ET!=_kw|`*Sa#eUM zJ<-nu06UN^LwTpQ5?%!mn6}|Lp#G?`AU1VP)8TTSIEiiF>V=3|$x{1t3~61F6(x+G0)x3b!6pA3&jc6 zrzQlZPT%~L#3bk9xmFOQz42zyw^6OgiU^@m>41r+4x@REDjsJ!aJ^KnTvH!$O5!`_ zM(;Vaxq^?{xh6uw^l5LlB~N*1YjLg>8cDi&>1TeCI8EPj(oSC5?5Q8Iw@GfKN}QYW zbrV<*&e-t}i51RvNCmAV%agN#Kh>2r42)?Xu6`?v_>**or6GJAFEp73IZ`O{GIJad zuPRPCOCU#kU1UHsaZ;Dn|1I>HG+@|_>$i$JF<7>$V^@;G)$(Ms&0^-d*GKzy*OXuI z^=h)9Z`zlt8C!Ut&DL~Uh}UGku5SW16OO27u|m7~*r>M%ua(6BHWTxqiT(2yf63*t zGqaq-HH?W`Vmr-}98jQBN)B;0Eq%vl3U|CcOWV9`t1!167AMEQVQzlj zJ`g2r;TzVaRtN|vmmdQd|7?Qt+sVV{N>DnRs*|lX=CCj9A#G5nxIE3mwvSqgD;<|J z01-sVHqcyPr$Nt}M4ibl@muMmG*88LZtB?Lj?8{y8=s#})vPnK0*>-vFzU2x29pjB ziHgRFr8tf_PUMB<22K%Rm{j6@6)1kwP#HTOE&e>ADc!ux7)96O@BjR{OHGo{PxN$p z)5PbouPv%&=r~Ku$=58gwiz(EUsnd?cs~$BMw2+)3<$yCb1Gwr#7EPHuiw3YA7{bw zZkye$lxOPfFc_v=7bFzy_H7*!|GtLx#n3Vv^F~@NZ@SYst;u(@LD3 zeDiTm7L@R{S^0EN%Z|yr)>s6?{}!hud(9+;pG@AO6r>9rIfdm2)GE^E-Yp3mbmfrx zq%-HzF(h5#=-$h&V5H)DK=0g)u8-|Y@Dzy}6ZP(Zc!zf;2y+fDQa&(h|NX zXE<^)x%{LXMWsdQ@YiE^|G5Yc5}})*bgUmb>+`G40|$wSd%@iK#@n}^-4uziZ>t4J z#4eZcNM1voo(vb*_kB4il9?yeo_plOUM75g3jp%(CRo-DzL|{1nOV*VLG5Rd>(?5Q zJ@LfgW0yEx?hio)$IC*m6Q}jJ$BA%^g1N?_yO-a{YjhUB;^xL`BAa9ad6HSSvy|dwri1dDkD)XFPRs4+LCo|OU1$2rJk@sCz(OIv_dsyb!ha}5El%S z1~gJ_7O^xjHLy{9%G}0Bqt`1hjdLtb+`3dO&3952H|s7-L$_*%dXQ?j{~8@|VJj83 zE>i|>tgSZ!@6Ht`RMewc73Z2maHRTAwKWwnZTt2O4Eg4e%y#wcf6+dDep)t5u^lVTXT1>gjF2TX=C1kftTAcRb>^;_KAySSxUxOZ+$no^{aot(YbPk_4H!N|R>ewgU zZ@i@Zu5K)l8YPwUYOcQQuw5pLJw;cg>T&@xsSSVi*dp%LCog!Z=#lV>x%Zbo*st0% zI(vfSmY(!>@3HTb3P1U!t@J<>wC@`!ruM_xaF*e`N9*H?>V;`R z7zF8&kuaf`n{EF{b)NrD=8dOyCAQgyjZ{1QXWA{EZX+_Glng8+Pb=EK7K`o`(f(zP zRSmKoas;&!sK?LT$6k9(GC61LprdAu*vH?lFKQpmTQW~h=`0}glpz<;F>bpR?W>u6%V>b=XFs3%27z#TrX5}9m=P@fJN zwsf(qnBttUV}PCY18R1xgHw(q_sI1E^#|%CxMqa@n-%t~7FYntYJm-8Mz*vUiCP_u z<)eE8ZCnMrQSxh^?BR=M1QL-B%vrYaxDW}qLPwy-M~_`3kCXI8&+kM>>*BSCr{B$m zq*G~D4v1s)0oK=>P08RoxTu=1btdoOR)|QCkGlbb&9wCU)AnpVOyL45?k^#epSO@N zx*)57=0OPoD!LWb=Dwp!7o;%UBcVZlL-o_5vSbD0h;k!(kc&2P&UUIeqxj%=l%tyy-~KT91QM2NM9t}Ig-m8f;KhgM{hzqh zd+8#2 z;oiD!`S$V^pxHT%-c<6W^9D%W;49PcP1;c6R<6)V=kDM5pLYFqc#J ztI9|n4)o>0sOwM5b8ZL|H=JJ$5GYZD21O?h=r;!4G5MqZ%^Q=$`tiLn=I=xYy`-kL z;Iqfi=iz>u?vC~1nY`&9{e-Z9z}D#{$6o2;CuvS#K!nDnQWrg{g*yQ*wwdznGdWk8 zHpXUtV*I7d)PXvEx&)AYkJDWuI@v%9j??=3=pc>nCJHZEio9pg`n({yrx;7OZ-hXG z3Qw67Nd+m1I;d$+?s;LC<(}jA+q;-De_IWfKQ`qkr&Iw>5zm~Zn?+xPo zrT}ED*8|$F1LD)AZ|=0977_{22n!{8tF#5H2lrvoj2#{%W2$eM(yO<;(nzaEb7n^Ei6uG zj3K!+0;!=E)w-!43#L zZp0TXEDlD(0Z`N*LF4M4+TQ@`w8r2d~x_ za-!(mD{!qp*Bo)f{kPu9RhmkI{=z_Mp?m3Lt5>pWWlZ|ieYfv*dCnI-^GJd>sD?`XIe}i#*CKJ>-TUOtUD0#9({;r~mM?Gn`i%tyH6edy=CgPC z+M_OSrEp(cSEEP)vE9ZP2*Ro6x~?q&#|sw!4%#DuCtMoB$#Fr&P}uzt6;wQzAZ#uu z$p>@3oc(|+yPN15i6=DKr-+jsi#|KmkFy#}tmGlPhtLcwN*qB*u#KebK4)A%?mn0F z!f~x@`=#OaCf*b8U!eEOn-ha5Q`WC43Xlht&Zjd6w85rNL3*UbvUI}pSK$Jts`+9W zB~ZbXnhhb=VZ4J#O5j@y(fgk}H7XaKq|cofZLqAC3$WWMsO}4`fwF;I7ZA9HS`^XI zCN95?iu)>~)4_qrl-zEHp`p=S-qS~2~vCDxQV<4Bz{UjQQb3qnNO8$ z_2WT;a&7&9vYN`jNOHS)`vfyBl)-L&?0ti3cc|fT-R*=?AG1lu`>&>{Nw2JTp9{ep z=H3!%uD(Bn>|3v=_VV%_mYPrAu`ZEmrPMvdi6+_kS5Rm^M(c{bcV)mY$hAG<6PZAU zyY?GYOX6l-Wkfd%Oj!I}A!93}a}$ydt0<0w3Cls~c1uhd!y7G)AmM6{PyDQ&r{SWy zPKHZ|)^3P1!K%%ghuX&H_fSicjONQW5LD_a>LRgn6bsk3Zv5s8DRFUK(*H5Cx8h5% z#I#W>Z$&{`G9lzTs~Snco;0J%Nnqk$A*lQo8(0Q|3psAlWk=gMd+ZXqP8MyF7+zVN z$rW9)>3n^4mA$3W2ca6LmVG|@s$K3P!B`0;$wT!s`q8?$tQT|KUwZ6CwR+X zWv{5?cG31iktMk$kx))?2`QN<4kh@IRC6OxZUZE6;eNSSf3q))@!AK90^tBA zn7MxO=PoF@r$Oj}1QW?AF6tG?Q$?2XS78aP%6|8Y6KB8c@|*_(m+Z9wiwm-}<)cSd zJx1M_d#E=dOBMHqSYmx=?~%=rAt3COgoDP6utUGN@ZhIZLb)p`$9-wt`X<~TKl=XZ zxPK=HNi&DoNOBX3Ghba=66xg&6yW0pPYxZ;W^c?E$n}Ns(}#;UoRQsKcp?e6)=A8W z?}kO~Zj;=`1beuWEU0;w?V_<7&-};ennkU$j2pzpLsRmg?`@cCwWU8rF-b{ph(pm% zUqaE&=B7dZplWx%=|WUzQurmOFyxh}i`19ZpkmRiw{FVczUwVY?IuKKV+qI0Oa(l&4m_m>qN=Pa_Uzv2vdS*=lv;6W9mAfjm0ZLO#rXTF zmt)%P-;BDB*rJimWVr)^u8j}t2o#Psy%#|kzi?oKavABz;%_^y*+xR z%lk-EZc+F&b$*fS{%YLqk1$&`ej@X|}shK34tZ^>Y?xLe&n}O@d z(fa)BcaKlOuDBnAKYeucQ$Eg+eg0tj8uBk z&^nzpM5S*EP!Zi*vU}8c^kFBbx*l0&=c0N84tpaEZZwpHYq23c31=b>4HtTwLU_So z$LwtCVTHxHq(ij;Px);VdKA<&pA4b7?Y$9qu`xJMq<-0d_ZNd*X%P8@lS!~kCaMkW z)-nKYIs*+dZRx#hkpNdyxJ@!7vyuW&DXJ;)OBPW@$~5qS+;#KZyQH4p+}qkh<;0hq zC)!G%2KlcA>^WerWUArT8}- za=$rZix1kZTmL=e5B3h^_(SgJ)^0#|NeCP{S-En)Bi}ys3Hu^))B>K|{{$NX+UHy@ z-`GCo_E|2P8ag`K4;8|tf*D>ze`->o<&V&TBl-@uJuvH33h^?Z7?T}+=jGetzS5_C zee7%hV;@hS|MOLINe1m~8IJ(x5`2(v?!4!HTAu|DMOi-iY~kF|-Qpjq&ql8t_AC3Yiqx)V%zpnKSKQP^y#u)c zU&MFWrI$voyfiO6l1HGKHTAJwY#A}vXnm32nfUeHi`m_i@J>Dr#_voSJJAb&&B+O` zTz#c_W9AZAl+F-Z!W#uYkwbj_^0*9gDkZ#7V$3r0+XpVkEQw>3s4<2-as&vNY?iQk zSsIxq;BtArrr*PI~SkzI8gvKK1$sZ1(DDC@P2o z@#O)T;&c_<;inJhc`g)Z8*l2??1JpXm+zVX)FSdDdX2Z?ZVMOZ6c;4EyYGnyPDi5P z3C63v;hlpX^otN6K{S9eP}Kb=P6U8 zF{Hk$1j_XG{1ru>OPxPRm}35c$x~dO%f$KdQ(%MF_Kg4-33JSO;~?CuKxp-ev{mB9 z`*L%G{t%IeDbFnIZdteShU2;y-0{d?(3bMD_#wkVqTo3Z*|P_3>4eq1^5*n=iN?6; zuGz3=&fq;BaEgxkx!ESlELb!BZZ>6_zXpoI7`}f0HIOQJyUpLj`QRCO`6Z=c_cxmd z3-Z|J`+WuB{76o|Kj&(k<$_})T-2a0PzW3gxsM)rygkM7>LEvNXN%jX32_NvJg%3P)DUmkgdDsujE|4hX{%GmJ>uD_vRG5E@;Pnl;Zyoi` zGcM1M#aY&$BffChmy^%DhC-s$g>rA(Hlx6EL5g=J1ux77U=A;TV> zA{%?=?tk3Jy#xy{lZ@xV9dCApN1%P7;wjJEzUU18TM@NAPu+SE@!CQFKTzb4DEzqN z@VHmmIbd+G`Om)de6CKhj-7}OhrM5CSGNt_w4Ox`MV@fdPdts7h907uPOvP8 z?B4zLusp&m{TalWl43w#N4(KXw_i$ESAVWkp-4$FczXb#TDfELrG!U#gKmGwpHqsU zx4y;;Ry>;j^~|er&42%2Nnh^ER-usfgT=$&1K#7Fr}%)7HW&Xb%LH z6hWELxAW-NZ)Osp`8V^5Oj)$-9T(AHE59}w`-Xkb0%L(l*2m1M#}D3ph($s5#Ng1w z4va72iKL{U^X28wZ}@^+E4GA<53i>>AqNGMdhzSI&MIZWgdm z{iB~mj8Eph`sr6LT>H-Ina;D<47uZM%P08R_+-KUr$OpK8Pz8y7oWZ4WgPNzZ@mjf3^6OoOZtgF@x-A^9A+~Qf9m~*r|I4|133Dj zk}PGM(e0C0Pt?6{32!Q~Y{mFjHj~Tm^d!py>KJ3qd1uQ_4y)I(Wz~VDl@23WF=zf! z_(zk&-9(~UFYT(1A1ho^8Yw`CEW)8kQ;PKdDcN;HByN)@(%7N#UP*Coh?EL?bKSUS zej0y7^rHFBPu#a3`xM;h*W!wjP);NO`UHj)DlG(Si)SQEc7V0Hr8#)2=$(7$g!^jb zYUq1*vO;i4Ch~ptz@`#*iLHoA=_U7kPduE>D~wK{!Yd_Fn(& zQ6xTf6CELELK$ao1Blj&4PA(w;YV~31~M7U?CmMHoJZUgf*dvhS!Km2Xj(85@ed*Q z#=DjeWyK_c&AC5%aKUwS2NIrG`Puph-@1W>XZuTi30o-U9DxBOeptVlzjxN7Oo-w? z$?=odo!@sqH+vNj3+|5im*nF)uM8_=Bu@I+I@{(AbACmk3d(X}l?UDLJ-Q#0KoilW zp^$s*d%I^acx_tz)&*k=iCcz31rgk(Fk%{WSQ1@u^Ady(K*FXc2F%xfy6OvNI~3f& zH%HeBKA!*5g%D0oR1Z{ih9Sj$JaP>V17fLqZd?X-HYsT@g7(cMYv1+ueQ&clB~+TN zFdrKGvBMi!STeNIy>EYWltnH>7hQMcXis9yVP7y0ye~f-F2Mmo*&*R)HJx4ttzo|SLt%z1|L(8BL6_x1ALOEA4?fGvv zz&1|NNWXCOHYJRK6e)cGnJ0x{xBiV3Iu7SE*(sl1vHcCQM=C>QqWzK$@yHC*u>yzwq)f~(=UFNd>0JGf)H1R96rT`bz5z*3nu zclVR>$emOEa`7JSWczBQvmhQ-8#egiXH5gMcV~MTmJ+-XIno;eSvse{?<+DRl3u@k zTOOIva{XZOMB*s0OR*FvoVo5byZ0|Ay4>CJhU^|sPw$#}KMZV$xgsl7Bm^5~q=1MF zV(IgJMN$dmpWTy&Ok7C%>WThqp_KOT`)?VaZu;d;ntB`a9MRXalhpQ=)tRMuLOy8D!)EhTH>+<|WTo@?g z=&Oj;utB0!B)4youMpI`Pr#p-PoorMyI+{R0%|q@#M`3r3X1#E;*F&}xOW5WZ;+r1 z0--Q33Ipdxt|^5@7z#y>A7FZB;r0{Bo=_MFg(!4@w~eu&s``s^`no?q`T!#65#d&Z z-AD3^5x^%|M5L%V9P#0!JSZXVVY9x3-3M`N#%nngIe>&OM3~9I1oz$#_QLLXF)OHQ zES+pe@_iu;C<7T-Xz2xGgM0kGV}1gjF{trA4c!X?db#cwHZOo(m_*v-Zz26m7dO}J zyRU)p#dwiM34(;uIX?R0A*l9X1N37Klx(oof{34VG50GEEzOdT2nCT25kfXvqy%Or z_wWbjbS7e6;sYzj2cgm&_#|K#cw|^Npv8$n|23tsEs_}?_AmtbL5V90yNAB8hwXd@ zMk`xLHcal}e6|fKRM+ur^`{39DA`p#p@njc1>nD8>7o*neaXmD=p!_wAU-IF5u8sk z=67#=Wh(eNlu0^fXom(U!6$(Buqo&oyL;=1qkkuqCYNCjunVhKFA-OsdfQ}NJ20Tq zB1D+v$UbtLAZY0W>hTtKRqRW2O7L2S&UQn4LxK& z-5Ta;B=N2RPYvvM3|rl4c55#yL_r<0<%PJHnx zl#<8@M*Bw*f>$0TR-Yu91UYR8j+3v*>-osjL%AKJ%tJ)^Lw;TlC-Kyy%Q&5130}CE zva*ym?jK+LH@2CoIs$kQ|jZ)^)J{z(84!K{h}fp+!Omi31L>x;z0^&KcSIP(LV0`C(XOLQA`g0nPOkOD;`Q z83otTk-e*)MJUUz>a-iV^emE32t6TOJzZusdpGsZNkF?VDpCbz-Fas+G7n)nIjXRfFWNjDeuzm1;>Ne(iV=8%ZQGgBgQ%udpbb5DM*S;8B;9!YZsZlS7uL=~wg4JcY)Ut6zD z|7<}wmcL2R%sxk)6>0h-?_3w0l+K7w6w^bGf^%*5?;#GTom9XMwP@^VSia43} zy4E&j_g&OuC{>X?WmIR)lFK~C3DRsM(z~XOKZddI?7i+e-vh7EJNxBbHO0AsL6_Ov#4T zoV?B|xbZHmrOJkSpc6aQD2G*l@Te@#VQ zZDmb^#7EiNL;ua7TfIbAy-rG0y&u!&k6WJC1hI~r!<%~YT$EHTANajZj#kybkeH#C zW$U>Gn*fRy`TO@r!83@Q`ZJSb!J_7lYx5P;)@(cmA3brb|7pT5emrv~tVR{xy;5Z8 zD~V}`*YAV$OiOUK|LD8%9%v=5Ier*8tp`R{2fZH8d_eAJ=y1#|NIx+kui z+ml11Wnnn?n9Yk3@=o!ss#2UDQRZIw&ezvbs+FbWnS0X8yT5X=&DFYXb{Ei2`9HKe z?^YLls7ymZ6${GxMNLrv^@OVE2Wu*~cF&>DW!X{|2#Q5JekG=T`}FD$~REbv3QcqZ;cd>O(>O_>Gtz~OD|4g*2tA*8TkhW;!5@LUuDSG_L zg-C&w5+%7hGa1O`5Z-HavL~f7DlE_aE^zGuGIX`cp}zI~$;K8n$R6rMQV-H{%Oh>< z18X0lqsZ{~7pKazE#-chvEHhim(KHkP7Wtk-EGY91%GH_2XYi?6Ql-p`nSYr&y{9L zUo2KzUdcxJxGSL!0Bsy}!k{*;Z5_G(Am0$_5>2>_jA;(8I5MM~SWVuHdO1;~vckKP zl`^uHT9%cJ${8(Hk9T!xI6seP1L$aTc>-LWiQ_+G8%_Ffk7u8YQQThc6OA#d8V2SJ zjFw+-DknO+rUB*ST^{2YL_mvrqmA5i^fZ!NC0fFucbVlWMF3^)~_8|qrM9%Z@iyd7 z)*gO#kEFSRzvUm}5$rQGnvzQ?iK5YF^b#S4iRE?~KtUdDBt=yYL!l_Q2rydya zsgoll-jHv0yuU%-5a-JHYF>5XYB4PcmH3U%V3R^JHydoSMjtjXDhOBCYxhlFVPRi? z6PM7h#>REzmfQ}^JP`yRuAaU{g1}jJqKVc1gNkLdK!E{U5Dtw+n!Hl~W>8z+ian^wz$Q6+(RIk*pKNo`b;jC>Z5Z}GN7$P?NeB8V=vDm9yvwEYJkqg_SHw)wXVzgYEN7-_%Dl=D zfoWliV0{nkOXKX1cME%66ne>si7m86oPBtG7qKISqgm$B32t#rTV4K&sL z+16v(i||M#@DYxEKMPLXLfO8at3@|O;R`Ftxg|ARgv@v8S5}Tv*;L@R{)S34I~lp^ z5!oD6Dv#upihIR7Cqra{v*82Q9z79pLfL=;AW=|v!7_~p+U8G&j*{H+XO8rT9HufB z#i+k#8C&{(k?2A#Bq|$_HPfI?yzB70%*AD_ViSRp9GvACp~m4^7KcL{qY#xnC^SVO zs%wRFKv1fzAj>Y{E4POT$*iED=mKbRu(jSbVeOZnQxs}u)@5k`R3BAEc5-MVg_Yyf zV*N?Hp%}(_yXG-8JLGdAONTHv4sh%xI&)1~z0X5T8#?aJzw>gO19(DIKN(gLYFZGJ z4I};}y2t9GfxAy|EWONvGWzFnl}m_?HVHhRYFzgCnK(g*tS;Bd^J*$VD%M0eDAjG^N|ngL zSoYL?Z*az7T>j#y>^Yn>S3>Cy7-Id02ll(T2SL)? z$^6>9R!(83@r8`z0}_owVniw8&{gISSkWymR*^!X?I^`DX35Sj`%H0qB-sPwP%UL7 z+0H~q=S6d7P(Fhs`TE24S=lfMC3Db~rUrQxHi{)fy%(-sJXR7I*26rq`PA+e?SL_= zmq1t14$%lmJJ23je%Fm`!J7_KCVcQTq-8?3AfGF|W*CS{45#!NJyTdu#-O@jMW{|; zK5;KwyCA~V6^d;?KeGAF63TK^oilQ552rr#Vs&yWvuv1=eB0UWM4Je@Y}|t#C_&apTL>2h&52##h;B2DkU*xr|02->6?1!n=w=co<0bD@ zc5N7x$8x-$-=IORdBI}Z>;s$8capqr>4E?F;%|tU*6RRhey&%Z1wdIg#F@5c-Z?C&IQs>a*~W7E(n9u6+%ggb z5g$V<(9JSzWK=Q1`suV_npdi`g78Bt(T1#gjhJCu3617horZH%xCAH#mNtEkX~4Qk zO>>|)JI-1{D_|+X)-HGA++(ju<-}Q*wi!p{MmP&V!XgFq;*BBOTx?1*VewBo;3lD! zVh=>+X~A|3h~L@hR+Ok9H)aq!9aYmf&r}P5mj^dk*E6-v!(Kg+L@){cN;+rbAz8&} z5sBx#b;k?KZDIrZEOrLae5AjbQ*I>L$uX2xXxeUc7erJ)x(ZOAM9TOb^Y%U; z?MEuP$QvxHX7=*>wD-xs+gj?kI0b&&9-I(M5u89}WRZG}8nV7HQnoi8_yT2`P*24u zcI7^FWE-l&qClXmZR#HK&bD79l^Cg6TW?g)a(}XXnry-rzYCVS<-*NSg`ZQTf`kE6 zu%Mpq2vN2zdtKY0f0o>gx?sl;;EOcXK`OVlPKGc{zU7m*B}%8V>snwqh)6Ff zCu%r86lnvJ)k4a}i46V-;%>^LWM%t6q@c* zKqIJu(Fz#L^obX4SvFH{GNn4f{9VqX)6|d}NzJX>ZtNBvE+US*WsfG((?2B#(LQ~C zS~epo+eUh)u*W!i#O%<~|57#?wyQYUT)0`t0HMWd%IabRYtcC~4nn)P4H?KslP-Wl zYNR*-vB@M!-E?kcRo^m33ltQg+7Iqq-y4oXS*fiU>6#+QB0yrF<3-6nS)8Qb933GQ zdg+Okq!BxzAk#C#8Z&IgQY}51y~Eztg2r|_Jd3fyyT3IB|5&f9VG5NxH_((qkTiRH zdW+doStWuA>fCP~&4j5YOsR~sK{Zt}1K)KAoaVgnlSIeH8f2lA52PkSF>UI!+ZxD( za-2k&?stzeXJtIwu8d!v9!Mybi(1o}3b_#p7H$ zC}&W4RTQOnI#rYniUB1f<@AI0*xhp%5*1WUmEfMOXjF}f?wmaCcTAj^X+VxbcsByM zsW^Z(^8F9H@-sRuHpAJ5W#@oC5KDCCx85I9bh&MPj?BY5jl+SgFDE1a+&1b4?6Rz1 zB^q5Lx3snzl~0s5{lx7@iNmNJf;E;?6)EWx&>mm&=3&~u!f@;#ZBwNdKJ3YDf93Bu zS`%&AGjq%j5!Y_%%Z_^3B>c#vEo%3m{{V{g(!BdGL*mCtmY7TwZ#3UOICk+a)t$j< z3mi9YSv7-KUnjNnCVQIY!1M8c{lt@=C<_V5Z5xOeEy!?e_@u8SGBkPQ&tOg*uNhxw@55GGVSpqFM6X)&| zU5Eo#9Nd{q7$D&o*#szXAJzC3dwY`u*osrBw~p)3!PxDjS@$lMcZ%g%LKXd)ce6!( zk@6Fp4%6j8KTqI5>5Jr;!!DwIcTRJBhB9I(%ff$)kh{#@qlC|sM8fbsw4~ZzS@f7rmcibpF`i5j(O^snuvdw$J5CVr8r-cwu?Vh&B3vP@OR9A}tr zJJgR;#pbw*qO3NDtTz-(^p%tpkk>AZa&}Z_jw{agb?>=z{I^^W|7yP$3 ziw#fyFO{IPN*&3knEvh1de(>%_sh=Rq&xKP<>G8j!&Qf}=Ni$ug5*$x6=+}oW90da zGpX#O))`DWR$8<|q6Lw8MgKwvf*{OBi08KNBEq96 zBjn%#T-L6CRby3RvU&cyg|D_X+XpoeyT)L+L@m>ZE}O@+dk-$2 z!s#nLnwbnl*&pW4S$wu^*8Aspf!T6io-p#mkQ-LpKSC!F)3#6j>M!g&OV>bU87#MK zP;r0y+l#n!Iai|(wzIaaE4XKmt~?WB1qSHpL9W7xxp zvQq@|Ka+uY9+YK{!Whz_3?W)&4FhA^^k+8vn(`0RN4^-!)eKClR$yuqG$QV(Xq#$U z{nnxn9+xM`BDuxzbR6~nlB6QYB7QxEn}xZ7(99^5@J3v;o4-7uR28<&A~)1{Wng1J zZSmu8{*g&0+h?s$E35ixyOyh`Y-L5+0^?iboG0zyidxP@blKVphm-kEoi=B|^FQH- zY$1gU$9SkGQyiE+;&1#0cTBeKKxI*A-%QxEPR_s~WxBvio4lb8r5qb;YNA!z#CH#U zF5jXMGt$=T>MLvOVJp#Q9-hvA%1-%R=n+bV*V9q!5rGdqzerVL4+y>pdrhTsNsRFD<;TNE^6?Wz$`Ou?~5q%3({t9lS!oos3J23xP3nN zklXtw6!WCnIM7NH-Q(vn>)dANmAK~(X+x9J0??W9!&`=eIMUx-tKYrr!xj8@do+9~ z3I)RM#Y5NkP1hPtJk7i_x_z09hISJ&*#Z^%u-t6ml)`yV1vY*JmfL>-VzZsVctgi! z=A!1Wb@suN&ZuzI)T8WJ$&_EmLtcdy^Q0q~QIT-XZt?UYLS15kB1zqtnpMI7gxX~r zzqks>)CqK|E73Q^lMY~)6XWc($M9?@^@%v`p=VGuYtk*lamBK)W7^_PYOd_W{GC0QMA5?VJcB)`YNK)^)LbUETpibNL zh4d#n*W-}yXAh{8YQ(Qa2EL2@KY8CB7*(0>y%Rvm8_Ez6jwqI6`7FDvV%c)Hr3@sR zwkfE)-@UU#GCpuwVoHe$Vs1 zr_Y(0gt!LpUywQHyybbH_vwX@HLksO-!6os5GC>tIX1ti^s`jVkOehgX2|@mzvu@a zY;05`s_McrkG;S%TaVHX;TZ2sn=$jstB87cmKH__e`Jrx?}gy+hQhfDiS_e0JMk9$ z3lqsL6w+MujTa@@sd<6uGot34aHP3uIN30y$(&+1A)3$Mb3D(H#NEM*FRnQU#ZPVD zpC27X(>eX3>@7Wue#QO$bT4Wz&=I6M!jec6${=_$4-1ldS$&uk@o*MNfeY!9WO5KD zJ-PI#w9V<~aPXnRW*>P_IW;56&=NW9J`Tuf7-hJO5yi=0I(YYKSDOXD6ZS_W2#0@pnrH#TsHDW^kQ!ix_x<5`Jhe zvUuu;H%O_EHKU_N5A%f@>9>w+3tykWrDb8D>1BIb+bCu8xVCP~XF#UJO2KOvsJb9eoJQu4Q4>f*nFwUR6b9X>oARf!U99Q_K9&z#KG~2;RA3 z|GD}g5j2OZVIN~00JVt$=7{-555}J`Q%AR6Dcw~Bw_FWJ9$9)!IPx(tRRJ7WU~=!B zNsV{6`s}XM?S}Xoj+XgM`#auK#gXPtYb37<8{(X{2AiO{uw|0}dWXy`8;>ibC;>fd6LUQ?FeAT&t8LH#q zx!PUELuP+{+4V`a(%4f#X7z7B{gNcvOsHMmYe#T7GxOO!d#+|lC6g|`$^E6NZ^QEK zoJO80Ss|1*z$;Qy6GOWo?bSW6avD^o%*aA%W?Ct9hD)1BJ~v+5Fy&QQ7m2l7`PR9f zw_cnuuPgSa^jlDFSt!vGw-=84pqyV|9rvf=sKgS5T=%t0$6Y1~0qeUSF@aTF*ilGU z3lnLXvEatzF?v_doFeBjKe26g>rE4@d3siEPZLL~7ZPmvs&Q|;Atz@|*Y>V=+t+-1 z-v{ztR($a;qYD;=(zCT>Z!)8PwCStnsBuXVZm)z(|CKl_#25|fENH1ep%U&o^Ak!0 z8<Cyum+kR1{2`V%_dm~9f# zG|+6;99+BcgIB1uRd?HCbf78^es;y(Hzg#lM~l7|y>(L|DbNkA;pDEQ_nYIT0MpsvYM{?bQ zTmq6W;ya#tS4Q9ZBDa272N85oSI}(uW_!W>3g=mM)WO1cJ$}PQd|M6g8NJm62{ew} zTZ_}L+VJ$(bh#AofEQy#b6ry{E*83>EcAi>*8T7-H`0oirZ?l-@GZr0Ob>ud%SM7g^hzHIMAKXW-CN*HnhApbyf*!n3=vyS!~`jVAEg%u=AQMK?#iz~yJ@2=;fu!TV7=$foW|FD~(Vv?~1R}{ve2E)FL z_&iYLcNT9LEw3>Td?Z3lW76r2d(?<_Ma$;zCILM&8ze#T)tXVT{~$e|MOxIPH^MPz z-tyXh8cVsM&k`r74~$B#xS42Dgug&Q;NEL&gqu&BHhJ6M`6Fc==w`l67T>t`{5_kY zU(yOr5=Yclk3ik`8YBWxzz~2&JxR1RFT76kD(SueolhHvQQSA0E@;y?EMpp!HNZc+ zPeLCsDry*pLiHu)FoX+kme#wA9kCYgaA>!JX z*M4ypeo1Zb#NMdZNH&$u=SY^Ybw5p75)Tu0M4Gg1pWJyVc91DsSDh!ate4~3%1yJM zkt$n~&<{puOj==*+sX#~nSF*huBo~)4DTV-ui7{wEWM}s@rMummEp%;H%RC71;;^N z5`m;)KluHNKVx@5rvg?`elCvXcS$IzML@zR@8EZT`&NVpH*^$sE12n1$_>}6xh4Uc zJ@e2v$MCo0hSP6`?}0i)mB`X*mAFkVqXPx?7*$>?3n2&p1jQt}Q5Saj9V&C+f-lbx zK70Fw8>Gxp9x5)ZDh@unVA&Jw+cIBSI{nHW0fb2(Z~S65POS*LMtgeVwXX+sxJ9~# zRP|(%=;O{t74VRim7;qnR~8^o+sWb>$8V~yI=8dD@FHrWI(E^*4cv0v`Ci2ZgM!bl z-+w;UvvochTpWDpgWHbMBcdnHy|7W0=7^Rul0(Qm&Jx&4a=8B~wY;GIwc%28dX3e>VX za8vJ9*`FKDN5fbQAabJUhvg{a&;_OC=c6ep{x;tXZn=JE6*Zhs^i~;~_w-+x zp?fGhO9IIWcJ9gIM3}(I5Q2YXaqdJUn&sStl$SZZMQqtf=BAkPM;DPac@$^ifaWBi zgtBKxN@|sRf;c{$im0%fhaWwYch4dKJ|gZGu5TVO1hDyN+pXUbY^3Q}W|Z>E5_&{< zKz?EyL!TKyp%;TE(f(8mp5w$3iX9RP(uT=s4YB8o#dB+z)t-P9JBfm}H`whG*FJt> z*Pr;M<5086dPxdUG|F8om(7%-i!S* zDTlKWW%KRJQ-|}nNpi?}7P)+7A6I(`2|<_zfvBlDuDx)}702*U{Zkm(<<}*Uu=vA- zo>W2+uIZsPUj2Q6*h$}&{MO-NVz|V$d$;bpJw4dMjSVk>v5`HGy~x#6llg&RZIY{( z#KK`;w;A7=RyZEojPFb_{7mF*bx3I2GATkb$`@>S!P1XxzHZm7#JezxoHa}C3i@+cX`Z;z|Vc;K}?Q=2D`O;AdMDlWyi zAC@#oh9>VN`1hK{*`mq_Y|F!z)#~hM$`2(1vQxo{i~5%x5K3&LwHB$?MQ@hYmE{B~ zFfjm<7cN`yEb>{&)NzV9T8a@qZ{By!qu0CMY(|w5ZeNHuF3>wIf>v zJcY4{F(r&a(HfLIeEa=J&}+iXv-J=trom?koz4d7hK9Bf4_|^#T0EFC=ft&-7S2^V zIn(9}CC$kzu1#IJE0-Bul7Rd~Py_f#Zj%==`!sQE!tH{BNHGghsqZg}^0oo)gzus{ z-$PsXFlcfq)6EYy7IIP#!PEfIXHm95>OCBZhz}`n8pr?ACkv~2$w{nmCrR&&JVfA( zae(93{A;f509$%ge7-({cPE(zL#@Is7+F)ZnwAC6<^Y(HwlZ9c210OfZ+T2;&k`M38@&W69rwKAh8uh5v@a!j>n*Ziq8(Ao4#l`O z{{6K_(?t5X0OH7br%r9!=&VYhYS5waUqTlwKSjpZe!S9d|u=cS{l)kzH$>jR6H z6!B9PdUv=gjHg}w?qb0YSTcqO5eUr}Lt8fYRVqG}$pJC?|A-!CSY?GOrpt3eR5{v` zj><~QE5k+^Qlr8GAdIL0Wx1p`g4-u;`xBW)>F1K1VrZKD^OMi7x|@uSLHeEQp(3td zK3TWni+clTL70Vnxl2a@a@Y?N7;L!&5RPEEEC}V~v&96mUP)<5DEQcVm`C99m5&FX z8N7GaqcfzcN$}%1bp|9wxN>-x7pxrYZigi6SPFOs0bqFPS9caYDk3AJHL}}Xw1yH$ z>7FoKSNW!kx3A|ED6^Mw#~}?3P1>hlJVs})oGH+MYCxnAn!>TSn;yAUrUUZHR*Ifn z>PCgLl0zMFzS@M3SD;@TkxGAUQhJ)Bv5<^m#-|AJl~GbiCgD-JavHkHKYHtq8)>)> z(m4Wby2w0Cyl;SQViTO zj`_ z$bk@!c62J@0mO)kKuZJRBe#5XI@LJgUoI#wgiU$#P20=${}kC3GKDjjHmBq)T^wVr z1Ob@kIfFvs+>0th$b4XJ1B=3Ks&Z77rs1o~$d-;;)1lz{nRCvd^^qe2_WN$ufGQsY zw6%=f>lKtD9lYs_m$tD#q#_R$>hcPLuk7Fbk&J$}T^bh3=$f!tVY?aZlTL6M_|n?Z znXkHuz%27KuJP|CdhtAFiVk6m)Cm|tluls7308&@VF8arH$`8GuwNz#`9unE$0D)n z;piY;O}9jQapQyb3J4xq$dJ>NF_G4e9eQ!}TcQR>h?k7cU7id1P4@FK{ZB z?S;*sKG2_E-~;v=P>9R}Or2P+@2=$%7M+cxSVTrO zjI5;yE*t=d&DCiy-zWzleyCrM`cj1|akyIeLWThZh$P0%HgTuUI~&6s#uGSZye{?6$Sv2J}iur8b}tTdZ?QrRAlA z3n`q7gMf(wiy-V%@fIpWtIgUlSJvQSnv|fa!3Cmosd^dG zd$#TDz|Xn5>`$@}7a4^m!P(hVPqw5Ke*Ti+gG)Xvf)TY>sd~$SD*L`$^ji-6g#gR4 zw6PrhESO=dv9jvn#5v>S@nH51$#m(;%c;YoEE31kxO$>j5P`x4s;3&6lsOIEmWsk4 z2X5g~7=P%ZF-=a$X?X$07be%xKj|QjadhngC2*!mkph=iQN~J7K31-;RU`S7Ni(xp zOEB0@Bh~3>YCvNjZR(=SxGka-_>@cd`mK z?#VBR49$~)YHZ=5T*jo6aOGt8AQr4hV~aK?2ElrbV+g0Y$8Ve!wAA zG;$y7woOZ6yQE|FuhHzBu-q8Rd9G}qfZf7fn40Ypzx4!*o}M0y8O3&DAEw}M%gDY! z^kj!iO%w+RWJa!N9h|dwO@68?QxpGoZ_dqD!J(Be#~4UMw6KnpUX#@3kd;?dT9qG$ zR*EY4U)(n99~8rA`z;*G9~26%nz`x{3f!|lP$8Yc759FTY*N_4IL z64j|Lb>iEnj2&?^2b}a*+b!|Lp|cA%G9+5(c*_jyC%2a$cCwvAB9yawhh@rm4!ts+ zN9IT2vSEbpTNfD>jr~Gy4Y)zpID^35wRJhCJZ23ToF;Di%~Zsb5YYkZ&=fWjE5&i& zRp_5(h~K8SAD>zLL;cW8k@!`ZbTwJ#SbJp4H7KS-B$vrDAk?F2I0S>?4RtjNE^%%8 zym!cpku@Ot{lKNtm{EdBFGs~LtaGrrOjxLF$$;fmMWHb1PPv6eg_Tr}jAK)i1}-xq z$tY7cC%E9CFY6$R4hrh7Jy49fvJ^JfHH?y=M8*M3=O%o$CqBOA6u>@13je2p&r@au zk`w3)TUp*XvI{0Za_jMUx05`lUqbJ-zl_XY*e*ckhD72~ScB}dEWhn>ZgH7mzP`39EEYUj8uc@vXOGr zHb#)>hIEsy<6lu(%6#qM#UM9iU34T0ZLMB9K96rC>q{qyKFr4`YErd~lAg1;_RuG9 zquDum7cUlBG;f(4-DxE~4o%87Imf$q&Xac}em-R$ECt@w}v$h(7KahDKvVz^O(++@Yq9 z(yqO1%^&&B@`$v0*Bknmhq(`q1zW!W2w$~?kK)gwt0V#(Esp4kxpzEhas z>;+9tjnZu`EwPe8cut@7q(WDieA;#b7T}A?Vit`_3-(2#tBM7N%^AOIpMUiY?ANq< z|E{{O!@%lQ%9AlPhsItkG^YiEG;2lQ-KtPW+aD&Qm>uoe zRd-RJ8x>ibs5W9JSt=tevSB?$h1y!mSC`3lDAKW-9qBDQy>g6GM8haGOy;}=t#bGHE5s{~H?YVj1oXP_5`DqHki6*dan}jF@ zW)1Ly-Fi)3O7oJ+&!7lqDKN99zkk^(8Qx5!2T>he)I(WQ>d8+({0mNAiubI!*}i3V zYkyszhQ_+yC8;ZxT_z4wcj@WN4vb=i@-N)wJB+$Qyj;|4BSWP2#b@X)N(7*vFM!Fg zDTQC4co+K0ygr*&e6&M;p0)`C^h526#x+n}S*W|IJa)*_yt<|DY`%rY&t#!k|AXkN zGW4an)tT3*lJpTigoaX-ZHYjHit;?fU{{0@>N9!&&g1zONl5Y?p-K2G?7QM{Ugtve z--u&VfEC__uJKqkC9I6v0WE^u8Sb%f+{ElH(sGg7mYroPYsh zf!dAl%=kIaQJ=yzR?>p=b;81JEaNMt*NSse0Wsl+B!@bUnM^ahK0r$YoDvYHc;_ku zHk%F-*xn@t%0@%3=%v-DT@OTwYwv#bB*i^v4LGj_+fO`l$QV^0+ew_6?t09x&~T-% z!HKFH8ZL(4fjAMb6(#xhzW&B}ywIw)TPT}0p*}`N#O9%_FG$DKCi{>^wuyvbBOT(3}}D+< zKm`@=yy|fNjg%5SCNfGJp~iNxyWrV4*BMzym589I2+mmd+)xUaK$?C9n-+riz4PJw zT;LidkWm{f_~ed{H&U%*A^#5NAl!M~#`o^v`o~a^%PZA~pTF^RF6)gAjqIw&dh`Q_ zyVZFT#N2{1z!)47sW+RCk*=m~zI9PA>_xSBs}Wu44a-!wcdtrzouw?aizF^vH=RYx3 z*4%6fw|1{LBquMWa9l++5isPMkxBHf<+uKxm&I*-q=Q)D7t&Wl-oVFl8&kil8Oc*K|SV}p| zu*97oB7?OvcfO#qvJ9DdrRNuhg5TaX4n^frVS;~Dq2seQZKinHO#Y3ki3j&>T!Dfe z6xUJ~oRdxOmxl(yvV>vsL%}UyeR&eiQBhJDTtBuG`Hm`!D#GXGoP~h*l0l(zBs(L@ zb^qN55N3pECaRAI0W~;n`?Mg(MGhQDf6iZZ^9I>c*?nDDk8|7*7FV6v%s)Aig#(G4 zKXE8IkLN%c_F4I02?w|)I$QmQ4v8ejHb85ZJiNHiVdv97zFXoxlfkzFs6t}9Hym;7 z2r6@81J^$}#885|oh3TO1iy2*@&6O2dl``XR7~PX5%;ox=G8N&|I8xF&}}&+8kC+% z_RDM6_T;AoceXL`SFB0dU(_EAplXf7Xv%ECY2Tn+B*{6oYv1{r3Itj~S$xc9c^*FI z^OE>=dw~{QsPbdaI%7a^%;v3#K1K@3pwiMo@LiRM@^Z=$Ri1-j!3V#TMin_VOR@~I zD>7W+U8CGGGKt6J?$I_(;T#QXxg#P7$o^=G$|s=ZdPQmGFW7R!(4izoT)+CYBN>)# z?8C^EZ=sEOietKEt8LG@H3oe`3iT+!aUlzRc>Q1~* zT0H-U)@#b}tQ^Z#@o%&ceKRhVae|1PX@UJWD#yX}2&#Ui#&DiYA8(#kDscz8|H1q1kbjnuM$3;7!lyXe0&ibv;sYBE#wtiCSA-NEsM0x&L710>1DY;0m0P@g^oR^viyna<6$*tB=ATPucXt)GSmY6w&Q%(s( zcGv1H?|%|N4Xb0_?;wa7g_uyq38`a9FbTeK&wUYkPyQXwE#yuy%mo}VsB^d7HkfzD zq;3V2@d?Kepe&3~af|i=w^y z^{h!!lI3+r_`NuqULk+Hx;om}1RFWEVp+9t{8MzbvIhJviRA5F2M>jqFS-_NCWqKh zOOaE=qI`qp6t~|pJ3^461jb}hX-r9dJu^&EVc1cfqe(1|Yg4vN?!ZF>4ywo%tUgG8 zG;BZGgo#V;BRHte9DWgJELS@s&RCQN9y?uiEc)VCr{RR-(E6Zt6cu^lYIt$&=Bu|o zB&|iKkk_Q4rnwrhhqi$%UAiNzfNC4&-Zqj5igaHTq55^a8r+xR9kwd5LQ&Oree*o` ze$EAkP>%b);EpGQ%snhX*shCTm=?ue+2R*@fP{F) zw*O>NT8?-uKXj0Vp8YU@XHR&d%+wRcaZ$4a=Sk_CI*^&$b)#LO?Y5hs*AKYZ#*2YonL>c;4`}Y^gclH-KCw-{2ZL5*Js7T=fyt;&Nq!$d~Ck;W!;8NPu#kc*ApYX9jek1Z^yFnmJug$)TfC?~eM)R=jzc)GRj&ufm!04!VuNozA~xpC*w{>pG9of7@aISO z-1P|8oG%H5VAw)6df8_;xa5kNvslBnH-tkpOy}~@c?bo;rw1mDuYiF+TTbJk2y50| z(ThErZg{X5WPpI>O3$wO!pVK=D+A)BM1W7kAqn=x!HHS3k6OF+_Duxgu2Mn=r_Ud}zcVKzU5+^J1@)H!Y_HSa^vgn}J~sZdHy zn_a}K1L9X|lf!9j2Zlj2F;+k&+p&502C4b40ffa14{-JMtO5Q~p9F%raEW8iy(w&v zw-MT)XF;R1j~@7j%h@DEGIbrDgUWf^m~PpwW86izQUYtyjpJsecOBKDQ-Z4HgzE$N zc?q@Z8k%czVj~)2RJt7aL~6NlC)2odqeOpDBKk}nb>9H9Y`qEC0(jVaH6`}&DY ziu_{@)iQ`!JJ;tx51-r2yo@^S8Z(1RU)e#NMuRns7|~E~*!7B$n_ClUipcC`2wcVw zsQcYh846|IF$rT3WOqz?eTtN%*kXcQjXu;4z|7q?Uyf@xY#6&-GVlLNBKD-ap#Eji zSdr?lV6HYEs&9&o>U#@vYWyD~p}hmSEqU45e|2gie{O@NC7QYr-WSfhC3i#uKlr>Vx$Hp(!&M8h~!{@>MiYq?;d)EPEOTN zY5lRVA|;EtNf}yIHdKPnQErEYU;&D~7_z96+JS9xZlUGv00r$eQGJFSBpC6Yqwame zimS4Z01>n~HL9OUw1Y5atLCH`bE>M=<-3456`Ksz42v3mG0ssR zrBtTeX6P;^BZY8lC^JL&f%e5aubqzbRA4{Ih1Z~;i!&htn6E6V*6rWDU|xiA-@gm2 zb1N=!)dhjE8O&3CA)u5-1F;c0Wq?3wyV~VX&6lmW+Je?({~$nEEOEUsG9t<8V`anY z8iugfTy+K=Ac7ZDo7!vOE(Yz}JV>xA^Z?fMe-%Qv}K?>f15yZjXp zzyJ$#`9yIHbZa>@$mryC)@J`j97n&hK|(sDy+^nBv6~l4zWOs?k?KzvB;mp7z#&9O zSlbwgbg4^F7TR&fhzk9=LZXJ)ut>epBQXv;iQlqbzhNC!E=-oyA`z<8He$jxlJDE( zp$?9rKO7L6ef5PSP*}z|g?5WN&j!R%j#aDTSjNH+A@qS*NJ5o)3k*(MiF#pmuoxIy zYPVOkTrLyS*ZbjUqpgu%2hi>3MM!&mB#9!b5I%FHnC#+a;2lOG{*IuXJIXi!R75N&cTc`)sefLmYR1?|~_* zo|yI>a!9#0KtaY9O)QU+Zp>BL4neB8$)(6(H*8~aFgpZqA!|QTuxxupM7Lm}DB+Jl zuvqBQg4`l^yOkx}_eK@1xBHWQ(X9PR6K>XIb$v`p1lsGJc|AiCZ?opK)I|;5l;ytS zNIgsiF=LM>i{7>B_3$u~3*l(y7qsPHe#RlNQcgz4<=-WKQF4<=9)w+C4Z#xyGz<@6ANZb?9baXDA6jxa!A227I`pWPQxUfGTs6qeZPsZ%0pdx znyCDt^JwLX`5)A}r{~J9vjcq($}aR&ONBxq79Cf@V`_oNYGMYP7>lTSVmzm&1{xY_ z`f}_8f`z<{tSh@qjNehI$fHp@BT}jzs%0Hd ze*F!5Zm-UML~NVG+r{QIz|g7%AZgNNkG1)t9A;TRuwC`R*!gLiWxY^y?;j=95k0HG z8@d!ZLiLfl!HxBUU}C!@Vn)L`S*G90CfxGO&2nY_Cu-XIy=zMc^?cc!eidi7shtco z(+y-w-v36_=GO7X(MqtpuKFQxsxYshxQsegxrxMQdkE|Wc1Q#otGy(#KDNv2bvYV% zTZ?!36>uvJPN+@&*DIYt)s+jlR-9x!kzCPlb8n8BRL#u5zt6P6|A_;(j(Q}c*vaU! zn`%zV;3zY>2)QheW#WGc13_bV3aK_g0S2N%{k@808W8yrNfyhbVb}{8L(n<|C>Aa~ zd3=n^MnZTCWuza`flke!d>02WT7UI_L~wy0hpc@PN!+0}Qt&ziP<^R%_^VyGoV16) z`mf=da_SUhXt-C5|KCM{9n|Z8J1{0^Pzg?j9{@&WGZOO5G?o8di19B@8AW?Gjsr04 z`Ef(OG#IqMRQo^Tj9MiEOR08*911oL=^Kc9tsT4OucP+D$=ci)3m^g4y*P*IBaP!~ zD^d5>40bT8`6^gZk1=20x?XXSHAZ3#Rz zvN)|5O80Mn@lk1n^e-@DK#3P)fJ(0OhXUA&44DRFK`em_z(A!`a7%+fq*OpABQZCj zmm`fcxb+&U4xTJ6H^JtToI?_3mVi!C0-!x~iT>|EyQ74t$8QSd#_qe~O+pxDu|n#f z^-%4VUiNqAJoxy&U+{MQQ~%5*@Fu-sRsVKJ+v*HX^eBtfA}%9Z*f^-6VOSj%fr2N< z>!@uDd`fbLU_?Te54xlwcCof=&USkO1!eGBPvwcAU_Y&!>X8rQm2+{YcmlEOtM$`I zOLE|!!E0@pjwc~Z>}0`>a?>+7R2kV%myRlkMrxw5?9c^^BG84gL|v;5{g)MX=C zB`^seM-_q8@G(}As)T^b?*3zQZFMQ?1jNwuO3r8Il$(CIG%jMYduFRj;Z27BZ_FR2 zLItz{FJFE8i+6N}QmR@D=Bgzg*|+6Dq*mm??~*oEtLL-9$ko6}iWwdx#E)2fy@boIxXiFTJ%JDdPW|J45` z`WphKqy%wKLZPeT!{r+mQB+RWfb_Hu=fWKLeUKQ}5;U2eA$|(Z%T{2Nhv}m zBSkQ&de7qfPVSs0omEaaNm}d1se?Sdf6Ml4h5HRG*T!9aBPYYBllkmQeT6HJVnGr? z#~y;124vblW(?)Qr!sSZ!P@0mk6mkmvSU8uYK(Hhg8x{x>QJ( zHI(E1P*muF4C+eKR56?y8b@mk08!=PVbpwG222}2fA1`Nq&PjUmSV-}p-!k=jFn!h z>K!e7bqZ>m5amzOd@A|YTF&3!%@98)kj3k4wS5qZN0j>@WWbd7@AiPmQObRjtN`Ve z2T94W)%;1ITTL8)_aX^0|K>Ic_aY@j&#svjOCTm=9jy=?ftpm;z%}DRKsed@(17jN z2LaVr=RNdS#zX&>Ag+a{24^ck1}6#C^G*yi0Fw0|;}WOA6Ouvf%7FN#f*4^Psk4Ua zMt>*A!li3hN;`3`uLv&Tr52qUS}iX-^_k38rWv@pyX%13N`L#4=*RHkIlwkN^3sye zXEZYIobC$?bB)eA7*wQM9f3s(Qj{gzEi+@x5glMY6!zTmgMKx@_WjDpFw>%K+yQ?9 z;2>|uZ$;N8%x7txpWiwGo#cpB`S&%X6}FroAuya`Ipjem4zz@x34e{FnD>F%ud$6S z{jx798B{WA@%@x7bP2;B$-q+yiDZGNZ32%Ue7i451}V2o(!Pn_2a|0QF}1EpN6|OgSjZbiC-%WQo%($Bfe6ePSaQ zvzFAjO7umAYgKL3!@sA#ca`c`>tA%$*r)oKhjoMGI%()IUj4q+i6n=Wj$D!b?*R&` z)sbsZ0!3a+vQ@VfLy~Q_-5|h+vVxa;uWeddHw}sL-*mD_H6_bcRUDa@=n0H?16imJ zN87@}ugMM<4Wf@}rYWd>Gv=^Lq?-PK57%wVWODdZUvg+$q*44d;T8TS1I>koM`Bc7 zOE#t|5n0fTxWNpH6>AGOfA@PXq<*gNT#oPiD`XGK9ydC2Hv*F|(H zD$UC&3a(xMyp9SfT}sOb<&+fu30+c3OM(yIbM?4D_A!vn&2Jn%53XCX_rn1CA@ryy z3*{9KEX+gal~QVzP!Zhm;I7#Lrk`;W82TW@z1v~$ST_~iZd3<>`nhAC-AMJwB;0r) z>!H4$^aYpINbWxSr{XBpQpGY#p^k5DQ$q|sCT-!iiENKjwJ~wo)Z1(}kA{adG&E@k z#_jzz=I$&Tf5N7z-Wl1{I70h!`!;Gs(U}`m=I7@jmX57D;2JokF}fXbM1!vggUx7(0!>BGUiT!`edtfC>1*4&8N z&r#}J*AT9YMq((pD%;J?SuwGhk%0?IA0>_q`@O3FMRcJCcF`Je4|Hh7wdoA-a!Wex z!`-{MVXf+!f_^mg2(1&FquRAI9@uT$N0!K>W08$GsgZ>FroNAB^3;xKrb=$b5yHoM zN}~>q1R@!d;`gps;{sk%+cX^19Mi*K9j7H5?_ddc6#!2hCZ{-fh$~GCX8d6E$Gl`7X5*>rlY0mq47&mzrwPpsgt~ z0u1`$n76YfyJo!8LPxu)Tg`nrZljatCx zYaf4}w$Pz~o3Nd3G83fV4MhM42r??ORyT}5XT_+tAo7NX2ca*KyJan2ntwAcTqZ$BVTca@T zmfc@UwwVQ@mz^UH<5%L^cTX+@g`oy9{#8efbMG(HbqrG5wN6$f#J17AOq)Al%Mlo; z1Eht{>PcMNIB7Kco={i5V?JN?hue;CWn|XFl&v&wV<01?kxZqEB399=SM>c3|%&>LZ>t zpuex6mDe0^YCxaEkja71kB%znK?9?4wmC2hdoOLBP3W6hkWG()n$igtCLGk3?OMS7 zSu+cI($hbSzP6|Cg}rshWBY0QEnitL8vJZ=f_-pU7D1<~DGF&+81XjM7dJN0(HwYd zjS^0eps#Qp>|X&1w?4Oei#(;?^uquBKL90HX;Q8~^e0r1)h-*qoWi{_3;NKT!^Fux zFS>WSZ^8{Pv~H&wO?0{mMrm!aRzyu0K7a9=$#VTi(#t;=$EsBs%MPpXqo~2q$1Qw> zO#PV!ed&V%2&a(y_4|Nkd3nzIMne8s+kNqd$;)IEG%Mj<#wT=-j=42Q=V5)SP5~ys+_t8A15^XFAhy$-lpkjnhb3sr@Z*wvxDEP zeZL>KCjaHRVf?vj)_ZFLdI+b44NlAzH~aeEZ~>?P*I3~nLB6VK5rie z>;RwSUlbg-{OXhNer8o!QE5&-4RPmf&;3*XPxOA1(9b1?RUuo@>EamMPAW^wa|VUN zxffN2D#B(%I?P>FmM>TH%&w21H}w#rsw`Yt8pf}o;QE=;AnIBtNp0dy+UI)jJ?vw#I`JaCQQf+eaJ$ zB4i_3iX`cGW>{C*r={Ono|b<8T|^A3KowelG@bmQLIjPCnYN~C5i|g5Tn6py4R3BE z`kpo5557W(dmu%Fid35)V|>=?xoM+&7X9@O6nCKRh4H@6Fxf*zrm?)Z_WJy5S4zpT z^kCQ5-&nA0M?|br>Cq3ZS;!qOcn5vaE~}gCRR<#*Zf9g!11>t)b-CbRbr@zIiKa=1 z$@l{xsIAv%S!q#W-bG-HFq^RvEnFTNL}s&{A3gF^0CvD$B_WvFDk{UpRYjGB#?!?I z=0w3~vrU^BeM{!Hir}7SS4{|HpN6~##Y2ooVL6wBCDP!#YZp_o-m|mJdSekchJ@(Tj#uEhj0{CVad?W!JS-#AX%KSB7Sr4z-L* zFsYm312nzlvI|vuaakl584=GeRO%t~wPA7X`K|XfvX11R2}m24qd*fRdz>^o>U%oF zfXARQ=ZH~@FSIp_lVDvPL07OwqhYtU@3Qf4(4|*q$drwIxD$`BuFK8L(L|MC5!d#v zTk|vCMUqyak&)3FSxP2aLtDx|Ph?BwmD;)2MbT8TAr{v@SvL_Hee$-Vl-;C0kgxy( z_a&oLEILxrC!`Uv>5`SCw_klqO4zL9|1p7v>fdh355f+O^=Q$>NF3)0A9`R-9gF8| zF!&GA+30np-M{ydQoqm0_!WIqicu56>or0+DU>#)Xg*jSY<; z_e;CtmFtdVFrMm5s#LAwLgSdE%l`s?@)(A~1&*wMEISh{oG zS>KLU?yl}6z4_xmi}ZH<* zI8z$kd`wDgdJBs#@o3#pRdlvSyZ5s()8!_T$Z(E>s=()oH^PRylf;oo&Sa-#q>jr+ zHr0-dvL!XHz4OWS`&ip2e$6Cq(e2#uO`6#BKZ}lhZ?Z)<>)upeR7OfX^y=cA66mM- z!S5Ds+#Vp|r6N=`Fl_vK<+s;AAArX&NFO+^%yr*xdm+HQ)rMi|YMOLOY>4C08inX= zK-1C;=_A|8v9u%4%B2vJ9&0}kc}1Z7>1#Wnp|%6^Im3ow40uRtd{mcmkLr@{p*n}| zUx?&pCFy#u0bjLaMfZBRNy3d}6l!Wf_iSzIqRTi_Uz*8%aFFj>AJL_`J{CoZ6!JdC zwHbF@)&w4tnccds-gI00{zVAeq8&1Kj#K9LuP5k)wyk$LclqojI*{H;A|<>2vPBSG z7#%Qhoh@O8(H{N249Lxn)ATvRUwO_j8M||gNSEqIqlLcE0m_79dkKk7cCF}I(?HHG z!|M3loE z5$7hJ^b+JE?b(WBp$N6u)w; z!*<)VN&0kU8E99}T#h2kgjMNZ$JUWER$T3*-FY;?9i~m)$bo{& z4{sA^GG#1CsfVs4QC3vif@ij*jDdBzWQ>7{zYk+zk*kdv0|{(>5v1kI8Gh^J4E}mP zaK!+BMKzRTX28r9h#e68Jz_!2*aH%FyW1x5;SFbd&QMQA;!M-ekB2M#9&r-ZSrC|V zMn-C3w6BXQCp41f;*AK`h@#_kXVaOz^x21-iC*gnaz4T~f_0kN{{hLEa*ZfF28gfS zwS7trU-)!j+(uV@YbON18974~DQkL25=0TOUes4~uVz25<+xw_(ApsLCeTQ@y{luj z9Db$ko49$k)E<1z+P|(}BrPDU4td*v$oK^x znvzLM(l113C4mf86~)ae>*9mu(&4{6(o#x_3!%Cf zRfGqJ%88jmKj|h8rytG?pAmdw*1O%Uzt0Rl>G*p<@G1PQN5$cYBBWhrA0c{JBZJ!x zM1OUR2sc|^X>l1$thxAm)0E{^|F9r80a(%`Gu4b^PK{ePN?W=A z%_}8}G8d#29P>_&((jVY+0wK9X2$k_^d) z1ynyO2_9KsA^n?UWNY9f!yQ??eLaWBN(ECVwJHbUJ^B0;A>l_@5=>4Ng$7Z$5=k)# zOezUMObUK9>;4lED|QT=9;WpmTv!6*MoC^szE6_WjyE^{jBT~H*{S_Hkw4o#c3vbC zvh8cxm)h((9VrM^`*<5y$mk@~7*2&n3EE?AU0i#5`#bN+OWMmILJ+B%8iq6v?VnRW z3U=+o5l2kfM%u*D_pV|LVa=Y!FdCZ^1=KtGOv-I*YG`b^sFa2Tkc6v3pi4U}UcZ-5 z)w@WG#Tz_0u~e7FQd0^mN%rEF5K#L1M1m>j7AFHNG1?lE4Z&X;P?3_`{3Vh(<1*yR zOc$H_)%~+2C-SFiOcs5Y0qvK^lwxlh07|m|7M&$(BAu3GRc`6?Py$g~;t-n0_9QSF z;*x>jy66FnsgA^IIE%0jdQXk^{QLLaOz5CuExr#yluZFi?<_?{dY0zC8WXZa7Pdt( z!c;7P0x7B^jge|3fstl7vX+#8%FAM>-^9!JU&2NJHesYNb0}klk13-?_K4(p2W*kZ zPY~7NA5&x7vLlcqv0bCT=!du(L}kK*j24kzxa^<4kYj5yWfa8E#L-jbgu{2YFb4I;=4@x0bF93*PkaHNK4H&5A8#xJwG zxI%O{h!e}oi0WSc&6lzuViHH1g$V{dBIey3FJKq3kGY1EEO12Z4nD8q`e_VFXBX}e)rz|J0u<|0xQ#JiJDtJUc zPaIWdA(m&L(-A;vNoSC~29}cZ20~Y&!Tw8hVo3}3)9%(+ZSocAj`oyGfCEsE%!O^0Jc{@z+%Uidt6TEWhJw^`X z)+9rYJ#J&T_xy^AbRc0`~f9s-pUMmGs=`dI(_q!i7)q`a| zlPvS4<>YpsH|K4HS@#rKRV6uta|(-c$iDx;mf0%5XJj#3oZQ%0VnL+kuQ)DIx(@l=2?a}|W2h9F8f@~8pxxi66BZYp{ zp#Hd%gDE;?QiQ(`sQZboM5$M;XafGGph#FNDlb&)vb%Jbc^ys(?T-J$9puzqr` zIC(_mQbfWv!RTrydvat$6@t+I#_N+xd3=WWsX}APfp4BE6-gSk^8E)sljM#AC(z@? zdX)+8q}5A)&OQR_ev#f=}|ID+3~ zGJ2NK)7Z|eDGz@o7ipxO`+USJp783%?mPp>uMQB$`@C#h{$*Dzc}Y${+6$8@>$F%X zOL#ysYc0Jq$))NS22gA&79Ru0Q(F(2%u;%p^^>(&PNOp(xS-2UHS%O2=zM zh5Zb1933Hp)PAdM0Mnk^^AT0GQTTnDI5OcEjDGu`-^%+@MHG-!o$y@?j@r^qH^?i& z*iFkpJVVmu%$Rb;pDh%p$6KutJ=1?60xCecaQ&`wU1 z=p}2KL{DwgP*9@n_$<+mYU7yNpj7xMWZ!NQu@t^XI-ul`B}ULqcPV|gXdM+DSmBWz z{Cl`09XqLt$8;c>^u`>}2OpW`wJxfPxMAOjzb2P{r7|a2-P)Yn1ktjHzxy-T5NudX z>D+vx{#q&LG0peLc|YW#c5}N5ev3ycg|d}hd8P-xuY-+ za$T!yYfyG3QV(D2n&-Cn=f^CuqCR*neN3sQXf8)6roHyX236&Z&FfekzhWEX^4n&N zm2)uH_S{J}iWdq2Xh8` z%+g5*@oAr@t>3x-Sz3DM0=A38tz*3kI5>LkX;-Zq+lOJr_Hh_)8k=K{4e_XU`!}C( z@hWK}r{sAV9%kjOaoM3$L?0Zc49qbPOCG~Rw?C zL@mUI`kDxe1>qR^QzV^zcS8sD@+=g38e zs7WC#ZWl{5xb~4N*2;%maLDVVpz1>UDABDD2qgO|GO;;E^tG()g=K@!MPg`PsG`D1 z4DBvDhc2u{geR4{oU=bj7Wl#v^~2JSZ$#StiQ?$05|xx6$`5-6nZ0+`)PVj3@>I)= z_KqXZwKsS~p+H-nYFT;VV9FxlaR!x^4k`+%HNpPhPaKh7SV0D>u=CMp{~G^tAp2+H zq)-Vz%`MC?EJp<%gmfSy#Mo1*`YO0+&E$1d1L*|ydTCWjGP7dgA z1`shTG0GJ&TUB0GT0!0kR4y1)RGNzkjkFkeI4-;>`03g=8?#RkM;m|(7gSc3RfMTP zP8e^KFQh!Ub>aGvlx3*)AAINShoqIx07ywrWpMVhkib!^F=+f)J}@tQ=C98DWpLYp zm7`E9sgLoXB2+%O5I&Z?(vlLuA-Ll6uX_W0y=AEd&k}bn++U#oT68Q2US~V&;;ip%aXe;UhXTt!yxq1IHt$A@iv?Ph(!zu&WQ?{SdqtoP44BU};63r>D>T?fbOa+vv7ZP8sn)7$qg+M?^t zqO(!F1S4i!;!$y^G6yB+a2pL?=|c}t>GXF4knTCo}PXqja=PSa5nLth%OlTw##>91=rc0s&k0ag~F zeQx&xZt2|aqiq;(}xut{XR+(3Z#_)Ab!}F-5EwNOxsB2>$~o^DDs<2M(7?hHXr5)I<&|NhIvjHu zP-?J>s)|r}VBv-8jo|i4+x`Un=ATP)ijAM2e16s4T)%~0XYHwE5Dy7v^u@gay+CA@ z(S`uInrIBFxvk(Ut9ju96hMU{_Y(((lfo1Xv;___0K6!k85kFIc(k zksXpOgDc=Mxi{dYhfux-)s3KrCQhDZx*l|iU72p(MPJiFbg$&LL4#tA)x766FwOZb zimmVtgBc@;$4bT6fnS{oyBvw*VH3~4=C^o9&m z%PkD3nkgRxO2(j;_dCzX0_N-$K0@@AwcJTsGoADve-f#fb|uj*WSilF>3CpBqf^Vy zrMR2K3)RWa?>bB$dAucde%FXUDxrLSKpZ9aXLMsiI=)RrC=flHTurqoUw`>abBkG0 z@Hg~3M;+D5dPB^~?S}pj&HHLBc+~fOU(u?9x^g02Gujx&4MBx1Li>hhR1uF>Yp<`r zn}a4gNtMEJyN!G7jQ`<#?77{1gCU4Y@;3w>Pqba@A7o2xXBnfOz?RFFavzewCh~;$ zolN8Dnugr>m|EE+0f%Auq3g{?8uOl$C~WP`ZcuSj0NY*HC&A(BLL@`)@-58O5{GNj zv40>#N#7ynxMt0}M9Cx~PCJ!5JH7{P9(N=TB9~EtVC?Jlu&VjqXISwNG ze9^1PBChCYAzLqNm+#x5>L2+R0(A}CX7n{8PIC=SYmPSMQIT4fe$g`sjUG8`9VKhK z+e$wn*rQQf@a}Wxu^h{!n@q#5H}r)8aZ18D{@7ewU5er*F|<%IW`G6fzwvXJx>C^Z z+I@F!Q;s2;K)+CQv3~|}(AF;Ck5yI$8 z@7Ulh^vRmEV`}|;aeBgaql%0TJSd7Ifpc_{(pH)J?!!<#kx!qnU-kxMTUc|`a5N$N z8yDMvcO7*%Mrn_Ia#PR*YEq~hDoe6rHY|nu`j%7sgwtk-%;+2pk(r!F+-1qs!w{Lb z`7uOhZb^`Xy}t<EB3CqZs!jz76e7Nu;bSG3kouk$8}U}0kFW&`lHeu^o;piqw%e7;d z6PiZhyhW;Z>^%OIRInx0j*|_22-3i|sCMiGiOs;$1_Y3*9XrSOA%88ZcI+JSN2Qlh zL0aebYzIOGX`7@{X57QL_QJ;d7E8}ql7h6(AzR6HJ@&2%hY2A^E~8oxFf0#2+);BQ z$K7gQKf7Bd>(h6sXgD)0U$LJlHu9c^qCyTSTX0*V8;5q_h6Pa&P312?Qgj{8z7*LX zFs{wN|2-JLsEDP5{42XxrUk+S`#$N)?|JxW5^Goj`JGjTgCg#TD~-ddP1ftkP*|wJ zA+!gV-J%LEF{MWX_wE()ogDQF;XfLNKZU^)@{yEU2*yB_mu|TAxdAxMUe*ij(1G)$vNSmV(^qTR>uwB4#RKsB ztd*0yP|^KCsQp}yu)%x;yp^6`7z!>}zvcl-a_u6$GH?Keit>YVC%+n|%vTD)Gv566 zu5ll^6kW3L*^nw-jzz7Soyg*E`^yxEBV>x|(y-2voKI0On)`$}P|CUoDfv}P0;T+h zJp_4Gn*>T(@UYRvHeghL7n(J6p%QYWYZh&648juU;w9Q6n-@JIN$yF$Mo#%HMMpMs zCa=@V&ZN{ZL+cc!WzFuxAzKoqWexVDVvcp#9-FWI#iX^ z9+`6WL()8F%1`Q%9!@x-&0Kr1)@)=Rog~5MSTn6&MNb$D_6-uDMYmzZ1+}@6j<(?( zy`dM1QxmKZ%e8?aO{?|I9St(7b~`GmHM)(&Qip8W;)n@fxU(_Z$9ZZ5OL$R?tp}~M z0F%+W4G%hjb0uBj%{LmujXW+J0y$?DNL-dy-O@u1)bQc5tY`Cu_lJ3u+FrK8b_T{%WSz-H1W`fpr+XtIsg8|uMMj%l4?^Gs5mhX}iJ4i~1CWW`IhDy@LnyCrlBe$+Yj45~CzQJ_oTgRA^WVhU%?>G1%NVMB7 zvd{ub+u8^%Z@x8y58ZCLH{TlaM@6_FFk`r_4cblxP1}1aMPg)Qy^*MmDpJ?4c~aVi zQbj>n!?u-m==zQ#t1=pI8VF}ob1Vur(*w=ln^DgXQPrr7O~L-!*sXh19SUYMKNJ1b zJF#dDT1!`Rr9e)eK_w4F25ud)&vYs@_Vt3AJG63=|(x8iVVn2Bqb zy)pgotj+l!K~<~{CMp6Jtd^9E16^TwL%d0w`{8oAP9vtSG14?#oBgcXBN;Hbo|Ol% zT%b8AD7g-w6MEd&+}xN2uUsnfW&WNRLY&%fzGIjV$TUwIkr_f*yZ#g!rqD(UBO_2^ zdqgce>Eg=zm)i^@V3T1>122X~Or5W_TW(y&ZR=$Im`thSwhY=;lkVq~D*2=u6%a8v zm8Ld^hEIy^v6Rj)Ke>D5qYS^S0scjYX^FP=sU`6w`ZDUe>br*urv}$|%YsK;vugC$ohz2YhzX zR8b#kj1O;U?<~USfKV~&MDNy$;N3!d-8_gl?fq;PA?@3D1MPkBPm&YQgIL8V@n2gX zJtTdWD^WwZ;q>a~FQneX;O^)-zRs4~U9!rD2i`CNZg zlHjytAF&tXC59)G`XWXezFa#gL0u zKP=^?YNwlfBO%$4Ee{h%mH6JOcDlot0*G(&(0y-H$3tyjC_tHjAj*BoXsYxDzIJ+a z@1b+0-_a??-9pOWPB)4^j0t4haxOp1X|5^B%MYu}`ta(G}c7bn#54-pkoPkf#W+w{y~aIti>+H}*axrd34C=q;#ejAF9RyCp*8id*62*yK=Nd%xHtEXFa zq@L{m)XfjU3EC}pz5O!`q}l+VA~Z6L!EJB}3i6=JK77xyCa(XZjahuzZ`rG3)La;0 z4Qw=Uy?y$ZC-XZ-Yy+3EH@oGriwRZi)!+znmP6k$fBhKg++m**++*J9AAex=Tk;+9 zD(S;S58K8nWKx8qVq7umM59n4HzTDMqg541TS5))(vm@?)G2S<-Os-jpc)xvp^|+1 z;mdn=2kC{XlJiSSFDMD#vwOvQs#DOB%U(O`W>;QRMg=yI1XYn&5X!GA3gri<+(v`ptlu19uaomMxO}tU0dN?C7v}6wA~18Rkqffy5%a)O zzb!)?U)4yZ&t$cDS>fLuwO=B7t7ZhKTaV5GmfPr>@Af`MXOT6)KU>8c3v;Oo$?%;J{TRgsg`Pb4VF5SgD49>Ok4?TdF_JKZ{_GSSER+ycYR>sKMiiQsUuZ;q2=&VvO7or!yU zZy|cXu|1cQ64c39zw+E_mp?WCIvXOE3(fV0wZ*%}yfIsDF-g3#+M}BI``F~28KQ^W zq}_`NenMTfwCU59*tYW<(Up5`nLgp&FU;%0r_|5)lxS4BZuFucKYU!KW?NLgb`kUP=~%)b7K?L zhlDr2;S$6ZsSl>CfBIOa1U@rMydI3_M@dkj8if0rT@97BRvfkeLWJEg(MShm_JQYGXKCV z_xjob>roNF6~H3i%*pt45dY`~)fXn`E{jIVO0QOA00<^uwMDZDm0V+kI7K~(hnpo^ zX_O-X0YO z!aRmsp)VImv{n;{?u`MSZ2`*`A=sxG;#Yovwp-$>rDv~|;7)@a9_wjhmfMBzh3ajV zjcn+g7}uAuj>U1r2A-SeYHDz{Gn+Gi(P?~U=lPzQ|F$Kdj5C$!XdW8cUIROt$&OH4 zqpcmYwFjXai-vCO9-krl$+6^ImLi1FXapQ#d(pU3o{P`Ei4F3;{k5)1rbaHo;M5Te zP_$p=q_v<)q@t~Gp+sK8h!M3-_HYiM1Z-RCM{VkjpS^37>Y#*M4=oDy)m@957~B23 zeOMDo+S7XFrnTT;fhno>!_BnPQgG&F7*-64QjmJgfY$b<3bqGmK^;8CPKRvry>a{6 znKsc{s3p2`J5VFczIz#kZ*06RSe6fIWQ`(Gkyv>Hb3{;8Gqo=ATh}~V#uxcmU$!Ne z&qKKR%@Y}hzL>xv+xiRdvpr>u%YtzQvGDBt)z(dXsW-7hxx@2CFWW^e4-S| z{dG{=4&-1-DMxZyC~dpR>u3h1Pz7lbmbm$SBMCW$ctUOU{9OYr0RBOAm%m%ETQPbp z)#T0^;Ey5YJXAsqxhX@OE;m>)oI0UJ%_==o$}waf<97HfW@&)L2XFXVAcG^WR$z&F zrXZ&>IJVsQ8Y}0?GB^_NL!wMeG_V=w-AUkkJ;=?1xY}E6Yi~ZYXP%9z!&GB`Y@PL# zC11<4_P-{!#iqC>>bj<_lX{GbNa<0Rqs0_787BNY3FI4xiNoaL)5?Y}6}@VrLnF;~ zNKd0XW!Ql3S@1Ht2ht_<@0miC;Q1m-`-@CugN$noXc*uheRt&pj0**95h}N)B<5fw zVQC-CTgWJrHQ;n#&cIWud^$BNJ0*RSy4fM=*WZZq+X}fn7*f@YtqcjT4J1fL-eG5o_&LSIJ zSsqQ}Nv4E_0Da7&vADKv(n^q(I}W96>qPb1VKcT)JFOy+jw&4b z^b8^7etc4W&-4`T_Ge^rAc_@m9yXIQ6b`LNOJg`hhM|d11FDK?Qx{!k^U(Vo4_}Ga zH9VyI;(-ZOZgMRoL7^q1#Q85oceyL8mRceLD9s7>_Bp#vz!IXs7Mx{k`mF7nxOugt zBFtS==EE`sTapjU#Hp>bUHK?*x^z9QY*(gA2}{)wN%CNEZ_&$2S_PF>DaUCgvwHGY zxeT|uNP4*l%CjPfOM*tY=p-==Z^+hYW7Zti_RM_f91`EG&=q={^;&*`BInt}xwPBsp^AXrS&>ta( z4(B$MXeWZH%tpslJ2+?-+DkGQ%ZX13h%qBrB=kVqZkz2GAWQ=r!f z;QRd(#&qDD@+)q_>BtyQy>zCv`gH-(s|eRG*BHG*4vs!P$61cEqSBoFaBfZ!0KwWdjiF1>7<%oT{Xr`2Z2S-|&MCYEM+?T$x=)J3h3Q|ibB zfgu{Jhx@m-apbuu#7C>u_FlJ;V5Y)5P7=K+rqJ`&&Y259R1Mmm?cckZStTly^Asw` zj6(%q`(ndxIRZ1j1U^04uN=Iuu{qY*5RYoNfAa~dE77DZj)VKe8W7mHcl2iYD@)cF zh@Pmz-B4c>iH*X>WRvQ+_Re=VaGv6eC$yUN{&P*@N%A{m@e!-l%@yMj*4FoqsORH;ZpE7yLbdjil2Be{aK-0e_XgVZMkjexjrS~Z*TVe; z`maUDavX5BBOtT9v`BV5JBFQp|#7X|NL`;uT4BGFah2Z?Tn zw^unA3UOZn7O#}Qn*XoxoZ~zRv)Q6);hg-_#4`Q=!H%6AW&N)u(5Z}acWGus+*O>WVJJnxx+7RT{rqDX3hTL7t)y}7v+|JqiQ~UcK;V&trUIl1qHqy@=os$hH z$g_5em*Dovd_I40xfUu9rSCg$`LC$KRpc@q8;#rBXo&`5joH5cdGkj$2)=WdY0ZO6 ztE(}77A=IE82?paFWf{Y1mXrkV$I;gOG@WvX0na#1C{5XWd+ZHK)dR#zF+>sYyL+{ zgmAfw5thF;qfN@~bvDv*UJi4vFnTm)|ikp)2$*Qm)^BiL?>$eEBDj5hmqqTF6wF-54unQS$bD z-2#t7Nv@5|UMhLUjLTmeAUL_Kas_zsRd^4XKVAiq&(WpBxLekF{f+RC zZpH-}n|t$NNx@5G&b!e=mV4-Nyda*Iido=IM&@~1ikkKi%tvqIefNCzPlIA}(#LD@WdEz8smW4rj2Q&}{Nb#z(lL8Mc|k5{2HI(Y zvJd-i`qkfolf`Xh7WF0Pfq9`EB$^`l`jXNa_DUP!LT+U*bbPJtYD~eadpv@Ii#5EC zkxx;F{LJC7E!*|JzkdF^&Was(ut;+=A;f**?grecXw_>WSfrc&^t#nz47Xar?$Y6M zj+Jm$wq@NgJj(}H6ZkDxo&`CzbYhfH;g9x>!u`}O>mVC@MRoJ=_TF3W{ljm2*lDGc z-9xr)-7bc`Qb;i@qXHCD(LzENUice>7x>n}N|iC8XoJ#8BU{#P-Mnqn z@b=;A_8pMi*)#@89#F-Qp9{qm_)Rw=R%eJ}d;=kAn|yhzYM z-c&9L@1)?6yMBJhbL9}>)jZV_t)qwNx_lcbpWMnKjJ1iz?P(FNy@uqYOisH{7MU>{ z$yj7~mO>+DJiBrz^m>R$6dqMtB|MgB=T~d0OI+XYZ~9Y|nHAIn=LdYj+QbAL7=(S_ z``!0GAxSHoK`2y`DZA*;uf5|pZ(Ti1MN~Xk}2XT>Z?2eLuSOdXXPEN=kOp+lRB?#?^Hd z9K7~xH}3)MaJW2)NCarY&rc5pgulMV5elTlXh;Ji5(xNtAJ7g!-}srXT(O%~1BmvqZ@f(T&Ub$3!H%g8%Iy zrRCwC8q|>S*Th@(cHg~ke@O(;F>+yM{JpxT7Vhc$@y}lUcM|GeJ_r_$WJ$elacuN) zvK4*b7oYV3Hq08rA>(g`#oC;Tw;GVR_@H zZ!YmXn(^S$ag|M*wyp)+4rjQd!(&@_jKWb=?>%3*{?(kID=Ry;Z`?XMa;13Qw>msJ zx^=Yoy4StoXrRT4b;EF?bm<6>x_DoWU%%|rU+RJ5nxo-8;L4g!BV*7pqxa7*es4cN zo>^ZR;mtGdzWHt6<#aq|{m3ZXyWCjWvTkf+<>KMqpMCdDSHY3h$}Phiwr(GhtMPAk zj1Kqy@-shs7w@>Se9Q3m%eIbQ9D(ttdp@>vCx;Q;3JkZaEJ= zS!O`^t3MpPsfQo0jSgP~$4~&ze?RXzWBiFR2ANE zhFgBKa062Ik{8u8;+WTINqNJ1&klB5TV7ce?Nae(rOe{XA7%BlQPw6h!Nyh*3C zHjkJ=ZWl2kxkJQRg(mgFPtg7y?}Fg2rKMGuqH6TUvYQhj(G$}071HRKvmSz>>{WDW z&G}|&&13!4&>Vy=1hQ{gQd+LqN5rvbC72fY!Tetp#=aWrZWNU?2C%X;9Wu&*K>v4t z*(}1?EClM3fA+$jQtxH8-EdyXon;88;Q?FF^+$+v45&N$@7Mj|Vqu&wE*%YTVnl(QCjYfOJR1?aqwnF1Cqp9PGrK6hoyS|^^_KQAl>E*#Bb#@x;ku%Dp&2G#n zTp@Al+V}e}zfn}~$P>_sQXhx?%H~YHE9-!B>3D(S`$v|JxUANi0ZYXGX&g_H^h)Q)}1yZu{ZKWacHM*$j+>Qn4eTijAL)_ucrc+dn5~5~+~y9Z@=rH;gyy zLDp_v$1@?vmsYIZG+f!TV_P+HG`{n~zuy2Ej6Uw841;?k(iYOYsqPp9OaI9q{^FzD zDLYOZ!P|YwzrNzu*T1!gJ*spHbcVRNIyQ3UaCK8gK@q=Scvn5#B(e$(7iAC?scE*fl9@J zkuC83$hzvr;mW4%8>>){2bC_|e_40MmdfUlwbjc;hBs{Fl-RVU_ba#D_3<7~Ab}R2 zZ`0N*IPeOzxBc|tqnsWs`pQSe)Fv&3AF{VuWsDBty)>P4!q2Rg-w(t><)&~TDSnGO!`maCza1T2j-l0*0Mz(;XxdqCKHdgqAqKpSTK`4}3 zUs*fc`_iBN*Dxnuay*}U{Z`19^?v0`@BMxc&oiCk9tC-|$m#6;{+t2o}6HAQ$a_uPij%z^*q`Q3IJMJ8kf8q}Ij!oOgsxa*~o*{eQ+upf? zd&Ao*qu}&zs*ddtg;AR;XgDS_YzN0yF^G)(w^ zD(3%G%>SvF|5GttRxw|N^M}joaEJph=9%p{z&z4T0_C|wcP<5rZ1k$qgZ2q9`u_Z! z&xj=da*?PMX#}eip$Njw`)RyfU49?D5gweotkK>BMM3+v&Fz|Mj8`V0;sH*Y>J!^U zows(8Ao<|ja?yhZe-BE(Z&pkKnR1*3YY$)lr!Sll`@JbwTSYP)%K)J-9eEWlZa@C5)thwWDo?e!}DkV z{#V7bujwf*2MWP~hPbscGLekuIKHByUiA(Z&i*AS&3Hvs`d01__x{JbfAh&6DD*q| z@@@S5Gji{x@2y=R`OCZCx)Fmse$9<97`*bZ(qTM20=IKjO&;Gu8Q}QrT$NwQfVZ9D zMEzy|{#_ot9+j#7XhW$qQHQ`6N_pYp*d1T|`X6}oa`X^=k7->roJZ60&_*Z%vXCiP zky7F~K%7@N^6ui0f=HcXU6Gyj7Donf4JMqM6;+kh*{4Hm&_CYrD8TqgaXb*5<;grl zk&4$0K<4 zlG2e}GKgJ0nAp{HOe+KoIAIo%2`(R+cXr_o&Eq&ykp0=jv(#`}DZ6*2AB2fqz-Grm z7=7WM=a(%xpOpupQx{xD zt`F`#b1-_~HXJ+<{WL#Vo1BDG2d*~4Gv*11SXfTtsYGHw}2V{AE0I7GI&7yjhJx zJwSeCeZeOQ#tv4N=~xP+E@0<(g4F6;d+x2A5b-yHrZ(FMPlsQ9qjF=<9_WA(mInv- z?b~Plbr9O*?ZKr_hx(_9=FHUofs7yc$4xcoCLW8%eCP|yOGi~?EeC8DXy9UR7y4?T zDc@=mlrs7-KN@O&9}HXj5mtp^P`4{Q(l18fjP26l%0ah`o7+V8a6#P_=#jR?_d zIT{#DkmyL*Syy0(r>`CaZKEL6N@0l{U}2DjCC}?QSb3sZ&yVfglIr4TFl}Qid^krO9$k_+2;pgY3bXRgNSG; zz^rbiSiegb$d>(JS?TDwfo{k?m$YWIV{KX^Z5rI9XOc{h2b+@w8!VG{4tuEMeIl}Jw8rFiO?`kk(KVRy*kCt}l+c{(S$A;wd2HWk?nL%2fk_tba1(b5 z!5(FO+ToPsT&J-IZ2i*U-uI?(Xi(+9ub7E;lbQrQmJpUB3 z_bn+M1IB)=F*#G8fUE2m*Y~sYX;Wd2H0H`9a~}nba5`!PJOz>c4F*C13ctxwy}G_% z(+|B?&5qRMv%wCJhL{wkK7-LR5#oaf%wozg|*e5_+8+>`A0hBnKBp`{f`PDi|{H9^k^j)4vn}t_&{k3IPTu zMEGqW53ZOm#05HA*rsB^QP7DpPaAFJ)^4OHyQf$gD zq2);Yc~xxNkLIuAFeNuL3@ zOd~*o<|_Pn1L(E8-m1eBv|h?RyC=A+h@>aYF+}G{>XZXNXzZ3HrDZ^?EGkYP=A@)o z#k~i}_&6jZYNr9|a=@h|-k&BSq4`#oP=l?YV>Jj%C`8MFe_aMGOc-yC%D<|&rW>N{ zJ4`X}$-z!a(Wa44pe;2T-GmH20HhmAkWRK;jUfY(b5L$yFj`E^kVW%@d?AwvW;z79PqAZ$Uf)@WS&UsQY+*! zC(C1X?gk;o!_R?Tk(r75E9VVmTES(xgc@;=m1neYj$j7-LHo!og=#9jr#Tl01yYS} z{$^6yN;Y0>IU4?R0WH}W5gtKd&`1+QH2MVA2+^WX5s56@^ch-y&f+{3qm1-#=n{w7 z%iUqxg`~)nVOjyyUj zg=HUMU1RheaCQR_Lwk033YXF6*=mdlDoQl%cAMkHW0Z2S;BSG=2_G?(8W)aqqQ-La z?ZTvwCjKND)1W$88 zkKhZ)-Frdq&cKLZm*q@Z|Mtq^_)xc0aEfGppN!+zlKKXM&SYe3vJw?fmd$z)h^Efn zEh2Rg$zR_SJh_<6sLXm~Da6@(65~vC}D>T^f) zUt3Z-77({`NKZvwa~#S);}!bJI&go@mK*Rxr2zbv z(@KYPDunC{OQ5gS#KdS6mWtz)1|$YkL_9f~PlZyGMGf5t8u|kCSe4uiOmK*JfvECQ zx4NBAax+3{!Q=yy-B=(`Crl6gEbE6ApAPMPR%7>XB1{Eu4 zIg<@~_FPTnBL@Y=d3L_EW^U?g82~f7hCd#}0YPxHaQt1sah32D9Nz^CLQ^a7cH31B zM$B`xq;3}P3UXc15Eu^f#Uys+z`rni4)hvc3zsn3^|6`SY`CYHcICz#n3piG2Esfn zxfQ}_T}2f)F(4`Ev%$2$L+d{c!}76-HTi`cObFAb-!em*7w`JP%CQNw-AI=E&-F+& zi6eVUl-5kiQAU;zrJ26K$WaWoyWkc%yD}>dCS+gD`V!jf)$?vT(Y;|BBwvp=D31F~ zKz}hCDL`bL!b-P&El#)5awGSnjzShiviD$RwSmQit~=ZUv?e$+H*V$S#>DLP=!MX2 zXVD8$9!R&00swX&&+|gB({?4?KQlgBpM|0x`M4WhKj|Ewmumk2RJ+iSA}-m{ zu7U;*;B(eENFeG8ri|O{Sv}sXRiryID3-Q~Q9hjm7xLEJnc!l-g^T)Q?dGgK5j&R* zd0oTv67}gW*T-#fw|cX>X*6aQnEa1&0O~=iifjWhXhxXQ4dh0gZjgox!C$A0#ulI#Frcz`t`WwUC33yMT*w8eIK0NsJ4xE4&(rxK3SCibwCkS*w1&2 z&|u;}+(-+v=oYDwp~At4<@qj32KJrHODl(?H<_Ue@CJxe;kB}m{d*jc(z;Ftq{+`Q z!plN=Ubg;VltuM8$=>*B2&z_Tw11mtD@P~aIH`u--~s$)Ra(8 z>7?X0yw^c0-eRMTvhE|vee5U!MYC28NP?Y*wYLCkPfKI1wzb@shOYEB5TJQnKH0@% zwIsV6<4igM%LB(G2~^ZcpD`pq5;1808bTU9_5s5ord!P`hd2pT9%g)@^#%k?vg5^wMO^Z;0;%q82?seMZ)5+I>jdN$ z-#i}9P-ngO$3QJVbSm`KinGN1dZLgq;v#7pn|7^8EpWg5$kn6i zQCr;PS%|jBOwSi28ppkSvIU%cVHbhnF=1)#6u5|daF`Ma#)FCz>v|y8F%~>o$gwH7 zNOz8kkYhZ?QM*x0S4>D}usEvM7Q?jCZzSUiV9M^wQjzUOEakMr{2;g@iJtKADy(Dp ze+j3d;FoGUKIMwMInV?W{QYPE~@bl!^%@F{gN8d&x+|bhjhczBlRZt^1WZebGfY5H! z@(H{I8h?(Dqi97TLkkN)d5JEQ@qHQS#9$U)Rhwy78xu*>p~7{)sT~O(n@c#$eHQA< zu=DfJEG-ocwBc|Dg7{tJ2y;e*=Y|opjTGELVC}} zc)-@4ZxruZjvz)CvI}x?WN^yH=4Zf&&2SKw(z}!Y*#J$UlEwME5#;a0-R2e;Q1Y0? zILzU)TZ>q315xP2}< zLD+kssRh7k2fxD3T^ktJ#53?6mlFvh5k>(`tJ+)$%8c-U4LoN4zo~ z)XbXaUAYK%=p=@|S}GldR1Vo^zGcXfBsU6fS&tB-}p zvYV}awHAMjg8K|1>!1~fH5GD$&N7=HScUlckI}S3e0XEWz=~g3m&Sn6DT~Nj7@r~% zS#%fQK@Y(lB-=X=#DItdGwhyG@usSE8Zg#>i5?I~lYpIwewrVY^TBWA5A%cZ%z|-X zQWW4~sd)yK6rx`seRZ2#7WEaM2GLE+cp4uBP{riISs0x$wg3oTAD?m4T#amz0X3qT zg{!XzuI_wfI$L!M<>c>G-eOW8e<2=LC|G9|pG3n&=Ldx0Qr`=KK^oA0hbbDuh(Vsz z)jr=!Zx;|>2G4kB%yJlLAQo9Tc@J<>6+}sT+xyf0x0kWgL*19_6jp!CCiD^b0cIZIH||G7^ulDGA|LtGjFUZk0^_j9 z;T+gl#+xL1U`7t`y>-KV2<`R=U1_bXV_`D!WM?<)MOEPQL1m@V=1?>sD-H57E zNhSl0PD%DLAlaD_Vzv~e231b6nlVqCa}X?+Ga=9-8hv1fQn$0xNfP-j_4dAI>+0c| ziP>gjrY$bKh3u}Sr4uUcc5Qr*_4kl%Bg=l=AJEI>Q5^4Da?~TAmedKC+<33G#Z%=TwCq*$SAM=TpHi2!E@HRMA-eo14e`=1U?TW z5ta~H;uCsB*oz2*0~(PGq0NW#j;+;&3Pa(g&qZBd1@m4p7XI?3Y++;;n%Ux6I=ydo z=h=k>qMpScdlT&2_$*__saL(}mZt8Zk+_Q9fm>O$N6y$#iOFI>B!j*q{ z%Zz| z$|5=!=|JP=d^{@zw>lG|y)$i3x*%8PIqUu$!YeY5W;-95k=BbM&tE^fbh6yx+vavb zA1W?Zlh9XWVjG-iH?D=V+8g7jG@CTKCqjwN!u-Dh2Szn`nH6wVClD~mCveE9!1Rj# zjPG8_c@y|Tt(JSidG?n`{%MC+$$vTx=t4;6cfqqW&_itOE7*b|56NZ>a%eHogB&L+ zsxmE$7`zqGeiUYp2(Ea;oLcZiegDyULAgLe9?GZqR_3p>$Vi7)__2O*lSL^Q+UaqA zD4c<DMnW zEt8L1t=&@}hi>LyOolx4DW4gs=<}cor~O5Jv^h@zEnSUQgwADWd-kOk@$3=rl||Ux z7kgNAW`OVGc3p!9fzP6N!h@CLQ18g4tK*!Kl+9V&pV6Du@fbXyPd(3D90~7=HV$B2 z90<`hE85`TsRT;W8}~j)5P9Qi@bd})ss9bvqu{^3`|4|HkvcM4{>{rA3tM*(L`!l$k&sz zmPwlU!Q-zXZH^emU-~gQC(t;X6=M^~*m8hieXBVw z_kBud4`W;|nBh{ay1%0B?F+IdZzI~vPt}%YpR$`3(H4VK86LfFLds;n0lN2sJ?xZT zlrj`1LGty?XfzUy(KS=#q(snbeHAA)Xt=kJju^eor6XoQo@JZQYA;&}FueQWf?y!e zelM>ur)96e;F|6t%pE3yiSn~(RKz&pVO?N(Sf{gGfHJs29o=-IArropSTc_;{VT26 ztf0n#_^+4L>xT;M*#ya7U^kqgw*i!37u*JK18tjHFehHb*bhiwGsoLp8(SrFowXnw zY$5#G>M)^qAtl!1RhC*QAswBmYV_Rv{;-b}#6>8|#7<^CTyauoQ*Bp$DlF@yA=c+5 zgRXuXbZK<5L90P5I!NIkx|*Zk2Ba(6leL+(#4<^yL#Nxun^%+q(Dm)w%y?at3~a8= zfHT+{6_1%jT1mWj_n@_W%oN)|`U`S^ceXsL?&~`Lgsa|&fQ?=cn3mx32jaEISKQs* zpVI@Ga*wewoqGpixX0-Pf#2QcFd)r@Qqf?V9~_qigklkNvuRpJZngsegEM((`T1_r z@)`Y4Upz{(Pb`tSFuK(<_rJ0dkIr>^rwELu&)Ef3ICRfoi%G+0EmdwHErvhO{((Q$d80@rsBX}yR>wSd$7$o1p&8<1!-V;1+ z0eK{$LgIww^C;eU!57b0N;jO*9%7oGo?VY8pEGuY?RIi@?(DyE;YcdP)I>8)Os$c~ ziA59B331T>Koe656%r>!OugW<&nzwVNuomn1ZP~^oY~!&4A~}9?^B=P3`H6CVbCiR zo#>SaW2j+QOskGdba=AQ z)OXO?F*2r=iiW-v<>G1ZygV-c&Yf%_Rm{ud;z3%~0v2Q}nqAfMjNm{9`Si%ygg1xk z_kYU|bqkGJI<6d~FYr?VqHjRWEHFirP_j>{;xSq~$pcPj{wll5J_w{(tLvkIhSS&*zgFth?LE&AEudxd ztN42$Y8O;;P?(O|i7#BTiK0oLd8=DR!5!edjTfhMSe@nXRrsA9Hzz){u;IIaElK6_ zlibpj85#DrrTpy;EAnK+q$)^^?UZeA1-7X+8r%vKJAwE$Pp^2xVK>X()e}rDpyoli zkU(Mi2^6z%sPeLtNh5YMxS60_;rJjWqL%}3Mcs1d*-6ITlr)xbXxy|N4{8faT0w^o zEG@0%MH-Pp-Cm!bo#F*_^httaG=5!_Snme;-PMWO384?35{!0)14y;7F&_Q@zMf!a z0qG2&A$gFv4nRm@ z3jqgk6BA1HX5Gv;^#qp}R=J4+9PvUjA{^R>@IDCH*OJGBDQ`|sPD1Z(e*c*Vhq$Ov zrYf$cJ3AQTtph>0&~Ds+E3luy7<-;)VW|ASd6vdR8sNolzb zT*&D90Arj1U0x+39%029!r({1){9fvn$X@;K#dgjEyVkUJ;4>lxowwA&WlH070Bhm zh9L}L)dLdy^^(#t^6^GBNy-b^)=2zBXzV;2=FdRc&3Py*A81UWty@9f+~a-xAw>$4 z#Fk(n+F|)jo7`SFg=9kzv86T*T|b(wc9;@88{=@*+{FGp5PMS|Vsp2AhQn8#9K}(Mz zy>iIcPAnD8@@geyi3Jx$oNnzc9g7sjbVta(n{=`19yz98oR|z5L?4sepO_N{`CC6a z9PJplpU0PGeXa6rzz~%zvc}zQ^=M+R-(}5_dYBi=FZ=kzh z>drVKuH0~cO$~m+rwK-^ApSg76f5>7`;sM{lmMfrB)70gz90Bk_`c;_&<(K#6Q=Mm z?iW&5FF)zNU$}meXla-4pul89ZaT;V?7G3p8VATcA_+nrtYL*R;Ce&NIYvc8SngA;* zK~$Q>9lbp**yiD*)1A|-tw?6-lqjFz27vw3lF~|`1sqp4=UU@+(Q2RpT|DTtgJX0N z>irz3x86;?Mzot`(iII71ZB_$0bm2_WjT?1UXSa=!NP4cc<7qmY zNLpn}21&JqL(K_-Vau9W?M)*Vfbc{=f$XUCv`VXl4BF3^Gl7cn3@p8xgB>>>V+>VF)cqL8vyL9aa=?9G%(K)@<s*rGyab+Etha}E@2-!x8++^P8?E}j+SF9YQr}fcj<-2T zXJv3?=v)^pt-LqP*-NCvlJYI+aXGuRV{wLfH;EeqiDm%p2HqY9Ok1n5YYsf*l>MF@ zj94T0Q@U!Is|3&@G(`w@u+H}|AZ?=tolng)2A%r^Tve=PW9dy_OxwtzrzbeNm2ED_ zQJlugU_i@!-ZN|rY82};;htuj(b2py&PMEEA7~H4S4#{m!;>0^f+i236HhZ1>16hR{d)X3ro(_=R)2L5P)KyK($V7dn z-DvMmx%-;(m5n@o-Gy2=fCpn!_UcpE&YcD286`)^GqpVXQJkQoJuN^}OVFV{$`b7I z%&~gJO}L;4mdD$?D0qA!yvxTX7GSsG$v&M>)AMjDW;%`Bu|N>fu|VYAphscy26(^@KgDzz*p-8kQYvo#7*p?LJWydg?W!6#OXi5 zJVNChyly$YxyI8SGrT=fig`>9Mtt*#BX82|#?kHcb;I4AO``cbxDX_31MDmTqn|Hv ze^7)9{{~bTal63{l|zY+=FuwVO{2WHC-614_uDE7gH5CI;|f5@z6octFjKwFXe}WA zUWB6i@`=^PV0{<%62}D&#rUOyx#_g7vvNQYyspiM*GRCT8+dVSUa_RKY78D@UDv2h z&NRbzV|;`sMO$;T?Uaj~#1}T|^uKFlVB zHvoGdP~mKY3dpPhuF}Ol65`NI?2c=K&OI&mp<$-u9Y6E?*ITcY4qcrZ1C}ijQB;WXr}G^XX`1hzB#Z6X}=5N zS;-=vNZK|)1oX{vX!cj$Blt{0s*$4n7*kSHfnv}U`e;rec*`1EcGXfIjnqaJA>x~X zh*XMkI$B-HqN*-sW8%J|&5z_nwNHd&C zz8W*t@!7d5zw5~X%P308qrTZBG82KubaB2i%k zmW=k3{q5Zv4O&}w#h*11jqlRQo#}%uCaowShx5he+)Ud?T7B#SlU6KMg@PImSH^wY zJ<{rkCP|wP8@pj?Dd4-*PM$+ZKBqkh=5}g}Sgk7vt5?^vTFaMoBQq|5ND!%fRzv0QvxCVmp&vHZZqBj+^1zG#xd=t~ z=G!tGg5l0}F2@A!R2(rj7tTTwHBC{<5k(N&pAWH%x}g~(eC~D^p3}W6>B4h7JIh~i z{B1s}e3&1c6FuH_ zdXP2m?}eIoNf9`8faJygbt2E7QZC~dU4(%A2`=K;VM0OzClBJt0k?)bPHPTr?^wG^ zdKm;LuOgseUjuV4X|P4!Y!GL7{9;3jId^|hgl_!(rZt9+LcS-<0h7P+?9n;z!|nc* zrzECLoAT^g@;=}uj?6l za+f63O`YQm|bOBNDrX@REMtbwbC+ zjze`yGBd4ei!8guk)d53K2fWEl3oW3e3MJK?h*%b(X86jgSwFGmasdz)P$K?^Em z**X?fe*dbILWygO+(eAg)kQhf(8*9Q0dK=;&&r-lrvgGN zUE@Px^vC;s-KyohLNNIP^KeBuUO{6tci-YaXiLwt=SJ_o(nW^cyV1Umr$utmXEyHd zf|q8ejU)uS9|!>z5aYHxjVRxv4`LWqfi zfgMD5iFPuiyX2yfy2L?uJ90~maGu~2=n9i$LO4d4uRJ>|`s_aS{05C()Zxs99`1)M z0>DcGH<;K^>Vf*bVhSY~H}niG{JzN`GhZ_NF8V?&c&E}YaSK5n^7694vPE9yEJ%3} z6}^PpLs9g)p1^x^EvvLyj%?(S1%BWb#f$jeVf?+`Sn4-5$7}o$Gh}ezGRq@t$xo4= z^vxC5g24eTA<)nus!l~939aD24y?LNR+zd20Va#t;1CrkZmTkHregq1z5Goure5-xX`u6+L-S0r(sG?VBGZlG2Hoy88EzmKvUm}Y zG&~NioGyf5zcvVgvLcFg{cG~ep(T0q?4C&D(|&(q-^rKB(ykuI>NcnmSP8|xj&%ct z|AN35fQ;|qd74;g19c`NuhIgB7%|@HLz`$6JABNh;XB5Bc^}6fvRTI4S86M>XF+>7 z00wR*K>cZS#74Wk)<_otXcerF<^<5!R1|>LMNT;u9N*4-b+{QRpfAmS7H7Wc-I)yc zkmFf)=M7*Z)Y*l;J$29BxlcC*k1McG%f~wxVedlAKzkmxWl)hC-S|RhtkC}Xd#kzl z#;#LA7!7VB2+PBkHvwDvU0Tx&v@l$tbm>(?T~I_6%OIz(rK;(p8E43phZuJQF;q7- zM0r3m#uFhqC3nVK66Rt$5exajSd>`keTSEpZGyg9a4fdAIRX8T?v4y1-J1dwpY{bZ z=;34*T^r1sUn%7XO&|HP&^mLXE|jA`F&fc3`ceQqctD?Lp8c&m$xkcwWRhP47_rNr z;OBR6i}rh+^Y#gK5&}iOVA<0yvU?HHuFDh1QAI87wE{>?QU&KP^Z4Ie!EV z?g6hH@oR^v9zj|cgeh+im=swvj`IUKFs<(bd!O5G(YZO&ZXtE@+pOC=uvyo5FHNUV z>(DuY{>Adra)`Zn(}j`g+9Wtk(0(v$YDE7Kxs*|xsB2BrQCo!uU!5{W!~JWssgh_m ziOS#sWAb@!Tt!kcH96u!icXH`ql0m+PRv+Z*r{RG6(qiHn=HCmMmJeHpvWt)zS&LL zE&m&U(e8-IfD9pw7o1a|@$v=yEuZTy)BB z==f_UMT4`w-r_YM-3}dVcm0D(%OZ;N?l&R3H(6vwUrsXXp!9iA!fEBDjW(wVHd@Z- zx$JC@t<%b>rls|i$b3FaszU<=p{7$E+F;&0SG~w3irb^LtGsKEFmV2A52Mgqhdnmc ze71RZ2m1Z=Uf@bjgHNeQx_n(5Ei~j-R~uD-G)W?Hs3aVIyRyWhD?o9DRLJiP*tb9E zYwo5HCuc+1qOC>Z8*|EFi?uKOPb6ylBD&9{qxavjUrQgN%FIdvG{h#0qrq=us+Rw< zVnki_s)^S*(&`GY==U`-P1LX?aUDDm{m!T+{8gkL=wf>C7fICVTu$PX;QCA?5IW-u zwqW@F(sq>ToT=_8C(uFWd%b07ti1}8BoX7$-xav-+{t`3&Y75tlUnyhAP0d?G%esV z14QDOMZn(<+*M~Zq=4&Q^{A_Ywifu#XfhC^e9}zxf>pe=)XMCOXhrB-XxtDasG)2L zeQ1#QMp%@q++~pdbMXwQvJa`lHyRyr_?CbTB{&OrzY5%aq9w&i8ap(aB0GdpPKNLG z-e1i?1*d9Dmja-h*`<`$19}8QQqijiJ`E(yQs9`Dtb10E_dY}>YQ?(3jBez|sTsV# zcSkpC$wYlJx*=&uyLEgLXuXcD97Zum%X^)w9(5A>0Yon26%**^=PUKfNz+3o@_Fv^ z(n%3Fh9@TL*!T=y$l%xbL*D1fcK$|4Mw^~m%Cx9>=qpL|$L1ozWtKa*f%zJ@B;7$L z=5U;k`A*v1HT*)yG>B*x4a;B7R4>Oxk~|Yxu{!VuHl=LU2R{hzPzrUr|7uU9NQtup z1314+1!A7RA?GjYr1^;?qEANXZv);1H5bitE^3M{RbG#K15X5%jx}TXp)*c3u9jwB!OR$4kE3PA45?7bF}eiY zB^Dw-cDd`s#a|}tmjHI>($aAbh(kt4v994R$Q8nCNZ-`?nQQ*wC17!{>crwsLBcXc zXNgU9TTjsJScquz%0aL&4$J4vI7Ke3dH`lbnrS^rY%7@&FE%ff7v?>w}e5F}DIM9F;(>LMunaadOB@CP64RJv^b^|Bn&PXmex+eqaA#3nDV$^Jg8&Bai>Tf4qD(*vgLmZG`nn#$N2Kwbuv^* zX(VgJGV7xaBS@cX-_7U8`l5c{!!en$X7EC|NLkWV2(jzyMsnvPNjqeIz#p@v7%YtP zMXY;xK{(2<$YxWe=D<`*rt6nXWVM9@=u4i8xBrAcGe7xNS#4?defxx;K4$}{ZETCj>XV4ZrXDaS;zk+xM!MCLIp`M9#w_BJP>Y6%E;p~Uu zuCPE}2svFCtj477;w+vnFFxq5hZcI@+9E{5;o{EL+T(jTEqp%OU&E_qyameMx~}l) zpfEAEV?y#SGL&JXJhq)Xy;U38X~nz9nCNrIRU#_Hi9Rcf2X#z_#dcgJ6$HL-wF`M@ zbMGkRaqAtgx#vo!@Rhr^_lZAJ9AcNiEZmVFq!#Xc)?K)>f%E~$jEb9P`BN$%1R@r_ zpRnKClQ;tn51m4tJC83N8Ex8-zx-K((0yCI-r^5h(izuyQ1mT21zAi6?=zuH#*9qk z;fWs{j!jI!+d2XO@L24(dELf!D#&=%Em|!uJ`q`v2;cH)_~%q0^4ys(Kpp+gd;|}r z{xjd1N4!*yHRGLm3w-*{d^FIwGaoG~f>Hl1hiFqdAcem4$3x69yn8ovEN<+rqml?y z@=wn37B;kZ6bs6a_x z=DYTYW4YI!n!OgIko3Fu5k@NPpl=UFBSpMX_=-IO%zoZeI+jlrDTmP}G)N3n9$QU} zwE?FK(T1-b-&32JtfS(UYY99i2qD|VF3J`YBR=ugADl{H_0K(}!$nAt@<5*WdxTRS zZOZTa_3_3Xrax^R=BU7 z+s?JJwp2)xV^A)MrtVQV!Uqb2YdmZW9)ld;v%R@?E^IfaH$%grl#P%aT!4JnCgq;e zMVq}fgrsd543mg)A(0PB`Gv$7R{+a&A(;~|x8)a-p^QCVPy{s9AeT%Ei3gNLsqFj3 zDW%dD5Jgc15;EZ1k>Hl{--PL&s~Dob%%jV`0-M@==x+v=!wK-W%gnyM$Y=yoE1ZespG#*xyBG zaPMoEPTdi)JoG6?~^lD7;%jE`yP7LfWd1t+59O+C$M?PP?M zV@^n5;}2^{Y;Ydy0;zTeL+{$?3?@5&RGZ`AH6YU}l_n5s%rx4K+LVx9=$kk<)7E5L zb4FKO38(dHBKZQ#X751^fq!{rEUan`_HK-R=sTZ008m_1@y{d3w3-?#A_wRbzYP6P z4w+!0zu5zU1p8r6=_mv!WOOW}#wchMhw?zH~(ztLFa(A;ey}8D_2hY@I z;2m4~j4(M^@ey@S7UTLWpv*=;WkUYqHV3Xc9YY7?vNMFPy?awnaA`M$C4xXBPx*`) zkOt`iW`mF)V4C-XX?<=SE7(%!)#toRkMG^N*(UTr+@Bz$P!=ukX#y#1vBoz}6XG}K zh;`X_pc^@0%>`+DeVRZ2P-nD9YK<%;e*XegTAxMy0266A+7Vz0s=4yqaOj@_`d)Hl|cp5rvtBzSl)JUhlxj<$$T3K9F+P>#Gc6S1RJjm=)?pk}1{ zD>FRLLyB)q+4;ecz#l4*wVjWnGQi6|?mjQ06|LjE%vJ_;?8QF@O`W*l{t=M-a|~AC zrpv{0MU-(QqYLxmKodVi@Uz%@-WBn|D0Fxioo^%5sgUFwb#-sq+VAuBk{5+_ zW<^dPE;G;1RQ$a;b-E*(bZ<_5bO6t>q#`OT>{ixgtP&4Z)3(!&6>WBU-3xe)TZO+7 zD{)^7*IpAg8CL$thT&usPQn=PhKN0()8T z#E!5ppD?5E3$-4*3j;^`bRL5!#9T#SbURO7cKPSQrS8^3Phy>+#cs2`Us^)JyHiOI z9X{NNUJ3m>;9{qZaSjCClVWhv6hdYFbwA1*hSw5V()cs_cONMy?M*wODxHzfQn8%ubMQs5mgHqXGd z6b>`(a>2GIP^Nq2S|0>(fy;-ta4!9Cx)wt6#`yj|&0XnQT9D`AE`N3GQ6BCphmT_O zlY4_sTDO@4qdD^I1$Z?J ztt|-l2G`58gTZ4xY?&~@eHX}O4A^KCd8d@1B?lM4g!fHU$0w1thWZByTJ_r58MTAq z2m2Jtjrn+RW@gM0&GPB_*5(O<<-;>NyJ^j5j4MDRtz8+#?bCw+56*DVsL3Yu$2?Yn zg+xd>14@i7fW`-a)#^rqBDaLA7^iE&8CkJL9LtZ*wKBUQa>(dT>D(ccS^#%2UBMp> z49OB=3zZ4*$Y_WNrPYDy!w?{3K3zE|UQJKW{sS1zv49ApEs8JbBO!fQ0fhN& z(?=k}jcB=iNN@JCo8yeAlpm753VR3WeaQGi50tryN^82=+TN(QQuKaeYym3pdxA+5 z4{6#e^e>s4sMa_f)iwZ<*~IViDt?&WL{hWxnU-eHT~a!cqu-pKZq6WqH`m*>iCVkH z=w86&Hw8#{9gyxs6rky7ZRHVB&cNotcb|h($B9?@*u*OAt|g`80jYKM-L<(X>=7p9 zhHg#d9AAI{_W%LZ;X*`+P~4N9kl<9K`ucqG^R&QM0u2;OB3#Dnt~o$paOwRxAjggn zo^=J@*6x&WX$)f^YSy1b&a!~04e5GsLM`6216 zEy@|eua7D9ZJXN#l~|RDz4cbR5yDllR(*HlTDZ#aQhu*tW(JB?p&0K;WEvfZ5cA|Q zhHnJss2f|e0xq}^i-1*U1!U9?p9pq&EMasTM^2nX7;=xql5oEP>2O2bAD4bzBg(?M z37dx?Tv`hg^ZLwJN&u?58a6>+YXmI1Ji zu%XihJb&8Sdu^ zWJT=ZjJiq@r-G+>ba?XM&5gctb?l`zPY3oa7G=`>vKTtl*{DNh4gJadtn@0s8e|yLnnTbQg%CMwYGfVW7Yu8prgl zqx(V5J#=-jp-WOyK4n($OI%D9nlReF3I_IFJj$l4vomNRQI{I|KZ}S z8id`aydxSp%{%IZ|33%*Z^*`fN~J2EfQRIiiyL}|7Jl1g5E*Wl&<#o{x5Ob%2~esg z%jP;%?9!sTO}{;wH))(~G-oPv?PfS$o2s|OJ5FdJ=@Kz%A?=Uzcn;6h@||*f4%8GB zlsx;JOUtRCN>Tm*mS0T@zl{Ge&##*ZqesVOVDu;qA4a>7YQ1184Mkzq{7t2^;{#7X zqVb~nCXE+`RhFH_&$HCgj)YEQoL3`_22aRqsbZ#u<(2V2)Ka{G++o~4q|{;XKigQV z$eb=-wLcM7XuI1AJ&|>S8T*5}E=^aH2+L!`lxNd*%DkaYP;@hoi>>VY!)URU0~QnW z)m_JYQ6lBLPbwWR$+(7Bq|QvJ7i8g?DOCG(_ET5;<^*}9@I|0P9%6YuyCgWiH&e&@ zFUhMuqL~rV!2{M(^X$iwB}gq|a8V7BPI+a(q*Cy7FXqB7jIjkk^NY~T8cf>8dTpw` zhtWA+H6{&Z+I=@M7F}TElEJ;e_Y2ecuHJ-}EdW5r@2K&!fXZCro08 z!z6@qI_T>@<_E&%fQQ#sm;@30_P=K8Lz345mG}~HvI|9nDOv1z(5R3+6H0{^U9M(+ z5KkA3yOHy^>2QNlbu)O~Z1 zBHkag@08N24eA%VquPw}kBDrjia^QnAT_ONy4Vi$-p9PW5(8nQyoU^pDm2tG-7fu^ zthgGBo`09GEiwAA0cdBA9d&H1Jfing5Ixm&E~23=dg^g{bw}1Vu#^x!zb6>)y6?rQ zY!aay_(AN(ql0P0ri)Vf4Gry<>?k&`c3oLPQObC|;<}#T$sN-d*DTlxgu&GSjK*j) zuSa7KFh#lg{#2BU62bl3QJA#jb$yNYH1zOs_D)HuZ8AMDaot%pyMXa*8&aV7U z42IXwD3F|sXNTlm{13HM++TxEYjIzYl){wQI;IhyA?RLSF2*BdFNrl`w)|8KRUXdq zdMLcG68Sp=F&Ns9in5fQu6kd_lCFUk1jY-QV(aASqG-L3A67a>iU=?I7x(%3m0F=A zXgvjixA_rrgl?aJ(+BVzMV}dR$%_oCfx-qhoY!3Qs|ryQ1#xSE&ov+K5c(t{-XRE| z3b^Pv(nMWs5x7n0iX)%E&MS<{q0(02C66c_9aAJ^|FWdC68f8i2PgUt32&W0b4=&O z9HZk2QL?gV>0iKJw@-e#JYbx|f0k{=(VdeI;R1ND`x93qB@kA7-5Yzn5A(J}xS^>5 zvF_jj{y)+C+@?+Waq<&>X)`l`?6vR+(we!ct7UR1rRR1$s2ExA0J5HGZP{J0aJ30KLANTzNEyp9Qc>#_2?_sw(3xGHa1h64fizLDVKE2fyKzgyCs}v zk%>b-5Ju~JN%K_i3lZs}HEy6=J~pv1KbytF2s#$i4F{A1AudYnaQK)N(oO2k}8UEnIpkTSq60e*ddvuR;!ycVDd!e4UNl`>MR$ zm_F{xL|;WP9SY@4r29p}h1lYDA^ee^8+P`GC8ZPO<3P5#Nx6CF{$NxXw7lHRy&zL6-9Vzfc<625Pmu;!DvQiaY7^pF$h4v`#UXz7BQv#06 z(li_RUVY0%GKsx$MnC|vzwrj0+CEPzVK3boJON!!tX3EK%b9^y6{toCk;?;F< zS-#b-);NSfN(EwOvc90l`{Xo5S8m8a3|$l|KVE(mX}YXHGI;OuxUqI~HbHUveuQgy zF@p1J-FY0%u^@K>o0AM3O`x0u(O>iX?eGUti;*D1TGGiRzbQrwemu3-A$)Mf8i0!` zEnHG3y*Lm*`2*#oL&)oU7>N)&zP^(<<+B8Ja{|cUnR4}+rSB9Z8-FE9Oj~K{Q0k*V z@D6)^UF&^ofgq`NklHTNT$cSJt_!3w*H5B!gPX-mzX_;wszV%Qn$IU}n}<4zuPm2+ zQF5x^KDuf|+C?o8Yf_*&%PfmhiY!+_Z0^E3*#f?3pQms19 z;ld&uYV+^h*?(o;5M9o1pgnlNwdg#9x3xsBnZ6aG0(hDZbgDM_O~BuI%|Z|n?eE;l z783hgKo+9(9c?uAh&hQ*9$B~@P#?%33to#bkw03H>^Eehe6swdDTr!u{#v3eKc`d2 zak!nNj0(PKHRt$9#Ns=5x`T25OL+;c?ZBITMqP%YG1F?Ml2GPh`gefocJYb?%B1^% z>z9fdlzKQYw1E4=BOr^S+&{al#1hIq&*6GPn;Vv4t~j_WOG+1CAjjbn>Qo7MLNZ5G9leB->* zNz#yjLJ?gQMWnpBHUnM8;JWDDOG~|#UA38sxOHC0E+TUZ_E382Jk0!Ccn5FNQdAA> z!Z_J#&dtI@aspt?rn>(Mr|uFJer7C?&3@wk!JeR**LLA521y4G;IE^cNCY~Z$y;-_C;AwgiV*wTrKMwJjX=!A5t514$nG%jL%_VlY?hK!bHYvcn>o+m_Cp$DcsOV|{Vz4GkEg?$U2$CV6$`w}?u+UCse z#$?DwNu5M}(j8{r(e@M4H$?4q@XQ(1|4`>AZ9HIvpVidNTv3Utftj_C3? z74Yeb$cY_rQ@|^MdxG4R%ea!x%CP)U{I#jK6#(oXF;J&3qr`zaP%9Zp?VGDv zV}VuER7@&(oBlWsvJ53Bko_UsN+RzXoe1Xes9S~(77PI9|)SD z;6Fl99fv<@0#af+_XjByLh@cr@+;+IoxG7-z=<62o{2d${k~xCeju=ej^9ujJX*JD z89bCEU3nn=vZP{v3}hM37FMC2B9t=ampr>?Xn~EU-(GwTk`aPv4uaFk2;vJ``0^0` z?k>f%)!ABmd`}^d@uLf$j}X8miSCI5GT_ACvy|Ugwc=%#rZTLt-C^U~fsIeewtrfp zL^0;nq@F+IS%@f@Z)L1my}c)xU0@xBFrk(S%jXuwg1sIR5uk~AVKD94$^qSB&AUOh z^=D%Zhl z8=VJMLPWNH28kI$#7C)h)GYczOdKJ_}QPM`N6Wq$p=u!s462mhLD- zZ*VNCGaOtnod9oU)A_0e-~qrAQ?7iDl=|2fhyX;I$TWx-MU(!^k)>58578eE*|Xv! zP5SDCJn(T(kw+3<20KqZDkdoy=f}~rrDBK6`gas{hZMTnDJCvA&wd@*6T0bO!k*xS zi2S2TMUC4QzX+a{g$6>CT*ej%VR!=(OA~3H1K^2s5kvyf&a(S&1$-Y(?S5ne?CkV= zL)D0vAOiJF=50uuK3Dy-A zyl_x!GxCURU@QvT-oW_ve%`)Q(!7mbPD1uyaVB(RA5dmRRckqB4Hn?lyB)K}raDSEorTm57TO4AMhhMHjZ#Vdqx+_rV9W9WN z+Cs?J)pH8D`-2CXkWUD-9+*NdVY37*^a{Bbr94%_*6M~jqH`XuubfrFksvDiOU)$Q zp#oLH(QH}8I(L<@3#~kR-Bl&*rhszJsZC#?O4v!A@_E)fDn;NN>QJOga`Ed+QHj;3{vOaoTpVg9?QaXaSB`AdJ{iYG z6t5aEv6n#_eeG0prp^baU15j^b%~z*dV>8Dqy;Nwo~rp@%fXpbC^jCGK|8&q^E-Na zI#N^Xb+wRd_wq|l1*x&Ue>87e%TEp7gH2S!(3u*QqE1CVp) zbp$&t58)i2fmmatFGGI}&m$1aMVFzV=;{PZc}L!eAmZih(vJ5Kkjz1!-`nRObgm9C zP&ri^Ri#!I;}j&RIEYga(4a>EKHRFLSm&l^ZFw@cjiA3!ZpymmizEG%I%0MG1%8J z;-hJji1^m)b`|zI`o&qLLPUGrI~79Q5L@ztHX&{*WsvkNeC7v2_CuoxR7CKk zFX}0UnHgFDyP6^gUxouANfWLk){#nIjp-8Yz6G>f5I=rC*txS~Ba#e|#Puw$PkgTY zJKzmc`8a~+MzBpJVH0D!MBq32wJ+t^?+zvwfP(U21f3{6>XGORMNPlc8V~9caUO6{ zk0g#D!(H~-Htnh;&$d%-m)BKUq!Vt`nW)Hl;hT0atGuyHC)_`9pUu)&!>F^_R8k%? zC$wp_J#aL zIF?wPI_b|HQR@>QEkrFTjF#??81%x z>+`yMY62*tQa_8UZ6aGqC)#+bLDV8A(95#BrczM3c}tJPhII>@k6?&Q_pXjZWQC8~ z4fI7sHCAkaF?X5d`K(-=E9|QP`(?F8o6#@Y@;`ULi`0m_y|cv&g;c&?}4}!bF4hZ}WhO@Tq)^*#M&V*b9be-#1z)>VBaIS+h(OYUL@s=Yaltw zefS%DRdz4hQ<@mDJvB&?Dc5X#v0s?h?&X>hDMXXqrgF{n#ZoQTYyyWuorSZmBr`%2 zk$AxRx0lfclFYaS5+JGeQ#k)wBgstnEwz%&#fj$1E+Ymc(Li%}DOV)Bj0@AG8`QGP zI9hEV9W3@jGi6Gb1=uOm;8?)lFWj zHQDFUp3@dkv*!jORFItF))^lNbAGuyQm(L0kz5o#^73W;ppf6o9t-0NRtOC65rS-a zBK$a4JoLsk4IooQBPjI4MXY<+ z{1KQIIr=oy3`alWcrK>#8}tFmHMK7(_KgNl=zx9Ym9c=RrP$r50%)`i6@bEkijclP zkE{gOU+n$u?!Es+)(KMV#ZXYkr?2d-HQ)m3RDFHD)}DjYM@F~*c8*VMWWHy0(X% z^1Uc_;kKi(pOfs~xUt=y-PUSe3p;_oq>k2s&Zg)oGjobu>c-X1DQb1O2SBQVCc2ii z6$RQk$+Xol;S z#livAP!^BV)ypY?u76MF@8y&rMR_&7F8eat9GW1p%`wTL<&o%C7Um~1k<`6bP6=EY zPmVw#&yLpA=Gtt^OW$gYv^5r(c^G{kDBvepj)a7(8t?3Zxz-ds**6Oe-(7FjXU4N6 zN2+-}j08Dcn|=_wGf483SJO}}in6}r*ixU(j}W!>^{{!RGG=rqHn+AGbL3LjuK=c= zN;5S~*Vk9{UsjxTh_J!CXu)~*yGUcxQKCBPh-KQupKicse<6y_{bUeI`wF&TIR8zo zwrS40)wYRw7QOv;;Jn?vUE9tPBfN^c7Od%91j;9+tjxZKs+%T?OLe1sp^l?#l5BC{ zvjtbV{pWS83;42+DuGA*_1sRw% zh=la?VtO-pYp_%K=2D#Rg=Q-DTc=4HVk4ErU%;oRf_%KEdzkH(rkCmq;G@l+t&pW80;_Lvph5Zb!xdT_uNr2k;H$1 zdM#f)66;#Fi?<85kE;mtKjR3KKBi6jEYS?PHlC{^WW>|RKl-Z|1pN;!DIIxfZK^Q=Pk^Nyz~B%U3FwPyk$A@+ zNB0Bn0eQI43M)|@TH<`V8vQe@?u~#0bM0tuyDzw?;MR?m>mV*sest!=7scTHXi4d4 z$$%@NZ%@c>Lsdgtg;>>yPf%)4B^3=HCe+Lpx0*SJJw7kNpU#0@eQVFXl@rFB)3bB! zdbE0Nwh^8Vzxqby#vYyp4$Fgs`}Xa#{yJEjYwy7|PjA(06U~{a{R0_4@Q<5n&P_a) zKY_Qq*_s~u@zT-}lExvsB{I5nE>Ia=BrI)i<)pzzH(AeQgNWkb-ZKZIy#XFT^wa#H z6ixVz{9&HG6uD3PfHC(om>3D5;QhG=D@Q~N3n$=F>=D_ZJ5;!Q%W*3^hjVFPAbaIOlPCuUYQlfg}nz-GO!4L z_Lt_89H7C1VwZ(WUji^>`18 zDqKg#Z`|ZN5cnFy@maw*@&7ptR-_aQHN0Rq!oG}xQhHxvP@14tmVNnFppWVrfb>E6 z*Y_pgmI4>|K77iM@9uLtnQ+N@w_aV8IO{bl`E7cMH5M zPqfy&dh(avUDAnk;G1&ZVzSM34HiL*01=A1z%^K$CI!Qv+TJC7<^rfH6>p+|lIk^9 z3-In1jicpiJ|{j`q9s_lnhuU;kznU-R|GNQrlu+r-8clNi`;g_HIUWiKKzZnD*H70 zpfnjGA2cR{R-Z`c5k_@o*zL0;fioXWL4glO=jwx zr@#$YToO@FDykH2zt?s}=?!kVqA~Xs(Yzack@~dJ6q@IiCQ5B(>eB|VGPrzGx=oYQ zH+4`izk9k!k7uQkvyi8{DE`?WS3-`q33=pJ$PY&C#2xKcnT}L61=={e#7_=1KMvMf zUfAQ(bTXk@F=!L143(tWZn($fWT=OH4v(ur>X;pGlMx@)Vtz zd7kG%#AS)}oVkGut$QTlgQrr62%}oyamNJI-vXMDl#4jQLW*M9i%`~}W>9!=4B#!HA8W%!yO7c9!5V3D*QXxj z?4!tFJ>zO@J|VOIjB6$a8+iRF&bZRLByxj|{g*|TJO|PR_7(V+n8oY#UX;JOLe3nP zkFl1BPdsT~Rd~2kGH_$kWfhWuBDdPTvWf_L_8V1JK|?G3*xc;+8(_z2m>V?2D^l@Z zu8a+Jtm~8P0X1{PwpM*_qrQ*P`z0D7X^%XjkFe!9sCyOjstxx1%p?#y?y4a7z0HV^ z%C^C&tNL(Q}M&+_=l?6p&c}3 zG?a%!qap|{OvVLP2yi;f1?Zw|q2KhCdX2_R{EqiKwa${XdlYq+G`>~|1e#uI&jgGBkf#hk;#Cg(kSt2b@!OUB%6)5ZW4vBzw`=2j zrt33c1-_Sbr0J75)A3EthQ16f_K9!IDFe9gV3c29z|QxGt9G8lORy~T{yX-jY4wHP zwDmP&lSO^Gny^IRRBMXdAcCXjBN(zQyFe3`B(8je3JkOb=NVK03s;+VU%)FJvk8Z& z)3JKu6K4aKBt*jXF3^A_nn@E~H@?s&%q-`oYaRh{b#k3R2Pr@wi;0MBfA9=V2V)L6 zQc42XVy)&aQ4~i^Qqx&wH!q3HZfF5VuiTmyam*s%u3j@q?&>bOQ_>6cnn`lLd{WBF z4AN$YaR-yp@8PV|+A#5a7RF1DFTqRQZAVC0z6=m_^K0b3sKx;o56z-Zb8 zyi{Akco|-x!%UJ2&aIv<1wc2mM4Z+GdR-1lMXw&<4s1DgOL%)=e5}i8_E3F!vfgT2XnxOC6?Z(Vx7;%TaCvptvA_DFhm>;7`q036F55fZX>CoFY zmkt^9TF%y?)`9_n&SK?W3i75pEr$^VeA^1r>B??{D=ObUlr;fmAy-~aFSaPr!aI+F z-jorLA;0X0IceHBMqYIEQ68#8nx_{xInsfO*3R$uy^dzd52#9CV$HhUyWFn5++BC~7Ah_giQ)@^7)29>C&6zWsve12R7rp$1(&Fq+bU5i^3*m6$c0#ti zg0!i~K;d4lcS7RuC3P2QcAM)A(Q;%tLk=H;a`Z(|pOvYZZpBTxtFv)r4Ro}Ue=7$= ze3IWGEQ1e*yxr$6ZLv>!riu)+_qrXmtCd)7?o^zGiBlvA>0I#zXAP;uA9 z{=kqu9(6QsErZBa9gSNPczXqXZeT-@X!fmjefa!Cn|+#Ph1s_jL#$$0#vjGfr^Yry zK__5)7V4#gYQloAU-3ZF{pbidN2`s=wdc5*uT~4 zhh~FPKk00M_q0}**$~t@mt>)9N@ad{AF5&ZpsJzKD^v~g6}Jan_KLiLIu@a0(l1$+ zp=ZxbQ7CEps)P=&@UzE*Cbg`(j z7D^m_7~_21u`lD*iaNlk{t2|D<4W0{g&0(9e|tg(sTFnUNc1S_%K>0>I`j1bkXR_| zaLu9BgQQqQaS6||+=_I~R}D>*rExQmE6a9R!vZ*(*{KR1`!e& ze)ltWmkCEzA~#|yJp+a4{dSmJ>6sigccgVva9CRDd5D#s2|wJe^eFO;low|ojc=vr zp;n9q=4VgXv01ccTvK2mY^3#zQcr%v{LXcuY;Np6Bedd@L`J`P3FO)q_bs#r*K~TI z)gCPeMbWu7y$o)C+MMZcI_}+gsWuG)ds2IM^tLLzJ2edfj}a~3qv>iPs-`!5U#?ur zr55ELp893T{H)H-~VjX&cTR zY6Sukm2PpN$9i9=S1SoaAHJCwFFKF_wdI{JF@hL>J^-Q$gHVf z)Th`3m=*~nebrRuR9Br5s?ox!-sOKH;X*bJI_$@AKZ-BEyWiM1->T>Wqz7qHR9MjW zOXRx76vyc7aMHZtwpC_MK~bnLJm>-mXcJuIcWHLW{H~gxB7gUR{HY$nCHXV7u#ykT zB-MkL2BYx^h+17$ViD4U0YDC1UJ9|~TDt0o6(w-I_Eeqwp;WT3#dUK^gi zXl?0k?sVqnTkD%mxSz{5&~;(N6fN&5g7tBD|8!@Zd54$@o{<*7avMJK$HL7X^;bO6Zx(who=RJsHcEW9uW35J;5cT{`}Nt| z0_VN4qCHZ$w4?`uX8PLssgDTO#RXoOfopICnuf8zaLnpvN!Ts z#`+vUq26Bip1WN-y*0q4;v7}3XrQH@Fx4L!vY!=BE1hcx505~SPPRD{vQ8DI!qK~w zO%yG77Y`jgnuF58b6`zThMxcqDlbpc+u)#STD`2?9c-^hu`*vpe@#1jH0InH7dwomh(Utkq(IMO-tSxiy`-Dx6hv9zNv7jBY@#x!|=|f1Q^hy z>wcU(w(j2#1fHnwN627rE8VX@lBD}_DTQQ6_p1p$-LHWdMfc;<6k5r;9~V@}#YFf% z-LLTqs*Ob5k01ihN=10SmZtlSMR5~`bU#j+i0;S50I5{nk5iLa=F|QA)uuz;um2^; z#6;bXKof#n$=Lhk%@g@7E2DE65FpAij?zR1$A~tMlU*CBsbakPdsVB~T4;vbK+b1x z4fw1jJ?v9h{Mi7BT)wJ!WENQD0-pW7%o^y0-lj*`m%1+{H$U?eh zg9CwUDaY!QqB(@{Fld{BVG?b;%`k~?05Lmh+kODVah2n;adGTd8_Ub4L!HHpIxT$K7AGF3X2);GM|Xse|5Y>v(k*0${5CI7T)pZ z@F2H(E*q+ywortvH`j3O>|zhHjdWH)Fvhd;8sb^;j3jji6G zeO0>&8B};}fK?QMyJKBGBIjeMcQa&7chPcRrXEO^$U`?WU7%^{babn!Th$QrBaZTC&2fDLy9~n`49w{eMg>v!IJVW5u*cJ;4sQ#=CPad84st|}%x=>j(X6N} zu_t7M0Irc?Q6g&p)?pFNN8lZJX*RrwU<@C5Q1pr_J{q31uLA$_V6jjY*7?bj!%Aw@ z*Vw}t6wwi{4vJ8MRYXMJNViEP;vp!pInE@3U}rd!UxgTZ0tz6xy)=6gAF6gU?XfnT zDJ*>wSbC9(4|@2xYdpQX%U0IMZ0JlEa_p;!Qr^D8nXyQeXV}J>b^(?o$@aU|wH1;l z;`#{t{W8d|&CXuZYRnJzZ`|K%9;ir++5`16DQtZj*t!MTT2xgH8a*g2l=b4q&;5F1 zcDBA>fL3pE*nC054qs*KN2anX0zpHm5JP@hkVUb$3wLb9+b9Ns^0U%lWItL~TLGlQ z-Ca?9XN=k8^687woPt}YvbRr6rxlNI7?jG_8uGw%YW$IoYDn3W;C@Lm;(o7izwCjd5&LgI z>`M}fZS3(<=6r|G`}*)iy)Q{fq)&dPkIE#7jH_#iU^XROE%jjp_QSe^Hm zRT0K6<)d~=H+3heu=_}W{3QkT%7Cz+cw;^KvRf%G9F20n2FhJnA(7!giX!0+6W#AX zLp!uRVq?6!PO2R*dBHQkMH$5(wVz3+VN5@>n45IM2^Tg`MphPrCNjjgoRo)F+1Qhw*td7r&tO#R>c(A&F(AznOp%bg{xRY?^VP9hDb_aH3lgV}to! zyVEGnDc^=-;m+9i|D;S50K(CbQb&D$R>Gx3eM@(+pt06|lwK0C4yDeJO2VH??|4Hn zko`|8QEqNp3$xhszw%tx9&2sfq|J9D90zWrc!&lF3600h`y`-nP%d8>=|vune=4k7 z2@-j>Ezh6XR8VKKsqi8Lj00I-qfp5Jd+cFmKy$?Ego!i2rUJ=;5WMW~;L?I?u#N9# z@Q!C&z3Q`AW8mnd{}<@5OH*YZ#)HDyFJJ_{Q}S&$`>H}9hzMmC(*)nZKR;V4$hs@_ zm5{O<{bdMrl_dAv?3#tqDgQyxI@?nz&+#(^DZT&!ib3}74a9J1>pGUAD2r~Po zTY^A$Y?ll$OAr7IAqZ%`VvP3pLFiRZ$N~G1-G|c62~n2(nrzRcsVlJzlpZX}S;&Jc z(NEshRM&ETUM@F|?O7=|kzNaV89GfbX1JxsW3{Z5;-Fz+$^Jh=g;>N$q{sgsGy@lM z68(RTl5!-}CzAYs7r&tYj}v_UzXD+t|G!w+ER|C04Oz1Pk8q|i&gcIt7?e*=X^lkx zU*oI%|MIue{C~Y9Vjc4Tiy86~&Y1qc{yMs!wl`bte%fO#B{H`Eujq>YKmNnv_Ww1B zJlnRy|4)T?eD||}G>P;+_Y)yMM3KJIsiU@9s{0wFyYM=spRU|b1RaH>64E6x-G4m} zuhj18E^LNE^lKW2`uui@dsT=I{Oki=x$TU_P>+Oe3h62Kg4qP_)ateS>_0kxN8hh7 z^LKhOq7q}lKWQd{>^%0t?m~S|k{YDboA|$CI^;geCE+fu`~jZ(5p@n4Sbfdb_}-8~ zHJ~^_t~_sbnTUvoE)MChXS|_=N`#U43oCyGd$y3hS-&kz^V&@LX#^1E7+&84xK6{~ zepjnGC|*iMU1iYTwEkYEzcX7Oh#A66SNBeQALebA<;%jfC#_R~nii_QBXqGyPZ8O` zEBzg~HnQ>YWRJ+>sN(gr$`WfihLY(R2LA*YoI4E0=1Jz$xb$OaUWUIn7$k-nZnl+! z>>oalCMSw(I|NWmVs7p@zV5Z>n%ovx9g#nQG3#S*wj>8|0$KznwU{v1eSZVo64 zI(v3zu{RHi&_4UNwj=aKb!kT=6bNmMz|B6fekIBqe2`zaq8yp?r(YM)8buzb0DR`U zV!iPL%FSyBvFQnE_jmz zg?YNjx%WE5(%8zNyQVYjCSaI)5Dw_b<;sjiv zFEg)C-Z^Lt7W)+iZ)%K&71>7nvwCb_%~#6d+Hxhfi|Gixs9_0A@Yr0NnNwIMR2pjx z5Zf3b^;H@hxCLY65h{%hyz>)%--@j?))*^4qvEVXj~33x_uU5VQBOwW$VA|{17^txOEyGARlr{~cl-m?;{ovWLi;LN1qjS+z z>PLP;_^#*GoSWqg`uSofKiZ*@n()fbLQ6d)jEtkpoV}BZfV}y{`jb!!`K9$Woo=hw z7(h}?NaLpI4FQ%|H{I1_NPelGhwQtB5~R%xC_yh$F)IEl5`|meIwi4SlfdGBOv%yP zif?QSj|i=x7%8*@ocflVFr3HE9gPe8p7V1qZ?p%DP66;gTQH+Q#n65~NqcF5f+^Do z@tL^>AY78H%#WAXp36zoXSWp+ToL#bB8=2Kg){?v#cYF*&u6k%C-9kl3j)mtnv!`AtMqVJs4Qs<%?fgoogle.cloud.compute.v1.AWSV4Signature + */ +class AWSV4Signature extends \Google\Protobuf\Internal\Message +{ + /** + * The access key used for s3 bucket authentication. Required for updating or creating a backend that uses AWS v4 signature authentication, but will not be returned as part of the configuration when queried with a REST API GET request. @InputOnly + * + * Generated from protobuf field optional string access_key = 468922628; + */ + protected $access_key = null; + /** + * The identifier of an access key used for s3 bucket authentication. + * + * Generated from protobuf field optional string access_key_id = 292975158; + */ + protected $access_key_id = null; + /** + * The optional version identifier for the access key. You can use this to keep track of different iterations of your access key. + * + * Generated from protobuf field optional string access_key_version = 80261277; + */ + protected $access_key_version = null; + /** + * The name of the cloud region of your origin. This is a free-form field with the name of the region your cloud uses to host your origin. For example, "us-east-1" for AWS or "us-ashburn-1" for OCI. + * + * Generated from protobuf field optional string origin_region = 265305645; + */ + protected $origin_region = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $access_key + * The access key used for s3 bucket authentication. Required for updating or creating a backend that uses AWS v4 signature authentication, but will not be returned as part of the configuration when queried with a REST API GET request. @InputOnly + * @type string $access_key_id + * The identifier of an access key used for s3 bucket authentication. + * @type string $access_key_version + * The optional version identifier for the access key. You can use this to keep track of different iterations of your access key. + * @type string $origin_region + * The name of the cloud region of your origin. This is a free-form field with the name of the region your cloud uses to host your origin. For example, "us-east-1" for AWS or "us-ashburn-1" for OCI. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The access key used for s3 bucket authentication. Required for updating or creating a backend that uses AWS v4 signature authentication, but will not be returned as part of the configuration when queried with a REST API GET request. @InputOnly + * + * Generated from protobuf field optional string access_key = 468922628; + * @return string + */ + public function getAccessKey() + { + return isset($this->access_key) ? $this->access_key : ''; + } + + public function hasAccessKey() + { + return isset($this->access_key); + } + + public function clearAccessKey() + { + unset($this->access_key); + } + + /** + * The access key used for s3 bucket authentication. Required for updating or creating a backend that uses AWS v4 signature authentication, but will not be returned as part of the configuration when queried with a REST API GET request. @InputOnly + * + * Generated from protobuf field optional string access_key = 468922628; + * @param string $var + * @return $this + */ + public function setAccessKey($var) + { + GPBUtil::checkString($var, True); + $this->access_key = $var; + + return $this; + } + + /** + * The identifier of an access key used for s3 bucket authentication. + * + * Generated from protobuf field optional string access_key_id = 292975158; + * @return string + */ + public function getAccessKeyId() + { + return isset($this->access_key_id) ? $this->access_key_id : ''; + } + + public function hasAccessKeyId() + { + return isset($this->access_key_id); + } + + public function clearAccessKeyId() + { + unset($this->access_key_id); + } + + /** + * The identifier of an access key used for s3 bucket authentication. + * + * Generated from protobuf field optional string access_key_id = 292975158; + * @param string $var + * @return $this + */ + public function setAccessKeyId($var) + { + GPBUtil::checkString($var, True); + $this->access_key_id = $var; + + return $this; + } + + /** + * The optional version identifier for the access key. You can use this to keep track of different iterations of your access key. + * + * Generated from protobuf field optional string access_key_version = 80261277; + * @return string + */ + public function getAccessKeyVersion() + { + return isset($this->access_key_version) ? $this->access_key_version : ''; + } + + public function hasAccessKeyVersion() + { + return isset($this->access_key_version); + } + + public function clearAccessKeyVersion() + { + unset($this->access_key_version); + } + + /** + * The optional version identifier for the access key. You can use this to keep track of different iterations of your access key. + * + * Generated from protobuf field optional string access_key_version = 80261277; + * @param string $var + * @return $this + */ + public function setAccessKeyVersion($var) + { + GPBUtil::checkString($var, True); + $this->access_key_version = $var; + + return $this; + } + + /** + * The name of the cloud region of your origin. This is a free-form field with the name of the region your cloud uses to host your origin. For example, "us-east-1" for AWS or "us-ashburn-1" for OCI. + * + * Generated from protobuf field optional string origin_region = 265305645; + * @return string + */ + public function getOriginRegion() + { + return isset($this->origin_region) ? $this->origin_region : ''; + } + + public function hasOriginRegion() + { + return isset($this->origin_region); + } + + public function clearOriginRegion() + { + unset($this->origin_region); + } + + /** + * The name of the cloud region of your origin. This is a free-form field with the name of the region your cloud uses to host your origin. For example, "us-east-1" for AWS or "us-ashburn-1" for OCI. + * + * Generated from protobuf field optional string origin_region = 265305645; + * @param string $var + * @return $this + */ + public function setOriginRegion($var) + { + GPBUtil::checkString($var, True); + $this->origin_region = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AbandonInstancesInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AbandonInstancesInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..e4fb4fadf755 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AbandonInstancesInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest + */ +class AbandonInstancesInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest instance_group_managers_abandon_instances_request_resource = 320929016 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_managers_abandon_instances_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the zone where the managed instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. + * @param string $instanceGroupManager The name of the managed instance group. + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersAbandonInstancesRequest $instanceGroupManagersAbandonInstancesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AbandonInstancesInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager, \Google\Cloud\Compute\V1\InstanceGroupManagersAbandonInstancesRequest $instanceGroupManagersAbandonInstancesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersAbandonInstancesRequestResource($instanceGroupManagersAbandonInstancesRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group. + * @type \Google\Cloud\Compute\V1\InstanceGroupManagersAbandonInstancesRequest $instance_group_managers_abandon_instances_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 where the managed instance group is located. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest instance_group_managers_abandon_instances_request_resource = 320929016 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagersAbandonInstancesRequest|null + */ + public function getInstanceGroupManagersAbandonInstancesRequestResource() + { + return $this->instance_group_managers_abandon_instances_request_resource; + } + + public function hasInstanceGroupManagersAbandonInstancesRequestResource() + { + return isset($this->instance_group_managers_abandon_instances_request_resource); + } + + public function clearInstanceGroupManagersAbandonInstancesRequestResource() + { + unset($this->instance_group_managers_abandon_instances_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest instance_group_managers_abandon_instances_request_resource = 320929016 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersAbandonInstancesRequest $var + * @return $this + */ + public function setInstanceGroupManagersAbandonInstancesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagersAbandonInstancesRequest::class); + $this->instance_group_managers_abandon_instances_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 where the managed instance group is located. + * + * 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 where the managed instance group is located. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AbandonInstancesRegionInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AbandonInstancesRegionInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..ada15c902ddb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AbandonInstancesRegionInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest + */ +class AbandonInstancesRegionInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest region_instance_group_managers_abandon_instances_request_resource = 488499491 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_instance_group_managers_abandon_instances_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $instanceGroupManager Name of the managed instance group. + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagersAbandonInstancesRequest $regionInstanceGroupManagersAbandonInstancesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AbandonInstancesRegionInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroupManager, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersAbandonInstancesRequest $regionInstanceGroupManagersAbandonInstancesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroupManager($instanceGroupManager) + ->setRegionInstanceGroupManagersAbandonInstancesRequestResource($regionInstanceGroupManagersAbandonInstancesRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * Name of the managed instance group. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type \Google\Cloud\Compute\V1\RegionInstanceGroupManagersAbandonInstancesRequest $region_instance_group_managers_abandon_instances_request_resource + * The body resource 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); + } + + /** + * Name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * Name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest region_instance_group_managers_abandon_instances_request_resource = 488499491 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionInstanceGroupManagersAbandonInstancesRequest|null + */ + public function getRegionInstanceGroupManagersAbandonInstancesRequestResource() + { + return $this->region_instance_group_managers_abandon_instances_request_resource; + } + + public function hasRegionInstanceGroupManagersAbandonInstancesRequestResource() + { + return isset($this->region_instance_group_managers_abandon_instances_request_resource); + } + + public function clearRegionInstanceGroupManagersAbandonInstancesRequestResource() + { + unset($this->region_instance_group_managers_abandon_instances_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest region_instance_group_managers_abandon_instances_request_resource = 488499491 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagersAbandonInstancesRequest $var + * @return $this + */ + public function setRegionInstanceGroupManagersAbandonInstancesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersAbandonInstancesRequest::class); + $this->region_instance_group_managers_abandon_instances_request_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AcceleratorConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AcceleratorConfig.php new file mode 100644 index 000000000000..f54b2d3d8f09 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AcceleratorConfig.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.AcceleratorConfig + */ +class AcceleratorConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The number of the guest accelerator cards exposed to this instance. + * + * Generated from protobuf field optional int32 accelerator_count = 504879675; + */ + protected $accelerator_count = null; + /** + * Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types. + * + * Generated from protobuf field optional string accelerator_type = 138031246; + */ + protected $accelerator_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $accelerator_count + * The number of the guest accelerator cards exposed to this instance. + * @type string $accelerator_type + * Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The number of the guest accelerator cards exposed to this instance. + * + * Generated from protobuf field optional int32 accelerator_count = 504879675; + * @return int + */ + public function getAcceleratorCount() + { + return isset($this->accelerator_count) ? $this->accelerator_count : 0; + } + + public function hasAcceleratorCount() + { + return isset($this->accelerator_count); + } + + public function clearAcceleratorCount() + { + unset($this->accelerator_count); + } + + /** + * The number of the guest accelerator cards exposed to this instance. + * + * Generated from protobuf field optional int32 accelerator_count = 504879675; + * @param int $var + * @return $this + */ + public function setAcceleratorCount($var) + { + GPBUtil::checkInt32($var); + $this->accelerator_count = $var; + + return $this; + } + + /** + * Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types. + * + * Generated from protobuf field optional string accelerator_type = 138031246; + * @return string + */ + public function getAcceleratorType() + { + return isset($this->accelerator_type) ? $this->accelerator_type : ''; + } + + public function hasAcceleratorType() + { + return isset($this->accelerator_type); + } + + public function clearAcceleratorType() + { + unset($this->accelerator_type); + } + + /** + * Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types. + * + * Generated from protobuf field optional string accelerator_type = 138031246; + * @param string $var + * @return $this + */ + public function setAcceleratorType($var) + { + GPBUtil::checkString($var, True); + $this->accelerator_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AcceleratorType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AcceleratorType.php new file mode 100644 index 000000000000..fc39ab2d1fb0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AcceleratorType.php @@ -0,0 +1,429 @@ +google.cloud.compute.v1.AcceleratorType + */ +class AcceleratorType extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * [Output Only] The deprecation status associated with this accelerator type. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + */ + protected $deprecated = null; + /** + * [Output Only] An optional textual description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] The type of the resource. Always compute#acceleratorType for accelerator types. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * [Output Only] Maximum number of accelerator cards allowed per instance. + * + * Generated from protobuf field optional int32 maximum_cards_per_instance = 263814482; + */ + protected $maximum_cards_per_instance = null; + /** + * [Output Only] Name of the resource. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] Server-defined, fully qualified URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] The name of the zone where the accelerator type resides, such as us-central1-a. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + */ + protected $zone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type \Google\Cloud\Compute\V1\DeprecationStatus $deprecated + * [Output Only] The deprecation status associated with this accelerator type. + * @type string $description + * [Output Only] An optional textual description of the resource. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] The type of the resource. Always compute#acceleratorType for accelerator types. + * @type int $maximum_cards_per_instance + * [Output Only] Maximum number of accelerator cards allowed per instance. + * @type string $name + * [Output Only] Name of the resource. + * @type string $self_link + * [Output Only] Server-defined, fully qualified URL for this resource. + * @type string $zone + * [Output Only] The name of the zone where the accelerator type resides, such as us-central1-a. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * [Output Only] The deprecation status associated with this accelerator type. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + * @return \Google\Cloud\Compute\V1\DeprecationStatus|null + */ + public function getDeprecated() + { + return $this->deprecated; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * [Output Only] The deprecation status associated with this accelerator type. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + * @param \Google\Cloud\Compute\V1\DeprecationStatus $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DeprecationStatus::class); + $this->deprecated = $var; + + return $this; + } + + /** + * [Output Only] An optional textual description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * [Output Only] An optional textual description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] The type of the resource. Always compute#acceleratorType for accelerator types. + * + * 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); + } + + /** + * [Output Only] The type of the resource. Always compute#acceleratorType for accelerator types. + * + * 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] Maximum number of accelerator cards allowed per instance. + * + * Generated from protobuf field optional int32 maximum_cards_per_instance = 263814482; + * @return int + */ + public function getMaximumCardsPerInstance() + { + return isset($this->maximum_cards_per_instance) ? $this->maximum_cards_per_instance : 0; + } + + public function hasMaximumCardsPerInstance() + { + return isset($this->maximum_cards_per_instance); + } + + public function clearMaximumCardsPerInstance() + { + unset($this->maximum_cards_per_instance); + } + + /** + * [Output Only] Maximum number of accelerator cards allowed per instance. + * + * Generated from protobuf field optional int32 maximum_cards_per_instance = 263814482; + * @param int $var + * @return $this + */ + public function setMaximumCardsPerInstance($var) + { + GPBUtil::checkInt32($var); + $this->maximum_cards_per_instance = $var; + + return $this; + } + + /** + * [Output Only] Name of the resource. + * + * 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); + } + + /** + * [Output Only] Name of the resource. + * + * 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; + } + + /** + * [Output Only] Server-defined, fully qualified 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, fully qualified 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] The name of the zone where the accelerator type resides, such as us-central1-a. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + * @return string + */ + public function getZone() + { + return isset($this->zone) ? $this->zone : ''; + } + + public function hasZone() + { + return isset($this->zone); + } + + public function clearZone() + { + unset($this->zone); + } + + /** + * [Output Only] The name of the zone where the accelerator type resides, such as us-central1-a. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AcceleratorTypeAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AcceleratorTypeAggregatedList.php new file mode 100644 index 000000000000..b93dc3d9a1ae --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AcceleratorTypeAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.AcceleratorTypeAggregatedList + */ +class AcceleratorTypeAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of AcceleratorTypesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#acceleratorTypeAggregatedList for aggregated lists of accelerator types. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 AcceleratorTypesScopedList resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#acceleratorTypeAggregatedList for aggregated lists of accelerator types. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 AcceleratorTypesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of AcceleratorTypesScopedList 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\AcceleratorTypesScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#acceleratorTypeAggregatedList for aggregated lists of accelerator types. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#acceleratorTypeAggregatedList for aggregated lists of accelerator types. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AcceleratorTypeList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AcceleratorTypeList.php new file mode 100644 index 000000000000..bc85350a2c8a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AcceleratorTypeList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.AcceleratorTypeList + */ +class AcceleratorTypeList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of AcceleratorType resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorType items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#acceleratorTypeList for lists of accelerator types. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\AcceleratorType>|\Google\Protobuf\Internal\RepeatedField $items + * A list of AcceleratorType resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#acceleratorTypeList for lists of accelerator types. + * @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 AcceleratorType resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorType items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of AcceleratorType resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorType items = 100526016; + * @param array<\Google\Cloud\Compute\V1\AcceleratorType>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AcceleratorType::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#acceleratorTypeList for lists of accelerator types. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#acceleratorTypeList for lists of accelerator types. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AcceleratorTypesScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AcceleratorTypesScopedList.php new file mode 100644 index 000000000000..ab3525e88596 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AcceleratorTypesScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.AcceleratorTypesScopedList + */ +class AcceleratorTypesScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A list of accelerator types contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorType accelerator_types = 520872357; + */ + private $accelerator_types; + /** + * [Output Only] An informational warning that appears when the accelerator types list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\AcceleratorType>|\Google\Protobuf\Internal\RepeatedField $accelerator_types + * [Output Only] A list of accelerator types contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] An informational warning that appears when the accelerator types list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] A list of accelerator types contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorType accelerator_types = 520872357; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAcceleratorTypes() + { + return $this->accelerator_types; + } + + /** + * [Output Only] A list of accelerator types contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorType accelerator_types = 520872357; + * @param array<\Google\Cloud\Compute\V1\AcceleratorType>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAcceleratorTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AcceleratorType::class); + $this->accelerator_types = $arr; + + return $this; + } + + /** + * [Output Only] An informational warning that appears when the accelerator types 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 appears when the accelerator types 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Accelerators.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Accelerators.php new file mode 100644 index 000000000000..d7c8d6d37d00 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Accelerators.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.Accelerators + */ +class Accelerators extends \Google\Protobuf\Internal\Message +{ + /** + * Number of accelerator cards exposed to the guest. + * + * Generated from protobuf field optional int32 guest_accelerator_count = 479079316; + */ + protected $guest_accelerator_count = null; + /** + * The accelerator type resource name, not a full URL, e.g. nvidia-tesla-t4. + * + * Generated from protobuf field optional string guest_accelerator_type = 293064725; + */ + protected $guest_accelerator_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $guest_accelerator_count + * Number of accelerator cards exposed to the guest. + * @type string $guest_accelerator_type + * The accelerator type resource name, not a full URL, e.g. nvidia-tesla-t4. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Number of accelerator cards exposed to the guest. + * + * Generated from protobuf field optional int32 guest_accelerator_count = 479079316; + * @return int + */ + public function getGuestAcceleratorCount() + { + return isset($this->guest_accelerator_count) ? $this->guest_accelerator_count : 0; + } + + public function hasGuestAcceleratorCount() + { + return isset($this->guest_accelerator_count); + } + + public function clearGuestAcceleratorCount() + { + unset($this->guest_accelerator_count); + } + + /** + * Number of accelerator cards exposed to the guest. + * + * Generated from protobuf field optional int32 guest_accelerator_count = 479079316; + * @param int $var + * @return $this + */ + public function setGuestAcceleratorCount($var) + { + GPBUtil::checkInt32($var); + $this->guest_accelerator_count = $var; + + return $this; + } + + /** + * The accelerator type resource name, not a full URL, e.g. nvidia-tesla-t4. + * + * Generated from protobuf field optional string guest_accelerator_type = 293064725; + * @return string + */ + public function getGuestAcceleratorType() + { + return isset($this->guest_accelerator_type) ? $this->guest_accelerator_type : ''; + } + + public function hasGuestAcceleratorType() + { + return isset($this->guest_accelerator_type); + } + + public function clearGuestAcceleratorType() + { + unset($this->guest_accelerator_type); + } + + /** + * The accelerator type resource name, not a full URL, e.g. nvidia-tesla-t4. + * + * Generated from protobuf field optional string guest_accelerator_type = 293064725; + * @param string $var + * @return $this + */ + public function setGuestAcceleratorType($var) + { + GPBUtil::checkString($var, True); + $this->guest_accelerator_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AccessConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AccessConfig.php new file mode 100644 index 000000000000..9a0834b950d4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AccessConfig.php @@ -0,0 +1,481 @@ +google.cloud.compute.v1.AccessConfig + */ +class AccessConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Applies to ipv6AccessConfigs only. 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; + */ + protected $external_ipv6 = null; + /** + * Applies to ipv6AccessConfigs only. The prefix length of the external IPv6 range. + * + * Generated from protobuf field optional int32 external_ipv6_prefix_length = 425672143; + */ + protected $external_ipv6_prefix_length = null; + /** + * [Output Only] Type of the resource. Always compute#accessConfig for access configs. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * The name of this access configuration. In accessConfigs (IPv4), the default and recommended name is External NAT, but you can use any arbitrary string, such as My external IP or Network Access. In ipv6AccessConfigs, the recommend name is External IPv6. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Applies to accessConfigs (IPv4) only. An external IP address associated with this instance. Specify an unused static external IP address available to the project or leave this field undefined to use an IP from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance. + * + * Generated from protobuf field optional string nat_i_p = 117634556; + */ + protected $nat_i_p = null; + /** + * This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM, STANDARD. If an AccessConfig is specified without a valid external IP address, an ephemeral IP will be created with this networkTier. If an AccessConfig with a valid external IP address is specified, it must match that of the networkTier associated with the Address resource owning that IP. + * Check the NetworkTier enum for the list of possible values. + * + * Generated from protobuf field optional string network_tier = 517397843; + */ + protected $network_tier = null; + /** + * The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled in accessConfig. If this field is unspecified in ipv6AccessConfig, a default PTR record will be createc for first IP in associated external IPv6 range. + * + * Generated from protobuf field optional string public_ptr_domain_name = 316599167; + */ + protected $public_ptr_domain_name = null; + /** + * [Output Only] The resource URL for the security policy associated with this access config. + * + * Generated from protobuf field optional string security_policy = 171082513; + */ + protected $security_policy = null; + /** + * Specifies whether a public DNS 'PTR' record should be created to map the external IP address of the instance to a DNS domain name. This field is not used in ipv6AccessConfig. A default PTR record will be created if the VM has external IPv6 range associated. + * + * Generated from protobuf field optional bool set_public_ptr = 523870229; + */ + protected $set_public_ptr = null; + /** + * The type of configuration. In accessConfigs (IPv4), the default and only option is ONE_TO_ONE_NAT. In ipv6AccessConfigs, the default and only option is DIRECT_IPV6. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $external_ipv6 + * Applies to ipv6AccessConfigs only. 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 + * Applies to ipv6AccessConfigs only. The prefix length of the external IPv6 range. + * @type string $kind + * [Output Only] Type of the resource. Always compute#accessConfig for access configs. + * @type string $name + * The name of this access configuration. In accessConfigs (IPv4), the default and recommended name is External NAT, but you can use any arbitrary string, such as My external IP or Network Access. In ipv6AccessConfigs, the recommend name is External IPv6. + * @type string $nat_i_p + * Applies to accessConfigs (IPv4) only. An external IP address associated with this instance. Specify an unused static external IP address available to the project or leave this field undefined to use an IP from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance. + * @type string $network_tier + * This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM, STANDARD. If an AccessConfig is specified without a valid external IP address, an ephemeral IP will be created with this networkTier. If an AccessConfig with a valid external IP address is specified, it must match that of the networkTier associated with the Address resource owning that IP. + * Check the NetworkTier enum for the list of possible values. + * @type string $public_ptr_domain_name + * The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled in accessConfig. If this field is unspecified in ipv6AccessConfig, a default PTR record will be createc for first IP in associated external IPv6 range. + * @type string $security_policy + * [Output Only] The resource URL for the security policy associated with this access config. + * @type bool $set_public_ptr + * Specifies whether a public DNS 'PTR' record should be created to map the external IP address of the instance to a DNS domain name. This field is not used in ipv6AccessConfig. A default PTR record will be created if the VM has external IPv6 range associated. + * @type string $type + * The type of configuration. In accessConfigs (IPv4), the default and only option is ONE_TO_ONE_NAT. In ipv6AccessConfigs, the default and only option is DIRECT_IPV6. + * Check the Type enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Applies to ipv6AccessConfigs only. 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 + */ + public function getExternalIpv6() + { + return isset($this->external_ipv6) ? $this->external_ipv6 : ''; + } + + public function hasExternalIpv6() + { + return isset($this->external_ipv6); + } + + public function clearExternalIpv6() + { + unset($this->external_ipv6); + } + + /** + * Applies to ipv6AccessConfigs only. 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 + * @return $this + */ + public function setExternalIpv6($var) + { + GPBUtil::checkString($var, True); + $this->external_ipv6 = $var; + + return $this; + } + + /** + * Applies to ipv6AccessConfigs only. The prefix length of the external IPv6 range. + * + * Generated from protobuf field optional int32 external_ipv6_prefix_length = 425672143; + * @return int + */ + public function getExternalIpv6PrefixLength() + { + return isset($this->external_ipv6_prefix_length) ? $this->external_ipv6_prefix_length : 0; + } + + public function hasExternalIpv6PrefixLength() + { + return isset($this->external_ipv6_prefix_length); + } + + public function clearExternalIpv6PrefixLength() + { + unset($this->external_ipv6_prefix_length); + } + + /** + * Applies to ipv6AccessConfigs only. The prefix length of the external IPv6 range. + * + * Generated from protobuf field optional int32 external_ipv6_prefix_length = 425672143; + * @param int $var + * @return $this + */ + public function setExternalIpv6PrefixLength($var) + { + GPBUtil::checkInt32($var); + $this->external_ipv6_prefix_length = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#accessConfig for access configs. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#accessConfig for access configs. + * + * 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; + } + + /** + * The name of this access configuration. In accessConfigs (IPv4), the default and recommended name is External NAT, but you can use any arbitrary string, such as My external IP or Network Access. In ipv6AccessConfigs, the recommend name is External IPv6. + * + * 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 of this access configuration. In accessConfigs (IPv4), the default and recommended name is External NAT, but you can use any arbitrary string, such as My external IP or Network Access. In ipv6AccessConfigs, the recommend name is External IPv6. + * + * 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; + } + + /** + * Applies to accessConfigs (IPv4) only. An external IP address associated with this instance. Specify an unused static external IP address available to the project or leave this field undefined to use an IP from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance. + * + * Generated from protobuf field optional string nat_i_p = 117634556; + * @return string + */ + public function getNatIP() + { + return isset($this->nat_i_p) ? $this->nat_i_p : ''; + } + + public function hasNatIP() + { + return isset($this->nat_i_p); + } + + public function clearNatIP() + { + unset($this->nat_i_p); + } + + /** + * Applies to accessConfigs (IPv4) only. An external IP address associated with this instance. Specify an unused static external IP address available to the project or leave this field undefined to use an IP from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance. + * + * Generated from protobuf field optional string nat_i_p = 117634556; + * @param string $var + * @return $this + */ + public function setNatIP($var) + { + GPBUtil::checkString($var, True); + $this->nat_i_p = $var; + + return $this; + } + + /** + * This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM, STANDARD. If an AccessConfig is specified without a valid external IP address, an ephemeral IP will be created with this networkTier. If an AccessConfig with a valid external IP address is specified, it must match that of the networkTier associated with the Address resource owning that IP. + * Check the NetworkTier enum for the list of possible values. + * + * Generated from protobuf field optional string network_tier = 517397843; + * @return string + */ + public function getNetworkTier() + { + return isset($this->network_tier) ? $this->network_tier : ''; + } + + public function hasNetworkTier() + { + return isset($this->network_tier); + } + + public function clearNetworkTier() + { + unset($this->network_tier); + } + + /** + * This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM, STANDARD. If an AccessConfig is specified without a valid external IP address, an ephemeral IP will be created with this networkTier. If an AccessConfig with a valid external IP address is specified, it must match that of the networkTier associated with the Address resource owning that IP. + * Check the NetworkTier enum for the list of possible values. + * + * Generated from protobuf field optional string network_tier = 517397843; + * @param string $var + * @return $this + */ + public function setNetworkTier($var) + { + GPBUtil::checkString($var, True); + $this->network_tier = $var; + + return $this; + } + + /** + * The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled in accessConfig. If this field is unspecified in ipv6AccessConfig, a default PTR record will be createc for first IP in associated external IPv6 range. + * + * Generated from protobuf field optional string public_ptr_domain_name = 316599167; + * @return string + */ + public function getPublicPtrDomainName() + { + return isset($this->public_ptr_domain_name) ? $this->public_ptr_domain_name : ''; + } + + public function hasPublicPtrDomainName() + { + return isset($this->public_ptr_domain_name); + } + + public function clearPublicPtrDomainName() + { + unset($this->public_ptr_domain_name); + } + + /** + * The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled in accessConfig. If this field is unspecified in ipv6AccessConfig, a default PTR record will be createc for first IP in associated external IPv6 range. + * + * Generated from protobuf field optional string public_ptr_domain_name = 316599167; + * @param string $var + * @return $this + */ + public function setPublicPtrDomainName($var) + { + GPBUtil::checkString($var, True); + $this->public_ptr_domain_name = $var; + + return $this; + } + + /** + * [Output Only] The resource URL for the security policy associated with this access config. + * + * Generated from protobuf field optional string security_policy = 171082513; + * @return string + */ + public function getSecurityPolicy() + { + return isset($this->security_policy) ? $this->security_policy : ''; + } + + public function hasSecurityPolicy() + { + return isset($this->security_policy); + } + + public function clearSecurityPolicy() + { + unset($this->security_policy); + } + + /** + * [Output Only] The resource URL for the security policy associated with this access config. + * + * Generated from protobuf field optional string security_policy = 171082513; + * @param string $var + * @return $this + */ + public function setSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->security_policy = $var; + + return $this; + } + + /** + * Specifies whether a public DNS 'PTR' record should be created to map the external IP address of the instance to a DNS domain name. This field is not used in ipv6AccessConfig. A default PTR record will be created if the VM has external IPv6 range associated. + * + * Generated from protobuf field optional bool set_public_ptr = 523870229; + * @return bool + */ + public function getSetPublicPtr() + { + return isset($this->set_public_ptr) ? $this->set_public_ptr : false; + } + + public function hasSetPublicPtr() + { + return isset($this->set_public_ptr); + } + + public function clearSetPublicPtr() + { + unset($this->set_public_ptr); + } + + /** + * Specifies whether a public DNS 'PTR' record should be created to map the external IP address of the instance to a DNS domain name. This field is not used in ipv6AccessConfig. A default PTR record will be created if the VM has external IPv6 range associated. + * + * Generated from protobuf field optional bool set_public_ptr = 523870229; + * @param bool $var + * @return $this + */ + public function setSetPublicPtr($var) + { + GPBUtil::checkBool($var); + $this->set_public_ptr = $var; + + return $this; + } + + /** + * The type of configuration. In accessConfigs (IPv4), the default and only option is ONE_TO_ONE_NAT. In ipv6AccessConfigs, the default and only option is DIRECT_IPV6. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * The type of configuration. In accessConfigs (IPv4), the default and only option is ONE_TO_ONE_NAT. In ipv6AccessConfigs, the default and only option is DIRECT_IPV6. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AccessConfig/NetworkTier.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AccessConfig/NetworkTier.php new file mode 100644 index 000000000000..355782eff4b8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AccessConfig/NetworkTier.php @@ -0,0 +1,78 @@ +google.cloud.compute.v1.AccessConfig.NetworkTier + */ +class NetworkTier +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_NETWORK_TIER = 0; + */ + const UNDEFINED_NETWORK_TIER = 0; + /** + * Public internet quality with fixed bandwidth. + * + * Generated from protobuf enum FIXED_STANDARD = 310464328; + */ + const FIXED_STANDARD = 310464328; + /** + * High quality, Google-grade network tier, support for all networking products. + * + * Generated from protobuf enum PREMIUM = 399530551; + */ + const PREMIUM = 399530551; + /** + * Public internet quality, only limited support for other networking products. + * + * Generated from protobuf enum STANDARD = 484642493; + */ + const STANDARD = 484642493; + /** + * (Output only) Temporary tier for FIXED_STANDARD when fixed standard tier is expired or not configured. + * + * Generated from protobuf enum STANDARD_OVERRIDES_FIXED_STANDARD = 465847234; + */ + const STANDARD_OVERRIDES_FIXED_STANDARD = 465847234; + + private static $valueToName = [ + self::UNDEFINED_NETWORK_TIER => 'UNDEFINED_NETWORK_TIER', + self::FIXED_STANDARD => 'FIXED_STANDARD', + self::PREMIUM => 'PREMIUM', + self::STANDARD => 'STANDARD', + self::STANDARD_OVERRIDES_FIXED_STANDARD => 'STANDARD_OVERRIDES_FIXED_STANDARD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NetworkTier::class, \Google\Cloud\Compute\V1\AccessConfig_NetworkTier::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AccessConfig/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AccessConfig/Type.php new file mode 100644 index 000000000000..e12f1ca13ea1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AccessConfig/Type.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.AccessConfig.Type + */ +class Type +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TYPE = 0; + */ + const UNDEFINED_TYPE = 0; + /** + * Generated from protobuf enum DIRECT_IPV6 = 4397213; + */ + const DIRECT_IPV6 = 4397213; + /** + * Generated from protobuf enum ONE_TO_ONE_NAT = 84090205; + */ + const ONE_TO_ONE_NAT = 84090205; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::DIRECT_IPV6 => 'DIRECT_IPV6', + self::ONE_TO_ONE_NAT => 'ONE_TO_ONE_NAT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Compute\V1\AccessConfig_Type::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddAccessConfigInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddAccessConfigInstanceRequest.php new file mode 100644 index 000000000000..38193ebd2628 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddAccessConfigInstanceRequest.php @@ -0,0 +1,278 @@ +google.cloud.compute.v1.AddAccessConfigInstanceRequest + */ +class AddAccessConfigInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.AccessConfig access_config_resource = 387825552 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $access_config_resource = null; + /** + * The instance name for this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * The name of the network interface to add to this instance. + * + * Generated from protobuf field string network_interface = 365387880 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_interface = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance The instance name for this request. + * @param string $networkInterface The name of the network interface to add to this instance. + * @param \Google\Cloud\Compute\V1\AccessConfig $accessConfigResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AddAccessConfigInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, string $networkInterface, \Google\Cloud\Compute\V1\AccessConfig $accessConfigResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setAccessConfigResource($accessConfigResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\AccessConfig $access_config_resource + * The body resource for this request + * @type string $instance + * The instance name for this request. + * @type string $network_interface + * The name of the network interface to add to this instance. + * @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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.AccessConfig access_config_resource = 387825552 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\AccessConfig|null + */ + public function getAccessConfigResource() + { + return $this->access_config_resource; + } + + public function hasAccessConfigResource() + { + return isset($this->access_config_resource); + } + + public function clearAccessConfigResource() + { + unset($this->access_config_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.AccessConfig access_config_resource = 387825552 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\AccessConfig $var + * @return $this + */ + public function setAccessConfigResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\AccessConfig::class); + $this->access_config_resource = $var; + + return $this; + } + + /** + * 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 name of the network interface to add to this instance. + * + * Generated from protobuf field string network_interface = 365387880 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkInterface() + { + return $this->network_interface; + } + + /** + * The name of the network interface to add to this instance. + * + * Generated from protobuf field string network_interface = 365387880 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkInterface($var) + { + GPBUtil::checkString($var, True); + $this->network_interface = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddAssociationFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddAssociationFirewallPolicyRequest.php new file mode 100644 index 000000000000..e364b2cb6d90 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddAssociationFirewallPolicyRequest.php @@ -0,0 +1,214 @@ +google.cloud.compute.v1.AddAssociationFirewallPolicyRequest + */ +class AddAssociationFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyAssociation firewall_policy_association_resource = 259546170 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy_association_resource = null; + /** + * Indicates whether or not to replace it if an association of the attachment already exists. This is false by default, in which case an error will be returned if an association already exists. + * + * Generated from protobuf field optional bool replace_existing_association = 209541240; + */ + protected $replace_existing_association = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $firewallPolicy Name of the firewall policy to update. + * @param \Google\Cloud\Compute\V1\FirewallPolicyAssociation $firewallPolicyAssociationResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AddAssociationFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $firewallPolicy, \Google\Cloud\Compute\V1\FirewallPolicyAssociation $firewallPolicyAssociationResource): self + { + return (new self()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyAssociationResource($firewallPolicyAssociationResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to update. + * @type \Google\Cloud\Compute\V1\FirewallPolicyAssociation $firewall_policy_association_resource + * The body resource for this request + * @type bool $replace_existing_association + * Indicates whether or not to replace it if an association of the attachment already exists. This is false by default, in which case an error will be returned if an association already exists. + * @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); + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyAssociation firewall_policy_association_resource = 259546170 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\FirewallPolicyAssociation|null + */ + public function getFirewallPolicyAssociationResource() + { + return $this->firewall_policy_association_resource; + } + + public function hasFirewallPolicyAssociationResource() + { + return isset($this->firewall_policy_association_resource); + } + + public function clearFirewallPolicyAssociationResource() + { + unset($this->firewall_policy_association_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyAssociation firewall_policy_association_resource = 259546170 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\FirewallPolicyAssociation $var + * @return $this + */ + public function setFirewallPolicyAssociationResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\FirewallPolicyAssociation::class); + $this->firewall_policy_association_resource = $var; + + return $this; + } + + /** + * Indicates whether or not to replace it if an association of the attachment already exists. This is false by default, in which case an error will be returned if an association already exists. + * + * Generated from protobuf field optional bool replace_existing_association = 209541240; + * @return bool + */ + public function getReplaceExistingAssociation() + { + return isset($this->replace_existing_association) ? $this->replace_existing_association : false; + } + + public function hasReplaceExistingAssociation() + { + return isset($this->replace_existing_association); + } + + public function clearReplaceExistingAssociation() + { + unset($this->replace_existing_association); + } + + /** + * Indicates whether or not to replace it if an association of the attachment already exists. This is false by default, in which case an error will be returned if an association already exists. + * + * Generated from protobuf field optional bool replace_existing_association = 209541240; + * @param bool $var + * @return $this + */ + public function setReplaceExistingAssociation($var) + { + GPBUtil::checkBool($var); + $this->replace_existing_association = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddAssociationNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddAssociationNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..9d72d53939b8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddAssociationNetworkFirewallPolicyRequest.php @@ -0,0 +1,250 @@ +google.cloud.compute.v1.AddAssociationNetworkFirewallPolicyRequest + */ +class AddAssociationNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyAssociation firewall_policy_association_resource = 259546170 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy_association_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"]; + */ + protected $project = ''; + /** + * Indicates whether or not to replace it if an association of the attachment already exists. This is false by default, in which case an error will be returned if an association already exists. + * + * Generated from protobuf field optional bool replace_existing_association = 209541240; + */ + protected $replace_existing_association = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $firewallPolicy Name of the firewall policy to update. + * @param \Google\Cloud\Compute\V1\FirewallPolicyAssociation $firewallPolicyAssociationResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AddAssociationNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $firewallPolicy, \Google\Cloud\Compute\V1\FirewallPolicyAssociation $firewallPolicyAssociationResource): self + { + return (new self()) + ->setProject($project) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyAssociationResource($firewallPolicyAssociationResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to update. + * @type \Google\Cloud\Compute\V1\FirewallPolicyAssociation $firewall_policy_association_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type bool $replace_existing_association + * Indicates whether or not to replace it if an association of the attachment already exists. This is false by default, in which case an error will be returned if an association already exists. + * @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); + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyAssociation firewall_policy_association_resource = 259546170 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\FirewallPolicyAssociation|null + */ + public function getFirewallPolicyAssociationResource() + { + return $this->firewall_policy_association_resource; + } + + public function hasFirewallPolicyAssociationResource() + { + return isset($this->firewall_policy_association_resource); + } + + public function clearFirewallPolicyAssociationResource() + { + unset($this->firewall_policy_association_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyAssociation firewall_policy_association_resource = 259546170 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\FirewallPolicyAssociation $var + * @return $this + */ + public function setFirewallPolicyAssociationResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\FirewallPolicyAssociation::class); + $this->firewall_policy_association_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; + } + + /** + * Indicates whether or not to replace it if an association of the attachment already exists. This is false by default, in which case an error will be returned if an association already exists. + * + * Generated from protobuf field optional bool replace_existing_association = 209541240; + * @return bool + */ + public function getReplaceExistingAssociation() + { + return isset($this->replace_existing_association) ? $this->replace_existing_association : false; + } + + public function hasReplaceExistingAssociation() + { + return isset($this->replace_existing_association); + } + + public function clearReplaceExistingAssociation() + { + unset($this->replace_existing_association); + } + + /** + * Indicates whether or not to replace it if an association of the attachment already exists. This is false by default, in which case an error will be returned if an association already exists. + * + * Generated from protobuf field optional bool replace_existing_association = 209541240; + * @param bool $var + * @return $this + */ + public function setReplaceExistingAssociation($var) + { + GPBUtil::checkBool($var); + $this->replace_existing_association = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddAssociationRegionNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddAssociationRegionNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..07b9d57253bf --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddAssociationRegionNetworkFirewallPolicyRequest.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.AddAssociationRegionNetworkFirewallPolicyRequest + */ +class AddAssociationRegionNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyAssociation firewall_policy_association_resource = 259546170 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy_association_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"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * Indicates whether or not to replace it if an association already exists. This is false by default, in which case an error will be returned if an association already exists. + * + * Generated from protobuf field optional bool replace_existing_association = 209541240; + */ + protected $replace_existing_association = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $firewallPolicy Name of the firewall policy to update. + * @param \Google\Cloud\Compute\V1\FirewallPolicyAssociation $firewallPolicyAssociationResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AddAssociationRegionNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $firewallPolicy, \Google\Cloud\Compute\V1\FirewallPolicyAssociation $firewallPolicyAssociationResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyAssociationResource($firewallPolicyAssociationResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to update. + * @type \Google\Cloud\Compute\V1\FirewallPolicyAssociation $firewall_policy_association_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type bool $replace_existing_association + * Indicates whether or not to replace it if an association already exists. This is false by default, in which case an error will be returned if an association already exists. + * @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); + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyAssociation firewall_policy_association_resource = 259546170 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\FirewallPolicyAssociation|null + */ + public function getFirewallPolicyAssociationResource() + { + return $this->firewall_policy_association_resource; + } + + public function hasFirewallPolicyAssociationResource() + { + return isset($this->firewall_policy_association_resource); + } + + public function clearFirewallPolicyAssociationResource() + { + unset($this->firewall_policy_association_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyAssociation firewall_policy_association_resource = 259546170 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\FirewallPolicyAssociation $var + * @return $this + */ + public function setFirewallPolicyAssociationResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\FirewallPolicyAssociation::class); + $this->firewall_policy_association_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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Indicates whether or not to replace it if an association already exists. This is false by default, in which case an error will be returned if an association already exists. + * + * Generated from protobuf field optional bool replace_existing_association = 209541240; + * @return bool + */ + public function getReplaceExistingAssociation() + { + return isset($this->replace_existing_association) ? $this->replace_existing_association : false; + } + + public function hasReplaceExistingAssociation() + { + return isset($this->replace_existing_association); + } + + public function clearReplaceExistingAssociation() + { + unset($this->replace_existing_association); + } + + /** + * Indicates whether or not to replace it if an association already exists. This is false by default, in which case an error will be returned if an association already exists. + * + * Generated from protobuf field optional bool replace_existing_association = 209541240; + * @param bool $var + * @return $this + */ + public function setReplaceExistingAssociation($var) + { + GPBUtil::checkBool($var); + $this->replace_existing_association = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddHealthCheckTargetPoolRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddHealthCheckTargetPoolRequest.php new file mode 100644 index 000000000000..b44e6f60b3e1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddHealthCheckTargetPoolRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.AddHealthCheckTargetPoolRequest + */ +class AddHealthCheckTargetPoolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the target pool to add a health check to. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_pool = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest target_pools_add_health_check_request_resource = 269573412 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_pools_add_health_check_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetPool Name of the target pool to add a health check to. + * @param \Google\Cloud\Compute\V1\TargetPoolsAddHealthCheckRequest $targetPoolsAddHealthCheckRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AddHealthCheckTargetPoolRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $targetPool, \Google\Cloud\Compute\V1\TargetPoolsAddHealthCheckRequest $targetPoolsAddHealthCheckRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetPoolsAddHealthCheckRequestResource($targetPoolsAddHealthCheckRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 $target_pool + * Name of the target pool to add a health check to. + * @type \Google\Cloud\Compute\V1\TargetPoolsAddHealthCheckRequest $target_pools_add_health_check_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the target pool to add a health check to. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetPool() + { + return $this->target_pool; + } + + /** + * Name of the target pool to add a health check to. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetPool($var) + { + GPBUtil::checkString($var, True); + $this->target_pool = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest target_pools_add_health_check_request_resource = 269573412 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetPoolsAddHealthCheckRequest|null + */ + public function getTargetPoolsAddHealthCheckRequestResource() + { + return $this->target_pools_add_health_check_request_resource; + } + + public function hasTargetPoolsAddHealthCheckRequestResource() + { + return isset($this->target_pools_add_health_check_request_resource); + } + + public function clearTargetPoolsAddHealthCheckRequestResource() + { + unset($this->target_pools_add_health_check_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest target_pools_add_health_check_request_resource = 269573412 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetPoolsAddHealthCheckRequest $var + * @return $this + */ + public function setTargetPoolsAddHealthCheckRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetPoolsAddHealthCheckRequest::class); + $this->target_pools_add_health_check_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddInstanceTargetPoolRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddInstanceTargetPoolRequest.php new file mode 100644 index 000000000000..e26a6283d4f9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddInstanceTargetPoolRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.AddInstanceTargetPoolRequest + */ +class AddInstanceTargetPoolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the TargetPool resource to add instances to. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_pool = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetPoolsAddInstanceRequest target_pools_add_instance_request_resource = 428796404 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_pools_add_instance_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetPool Name of the TargetPool resource to add instances to. + * @param \Google\Cloud\Compute\V1\TargetPoolsAddInstanceRequest $targetPoolsAddInstanceRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AddInstanceTargetPoolRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $targetPool, \Google\Cloud\Compute\V1\TargetPoolsAddInstanceRequest $targetPoolsAddInstanceRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetPoolsAddInstanceRequestResource($targetPoolsAddInstanceRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 $target_pool + * Name of the TargetPool resource to add instances to. + * @type \Google\Cloud\Compute\V1\TargetPoolsAddInstanceRequest $target_pools_add_instance_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the TargetPool resource to add instances to. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetPool() + { + return $this->target_pool; + } + + /** + * Name of the TargetPool resource to add instances to. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetPool($var) + { + GPBUtil::checkString($var, True); + $this->target_pool = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetPoolsAddInstanceRequest target_pools_add_instance_request_resource = 428796404 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetPoolsAddInstanceRequest|null + */ + public function getTargetPoolsAddInstanceRequestResource() + { + return $this->target_pools_add_instance_request_resource; + } + + public function hasTargetPoolsAddInstanceRequestResource() + { + return isset($this->target_pools_add_instance_request_resource); + } + + public function clearTargetPoolsAddInstanceRequestResource() + { + unset($this->target_pools_add_instance_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetPoolsAddInstanceRequest target_pools_add_instance_request_resource = 428796404 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetPoolsAddInstanceRequest $var + * @return $this + */ + public function setTargetPoolsAddInstanceRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetPoolsAddInstanceRequest::class); + $this->target_pools_add_instance_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddInstancesInstanceGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddInstancesInstanceGroupRequest.php new file mode 100644 index 000000000000..82b3270db0ae --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddInstancesInstanceGroupRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.AddInstancesInstanceGroupRequest + */ +class AddInstancesInstanceGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the instance group where you are adding instances. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupsAddInstancesRequest instance_groups_add_instances_request_resource = 453713246 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_groups_add_instances_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the zone where the instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the instance group is located. + * @param string $instanceGroup The name of the instance group where you are adding instances. + * @param \Google\Cloud\Compute\V1\InstanceGroupsAddInstancesRequest $instanceGroupsAddInstancesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AddInstancesInstanceGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroup, \Google\Cloud\Compute\V1\InstanceGroupsAddInstancesRequest $instanceGroupsAddInstancesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroup($instanceGroup) + ->setInstanceGroupsAddInstancesRequestResource($instanceGroupsAddInstancesRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group + * The name of the instance group where you are adding instances. + * @type \Google\Cloud\Compute\V1\InstanceGroupsAddInstancesRequest $instance_groups_add_instances_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 where the instance group is located. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the instance group where you are adding instances. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroup() + { + return $this->instance_group; + } + + /** + * The name of the instance group where you are adding instances. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroup($var) + { + GPBUtil::checkString($var, True); + $this->instance_group = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupsAddInstancesRequest instance_groups_add_instances_request_resource = 453713246 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupsAddInstancesRequest|null + */ + public function getInstanceGroupsAddInstancesRequestResource() + { + return $this->instance_groups_add_instances_request_resource; + } + + public function hasInstanceGroupsAddInstancesRequestResource() + { + return isset($this->instance_groups_add_instances_request_resource); + } + + public function clearInstanceGroupsAddInstancesRequestResource() + { + unset($this->instance_groups_add_instances_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupsAddInstancesRequest instance_groups_add_instances_request_resource = 453713246 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupsAddInstancesRequest $var + * @return $this + */ + public function setInstanceGroupsAddInstancesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupsAddInstancesRequest::class); + $this->instance_groups_add_instances_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 where the instance group is located. + * + * 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 where the instance group is located. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddNodesNodeGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddNodesNodeGroupRequest.php new file mode 100644 index 000000000000..2b9e93785055 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddNodesNodeGroupRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.AddNodesNodeGroupRequest + */ +class AddNodesNodeGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the NodeGroup resource. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $node_group = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeGroupsAddNodesRequest node_groups_add_nodes_request_resource = 131263288 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $node_groups_add_nodes_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $nodeGroup Name of the NodeGroup resource. + * @param \Google\Cloud\Compute\V1\NodeGroupsAddNodesRequest $nodeGroupsAddNodesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AddNodesNodeGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $nodeGroup, \Google\Cloud\Compute\V1\NodeGroupsAddNodesRequest $nodeGroupsAddNodesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setNodeGroup($nodeGroup) + ->setNodeGroupsAddNodesRequestResource($nodeGroupsAddNodesRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $node_group + * Name of the NodeGroup resource. + * @type \Google\Cloud\Compute\V1\NodeGroupsAddNodesRequest $node_groups_add_nodes_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); + } + + /** + * Name of the NodeGroup resource. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNodeGroup() + { + return $this->node_group; + } + + /** + * Name of the NodeGroup resource. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNodeGroup($var) + { + GPBUtil::checkString($var, True); + $this->node_group = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeGroupsAddNodesRequest node_groups_add_nodes_request_resource = 131263288 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NodeGroupsAddNodesRequest|null + */ + public function getNodeGroupsAddNodesRequestResource() + { + return $this->node_groups_add_nodes_request_resource; + } + + public function hasNodeGroupsAddNodesRequestResource() + { + return isset($this->node_groups_add_nodes_request_resource); + } + + public function clearNodeGroupsAddNodesRequestResource() + { + unset($this->node_groups_add_nodes_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeGroupsAddNodesRequest node_groups_add_nodes_request_resource = 131263288 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NodeGroupsAddNodesRequest $var + * @return $this + */ + public function setNodeGroupsAddNodesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NodeGroupsAddNodesRequest::class); + $this->node_groups_add_nodes_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddPeeringNetworkRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddPeeringNetworkRequest.php new file mode 100644 index 000000000000..7801fb7cdbc0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddPeeringNetworkRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.AddPeeringNetworkRequest + */ +class AddPeeringNetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the network resource to add peering to. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworksAddPeeringRequest networks_add_peering_request_resource = 388810421 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $networks_add_peering_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $network Name of the network resource to add peering to. + * @param \Google\Cloud\Compute\V1\NetworksAddPeeringRequest $networksAddPeeringRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AddPeeringNetworkRequest + * + * @experimental + */ + public static function build(string $project, string $network, \Google\Cloud\Compute\V1\NetworksAddPeeringRequest $networksAddPeeringRequestResource): self + { + return (new self()) + ->setProject($project) + ->setNetwork($network) + ->setNetworksAddPeeringRequestResource($networksAddPeeringRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Name of the network resource to add peering to. + * @type \Google\Cloud\Compute\V1\NetworksAddPeeringRequest $networks_add_peering_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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the network resource to add peering to. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Name of the network resource to add peering to. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworksAddPeeringRequest networks_add_peering_request_resource = 388810421 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NetworksAddPeeringRequest|null + */ + public function getNetworksAddPeeringRequestResource() + { + return $this->networks_add_peering_request_resource; + } + + public function hasNetworksAddPeeringRequestResource() + { + return isset($this->networks_add_peering_request_resource); + } + + public function clearNetworksAddPeeringRequestResource() + { + unset($this->networks_add_peering_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworksAddPeeringRequest networks_add_peering_request_resource = 388810421 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NetworksAddPeeringRequest $var + * @return $this + */ + public function setNetworksAddPeeringRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworksAddPeeringRequest::class); + $this->networks_add_peering_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddResourcePoliciesDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddResourcePoliciesDiskRequest.php new file mode 100644 index 000000000000..c3e5b1a6ffa6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddResourcePoliciesDiskRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.AddResourcePoliciesDiskRequest + */ +class AddResourcePoliciesDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The disk name for this request. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.DisksAddResourcePoliciesRequest disks_add_resource_policies_request_resource = 496483363 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disks_add_resource_policies_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $disk The disk name for this request. + * @param \Google\Cloud\Compute\V1\DisksAddResourcePoliciesRequest $disksAddResourcePoliciesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AddResourcePoliciesDiskRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $disk, \Google\Cloud\Compute\V1\DisksAddResourcePoliciesRequest $disksAddResourcePoliciesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setDisk($disk) + ->setDisksAddResourcePoliciesRequestResource($disksAddResourcePoliciesRequestResource); + } + + /** + * 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\DisksAddResourcePoliciesRequest $disks_add_resource_policies_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 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.DisksAddResourcePoliciesRequest disks_add_resource_policies_request_resource = 496483363 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\DisksAddResourcePoliciesRequest|null + */ + public function getDisksAddResourcePoliciesRequestResource() + { + return $this->disks_add_resource_policies_request_resource; + } + + public function hasDisksAddResourcePoliciesRequestResource() + { + return isset($this->disks_add_resource_policies_request_resource); + } + + public function clearDisksAddResourcePoliciesRequestResource() + { + unset($this->disks_add_resource_policies_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.DisksAddResourcePoliciesRequest disks_add_resource_policies_request_resource = 496483363 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\DisksAddResourcePoliciesRequest $var + * @return $this + */ + public function setDisksAddResourcePoliciesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DisksAddResourcePoliciesRequest::class); + $this->disks_add_resource_policies_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddResourcePoliciesInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddResourcePoliciesInstanceRequest.php new file mode 100644 index 000000000000..db723866ea8d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddResourcePoliciesInstanceRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.AddResourcePoliciesInstanceRequest + */ +class AddResourcePoliciesInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The instance name for this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstancesAddResourcePoliciesRequest instances_add_resource_policies_request_resource = 489351963 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instances_add_resource_policies_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance The instance name for this request. + * @param \Google\Cloud\Compute\V1\InstancesAddResourcePoliciesRequest $instancesAddResourcePoliciesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AddResourcePoliciesInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, \Google\Cloud\Compute\V1\InstancesAddResourcePoliciesRequest $instancesAddResourcePoliciesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setInstancesAddResourcePoliciesRequestResource($instancesAddResourcePoliciesRequestResource); + } + + /** + * 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\InstancesAddResourcePoliciesRequest $instances_add_resource_policies_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.InstancesAddResourcePoliciesRequest instances_add_resource_policies_request_resource = 489351963 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstancesAddResourcePoliciesRequest|null + */ + public function getInstancesAddResourcePoliciesRequestResource() + { + return $this->instances_add_resource_policies_request_resource; + } + + public function hasInstancesAddResourcePoliciesRequestResource() + { + return isset($this->instances_add_resource_policies_request_resource); + } + + public function clearInstancesAddResourcePoliciesRequestResource() + { + unset($this->instances_add_resource_policies_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstancesAddResourcePoliciesRequest instances_add_resource_policies_request_resource = 489351963 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstancesAddResourcePoliciesRequest $var + * @return $this + */ + public function setInstancesAddResourcePoliciesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstancesAddResourcePoliciesRequest::class); + $this->instances_add_resource_policies_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddResourcePoliciesRegionDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddResourcePoliciesRegionDiskRequest.php new file mode 100644 index 000000000000..28d5f293bb19 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddResourcePoliciesRegionDiskRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest + */ +class AddResourcePoliciesRegionDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The disk name for this request. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest region_disks_add_resource_policies_request_resource = 284196750 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_disks_add_resource_policies_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $disk The disk name for this request. + * @param \Google\Cloud\Compute\V1\RegionDisksAddResourcePoliciesRequest $regionDisksAddResourcePoliciesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AddResourcePoliciesRegionDiskRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $disk, \Google\Cloud\Compute\V1\RegionDisksAddResourcePoliciesRequest $regionDisksAddResourcePoliciesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setDisk($disk) + ->setRegionDisksAddResourcePoliciesRequestResource($regionDisksAddResourcePoliciesRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $disk + * The disk name for this request. + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type \Google\Cloud\Compute\V1\RegionDisksAddResourcePoliciesRequest $region_disks_add_resource_policies_request_resource + * The body resource 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 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; + } + + /** + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest region_disks_add_resource_policies_request_resource = 284196750 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionDisksAddResourcePoliciesRequest|null + */ + public function getRegionDisksAddResourcePoliciesRequestResource() + { + return $this->region_disks_add_resource_policies_request_resource; + } + + public function hasRegionDisksAddResourcePoliciesRequestResource() + { + return isset($this->region_disks_add_resource_policies_request_resource); + } + + public function clearRegionDisksAddResourcePoliciesRequestResource() + { + unset($this->region_disks_add_resource_policies_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest region_disks_add_resource_policies_request_resource = 284196750 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionDisksAddResourcePoliciesRequest $var + * @return $this + */ + public function setRegionDisksAddResourcePoliciesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionDisksAddResourcePoliciesRequest::class); + $this->region_disks_add_resource_policies_request_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddRuleFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddRuleFirewallPolicyRequest.php new file mode 100644 index 000000000000..011cae00f6f2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddRuleFirewallPolicyRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.AddRuleFirewallPolicyRequest + */ +class AddRuleFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyRule firewall_policy_rule_resource = 250523523 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy_rule_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $firewallPolicy Name of the firewall policy to update. + * @param \Google\Cloud\Compute\V1\FirewallPolicyRule $firewallPolicyRuleResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AddRuleFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $firewallPolicy, \Google\Cloud\Compute\V1\FirewallPolicyRule $firewallPolicyRuleResource): self + { + return (new self()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to update. + * @type \Google\Cloud\Compute\V1\FirewallPolicyRule $firewall_policy_rule_resource + * The body resource 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); + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyRule firewall_policy_rule_resource = 250523523 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\FirewallPolicyRule|null + */ + public function getFirewallPolicyRuleResource() + { + return $this->firewall_policy_rule_resource; + } + + public function hasFirewallPolicyRuleResource() + { + return isset($this->firewall_policy_rule_resource); + } + + public function clearFirewallPolicyRuleResource() + { + unset($this->firewall_policy_rule_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyRule firewall_policy_rule_resource = 250523523 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\FirewallPolicyRule $var + * @return $this + */ + public function setFirewallPolicyRuleResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\FirewallPolicyRule::class); + $this->firewall_policy_rule_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddRuleNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddRuleNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..39651a211773 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddRuleNetworkFirewallPolicyRequest.php @@ -0,0 +1,294 @@ +google.cloud.compute.v1.AddRuleNetworkFirewallPolicyRequest + */ +class AddRuleNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyRule firewall_policy_rule_resource = 250523523 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy_rule_resource = null; + /** + * When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority. + * + * Generated from protobuf field optional int32 max_priority = 329635359; + */ + protected $max_priority = null; + /** + * When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority. + * + * Generated from protobuf field optional int32 min_priority = 267190513; + */ + protected $min_priority = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $firewallPolicy Name of the firewall policy to update. + * @param \Google\Cloud\Compute\V1\FirewallPolicyRule $firewallPolicyRuleResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AddRuleNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $firewallPolicy, \Google\Cloud\Compute\V1\FirewallPolicyRule $firewallPolicyRuleResource): self + { + return (new self()) + ->setProject($project) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to update. + * @type \Google\Cloud\Compute\V1\FirewallPolicyRule $firewall_policy_rule_resource + * The body resource for this request + * @type int $max_priority + * When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority. + * @type int $min_priority + * When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority. + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyRule firewall_policy_rule_resource = 250523523 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\FirewallPolicyRule|null + */ + public function getFirewallPolicyRuleResource() + { + return $this->firewall_policy_rule_resource; + } + + public function hasFirewallPolicyRuleResource() + { + return isset($this->firewall_policy_rule_resource); + } + + public function clearFirewallPolicyRuleResource() + { + unset($this->firewall_policy_rule_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyRule firewall_policy_rule_resource = 250523523 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\FirewallPolicyRule $var + * @return $this + */ + public function setFirewallPolicyRuleResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\FirewallPolicyRule::class); + $this->firewall_policy_rule_resource = $var; + + return $this; + } + + /** + * When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority. + * + * Generated from protobuf field optional int32 max_priority = 329635359; + * @return int + */ + public function getMaxPriority() + { + return isset($this->max_priority) ? $this->max_priority : 0; + } + + public function hasMaxPriority() + { + return isset($this->max_priority); + } + + public function clearMaxPriority() + { + unset($this->max_priority); + } + + /** + * When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority. + * + * Generated from protobuf field optional int32 max_priority = 329635359; + * @param int $var + * @return $this + */ + public function setMaxPriority($var) + { + GPBUtil::checkInt32($var); + $this->max_priority = $var; + + return $this; + } + + /** + * When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority. + * + * Generated from protobuf field optional int32 min_priority = 267190513; + * @return int + */ + public function getMinPriority() + { + return isset($this->min_priority) ? $this->min_priority : 0; + } + + public function hasMinPriority() + { + return isset($this->min_priority); + } + + public function clearMinPriority() + { + unset($this->min_priority); + } + + /** + * When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority. + * + * Generated from protobuf field optional int32 min_priority = 267190513; + * @param int $var + * @return $this + */ + public function setMinPriority($var) + { + GPBUtil::checkInt32($var); + $this->min_priority = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddRuleRegionNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddRuleRegionNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..3f92a5437662 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddRuleRegionNetworkFirewallPolicyRequest.php @@ -0,0 +1,330 @@ +google.cloud.compute.v1.AddRuleRegionNetworkFirewallPolicyRequest + */ +class AddRuleRegionNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyRule firewall_policy_rule_resource = 250523523 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy_rule_resource = null; + /** + * When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority. + * + * Generated from protobuf field optional int32 max_priority = 329635359; + */ + protected $max_priority = null; + /** + * When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority. + * + * Generated from protobuf field optional int32 min_priority = 267190513; + */ + protected $min_priority = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $firewallPolicy Name of the firewall policy to update. + * @param \Google\Cloud\Compute\V1\FirewallPolicyRule $firewallPolicyRuleResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AddRuleRegionNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $firewallPolicy, \Google\Cloud\Compute\V1\FirewallPolicyRule $firewallPolicyRuleResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to update. + * @type \Google\Cloud\Compute\V1\FirewallPolicyRule $firewall_policy_rule_resource + * The body resource for this request + * @type int $max_priority + * When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority. + * @type int $min_priority + * When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyRule firewall_policy_rule_resource = 250523523 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\FirewallPolicyRule|null + */ + public function getFirewallPolicyRuleResource() + { + return $this->firewall_policy_rule_resource; + } + + public function hasFirewallPolicyRuleResource() + { + return isset($this->firewall_policy_rule_resource); + } + + public function clearFirewallPolicyRuleResource() + { + unset($this->firewall_policy_rule_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyRule firewall_policy_rule_resource = 250523523 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\FirewallPolicyRule $var + * @return $this + */ + public function setFirewallPolicyRuleResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\FirewallPolicyRule::class); + $this->firewall_policy_rule_resource = $var; + + return $this; + } + + /** + * When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority. + * + * Generated from protobuf field optional int32 max_priority = 329635359; + * @return int + */ + public function getMaxPriority() + { + return isset($this->max_priority) ? $this->max_priority : 0; + } + + public function hasMaxPriority() + { + return isset($this->max_priority); + } + + public function clearMaxPriority() + { + unset($this->max_priority); + } + + /** + * When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority. + * + * Generated from protobuf field optional int32 max_priority = 329635359; + * @param int $var + * @return $this + */ + public function setMaxPriority($var) + { + GPBUtil::checkInt32($var); + $this->max_priority = $var; + + return $this; + } + + /** + * When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority. + * + * Generated from protobuf field optional int32 min_priority = 267190513; + * @return int + */ + public function getMinPriority() + { + return isset($this->min_priority) ? $this->min_priority : 0; + } + + public function hasMinPriority() + { + return isset($this->min_priority); + } + + public function clearMinPriority() + { + unset($this->min_priority); + } + + /** + * When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority. + * + * Generated from protobuf field optional int32 min_priority = 267190513; + * @param int $var + * @return $this + */ + public function setMinPriority($var) + { + GPBUtil::checkInt32($var); + $this->min_priority = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddRuleRegionSecurityPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddRuleRegionSecurityPolicyRequest.php new file mode 100644 index 000000000000..909a99e9caa3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddRuleRegionSecurityPolicyRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.AddRuleRegionSecurityPolicyRequest + */ +class AddRuleRegionSecurityPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyRule security_policy_rule_resource = 402693443 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy_rule_resource = null; + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + */ + protected $validate_only = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $securityPolicy Name of the security policy to update. + * @param \Google\Cloud\Compute\V1\SecurityPolicyRule $securityPolicyRuleResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AddRuleRegionSecurityPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $securityPolicy, \Google\Cloud\Compute\V1\SecurityPolicyRule $securityPolicyRuleResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyRuleResource($securityPolicyRuleResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type string $security_policy + * Name of the security policy to update. + * @type \Google\Cloud\Compute\V1\SecurityPolicyRule $security_policy_rule_resource + * The body resource for this request + * @type bool $validate_only + * If true, the request will not be committed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSecurityPolicy() + { + return $this->security_policy; + } + + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->security_policy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyRule security_policy_rule_resource = 402693443 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SecurityPolicyRule|null + */ + public function getSecurityPolicyRuleResource() + { + return $this->security_policy_rule_resource; + } + + public function hasSecurityPolicyRuleResource() + { + return isset($this->security_policy_rule_resource); + } + + public function clearSecurityPolicyRuleResource() + { + unset($this->security_policy_rule_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyRule security_policy_rule_resource = 402693443 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SecurityPolicyRule $var + * @return $this + */ + public function setSecurityPolicyRuleResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyRule::class); + $this->security_policy_rule_resource = $var; + + return $this; + } + + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + * @return bool + */ + public function getValidateOnly() + { + return isset($this->validate_only) ? $this->validate_only : false; + } + + public function hasValidateOnly() + { + return isset($this->validate_only); + } + + public function clearValidateOnly() + { + unset($this->validate_only); + } + + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddRuleSecurityPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddRuleSecurityPolicyRequest.php new file mode 100644 index 000000000000..1d2d4016ea9d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddRuleSecurityPolicyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.AddRuleSecurityPolicyRequest + */ +class AddRuleSecurityPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyRule security_policy_rule_resource = 402693443 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy_rule_resource = null; + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + */ + protected $validate_only = null; + + /** + * @param string $project Project ID for this request. + * @param string $securityPolicy Name of the security policy to update. + * @param \Google\Cloud\Compute\V1\SecurityPolicyRule $securityPolicyRuleResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AddRuleSecurityPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $securityPolicy, \Google\Cloud\Compute\V1\SecurityPolicyRule $securityPolicyRuleResource): self + { + return (new self()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyRuleResource($securityPolicyRuleResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $security_policy + * Name of the security policy to update. + * @type \Google\Cloud\Compute\V1\SecurityPolicyRule $security_policy_rule_resource + * The body resource for this request + * @type bool $validate_only + * If true, the request will not be committed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSecurityPolicy() + { + return $this->security_policy; + } + + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->security_policy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyRule security_policy_rule_resource = 402693443 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SecurityPolicyRule|null + */ + public function getSecurityPolicyRuleResource() + { + return $this->security_policy_rule_resource; + } + + public function hasSecurityPolicyRuleResource() + { + return isset($this->security_policy_rule_resource); + } + + public function clearSecurityPolicyRuleResource() + { + unset($this->security_policy_rule_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyRule security_policy_rule_resource = 402693443 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SecurityPolicyRule $var + * @return $this + */ + public function setSecurityPolicyRuleResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyRule::class); + $this->security_policy_rule_resource = $var; + + return $this; + } + + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + * @return bool + */ + public function getValidateOnly() + { + return isset($this->validate_only) ? $this->validate_only : false; + } + + public function hasValidateOnly() + { + return isset($this->validate_only); + } + + public function clearValidateOnly() + { + unset($this->validate_only); + } + + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddSignedUrlKeyBackendBucketRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddSignedUrlKeyBackendBucketRequest.php new file mode 100644 index 000000000000..d18c6b9c98bd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddSignedUrlKeyBackendBucketRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest + */ +class AddSignedUrlKeyBackendBucketRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_bucket = 91714037 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_bucket = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SignedUrlKey signed_url_key_resource = 457625985 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $signed_url_key_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $backendBucket Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @param \Google\Cloud\Compute\V1\SignedUrlKey $signedUrlKeyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AddSignedUrlKeyBackendBucketRequest + * + * @experimental + */ + public static function build(string $project, string $backendBucket, \Google\Cloud\Compute\V1\SignedUrlKey $signedUrlKeyResource): self + { + return (new self()) + ->setProject($project) + ->setBackendBucket($backendBucket) + ->setSignedUrlKeyResource($signedUrlKeyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_bucket + * Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @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 \Google\Cloud\Compute\V1\SignedUrlKey $signed_url_key_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_bucket = 91714037 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackendBucket() + { + return $this->backend_bucket; + } + + /** + * Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_bucket = 91714037 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackendBucket($var) + { + GPBUtil::checkString($var, True); + $this->backend_bucket = $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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SignedUrlKey signed_url_key_resource = 457625985 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SignedUrlKey|null + */ + public function getSignedUrlKeyResource() + { + return $this->signed_url_key_resource; + } + + public function hasSignedUrlKeyResource() + { + return isset($this->signed_url_key_resource); + } + + public function clearSignedUrlKeyResource() + { + unset($this->signed_url_key_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SignedUrlKey signed_url_key_resource = 457625985 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SignedUrlKey $var + * @return $this + */ + public function setSignedUrlKeyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SignedUrlKey::class); + $this->signed_url_key_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddSignedUrlKeyBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddSignedUrlKeyBackendServiceRequest.php new file mode 100644 index 000000000000..b8b7fd554072 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddSignedUrlKeyBackendServiceRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest + */ +class AddSignedUrlKeyBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_service = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SignedUrlKey signed_url_key_resource = 457625985 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $signed_url_key_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $backendService Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @param \Google\Cloud\Compute\V1\SignedUrlKey $signedUrlKeyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AddSignedUrlKeyBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, string $backendService, \Google\Cloud\Compute\V1\SignedUrlKey $signedUrlKeyResource): self + { + return (new self()) + ->setProject($project) + ->setBackendService($backendService) + ->setSignedUrlKeyResource($signedUrlKeyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_service + * Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @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 \Google\Cloud\Compute\V1\SignedUrlKey $signed_url_key_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackendService() + { + return $this->backend_service; + } + + /** + * Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackendService($var) + { + GPBUtil::checkString($var, True); + $this->backend_service = $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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SignedUrlKey signed_url_key_resource = 457625985 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SignedUrlKey|null + */ + public function getSignedUrlKeyResource() + { + return $this->signed_url_key_resource; + } + + public function hasSignedUrlKeyResource() + { + return isset($this->signed_url_key_resource); + } + + public function clearSignedUrlKeyResource() + { + unset($this->signed_url_key_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SignedUrlKey signed_url_key_resource = 457625985 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SignedUrlKey $var + * @return $this + */ + public function setSignedUrlKeyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SignedUrlKey::class); + $this->signed_url_key_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address.php new file mode 100644 index 000000000000..f50b5bc9b8f8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address.php @@ -0,0 +1,917 @@ +google.cloud.compute.v1.Address + */ +class Address extends \Google\Protobuf\Internal\Message +{ + /** + * The static IP address represented by this resource. + * + * Generated from protobuf field optional string address = 462920692; + */ + protected $address = null; + /** + * The type of address to reserve, either INTERNAL or EXTERNAL. If unspecified, defaults to EXTERNAL. + * Check the AddressType enum for the list of possible values. + * + * Generated from protobuf field optional string address_type = 264307877; + */ + protected $address_type = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this field when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * The IP version that will be used by this address. Valid options are IPV4 or IPV6. + * Check the IpVersion enum for the list of possible values. + * + * Generated from protobuf field optional string ip_version = 294959552; + */ + protected $ip_version = null; + /** + * The endpoint type of this address, which should be VM or NETLB. This is used for deciding which type of endpoint this address can be used after the external IPv6 address reservation. + * Check the Ipv6EndpointType enum for the list of possible values. + * + * Generated from protobuf field optional string ipv6_endpoint_type = 97501004; + */ + protected $ipv6_endpoint_type = null; + /** + * [Output Only] Type of the resource. Always compute#address for addresses. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * A fingerprint for the labels being applied to this Address, 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 Address. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + */ + protected $label_fingerprint = null; + /** + * 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. + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + /** + * 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])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * The URL of the network in which to reserve the address. This field can only be used with INTERNAL type with the VPC_PEERING purpose. + * + * Generated from protobuf field optional string network = 232872494; + */ + protected $network = null; + /** + * This signifies the networking tier used for configuring this address and can only take the following values: PREMIUM or STANDARD. Internal IP addresses are always Premium Tier; global external IP addresses are always Premium Tier; regional external IP addresses can be either Standard or Premium Tier. If this field is not specified, it is assumed to be PREMIUM. + * Check the NetworkTier enum for the list of possible values. + * + * Generated from protobuf field optional string network_tier = 517397843; + */ + protected $network_tier = null; + /** + * The prefix length if the resource represents an IP range. + * + * Generated from protobuf field optional int32 prefix_length = 453565747; + */ + protected $prefix_length = null; + /** + * The purpose of this resource, which can be one of the following values: - GCE_ENDPOINT for addresses that are used by VM instances, alias IP ranges, load balancers, and similar resources. - DNS_RESOLVER for a DNS resolver address in a subnetwork for a Cloud DNS inbound forwarder IP addresses (regional internal IP address in a subnet of a VPC network) - VPC_PEERING for global internal IP addresses used for private services access allocated ranges. - NAT_AUTO for the regional external IP addresses used by Cloud NAT when allocating addresses using automatic NAT IP address allocation. - IPSEC_INTERCONNECT for addresses created from a private IP range that are reserved for a VLAN attachment in an *HA VPN over Cloud Interconnect* configuration. These addresses are regional resources. - `SHARED_LOADBALANCER_VIP` for an internal IP address that is assigned to multiple internal forwarding rules. - `PRIVATE_SERVICE_CONNECT` for a private network address that is used to configure Private Service Connect. Only global internal addresses can use this purpose. + * Check the Purpose enum for the list of possible values. + * + * Generated from protobuf field optional string purpose = 316407070; + */ + protected $purpose = null; + /** + * [Output Only] The URL of the region where a regional address resides. For regional addresses, you must specify the region as a path parameter in the HTTP request URL. *This field is not applicable to global addresses.* + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] The status of the address, which can be one of RESERVING, RESERVED, or IN_USE. An address that is RESERVING is currently in the process of being reserved. A RESERVED address is currently reserved and available to use. An IN_USE address is currently being used by another resource and is not available. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + /** + * The URL of the subnetwork in which to reserve the address. If an IP address is specified, it must be within the subnetwork's IP range. This field can only be used with INTERNAL type with a GCE_ENDPOINT or DNS_RESOLVER purpose. + * + * Generated from protobuf field optional string subnetwork = 307827694; + */ + protected $subnetwork = null; + /** + * [Output Only] The URLs of the resources that are using this address. + * + * Generated from protobuf field repeated string users = 111578632; + */ + private $users; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $address + * The static IP address represented by this resource. + * @type string $address_type + * The type of address to reserve, either INTERNAL or EXTERNAL. If unspecified, defaults to EXTERNAL. + * Check the AddressType enum for the list of possible values. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this field when you create the resource. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $ip_version + * The IP version that will be used by this address. Valid options are IPV4 or IPV6. + * Check the IpVersion enum for the list of possible values. + * @type string $ipv6_endpoint_type + * The endpoint type of this address, which should be VM or NETLB. This is used for deciding which type of endpoint this address can be used after the external IPv6 address reservation. + * Check the Ipv6EndpointType enum for the list of possible values. + * @type string $kind + * [Output Only] Type of the resource. Always compute#address for addresses. + * @type string $label_fingerprint + * A fingerprint for the labels being applied to this Address, 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 Address. + * @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 + * 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])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. + * @type string $network + * The URL of the network in which to reserve the address. This field can only be used with INTERNAL type with the VPC_PEERING purpose. + * @type string $network_tier + * This signifies the networking tier used for configuring this address and can only take the following values: PREMIUM or STANDARD. Internal IP addresses are always Premium Tier; global external IP addresses are always Premium Tier; regional external IP addresses can be either Standard or Premium Tier. If this field is not specified, it is assumed to be PREMIUM. + * Check the NetworkTier enum for the list of possible values. + * @type int $prefix_length + * The prefix length if the resource represents an IP range. + * @type string $purpose + * The purpose of this resource, which can be one of the following values: - GCE_ENDPOINT for addresses that are used by VM instances, alias IP ranges, load balancers, and similar resources. - DNS_RESOLVER for a DNS resolver address in a subnetwork for a Cloud DNS inbound forwarder IP addresses (regional internal IP address in a subnet of a VPC network) - VPC_PEERING for global internal IP addresses used for private services access allocated ranges. - NAT_AUTO for the regional external IP addresses used by Cloud NAT when allocating addresses using automatic NAT IP address allocation. - IPSEC_INTERCONNECT for addresses created from a private IP range that are reserved for a VLAN attachment in an *HA VPN over Cloud Interconnect* configuration. These addresses are regional resources. - `SHARED_LOADBALANCER_VIP` for an internal IP address that is assigned to multiple internal forwarding rules. - `PRIVATE_SERVICE_CONNECT` for a private network address that is used to configure Private Service Connect. Only global internal addresses can use this purpose. + * Check the Purpose enum for the list of possible values. + * @type string $region + * [Output Only] The URL of the region where a regional address resides. For regional addresses, you must specify the region as a path parameter in the HTTP request URL. *This field is not applicable to global addresses.* + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $status + * [Output Only] The status of the address, which can be one of RESERVING, RESERVED, or IN_USE. An address that is RESERVING is currently in the process of being reserved. A RESERVED address is currently reserved and available to use. An IN_USE address is currently being used by another resource and is not available. + * Check the Status enum for the list of possible values. + * @type string $subnetwork + * The URL of the subnetwork in which to reserve the address. If an IP address is specified, it must be within the subnetwork's IP range. This field can only be used with INTERNAL type with a GCE_ENDPOINT or DNS_RESOLVER purpose. + * @type array|\Google\Protobuf\Internal\RepeatedField $users + * [Output Only] The URLs of the resources that are using this address. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The static IP address represented by this resource. + * + * Generated from protobuf field optional string address = 462920692; + * @return string + */ + public function getAddress() + { + return isset($this->address) ? $this->address : ''; + } + + public function hasAddress() + { + return isset($this->address); + } + + public function clearAddress() + { + unset($this->address); + } + + /** + * The static IP address represented by this resource. + * + * Generated from protobuf field optional string address = 462920692; + * @param string $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkString($var, True); + $this->address = $var; + + return $this; + } + + /** + * The type of address to reserve, either INTERNAL or EXTERNAL. If unspecified, defaults to EXTERNAL. + * Check the AddressType enum for the list of possible values. + * + * Generated from protobuf field optional string address_type = 264307877; + * @return string + */ + public function getAddressType() + { + return isset($this->address_type) ? $this->address_type : ''; + } + + public function hasAddressType() + { + return isset($this->address_type); + } + + public function clearAddressType() + { + unset($this->address_type); + } + + /** + * The type of address to reserve, either INTERNAL or EXTERNAL. If unspecified, defaults to EXTERNAL. + * Check the AddressType enum for the list of possible values. + * + * Generated from protobuf field optional string address_type = 264307877; + * @param string $var + * @return $this + */ + public function setAddressType($var) + { + GPBUtil::checkString($var, True); + $this->address_type = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this field when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this field when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * The IP version that will be used by this address. Valid options are IPV4 or IPV6. + * Check the IpVersion enum for the list of possible values. + * + * Generated from protobuf field optional string ip_version = 294959552; + * @return string + */ + public function getIpVersion() + { + return isset($this->ip_version) ? $this->ip_version : ''; + } + + public function hasIpVersion() + { + return isset($this->ip_version); + } + + public function clearIpVersion() + { + unset($this->ip_version); + } + + /** + * The IP version that will be used by this address. Valid options are IPV4 or IPV6. + * Check the IpVersion enum for the list of possible values. + * + * Generated from protobuf field optional string ip_version = 294959552; + * @param string $var + * @return $this + */ + public function setIpVersion($var) + { + GPBUtil::checkString($var, True); + $this->ip_version = $var; + + return $this; + } + + /** + * The endpoint type of this address, which should be VM or NETLB. This is used for deciding which type of endpoint this address can be used after the external IPv6 address reservation. + * Check the Ipv6EndpointType enum for the list of possible values. + * + * Generated from protobuf field optional string ipv6_endpoint_type = 97501004; + * @return string + */ + public function getIpv6EndpointType() + { + return isset($this->ipv6_endpoint_type) ? $this->ipv6_endpoint_type : ''; + } + + public function hasIpv6EndpointType() + { + return isset($this->ipv6_endpoint_type); + } + + public function clearIpv6EndpointType() + { + unset($this->ipv6_endpoint_type); + } + + /** + * The endpoint type of this address, which should be VM or NETLB. This is used for deciding which type of endpoint this address can be used after the external IPv6 address reservation. + * Check the Ipv6EndpointType enum for the list of possible values. + * + * Generated from protobuf field optional string ipv6_endpoint_type = 97501004; + * @param string $var + * @return $this + */ + public function setIpv6EndpointType($var) + { + GPBUtil::checkString($var, True); + $this->ipv6_endpoint_type = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#address for addresses. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#address for addresses. + * + * 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; + } + + /** + * A fingerprint for the labels being applied to this Address, 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 Address. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @return string + */ + public function getLabelFingerprint() + { + return isset($this->label_fingerprint) ? $this->label_fingerprint : ''; + } + + public function hasLabelFingerprint() + { + return isset($this->label_fingerprint); + } + + public function clearLabelFingerprint() + { + unset($this->label_fingerprint); + } + + /** + * A fingerprint for the labels being applied to this Address, 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 Address. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @param string $var + * @return $this + */ + public function setLabelFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->label_fingerprint = $var; + + return $this; + } + + /** + * 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. + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->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. + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * 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])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. + * + * 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); + } + + /** + * 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])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. + * + * 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; + } + + /** + * The URL of the network in which to reserve the address. This field can only be used with INTERNAL type with the VPC_PEERING purpose. + * + * Generated from protobuf field optional string network = 232872494; + * @return string + */ + public function getNetwork() + { + return isset($this->network) ? $this->network : ''; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * The URL of the network in which to reserve the address. This field can only be used with INTERNAL type with the VPC_PEERING purpose. + * + * Generated from protobuf field optional string network = 232872494; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * This signifies the networking tier used for configuring this address and can only take the following values: PREMIUM or STANDARD. Internal IP addresses are always Premium Tier; global external IP addresses are always Premium Tier; regional external IP addresses can be either Standard or Premium Tier. If this field is not specified, it is assumed to be PREMIUM. + * Check the NetworkTier enum for the list of possible values. + * + * Generated from protobuf field optional string network_tier = 517397843; + * @return string + */ + public function getNetworkTier() + { + return isset($this->network_tier) ? $this->network_tier : ''; + } + + public function hasNetworkTier() + { + return isset($this->network_tier); + } + + public function clearNetworkTier() + { + unset($this->network_tier); + } + + /** + * This signifies the networking tier used for configuring this address and can only take the following values: PREMIUM or STANDARD. Internal IP addresses are always Premium Tier; global external IP addresses are always Premium Tier; regional external IP addresses can be either Standard or Premium Tier. If this field is not specified, it is assumed to be PREMIUM. + * Check the NetworkTier enum for the list of possible values. + * + * Generated from protobuf field optional string network_tier = 517397843; + * @param string $var + * @return $this + */ + public function setNetworkTier($var) + { + GPBUtil::checkString($var, True); + $this->network_tier = $var; + + return $this; + } + + /** + * The prefix length if the resource represents an IP range. + * + * Generated from protobuf field optional int32 prefix_length = 453565747; + * @return int + */ + public function getPrefixLength() + { + return isset($this->prefix_length) ? $this->prefix_length : 0; + } + + public function hasPrefixLength() + { + return isset($this->prefix_length); + } + + public function clearPrefixLength() + { + unset($this->prefix_length); + } + + /** + * The prefix length if the resource represents an IP range. + * + * Generated from protobuf field optional int32 prefix_length = 453565747; + * @param int $var + * @return $this + */ + public function setPrefixLength($var) + { + GPBUtil::checkInt32($var); + $this->prefix_length = $var; + + return $this; + } + + /** + * The purpose of this resource, which can be one of the following values: - GCE_ENDPOINT for addresses that are used by VM instances, alias IP ranges, load balancers, and similar resources. - DNS_RESOLVER for a DNS resolver address in a subnetwork for a Cloud DNS inbound forwarder IP addresses (regional internal IP address in a subnet of a VPC network) - VPC_PEERING for global internal IP addresses used for private services access allocated ranges. - NAT_AUTO for the regional external IP addresses used by Cloud NAT when allocating addresses using automatic NAT IP address allocation. - IPSEC_INTERCONNECT for addresses created from a private IP range that are reserved for a VLAN attachment in an *HA VPN over Cloud Interconnect* configuration. These addresses are regional resources. - `SHARED_LOADBALANCER_VIP` for an internal IP address that is assigned to multiple internal forwarding rules. - `PRIVATE_SERVICE_CONNECT` for a private network address that is used to configure Private Service Connect. Only global internal addresses can use this purpose. + * Check the Purpose enum for the list of possible values. + * + * Generated from protobuf field optional string purpose = 316407070; + * @return string + */ + public function getPurpose() + { + return isset($this->purpose) ? $this->purpose : ''; + } + + public function hasPurpose() + { + return isset($this->purpose); + } + + public function clearPurpose() + { + unset($this->purpose); + } + + /** + * The purpose of this resource, which can be one of the following values: - GCE_ENDPOINT for addresses that are used by VM instances, alias IP ranges, load balancers, and similar resources. - DNS_RESOLVER for a DNS resolver address in a subnetwork for a Cloud DNS inbound forwarder IP addresses (regional internal IP address in a subnet of a VPC network) - VPC_PEERING for global internal IP addresses used for private services access allocated ranges. - NAT_AUTO for the regional external IP addresses used by Cloud NAT when allocating addresses using automatic NAT IP address allocation. - IPSEC_INTERCONNECT for addresses created from a private IP range that are reserved for a VLAN attachment in an *HA VPN over Cloud Interconnect* configuration. These addresses are regional resources. - `SHARED_LOADBALANCER_VIP` for an internal IP address that is assigned to multiple internal forwarding rules. - `PRIVATE_SERVICE_CONNECT` for a private network address that is used to configure Private Service Connect. Only global internal addresses can use this purpose. + * Check the Purpose enum for the list of possible values. + * + * Generated from protobuf field optional string purpose = 316407070; + * @param string $var + * @return $this + */ + public function setPurpose($var) + { + GPBUtil::checkString($var, True); + $this->purpose = $var; + + return $this; + } + + /** + * [Output Only] The URL of the region where a regional address resides. For regional addresses, you must specify the region as a path parameter in the HTTP request URL. *This field is not applicable to global addresses.* + * + * 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] The URL of the region where a regional address resides. For regional addresses, you must specify the region as a path parameter in the HTTP request URL. *This field is not applicable to global addresses.* + * + * 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] Server-defined URL for the 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 the 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] The status of the address, which can be one of RESERVING, RESERVED, or IN_USE. An address that is RESERVING is currently in the process of being reserved. A RESERVED address is currently reserved and available to use. An IN_USE address is currently being used by another resource and is not available. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] The status of the address, which can be one of RESERVING, RESERVED, or IN_USE. An address that is RESERVING is currently in the process of being reserved. A RESERVED address is currently reserved and available to use. An IN_USE address is currently being used by another resource and is not available. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + + /** + * The URL of the subnetwork in which to reserve the address. If an IP address is specified, it must be within the subnetwork's IP range. This field can only be used with INTERNAL type with a GCE_ENDPOINT or DNS_RESOLVER purpose. + * + * Generated from protobuf field optional string subnetwork = 307827694; + * @return string + */ + public function getSubnetwork() + { + return isset($this->subnetwork) ? $this->subnetwork : ''; + } + + public function hasSubnetwork() + { + return isset($this->subnetwork); + } + + public function clearSubnetwork() + { + unset($this->subnetwork); + } + + /** + * The URL of the subnetwork in which to reserve the address. If an IP address is specified, it must be within the subnetwork's IP range. This field can only be used with INTERNAL type with a GCE_ENDPOINT or DNS_RESOLVER purpose. + * + * Generated from protobuf field optional string subnetwork = 307827694; + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork = $var; + + return $this; + } + + /** + * [Output Only] The URLs of the resources that are using this address. + * + * Generated from protobuf field repeated string users = 111578632; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUsers() + { + return $this->users; + } + + /** + * [Output Only] The URLs of the resources that are using this address. + * + * Generated from protobuf field repeated string users = 111578632; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUsers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->users = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/AddressType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/AddressType.php new file mode 100644 index 000000000000..7a0d1dd95ee3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/AddressType.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.Address.AddressType + */ +class AddressType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ADDRESS_TYPE = 0; + */ + const UNDEFINED_ADDRESS_TYPE = 0; + /** + * A publicly visible external IP address. + * + * Generated from protobuf enum EXTERNAL = 35607499; + */ + const EXTERNAL = 35607499; + /** + * A private network IP address, for use with an Instance or Internal Load Balancer forwarding rule. + * + * Generated from protobuf enum INTERNAL = 279295677; + */ + const INTERNAL = 279295677; + /** + * Generated from protobuf enum UNSPECIFIED_TYPE = 53933922; + */ + const UNSPECIFIED_TYPE = 53933922; + + private static $valueToName = [ + self::UNDEFINED_ADDRESS_TYPE => 'UNDEFINED_ADDRESS_TYPE', + self::EXTERNAL => 'EXTERNAL', + self::INTERNAL => 'INTERNAL', + self::UNSPECIFIED_TYPE => 'UNSPECIFIED_TYPE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AddressType::class, \Google\Cloud\Compute\V1\Address_AddressType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/IpVersion.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/IpVersion.php new file mode 100644 index 000000000000..3d38e4ba2af7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/IpVersion.php @@ -0,0 +1,65 @@ +google.cloud.compute.v1.Address.IpVersion + */ +class IpVersion +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_IP_VERSION = 0; + */ + const UNDEFINED_IP_VERSION = 0; + /** + * Generated from protobuf enum IPV4 = 2254341; + */ + const IPV4 = 2254341; + /** + * Generated from protobuf enum IPV6 = 2254343; + */ + const IPV6 = 2254343; + /** + * Generated from protobuf enum UNSPECIFIED_VERSION = 21850000; + */ + const UNSPECIFIED_VERSION = 21850000; + + private static $valueToName = [ + self::UNDEFINED_IP_VERSION => 'UNDEFINED_IP_VERSION', + self::IPV4 => 'IPV4', + self::IPV6 => 'IPV6', + self::UNSPECIFIED_VERSION => 'UNSPECIFIED_VERSION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IpVersion::class, \Google\Cloud\Compute\V1\Address_IpVersion::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/Ipv6EndpointType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/Ipv6EndpointType.php new file mode 100644 index 000000000000..08db398b1069 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/Ipv6EndpointType.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.Address.Ipv6EndpointType + */ +class Ipv6EndpointType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_IPV6_ENDPOINT_TYPE = 0; + */ + const UNDEFINED_IPV6_ENDPOINT_TYPE = 0; + /** + * Reserved IPv6 address can be used on network load balancer. + * + * Generated from protobuf enum NETLB = 74173363; + */ + const NETLB = 74173363; + /** + * Reserved IPv6 address can be used on VM. + * + * Generated from protobuf enum VM = 2743; + */ + const VM = 2743; + + private static $valueToName = [ + self::UNDEFINED_IPV6_ENDPOINT_TYPE => 'UNDEFINED_IPV6_ENDPOINT_TYPE', + self::NETLB => 'NETLB', + self::VM => 'VM', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Ipv6EndpointType::class, \Google\Cloud\Compute\V1\Address_Ipv6EndpointType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/NetworkTier.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/NetworkTier.php new file mode 100644 index 000000000000..fac6a50dbdd6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/NetworkTier.php @@ -0,0 +1,78 @@ +google.cloud.compute.v1.Address.NetworkTier + */ +class NetworkTier +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_NETWORK_TIER = 0; + */ + const UNDEFINED_NETWORK_TIER = 0; + /** + * Public internet quality with fixed bandwidth. + * + * Generated from protobuf enum FIXED_STANDARD = 310464328; + */ + const FIXED_STANDARD = 310464328; + /** + * High quality, Google-grade network tier, support for all networking products. + * + * Generated from protobuf enum PREMIUM = 399530551; + */ + const PREMIUM = 399530551; + /** + * Public internet quality, only limited support for other networking products. + * + * Generated from protobuf enum STANDARD = 484642493; + */ + const STANDARD = 484642493; + /** + * (Output only) Temporary tier for FIXED_STANDARD when fixed standard tier is expired or not configured. + * + * Generated from protobuf enum STANDARD_OVERRIDES_FIXED_STANDARD = 465847234; + */ + const STANDARD_OVERRIDES_FIXED_STANDARD = 465847234; + + private static $valueToName = [ + self::UNDEFINED_NETWORK_TIER => 'UNDEFINED_NETWORK_TIER', + self::FIXED_STANDARD => 'FIXED_STANDARD', + self::PREMIUM => 'PREMIUM', + self::STANDARD => 'STANDARD', + self::STANDARD_OVERRIDES_FIXED_STANDARD => 'STANDARD_OVERRIDES_FIXED_STANDARD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NetworkTier::class, \Google\Cloud\Compute\V1\Address_NetworkTier::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/Purpose.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/Purpose.php new file mode 100644 index 000000000000..ef161970df7e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/Purpose.php @@ -0,0 +1,106 @@ +google.cloud.compute.v1.Address.Purpose + */ +class Purpose +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PURPOSE = 0; + */ + const UNDEFINED_PURPOSE = 0; + /** + * DNS resolver address in the subnetwork. + * + * Generated from protobuf enum DNS_RESOLVER = 476114556; + */ + const DNS_RESOLVER = 476114556; + /** + * VM internal/alias IP, Internal LB service IP, etc. + * + * Generated from protobuf enum GCE_ENDPOINT = 230515243; + */ + 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. + * + * Generated from protobuf enum IPSEC_INTERCONNECT = 340437251; + */ + const IPSEC_INTERCONNECT = 340437251; + /** + * External IP automatically reserved for Cloud NAT. + * + * Generated from protobuf enum NAT_AUTO = 163666477; + */ + const NAT_AUTO = 163666477; + /** + * A private network IP address that can be used to configure Private Service Connect. This purpose can be specified only for GLOBAL addresses of Type INTERNAL + * + * Generated from protobuf enum PRIVATE_SERVICE_CONNECT = 48134724; + */ + const PRIVATE_SERVICE_CONNECT = 48134724; + /** + * A regional internal IP address range reserved for Serverless. + * + * Generated from protobuf enum SERVERLESS = 270492508; + */ + const SERVERLESS = 270492508; + /** + * A private network IP address that can be shared by multiple Internal Load Balancer forwarding rules. + * + * Generated from protobuf enum SHARED_LOADBALANCER_VIP = 294447572; + */ + const SHARED_LOADBALANCER_VIP = 294447572; + /** + * IP range for peer networks. + * + * Generated from protobuf enum VPC_PEERING = 400800170; + */ + const VPC_PEERING = 400800170; + + private static $valueToName = [ + self::UNDEFINED_PURPOSE => 'UNDEFINED_PURPOSE', + self::DNS_RESOLVER => 'DNS_RESOLVER', + self::GCE_ENDPOINT => 'GCE_ENDPOINT', + self::IPSEC_INTERCONNECT => 'IPSEC_INTERCONNECT', + self::NAT_AUTO => 'NAT_AUTO', + self::PRIVATE_SERVICE_CONNECT => 'PRIVATE_SERVICE_CONNECT', + self::SERVERLESS => 'SERVERLESS', + self::SHARED_LOADBALANCER_VIP => 'SHARED_LOADBALANCER_VIP', + self::VPC_PEERING => 'VPC_PEERING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Purpose::class, \Google\Cloud\Compute\V1\Address_Purpose::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/Status.php new file mode 100644 index 000000000000..3e7f4bbf235f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Address/Status.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.Address.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * Address is being used by another resource and is not available. + * + * Generated from protobuf enum IN_USE = 17393485; + */ + const IN_USE = 17393485; + /** + * Address is reserved and available to use. + * + * Generated from protobuf enum RESERVED = 432241448; + */ + const RESERVED = 432241448; + /** + * Address is being reserved. + * + * Generated from protobuf enum RESERVING = 514587225; + */ + const RESERVING = 514587225; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::IN_USE => 'IN_USE', + self::RESERVED => 'RESERVED', + self::RESERVING => 'RESERVING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\Address_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddressAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddressAggregatedList.php new file mode 100644 index 000000000000..ffef64f54854 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddressAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.AddressAggregatedList + */ +class AddressAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of AddressesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#addressAggregatedList for aggregated lists of addresses. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 AddressesScopedList resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#addressAggregatedList for aggregated lists of addresses. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 AddressesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of AddressesScopedList 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\AddressesScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#addressAggregatedList for aggregated lists of addresses. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#addressAggregatedList for aggregated lists of addresses. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddressList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddressList.php new file mode 100644 index 000000000000..ec6897b6d480 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddressList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.AddressList + */ +class AddressList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of Address resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Address items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#addressList for lists of addresses. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\Address>|\Google\Protobuf\Internal\RepeatedField $items + * A list of Address resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#addressList for lists of addresses. + * @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 Address resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Address items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of Address resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Address items = 100526016; + * @param array<\Google\Cloud\Compute\V1\Address>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Address::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#addressList for lists of addresses. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#addressList for lists of addresses. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddressesScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddressesScopedList.php new file mode 100644 index 000000000000..0a4a79b278a8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AddressesScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.AddressesScopedList + */ +class AddressesScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A list of addresses contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Address addresses = 337673122; + */ + private $addresses; + /** + * [Output Only] Informational warning which replaces the list of addresses when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\Address>|\Google\Protobuf\Internal\RepeatedField $addresses + * [Output Only] A list of addresses contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] Informational warning which replaces the list of addresses 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 addresses contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Address addresses = 337673122; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAddresses() + { + return $this->addresses; + } + + /** + * [Output Only] A list of addresses contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Address addresses = 337673122; + * @param array<\Google\Cloud\Compute\V1\Address>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAddresses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Address::class); + $this->addresses = $arr; + + return $this; + } + + /** + * [Output Only] Informational warning which replaces the list of addresses 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] Informational warning which replaces the list of addresses 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AdvancedMachineFeatures.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AdvancedMachineFeatures.php new file mode 100644 index 000000000000..6cc23bc3a7dc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AdvancedMachineFeatures.php @@ -0,0 +1,209 @@ +google.cloud.compute.v1.AdvancedMachineFeatures + */ +class AdvancedMachineFeatures extends \Google\Protobuf\Internal\Message +{ + /** + * Whether to enable nested virtualization or not (default is false). + * + * Generated from protobuf field optional bool enable_nested_virtualization = 16639365; + */ + protected $enable_nested_virtualization = null; + /** + * Whether to enable UEFI networking for instance creation. + * + * Generated from protobuf field optional bool enable_uefi_networking = 334485668; + */ + protected $enable_uefi_networking = null; + /** + * The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed. + * + * Generated from protobuf field optional int32 threads_per_core = 352611671; + */ + protected $threads_per_core = null; + /** + * The number of physical cores to expose to an instance. Multiply by the number of threads per core to compute the total number of virtual CPUs to expose to the instance. If unset, the number of cores is inferred from the instance's nominal CPU count and the underlying platform's SMT width. + * + * Generated from protobuf field optional int32 visible_core_count = 193198684; + */ + protected $visible_core_count = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_nested_virtualization + * Whether to enable nested virtualization or not (default is false). + * @type bool $enable_uefi_networking + * Whether to enable UEFI networking for instance creation. + * @type int $threads_per_core + * The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed. + * @type int $visible_core_count + * The number of physical cores to expose to an instance. Multiply by the number of threads per core to compute the total number of virtual CPUs to expose to the instance. If unset, the number of cores is inferred from the instance's nominal CPU count and the underlying platform's SMT width. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Whether to enable nested virtualization or not (default is false). + * + * Generated from protobuf field optional bool enable_nested_virtualization = 16639365; + * @return bool + */ + public function getEnableNestedVirtualization() + { + return isset($this->enable_nested_virtualization) ? $this->enable_nested_virtualization : false; + } + + public function hasEnableNestedVirtualization() + { + return isset($this->enable_nested_virtualization); + } + + public function clearEnableNestedVirtualization() + { + unset($this->enable_nested_virtualization); + } + + /** + * Whether to enable nested virtualization or not (default is false). + * + * Generated from protobuf field optional bool enable_nested_virtualization = 16639365; + * @param bool $var + * @return $this + */ + public function setEnableNestedVirtualization($var) + { + GPBUtil::checkBool($var); + $this->enable_nested_virtualization = $var; + + return $this; + } + + /** + * Whether to enable UEFI networking for instance creation. + * + * Generated from protobuf field optional bool enable_uefi_networking = 334485668; + * @return bool + */ + public function getEnableUefiNetworking() + { + return isset($this->enable_uefi_networking) ? $this->enable_uefi_networking : false; + } + + public function hasEnableUefiNetworking() + { + return isset($this->enable_uefi_networking); + } + + public function clearEnableUefiNetworking() + { + unset($this->enable_uefi_networking); + } + + /** + * Whether to enable UEFI networking for instance creation. + * + * Generated from protobuf field optional bool enable_uefi_networking = 334485668; + * @param bool $var + * @return $this + */ + public function setEnableUefiNetworking($var) + { + GPBUtil::checkBool($var); + $this->enable_uefi_networking = $var; + + return $this; + } + + /** + * The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed. + * + * Generated from protobuf field optional int32 threads_per_core = 352611671; + * @return int + */ + public function getThreadsPerCore() + { + return isset($this->threads_per_core) ? $this->threads_per_core : 0; + } + + public function hasThreadsPerCore() + { + return isset($this->threads_per_core); + } + + public function clearThreadsPerCore() + { + unset($this->threads_per_core); + } + + /** + * The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed. + * + * Generated from protobuf field optional int32 threads_per_core = 352611671; + * @param int $var + * @return $this + */ + public function setThreadsPerCore($var) + { + GPBUtil::checkInt32($var); + $this->threads_per_core = $var; + + return $this; + } + + /** + * The number of physical cores to expose to an instance. Multiply by the number of threads per core to compute the total number of virtual CPUs to expose to the instance. If unset, the number of cores is inferred from the instance's nominal CPU count and the underlying platform's SMT width. + * + * Generated from protobuf field optional int32 visible_core_count = 193198684; + * @return int + */ + public function getVisibleCoreCount() + { + return isset($this->visible_core_count) ? $this->visible_core_count : 0; + } + + public function hasVisibleCoreCount() + { + return isset($this->visible_core_count); + } + + public function clearVisibleCoreCount() + { + unset($this->visible_core_count); + } + + /** + * The number of physical cores to expose to an instance. Multiply by the number of threads per core to compute the total number of virtual CPUs to expose to the instance. If unset, the number of cores is inferred from the instance's nominal CPU count and the underlying platform's SMT width. + * + * Generated from protobuf field optional int32 visible_core_count = 193198684; + * @param int $var + * @return $this + */ + public function setVisibleCoreCount($var) + { + GPBUtil::checkInt32($var); + $this->visible_core_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListAcceleratorTypesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListAcceleratorTypesRequest.php new file mode 100644 index 000000000000..f13d2263ebf9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListAcceleratorTypesRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + */ +class AggregatedListAcceleratorTypesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListAcceleratorTypesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListAddressesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListAddressesRequest.php new file mode 100644 index 000000000000..c101c3ce5704 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListAddressesRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListAddressesRequest + */ +class AggregatedListAddressesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListAddressesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListAutoscalersRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListAutoscalersRequest.php new file mode 100644 index 000000000000..1ec5e79a77f2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListAutoscalersRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListAutoscalersRequest + */ +class AggregatedListAutoscalersRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListAutoscalersRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListBackendServicesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListBackendServicesRequest.php new file mode 100644 index 000000000000..1309a9a1d63d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListBackendServicesRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListBackendServicesRequest + */ +class AggregatedListBackendServicesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Name of the project scoping this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Name of the project scoping this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListBackendServicesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListDiskTypesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListDiskTypesRequest.php new file mode 100644 index 000000000000..4862fab08c07 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListDiskTypesRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListDiskTypesRequest + */ +class AggregatedListDiskTypesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListDiskTypesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListDisksRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListDisksRequest.php new file mode 100644 index 000000000000..a73f0e5d4f7b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListDisksRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListDisksRequest + */ +class AggregatedListDisksRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListDisksRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListForwardingRulesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListForwardingRulesRequest.php new file mode 100644 index 000000000000..f2784259d846 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListForwardingRulesRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListForwardingRulesRequest + */ +class AggregatedListForwardingRulesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListForwardingRulesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListGlobalOperationsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListGlobalOperationsRequest.php new file mode 100644 index 000000000000..c93d36c9c9d7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListGlobalOperationsRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + */ +class AggregatedListGlobalOperationsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListGlobalOperationsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListHealthChecksRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListHealthChecksRequest.php new file mode 100644 index 000000000000..ec11ea6e303a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListHealthChecksRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListHealthChecksRequest + */ +class AggregatedListHealthChecksRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Name of the project scoping this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Name of the project scoping this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListHealthChecksRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInstanceGroupManagersRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInstanceGroupManagersRequest.php new file mode 100644 index 000000000000..edf47bf1aa28 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInstanceGroupManagersRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + */ +class AggregatedListInstanceGroupManagersRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListInstanceGroupManagersRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInstanceGroupsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInstanceGroupsRequest.php new file mode 100644 index 000000000000..56f8a50d2802 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInstanceGroupsRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + */ +class AggregatedListInstanceGroupsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListInstanceGroupsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInstanceTemplatesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInstanceTemplatesRequest.php new file mode 100644 index 000000000000..3eb9e5938445 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInstanceTemplatesRequest.php @@ -0,0 +1,388 @@ +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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Name of the project scoping this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Name of the project scoping this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListInstanceTemplatesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInstancesRequest.php new file mode 100644 index 000000000000..b6bb5cf1b790 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInstancesRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListInstancesRequest + */ +class AggregatedListInstancesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListInstancesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInstantSnapshotsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInstantSnapshotsRequest.php new file mode 100644 index 000000000000..558031241b5f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInstantSnapshotsRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListInstantSnapshotsRequest + */ +class AggregatedListInstantSnapshotsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListInstantSnapshotsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInterconnectAttachmentsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInterconnectAttachmentsRequest.php new file mode 100644 index 000000000000..be138c42e9ea --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListInterconnectAttachmentsRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + */ +class AggregatedListInterconnectAttachmentsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListInterconnectAttachmentsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListMachineTypesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListMachineTypesRequest.php new file mode 100644 index 000000000000..abb58ff1b5ab --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListMachineTypesRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListMachineTypesRequest + */ +class AggregatedListMachineTypesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListMachineTypesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNetworkAttachmentsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNetworkAttachmentsRequest.php new file mode 100644 index 000000000000..82f010eb2e8f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNetworkAttachmentsRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListNetworkAttachmentsRequest + */ +class AggregatedListNetworkAttachmentsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListNetworkAttachmentsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNetworkEdgeSecurityServicesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNetworkEdgeSecurityServicesRequest.php new file mode 100644 index 000000000000..11d3c5597bf4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNetworkEdgeSecurityServicesRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListNetworkEdgeSecurityServicesRequest + */ +class AggregatedListNetworkEdgeSecurityServicesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Name of the project scoping this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Name of the project scoping this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListNetworkEdgeSecurityServicesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNetworkEndpointGroupsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNetworkEndpointGroupsRequest.php new file mode 100644 index 000000000000..dfa580dd58ba --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNetworkEndpointGroupsRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + */ +class AggregatedListNetworkEndpointGroupsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListNetworkEndpointGroupsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNodeGroupsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNodeGroupsRequest.php new file mode 100644 index 000000000000..83e4a758d879 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNodeGroupsRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListNodeGroupsRequest + */ +class AggregatedListNodeGroupsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListNodeGroupsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNodeTemplatesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNodeTemplatesRequest.php new file mode 100644 index 000000000000..1dc616bb5b1b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNodeTemplatesRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + */ +class AggregatedListNodeTemplatesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListNodeTemplatesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNodeTypesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNodeTypesRequest.php new file mode 100644 index 000000000000..7ed07a3ef260 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListNodeTypesRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListNodeTypesRequest + */ +class AggregatedListNodeTypesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListNodeTypesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListPacketMirroringsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListPacketMirroringsRequest.php new file mode 100644 index 000000000000..d3a3bef11799 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListPacketMirroringsRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + */ +class AggregatedListPacketMirroringsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListPacketMirroringsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListPublicDelegatedPrefixesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListPublicDelegatedPrefixesRequest.php new file mode 100644 index 000000000000..ab76002e6758 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListPublicDelegatedPrefixesRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + */ +class AggregatedListPublicDelegatedPrefixesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Name of the project scoping this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Name of the project scoping this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListPublicDelegatedPrefixesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListRegionCommitmentsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListRegionCommitmentsRequest.php new file mode 100644 index 000000000000..592178644c7c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListRegionCommitmentsRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + */ +class AggregatedListRegionCommitmentsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListRegionCommitmentsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListReservationsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListReservationsRequest.php new file mode 100644 index 000000000000..19fd8ba660de --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListReservationsRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListReservationsRequest + */ +class AggregatedListReservationsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListReservationsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListResourcePoliciesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListResourcePoliciesRequest.php new file mode 100644 index 000000000000..942a024991da --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListResourcePoliciesRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + */ +class AggregatedListResourcePoliciesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListResourcePoliciesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListRoutersRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListRoutersRequest.php new file mode 100644 index 000000000000..9f22dc83f559 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListRoutersRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListRoutersRequest + */ +class AggregatedListRoutersRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListRoutersRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListSecurityPoliciesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListSecurityPoliciesRequest.php new file mode 100644 index 000000000000..6d85ad2789f5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListSecurityPoliciesRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListSecurityPoliciesRequest + */ +class AggregatedListSecurityPoliciesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Name of the project scoping this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Name of the project scoping this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListSecurityPoliciesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListServiceAttachmentsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListServiceAttachmentsRequest.php new file mode 100644 index 000000000000..ec2c67d98d21 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListServiceAttachmentsRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListServiceAttachmentsRequest + */ +class AggregatedListServiceAttachmentsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Name of the project scoping this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Name of the project scoping this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListServiceAttachmentsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListSslCertificatesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListSslCertificatesRequest.php new file mode 100644 index 000000000000..12cab1f4df69 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListSslCertificatesRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListSslCertificatesRequest + */ +class AggregatedListSslCertificatesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Name of the project scoping this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Name of the project scoping this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListSslCertificatesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListSslPoliciesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListSslPoliciesRequest.php new file mode 100644 index 000000000000..6192b9a0e1a8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListSslPoliciesRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListSslPoliciesRequest + */ +class AggregatedListSslPoliciesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Name of the project scoping this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Name of the project scoping this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListSslPoliciesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListStoragePoolTypesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListStoragePoolTypesRequest.php new file mode 100644 index 000000000000..864771e4e8b6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListStoragePoolTypesRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListStoragePoolTypesRequest + */ +class AggregatedListStoragePoolTypesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListStoragePoolTypesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListStoragePoolsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListStoragePoolsRequest.php new file mode 100644 index 000000000000..5227898d2e71 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListStoragePoolsRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListStoragePoolsRequest + */ +class AggregatedListStoragePoolsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListStoragePoolsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListSubnetworksRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListSubnetworksRequest.php new file mode 100644 index 000000000000..ab63f9aca6a7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListSubnetworksRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListSubnetworksRequest + */ +class AggregatedListSubnetworksRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListSubnetworksRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetHttpProxiesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetHttpProxiesRequest.php new file mode 100644 index 000000000000..9a1db4308420 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetHttpProxiesRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + */ +class AggregatedListTargetHttpProxiesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Name of the project scoping this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Name of the project scoping this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListTargetHttpProxiesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetHttpsProxiesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetHttpsProxiesRequest.php new file mode 100644 index 000000000000..f9b472196d0a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetHttpsProxiesRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + */ +class AggregatedListTargetHttpsProxiesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Name of the project scoping this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Name of the project scoping this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListTargetHttpsProxiesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetInstancesRequest.php new file mode 100644 index 000000000000..5c4a2153b133 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetInstancesRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListTargetInstancesRequest + */ +class AggregatedListTargetInstancesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListTargetInstancesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetPoolsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetPoolsRequest.php new file mode 100644 index 000000000000..5e23007ccba1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetPoolsRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListTargetPoolsRequest + */ +class AggregatedListTargetPoolsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListTargetPoolsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetTcpProxiesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetTcpProxiesRequest.php new file mode 100644 index 000000000000..235d2859ade0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetTcpProxiesRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListTargetTcpProxiesRequest + */ +class AggregatedListTargetTcpProxiesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Name of the project scoping this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Name of the project scoping this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListTargetTcpProxiesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetVpnGatewaysRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetVpnGatewaysRequest.php new file mode 100644 index 000000000000..80bf05d3ecc5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListTargetVpnGatewaysRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + */ +class AggregatedListTargetVpnGatewaysRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListTargetVpnGatewaysRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListUrlMapsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListUrlMapsRequest.php new file mode 100644 index 000000000000..636fc4676ba6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListUrlMapsRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListUrlMapsRequest + */ +class AggregatedListUrlMapsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Name of the project scoping this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Name of the project scoping this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListUrlMapsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListVpnGatewaysRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListVpnGatewaysRequest.php new file mode 100644 index 000000000000..4feb678576eb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListVpnGatewaysRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + */ +class AggregatedListVpnGatewaysRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListVpnGatewaysRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListVpnTunnelsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListVpnTunnelsRequest.php new file mode 100644 index 000000000000..b5b22510dca1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AggregatedListVpnTunnelsRequest.php @@ -0,0 +1,388 @@ +google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + */ +class AggregatedListVpnTunnelsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + */ + protected $service_project_number = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\AggregatedListVpnTunnelsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Project ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int|string $service_project_number + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @return int|string + */ + public function getServiceProjectNumber() + { + return isset($this->service_project_number) ? $this->service_project_number : 0; + } + + public function hasServiceProjectNumber() + { + return isset($this->service_project_number); + } + + public function clearServiceProjectNumber() + { + unset($this->service_project_number); + } + + /** + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * + * Generated from protobuf field optional int64 service_project_number = 316757497; + * @param int|string $var + * @return $this + */ + public function setServiceProjectNumber($var) + { + GPBUtil::checkInt64($var); + $this->service_project_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AliasIpRange.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AliasIpRange.php new file mode 100644 index 000000000000..0793eb5ad565 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AliasIpRange.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.AliasIpRange + */ +class AliasIpRange extends \Google\Protobuf\Internal\Message +{ + /** + * The IP alias ranges to allocate for this interface. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be a single IP address (such as 10.2.3.4), a netmask (such as /24) or a CIDR-formatted string (such as 10.1.2.0/24). + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + */ + protected $ip_cidr_range = null; + /** + * The name of a subnetwork secondary IP range from which to allocate an IP alias range. If not specified, the primary range of the subnetwork is used. + * + * Generated from protobuf field optional string subnetwork_range_name = 387995966; + */ + protected $subnetwork_range_name = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ip_cidr_range + * The IP alias ranges to allocate for this interface. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be a single IP address (such as 10.2.3.4), a netmask (such as /24) or a CIDR-formatted string (such as 10.1.2.0/24). + * @type string $subnetwork_range_name + * The name of a subnetwork secondary IP range from which to allocate an IP alias range. If not specified, the primary range of the subnetwork is used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The IP alias ranges to allocate for this interface. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be a single IP address (such as 10.2.3.4), a netmask (such as /24) or a CIDR-formatted string (such as 10.1.2.0/24). + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + * @return string + */ + public function getIpCidrRange() + { + return isset($this->ip_cidr_range) ? $this->ip_cidr_range : ''; + } + + public function hasIpCidrRange() + { + return isset($this->ip_cidr_range); + } + + public function clearIpCidrRange() + { + unset($this->ip_cidr_range); + } + + /** + * The IP alias ranges to allocate for this interface. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be a single IP address (such as 10.2.3.4), a netmask (such as /24) or a CIDR-formatted string (such as 10.1.2.0/24). + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + * @param string $var + * @return $this + */ + public function setIpCidrRange($var) + { + GPBUtil::checkString($var, True); + $this->ip_cidr_range = $var; + + return $this; + } + + /** + * The name of a subnetwork secondary IP range from which to allocate an IP alias range. If not specified, the primary range of the subnetwork is used. + * + * Generated from protobuf field optional string subnetwork_range_name = 387995966; + * @return string + */ + public function getSubnetworkRangeName() + { + return isset($this->subnetwork_range_name) ? $this->subnetwork_range_name : ''; + } + + public function hasSubnetworkRangeName() + { + return isset($this->subnetwork_range_name); + } + + public function clearSubnetworkRangeName() + { + unset($this->subnetwork_range_name); + } + + /** + * The name of a subnetwork secondary IP range from which to allocate an IP alias range. If not specified, the primary range of the subnetwork is used. + * + * Generated from protobuf field optional string subnetwork_range_name = 387995966; + * @param string $var + * @return $this + */ + public function setSubnetworkRangeName($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork_range_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationAggregateReservation.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationAggregateReservation.php new file mode 100644 index 000000000000..13d7605c79a3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationAggregateReservation.php @@ -0,0 +1,197 @@ +google.cloud.compute.v1.AllocationAggregateReservation + */ +class AllocationAggregateReservation extends \Google\Protobuf\Internal\Message +{ + /** + * [Output only] List of resources currently in use. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AllocationAggregateReservationReservedResourceInfo in_use_resources = 409009107; + */ + private $in_use_resources; + /** + * List of reserved resources (CPUs, memory, accelerators). + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AllocationAggregateReservationReservedResourceInfo reserved_resources = 213217742; + */ + private $reserved_resources; + /** + * The VM family that all instances scheduled against this reservation must belong to. + * Check the VmFamily enum for the list of possible values. + * + * Generated from protobuf field optional string vm_family = 125017580; + */ + protected $vm_family = null; + /** + * The workload type of the instances that will target this reservation. + * Check the WorkloadType enum for the list of possible values. + * + * Generated from protobuf field optional string workload_type = 273432322; + */ + protected $workload_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\AllocationAggregateReservationReservedResourceInfo>|\Google\Protobuf\Internal\RepeatedField $in_use_resources + * [Output only] List of resources currently in use. + * @type array<\Google\Cloud\Compute\V1\AllocationAggregateReservationReservedResourceInfo>|\Google\Protobuf\Internal\RepeatedField $reserved_resources + * List of reserved resources (CPUs, memory, accelerators). + * @type string $vm_family + * The VM family that all instances scheduled against this reservation must belong to. + * Check the VmFamily enum for the list of possible values. + * @type string $workload_type + * The workload type of the instances that will target this reservation. + * Check the WorkloadType enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output only] List of resources currently in use. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AllocationAggregateReservationReservedResourceInfo in_use_resources = 409009107; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInUseResources() + { + return $this->in_use_resources; + } + + /** + * [Output only] List of resources currently in use. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AllocationAggregateReservationReservedResourceInfo in_use_resources = 409009107; + * @param array<\Google\Cloud\Compute\V1\AllocationAggregateReservationReservedResourceInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInUseResources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AllocationAggregateReservationReservedResourceInfo::class); + $this->in_use_resources = $arr; + + return $this; + } + + /** + * List of reserved resources (CPUs, memory, accelerators). + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AllocationAggregateReservationReservedResourceInfo reserved_resources = 213217742; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReservedResources() + { + return $this->reserved_resources; + } + + /** + * List of reserved resources (CPUs, memory, accelerators). + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AllocationAggregateReservationReservedResourceInfo reserved_resources = 213217742; + * @param array<\Google\Cloud\Compute\V1\AllocationAggregateReservationReservedResourceInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReservedResources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AllocationAggregateReservationReservedResourceInfo::class); + $this->reserved_resources = $arr; + + return $this; + } + + /** + * The VM family that all instances scheduled against this reservation must belong to. + * Check the VmFamily enum for the list of possible values. + * + * Generated from protobuf field optional string vm_family = 125017580; + * @return string + */ + public function getVmFamily() + { + return isset($this->vm_family) ? $this->vm_family : ''; + } + + public function hasVmFamily() + { + return isset($this->vm_family); + } + + public function clearVmFamily() + { + unset($this->vm_family); + } + + /** + * The VM family that all instances scheduled against this reservation must belong to. + * Check the VmFamily enum for the list of possible values. + * + * Generated from protobuf field optional string vm_family = 125017580; + * @param string $var + * @return $this + */ + public function setVmFamily($var) + { + GPBUtil::checkString($var, True); + $this->vm_family = $var; + + return $this; + } + + /** + * The workload type of the instances that will target this reservation. + * Check the WorkloadType enum for the list of possible values. + * + * Generated from protobuf field optional string workload_type = 273432322; + * @return string + */ + public function getWorkloadType() + { + return isset($this->workload_type) ? $this->workload_type : ''; + } + + public function hasWorkloadType() + { + return isset($this->workload_type); + } + + public function clearWorkloadType() + { + unset($this->workload_type); + } + + /** + * The workload type of the instances that will target this reservation. + * Check the WorkloadType enum for the list of possible values. + * + * Generated from protobuf field optional string workload_type = 273432322; + * @param string $var + * @return $this + */ + public function setWorkloadType($var) + { + GPBUtil::checkString($var, True); + $this->workload_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationAggregateReservation/VmFamily.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationAggregateReservation/VmFamily.php new file mode 100644 index 000000000000..73d6ea80a4d9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationAggregateReservation/VmFamily.php @@ -0,0 +1,65 @@ +google.cloud.compute.v1.AllocationAggregateReservation.VmFamily + */ +class VmFamily +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_VM_FAMILY = 0; + */ + const UNDEFINED_VM_FAMILY = 0; + /** + * Generated from protobuf enum VM_FAMILY_CLOUD_TPU_LITE_DEVICE_CT5L = 108020067; + */ + const VM_FAMILY_CLOUD_TPU_LITE_DEVICE_CT5L = 108020067; + /** + * Generated from protobuf enum VM_FAMILY_CLOUD_TPU_LITE_POD_SLICE_CT5LP = 18705267; + */ + const VM_FAMILY_CLOUD_TPU_LITE_POD_SLICE_CT5LP = 18705267; + /** + * Generated from protobuf enum VM_FAMILY_CLOUD_TPU_POD_SLICE_CT4P = 517384407; + */ + const VM_FAMILY_CLOUD_TPU_POD_SLICE_CT4P = 517384407; + + private static $valueToName = [ + self::UNDEFINED_VM_FAMILY => 'UNDEFINED_VM_FAMILY', + self::VM_FAMILY_CLOUD_TPU_LITE_DEVICE_CT5L => 'VM_FAMILY_CLOUD_TPU_LITE_DEVICE_CT5L', + self::VM_FAMILY_CLOUD_TPU_LITE_POD_SLICE_CT5LP => 'VM_FAMILY_CLOUD_TPU_LITE_POD_SLICE_CT5LP', + self::VM_FAMILY_CLOUD_TPU_POD_SLICE_CT4P => 'VM_FAMILY_CLOUD_TPU_POD_SLICE_CT4P', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(VmFamily::class, \Google\Cloud\Compute\V1\AllocationAggregateReservation_VmFamily::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationAggregateReservation/WorkloadType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationAggregateReservation/WorkloadType.php new file mode 100644 index 000000000000..2091c1a7c078 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationAggregateReservation/WorkloadType.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.AllocationAggregateReservation.WorkloadType + */ +class WorkloadType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_WORKLOAD_TYPE = 0; + */ + const UNDEFINED_WORKLOAD_TYPE = 0; + /** + * Reserved resources will be optimized for BATCH workloads, such as ML training. + * + * Generated from protobuf enum BATCH = 62971674; + */ + const BATCH = 62971674; + /** + * Reserved resources will be optimized for SERVING workloads, such as ML inference. + * + * Generated from protobuf enum SERVING = 17781740; + */ + const SERVING = 17781740; + /** + * Generated from protobuf enum UNSPECIFIED = 526786327; + */ + const UNSPECIFIED = 526786327; + + private static $valueToName = [ + self::UNDEFINED_WORKLOAD_TYPE => 'UNDEFINED_WORKLOAD_TYPE', + self::BATCH => 'BATCH', + self::SERVING => 'SERVING', + self::UNSPECIFIED => 'UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(WorkloadType::class, \Google\Cloud\Compute\V1\AllocationAggregateReservation_WorkloadType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationAggregateReservationReservedResourceInfo.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationAggregateReservationReservedResourceInfo.php new file mode 100644 index 000000000000..9d3753a1dd00 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationAggregateReservationReservedResourceInfo.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.AllocationAggregateReservationReservedResourceInfo + */ +class AllocationAggregateReservationReservedResourceInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Properties of accelerator resources in this reservation. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AllocationAggregateReservationReservedResourceInfoAccelerator accelerator = 424338027; + */ + protected $accelerator = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\AllocationAggregateReservationReservedResourceInfoAccelerator $accelerator + * Properties of accelerator resources in this reservation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Properties of accelerator resources in this reservation. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AllocationAggregateReservationReservedResourceInfoAccelerator accelerator = 424338027; + * @return \Google\Cloud\Compute\V1\AllocationAggregateReservationReservedResourceInfoAccelerator|null + */ + public function getAccelerator() + { + return $this->accelerator; + } + + public function hasAccelerator() + { + return isset($this->accelerator); + } + + public function clearAccelerator() + { + unset($this->accelerator); + } + + /** + * Properties of accelerator resources in this reservation. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AllocationAggregateReservationReservedResourceInfoAccelerator accelerator = 424338027; + * @param \Google\Cloud\Compute\V1\AllocationAggregateReservationReservedResourceInfoAccelerator $var + * @return $this + */ + public function setAccelerator($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\AllocationAggregateReservationReservedResourceInfoAccelerator::class); + $this->accelerator = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationAggregateReservationReservedResourceInfoAccelerator.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationAggregateReservationReservedResourceInfoAccelerator.php new file mode 100644 index 000000000000..bc88f54d671a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationAggregateReservationReservedResourceInfoAccelerator.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.AllocationAggregateReservationReservedResourceInfoAccelerator + */ +class AllocationAggregateReservationReservedResourceInfoAccelerator extends \Google\Protobuf\Internal\Message +{ + /** + * Number of accelerators of specified type. + * + * Generated from protobuf field optional int32 accelerator_count = 504879675; + */ + protected $accelerator_count = null; + /** + * Full or partial URL to accelerator type. e.g. "projects/{PROJECT}/zones/{ZONE}/acceleratorTypes/ct4l" + * + * Generated from protobuf field optional string accelerator_type = 138031246; + */ + protected $accelerator_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $accelerator_count + * Number of accelerators of specified type. + * @type string $accelerator_type + * Full or partial URL to accelerator type. e.g. "projects/{PROJECT}/zones/{ZONE}/acceleratorTypes/ct4l" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Number of accelerators of specified type. + * + * Generated from protobuf field optional int32 accelerator_count = 504879675; + * @return int + */ + public function getAcceleratorCount() + { + return isset($this->accelerator_count) ? $this->accelerator_count : 0; + } + + public function hasAcceleratorCount() + { + return isset($this->accelerator_count); + } + + public function clearAcceleratorCount() + { + unset($this->accelerator_count); + } + + /** + * Number of accelerators of specified type. + * + * Generated from protobuf field optional int32 accelerator_count = 504879675; + * @param int $var + * @return $this + */ + public function setAcceleratorCount($var) + { + GPBUtil::checkInt32($var); + $this->accelerator_count = $var; + + return $this; + } + + /** + * Full or partial URL to accelerator type. e.g. "projects/{PROJECT}/zones/{ZONE}/acceleratorTypes/ct4l" + * + * Generated from protobuf field optional string accelerator_type = 138031246; + * @return string + */ + public function getAcceleratorType() + { + return isset($this->accelerator_type) ? $this->accelerator_type : ''; + } + + public function hasAcceleratorType() + { + return isset($this->accelerator_type); + } + + public function clearAcceleratorType() + { + unset($this->accelerator_type); + } + + /** + * Full or partial URL to accelerator type. e.g. "projects/{PROJECT}/zones/{ZONE}/acceleratorTypes/ct4l" + * + * Generated from protobuf field optional string accelerator_type = 138031246; + * @param string $var + * @return $this + */ + public function setAcceleratorType($var) + { + GPBUtil::checkString($var, True); + $this->accelerator_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationResourceStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationResourceStatus.php new file mode 100644 index 000000000000..aa01507e1bb6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationResourceStatus.php @@ -0,0 +1,77 @@ +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; + */ + protected $specific_sku_allocation = null; + + /** + * Constructor. + * + * @param array $data { + * 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) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 + */ + public function getSpecificSkuAllocation() + { + return $this->specific_sku_allocation; + } + + public function hasSpecificSkuAllocation() + { + return isset($this->specific_sku_allocation); + } + + public function clearSpecificSkuAllocation() + { + unset($this->specific_sku_allocation); + } + + /** + * 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 + */ + public function setSpecificSkuAllocation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\AllocationResourceStatusSpecificSKUAllocation::class); + $this->specific_sku_allocation = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationResourceStatusSpecificSKUAllocation.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationResourceStatusSpecificSKUAllocation.php new file mode 100644 index 000000000000..903796d4e820 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationResourceStatusSpecificSKUAllocation.php @@ -0,0 +1,77 @@ +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; + */ + protected $source_instance_template_id = null; + + /** + * Constructor. + * + * @param array $data { + * 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) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * ID of the instance template used to populate reservation properties. + * + * Generated from protobuf field optional string source_instance_template_id = 111196154; + * @return string + */ + public function getSourceInstanceTemplateId() + { + return isset($this->source_instance_template_id) ? $this->source_instance_template_id : ''; + } + + public function hasSourceInstanceTemplateId() + { + return isset($this->source_instance_template_id); + } + + public function clearSourceInstanceTemplateId() + { + unset($this->source_instance_template_id); + } + + /** + * 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 + */ + public function setSourceInstanceTemplateId($var) + { + GPBUtil::checkString($var, True); + $this->source_instance_template_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.php new file mode 100644 index 000000000000..d33bf0b12190 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.php @@ -0,0 +1,124 @@ +google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + */ +class AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies the size of the disk in base-2 GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 316263735; + */ + protected $disk_size_gb = null; + /** + * Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance. + * Check the Interface enum for the list of possible values. + * + * Generated from protobuf field optional string interface = 502623545; + */ + protected $interface = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $disk_size_gb + * Specifies the size of the disk in base-2 GB. + * @type string $interface + * Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance. + * Check the Interface enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies the size of the disk in base-2 GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 316263735; + * @return int|string + */ + public function getDiskSizeGb() + { + return isset($this->disk_size_gb) ? $this->disk_size_gb : 0; + } + + public function hasDiskSizeGb() + { + return isset($this->disk_size_gb); + } + + public function clearDiskSizeGb() + { + unset($this->disk_size_gb); + } + + /** + * Specifies the size of the disk in base-2 GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 316263735; + * @param int|string $var + * @return $this + */ + public function setDiskSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->disk_size_gb = $var; + + return $this; + } + + /** + * Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance. + * Check the Interface enum for the list of possible values. + * + * Generated from protobuf field optional string interface = 502623545; + * @return string + */ + public function getInterface() + { + return isset($this->interface) ? $this->interface : ''; + } + + public function hasInterface() + { + return isset($this->interface); + } + + public function clearInterface() + { + unset($this->interface); + } + + /** + * Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance. + * Check the Interface enum for the list of possible values. + * + * Generated from protobuf field optional string interface = 502623545; + * @param string $var + * @return $this + */ + public function setInterface($var) + { + GPBUtil::checkString($var, True); + $this->interface = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk/PBInterface.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk/PBInterface.php new file mode 100644 index 000000000000..f1bcf7fd50b0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk/PBInterface.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.Interface + */ +class PBInterface +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_INTERFACE = 0; + */ + const UNDEFINED_INTERFACE = 0; + /** + * Generated from protobuf enum NVME = 2408800; + */ + const NVME = 2408800; + /** + * Generated from protobuf enum SCSI = 2539686; + */ + const SCSI = 2539686; + + private static $valueToName = [ + self::UNDEFINED_INTERFACE => 'UNDEFINED_INTERFACE', + self::NVME => 'NVME', + self::SCSI => 'SCSI', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PBInterface::class, \Google\Cloud\Compute\V1\AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk_Interface::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationSpecificSKUAllocationReservedInstanceProperties.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationSpecificSKUAllocationReservedInstanceProperties.php new file mode 100644 index 000000000000..85279346b0df --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationSpecificSKUAllocationReservedInstanceProperties.php @@ -0,0 +1,233 @@ +google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties + */ +class AllocationSpecificSKUAllocationReservedInstanceProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies accelerator type and count. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig guest_accelerators = 463595119; + */ + private $guest_accelerators; + /** + * Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk local_ssds = 229951299; + */ + private $local_ssds; + /** + * An opaque location hint used to place the allocation close to other resources. This field is for use by internal tools that use the public API. + * + * Generated from protobuf field optional string location_hint = 350519505; + */ + protected $location_hint = null; + /** + * Specifies type of machine (name only) which has fixed number of vCPUs and fixed amount of memory. This also includes specifying custom machine type following custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern. + * + * Generated from protobuf field optional string machine_type = 227711026; + */ + protected $machine_type = null; + /** + * Minimum cpu platform the reservation. + * + * Generated from protobuf field optional string min_cpu_platform = 242912759; + */ + protected $min_cpu_platform = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $guest_accelerators + * Specifies accelerator type and count. + * @type array<\Google\Cloud\Compute\V1\AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk>|\Google\Protobuf\Internal\RepeatedField $local_ssds + * Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd. + * @type string $location_hint + * An opaque location hint used to place the allocation close to other resources. This field is for use by internal tools that use the public API. + * @type string $machine_type + * Specifies type of machine (name only) which has fixed number of vCPUs and fixed amount of memory. This also includes specifying custom machine type following custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern. + * @type string $min_cpu_platform + * Minimum cpu platform the reservation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies accelerator type and count. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig guest_accelerators = 463595119; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGuestAccelerators() + { + return $this->guest_accelerators; + } + + /** + * Specifies accelerator type and count. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig guest_accelerators = 463595119; + * @param array<\Google\Cloud\Compute\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGuestAccelerators($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AcceleratorConfig::class); + $this->guest_accelerators = $arr; + + return $this; + } + + /** + * Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk local_ssds = 229951299; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLocalSsds() + { + return $this->local_ssds; + } + + /** + * Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk local_ssds = 229951299; + * @param array<\Google\Cloud\Compute\V1\AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLocalSsds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk::class); + $this->local_ssds = $arr; + + return $this; + } + + /** + * An opaque location hint used to place the allocation close to other resources. This field is for use by internal tools that use the public API. + * + * Generated from protobuf field optional string location_hint = 350519505; + * @return string + */ + public function getLocationHint() + { + return isset($this->location_hint) ? $this->location_hint : ''; + } + + public function hasLocationHint() + { + return isset($this->location_hint); + } + + public function clearLocationHint() + { + unset($this->location_hint); + } + + /** + * An opaque location hint used to place the allocation close to other resources. This field is for use by internal tools that use the public API. + * + * Generated from protobuf field optional string location_hint = 350519505; + * @param string $var + * @return $this + */ + public function setLocationHint($var) + { + GPBUtil::checkString($var, True); + $this->location_hint = $var; + + return $this; + } + + /** + * Specifies type of machine (name only) which has fixed number of vCPUs and fixed amount of memory. This also includes specifying custom machine type following custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern. + * + * Generated from protobuf field optional string machine_type = 227711026; + * @return string + */ + public function getMachineType() + { + return isset($this->machine_type) ? $this->machine_type : ''; + } + + public function hasMachineType() + { + return isset($this->machine_type); + } + + public function clearMachineType() + { + unset($this->machine_type); + } + + /** + * Specifies type of machine (name only) which has fixed number of vCPUs and fixed amount of memory. This also includes specifying custom machine type following custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern. + * + * Generated from protobuf field optional string machine_type = 227711026; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $var; + + return $this; + } + + /** + * Minimum cpu platform the reservation. + * + * Generated from protobuf field optional string min_cpu_platform = 242912759; + * @return string + */ + public function getMinCpuPlatform() + { + return isset($this->min_cpu_platform) ? $this->min_cpu_platform : ''; + } + + public function hasMinCpuPlatform() + { + return isset($this->min_cpu_platform); + } + + public function clearMinCpuPlatform() + { + unset($this->min_cpu_platform); + } + + /** + * Minimum cpu platform the reservation. + * + * Generated from protobuf field optional string min_cpu_platform = 242912759; + * @param string $var + * @return $this + */ + public function setMinCpuPlatform($var) + { + GPBUtil::checkString($var, True); + $this->min_cpu_platform = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationSpecificSKUReservation.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationSpecificSKUReservation.php new file mode 100644 index 000000000000..32da10c3c3f5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationSpecificSKUReservation.php @@ -0,0 +1,253 @@ +google.cloud.compute.v1.AllocationSpecificSKUReservation + */ +class AllocationSpecificSKUReservation extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Indicates how many instances are actually usable currently. + * + * Generated from protobuf field optional int64 assured_count = 281197645; + */ + protected $assured_count = null; + /** + * Specifies the number of resources that are allocated. + * + * Generated from protobuf field optional int64 count = 94851343; + */ + protected $count = null; + /** + * [Output Only] Indicates how many instances are in use. + * + * Generated from protobuf field optional int64 in_use_count = 493458877; + */ + protected $in_use_count = null; + /** + * The instance properties for the reservation. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties instance_properties = 215355165; + */ + protected $instance_properties = null; + /** + * Specifies the instance template to create the reservation. If you use this field, you must exclude the instanceProperties field. This field is optional, and it can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project /global/instanceTemplates/instanceTemplate - projects/project/global/instanceTemplates/instanceTemplate - global/instanceTemplates/instanceTemplate + * + * Generated from protobuf field optional string source_instance_template = 332423616; + */ + protected $source_instance_template = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $assured_count + * [Output Only] Indicates how many instances are actually usable currently. + * @type int|string $count + * Specifies the number of resources that are allocated. + * @type int|string $in_use_count + * [Output Only] Indicates how many instances are in use. + * @type \Google\Cloud\Compute\V1\AllocationSpecificSKUAllocationReservedInstanceProperties $instance_properties + * The instance properties for the reservation. + * @type string $source_instance_template + * Specifies the instance template to create the reservation. If you use this field, you must exclude the instanceProperties field. This field is optional, and it can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project /global/instanceTemplates/instanceTemplate - projects/project/global/instanceTemplates/instanceTemplate - global/instanceTemplates/instanceTemplate + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Indicates how many instances are actually usable currently. + * + * Generated from protobuf field optional int64 assured_count = 281197645; + * @return int|string + */ + public function getAssuredCount() + { + return isset($this->assured_count) ? $this->assured_count : 0; + } + + public function hasAssuredCount() + { + return isset($this->assured_count); + } + + public function clearAssuredCount() + { + unset($this->assured_count); + } + + /** + * [Output Only] Indicates how many instances are actually usable currently. + * + * Generated from protobuf field optional int64 assured_count = 281197645; + * @param int|string $var + * @return $this + */ + public function setAssuredCount($var) + { + GPBUtil::checkInt64($var); + $this->assured_count = $var; + + return $this; + } + + /** + * Specifies the number of resources that are allocated. + * + * Generated from protobuf field optional int64 count = 94851343; + * @return int|string + */ + public function getCount() + { + return isset($this->count) ? $this->count : 0; + } + + public function hasCount() + { + return isset($this->count); + } + + public function clearCount() + { + unset($this->count); + } + + /** + * Specifies the number of resources that are allocated. + * + * Generated from protobuf field optional int64 count = 94851343; + * @param int|string $var + * @return $this + */ + public function setCount($var) + { + GPBUtil::checkInt64($var); + $this->count = $var; + + return $this; + } + + /** + * [Output Only] Indicates how many instances are in use. + * + * Generated from protobuf field optional int64 in_use_count = 493458877; + * @return int|string + */ + public function getInUseCount() + { + return isset($this->in_use_count) ? $this->in_use_count : 0; + } + + public function hasInUseCount() + { + return isset($this->in_use_count); + } + + public function clearInUseCount() + { + unset($this->in_use_count); + } + + /** + * [Output Only] Indicates how many instances are in use. + * + * Generated from protobuf field optional int64 in_use_count = 493458877; + * @param int|string $var + * @return $this + */ + public function setInUseCount($var) + { + GPBUtil::checkInt64($var); + $this->in_use_count = $var; + + return $this; + } + + /** + * The instance properties for the reservation. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties instance_properties = 215355165; + * @return \Google\Cloud\Compute\V1\AllocationSpecificSKUAllocationReservedInstanceProperties|null + */ + public function getInstanceProperties() + { + return $this->instance_properties; + } + + public function hasInstanceProperties() + { + return isset($this->instance_properties); + } + + public function clearInstanceProperties() + { + unset($this->instance_properties); + } + + /** + * The instance properties for the reservation. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties instance_properties = 215355165; + * @param \Google\Cloud\Compute\V1\AllocationSpecificSKUAllocationReservedInstanceProperties $var + * @return $this + */ + public function setInstanceProperties($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\AllocationSpecificSKUAllocationReservedInstanceProperties::class); + $this->instance_properties = $var; + + return $this; + } + + /** + * Specifies the instance template to create the reservation. If you use this field, you must exclude the instanceProperties field. This field is optional, and it can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project /global/instanceTemplates/instanceTemplate - projects/project/global/instanceTemplates/instanceTemplate - global/instanceTemplates/instanceTemplate + * + * Generated from protobuf field optional string source_instance_template = 332423616; + * @return string + */ + public function getSourceInstanceTemplate() + { + return isset($this->source_instance_template) ? $this->source_instance_template : ''; + } + + public function hasSourceInstanceTemplate() + { + return isset($this->source_instance_template); + } + + public function clearSourceInstanceTemplate() + { + unset($this->source_instance_template); + } + + /** + * Specifies the instance template to create the reservation. If you use this field, you must exclude the instanceProperties field. This field is optional, and it can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project /global/instanceTemplates/instanceTemplate - projects/project/global/instanceTemplates/instanceTemplate - global/instanceTemplates/instanceTemplate + * + * Generated from protobuf field optional string source_instance_template = 332423616; + * @param string $var + * @return $this + */ + public function setSourceInstanceTemplate($var) + { + GPBUtil::checkString($var, True); + $this->source_instance_template = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Allowed.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Allowed.php new file mode 100644 index 000000000000..9e6e9fe0f44c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Allowed.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.Allowed + */ +class Allowed extends \Google\Protobuf\Internal\Message +{ + /** + * The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. + * + * Generated from protobuf field optional string I_p_protocol = 488094525; + */ + protected $I_p_protocol = null; + /** + * An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + * + * Generated from protobuf field repeated string ports = 106854418; + */ + private $ports; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $I_p_protocol + * The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. + * @type array|\Google\Protobuf\Internal\RepeatedField $ports + * An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. + * + * Generated from protobuf field optional string I_p_protocol = 488094525; + * @return string + */ + public function getIPProtocol() + { + return isset($this->I_p_protocol) ? $this->I_p_protocol : ''; + } + + public function hasIPProtocol() + { + return isset($this->I_p_protocol); + } + + public function clearIPProtocol() + { + unset($this->I_p_protocol); + } + + /** + * The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. + * + * Generated from protobuf field optional string I_p_protocol = 488094525; + * @param string $var + * @return $this + */ + public function setIPProtocol($var) + { + GPBUtil::checkString($var, True); + $this->I_p_protocol = $var; + + return $this; + } + + /** + * An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + * + * Generated from protobuf field repeated string ports = 106854418; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPorts() + { + return $this->ports; + } + + /** + * An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + * + * Generated from protobuf field repeated string ports = 106854418; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPorts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ports = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AnnouncePublicAdvertisedPrefixeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AnnouncePublicAdvertisedPrefixeRequest.php new file mode 100644 index 000000000000..b0090235f546 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AnnouncePublicAdvertisedPrefixeRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.AnnouncePublicAdvertisedPrefixeRequest + */ +class AnnouncePublicAdvertisedPrefixeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The name of the public advertised prefix. It should comply with RFC1035. + * + * Generated from protobuf field string public_advertised_prefix = 101874590 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $public_advertised_prefix = ''; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $publicAdvertisedPrefix The name of the public advertised prefix. It should comply with RFC1035. + * + * @return \Google\Cloud\Compute\V1\AnnouncePublicAdvertisedPrefixeRequest + * + * @experimental + */ + public static function build(string $project, string $publicAdvertisedPrefix): self + { + return (new self()) + ->setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $public_advertised_prefix + * The name of the public advertised prefix. It should comply with RFC1035. + * @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); + } + + /** + * 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 public advertised prefix. It should comply with RFC1035. + * + * Generated from protobuf field string public_advertised_prefix = 101874590 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPublicAdvertisedPrefix() + { + return $this->public_advertised_prefix; + } + + /** + * The name of the public advertised prefix. It should comply with RFC1035. + * + * Generated from protobuf field string public_advertised_prefix = 101874590 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPublicAdvertisedPrefix($var) + { + GPBUtil::checkString($var, True); + $this->public_advertised_prefix = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AnnouncePublicDelegatedPrefixeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AnnouncePublicDelegatedPrefixeRequest.php new file mode 100644 index 000000000000..de067036128c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AnnouncePublicDelegatedPrefixeRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.AnnouncePublicDelegatedPrefixeRequest + */ +class AnnouncePublicDelegatedPrefixeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The name of the public delegated prefix. It should comply with RFC1035. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $public_delegated_prefix = ''; + /** + * The name of the region where the public delegated prefix is located. It should comply with RFC1035. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region where the public delegated prefix is located. It should comply with RFC1035. + * @param string $publicDelegatedPrefix The name of the public delegated prefix. It should comply with RFC1035. + * + * @return \Google\Cloud\Compute\V1\AnnouncePublicDelegatedPrefixeRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $publicDelegatedPrefix): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setPublicDelegatedPrefix($publicDelegatedPrefix); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $public_delegated_prefix + * The name of the public delegated prefix. It should comply with RFC1035. + * @type string $region + * The name of the region where the public delegated prefix is located. It should comply with RFC1035. + * @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); + } + + /** + * 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 public delegated prefix. It should comply with RFC1035. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPublicDelegatedPrefix() + { + return $this->public_delegated_prefix; + } + + /** + * The name of the public delegated prefix. It should comply with RFC1035. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPublicDelegatedPrefix($var) + { + GPBUtil::checkString($var, True); + $this->public_delegated_prefix = $var; + + return $this; + } + + /** + * The name of the region where the public delegated prefix is located. It should comply with RFC1035. + * + * 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 where the public delegated prefix is located. It should comply with RFC1035. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ApplyUpdatesToInstancesInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ApplyUpdatesToInstancesInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..56cec6c850bf --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ApplyUpdatesToInstancesInstanceGroupManagerRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest + */ +class ApplyUpdatesToInstancesInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group, should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest instance_group_managers_apply_updates_request_resource = 259242835 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_managers_apply_updates_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"]; + */ + protected $project = ''; + /** + * The name of the zone where the managed instance group is located. Should conform to RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. Should conform to RFC1035. + * @param string $instanceGroupManager The name of the managed instance group, should conform to RFC1035. + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersApplyUpdatesRequest $instanceGroupManagersApplyUpdatesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\ApplyUpdatesToInstancesInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager, \Google\Cloud\Compute\V1\InstanceGroupManagersApplyUpdatesRequest $instanceGroupManagersApplyUpdatesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersApplyUpdatesRequestResource($instanceGroupManagersApplyUpdatesRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group, should conform to RFC1035. + * @type \Google\Cloud\Compute\V1\InstanceGroupManagersApplyUpdatesRequest $instance_group_managers_apply_updates_request_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $zone + * The name of the zone where the managed instance group is located. Should conform to RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the managed instance group, should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group, should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest instance_group_managers_apply_updates_request_resource = 259242835 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagersApplyUpdatesRequest|null + */ + public function getInstanceGroupManagersApplyUpdatesRequestResource() + { + return $this->instance_group_managers_apply_updates_request_resource; + } + + public function hasInstanceGroupManagersApplyUpdatesRequestResource() + { + return isset($this->instance_group_managers_apply_updates_request_resource); + } + + public function clearInstanceGroupManagersApplyUpdatesRequestResource() + { + unset($this->instance_group_managers_apply_updates_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest instance_group_managers_apply_updates_request_resource = 259242835 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersApplyUpdatesRequest $var + * @return $this + */ + public function setInstanceGroupManagersApplyUpdatesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagersApplyUpdatesRequest::class); + $this->instance_group_managers_apply_updates_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; + } + + /** + * The name of the zone where the managed instance group is located. Should conform to RFC1035. + * + * 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 where the managed instance group is located. Should conform to RFC1035. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..fec2d45bc312 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + */ +class ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group, should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request, should conform to RFC1035. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest region_instance_group_managers_apply_updates_request_resource = 76248318 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_instance_group_managers_apply_updates_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request, should conform to RFC1035. + * @param string $instanceGroupManager The name of the managed instance group, should conform to RFC1035. + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagersApplyUpdatesRequest $regionInstanceGroupManagersApplyUpdatesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroupManager, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersApplyUpdatesRequest $regionInstanceGroupManagersApplyUpdatesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroupManager($instanceGroupManager) + ->setRegionInstanceGroupManagersApplyUpdatesRequestResource($regionInstanceGroupManagersApplyUpdatesRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group, should conform to RFC1035. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request, should conform to RFC1035. + * @type \Google\Cloud\Compute\V1\RegionInstanceGroupManagersApplyUpdatesRequest $region_instance_group_managers_apply_updates_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the managed instance group, should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group, should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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; + } + + /** + * Name of the region scoping this request, should conform to RFC1035. + * + * 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; + } + + /** + * Name of the region scoping this request, should conform to RFC1035. + * + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest region_instance_group_managers_apply_updates_request_resource = 76248318 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionInstanceGroupManagersApplyUpdatesRequest|null + */ + public function getRegionInstanceGroupManagersApplyUpdatesRequestResource() + { + return $this->region_instance_group_managers_apply_updates_request_resource; + } + + public function hasRegionInstanceGroupManagersApplyUpdatesRequestResource() + { + return isset($this->region_instance_group_managers_apply_updates_request_resource); + } + + public function clearRegionInstanceGroupManagersApplyUpdatesRequestResource() + { + unset($this->region_instance_group_managers_apply_updates_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest region_instance_group_managers_apply_updates_request_resource = 76248318 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagersApplyUpdatesRequest $var + * @return $this + */ + public function setRegionInstanceGroupManagersApplyUpdatesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersApplyUpdatesRequest::class); + $this->region_instance_group_managers_apply_updates_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachDiskInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachDiskInstanceRequest.php new file mode 100644 index 000000000000..3fe86109c07e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachDiskInstanceRequest.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.AttachDiskInstanceRequest + */ +class AttachDiskInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.AttachedDisk attached_disk_resource = 90605845 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $attached_disk_resource = null; + /** + * Whether to force attach the regional disk even if it's currently attached to another instance. If you try to force attach a zonal disk to an instance, you will receive an error. + * + * Generated from protobuf field optional bool force_attach = 142758425; + */ + protected $force_attach = null; + /** + * The instance name for this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance The instance name for this request. + * @param \Google\Cloud\Compute\V1\AttachedDisk $attachedDiskResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AttachDiskInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, \Google\Cloud\Compute\V1\AttachedDisk $attachedDiskResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setAttachedDiskResource($attachedDiskResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\AttachedDisk $attached_disk_resource + * The body resource for this request + * @type bool $force_attach + * Whether to force attach the regional disk even if it's currently attached to another instance. If you try to force attach a zonal disk to an instance, you will receive an error. + * @type string $instance + * The instance name 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.AttachedDisk attached_disk_resource = 90605845 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\AttachedDisk|null + */ + public function getAttachedDiskResource() + { + return $this->attached_disk_resource; + } + + public function hasAttachedDiskResource() + { + return isset($this->attached_disk_resource); + } + + public function clearAttachedDiskResource() + { + unset($this->attached_disk_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.AttachedDisk attached_disk_resource = 90605845 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\AttachedDisk $var + * @return $this + */ + public function setAttachedDiskResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\AttachedDisk::class); + $this->attached_disk_resource = $var; + + return $this; + } + + /** + * Whether to force attach the regional disk even if it's currently attached to another instance. If you try to force attach a zonal disk to an instance, you will receive an error. + * + * Generated from protobuf field optional bool force_attach = 142758425; + * @return bool + */ + public function getForceAttach() + { + return isset($this->force_attach) ? $this->force_attach : false; + } + + public function hasForceAttach() + { + return isset($this->force_attach); + } + + public function clearForceAttach() + { + unset($this->force_attach); + } + + /** + * Whether to force attach the regional disk even if it's currently attached to another instance. If you try to force attach a zonal disk to an instance, you will receive an error. + * + * Generated from protobuf field optional bool force_attach = 142758425; + * @param bool $var + * @return $this + */ + public function setForceAttach($var) + { + GPBUtil::checkBool($var); + $this->force_attach = $var; + + return $this; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.php new file mode 100644 index 000000000000..cac3a8502abd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + */ +class AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest global_network_endpoint_groups_attach_endpoints_request_resource = 30691563 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $global_network_endpoint_groups_attach_endpoints_request_resource = null; + /** + * The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_endpoint_group = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $networkEndpointGroup The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * @param \Google\Cloud\Compute\V1\GlobalNetworkEndpointGroupsAttachEndpointsRequest $globalNetworkEndpointGroupsAttachEndpointsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * + * @experimental + */ + public static function build(string $project, string $networkEndpointGroup, \Google\Cloud\Compute\V1\GlobalNetworkEndpointGroupsAttachEndpointsRequest $globalNetworkEndpointGroupsAttachEndpointsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setGlobalNetworkEndpointGroupsAttachEndpointsRequestResource($globalNetworkEndpointGroupsAttachEndpointsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\GlobalNetworkEndpointGroupsAttachEndpointsRequest $global_network_endpoint_groups_attach_endpoints_request_resource + * The body resource for this request + * @type string $network_endpoint_group + * The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * @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). + * } + */ + 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.GlobalNetworkEndpointGroupsAttachEndpointsRequest global_network_endpoint_groups_attach_endpoints_request_resource = 30691563 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\GlobalNetworkEndpointGroupsAttachEndpointsRequest|null + */ + public function getGlobalNetworkEndpointGroupsAttachEndpointsRequestResource() + { + return $this->global_network_endpoint_groups_attach_endpoints_request_resource; + } + + public function hasGlobalNetworkEndpointGroupsAttachEndpointsRequestResource() + { + return isset($this->global_network_endpoint_groups_attach_endpoints_request_resource); + } + + public function clearGlobalNetworkEndpointGroupsAttachEndpointsRequestResource() + { + unset($this->global_network_endpoint_groups_attach_endpoints_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest global_network_endpoint_groups_attach_endpoints_request_resource = 30691563 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\GlobalNetworkEndpointGroupsAttachEndpointsRequest $var + * @return $this + */ + public function setGlobalNetworkEndpointGroupsAttachEndpointsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\GlobalNetworkEndpointGroupsAttachEndpointsRequest::class); + $this->global_network_endpoint_groups_attach_endpoints_request_resource = $var; + + return $this; + } + + /** + * The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkEndpointGroup() + { + return $this->network_endpoint_group; + } + + /** + * The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkEndpointGroup($var) + { + GPBUtil::checkString($var, True); + $this->network_endpoint_group = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachNetworkEndpointsNetworkEndpointGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachNetworkEndpointsNetworkEndpointGroupRequest.php new file mode 100644 index 000000000000..12546b00b515 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachNetworkEndpointsNetworkEndpointGroupRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest + */ +class AttachNetworkEndpointsNetworkEndpointGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_endpoint_group = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest network_endpoint_groups_attach_endpoints_request_resource = 531079 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_endpoint_groups_attach_endpoints_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @param string $networkEndpointGroup The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * @param \Google\Cloud\Compute\V1\NetworkEndpointGroupsAttachEndpointsRequest $networkEndpointGroupsAttachEndpointsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AttachNetworkEndpointsNetworkEndpointGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $networkEndpointGroup, \Google\Cloud\Compute\V1\NetworkEndpointGroupsAttachEndpointsRequest $networkEndpointGroupsAttachEndpointsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setNetworkEndpointGroupsAttachEndpointsRequestResource($networkEndpointGroupsAttachEndpointsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network_endpoint_group + * The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * @type \Google\Cloud\Compute\V1\NetworkEndpointGroupsAttachEndpointsRequest $network_endpoint_groups_attach_endpoints_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 where the network endpoint group is located. It should comply with RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkEndpointGroup() + { + return $this->network_endpoint_group; + } + + /** + * The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkEndpointGroup($var) + { + GPBUtil::checkString($var, True); + $this->network_endpoint_group = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest network_endpoint_groups_attach_endpoints_request_resource = 531079 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NetworkEndpointGroupsAttachEndpointsRequest|null + */ + public function getNetworkEndpointGroupsAttachEndpointsRequestResource() + { + return $this->network_endpoint_groups_attach_endpoints_request_resource; + } + + public function hasNetworkEndpointGroupsAttachEndpointsRequestResource() + { + return isset($this->network_endpoint_groups_attach_endpoints_request_resource); + } + + public function clearNetworkEndpointGroupsAttachEndpointsRequestResource() + { + unset($this->network_endpoint_groups_attach_endpoints_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest network_endpoint_groups_attach_endpoints_request_resource = 531079 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NetworkEndpointGroupsAttachEndpointsRequest $var + * @return $this + */ + public function setNetworkEndpointGroupsAttachEndpointsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkEndpointGroupsAttachEndpointsRequest::class); + $this->network_endpoint_groups_attach_endpoints_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 where the network endpoint group is located. It should comply with RFC1035. + * + * 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 where the network endpoint group is located. It should comply with RFC1035. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachNetworkEndpointsRegionNetworkEndpointGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachNetworkEndpointsRegionNetworkEndpointGroupRequest.php new file mode 100644 index 000000000000..116c6deb2d4c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachNetworkEndpointsRegionNetworkEndpointGroupRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.AttachNetworkEndpointsRegionNetworkEndpointGroupRequest + */ +class AttachNetworkEndpointsRegionNetworkEndpointGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_endpoint_group = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The name of the region where you want to create the network endpoint group. It should comply with RFC1035. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionNetworkEndpointGroupsAttachEndpointsRequest region_network_endpoint_groups_attach_endpoints_request_resource = 334986492 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_network_endpoint_groups_attach_endpoints_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region where you want to create the network endpoint group. It should comply with RFC1035. + * @param string $networkEndpointGroup The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * @param \Google\Cloud\Compute\V1\RegionNetworkEndpointGroupsAttachEndpointsRequest $regionNetworkEndpointGroupsAttachEndpointsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\AttachNetworkEndpointsRegionNetworkEndpointGroupRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $networkEndpointGroup, \Google\Cloud\Compute\V1\RegionNetworkEndpointGroupsAttachEndpointsRequest $regionNetworkEndpointGroupsAttachEndpointsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setRegionNetworkEndpointGroupsAttachEndpointsRequestResource($regionNetworkEndpointGroupsAttachEndpointsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network_endpoint_group + * The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region where you want to create the network endpoint group. It should comply with RFC1035. + * @type \Google\Cloud\Compute\V1\RegionNetworkEndpointGroupsAttachEndpointsRequest $region_network_endpoint_groups_attach_endpoints_request_resource + * The body resource 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 network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkEndpointGroup() + { + return $this->network_endpoint_group; + } + + /** + * The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkEndpointGroup($var) + { + GPBUtil::checkString($var, True); + $this->network_endpoint_group = $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 where you want to create the network endpoint group. It should comply with RFC1035. + * + * 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 where you want to create the network endpoint group. It should comply with RFC1035. + * + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionNetworkEndpointGroupsAttachEndpointsRequest region_network_endpoint_groups_attach_endpoints_request_resource = 334986492 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionNetworkEndpointGroupsAttachEndpointsRequest|null + */ + public function getRegionNetworkEndpointGroupsAttachEndpointsRequestResource() + { + return $this->region_network_endpoint_groups_attach_endpoints_request_resource; + } + + public function hasRegionNetworkEndpointGroupsAttachEndpointsRequestResource() + { + return isset($this->region_network_endpoint_groups_attach_endpoints_request_resource); + } + + public function clearRegionNetworkEndpointGroupsAttachEndpointsRequestResource() + { + unset($this->region_network_endpoint_groups_attach_endpoints_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionNetworkEndpointGroupsAttachEndpointsRequest region_network_endpoint_groups_attach_endpoints_request_resource = 334986492 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionNetworkEndpointGroupsAttachEndpointsRequest $var + * @return $this + */ + public function setRegionNetworkEndpointGroupsAttachEndpointsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionNetworkEndpointGroupsAttachEndpointsRequest::class); + $this->region_network_endpoint_groups_attach_endpoints_request_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk.php new file mode 100644 index 000000000000..b98b7c1407c4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk.php @@ -0,0 +1,825 @@ +google.cloud.compute.v1.AttachedDisk + */ +class AttachedDisk extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The architecture of the attached disk. Valid values are ARM64 or X86_64. + * Check the Architecture enum for the list of possible values. + * + * Generated from protobuf field optional string architecture = 302803283; + */ + protected $architecture = null; + /** + * Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance). + * + * Generated from protobuf field optional bool auto_delete = 464761403; + */ + protected $auto_delete = null; + /** + * Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem. + * + * Generated from protobuf field optional bool boot = 3029746; + */ + protected $boot = null; + /** + * Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance. If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disk-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks. + * + * Generated from protobuf field optional string device_name = 67541716; + */ + protected $device_name = null; + /** + * Encrypts or decrypts a disk using a customer-supplied encryption key. If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key. If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance. If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677; + */ + protected $disk_encryption_key = null; + /** + * The size of the disk in GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 316263735; + */ + protected $disk_size_gb = null; + /** + * [Input Only] Whether to force attach the regional disk even if it's currently attached to another instance. If you try to force attach a zonal disk to an instance, you will receive an error. + * + * Generated from protobuf field optional bool force_attach = 142758425; + */ + protected $force_attach = null; + /** + * A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545; + */ + private $guest_os_features; + /** + * [Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number. + * + * Generated from protobuf field optional int32 index = 100346066; + */ + protected $index = null; + /** + * [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. This property is mutually exclusive with the source property; you can only define one or the other, but not both. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AttachedDiskInitializeParams initialize_params = 17697045; + */ + protected $initialize_params = null; + /** + * Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. For most machine types, the default is SCSI. Local SSDs can use either NVME or SCSI. In certain configurations, persistent disks can use NVMe. For more information, see About persistent disks. + * Check the Interface enum for the list of possible values. + * + * Generated from protobuf field optional string interface = 502623545; + */ + protected $interface = null; + /** + * [Output Only] Type of the resource. Always compute#attachedDisk for attached disks. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * [Output Only] Any valid publicly visible licenses. + * + * Generated from protobuf field repeated string licenses = 337642578; + */ + private $licenses; + /** + * The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + */ + protected $mode = null; + /** + * For LocalSSD disks on VM Instances in STOPPED or SUSPENDED state, this field is set to PRESERVED if the LocalSSD data has been saved to a persistent location by customer request. (see the discard_local_ssd option on Stop/Suspend). Read-only in the api. + * Check the SavedState enum for the list of possible values. + * + * Generated from protobuf field optional string saved_state = 411587801; + */ + protected $saved_state = null; + /** + * [Output Only] shielded vm initial state stored on disk + * + * Generated from protobuf field optional .google.cloud.compute.v1.InitialStateConfig shielded_instance_initial_state = 192356867; + */ + protected $shielded_instance_initial_state = null; + /** + * Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD. If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. Note that for InstanceTemplate, specify the disk name for zonal disk, and the URL for regional disk. + * + * Generated from protobuf field optional string source = 177235995; + */ + protected $source = null; + /** + * Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $architecture + * [Output Only] The architecture of the attached disk. Valid values are ARM64 or X86_64. + * Check the Architecture enum for the list of possible values. + * @type bool $auto_delete + * Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance). + * @type bool $boot + * Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem. + * @type string $device_name + * Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance. If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disk-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks. + * @type \Google\Cloud\Compute\V1\CustomerEncryptionKey $disk_encryption_key + * Encrypts or decrypts a disk using a customer-supplied encryption key. If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key. If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance. If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group. + * @type int|string $disk_size_gb + * The size of the disk in GB. + * @type bool $force_attach + * [Input Only] Whether to force attach the regional disk even if it's currently attached to another instance. If you try to force attach a zonal disk to an instance, you will receive an error. + * @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. Read Enabling guest operating system features to see a list of available options. + * @type int $index + * [Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number. + * @type \Google\Cloud\Compute\V1\AttachedDiskInitializeParams $initialize_params + * [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. This property is mutually exclusive with the source property; you can only define one or the other, but not both. + * @type string $interface + * Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. For most machine types, the default is SCSI. Local SSDs can use either NVME or SCSI. In certain configurations, persistent disks can use NVMe. For more information, see About persistent disks. + * Check the Interface enum for the list of possible values. + * @type string $kind + * [Output Only] Type of the resource. Always compute#attachedDisk for attached disks. + * @type array|\Google\Protobuf\Internal\RepeatedField $licenses + * [Output Only] Any valid publicly visible licenses. + * @type string $mode + * The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. + * Check the Mode enum for the list of possible values. + * @type string $saved_state + * For LocalSSD disks on VM Instances in STOPPED or SUSPENDED state, this field is set to PRESERVED if the LocalSSD data has been saved to a persistent location by customer request. (see the discard_local_ssd option on Stop/Suspend). Read-only in the api. + * Check the SavedState enum for the list of possible values. + * @type \Google\Cloud\Compute\V1\InitialStateConfig $shielded_instance_initial_state + * [Output Only] shielded vm initial state stored on disk + * @type string $source + * Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD. If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. Note that for InstanceTemplate, specify the disk name for zonal disk, and the URL for regional disk. + * @type string $type + * Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT. + * Check the Type enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The architecture of the attached disk. Valid values are ARM64 or X86_64. + * Check the Architecture enum for the list of possible values. + * + * Generated from protobuf field optional string architecture = 302803283; + * @return string + */ + public function getArchitecture() + { + return isset($this->architecture) ? $this->architecture : ''; + } + + public function hasArchitecture() + { + return isset($this->architecture); + } + + public function clearArchitecture() + { + unset($this->architecture); + } + + /** + * [Output Only] The architecture of the attached disk. Valid values are ARM64 or X86_64. + * Check the Architecture enum for the list of possible values. + * + * Generated from protobuf field optional string architecture = 302803283; + * @param string $var + * @return $this + */ + public function setArchitecture($var) + { + GPBUtil::checkString($var, True); + $this->architecture = $var; + + return $this; + } + + /** + * Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance). + * + * Generated from protobuf field optional bool auto_delete = 464761403; + * @return bool + */ + public function getAutoDelete() + { + return isset($this->auto_delete) ? $this->auto_delete : false; + } + + public function hasAutoDelete() + { + return isset($this->auto_delete); + } + + public function clearAutoDelete() + { + unset($this->auto_delete); + } + + /** + * Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance). + * + * Generated from protobuf field optional bool auto_delete = 464761403; + * @param bool $var + * @return $this + */ + public function setAutoDelete($var) + { + GPBUtil::checkBool($var); + $this->auto_delete = $var; + + return $this; + } + + /** + * Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem. + * + * Generated from protobuf field optional bool boot = 3029746; + * @return bool + */ + public function getBoot() + { + return isset($this->boot) ? $this->boot : false; + } + + public function hasBoot() + { + return isset($this->boot); + } + + public function clearBoot() + { + unset($this->boot); + } + + /** + * Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem. + * + * Generated from protobuf field optional bool boot = 3029746; + * @param bool $var + * @return $this + */ + public function setBoot($var) + { + GPBUtil::checkBool($var); + $this->boot = $var; + + return $this; + } + + /** + * Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance. If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disk-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks. + * + * Generated from protobuf field optional string device_name = 67541716; + * @return string + */ + public function getDeviceName() + { + return isset($this->device_name) ? $this->device_name : ''; + } + + public function hasDeviceName() + { + return isset($this->device_name); + } + + public function clearDeviceName() + { + unset($this->device_name); + } + + /** + * Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance. If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disk-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks. + * + * Generated from protobuf field optional string device_name = 67541716; + * @param string $var + * @return $this + */ + public function setDeviceName($var) + { + GPBUtil::checkString($var, True); + $this->device_name = $var; + + return $this; + } + + /** + * Encrypts or decrypts a disk using a customer-supplied encryption key. If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key. If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance. If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677; + * @return \Google\Cloud\Compute\V1\CustomerEncryptionKey|null + */ + public function getDiskEncryptionKey() + { + return $this->disk_encryption_key; + } + + public function hasDiskEncryptionKey() + { + return isset($this->disk_encryption_key); + } + + public function clearDiskEncryptionKey() + { + unset($this->disk_encryption_key); + } + + /** + * Encrypts or decrypts a disk using a customer-supplied encryption key. If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key. If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance. If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677; + * @param \Google\Cloud\Compute\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setDiskEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomerEncryptionKey::class); + $this->disk_encryption_key = $var; + + return $this; + } + + /** + * The size of the disk in GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 316263735; + * @return int|string + */ + public function getDiskSizeGb() + { + return isset($this->disk_size_gb) ? $this->disk_size_gb : 0; + } + + public function hasDiskSizeGb() + { + return isset($this->disk_size_gb); + } + + public function clearDiskSizeGb() + { + unset($this->disk_size_gb); + } + + /** + * The size of the disk in GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 316263735; + * @param int|string $var + * @return $this + */ + public function setDiskSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->disk_size_gb = $var; + + return $this; + } + + /** + * [Input Only] Whether to force attach the regional disk even if it's currently attached to another instance. If you try to force attach a zonal disk to an instance, you will receive an error. + * + * Generated from protobuf field optional bool force_attach = 142758425; + * @return bool + */ + public function getForceAttach() + { + return isset($this->force_attach) ? $this->force_attach : false; + } + + public function hasForceAttach() + { + return isset($this->force_attach); + } + + public function clearForceAttach() + { + unset($this->force_attach); + } + + /** + * [Input Only] Whether to force attach the regional disk even if it's currently attached to another instance. If you try to force attach a zonal disk to an instance, you will receive an error. + * + * Generated from protobuf field optional bool force_attach = 142758425; + * @param bool $var + * @return $this + */ + public function setForceAttach($var) + { + GPBUtil::checkBool($var); + $this->force_attach = $var; + + return $this; + } + + /** + * A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGuestOsFeatures() + { + return $this->guest_os_features; + } + + /** + * A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545; + * @param array<\Google\Cloud\Compute\V1\GuestOsFeature>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGuestOsFeatures($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\GuestOsFeature::class); + $this->guest_os_features = $arr; + + return $this; + } + + /** + * [Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number. + * + * Generated from protobuf field optional int32 index = 100346066; + * @return int + */ + public function getIndex() + { + return isset($this->index) ? $this->index : 0; + } + + public function hasIndex() + { + return isset($this->index); + } + + public function clearIndex() + { + unset($this->index); + } + + /** + * [Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number. + * + * Generated from protobuf field optional int32 index = 100346066; + * @param int $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkInt32($var); + $this->index = $var; + + return $this; + } + + /** + * [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. This property is mutually exclusive with the source property; you can only define one or the other, but not both. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AttachedDiskInitializeParams initialize_params = 17697045; + * @return \Google\Cloud\Compute\V1\AttachedDiskInitializeParams|null + */ + public function getInitializeParams() + { + return $this->initialize_params; + } + + public function hasInitializeParams() + { + return isset($this->initialize_params); + } + + public function clearInitializeParams() + { + unset($this->initialize_params); + } + + /** + * [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. This property is mutually exclusive with the source property; you can only define one or the other, but not both. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AttachedDiskInitializeParams initialize_params = 17697045; + * @param \Google\Cloud\Compute\V1\AttachedDiskInitializeParams $var + * @return $this + */ + public function setInitializeParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\AttachedDiskInitializeParams::class); + $this->initialize_params = $var; + + return $this; + } + + /** + * Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. For most machine types, the default is SCSI. Local SSDs can use either NVME or SCSI. In certain configurations, persistent disks can use NVMe. For more information, see About persistent disks. + * Check the Interface enum for the list of possible values. + * + * Generated from protobuf field optional string interface = 502623545; + * @return string + */ + public function getInterface() + { + return isset($this->interface) ? $this->interface : ''; + } + + public function hasInterface() + { + return isset($this->interface); + } + + public function clearInterface() + { + unset($this->interface); + } + + /** + * Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. For most machine types, the default is SCSI. Local SSDs can use either NVME or SCSI. In certain configurations, persistent disks can use NVMe. For more information, see About persistent disks. + * Check the Interface enum for the list of possible values. + * + * Generated from protobuf field optional string interface = 502623545; + * @param string $var + * @return $this + */ + public function setInterface($var) + { + GPBUtil::checkString($var, True); + $this->interface = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#attachedDisk for attached disks. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#attachedDisk for attached disks. + * + * 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] Any valid publicly visible licenses. + * + * Generated from protobuf field repeated string licenses = 337642578; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLicenses() + { + return $this->licenses; + } + + /** + * [Output Only] Any valid publicly visible licenses. + * + * Generated from protobuf field repeated string licenses = 337642578; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLicenses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->licenses = $arr; + + return $this; + } + + /** + * The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + * @return string + */ + public function getMode() + { + return isset($this->mode) ? $this->mode : ''; + } + + public function hasMode() + { + return isset($this->mode); + } + + public function clearMode() + { + unset($this->mode); + } + + /** + * The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + * @param string $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkString($var, True); + $this->mode = $var; + + return $this; + } + + /** + * For LocalSSD disks on VM Instances in STOPPED or SUSPENDED state, this field is set to PRESERVED if the LocalSSD data has been saved to a persistent location by customer request. (see the discard_local_ssd option on Stop/Suspend). Read-only in the api. + * Check the SavedState enum for the list of possible values. + * + * Generated from protobuf field optional string saved_state = 411587801; + * @return string + */ + public function getSavedState() + { + return isset($this->saved_state) ? $this->saved_state : ''; + } + + public function hasSavedState() + { + return isset($this->saved_state); + } + + public function clearSavedState() + { + unset($this->saved_state); + } + + /** + * For LocalSSD disks on VM Instances in STOPPED or SUSPENDED state, this field is set to PRESERVED if the LocalSSD data has been saved to a persistent location by customer request. (see the discard_local_ssd option on Stop/Suspend). Read-only in the api. + * Check the SavedState enum for the list of possible values. + * + * Generated from protobuf field optional string saved_state = 411587801; + * @param string $var + * @return $this + */ + public function setSavedState($var) + { + GPBUtil::checkString($var, True); + $this->saved_state = $var; + + return $this; + } + + /** + * [Output Only] shielded vm initial state stored on disk + * + * Generated from protobuf field optional .google.cloud.compute.v1.InitialStateConfig shielded_instance_initial_state = 192356867; + * @return \Google\Cloud\Compute\V1\InitialStateConfig|null + */ + public function getShieldedInstanceInitialState() + { + return $this->shielded_instance_initial_state; + } + + public function hasShieldedInstanceInitialState() + { + return isset($this->shielded_instance_initial_state); + } + + public function clearShieldedInstanceInitialState() + { + unset($this->shielded_instance_initial_state); + } + + /** + * [Output Only] shielded vm initial state stored on disk + * + * Generated from protobuf field optional .google.cloud.compute.v1.InitialStateConfig shielded_instance_initial_state = 192356867; + * @param \Google\Cloud\Compute\V1\InitialStateConfig $var + * @return $this + */ + public function setShieldedInstanceInitialState($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InitialStateConfig::class); + $this->shielded_instance_initial_state = $var; + + return $this; + } + + /** + * Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD. If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. Note that for InstanceTemplate, specify the disk name for zonal disk, and the URL for regional disk. + * + * Generated from protobuf field optional string source = 177235995; + * @return string + */ + public function getSource() + { + return isset($this->source) ? $this->source : ''; + } + + public function hasSource() + { + return isset($this->source); + } + + public function clearSource() + { + unset($this->source); + } + + /** + * Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD. If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. Note that for InstanceTemplate, specify the disk name for zonal disk, and the URL for regional disk. + * + * Generated from protobuf field optional string source = 177235995; + * @param string $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkString($var, True); + $this->source = $var; + + return $this; + } + + /** + * Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk/Architecture.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk/Architecture.php new file mode 100644 index 000000000000..ce973af56e1c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk/Architecture.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.AttachedDisk.Architecture + */ +class Architecture +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ARCHITECTURE = 0; + */ + const UNDEFINED_ARCHITECTURE = 0; + /** + * Default value indicating Architecture is not set. + * + * Generated from protobuf enum ARCHITECTURE_UNSPECIFIED = 394750507; + */ + const ARCHITECTURE_UNSPECIFIED = 394750507; + /** + * Machines with architecture ARM64 + * + * Generated from protobuf enum ARM64 = 62547450; + */ + const ARM64 = 62547450; + /** + * Machines with architecture X86_64 + * + * Generated from protobuf enum X86_64 = 425300551; + */ + const X86_64 = 425300551; + + private static $valueToName = [ + self::UNDEFINED_ARCHITECTURE => 'UNDEFINED_ARCHITECTURE', + self::ARCHITECTURE_UNSPECIFIED => 'ARCHITECTURE_UNSPECIFIED', + self::ARM64 => 'ARM64', + self::X86_64 => 'X86_64', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Architecture::class, \Google\Cloud\Compute\V1\AttachedDisk_Architecture::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk/Mode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk/Mode.php new file mode 100644 index 000000000000..9487676020ce --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk/Mode.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.AttachedDisk.Mode + */ +class Mode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MODE = 0; + */ + const UNDEFINED_MODE = 0; + /** + * Attaches this disk in read-only mode. Multiple virtual machines can use a disk in read-only mode at a time. + * + * Generated from protobuf enum READ_ONLY = 91950261; + */ + const READ_ONLY = 91950261; + /** + * *[Default]* Attaches this disk in read-write mode. Only one virtual machine at a time can be attached to a disk in read-write mode. + * + * Generated from protobuf enum READ_WRITE = 173607894; + */ + const READ_WRITE = 173607894; + + private static $valueToName = [ + self::UNDEFINED_MODE => 'UNDEFINED_MODE', + self::READ_ONLY => 'READ_ONLY', + self::READ_WRITE => 'READ_WRITE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Mode::class, \Google\Cloud\Compute\V1\AttachedDisk_Mode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk/PBInterface.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk/PBInterface.php new file mode 100644 index 000000000000..76eee4370d08 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk/PBInterface.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.AttachedDisk.Interface + */ +class PBInterface +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_INTERFACE = 0; + */ + const UNDEFINED_INTERFACE = 0; + /** + * Generated from protobuf enum NVME = 2408800; + */ + const NVME = 2408800; + /** + * Generated from protobuf enum SCSI = 2539686; + */ + const SCSI = 2539686; + + private static $valueToName = [ + self::UNDEFINED_INTERFACE => 'UNDEFINED_INTERFACE', + self::NVME => 'NVME', + self::SCSI => 'SCSI', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PBInterface::class, \Google\Cloud\Compute\V1\AttachedDisk_Interface::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk/SavedState.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk/SavedState.php new file mode 100644 index 000000000000..347ea91d6642 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk/SavedState.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.AttachedDisk.SavedState + */ +class SavedState +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_SAVED_STATE = 0; + */ + const UNDEFINED_SAVED_STATE = 0; + /** + * *[Default]* Disk state has not been preserved. + * + * Generated from protobuf enum DISK_SAVED_STATE_UNSPECIFIED = 391290831; + */ + const DISK_SAVED_STATE_UNSPECIFIED = 391290831; + /** + * Disk state has been preserved. + * + * Generated from protobuf enum PRESERVED = 254159736; + */ + const PRESERVED = 254159736; + + private static $valueToName = [ + self::UNDEFINED_SAVED_STATE => 'UNDEFINED_SAVED_STATE', + self::DISK_SAVED_STATE_UNSPECIFIED => 'DISK_SAVED_STATE_UNSPECIFIED', + self::PRESERVED => 'PRESERVED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SavedState::class, \Google\Cloud\Compute\V1\AttachedDisk_SavedState::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk/Type.php new file mode 100644 index 000000000000..817b59081435 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDisk/Type.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.AttachedDisk.Type + */ +class Type +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TYPE = 0; + */ + const UNDEFINED_TYPE = 0; + /** + * Generated from protobuf enum PERSISTENT = 460683927; + */ + const PERSISTENT = 460683927; + /** + * Generated from protobuf enum SCRATCH = 496778970; + */ + const SCRATCH = 496778970; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::PERSISTENT => 'PERSISTENT', + self::SCRATCH => 'SCRATCH', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Compute\V1\AttachedDisk_Type::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDiskInitializeParams.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDiskInitializeParams.php new file mode 100644 index 000000000000..b5ee73b6c987 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDiskInitializeParams.php @@ -0,0 +1,827 @@ +google.cloud.compute.v1.AttachedDiskInitializeParams + */ +class AttachedDiskInitializeParams extends \Google\Protobuf\Internal\Message +{ + /** + * The architecture of the attached disk. Valid values are arm64 or x86_64. + * Check the Architecture enum for the list of possible values. + * + * Generated from protobuf field optional string architecture = 302803283; + */ + protected $architecture = null; + /** + * An optional description. Provide this property when creating the disk. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Specifies the disk name. If not specified, the default is to use the name of the instance. If a disk with the same name already exists in the given region, the existing disk is attached to the new instance and the new disk is not created. + * + * Generated from protobuf field optional string disk_name = 92807149; + */ + protected $disk_name = null; + /** + * Specifies the size of the disk in base-2 GB. The size must be at least 10 GB. If you specify a sourceImage, which is required for boot disks, the default size is the size of the sourceImage. If you do not specify a sourceImage, the default disk size is 500 GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 316263735; + */ + protected $disk_size_gb = null; + /** + * Specifies the disk type to use to create the instance. If not specified, the default is pd-standard, specified using the full URL. For example: https://www.googleapis.com/compute/v1/projects/project/zones/zone /diskTypes/pd-standard For a full list of acceptable values, see Persistent disk types. If you specify this field when creating a VM, you can provide either the full or partial URL. For example, the following values are valid: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /diskTypes/diskType - projects/project/zones/zone/diskTypes/diskType - zones/zone/diskTypes/diskType If you specify this field when creating or updating an instance template or all-instances configuration, specify the type of the disk, not the URL. For example: pd-standard. + * + * Generated from protobuf field optional string disk_type = 93009052; + */ + protected $disk_type = null; + /** + * Whether this disk is using confidential compute mode. + * + * Generated from protobuf field optional bool enable_confidential_compute = 102135228; + */ + protected $enable_confidential_compute = null; + /** + * Labels to apply to this disk. These can be later modified by the disks.setLabels method. This field is only applicable for persistent disks. + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + /** + * A list of publicly visible licenses. Reserved for Google's use. + * + * Generated from protobuf field repeated string licenses = 337642578; + */ + private $licenses; + /** + * Specifies which action to take on instance update with this disk. Default is to use the existing disk. + * Check the OnUpdateAction enum for the list of possible values. + * + * Generated from protobuf field optional string on_update_action = 202451980; + */ + protected $on_update_action = null; + /** + * Indicates how many IOPS to provision for the disk. This sets the number of I/O operations per second that the disk can handle. Values must be between 10,000 and 120,000. For more details, see the Extreme persistent disk documentation. + * + * Generated from protobuf field optional int64 provisioned_iops = 186769108; + */ + protected $provisioned_iops = null; + /** + * Indicates how much throughput to provision for the disk. This sets the number of throughput mb per second that the disk can handle. Values must greater than or equal to 1. + * + * Generated from protobuf field optional int64 provisioned_throughput = 526524181; + */ + protected $provisioned_throughput = null; + /** + * Required for each regional disk associated with the instance. Specify the URLs of the zones where the disk should be replicated to. You must provide exactly two replica zones, and one zone must be the same as the instance zone. + * + * Generated from protobuf field repeated string replica_zones = 48438272; + */ + private $replica_zones; + /** + * Resource manager tags to be bound to the disk. Tag keys and values have the same definition as resource manager tags. Keys must be in the format `tagKeys/{tag_key_id}`, and values are in the format `tagValues/456`. The field is ignored (both PUT & PATCH) when empty. + * + * Generated from protobuf field map resource_manager_tags = 377671164; + */ + private $resource_manager_tags; + /** + * Resource policies applied to this disk for automatic snapshot creations. Specified using the full or partial URL. For instance template, specify only the resource policy name. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + */ + private $resource_policies; + /** + * The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD. To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-9 to use the latest Debian 9 image: projects/debian-cloud/global/images/family/debian-9 Alternatively, use a specific version of a public operating system image: projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD To create a disk with a custom image that you created, specify the image name in the following format: global/images/my-custom-image You can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name: global/images/family/my-image-family If the source image is deleted later, this field will not be set. + * + * Generated from protobuf field optional string source_image = 50443319; + */ + protected $source_image = null; + /** + * The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. InstanceTemplate and InstancePropertiesPatch do not store customer-supplied encryption keys, so you cannot create disks for instances in a managed instance group if the source images are encrypted with your own keys. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_image_encryption_key = 381503659; + */ + protected $source_image_encryption_key = null; + /** + * The source snapshot to create this disk. When creating a new instance, one of initializeParams.sourceSnapshot or initializeParams.sourceImage or disks.source is required except for local SSD. To create a disk with a snapshot that you created, specify the snapshot name in the following format: global/snapshots/my-backup If the source snapshot is deleted later, this field will not be set. + * + * Generated from protobuf field optional string source_snapshot = 126061928; + */ + protected $source_snapshot = null; + /** + * The customer-supplied encryption key of the source snapshot. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_snapshot_encryption_key = 303679322; + */ + protected $source_snapshot_encryption_key = null; + /** + * The storage pool in which the new disk is created. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /storagePools/storagePool - projects/project/zones/zone/storagePools/storagePool - zones/zone/storagePools/storagePool + * + * Generated from protobuf field optional string storage_pool = 360473440; + */ + protected $storage_pool = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $architecture + * The architecture of the attached disk. Valid values are arm64 or x86_64. + * Check the Architecture enum for the list of possible values. + * @type string $description + * An optional description. Provide this property when creating the disk. + * @type string $disk_name + * Specifies the disk name. If not specified, the default is to use the name of the instance. If a disk with the same name already exists in the given region, the existing disk is attached to the new instance and the new disk is not created. + * @type int|string $disk_size_gb + * Specifies the size of the disk in base-2 GB. The size must be at least 10 GB. If you specify a sourceImage, which is required for boot disks, the default size is the size of the sourceImage. If you do not specify a sourceImage, the default disk size is 500 GB. + * @type string $disk_type + * Specifies the disk type to use to create the instance. If not specified, the default is pd-standard, specified using the full URL. For example: https://www.googleapis.com/compute/v1/projects/project/zones/zone /diskTypes/pd-standard For a full list of acceptable values, see Persistent disk types. If you specify this field when creating a VM, you can provide either the full or partial URL. For example, the following values are valid: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /diskTypes/diskType - projects/project/zones/zone/diskTypes/diskType - zones/zone/diskTypes/diskType If you specify this field when creating or updating an instance template or all-instances configuration, specify the type of the disk, not the URL. For example: pd-standard. + * @type bool $enable_confidential_compute + * Whether this disk is using confidential compute mode. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels to apply to this disk. These can be later modified by the disks.setLabels method. This field is only applicable for persistent disks. + * @type array|\Google\Protobuf\Internal\RepeatedField $licenses + * A list of publicly visible licenses. Reserved for Google's use. + * @type string $on_update_action + * Specifies which action to take on instance update with this disk. Default is to use the existing disk. + * Check the OnUpdateAction enum for the list of possible values. + * @type int|string $provisioned_iops + * Indicates how many IOPS to provision for the disk. This sets the number of I/O operations per second that the disk can handle. Values must be between 10,000 and 120,000. For more details, see the Extreme persistent disk documentation. + * @type int|string $provisioned_throughput + * Indicates how much throughput to provision for the disk. This sets the number of throughput mb per second that the disk can handle. Values must greater than or equal to 1. + * @type array|\Google\Protobuf\Internal\RepeatedField $replica_zones + * Required for each regional disk associated with the instance. Specify the URLs of the zones where the disk should be replicated to. You must provide exactly two replica zones, and one zone must be the same as the instance zone. + * @type array|\Google\Protobuf\Internal\MapField $resource_manager_tags + * Resource manager tags to be bound to the disk. Tag keys and values have the same definition as resource manager tags. Keys must be in the format `tagKeys/{tag_key_id}`, and values are in the format `tagValues/456`. The field is ignored (both PUT & PATCH) when empty. + * @type array|\Google\Protobuf\Internal\RepeatedField $resource_policies + * Resource policies applied to this disk for automatic snapshot creations. Specified using the full or partial URL. For instance template, specify only the resource policy name. + * @type string $source_image + * The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD. To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-9 to use the latest Debian 9 image: projects/debian-cloud/global/images/family/debian-9 Alternatively, use a specific version of a public operating system image: projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD To create a disk with a custom image that you created, specify the image name in the following format: global/images/my-custom-image You can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name: global/images/family/my-image-family If the source image is deleted later, this field will not be set. + * @type \Google\Cloud\Compute\V1\CustomerEncryptionKey $source_image_encryption_key + * The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. InstanceTemplate and InstancePropertiesPatch do not store customer-supplied encryption keys, so you cannot create disks for instances in a managed instance group if the source images are encrypted with your own keys. + * @type string $source_snapshot + * The source snapshot to create this disk. When creating a new instance, one of initializeParams.sourceSnapshot or initializeParams.sourceImage or disks.source is required except for local SSD. To create a disk with a snapshot that you created, specify the snapshot name in the following format: global/snapshots/my-backup If the source snapshot is deleted later, this field will not be set. + * @type \Google\Cloud\Compute\V1\CustomerEncryptionKey $source_snapshot_encryption_key + * The customer-supplied encryption key of the source snapshot. + * @type string $storage_pool + * The storage pool in which the new disk is created. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /storagePools/storagePool - projects/project/zones/zone/storagePools/storagePool - zones/zone/storagePools/storagePool + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The architecture of the attached disk. Valid values are arm64 or x86_64. + * Check the Architecture enum for the list of possible values. + * + * Generated from protobuf field optional string architecture = 302803283; + * @return string + */ + public function getArchitecture() + { + return isset($this->architecture) ? $this->architecture : ''; + } + + public function hasArchitecture() + { + return isset($this->architecture); + } + + public function clearArchitecture() + { + unset($this->architecture); + } + + /** + * The architecture of the attached disk. Valid values are arm64 or x86_64. + * Check the Architecture enum for the list of possible values. + * + * Generated from protobuf field optional string architecture = 302803283; + * @param string $var + * @return $this + */ + public function setArchitecture($var) + { + GPBUtil::checkString($var, True); + $this->architecture = $var; + + return $this; + } + + /** + * An optional description. Provide this property when creating the disk. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description. Provide this property when creating the disk. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Specifies the disk name. If not specified, the default is to use the name of the instance. If a disk with the same name already exists in the given region, the existing disk is attached to the new instance and the new disk is not created. + * + * Generated from protobuf field optional string disk_name = 92807149; + * @return string + */ + public function getDiskName() + { + return isset($this->disk_name) ? $this->disk_name : ''; + } + + public function hasDiskName() + { + return isset($this->disk_name); + } + + public function clearDiskName() + { + unset($this->disk_name); + } + + /** + * Specifies the disk name. If not specified, the default is to use the name of the instance. If a disk with the same name already exists in the given region, the existing disk is attached to the new instance and the new disk is not created. + * + * Generated from protobuf field optional string disk_name = 92807149; + * @param string $var + * @return $this + */ + public function setDiskName($var) + { + GPBUtil::checkString($var, True); + $this->disk_name = $var; + + return $this; + } + + /** + * Specifies the size of the disk in base-2 GB. The size must be at least 10 GB. If you specify a sourceImage, which is required for boot disks, the default size is the size of the sourceImage. If you do not specify a sourceImage, the default disk size is 500 GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 316263735; + * @return int|string + */ + public function getDiskSizeGb() + { + return isset($this->disk_size_gb) ? $this->disk_size_gb : 0; + } + + public function hasDiskSizeGb() + { + return isset($this->disk_size_gb); + } + + public function clearDiskSizeGb() + { + unset($this->disk_size_gb); + } + + /** + * Specifies the size of the disk in base-2 GB. The size must be at least 10 GB. If you specify a sourceImage, which is required for boot disks, the default size is the size of the sourceImage. If you do not specify a sourceImage, the default disk size is 500 GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 316263735; + * @param int|string $var + * @return $this + */ + public function setDiskSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->disk_size_gb = $var; + + return $this; + } + + /** + * Specifies the disk type to use to create the instance. If not specified, the default is pd-standard, specified using the full URL. For example: https://www.googleapis.com/compute/v1/projects/project/zones/zone /diskTypes/pd-standard For a full list of acceptable values, see Persistent disk types. If you specify this field when creating a VM, you can provide either the full or partial URL. For example, the following values are valid: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /diskTypes/diskType - projects/project/zones/zone/diskTypes/diskType - zones/zone/diskTypes/diskType If you specify this field when creating or updating an instance template or all-instances configuration, specify the type of the disk, not the URL. For example: pd-standard. + * + * Generated from protobuf field optional string disk_type = 93009052; + * @return string + */ + public function getDiskType() + { + return isset($this->disk_type) ? $this->disk_type : ''; + } + + public function hasDiskType() + { + return isset($this->disk_type); + } + + public function clearDiskType() + { + unset($this->disk_type); + } + + /** + * Specifies the disk type to use to create the instance. If not specified, the default is pd-standard, specified using the full URL. For example: https://www.googleapis.com/compute/v1/projects/project/zones/zone /diskTypes/pd-standard For a full list of acceptable values, see Persistent disk types. If you specify this field when creating a VM, you can provide either the full or partial URL. For example, the following values are valid: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /diskTypes/diskType - projects/project/zones/zone/diskTypes/diskType - zones/zone/diskTypes/diskType If you specify this field when creating or updating an instance template or all-instances configuration, specify the type of the disk, not the URL. For example: pd-standard. + * + * Generated from protobuf field optional string disk_type = 93009052; + * @param string $var + * @return $this + */ + public function setDiskType($var) + { + GPBUtil::checkString($var, True); + $this->disk_type = $var; + + return $this; + } + + /** + * Whether this disk is using confidential compute mode. + * + * Generated from protobuf field optional bool enable_confidential_compute = 102135228; + * @return bool + */ + public function getEnableConfidentialCompute() + { + return isset($this->enable_confidential_compute) ? $this->enable_confidential_compute : false; + } + + public function hasEnableConfidentialCompute() + { + return isset($this->enable_confidential_compute); + } + + public function clearEnableConfidentialCompute() + { + unset($this->enable_confidential_compute); + } + + /** + * Whether this disk is using confidential compute mode. + * + * Generated from protobuf field optional bool enable_confidential_compute = 102135228; + * @param bool $var + * @return $this + */ + public function setEnableConfidentialCompute($var) + { + GPBUtil::checkBool($var); + $this->enable_confidential_compute = $var; + + return $this; + } + + /** + * Labels to apply to this disk. These can be later modified by the disks.setLabels method. This field is only applicable for persistent disks. + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels to apply to this disk. These can be later modified by the disks.setLabels method. This field is only applicable for persistent disks. + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * A list of publicly visible licenses. Reserved for Google's use. + * + * Generated from protobuf field repeated string licenses = 337642578; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLicenses() + { + return $this->licenses; + } + + /** + * A list of publicly visible licenses. Reserved for Google's use. + * + * Generated from protobuf field repeated string licenses = 337642578; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLicenses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->licenses = $arr; + + return $this; + } + + /** + * Specifies which action to take on instance update with this disk. Default is to use the existing disk. + * Check the OnUpdateAction enum for the list of possible values. + * + * Generated from protobuf field optional string on_update_action = 202451980; + * @return string + */ + public function getOnUpdateAction() + { + return isset($this->on_update_action) ? $this->on_update_action : ''; + } + + public function hasOnUpdateAction() + { + return isset($this->on_update_action); + } + + public function clearOnUpdateAction() + { + unset($this->on_update_action); + } + + /** + * Specifies which action to take on instance update with this disk. Default is to use the existing disk. + * Check the OnUpdateAction enum for the list of possible values. + * + * Generated from protobuf field optional string on_update_action = 202451980; + * @param string $var + * @return $this + */ + public function setOnUpdateAction($var) + { + GPBUtil::checkString($var, True); + $this->on_update_action = $var; + + return $this; + } + + /** + * Indicates how many IOPS to provision for the disk. This sets the number of I/O operations per second that the disk can handle. Values must be between 10,000 and 120,000. For more details, see the Extreme persistent disk documentation. + * + * Generated from protobuf field optional int64 provisioned_iops = 186769108; + * @return int|string + */ + public function getProvisionedIops() + { + return isset($this->provisioned_iops) ? $this->provisioned_iops : 0; + } + + public function hasProvisionedIops() + { + return isset($this->provisioned_iops); + } + + public function clearProvisionedIops() + { + unset($this->provisioned_iops); + } + + /** + * Indicates how many IOPS to provision for the disk. This sets the number of I/O operations per second that the disk can handle. Values must be between 10,000 and 120,000. For more details, see the Extreme persistent disk documentation. + * + * Generated from protobuf field optional int64 provisioned_iops = 186769108; + * @param int|string $var + * @return $this + */ + public function setProvisionedIops($var) + { + GPBUtil::checkInt64($var); + $this->provisioned_iops = $var; + + return $this; + } + + /** + * Indicates how much throughput to provision for the disk. This sets the number of throughput mb per second that the disk can handle. Values must greater than or equal to 1. + * + * Generated from protobuf field optional int64 provisioned_throughput = 526524181; + * @return int|string + */ + public function getProvisionedThroughput() + { + return isset($this->provisioned_throughput) ? $this->provisioned_throughput : 0; + } + + public function hasProvisionedThroughput() + { + return isset($this->provisioned_throughput); + } + + public function clearProvisionedThroughput() + { + unset($this->provisioned_throughput); + } + + /** + * Indicates how much throughput to provision for the disk. This sets the number of throughput mb per second that the disk can handle. Values must greater than or equal to 1. + * + * Generated from protobuf field optional int64 provisioned_throughput = 526524181; + * @param int|string $var + * @return $this + */ + public function setProvisionedThroughput($var) + { + GPBUtil::checkInt64($var); + $this->provisioned_throughput = $var; + + return $this; + } + + /** + * Required for each regional disk associated with the instance. Specify the URLs of the zones where the disk should be replicated to. You must provide exactly two replica zones, and one zone must be the same as the instance zone. + * + * Generated from protobuf field repeated string replica_zones = 48438272; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReplicaZones() + { + return $this->replica_zones; + } + + /** + * Required for each regional disk associated with the instance. Specify the URLs of the zones where the disk should be replicated to. You must provide exactly two replica zones, and one zone must be the same as the instance zone. + * + * Generated from protobuf field repeated string replica_zones = 48438272; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReplicaZones($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->replica_zones = $arr; + + return $this; + } + + /** + * Resource manager tags to be bound to the disk. Tag keys and values have the same definition as resource manager tags. Keys must be in the format `tagKeys/{tag_key_id}`, and values are in the format `tagValues/456`. The field is ignored (both PUT & PATCH) when empty. + * + * Generated from protobuf field map resource_manager_tags = 377671164; + * @return \Google\Protobuf\Internal\MapField + */ + public function getResourceManagerTags() + { + return $this->resource_manager_tags; + } + + /** + * Resource manager tags to be bound to the disk. Tag keys and values have the same definition as resource manager tags. Keys must be in the format `tagKeys/{tag_key_id}`, and values are in the format `tagValues/456`. The field is ignored (both PUT & PATCH) when empty. + * + * Generated from protobuf field map resource_manager_tags = 377671164; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setResourceManagerTags($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_manager_tags = $arr; + + return $this; + } + + /** + * Resource policies applied to this disk for automatic snapshot creations. Specified using the full or partial URL. For instance template, specify only the resource policy name. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourcePolicies() + { + return $this->resource_policies; + } + + /** + * Resource policies applied to this disk for automatic snapshot creations. Specified using the full or partial URL. For instance template, specify only the resource policy name. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourcePolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_policies = $arr; + + return $this; + } + + /** + * The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD. To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-9 to use the latest Debian 9 image: projects/debian-cloud/global/images/family/debian-9 Alternatively, use a specific version of a public operating system image: projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD To create a disk with a custom image that you created, specify the image name in the following format: global/images/my-custom-image You can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name: global/images/family/my-image-family If the source image is deleted later, this field will not be set. + * + * Generated from protobuf field optional string source_image = 50443319; + * @return string + */ + public function getSourceImage() + { + return isset($this->source_image) ? $this->source_image : ''; + } + + public function hasSourceImage() + { + return isset($this->source_image); + } + + public function clearSourceImage() + { + unset($this->source_image); + } + + /** + * The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD. To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-9 to use the latest Debian 9 image: projects/debian-cloud/global/images/family/debian-9 Alternatively, use a specific version of a public operating system image: projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD To create a disk with a custom image that you created, specify the image name in the following format: global/images/my-custom-image You can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name: global/images/family/my-image-family If the source image is deleted later, this field will not be set. + * + * Generated from protobuf field optional string source_image = 50443319; + * @param string $var + * @return $this + */ + public function setSourceImage($var) + { + GPBUtil::checkString($var, True); + $this->source_image = $var; + + return $this; + } + + /** + * The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. InstanceTemplate and InstancePropertiesPatch do not store customer-supplied encryption keys, so you cannot create disks for instances in a managed instance group if the source images are encrypted with your own keys. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_image_encryption_key = 381503659; + * @return \Google\Cloud\Compute\V1\CustomerEncryptionKey|null + */ + public function getSourceImageEncryptionKey() + { + return $this->source_image_encryption_key; + } + + public function hasSourceImageEncryptionKey() + { + return isset($this->source_image_encryption_key); + } + + public function clearSourceImageEncryptionKey() + { + unset($this->source_image_encryption_key); + } + + /** + * The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. InstanceTemplate and InstancePropertiesPatch do not store customer-supplied encryption keys, so you cannot create disks for instances in a managed instance group if the source images are encrypted with your own keys. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_image_encryption_key = 381503659; + * @param \Google\Cloud\Compute\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setSourceImageEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomerEncryptionKey::class); + $this->source_image_encryption_key = $var; + + return $this; + } + + /** + * The source snapshot to create this disk. When creating a new instance, one of initializeParams.sourceSnapshot or initializeParams.sourceImage or disks.source is required except for local SSD. To create a disk with a snapshot that you created, specify the snapshot name in the following format: global/snapshots/my-backup If the source snapshot is deleted later, this field will not be set. + * + * Generated from protobuf field optional string source_snapshot = 126061928; + * @return string + */ + public function getSourceSnapshot() + { + return isset($this->source_snapshot) ? $this->source_snapshot : ''; + } + + public function hasSourceSnapshot() + { + return isset($this->source_snapshot); + } + + public function clearSourceSnapshot() + { + unset($this->source_snapshot); + } + + /** + * The source snapshot to create this disk. When creating a new instance, one of initializeParams.sourceSnapshot or initializeParams.sourceImage or disks.source is required except for local SSD. To create a disk with a snapshot that you created, specify the snapshot name in the following format: global/snapshots/my-backup If the source snapshot is deleted later, this field will not be set. + * + * Generated from protobuf field optional string source_snapshot = 126061928; + * @param string $var + * @return $this + */ + public function setSourceSnapshot($var) + { + GPBUtil::checkString($var, True); + $this->source_snapshot = $var; + + return $this; + } + + /** + * The customer-supplied encryption key of the source snapshot. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_snapshot_encryption_key = 303679322; + * @return \Google\Cloud\Compute\V1\CustomerEncryptionKey|null + */ + public function getSourceSnapshotEncryptionKey() + { + return $this->source_snapshot_encryption_key; + } + + public function hasSourceSnapshotEncryptionKey() + { + return isset($this->source_snapshot_encryption_key); + } + + public function clearSourceSnapshotEncryptionKey() + { + unset($this->source_snapshot_encryption_key); + } + + /** + * The customer-supplied encryption key of the source snapshot. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_snapshot_encryption_key = 303679322; + * @param \Google\Cloud\Compute\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setSourceSnapshotEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomerEncryptionKey::class); + $this->source_snapshot_encryption_key = $var; + + return $this; + } + + /** + * The storage pool in which the new disk is created. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /storagePools/storagePool - projects/project/zones/zone/storagePools/storagePool - zones/zone/storagePools/storagePool + * + * Generated from protobuf field optional string storage_pool = 360473440; + * @return string + */ + public function getStoragePool() + { + return isset($this->storage_pool) ? $this->storage_pool : ''; + } + + public function hasStoragePool() + { + return isset($this->storage_pool); + } + + public function clearStoragePool() + { + unset($this->storage_pool); + } + + /** + * The storage pool in which the new disk is created. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /storagePools/storagePool - projects/project/zones/zone/storagePools/storagePool - zones/zone/storagePools/storagePool + * + * Generated from protobuf field optional string storage_pool = 360473440; + * @param string $var + * @return $this + */ + public function setStoragePool($var) + { + GPBUtil::checkString($var, True); + $this->storage_pool = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDiskInitializeParams/Architecture.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDiskInitializeParams/Architecture.php new file mode 100644 index 000000000000..a4b13a045543 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDiskInitializeParams/Architecture.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.AttachedDiskInitializeParams.Architecture + */ +class Architecture +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ARCHITECTURE = 0; + */ + const UNDEFINED_ARCHITECTURE = 0; + /** + * Default value indicating Architecture is not set. + * + * Generated from protobuf enum ARCHITECTURE_UNSPECIFIED = 394750507; + */ + const ARCHITECTURE_UNSPECIFIED = 394750507; + /** + * Machines with architecture ARM64 + * + * Generated from protobuf enum ARM64 = 62547450; + */ + const ARM64 = 62547450; + /** + * Machines with architecture X86_64 + * + * Generated from protobuf enum X86_64 = 425300551; + */ + const X86_64 = 425300551; + + private static $valueToName = [ + self::UNDEFINED_ARCHITECTURE => 'UNDEFINED_ARCHITECTURE', + self::ARCHITECTURE_UNSPECIFIED => 'ARCHITECTURE_UNSPECIFIED', + self::ARM64 => 'ARM64', + self::X86_64 => 'X86_64', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Architecture::class, \Google\Cloud\Compute\V1\AttachedDiskInitializeParams_Architecture::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDiskInitializeParams/OnUpdateAction.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDiskInitializeParams/OnUpdateAction.php new file mode 100644 index 000000000000..c80a3d012a85 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AttachedDiskInitializeParams/OnUpdateAction.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.AttachedDiskInitializeParams.OnUpdateAction + */ +class OnUpdateAction +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ON_UPDATE_ACTION = 0; + */ + const UNDEFINED_ON_UPDATE_ACTION = 0; + /** + * Always recreate the disk. + * + * Generated from protobuf enum RECREATE_DISK = 494767853; + */ + const RECREATE_DISK = 494767853; + /** + * Recreate the disk if source (image, snapshot) of this disk is different from source of existing disk. + * + * Generated from protobuf enum RECREATE_DISK_IF_SOURCE_CHANGED = 398099712; + */ + const RECREATE_DISK_IF_SOURCE_CHANGED = 398099712; + /** + * Use the existing disk, this is the default behaviour. + * + * Generated from protobuf enum USE_EXISTING_DISK = 232682233; + */ + const USE_EXISTING_DISK = 232682233; + + private static $valueToName = [ + self::UNDEFINED_ON_UPDATE_ACTION => 'UNDEFINED_ON_UPDATE_ACTION', + self::RECREATE_DISK => 'RECREATE_DISK', + self::RECREATE_DISK_IF_SOURCE_CHANGED => 'RECREATE_DISK_IF_SOURCE_CHANGED', + self::USE_EXISTING_DISK => 'USE_EXISTING_DISK', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(OnUpdateAction::class, \Google\Cloud\Compute\V1\AttachedDiskInitializeParams_OnUpdateAction::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AuditConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AuditConfig.php new file mode 100644 index 000000000000..80dcbaa60145 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AuditConfig.php @@ -0,0 +1,145 @@ +google.cloud.compute.v1.AuditConfig + */ +class AuditConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The configuration for logging of each type of permission. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AuditLogConfig audit_log_configs = 488420626; + */ + private $audit_log_configs; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated string exempted_members = 232615576; + */ + private $exempted_members; + /** + * Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services. + * + * Generated from protobuf field optional string service = 373540533; + */ + protected $service = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\AuditLogConfig>|\Google\Protobuf\Internal\RepeatedField $audit_log_configs + * The configuration for logging of each type of permission. + * @type array|\Google\Protobuf\Internal\RepeatedField $exempted_members + * This is deprecated and has no effect. Do not use. + * @type string $service + * Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The configuration for logging of each type of permission. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AuditLogConfig audit_log_configs = 488420626; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAuditLogConfigs() + { + return $this->audit_log_configs; + } + + /** + * The configuration for logging of each type of permission. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AuditLogConfig audit_log_configs = 488420626; + * @param array<\Google\Cloud\Compute\V1\AuditLogConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAuditLogConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AuditLogConfig::class); + $this->audit_log_configs = $arr; + + return $this; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated string exempted_members = 232615576; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExemptedMembers() + { + return $this->exempted_members; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated string exempted_members = 232615576; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExemptedMembers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->exempted_members = $arr; + + return $this; + } + + /** + * Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services. + * + * Generated from protobuf field optional string service = 373540533; + * @return string + */ + public function getService() + { + return isset($this->service) ? $this->service : ''; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services. + * + * Generated from protobuf field optional string service = 373540533; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AuditLogConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AuditLogConfig.php new file mode 100644 index 000000000000..b942be3cdbdc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AuditLogConfig.php @@ -0,0 +1,159 @@ +google.cloud.compute.v1.AuditLogConfig + */ +class AuditLogConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies the identities that do not cause logging for this type of permission. Follows the same format of Binding.members. + * + * Generated from protobuf field repeated string exempted_members = 232615576; + */ + private $exempted_members; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional bool ignore_child_exemptions = 70141850; + */ + protected $ignore_child_exemptions = null; + /** + * The log type that this config enables. + * Check the LogType enum for the list of possible values. + * + * Generated from protobuf field optional string log_type = 403115861; + */ + protected $log_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $exempted_members + * Specifies the identities that do not cause logging for this type of permission. Follows the same format of Binding.members. + * @type bool $ignore_child_exemptions + * This is deprecated and has no effect. Do not use. + * @type string $log_type + * The log type that this config enables. + * Check the LogType enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies the identities that do not cause logging for this type of permission. Follows the same format of Binding.members. + * + * Generated from protobuf field repeated string exempted_members = 232615576; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExemptedMembers() + { + return $this->exempted_members; + } + + /** + * Specifies the identities that do not cause logging for this type of permission. Follows the same format of Binding.members. + * + * Generated from protobuf field repeated string exempted_members = 232615576; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExemptedMembers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->exempted_members = $arr; + + return $this; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional bool ignore_child_exemptions = 70141850; + * @return bool + */ + public function getIgnoreChildExemptions() + { + return isset($this->ignore_child_exemptions) ? $this->ignore_child_exemptions : false; + } + + public function hasIgnoreChildExemptions() + { + return isset($this->ignore_child_exemptions); + } + + public function clearIgnoreChildExemptions() + { + unset($this->ignore_child_exemptions); + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional bool ignore_child_exemptions = 70141850; + * @param bool $var + * @return $this + */ + public function setIgnoreChildExemptions($var) + { + GPBUtil::checkBool($var); + $this->ignore_child_exemptions = $var; + + return $this; + } + + /** + * The log type that this config enables. + * Check the LogType enum for the list of possible values. + * + * Generated from protobuf field optional string log_type = 403115861; + * @return string + */ + public function getLogType() + { + return isset($this->log_type) ? $this->log_type : ''; + } + + public function hasLogType() + { + return isset($this->log_type); + } + + public function clearLogType() + { + unset($this->log_type); + } + + /** + * The log type that this config enables. + * Check the LogType enum for the list of possible values. + * + * Generated from protobuf field optional string log_type = 403115861; + * @param string $var + * @return $this + */ + public function setLogType($var) + { + GPBUtil::checkString($var, True); + $this->log_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AuditLogConfig/LogType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AuditLogConfig/LogType.php new file mode 100644 index 000000000000..34077568eb7f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AuditLogConfig/LogType.php @@ -0,0 +1,78 @@ +google.cloud.compute.v1.AuditLogConfig.LogType + */ +class LogType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_LOG_TYPE = 0; + */ + const UNDEFINED_LOG_TYPE = 0; + /** + * Admin reads. Example: CloudIAM getIamPolicy + * + * Generated from protobuf enum ADMIN_READ = 128951462; + */ + const ADMIN_READ = 128951462; + /** + * Data reads. Example: CloudSQL Users list + * + * Generated from protobuf enum DATA_READ = 305224971; + */ + const DATA_READ = 305224971; + /** + * Data writes. Example: CloudSQL Users create + * + * Generated from protobuf enum DATA_WRITE = 340181738; + */ + const DATA_WRITE = 340181738; + /** + * Default case. Should never be this. + * + * Generated from protobuf enum LOG_TYPE_UNSPECIFIED = 154527053; + */ + const LOG_TYPE_UNSPECIFIED = 154527053; + + private static $valueToName = [ + self::UNDEFINED_LOG_TYPE => 'UNDEFINED_LOG_TYPE', + self::ADMIN_READ => 'ADMIN_READ', + self::DATA_READ => 'DATA_READ', + self::DATA_WRITE => 'DATA_WRITE', + self::LOG_TYPE_UNSPECIFIED => 'LOG_TYPE_UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LogType::class, \Google\Cloud\Compute\V1\AuditLogConfig_LogType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AuthorizationLoggingOptions.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AuthorizationLoggingOptions.php new file mode 100644 index 000000000000..03f89e391a21 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AuthorizationLoggingOptions.php @@ -0,0 +1,81 @@ +google.cloud.compute.v1.AuthorizationLoggingOptions + */ +class AuthorizationLoggingOptions extends \Google\Protobuf\Internal\Message +{ + /** + * This is deprecated and has no effect. Do not use. + * Check the PermissionType enum for the list of possible values. + * + * Generated from protobuf field optional string permission_type = 525978538; + */ + protected $permission_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $permission_type + * This is deprecated and has no effect. Do not use. + * Check the PermissionType enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * This is deprecated and has no effect. Do not use. + * Check the PermissionType enum for the list of possible values. + * + * Generated from protobuf field optional string permission_type = 525978538; + * @return string + */ + public function getPermissionType() + { + return isset($this->permission_type) ? $this->permission_type : ''; + } + + public function hasPermissionType() + { + return isset($this->permission_type); + } + + public function clearPermissionType() + { + unset($this->permission_type); + } + + /** + * This is deprecated and has no effect. Do not use. + * Check the PermissionType enum for the list of possible values. + * + * Generated from protobuf field optional string permission_type = 525978538; + * @param string $var + * @return $this + */ + public function setPermissionType($var) + { + GPBUtil::checkString($var, True); + $this->permission_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AuthorizationLoggingOptions/PermissionType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AuthorizationLoggingOptions/PermissionType.php new file mode 100644 index 000000000000..8de800b60fe7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AuthorizationLoggingOptions/PermissionType.php @@ -0,0 +1,85 @@ +google.cloud.compute.v1.AuthorizationLoggingOptions.PermissionType + */ +class PermissionType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PERMISSION_TYPE = 0; + */ + const UNDEFINED_PERMISSION_TYPE = 0; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum ADMIN_READ = 128951462; + */ + const ADMIN_READ = 128951462; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum ADMIN_WRITE = 244412079; + */ + const ADMIN_WRITE = 244412079; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum DATA_READ = 305224971; + */ + const DATA_READ = 305224971; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum DATA_WRITE = 340181738; + */ + const DATA_WRITE = 340181738; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum PERMISSION_TYPE_UNSPECIFIED = 440313346; + */ + const PERMISSION_TYPE_UNSPECIFIED = 440313346; + + private static $valueToName = [ + self::UNDEFINED_PERMISSION_TYPE => 'UNDEFINED_PERMISSION_TYPE', + self::ADMIN_READ => 'ADMIN_READ', + self::ADMIN_WRITE => 'ADMIN_WRITE', + self::DATA_READ => 'DATA_READ', + self::DATA_WRITE => 'DATA_WRITE', + self::PERMISSION_TYPE_UNSPECIFIED => 'PERMISSION_TYPE_UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PermissionType::class, \Google\Cloud\Compute\V1\AuthorizationLoggingOptions_PermissionType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Autoscaler.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Autoscaler.php new file mode 100644 index 000000000000..15536b19fcc7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Autoscaler.php @@ -0,0 +1,633 @@ +google.cloud.compute.v1.Autoscaler + */ +class Autoscaler extends \Google\Protobuf\Internal\Message +{ + /** + * The configuration parameters for the autoscaling algorithm. You can define one or more signals for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization. If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AutoscalingPolicy autoscaling_policy = 221950041; + */ + protected $autoscaling_policy = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#autoscaler for autoscalers. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] Target recommended MIG size (number of instances) computed by autoscaler. Autoscaler calculates the recommended MIG size even when the autoscaling policy mode is different from ON. This field is empty when autoscaler is not connected to an existing managed instance group or autoscaler did not generate its prediction. + * + * Generated from protobuf field optional int32 recommended_size = 257915749; + */ + protected $recommended_size = null; + /** + * [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope). + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Status information of existing scaling schedules. + * + * Generated from protobuf field map scaling_schedule_status = 465950178; + */ + private $scaling_schedule_status; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] The status of the autoscaler configuration. Current set of possible values: - PENDING: Autoscaler backend hasn't read new/updated configuration. - DELETING: Configuration is being deleted. - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field. - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + /** + * [Output Only] Human-readable details about the current state of the autoscaler. Read the documentation for Commonly returned status messages for examples of status messages you might encounter. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AutoscalerStatusDetails status_details = 363353845; + */ + private $status_details; + /** + * URL of the managed instance group that this autoscaler will scale. This field is required when creating an autoscaler. + * + * Generated from protobuf field optional string target = 192835985; + */ + protected $target = null; + /** + * [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope). + * + * Generated from protobuf field optional string zone = 3744684; + */ + protected $zone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\AutoscalingPolicy $autoscaling_policy + * The configuration parameters for the autoscaling algorithm. You can define one or more signals for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization. If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of the resource. Always compute#autoscaler for autoscalers. + * @type string $name + * 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 int $recommended_size + * [Output Only] Target recommended MIG size (number of instances) computed by autoscaler. Autoscaler calculates the recommended MIG size even when the autoscaling policy mode is different from ON. This field is empty when autoscaler is not connected to an existing managed instance group or autoscaler did not generate its prediction. + * @type string $region + * [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope). + * @type array|\Google\Protobuf\Internal\MapField $scaling_schedule_status + * [Output Only] Status information of existing scaling schedules. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $status + * [Output Only] The status of the autoscaler configuration. Current set of possible values: - PENDING: Autoscaler backend hasn't read new/updated configuration. - DELETING: Configuration is being deleted. - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field. - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future. + * Check the Status enum for the list of possible values. + * @type array<\Google\Cloud\Compute\V1\AutoscalerStatusDetails>|\Google\Protobuf\Internal\RepeatedField $status_details + * [Output Only] Human-readable details about the current state of the autoscaler. Read the documentation for Commonly returned status messages for examples of status messages you might encounter. + * @type string $target + * URL of the managed instance group that this autoscaler will scale. This field is required when creating an autoscaler. + * @type string $zone + * [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The configuration parameters for the autoscaling algorithm. You can define one or more signals for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization. If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AutoscalingPolicy autoscaling_policy = 221950041; + * @return \Google\Cloud\Compute\V1\AutoscalingPolicy|null + */ + public function getAutoscalingPolicy() + { + return $this->autoscaling_policy; + } + + public function hasAutoscalingPolicy() + { + return isset($this->autoscaling_policy); + } + + public function clearAutoscalingPolicy() + { + unset($this->autoscaling_policy); + } + + /** + * The configuration parameters for the autoscaling algorithm. You can define one or more signals for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization. If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AutoscalingPolicy autoscaling_policy = 221950041; + * @param \Google\Cloud\Compute\V1\AutoscalingPolicy $var + * @return $this + */ + public function setAutoscalingPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\AutoscalingPolicy::class); + $this->autoscaling_policy = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#autoscaler for autoscalers. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#autoscaler for autoscalers. + * + * 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; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * [Output Only] Target recommended MIG size (number of instances) computed by autoscaler. Autoscaler calculates the recommended MIG size even when the autoscaling policy mode is different from ON. This field is empty when autoscaler is not connected to an existing managed instance group or autoscaler did not generate its prediction. + * + * Generated from protobuf field optional int32 recommended_size = 257915749; + * @return int + */ + public function getRecommendedSize() + { + return isset($this->recommended_size) ? $this->recommended_size : 0; + } + + public function hasRecommendedSize() + { + return isset($this->recommended_size); + } + + public function clearRecommendedSize() + { + unset($this->recommended_size); + } + + /** + * [Output Only] Target recommended MIG size (number of instances) computed by autoscaler. Autoscaler calculates the recommended MIG size even when the autoscaling policy mode is different from ON. This field is empty when autoscaler is not connected to an existing managed instance group or autoscaler did not generate its prediction. + * + * Generated from protobuf field optional int32 recommended_size = 257915749; + * @param int $var + * @return $this + */ + public function setRecommendedSize($var) + { + GPBUtil::checkInt32($var); + $this->recommended_size = $var; + + return $this; + } + + /** + * [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope). + * + * 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 group resides (for autoscalers living in regional scope). + * + * 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] Status information of existing scaling schedules. + * + * Generated from protobuf field map scaling_schedule_status = 465950178; + * @return \Google\Protobuf\Internal\MapField + */ + public function getScalingScheduleStatus() + { + return $this->scaling_schedule_status; + } + + /** + * [Output Only] Status information of existing scaling schedules. + * + * Generated from protobuf field map scaling_schedule_status = 465950178; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setScalingScheduleStatus($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ScalingScheduleStatus::class); + $this->scaling_schedule_status = $arr; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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] The status of the autoscaler configuration. Current set of possible values: - PENDING: Autoscaler backend hasn't read new/updated configuration. - DELETING: Configuration is being deleted. - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field. - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] The status of the autoscaler configuration. Current set of possible values: - PENDING: Autoscaler backend hasn't read new/updated configuration. - DELETING: Configuration is being deleted. - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field. - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + + /** + * [Output Only] Human-readable details about the current state of the autoscaler. Read the documentation for Commonly returned status messages for examples of status messages you might encounter. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AutoscalerStatusDetails status_details = 363353845; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStatusDetails() + { + return $this->status_details; + } + + /** + * [Output Only] Human-readable details about the current state of the autoscaler. Read the documentation for Commonly returned status messages for examples of status messages you might encounter. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AutoscalerStatusDetails status_details = 363353845; + * @param array<\Google\Cloud\Compute\V1\AutoscalerStatusDetails>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStatusDetails($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AutoscalerStatusDetails::class); + $this->status_details = $arr; + + return $this; + } + + /** + * URL of the managed instance group that this autoscaler will scale. This field is required when creating an autoscaler. + * + * Generated from protobuf field optional string target = 192835985; + * @return string + */ + public function getTarget() + { + return isset($this->target) ? $this->target : ''; + } + + public function hasTarget() + { + return isset($this->target); + } + + public function clearTarget() + { + unset($this->target); + } + + /** + * URL of the managed instance group that this autoscaler will scale. This field is required when creating an autoscaler. + * + * Generated from protobuf field optional string target = 192835985; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope). + * + * Generated from protobuf field optional string zone = 3744684; + * @return string + */ + public function getZone() + { + return isset($this->zone) ? $this->zone : ''; + } + + public function hasZone() + { + return isset($this->zone); + } + + public function clearZone() + { + unset($this->zone); + } + + /** + * [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope). + * + * Generated from protobuf field optional string zone = 3744684; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Autoscaler/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Autoscaler/Status.php new file mode 100644 index 000000000000..ffa4d83d5aa2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Autoscaler/Status.php @@ -0,0 +1,78 @@ +google.cloud.compute.v1.Autoscaler.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * Configuration is acknowledged to be effective + * + * Generated from protobuf enum ACTIVE = 314733318; + */ + const ACTIVE = 314733318; + /** + * Configuration is being deleted + * + * Generated from protobuf enum DELETING = 528602024; + */ + const DELETING = 528602024; + /** + * Configuration has errors. Actionable for users. + * + * Generated from protobuf enum ERROR = 66247144; + */ + const ERROR = 66247144; + /** + * Autoscaler backend hasn't read new/updated configuration + * + * Generated from protobuf enum PENDING = 35394935; + */ + const PENDING = 35394935; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::ACTIVE => 'ACTIVE', + self::DELETING => 'DELETING', + self::ERROR => 'ERROR', + self::PENDING => 'PENDING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\Autoscaler_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalerAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalerAggregatedList.php new file mode 100644 index 000000000000..7645a49e2e77 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalerAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.AutoscalerAggregatedList + */ +class AutoscalerAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of AutoscalersScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#autoscalerAggregatedList for aggregated lists of autoscalers. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. end_interface: MixerListResponseWithEtagBuilder + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 AutoscalersScopedList resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#autoscalerAggregatedList for aggregated lists of autoscalers. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. end_interface: MixerListResponseWithEtagBuilder + * @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 AutoscalersScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of AutoscalersScopedList 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\AutoscalersScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#autoscalerAggregatedList for aggregated lists of autoscalers. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#autoscalerAggregatedList for aggregated lists of autoscalers. + * + * 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] Unreachable resources. end_interface: MixerListResponseWithEtagBuilder + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. end_interface: MixerListResponseWithEtagBuilder + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalerList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalerList.php new file mode 100644 index 000000000000..282203b7cc84 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalerList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.AutoscalerList + */ +class AutoscalerList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of Autoscaler resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Autoscaler items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#autoscalerList for lists of autoscalers. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\Autoscaler>|\Google\Protobuf\Internal\RepeatedField $items + * A list of Autoscaler resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#autoscalerList for lists of autoscalers. + * @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 Autoscaler resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Autoscaler items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of Autoscaler resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Autoscaler items = 100526016; + * @param array<\Google\Cloud\Compute\V1\Autoscaler>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Autoscaler::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#autoscalerList for lists of autoscalers. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#autoscalerList for lists of autoscalers. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalerStatusDetails.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalerStatusDetails.php new file mode 100644 index 000000000000..665cadb7c0db --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalerStatusDetails.php @@ -0,0 +1,124 @@ +google.cloud.compute.v1.AutoscalerStatusDetails + */ +class AutoscalerStatusDetails extends \Google\Protobuf\Internal\Message +{ + /** + * The status message. + * + * Generated from protobuf field optional string message = 418054151; + */ + protected $message = null; + /** + * The type of error, warning, or notice returned. Current set of possible values: - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state). - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group. - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas. - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling. - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels. - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group. - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling. - MISSING_LOAD_BALANCING_DATA_POINTS (WARNING): The autoscaler is configured to scale based on a load balancing signal but the instance group has not received any requests from the load balancer. - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won't change automatically. The autoscaling configuration is preserved. - MODE_ONLY_UP (WARNING): Autoscaling is in the "Autoscale only out" mode. The autoscaler can add instances but not remove any. - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it. - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances. - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region. - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist. - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate. - ZONE_RESOURCE_STOCKOUT (ERROR): For zonal autoscalers: there is a resource stockout in the chosen zone. For regional autoscalers: in at least one of the zones you're using there is a resource stockout. New values might be added in the future. Some of the values might not be available in all API versions. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $message + * The status message. + * @type string $type + * The type of error, warning, or notice returned. Current set of possible values: - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state). - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group. - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas. - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling. - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels. - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group. - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling. - MISSING_LOAD_BALANCING_DATA_POINTS (WARNING): The autoscaler is configured to scale based on a load balancing signal but the instance group has not received any requests from the load balancer. - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won't change automatically. The autoscaling configuration is preserved. - MODE_ONLY_UP (WARNING): Autoscaling is in the "Autoscale only out" mode. The autoscaler can add instances but not remove any. - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it. - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances. - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region. - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist. - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate. - ZONE_RESOURCE_STOCKOUT (ERROR): For zonal autoscalers: there is a resource stockout in the chosen zone. For regional autoscalers: in at least one of the zones you're using there is a resource stockout. New values might be added in the future. Some of the values might not be available in all API versions. + * Check the Type enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The status message. + * + * Generated from protobuf field optional string message = 418054151; + * @return string + */ + public function getMessage() + { + return isset($this->message) ? $this->message : ''; + } + + public function hasMessage() + { + return isset($this->message); + } + + public function clearMessage() + { + unset($this->message); + } + + /** + * The status message. + * + * Generated from protobuf field optional string message = 418054151; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + + /** + * The type of error, warning, or notice returned. Current set of possible values: - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state). - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group. - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas. - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling. - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels. - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group. - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling. - MISSING_LOAD_BALANCING_DATA_POINTS (WARNING): The autoscaler is configured to scale based on a load balancing signal but the instance group has not received any requests from the load balancer. - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won't change automatically. The autoscaling configuration is preserved. - MODE_ONLY_UP (WARNING): Autoscaling is in the "Autoscale only out" mode. The autoscaler can add instances but not remove any. - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it. - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances. - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region. - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist. - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate. - ZONE_RESOURCE_STOCKOUT (ERROR): For zonal autoscalers: there is a resource stockout in the chosen zone. For regional autoscalers: in at least one of the zones you're using there is a resource stockout. New values might be added in the future. Some of the values might not be available in all API versions. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * The type of error, warning, or notice returned. Current set of possible values: - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state). - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group. - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas. - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling. - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels. - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group. - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling. - MISSING_LOAD_BALANCING_DATA_POINTS (WARNING): The autoscaler is configured to scale based on a load balancing signal but the instance group has not received any requests from the load balancer. - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won't change automatically. The autoscaling configuration is preserved. - MODE_ONLY_UP (WARNING): Autoscaling is in the "Autoscale only out" mode. The autoscaler can add instances but not remove any. - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it. - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances. - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region. - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist. - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate. - ZONE_RESOURCE_STOCKOUT (ERROR): For zonal autoscalers: there is a resource stockout in the chosen zone. For regional autoscalers: in at least one of the zones you're using there is a resource stockout. New values might be added in the future. Some of the values might not be available in all API versions. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalerStatusDetails/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalerStatusDetails/Type.php new file mode 100644 index 000000000000..abf2baea191a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalerStatusDetails/Type.php @@ -0,0 +1,188 @@ +google.cloud.compute.v1.AutoscalerStatusDetails.Type + */ +class Type +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TYPE = 0; + */ + const UNDEFINED_TYPE = 0; + /** + * All instances in the instance group are unhealthy (not in RUNNING state). + * + * Generated from protobuf enum ALL_INSTANCES_UNHEALTHY = 404965477; + */ + const ALL_INSTANCES_UNHEALTHY = 404965477; + /** + * There is no backend service attached to the instance group. + * + * Generated from protobuf enum BACKEND_SERVICE_DOES_NOT_EXIST = 191417626; + */ + const BACKEND_SERVICE_DOES_NOT_EXIST = 191417626; + /** + * Autoscaler recommends a size greater than maxNumReplicas. + * + * Generated from protobuf enum CAPPED_AT_MAX_NUM_REPLICAS = 518617; + */ + const CAPPED_AT_MAX_NUM_REPLICAS = 518617; + /** + * The custom metric samples are not exported often enough to be a credible base for autoscaling. + * + * Generated from protobuf enum CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE = 328964659; + */ + const CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE = 328964659; + /** + * The custom metric that was specified does not exist or does not have the necessary labels. + * + * Generated from protobuf enum CUSTOM_METRIC_INVALID = 204430550; + */ + const CUSTOM_METRIC_INVALID = 204430550; + /** + * The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group. + * + * Generated from protobuf enum MIN_EQUALS_MAX = 2821361; + */ + const MIN_EQUALS_MAX = 2821361; + /** + * The autoscaler did not receive any data from the custom metric configured for autoscaling. + * + * Generated from protobuf enum MISSING_CUSTOM_METRIC_DATA_POINTS = 94885086; + */ + const MISSING_CUSTOM_METRIC_DATA_POINTS = 94885086; + /** + * The autoscaler is configured to scale based on a load balancing signal but the instance group has not received any requests from the load balancer. + * + * Generated from protobuf enum MISSING_LOAD_BALANCING_DATA_POINTS = 509858898; + */ + const MISSING_LOAD_BALANCING_DATA_POINTS = 509858898; + /** + * Autoscaling is turned off. The number of instances in the group won't change automatically. The autoscaling configuration is preserved. + * + * Generated from protobuf enum MODE_OFF = 164169907; + */ + const MODE_OFF = 164169907; + /** + * Autoscaling is in the "Autoscale only scale out" mode. Instances in the group will be only added. + * + * Generated from protobuf enum MODE_ONLY_SCALE_OUT = 3840994; + */ + const MODE_ONLY_SCALE_OUT = 3840994; + /** + * Autoscaling is in the "Autoscale only out" mode. Instances in the group will be only added. + * + * Generated from protobuf enum MODE_ONLY_UP = 100969842; + */ + const MODE_ONLY_UP = 100969842; + /** + * The instance group cannot be autoscaled because it has more than one backend service attached to it. + * + * Generated from protobuf enum MORE_THAN_ONE_BACKEND_SERVICE = 151922141; + */ + const MORE_THAN_ONE_BACKEND_SERVICE = 151922141; + /** + * There is insufficient quota for the necessary resources, such as CPU or number of instances. + * + * Generated from protobuf enum NOT_ENOUGH_QUOTA_AVAILABLE = 403101631; + */ + const NOT_ENOUGH_QUOTA_AVAILABLE = 403101631; + /** + * Showed only for regional autoscalers: there is a resource stockout in the chosen region. + * + * Generated from protobuf enum REGION_RESOURCE_STOCKOUT = 528622846; + */ + const REGION_RESOURCE_STOCKOUT = 528622846; + /** + * The target to be scaled does not exist. + * + * Generated from protobuf enum SCALING_TARGET_DOES_NOT_EXIST = 122636699; + */ + const SCALING_TARGET_DOES_NOT_EXIST = 122636699; + /** + * For some scaling schedules minRequiredReplicas is greater than maxNumReplicas. Autoscaler always recommends at most maxNumReplicas instances. + * + * Generated from protobuf enum SCHEDULED_INSTANCES_GREATER_THAN_AUTOSCALER_MAX = 29275586; + */ + const SCHEDULED_INSTANCES_GREATER_THAN_AUTOSCALER_MAX = 29275586; + /** + * For some scaling schedules minRequiredReplicas is less than minNumReplicas. Autoscaler always recommends at least minNumReplicas instances. + * + * Generated from protobuf enum SCHEDULED_INSTANCES_LESS_THAN_AUTOSCALER_MIN = 398287669; + */ + const SCHEDULED_INSTANCES_LESS_THAN_AUTOSCALER_MIN = 398287669; + /** + * Generated from protobuf enum UNKNOWN = 433141802; + */ + const UNKNOWN = 433141802; + /** + * Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate. + * + * Generated from protobuf enum UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION = 330845009; + */ + const UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION = 330845009; + /** + * For zonal autoscalers: there is a resource stockout in the chosen zone. For regional autoscalers: in at least one of the zones you're using there is a resource stockout. + * + * Generated from protobuf enum ZONE_RESOURCE_STOCKOUT = 210200502; + */ + const ZONE_RESOURCE_STOCKOUT = 210200502; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::ALL_INSTANCES_UNHEALTHY => 'ALL_INSTANCES_UNHEALTHY', + self::BACKEND_SERVICE_DOES_NOT_EXIST => 'BACKEND_SERVICE_DOES_NOT_EXIST', + self::CAPPED_AT_MAX_NUM_REPLICAS => 'CAPPED_AT_MAX_NUM_REPLICAS', + self::CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE => 'CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE', + self::CUSTOM_METRIC_INVALID => 'CUSTOM_METRIC_INVALID', + self::MIN_EQUALS_MAX => 'MIN_EQUALS_MAX', + self::MISSING_CUSTOM_METRIC_DATA_POINTS => 'MISSING_CUSTOM_METRIC_DATA_POINTS', + self::MISSING_LOAD_BALANCING_DATA_POINTS => 'MISSING_LOAD_BALANCING_DATA_POINTS', + self::MODE_OFF => 'MODE_OFF', + self::MODE_ONLY_SCALE_OUT => 'MODE_ONLY_SCALE_OUT', + self::MODE_ONLY_UP => 'MODE_ONLY_UP', + self::MORE_THAN_ONE_BACKEND_SERVICE => 'MORE_THAN_ONE_BACKEND_SERVICE', + self::NOT_ENOUGH_QUOTA_AVAILABLE => 'NOT_ENOUGH_QUOTA_AVAILABLE', + self::REGION_RESOURCE_STOCKOUT => 'REGION_RESOURCE_STOCKOUT', + self::SCALING_TARGET_DOES_NOT_EXIST => 'SCALING_TARGET_DOES_NOT_EXIST', + self::SCHEDULED_INSTANCES_GREATER_THAN_AUTOSCALER_MAX => 'SCHEDULED_INSTANCES_GREATER_THAN_AUTOSCALER_MAX', + self::SCHEDULED_INSTANCES_LESS_THAN_AUTOSCALER_MIN => 'SCHEDULED_INSTANCES_LESS_THAN_AUTOSCALER_MIN', + self::UNKNOWN => 'UNKNOWN', + self::UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION => 'UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION', + self::ZONE_RESOURCE_STOCKOUT => 'ZONE_RESOURCE_STOCKOUT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Compute\V1\AutoscalerStatusDetails_Type::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalersScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalersScopedList.php new file mode 100644 index 000000000000..820f3df7774c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalersScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.AutoscalersScopedList + */ +class AutoscalersScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A list of autoscalers contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Autoscaler autoscalers = 465771644; + */ + private $autoscalers; + /** + * [Output Only] Informational warning which replaces the list of autoscalers when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\Autoscaler>|\Google\Protobuf\Internal\RepeatedField $autoscalers + * [Output Only] A list of autoscalers contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] Informational warning which replaces the list of autoscalers 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 autoscalers contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Autoscaler autoscalers = 465771644; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAutoscalers() + { + return $this->autoscalers; + } + + /** + * [Output Only] A list of autoscalers contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Autoscaler autoscalers = 465771644; + * @param array<\Google\Cloud\Compute\V1\Autoscaler>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAutoscalers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Autoscaler::class); + $this->autoscalers = $arr; + + return $this; + } + + /** + * [Output Only] Informational warning which replaces the list of autoscalers 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] Informational warning which replaces the list of autoscalers 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicy.php new file mode 100644 index 000000000000..602da2478593 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicy.php @@ -0,0 +1,406 @@ +google.cloud.compute.v1.AutoscalingPolicy + */ +class AutoscalingPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * The number of seconds that your application takes to initialize on a VM instance. This is referred to as the [initialization period](/compute/docs/autoscaler#cool_down_period). Specifying an accurate initialization period improves autoscaler decisions. For example, when scaling out, the autoscaler ignores data from VMs that are still initializing because those VMs might not yet represent normal usage of your application. The default initialization period is 60 seconds. Initialization periods might vary because of numerous factors. We recommend that you test how long your application takes to initialize. To do this, create a VM and time your application's startup process. + * + * Generated from protobuf field optional int32 cool_down_period_sec = 107692954; + */ + protected $cool_down_period_sec = null; + /** + * Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147; + */ + protected $cpu_utilization = null; + /** + * Configuration parameters of autoscaling based on a custom metric. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850; + */ + private $custom_metric_utilizations; + /** + * Configuration parameters of autoscaling based on load balancer. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403; + */ + protected $load_balancing_utilization = null; + /** + * The maximum number of instances that the autoscaler can scale out to. This is required when creating or updating an autoscaler. The maximum number of replicas must not be lower than minimal number of replicas. + * + * Generated from protobuf field optional int32 max_num_replicas = 62327375; + */ + protected $max_num_replicas = null; + /** + * The minimum number of replicas that the autoscaler can scale in to. This cannot be less than 0. If not provided, autoscaler chooses a default value depending on maximum number of instances allowed. + * + * Generated from protobuf field optional int32 min_num_replicas = 535329825; + */ + protected $min_num_replicas = null; + /** + * Defines the operating mode for this policy. The following modes are available: - OFF: Disables the autoscaler but maintains its configuration. - ONLY_SCALE_OUT: Restricts the autoscaler to add VM instances only. - ON: Enables all autoscaler activities according to its policy. For more information, see "Turning off or restricting an autoscaler" + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + */ + protected $mode = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872; + */ + protected $scale_in_control = null; + /** + * Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler, and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules is applied. Up to 128 scaling schedules are allowed. + * + * Generated from protobuf field map scaling_schedules = 355416580; + */ + private $scaling_schedules; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $cool_down_period_sec + * The number of seconds that your application takes to initialize on a VM instance. This is referred to as the [initialization period](/compute/docs/autoscaler#cool_down_period). Specifying an accurate initialization period improves autoscaler decisions. For example, when scaling out, the autoscaler ignores data from VMs that are still initializing because those VMs might not yet represent normal usage of your application. The default initialization period is 60 seconds. Initialization periods might vary because of numerous factors. We recommend that you test how long your application takes to initialize. To do this, create a VM and time your application's startup process. + * @type \Google\Cloud\Compute\V1\AutoscalingPolicyCpuUtilization $cpu_utilization + * Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group. + * @type array<\Google\Cloud\Compute\V1\AutoscalingPolicyCustomMetricUtilization>|\Google\Protobuf\Internal\RepeatedField $custom_metric_utilizations + * Configuration parameters of autoscaling based on a custom metric. + * @type \Google\Cloud\Compute\V1\AutoscalingPolicyLoadBalancingUtilization $load_balancing_utilization + * Configuration parameters of autoscaling based on load balancer. + * @type int $max_num_replicas + * The maximum number of instances that the autoscaler can scale out to. This is required when creating or updating an autoscaler. The maximum number of replicas must not be lower than minimal number of replicas. + * @type int $min_num_replicas + * The minimum number of replicas that the autoscaler can scale in to. This cannot be less than 0. If not provided, autoscaler chooses a default value depending on maximum number of instances allowed. + * @type string $mode + * Defines the operating mode for this policy. The following modes are available: - OFF: Disables the autoscaler but maintains its configuration. - ONLY_SCALE_OUT: Restricts the autoscaler to add VM instances only. - ON: Enables all autoscaler activities according to its policy. For more information, see "Turning off or restricting an autoscaler" + * Check the Mode enum for the list of possible values. + * @type \Google\Cloud\Compute\V1\AutoscalingPolicyScaleInControl $scale_in_control + * @type array|\Google\Protobuf\Internal\MapField $scaling_schedules + * Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler, and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules is applied. Up to 128 scaling schedules are allowed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The number of seconds that your application takes to initialize on a VM instance. This is referred to as the [initialization period](/compute/docs/autoscaler#cool_down_period). Specifying an accurate initialization period improves autoscaler decisions. For example, when scaling out, the autoscaler ignores data from VMs that are still initializing because those VMs might not yet represent normal usage of your application. The default initialization period is 60 seconds. Initialization periods might vary because of numerous factors. We recommend that you test how long your application takes to initialize. To do this, create a VM and time your application's startup process. + * + * Generated from protobuf field optional int32 cool_down_period_sec = 107692954; + * @return int + */ + public function getCoolDownPeriodSec() + { + return isset($this->cool_down_period_sec) ? $this->cool_down_period_sec : 0; + } + + public function hasCoolDownPeriodSec() + { + return isset($this->cool_down_period_sec); + } + + public function clearCoolDownPeriodSec() + { + unset($this->cool_down_period_sec); + } + + /** + * The number of seconds that your application takes to initialize on a VM instance. This is referred to as the [initialization period](/compute/docs/autoscaler#cool_down_period). Specifying an accurate initialization period improves autoscaler decisions. For example, when scaling out, the autoscaler ignores data from VMs that are still initializing because those VMs might not yet represent normal usage of your application. The default initialization period is 60 seconds. Initialization periods might vary because of numerous factors. We recommend that you test how long your application takes to initialize. To do this, create a VM and time your application's startup process. + * + * Generated from protobuf field optional int32 cool_down_period_sec = 107692954; + * @param int $var + * @return $this + */ + public function setCoolDownPeriodSec($var) + { + GPBUtil::checkInt32($var); + $this->cool_down_period_sec = $var; + + return $this; + } + + /** + * Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147; + * @return \Google\Cloud\Compute\V1\AutoscalingPolicyCpuUtilization|null + */ + public function getCpuUtilization() + { + return $this->cpu_utilization; + } + + public function hasCpuUtilization() + { + return isset($this->cpu_utilization); + } + + public function clearCpuUtilization() + { + unset($this->cpu_utilization); + } + + /** + * Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AutoscalingPolicyCpuUtilization cpu_utilization = 381211147; + * @param \Google\Cloud\Compute\V1\AutoscalingPolicyCpuUtilization $var + * @return $this + */ + public function setCpuUtilization($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\AutoscalingPolicyCpuUtilization::class); + $this->cpu_utilization = $var; + + return $this; + } + + /** + * Configuration parameters of autoscaling based on a custom metric. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCustomMetricUtilizations() + { + return $this->custom_metric_utilizations; + } + + /** + * Configuration parameters of autoscaling based on a custom metric. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850; + * @param array<\Google\Cloud\Compute\V1\AutoscalingPolicyCustomMetricUtilization>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCustomMetricUtilizations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AutoscalingPolicyCustomMetricUtilization::class); + $this->custom_metric_utilizations = $arr; + + return $this; + } + + /** + * Configuration parameters of autoscaling based on load balancer. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403; + * @return \Google\Cloud\Compute\V1\AutoscalingPolicyLoadBalancingUtilization|null + */ + public function getLoadBalancingUtilization() + { + return $this->load_balancing_utilization; + } + + public function hasLoadBalancingUtilization() + { + return isset($this->load_balancing_utilization); + } + + public function clearLoadBalancingUtilization() + { + unset($this->load_balancing_utilization); + } + + /** + * Configuration parameters of autoscaling based on load balancer. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403; + * @param \Google\Cloud\Compute\V1\AutoscalingPolicyLoadBalancingUtilization $var + * @return $this + */ + public function setLoadBalancingUtilization($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\AutoscalingPolicyLoadBalancingUtilization::class); + $this->load_balancing_utilization = $var; + + return $this; + } + + /** + * The maximum number of instances that the autoscaler can scale out to. This is required when creating or updating an autoscaler. The maximum number of replicas must not be lower than minimal number of replicas. + * + * Generated from protobuf field optional int32 max_num_replicas = 62327375; + * @return int + */ + public function getMaxNumReplicas() + { + return isset($this->max_num_replicas) ? $this->max_num_replicas : 0; + } + + public function hasMaxNumReplicas() + { + return isset($this->max_num_replicas); + } + + public function clearMaxNumReplicas() + { + unset($this->max_num_replicas); + } + + /** + * The maximum number of instances that the autoscaler can scale out to. This is required when creating or updating an autoscaler. The maximum number of replicas must not be lower than minimal number of replicas. + * + * Generated from protobuf field optional int32 max_num_replicas = 62327375; + * @param int $var + * @return $this + */ + public function setMaxNumReplicas($var) + { + GPBUtil::checkInt32($var); + $this->max_num_replicas = $var; + + return $this; + } + + /** + * The minimum number of replicas that the autoscaler can scale in to. This cannot be less than 0. If not provided, autoscaler chooses a default value depending on maximum number of instances allowed. + * + * Generated from protobuf field optional int32 min_num_replicas = 535329825; + * @return int + */ + public function getMinNumReplicas() + { + return isset($this->min_num_replicas) ? $this->min_num_replicas : 0; + } + + public function hasMinNumReplicas() + { + return isset($this->min_num_replicas); + } + + public function clearMinNumReplicas() + { + unset($this->min_num_replicas); + } + + /** + * The minimum number of replicas that the autoscaler can scale in to. This cannot be less than 0. If not provided, autoscaler chooses a default value depending on maximum number of instances allowed. + * + * Generated from protobuf field optional int32 min_num_replicas = 535329825; + * @param int $var + * @return $this + */ + public function setMinNumReplicas($var) + { + GPBUtil::checkInt32($var); + $this->min_num_replicas = $var; + + return $this; + } + + /** + * Defines the operating mode for this policy. The following modes are available: - OFF: Disables the autoscaler but maintains its configuration. - ONLY_SCALE_OUT: Restricts the autoscaler to add VM instances only. - ON: Enables all autoscaler activities according to its policy. For more information, see "Turning off or restricting an autoscaler" + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + * @return string + */ + public function getMode() + { + return isset($this->mode) ? $this->mode : ''; + } + + public function hasMode() + { + return isset($this->mode); + } + + public function clearMode() + { + unset($this->mode); + } + + /** + * Defines the operating mode for this policy. The following modes are available: - OFF: Disables the autoscaler but maintains its configuration. - ONLY_SCALE_OUT: Restricts the autoscaler to add VM instances only. - ON: Enables all autoscaler activities according to its policy. For more information, see "Turning off or restricting an autoscaler" + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + * @param string $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkString($var, True); + $this->mode = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872; + * @return \Google\Cloud\Compute\V1\AutoscalingPolicyScaleInControl|null + */ + public function getScaleInControl() + { + return $this->scale_in_control; + } + + public function hasScaleInControl() + { + return isset($this->scale_in_control); + } + + public function clearScaleInControl() + { + unset($this->scale_in_control); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.AutoscalingPolicyScaleInControl scale_in_control = 527670872; + * @param \Google\Cloud\Compute\V1\AutoscalingPolicyScaleInControl $var + * @return $this + */ + public function setScaleInControl($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\AutoscalingPolicyScaleInControl::class); + $this->scale_in_control = $var; + + return $this; + } + + /** + * Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler, and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules is applied. Up to 128 scaling schedules are allowed. + * + * Generated from protobuf field map scaling_schedules = 355416580; + * @return \Google\Protobuf\Internal\MapField + */ + public function getScalingSchedules() + { + return $this->scaling_schedules; + } + + /** + * Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler, and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules is applied. Up to 128 scaling schedules are allowed. + * + * Generated from protobuf field map scaling_schedules = 355416580; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setScalingSchedules($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AutoscalingPolicyScalingSchedule::class); + $this->scaling_schedules = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicy/Mode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicy/Mode.php new file mode 100644 index 000000000000..1de18db0da85 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicy/Mode.php @@ -0,0 +1,78 @@ +google.cloud.compute.v1.AutoscalingPolicy.Mode + */ +class Mode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MODE = 0; + */ + const UNDEFINED_MODE = 0; + /** + * Do not automatically scale the MIG in or out. The recommended_size field contains the size of MIG that would be set if the actuation mode was enabled. + * + * Generated from protobuf enum OFF = 78159; + */ + const OFF = 78159; + /** + * Automatically scale the MIG in and out according to the policy. + * + * Generated from protobuf enum ON = 2527; + */ + const ON = 2527; + /** + * Automatically create VMs according to the policy, but do not scale the MIG in. + * + * Generated from protobuf enum ONLY_SCALE_OUT = 152713670; + */ + const ONLY_SCALE_OUT = 152713670; + /** + * Automatically create VMs according to the policy, but do not scale the MIG in. + * + * Generated from protobuf enum ONLY_UP = 478095374; + */ + const ONLY_UP = 478095374; + + private static $valueToName = [ + self::UNDEFINED_MODE => 'UNDEFINED_MODE', + self::OFF => 'OFF', + self::ON => 'ON', + self::ONLY_SCALE_OUT => 'ONLY_SCALE_OUT', + self::ONLY_UP => 'ONLY_UP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Mode::class, \Google\Cloud\Compute\V1\AutoscalingPolicy_Mode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyCpuUtilization.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyCpuUtilization.php new file mode 100644 index 000000000000..7cfd66c0e455 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyCpuUtilization.php @@ -0,0 +1,125 @@ +google.cloud.compute.v1.AutoscalingPolicyCpuUtilization + */ +class AutoscalingPolicyCpuUtilization extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are: * NONE (default). No predictive method is used. The autoscaler scales the group to meet current demand based on real-time metrics. * OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability by monitoring daily and weekly load patterns and scaling out ahead of anticipated demand. + * Check the PredictiveMethod enum for the list of possible values. + * + * Generated from protobuf field optional string predictive_method = 390220737; + */ + protected $predictive_method = null; + /** + * The target CPU utilization that the autoscaler maintains. Must be a float value in the range (0, 1]. If not specified, the default is 0.6. If the CPU level is below the target utilization, the autoscaler scales in the number of instances until it reaches the minimum number of instances you specified or until the average CPU of your instances reaches the target utilization. If the average CPU is above the target utilization, the autoscaler scales out until it reaches the maximum number of instances you specified or until the average utilization reaches the target utilization. + * + * Generated from protobuf field optional double utilization_target = 215905870; + */ + protected $utilization_target = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $predictive_method + * Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are: * NONE (default). No predictive method is used. The autoscaler scales the group to meet current demand based on real-time metrics. * OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability by monitoring daily and weekly load patterns and scaling out ahead of anticipated demand. + * Check the PredictiveMethod enum for the list of possible values. + * @type float $utilization_target + * The target CPU utilization that the autoscaler maintains. Must be a float value in the range (0, 1]. If not specified, the default is 0.6. If the CPU level is below the target utilization, the autoscaler scales in the number of instances until it reaches the minimum number of instances you specified or until the average CPU of your instances reaches the target utilization. If the average CPU is above the target utilization, the autoscaler scales out until it reaches the maximum number of instances you specified or until the average utilization reaches the target utilization. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are: * NONE (default). No predictive method is used. The autoscaler scales the group to meet current demand based on real-time metrics. * OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability by monitoring daily and weekly load patterns and scaling out ahead of anticipated demand. + * Check the PredictiveMethod enum for the list of possible values. + * + * Generated from protobuf field optional string predictive_method = 390220737; + * @return string + */ + public function getPredictiveMethod() + { + return isset($this->predictive_method) ? $this->predictive_method : ''; + } + + public function hasPredictiveMethod() + { + return isset($this->predictive_method); + } + + public function clearPredictiveMethod() + { + unset($this->predictive_method); + } + + /** + * Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are: * NONE (default). No predictive method is used. The autoscaler scales the group to meet current demand based on real-time metrics. * OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability by monitoring daily and weekly load patterns and scaling out ahead of anticipated demand. + * Check the PredictiveMethod enum for the list of possible values. + * + * Generated from protobuf field optional string predictive_method = 390220737; + * @param string $var + * @return $this + */ + public function setPredictiveMethod($var) + { + GPBUtil::checkString($var, True); + $this->predictive_method = $var; + + return $this; + } + + /** + * The target CPU utilization that the autoscaler maintains. Must be a float value in the range (0, 1]. If not specified, the default is 0.6. If the CPU level is below the target utilization, the autoscaler scales in the number of instances until it reaches the minimum number of instances you specified or until the average CPU of your instances reaches the target utilization. If the average CPU is above the target utilization, the autoscaler scales out until it reaches the maximum number of instances you specified or until the average utilization reaches the target utilization. + * + * Generated from protobuf field optional double utilization_target = 215905870; + * @return float + */ + public function getUtilizationTarget() + { + return isset($this->utilization_target) ? $this->utilization_target : 0.0; + } + + public function hasUtilizationTarget() + { + return isset($this->utilization_target); + } + + public function clearUtilizationTarget() + { + unset($this->utilization_target); + } + + /** + * The target CPU utilization that the autoscaler maintains. Must be a float value in the range (0, 1]. If not specified, the default is 0.6. If the CPU level is below the target utilization, the autoscaler scales in the number of instances until it reaches the minimum number of instances you specified or until the average CPU of your instances reaches the target utilization. If the average CPU is above the target utilization, the autoscaler scales out until it reaches the maximum number of instances you specified or until the average utilization reaches the target utilization. + * + * Generated from protobuf field optional double utilization_target = 215905870; + * @param float $var + * @return $this + */ + public function setUtilizationTarget($var) + { + GPBUtil::checkDouble($var); + $this->utilization_target = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyCpuUtilization/PredictiveMethod.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyCpuUtilization/PredictiveMethod.php new file mode 100644 index 000000000000..3a0ce037b2f6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyCpuUtilization/PredictiveMethod.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.PredictiveMethod + */ +class PredictiveMethod +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PREDICTIVE_METHOD = 0; + */ + const UNDEFINED_PREDICTIVE_METHOD = 0; + /** + * No predictive method is used. The autoscaler scales the group to meet current demand based on real-time metrics + * + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + /** + * Predictive autoscaling improves availability by monitoring daily and weekly load patterns and scaling out ahead of anticipated demand. + * + * Generated from protobuf enum OPTIMIZE_AVAILABILITY = 11629437; + */ + const OPTIMIZE_AVAILABILITY = 11629437; + + private static $valueToName = [ + self::UNDEFINED_PREDICTIVE_METHOD => 'UNDEFINED_PREDICTIVE_METHOD', + self::NONE => 'NONE', + self::OPTIMIZE_AVAILABILITY => 'OPTIMIZE_AVAILABILITY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PredictiveMethod::class, \Google\Cloud\Compute\V1\AutoscalingPolicyCpuUtilization_PredictiveMethod::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyCustomMetricUtilization.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyCustomMetricUtilization.php new file mode 100644 index 000000000000..c9784d1dbe87 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyCustomMetricUtilization.php @@ -0,0 +1,257 @@ +google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization + */ +class AutoscalingPolicyCustomMetricUtilization extends \Google\Protobuf\Internal\Message +{ + /** + * A filter string, compatible with a Stackdriver Monitoring filter string for TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data. For the filter to be valid for autoscaling purposes, the following rules apply: - You can only use the AND operator for joining selectors. - You can only use direct equality comparison operator (=) without any functions for each selector. - You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical. - The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels. If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a *per-group metric* for the purpose of autoscaling. If not specified, the type defaults to gce_instance. Try to provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $filter = null; + /** + * The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE. + * + * Generated from protobuf field optional string metric = 533067184; + */ + protected $metric = null; + /** + * If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. Autoscaler keeps the number of instances proportional to the value of this metric. The metric itself does not change value due to group resizing. A good metric to use with the target is for example pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances. A bad example would be a metric exporting an average or median latency, since this value can't include a chunk assignable to a single instance, it could be better used with utilization_target instead. + * + * Generated from protobuf field optional double single_instance_assignment = 504768064; + */ + protected $single_instance_assignment = null; + /** + * The target value of the metric that autoscaler maintains. This must be a positive value. A utilization metric scales number of virtual machines handling requests to increase or decrease proportionally to the metric. For example, a good metric to use as a utilization_target is https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. The autoscaler works to keep this value constant for each of the instances. + * + * Generated from protobuf field optional double utilization_target = 215905870; + */ + protected $utilization_target = null; + /** + * Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. + * Check the UtilizationTargetType enum for the list of possible values. + * + * Generated from protobuf field optional string utilization_target_type = 340169355; + */ + protected $utilization_target_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $filter + * A filter string, compatible with a Stackdriver Monitoring filter string for TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data. For the filter to be valid for autoscaling purposes, the following rules apply: - You can only use the AND operator for joining selectors. - You can only use direct equality comparison operator (=) without any functions for each selector. - You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical. - The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels. If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a *per-group metric* for the purpose of autoscaling. If not specified, the type defaults to gce_instance. Try to provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value. + * @type string $metric + * The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE. + * @type float $single_instance_assignment + * If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. Autoscaler keeps the number of instances proportional to the value of this metric. The metric itself does not change value due to group resizing. A good metric to use with the target is for example pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances. A bad example would be a metric exporting an average or median latency, since this value can't include a chunk assignable to a single instance, it could be better used with utilization_target instead. + * @type float $utilization_target + * The target value of the metric that autoscaler maintains. This must be a positive value. A utilization metric scales number of virtual machines handling requests to increase or decrease proportionally to the metric. For example, a good metric to use as a utilization_target is https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. The autoscaler works to keep this value constant for each of the instances. + * @type string $utilization_target_type + * Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. + * Check the UtilizationTargetType enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A filter string, compatible with a Stackdriver Monitoring filter string for TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data. For the filter to be valid for autoscaling purposes, the following rules apply: - You can only use the AND operator for joining selectors. - You can only use direct equality comparison operator (=) without any functions for each selector. - You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical. - The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels. If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a *per-group metric* for the purpose of autoscaling. If not specified, the type defaults to gce_instance. Try to provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value. + * + * 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 string, compatible with a Stackdriver Monitoring filter string for TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data. For the filter to be valid for autoscaling purposes, the following rules apply: - You can only use the AND operator for joining selectors. - You can only use direct equality comparison operator (=) without any functions for each selector. - You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical. - The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels. If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a *per-group metric* for the purpose of autoscaling. If not specified, the type defaults to gce_instance. Try to provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value. + * + * 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 identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE. + * + * Generated from protobuf field optional string metric = 533067184; + * @return string + */ + public function getMetric() + { + return isset($this->metric) ? $this->metric : ''; + } + + public function hasMetric() + { + return isset($this->metric); + } + + public function clearMetric() + { + unset($this->metric); + } + + /** + * The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. The metric must have a value type of INT64 or DOUBLE. + * + * Generated from protobuf field optional string metric = 533067184; + * @param string $var + * @return $this + */ + public function setMetric($var) + { + GPBUtil::checkString($var, True); + $this->metric = $var; + + return $this; + } + + /** + * If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. Autoscaler keeps the number of instances proportional to the value of this metric. The metric itself does not change value due to group resizing. A good metric to use with the target is for example pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances. A bad example would be a metric exporting an average or median latency, since this value can't include a chunk assignable to a single instance, it could be better used with utilization_target instead. + * + * Generated from protobuf field optional double single_instance_assignment = 504768064; + * @return float + */ + public function getSingleInstanceAssignment() + { + return isset($this->single_instance_assignment) ? $this->single_instance_assignment : 0.0; + } + + public function hasSingleInstanceAssignment() + { + return isset($this->single_instance_assignment); + } + + public function clearSingleInstanceAssignment() + { + unset($this->single_instance_assignment); + } + + /** + * If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. Autoscaler keeps the number of instances proportional to the value of this metric. The metric itself does not change value due to group resizing. A good metric to use with the target is for example pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances. A bad example would be a metric exporting an average or median latency, since this value can't include a chunk assignable to a single instance, it could be better used with utilization_target instead. + * + * Generated from protobuf field optional double single_instance_assignment = 504768064; + * @param float $var + * @return $this + */ + public function setSingleInstanceAssignment($var) + { + GPBUtil::checkDouble($var); + $this->single_instance_assignment = $var; + + return $this; + } + + /** + * The target value of the metric that autoscaler maintains. This must be a positive value. A utilization metric scales number of virtual machines handling requests to increase or decrease proportionally to the metric. For example, a good metric to use as a utilization_target is https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. The autoscaler works to keep this value constant for each of the instances. + * + * Generated from protobuf field optional double utilization_target = 215905870; + * @return float + */ + public function getUtilizationTarget() + { + return isset($this->utilization_target) ? $this->utilization_target : 0.0; + } + + public function hasUtilizationTarget() + { + return isset($this->utilization_target); + } + + public function clearUtilizationTarget() + { + unset($this->utilization_target); + } + + /** + * The target value of the metric that autoscaler maintains. This must be a positive value. A utilization metric scales number of virtual machines handling requests to increase or decrease proportionally to the metric. For example, a good metric to use as a utilization_target is https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. The autoscaler works to keep this value constant for each of the instances. + * + * Generated from protobuf field optional double utilization_target = 215905870; + * @param float $var + * @return $this + */ + public function setUtilizationTarget($var) + { + GPBUtil::checkDouble($var); + $this->utilization_target = $var; + + return $this; + } + + /** + * Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. + * Check the UtilizationTargetType enum for the list of possible values. + * + * Generated from protobuf field optional string utilization_target_type = 340169355; + * @return string + */ + public function getUtilizationTargetType() + { + return isset($this->utilization_target_type) ? $this->utilization_target_type : ''; + } + + public function hasUtilizationTargetType() + { + return isset($this->utilization_target_type); + } + + public function clearUtilizationTargetType() + { + unset($this->utilization_target_type); + } + + /** + * Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. + * Check the UtilizationTargetType enum for the list of possible values. + * + * Generated from protobuf field optional string utilization_target_type = 340169355; + * @param string $var + * @return $this + */ + public function setUtilizationTargetType($var) + { + GPBUtil::checkString($var, True); + $this->utilization_target_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyCustomMetricUtilization/UtilizationTargetType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyCustomMetricUtilization/UtilizationTargetType.php new file mode 100644 index 000000000000..e6cf9cd41f2d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyCustomMetricUtilization/UtilizationTargetType.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.UtilizationTargetType + */ +class UtilizationTargetType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_UTILIZATION_TARGET_TYPE = 0; + */ + const UNDEFINED_UTILIZATION_TARGET_TYPE = 0; + /** + * Sets the utilization target value for a cumulative or delta metric, expressed as the rate of growth per minute. + * + * Generated from protobuf enum DELTA_PER_MINUTE = 87432861; + */ + const DELTA_PER_MINUTE = 87432861; + /** + * Sets the utilization target value for a cumulative or delta metric, expressed as the rate of growth per second. + * + * Generated from protobuf enum DELTA_PER_SECOND = 255180029; + */ + const DELTA_PER_SECOND = 255180029; + /** + * Sets the utilization target value for a gauge metric. The autoscaler will collect the average utilization of the virtual machines from the last couple of minutes, and compare the value to the utilization target value to perform autoscaling. + * + * Generated from protobuf enum GAUGE = 67590361; + */ + const GAUGE = 67590361; + + private static $valueToName = [ + self::UNDEFINED_UTILIZATION_TARGET_TYPE => 'UNDEFINED_UTILIZATION_TARGET_TYPE', + self::DELTA_PER_MINUTE => 'DELTA_PER_MINUTE', + self::DELTA_PER_SECOND => 'DELTA_PER_SECOND', + self::GAUGE => 'GAUGE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(UtilizationTargetType::class, \Google\Cloud\Compute\V1\AutoscalingPolicyCustomMetricUtilization_UtilizationTargetType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyLoadBalancingUtilization.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyLoadBalancingUtilization.php new file mode 100644 index 000000000000..392eaf66b682 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyLoadBalancingUtilization.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization + */ +class AutoscalingPolicyLoadBalancingUtilization extends \Google\Protobuf\Internal\Message +{ + /** + * Fraction of backend capacity utilization (set in HTTP(S) load balancing configuration) that the autoscaler maintains. Must be a positive float value. If not defined, the default is 0.8. + * + * Generated from protobuf field optional double utilization_target = 215905870; + */ + protected $utilization_target = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $utilization_target + * Fraction of backend capacity utilization (set in HTTP(S) load balancing configuration) that the autoscaler maintains. Must be a positive float value. If not defined, the default is 0.8. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Fraction of backend capacity utilization (set in HTTP(S) load balancing configuration) that the autoscaler maintains. Must be a positive float value. If not defined, the default is 0.8. + * + * Generated from protobuf field optional double utilization_target = 215905870; + * @return float + */ + public function getUtilizationTarget() + { + return isset($this->utilization_target) ? $this->utilization_target : 0.0; + } + + public function hasUtilizationTarget() + { + return isset($this->utilization_target); + } + + public function clearUtilizationTarget() + { + unset($this->utilization_target); + } + + /** + * Fraction of backend capacity utilization (set in HTTP(S) load balancing configuration) that the autoscaler maintains. Must be a positive float value. If not defined, the default is 0.8. + * + * Generated from protobuf field optional double utilization_target = 215905870; + * @param float $var + * @return $this + */ + public function setUtilizationTarget($var) + { + GPBUtil::checkDouble($var); + $this->utilization_target = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyScaleInControl.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyScaleInControl.php new file mode 100644 index 000000000000..7eaad9298951 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyScaleInControl.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.AutoscalingPolicyScaleInControl + */ +class AutoscalingPolicyScaleInControl extends \Google\Protobuf\Internal\Message +{ + /** + * Maximum allowed number (or %) of VMs that can be deducted from the peak recommendation during the window autoscaler looks at when computing recommendations. Possibly all these VMs can be deleted at once so user service needs to be prepared to lose that many VMs in one step. + * + * Generated from protobuf field optional .google.cloud.compute.v1.FixedOrPercent max_scaled_in_replicas = 180710123; + */ + protected $max_scaled_in_replicas = null; + /** + * How far back autoscaling looks when computing recommendations to include directives regarding slower scale in, as described above. + * + * Generated from protobuf field optional int32 time_window_sec = 36405300; + */ + protected $time_window_sec = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\FixedOrPercent $max_scaled_in_replicas + * Maximum allowed number (or %) of VMs that can be deducted from the peak recommendation during the window autoscaler looks at when computing recommendations. Possibly all these VMs can be deleted at once so user service needs to be prepared to lose that many VMs in one step. + * @type int $time_window_sec + * How far back autoscaling looks when computing recommendations to include directives regarding slower scale in, as described above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Maximum allowed number (or %) of VMs that can be deducted from the peak recommendation during the window autoscaler looks at when computing recommendations. Possibly all these VMs can be deleted at once so user service needs to be prepared to lose that many VMs in one step. + * + * Generated from protobuf field optional .google.cloud.compute.v1.FixedOrPercent max_scaled_in_replicas = 180710123; + * @return \Google\Cloud\Compute\V1\FixedOrPercent|null + */ + public function getMaxScaledInReplicas() + { + return $this->max_scaled_in_replicas; + } + + public function hasMaxScaledInReplicas() + { + return isset($this->max_scaled_in_replicas); + } + + public function clearMaxScaledInReplicas() + { + unset($this->max_scaled_in_replicas); + } + + /** + * Maximum allowed number (or %) of VMs that can be deducted from the peak recommendation during the window autoscaler looks at when computing recommendations. Possibly all these VMs can be deleted at once so user service needs to be prepared to lose that many VMs in one step. + * + * Generated from protobuf field optional .google.cloud.compute.v1.FixedOrPercent max_scaled_in_replicas = 180710123; + * @param \Google\Cloud\Compute\V1\FixedOrPercent $var + * @return $this + */ + public function setMaxScaledInReplicas($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\FixedOrPercent::class); + $this->max_scaled_in_replicas = $var; + + return $this; + } + + /** + * How far back autoscaling looks when computing recommendations to include directives regarding slower scale in, as described above. + * + * Generated from protobuf field optional int32 time_window_sec = 36405300; + * @return int + */ + public function getTimeWindowSec() + { + return isset($this->time_window_sec) ? $this->time_window_sec : 0; + } + + public function hasTimeWindowSec() + { + return isset($this->time_window_sec); + } + + public function clearTimeWindowSec() + { + unset($this->time_window_sec); + } + + /** + * How far back autoscaling looks when computing recommendations to include directives regarding slower scale in, as described above. + * + * Generated from protobuf field optional int32 time_window_sec = 36405300; + * @param int $var + * @return $this + */ + public function setTimeWindowSec($var) + { + GPBUtil::checkInt32($var); + $this->time_window_sec = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyScalingSchedule.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyScalingSchedule.php new file mode 100644 index 000000000000..048b63f5ab8c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AutoscalingPolicyScalingSchedule.php @@ -0,0 +1,297 @@ +google.cloud.compute.v1.AutoscalingPolicyScalingSchedule + */ +class AutoscalingPolicyScalingSchedule extends \Google\Protobuf\Internal\Message +{ + /** + * A description of a scaling schedule. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * A boolean value that specifies whether a scaling schedule can influence autoscaler recommendations. If set to true, then a scaling schedule has no effect. This field is optional, and its value is false by default. + * + * Generated from protobuf field optional bool disabled = 270940796; + */ + protected $disabled = null; + /** + * The duration of time intervals, in seconds, for which this scaling schedule is to run. The minimum allowed value is 300. This field is required. + * + * Generated from protobuf field optional int32 duration_sec = 212356902; + */ + protected $duration_sec = null; + /** + * The minimum number of VM instances that the autoscaler will recommend in time intervals starting according to schedule. This field is required. + * + * Generated from protobuf field optional int32 min_required_replicas = 365514414; + */ + protected $min_required_replicas = null; + /** + * 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. + * + * Generated from protobuf field optional string schedule = 375820951; + */ + protected $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: https://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; + */ + protected $time_zone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $description + * A description of a scaling schedule. + * @type bool $disabled + * A boolean value that specifies whether a scaling schedule can influence autoscaler recommendations. If set to true, then a scaling schedule has no effect. This field is optional, and its value is false by default. + * @type int $duration_sec + * The duration of time intervals, in seconds, for which this scaling schedule is to run. The minimum allowed value is 300. This field is required. + * @type int $min_required_replicas + * The minimum number of VM instances that the autoscaler will recommend in time intervals starting according to schedule. This field is required. + * @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: https://en.wikipedia.org/wiki/Tz_database. This field is assigned a default value of "UTC" if left empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A description of a scaling schedule. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * A description of a scaling schedule. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * A boolean value that specifies whether a scaling schedule can influence autoscaler recommendations. If set to true, then a scaling schedule has no effect. This field is optional, and its value is false by default. + * + * Generated from protobuf field optional bool disabled = 270940796; + * @return bool + */ + public function getDisabled() + { + return isset($this->disabled) ? $this->disabled : false; + } + + public function hasDisabled() + { + return isset($this->disabled); + } + + public function clearDisabled() + { + unset($this->disabled); + } + + /** + * A boolean value that specifies whether a scaling schedule can influence autoscaler recommendations. If set to true, then a scaling schedule has no effect. This field is optional, and its value is false by default. + * + * Generated from protobuf field optional bool disabled = 270940796; + * @param bool $var + * @return $this + */ + public function setDisabled($var) + { + GPBUtil::checkBool($var); + $this->disabled = $var; + + return $this; + } + + /** + * The duration of time intervals, in seconds, for which this scaling schedule is to run. The minimum allowed value is 300. This field is required. + * + * Generated from protobuf field optional int32 duration_sec = 212356902; + * @return int + */ + public function getDurationSec() + { + return isset($this->duration_sec) ? $this->duration_sec : 0; + } + + public function hasDurationSec() + { + return isset($this->duration_sec); + } + + public function clearDurationSec() + { + unset($this->duration_sec); + } + + /** + * The duration of time intervals, in seconds, for which this scaling schedule is to run. The minimum allowed value is 300. This field is required. + * + * Generated from protobuf field optional int32 duration_sec = 212356902; + * @param int $var + * @return $this + */ + public function setDurationSec($var) + { + GPBUtil::checkInt32($var); + $this->duration_sec = $var; + + return $this; + } + + /** + * The minimum number of VM instances that the autoscaler will recommend in time intervals starting according to schedule. This field is required. + * + * Generated from protobuf field optional int32 min_required_replicas = 365514414; + * @return int + */ + public function getMinRequiredReplicas() + { + return isset($this->min_required_replicas) ? $this->min_required_replicas : 0; + } + + public function hasMinRequiredReplicas() + { + return isset($this->min_required_replicas); + } + + public function clearMinRequiredReplicas() + { + unset($this->min_required_replicas); + } + + /** + * The minimum number of VM instances that the autoscaler will recommend in time intervals starting according to schedule. This field is required. + * + * Generated from protobuf field optional int32 min_required_replicas = 365514414; + * @param int $var + * @return $this + */ + public function setMinRequiredReplicas($var) + { + GPBUtil::checkInt32($var); + $this->min_required_replicas = $var; + + return $this; + } + + /** + * 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. + * + * Generated from protobuf field optional string schedule = 375820951; + * @return string + */ + public function getSchedule() + { + return isset($this->schedule) ? $this->schedule : ''; + } + + public function hasSchedule() + { + return isset($this->schedule); + } + + public function clearSchedule() + { + unset($this->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. + * + * Generated from protobuf field optional string schedule = 375820951; + * @param string $var + * @return $this + */ + public function setSchedule($var) + { + GPBUtil::checkString($var, True); + $this->schedule = $var; + + return $this; + } + + /** + * The time zone to use when interpreting the schedule. The value of this field must be a time zone name from the tz database: https://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 + */ + public function getTimeZone() + { + return isset($this->time_zone) ? $this->time_zone : ''; + } + + public function hasTimeZone() + { + return isset($this->time_zone); + } + + public function clearTimeZone() + { + unset($this->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: https://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 + * @return $this + */ + public function setTimeZone($var) + { + GPBUtil::checkString($var, True); + $this->time_zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Backend.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Backend.php new file mode 100644 index 000000000000..18a3c5f26fcf --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Backend.php @@ -0,0 +1,613 @@ +google.cloud.compute.v1.Backend + */ +class Backend extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies how to determine whether the backend of a load balancer can handle additional traffic or is fully loaded. For usage guidelines, see Connection balancing mode. Backends must use compatible balancing modes. For more information, see Supported balancing modes and target capacity settings and Restrictions and guidance for instance groups. Note: Currently, if you use the API to configure incompatible balancing modes, the configuration might be accepted even though it has no impact and is ignored. Specifically, Backend.maxUtilization is ignored when Backend.balancingMode is RATE. In the future, this incompatible combination will be rejected. + * Check the BalancingMode enum for the list of possible values. + * + * Generated from protobuf field optional string balancing_mode = 430286217; + */ + protected $balancing_mode = null; + /** + * A multiplier applied to the backend's target capacity of its balancing mode. The default value is 1, which means the group serves up to 100% of its configured capacity (depending on balancingMode). A setting of 0 means the group is completely drained, offering 0% of its available capacity. The valid ranges are 0.0 and [0.1,1.0]. You cannot configure a setting larger than 0 and smaller than 0.1. You cannot configure a setting of 0 when there is only one backend attached to the backend service. Not available with backends that don't support using a balancingMode. This includes backends such as global internet NEGs, regional serverless NEGs, and PSC NEGs. + * + * Generated from protobuf field optional float capacity_scaler = 315958157; + */ + protected $capacity_scaler = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * This field designates whether this is a failover backend. More than one failover backend can be configured for a given BackendService. + * + * Generated from protobuf field optional bool failover = 138892530; + */ + protected $failover = null; + /** + * The fully-qualified URL of an instance group or network endpoint group (NEG) resource. To determine what types of backends a load balancer supports, see the [Backend services overview](https://cloud.google.com/load-balancing/docs/backend-service#backends). You must use the *fully-qualified* URL (starting with https://www.googleapis.com/) to specify the instance group or NEG. Partial URLs are not supported. + * + * Generated from protobuf field optional string group = 98629247; + */ + protected $group = null; + /** + * Defines a target maximum number of simultaneous connections. For usage guidelines, see Connection balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is RATE. + * + * Generated from protobuf field optional int32 max_connections = 110652154; + */ + protected $max_connections = null; + /** + * Defines a target maximum number of simultaneous connections. For usage guidelines, see Connection balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is RATE. + * + * Generated from protobuf field optional int32 max_connections_per_endpoint = 216904604; + */ + protected $max_connections_per_endpoint = null; + /** + * Defines a target maximum number of simultaneous connections. For usage guidelines, see Connection balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is RATE. + * + * Generated from protobuf field optional int32 max_connections_per_instance = 104671900; + */ + protected $max_connections_per_instance = null; + /** + * Defines a maximum number of HTTP requests per second (RPS). For usage guidelines, see Rate balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is CONNECTION. + * + * Generated from protobuf field optional int32 max_rate = 408035035; + */ + protected $max_rate = null; + /** + * Defines a maximum target for requests per second (RPS). For usage guidelines, see Rate balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is CONNECTION. + * + * Generated from protobuf field optional float max_rate_per_endpoint = 129832283; + */ + protected $max_rate_per_endpoint = null; + /** + * Defines a maximum target for requests per second (RPS). For usage guidelines, see Rate balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is CONNECTION. + * + * Generated from protobuf field optional float max_rate_per_instance = 17599579; + */ + protected $max_rate_per_instance = null; + /** + * Optional parameter to define a target capacity for the UTILIZATION balancing mode. The valid range is [0.0, 1.0]. For usage guidelines, see Utilization balancing mode. + * + * Generated from protobuf field optional float max_utilization = 148192199; + */ + protected $max_utilization = null; + /** + * This field indicates whether this backend should be fully utilized before sending traffic to backends with default preference. The possible values are: - PREFERRED: Backends with this preference level will be filled up to their capacity limits first, based on RTT. - DEFAULT: If preferred backends don't have enough capacity, backends in this layer would be used and traffic would be assigned based on the load balancing algorithm you use. This is the default + * Check the Preference enum for the list of possible values. + * + * Generated from protobuf field optional string preference = 150781147; + */ + protected $preference = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $balancing_mode + * Specifies how to determine whether the backend of a load balancer can handle additional traffic or is fully loaded. For usage guidelines, see Connection balancing mode. Backends must use compatible balancing modes. For more information, see Supported balancing modes and target capacity settings and Restrictions and guidance for instance groups. Note: Currently, if you use the API to configure incompatible balancing modes, the configuration might be accepted even though it has no impact and is ignored. Specifically, Backend.maxUtilization is ignored when Backend.balancingMode is RATE. In the future, this incompatible combination will be rejected. + * Check the BalancingMode enum for the list of possible values. + * @type float $capacity_scaler + * A multiplier applied to the backend's target capacity of its balancing mode. The default value is 1, which means the group serves up to 100% of its configured capacity (depending on balancingMode). A setting of 0 means the group is completely drained, offering 0% of its available capacity. The valid ranges are 0.0 and [0.1,1.0]. You cannot configure a setting larger than 0 and smaller than 0.1. You cannot configure a setting of 0 when there is only one backend attached to the backend service. Not available with backends that don't support using a balancingMode. This includes backends such as global internet NEGs, regional serverless NEGs, and PSC NEGs. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type bool $failover + * This field designates whether this is a failover backend. More than one failover backend can be configured for a given BackendService. + * @type string $group + * The fully-qualified URL of an instance group or network endpoint group (NEG) resource. To determine what types of backends a load balancer supports, see the [Backend services overview](https://cloud.google.com/load-balancing/docs/backend-service#backends). You must use the *fully-qualified* URL (starting with https://www.googleapis.com/) to specify the instance group or NEG. Partial URLs are not supported. + * @type int $max_connections + * Defines a target maximum number of simultaneous connections. For usage guidelines, see Connection balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is RATE. + * @type int $max_connections_per_endpoint + * Defines a target maximum number of simultaneous connections. For usage guidelines, see Connection balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is RATE. + * @type int $max_connections_per_instance + * Defines a target maximum number of simultaneous connections. For usage guidelines, see Connection balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is RATE. + * @type int $max_rate + * Defines a maximum number of HTTP requests per second (RPS). For usage guidelines, see Rate balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is CONNECTION. + * @type float $max_rate_per_endpoint + * Defines a maximum target for requests per second (RPS). For usage guidelines, see Rate balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is CONNECTION. + * @type float $max_rate_per_instance + * Defines a maximum target for requests per second (RPS). For usage guidelines, see Rate balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is CONNECTION. + * @type float $max_utilization + * Optional parameter to define a target capacity for the UTILIZATION balancing mode. The valid range is [0.0, 1.0]. For usage guidelines, see Utilization balancing mode. + * @type string $preference + * This field indicates whether this backend should be fully utilized before sending traffic to backends with default preference. The possible values are: - PREFERRED: Backends with this preference level will be filled up to their capacity limits first, based on RTT. - DEFAULT: If preferred backends don't have enough capacity, backends in this layer would be used and traffic would be assigned based on the load balancing algorithm you use. This is the default + * Check the Preference enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies how to determine whether the backend of a load balancer can handle additional traffic or is fully loaded. For usage guidelines, see Connection balancing mode. Backends must use compatible balancing modes. For more information, see Supported balancing modes and target capacity settings and Restrictions and guidance for instance groups. Note: Currently, if you use the API to configure incompatible balancing modes, the configuration might be accepted even though it has no impact and is ignored. Specifically, Backend.maxUtilization is ignored when Backend.balancingMode is RATE. In the future, this incompatible combination will be rejected. + * Check the BalancingMode enum for the list of possible values. + * + * Generated from protobuf field optional string balancing_mode = 430286217; + * @return string + */ + public function getBalancingMode() + { + return isset($this->balancing_mode) ? $this->balancing_mode : ''; + } + + public function hasBalancingMode() + { + return isset($this->balancing_mode); + } + + public function clearBalancingMode() + { + unset($this->balancing_mode); + } + + /** + * Specifies how to determine whether the backend of a load balancer can handle additional traffic or is fully loaded. For usage guidelines, see Connection balancing mode. Backends must use compatible balancing modes. For more information, see Supported balancing modes and target capacity settings and Restrictions and guidance for instance groups. Note: Currently, if you use the API to configure incompatible balancing modes, the configuration might be accepted even though it has no impact and is ignored. Specifically, Backend.maxUtilization is ignored when Backend.balancingMode is RATE. In the future, this incompatible combination will be rejected. + * Check the BalancingMode enum for the list of possible values. + * + * Generated from protobuf field optional string balancing_mode = 430286217; + * @param string $var + * @return $this + */ + public function setBalancingMode($var) + { + GPBUtil::checkString($var, True); + $this->balancing_mode = $var; + + return $this; + } + + /** + * A multiplier applied to the backend's target capacity of its balancing mode. The default value is 1, which means the group serves up to 100% of its configured capacity (depending on balancingMode). A setting of 0 means the group is completely drained, offering 0% of its available capacity. The valid ranges are 0.0 and [0.1,1.0]. You cannot configure a setting larger than 0 and smaller than 0.1. You cannot configure a setting of 0 when there is only one backend attached to the backend service. Not available with backends that don't support using a balancingMode. This includes backends such as global internet NEGs, regional serverless NEGs, and PSC NEGs. + * + * Generated from protobuf field optional float capacity_scaler = 315958157; + * @return float + */ + public function getCapacityScaler() + { + return isset($this->capacity_scaler) ? $this->capacity_scaler : 0.0; + } + + public function hasCapacityScaler() + { + return isset($this->capacity_scaler); + } + + public function clearCapacityScaler() + { + unset($this->capacity_scaler); + } + + /** + * A multiplier applied to the backend's target capacity of its balancing mode. The default value is 1, which means the group serves up to 100% of its configured capacity (depending on balancingMode). A setting of 0 means the group is completely drained, offering 0% of its available capacity. The valid ranges are 0.0 and [0.1,1.0]. You cannot configure a setting larger than 0 and smaller than 0.1. You cannot configure a setting of 0 when there is only one backend attached to the backend service. Not available with backends that don't support using a balancingMode. This includes backends such as global internet NEGs, regional serverless NEGs, and PSC NEGs. + * + * Generated from protobuf field optional float capacity_scaler = 315958157; + * @param float $var + * @return $this + */ + public function setCapacityScaler($var) + { + GPBUtil::checkFloat($var); + $this->capacity_scaler = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * This field designates whether this is a failover backend. More than one failover backend can be configured for a given BackendService. + * + * Generated from protobuf field optional bool failover = 138892530; + * @return bool + */ + public function getFailover() + { + return isset($this->failover) ? $this->failover : false; + } + + public function hasFailover() + { + return isset($this->failover); + } + + public function clearFailover() + { + unset($this->failover); + } + + /** + * This field designates whether this is a failover backend. More than one failover backend can be configured for a given BackendService. + * + * Generated from protobuf field optional bool failover = 138892530; + * @param bool $var + * @return $this + */ + public function setFailover($var) + { + GPBUtil::checkBool($var); + $this->failover = $var; + + return $this; + } + + /** + * The fully-qualified URL of an instance group or network endpoint group (NEG) resource. To determine what types of backends a load balancer supports, see the [Backend services overview](https://cloud.google.com/load-balancing/docs/backend-service#backends). You must use the *fully-qualified* URL (starting with https://www.googleapis.com/) to specify the instance group or NEG. Partial URLs are not supported. + * + * Generated from protobuf field optional string group = 98629247; + * @return string + */ + public function getGroup() + { + return isset($this->group) ? $this->group : ''; + } + + public function hasGroup() + { + return isset($this->group); + } + + public function clearGroup() + { + unset($this->group); + } + + /** + * The fully-qualified URL of an instance group or network endpoint group (NEG) resource. To determine what types of backends a load balancer supports, see the [Backend services overview](https://cloud.google.com/load-balancing/docs/backend-service#backends). You must use the *fully-qualified* URL (starting with https://www.googleapis.com/) to specify the instance group or NEG. Partial URLs are not supported. + * + * Generated from protobuf field optional string group = 98629247; + * @param string $var + * @return $this + */ + public function setGroup($var) + { + GPBUtil::checkString($var, True); + $this->group = $var; + + return $this; + } + + /** + * Defines a target maximum number of simultaneous connections. For usage guidelines, see Connection balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is RATE. + * + * Generated from protobuf field optional int32 max_connections = 110652154; + * @return int + */ + public function getMaxConnections() + { + return isset($this->max_connections) ? $this->max_connections : 0; + } + + public function hasMaxConnections() + { + return isset($this->max_connections); + } + + public function clearMaxConnections() + { + unset($this->max_connections); + } + + /** + * Defines a target maximum number of simultaneous connections. For usage guidelines, see Connection balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is RATE. + * + * Generated from protobuf field optional int32 max_connections = 110652154; + * @param int $var + * @return $this + */ + public function setMaxConnections($var) + { + GPBUtil::checkInt32($var); + $this->max_connections = $var; + + return $this; + } + + /** + * Defines a target maximum number of simultaneous connections. For usage guidelines, see Connection balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is RATE. + * + * Generated from protobuf field optional int32 max_connections_per_endpoint = 216904604; + * @return int + */ + public function getMaxConnectionsPerEndpoint() + { + return isset($this->max_connections_per_endpoint) ? $this->max_connections_per_endpoint : 0; + } + + public function hasMaxConnectionsPerEndpoint() + { + return isset($this->max_connections_per_endpoint); + } + + public function clearMaxConnectionsPerEndpoint() + { + unset($this->max_connections_per_endpoint); + } + + /** + * Defines a target maximum number of simultaneous connections. For usage guidelines, see Connection balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is RATE. + * + * Generated from protobuf field optional int32 max_connections_per_endpoint = 216904604; + * @param int $var + * @return $this + */ + public function setMaxConnectionsPerEndpoint($var) + { + GPBUtil::checkInt32($var); + $this->max_connections_per_endpoint = $var; + + return $this; + } + + /** + * Defines a target maximum number of simultaneous connections. For usage guidelines, see Connection balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is RATE. + * + * Generated from protobuf field optional int32 max_connections_per_instance = 104671900; + * @return int + */ + public function getMaxConnectionsPerInstance() + { + return isset($this->max_connections_per_instance) ? $this->max_connections_per_instance : 0; + } + + public function hasMaxConnectionsPerInstance() + { + return isset($this->max_connections_per_instance); + } + + public function clearMaxConnectionsPerInstance() + { + unset($this->max_connections_per_instance); + } + + /** + * Defines a target maximum number of simultaneous connections. For usage guidelines, see Connection balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is RATE. + * + * Generated from protobuf field optional int32 max_connections_per_instance = 104671900; + * @param int $var + * @return $this + */ + public function setMaxConnectionsPerInstance($var) + { + GPBUtil::checkInt32($var); + $this->max_connections_per_instance = $var; + + return $this; + } + + /** + * Defines a maximum number of HTTP requests per second (RPS). For usage guidelines, see Rate balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is CONNECTION. + * + * Generated from protobuf field optional int32 max_rate = 408035035; + * @return int + */ + public function getMaxRate() + { + return isset($this->max_rate) ? $this->max_rate : 0; + } + + public function hasMaxRate() + { + return isset($this->max_rate); + } + + public function clearMaxRate() + { + unset($this->max_rate); + } + + /** + * Defines a maximum number of HTTP requests per second (RPS). For usage guidelines, see Rate balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is CONNECTION. + * + * Generated from protobuf field optional int32 max_rate = 408035035; + * @param int $var + * @return $this + */ + public function setMaxRate($var) + { + GPBUtil::checkInt32($var); + $this->max_rate = $var; + + return $this; + } + + /** + * Defines a maximum target for requests per second (RPS). For usage guidelines, see Rate balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is CONNECTION. + * + * Generated from protobuf field optional float max_rate_per_endpoint = 129832283; + * @return float + */ + public function getMaxRatePerEndpoint() + { + return isset($this->max_rate_per_endpoint) ? $this->max_rate_per_endpoint : 0.0; + } + + public function hasMaxRatePerEndpoint() + { + return isset($this->max_rate_per_endpoint); + } + + public function clearMaxRatePerEndpoint() + { + unset($this->max_rate_per_endpoint); + } + + /** + * Defines a maximum target for requests per second (RPS). For usage guidelines, see Rate balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is CONNECTION. + * + * Generated from protobuf field optional float max_rate_per_endpoint = 129832283; + * @param float $var + * @return $this + */ + public function setMaxRatePerEndpoint($var) + { + GPBUtil::checkFloat($var); + $this->max_rate_per_endpoint = $var; + + return $this; + } + + /** + * Defines a maximum target for requests per second (RPS). For usage guidelines, see Rate balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is CONNECTION. + * + * Generated from protobuf field optional float max_rate_per_instance = 17599579; + * @return float + */ + public function getMaxRatePerInstance() + { + return isset($this->max_rate_per_instance) ? $this->max_rate_per_instance : 0.0; + } + + public function hasMaxRatePerInstance() + { + return isset($this->max_rate_per_instance); + } + + public function clearMaxRatePerInstance() + { + unset($this->max_rate_per_instance); + } + + /** + * Defines a maximum target for requests per second (RPS). For usage guidelines, see Rate balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is CONNECTION. + * + * Generated from protobuf field optional float max_rate_per_instance = 17599579; + * @param float $var + * @return $this + */ + public function setMaxRatePerInstance($var) + { + GPBUtil::checkFloat($var); + $this->max_rate_per_instance = $var; + + return $this; + } + + /** + * Optional parameter to define a target capacity for the UTILIZATION balancing mode. The valid range is [0.0, 1.0]. For usage guidelines, see Utilization balancing mode. + * + * Generated from protobuf field optional float max_utilization = 148192199; + * @return float + */ + public function getMaxUtilization() + { + return isset($this->max_utilization) ? $this->max_utilization : 0.0; + } + + public function hasMaxUtilization() + { + return isset($this->max_utilization); + } + + public function clearMaxUtilization() + { + unset($this->max_utilization); + } + + /** + * Optional parameter to define a target capacity for the UTILIZATION balancing mode. The valid range is [0.0, 1.0]. For usage guidelines, see Utilization balancing mode. + * + * Generated from protobuf field optional float max_utilization = 148192199; + * @param float $var + * @return $this + */ + public function setMaxUtilization($var) + { + GPBUtil::checkFloat($var); + $this->max_utilization = $var; + + return $this; + } + + /** + * This field indicates whether this backend should be fully utilized before sending traffic to backends with default preference. The possible values are: - PREFERRED: Backends with this preference level will be filled up to their capacity limits first, based on RTT. - DEFAULT: If preferred backends don't have enough capacity, backends in this layer would be used and traffic would be assigned based on the load balancing algorithm you use. This is the default + * Check the Preference enum for the list of possible values. + * + * Generated from protobuf field optional string preference = 150781147; + * @return string + */ + public function getPreference() + { + return isset($this->preference) ? $this->preference : ''; + } + + public function hasPreference() + { + return isset($this->preference); + } + + public function clearPreference() + { + unset($this->preference); + } + + /** + * This field indicates whether this backend should be fully utilized before sending traffic to backends with default preference. The possible values are: - PREFERRED: Backends with this preference level will be filled up to their capacity limits first, based on RTT. - DEFAULT: If preferred backends don't have enough capacity, backends in this layer would be used and traffic would be assigned based on the load balancing algorithm you use. This is the default + * Check the Preference enum for the list of possible values. + * + * Generated from protobuf field optional string preference = 150781147; + * @param string $var + * @return $this + */ + public function setPreference($var) + { + GPBUtil::checkString($var, True); + $this->preference = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Backend/BalancingMode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Backend/BalancingMode.php new file mode 100644 index 000000000000..28ec5c5186ca --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Backend/BalancingMode.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.Backend.BalancingMode + */ +class BalancingMode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_BALANCING_MODE = 0; + */ + const UNDEFINED_BALANCING_MODE = 0; + /** + * Balance based on the number of simultaneous connections. + * + * Generated from protobuf enum CONNECTION = 246311646; + */ + const CONNECTION = 246311646; + /** + * Balance based on requests per second (RPS). + * + * Generated from protobuf enum RATE = 2508000; + */ + const RATE = 2508000; + /** + * Balance based on the backend utilization. + * + * Generated from protobuf enum UTILIZATION = 157008386; + */ + const UTILIZATION = 157008386; + + private static $valueToName = [ + self::UNDEFINED_BALANCING_MODE => 'UNDEFINED_BALANCING_MODE', + self::CONNECTION => 'CONNECTION', + self::RATE => 'RATE', + self::UTILIZATION => 'UTILIZATION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BalancingMode::class, \Google\Cloud\Compute\V1\Backend_BalancingMode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Backend/Preference.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Backend/Preference.php new file mode 100644 index 000000000000..520c096f114e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Backend/Preference.php @@ -0,0 +1,75 @@ +google.cloud.compute.v1.Backend.Preference + */ +class Preference +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PREFERENCE = 0; + */ + const UNDEFINED_PREFERENCE = 0; + /** + * No preference. + * + * Generated from protobuf enum DEFAULT = 115302945; + */ + const PBDEFAULT = 115302945; + /** + * If preference is unspecified, we set it to the DEFAULT value + * + * Generated from protobuf enum PREFERENCE_UNSPECIFIED = 496219571; + */ + const PREFERENCE_UNSPECIFIED = 496219571; + /** + * Traffic will be sent to this backend first. + * + * Generated from protobuf enum PREFERRED = 418847841; + */ + const PREFERRED = 418847841; + + private static $valueToName = [ + self::UNDEFINED_PREFERENCE => 'UNDEFINED_PREFERENCE', + self::PBDEFAULT => 'DEFAULT', + self::PREFERENCE_UNSPECIFIED => 'PREFERENCE_UNSPECIFIED', + self::PREFERRED => 'PREFERRED', + ]; + + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Preference::class, \Google\Cloud\Compute\V1\Backend_Preference::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucket.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucket.php new file mode 100644 index 000000000000..21a4454b1886 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucket.php @@ -0,0 +1,555 @@ +google.cloud.compute.v1.BackendBucket + */ +class BackendBucket extends \Google\Protobuf\Internal\Message +{ + /** + * Cloud Storage bucket name. + * + * Generated from protobuf field optional string bucket_name = 283610048; + */ + protected $bucket_name = null; + /** + * Cloud CDN configuration for this BackendBucket. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendBucketCdnPolicy cdn_policy = 213976452; + */ + protected $cdn_policy = null; + /** + * Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + * Check the CompressionMode enum for the list of possible values. + * + * Generated from protobuf field optional string compression_mode = 95520988; + */ + protected $compression_mode = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * Headers that the Application Load Balancer should add to proxied responses. + * + * Generated from protobuf field repeated string custom_response_headers = 387539094; + */ + private $custom_response_headers; + /** + * An optional textual description of the resource; provided by the client when the resource is created. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The resource URL for the edge security policy associated with this backend bucket. + * + * Generated from protobuf field optional string edge_security_policy = 41036943; + */ + protected $edge_security_policy = null; + /** + * If true, enable Cloud CDN for this BackendBucket. + * + * Generated from protobuf field optional bool enable_cdn = 282942321; + */ + protected $enable_cdn = null; + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * Type of the resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $bucket_name + * Cloud Storage bucket name. + * @type \Google\Cloud\Compute\V1\BackendBucketCdnPolicy $cdn_policy + * Cloud CDN configuration for this BackendBucket. + * @type string $compression_mode + * Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + * Check the CompressionMode enum for the list of possible values. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type array|\Google\Protobuf\Internal\RepeatedField $custom_response_headers + * Headers that the Application Load Balancer should add to proxied responses. + * @type string $description + * An optional textual description of the resource; provided by the client when the resource is created. + * @type string $edge_security_policy + * [Output Only] The resource URL for the edge security policy associated with this backend bucket. + * @type bool $enable_cdn + * If true, enable Cloud CDN for this BackendBucket. + * @type int|string $id + * [Output Only] Unique identifier for the resource; defined by the server. + * @type string $kind + * Type of the resource. + * @type string $name + * 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 string $self_link + * [Output Only] Server-defined URL for the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Cloud Storage bucket name. + * + * Generated from protobuf field optional string bucket_name = 283610048; + * @return string + */ + public function getBucketName() + { + return isset($this->bucket_name) ? $this->bucket_name : ''; + } + + public function hasBucketName() + { + return isset($this->bucket_name); + } + + public function clearBucketName() + { + unset($this->bucket_name); + } + + /** + * Cloud Storage bucket name. + * + * Generated from protobuf field optional string bucket_name = 283610048; + * @param string $var + * @return $this + */ + public function setBucketName($var) + { + GPBUtil::checkString($var, True); + $this->bucket_name = $var; + + return $this; + } + + /** + * Cloud CDN configuration for this BackendBucket. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendBucketCdnPolicy cdn_policy = 213976452; + * @return \Google\Cloud\Compute\V1\BackendBucketCdnPolicy|null + */ + public function getCdnPolicy() + { + return $this->cdn_policy; + } + + public function hasCdnPolicy() + { + return isset($this->cdn_policy); + } + + public function clearCdnPolicy() + { + unset($this->cdn_policy); + } + + /** + * Cloud CDN configuration for this BackendBucket. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendBucketCdnPolicy cdn_policy = 213976452; + * @param \Google\Cloud\Compute\V1\BackendBucketCdnPolicy $var + * @return $this + */ + public function setCdnPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BackendBucketCdnPolicy::class); + $this->cdn_policy = $var; + + return $this; + } + + /** + * Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + * Check the CompressionMode enum for the list of possible values. + * + * Generated from protobuf field optional string compression_mode = 95520988; + * @return string + */ + public function getCompressionMode() + { + return isset($this->compression_mode) ? $this->compression_mode : ''; + } + + public function hasCompressionMode() + { + return isset($this->compression_mode); + } + + public function clearCompressionMode() + { + unset($this->compression_mode); + } + + /** + * Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + * Check the CompressionMode enum for the list of possible values. + * + * Generated from protobuf field optional string compression_mode = 95520988; + * @param string $var + * @return $this + */ + public function setCompressionMode($var) + { + GPBUtil::checkString($var, True); + $this->compression_mode = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * Headers that the Application Load Balancer should add to proxied responses. + * + * Generated from protobuf field repeated string custom_response_headers = 387539094; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCustomResponseHeaders() + { + return $this->custom_response_headers; + } + + /** + * Headers that the Application Load Balancer should add to proxied responses. + * + * Generated from protobuf field repeated string custom_response_headers = 387539094; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCustomResponseHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->custom_response_headers = $arr; + + return $this; + } + + /** + * An optional textual description of the resource; provided by the client when the resource is created. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional textual description of the resource; provided by the client when the resource is created. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The resource URL for the edge security policy associated with this backend bucket. + * + * Generated from protobuf field optional string edge_security_policy = 41036943; + * @return string + */ + public function getEdgeSecurityPolicy() + { + return isset($this->edge_security_policy) ? $this->edge_security_policy : ''; + } + + public function hasEdgeSecurityPolicy() + { + return isset($this->edge_security_policy); + } + + public function clearEdgeSecurityPolicy() + { + unset($this->edge_security_policy); + } + + /** + * [Output Only] The resource URL for the edge security policy associated with this backend bucket. + * + * Generated from protobuf field optional string edge_security_policy = 41036943; + * @param string $var + * @return $this + */ + public function setEdgeSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->edge_security_policy = $var; + + return $this; + } + + /** + * If true, enable Cloud CDN for this BackendBucket. + * + * Generated from protobuf field optional bool enable_cdn = 282942321; + * @return bool + */ + public function getEnableCdn() + { + return isset($this->enable_cdn) ? $this->enable_cdn : false; + } + + public function hasEnableCdn() + { + return isset($this->enable_cdn); + } + + public function clearEnableCdn() + { + unset($this->enable_cdn); + } + + /** + * If true, enable Cloud CDN for this BackendBucket. + * + * Generated from protobuf field optional bool enable_cdn = 282942321; + * @param bool $var + * @return $this + */ + public function setEnableCdn($var) + { + GPBUtil::checkBool($var); + $this->enable_cdn = $var; + + return $this; + } + + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + 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 uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * Type of the 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 the 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; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucket/CompressionMode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucket/CompressionMode.php new file mode 100644 index 000000000000..3f2843bc382e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucket/CompressionMode.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.BackendBucket.CompressionMode + */ +class CompressionMode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_COMPRESSION_MODE = 0; + */ + const UNDEFINED_COMPRESSION_MODE = 0; + /** + * Automatically uses the best compression based on the Accept-Encoding header sent by the client. + * + * Generated from protobuf enum AUTOMATIC = 165298699; + */ + const AUTOMATIC = 165298699; + /** + * Disables compression. Existing compressed responses cached by Cloud CDN will not be served to clients. + * + * Generated from protobuf enum DISABLED = 516696700; + */ + const DISABLED = 516696700; + + private static $valueToName = [ + self::UNDEFINED_COMPRESSION_MODE => 'UNDEFINED_COMPRESSION_MODE', + self::AUTOMATIC => 'AUTOMATIC', + self::DISABLED => 'DISABLED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CompressionMode::class, \Google\Cloud\Compute\V1\BackendBucket_CompressionMode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketCdnPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketCdnPolicy.php new file mode 100644 index 000000000000..29ab40326c64 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketCdnPolicy.php @@ -0,0 +1,535 @@ +google.cloud.compute.v1.BackendBucketCdnPolicy + */ +class BackendBucketCdnPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. The cache is bypassed for all cdnPolicy.cacheMode settings. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader bypass_cache_on_request_headers = 486203082; + */ + private $bypass_cache_on_request_headers; + /** + * The CacheKeyPolicy for this CdnPolicy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendBucketCdnPolicyCacheKeyPolicy cache_key_policy = 159263727; + */ + protected $cache_key_policy = null; + /** + * Specifies the cache setting for all responses from this backend. The possible values are: USE_ORIGIN_HEADERS Requires the origin to set valid caching headers to cache content. Responses without these headers will not be cached at Google's edge, and will require a full trip to the origin on every request, potentially impacting performance and increasing load on the origin server. FORCE_CACHE_ALL Cache all content, ignoring any "private", "no-store" or "no-cache" directives in Cache-Control response headers. Warning: this may result in Cloud CDN caching private, per-user (user identifiable) content. CACHE_ALL_STATIC Automatically cache static content, including common image formats, media (video and audio), and web assets (JavaScript and CSS). Requests and responses that are marked as uncacheable, as well as dynamic content (including HTML), will not be cached. + * Check the CacheMode enum for the list of possible values. + * + * Generated from protobuf field optional string cache_mode = 28877888; + */ + protected $cache_mode = null; + /** + * Specifies a separate client (e.g. browser client) maximum TTL. This is used to clamp the max-age (or Expires) value sent to the client. With FORCE_CACHE_ALL, the lesser of client_ttl and default_ttl is used for the response max-age directive, along with a "public" directive. For cacheable content in CACHE_ALL_STATIC mode, client_ttl clamps the max-age from the origin (if specified), or else sets the response max-age directive to the lesser of the client_ttl and default_ttl, and also ensures a "public" cache-control directive is present. If a client TTL is not specified, a default value (1 hour) will be used. The maximum allowed value is 31,622,400s (1 year). + * + * Generated from protobuf field optional int32 client_ttl = 29034360; + */ + protected $client_ttl = null; + /** + * Specifies the default TTL for cached content served by this origin for responses that do not have an existing valid TTL (max-age or s-max-age). Setting a TTL of "0" means "always revalidate". The value of defaultTTL cannot be set to a value greater than that of maxTTL, but can be equal. When the cacheMode is set to FORCE_CACHE_ALL, the defaultTTL will overwrite the TTL set in all responses. The maximum allowed value is 31,622,400s (1 year), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * + * Generated from protobuf field optional int32 default_ttl = 100253422; + */ + protected $default_ttl = null; + /** + * Specifies the maximum allowed TTL for cached content served by this origin. Cache directives that attempt to set a max-age or s-maxage higher than this, or an Expires header more than maxTTL seconds in the future will be capped at the value of maxTTL, as if it were the value of an s-maxage Cache-Control directive. Headers sent to the client will not be modified. Setting a TTL of "0" means "always revalidate". The maximum allowed value is 31,622,400s (1 year), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * + * Generated from protobuf field optional int32 max_ttl = 307578001; + */ + protected $max_ttl = null; + /** + * Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects. This can reduce the load on your origin and improve end-user experience by reducing response latency. When the cache mode is set to CACHE_ALL_STATIC or USE_ORIGIN_HEADERS, negative caching applies to responses with the specified response code that lack any Cache-Control, Expires, or Pragma: no-cache directives. When the cache mode is set to FORCE_CACHE_ALL, negative caching applies to all responses with the specified response code, and override any caching headers. By default, Cloud CDN will apply the following default TTLs to these status codes: HTTP 300 (Multiple Choice), 301, 308 (Permanent Redirects): 10m HTTP 404 (Not Found), 410 (Gone), 451 (Unavailable For Legal Reasons): 120s HTTP 405 (Method Not Found), 421 (Misdirected Request), 501 (Not Implemented): 60s. These defaults can be overridden in negative_caching_policy. + * + * Generated from protobuf field optional bool negative_caching = 336110005; + */ + protected $negative_caching = null; + /** + * Sets a cache TTL for the specified HTTP status code. negative_caching must be enabled to configure negative_caching_policy. Omitting the policy and leaving negative_caching enabled will use Cloud CDN's default cache TTLs. Note that when specifying an explicit negative_caching_policy, you should take care to specify a cache TTL for all response codes that you wish to cache. Cloud CDN will not apply any default negative caching when a policy exists. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy negative_caching_policy = 155359996; + */ + private $negative_caching_policy; + /** + * If true then Cloud CDN will combine multiple concurrent cache fill requests into a small number of requests to the origin. + * + * Generated from protobuf field optional bool request_coalescing = 532808276; + */ + protected $request_coalescing = null; + /** + * Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache. This setting defines the default "max-stale" duration for any cached responses that do not specify a max-stale directive. Stale responses that exceed the TTL configured here will not be served. The default limit (max-stale) is 86400s (1 day), which will allow stale content to be served up to this limit beyond the max-age (or s-max-age) of a cached response. The maximum allowed value is 604800 (1 week). Set this to zero (0) to disable serve-while-stale. + * + * Generated from protobuf field optional int32 serve_while_stale = 236682203; + */ + protected $serve_while_stale = null; + /** + * Maximum number of seconds the response to a signed URL request will be considered fresh. After this time period, the response will be revalidated before being served. Defaults to 1hr (3600s). When serving responses to signed URL requests, Cloud CDN will internally behave as though all responses from this backend had a "Cache-Control: public, max-age=[TTL]" header, regardless of any existing Cache-Control header. The actual headers served in responses will not be altered. + * + * Generated from protobuf field optional int64 signed_url_cache_max_age_sec = 269374534; + */ + protected $signed_url_cache_max_age_sec = null; + /** + * [Output Only] Names of the keys for signing request URLs. + * + * Generated from protobuf field repeated string signed_url_key_names = 371848885; + */ + private $signed_url_key_names; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\BackendBucketCdnPolicyBypassCacheOnRequestHeader>|\Google\Protobuf\Internal\RepeatedField $bypass_cache_on_request_headers + * Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. The cache is bypassed for all cdnPolicy.cacheMode settings. + * @type \Google\Cloud\Compute\V1\BackendBucketCdnPolicyCacheKeyPolicy $cache_key_policy + * The CacheKeyPolicy for this CdnPolicy. + * @type string $cache_mode + * Specifies the cache setting for all responses from this backend. The possible values are: USE_ORIGIN_HEADERS Requires the origin to set valid caching headers to cache content. Responses without these headers will not be cached at Google's edge, and will require a full trip to the origin on every request, potentially impacting performance and increasing load on the origin server. FORCE_CACHE_ALL Cache all content, ignoring any "private", "no-store" or "no-cache" directives in Cache-Control response headers. Warning: this may result in Cloud CDN caching private, per-user (user identifiable) content. CACHE_ALL_STATIC Automatically cache static content, including common image formats, media (video and audio), and web assets (JavaScript and CSS). Requests and responses that are marked as uncacheable, as well as dynamic content (including HTML), will not be cached. + * Check the CacheMode enum for the list of possible values. + * @type int $client_ttl + * Specifies a separate client (e.g. browser client) maximum TTL. This is used to clamp the max-age (or Expires) value sent to the client. With FORCE_CACHE_ALL, the lesser of client_ttl and default_ttl is used for the response max-age directive, along with a "public" directive. For cacheable content in CACHE_ALL_STATIC mode, client_ttl clamps the max-age from the origin (if specified), or else sets the response max-age directive to the lesser of the client_ttl and default_ttl, and also ensures a "public" cache-control directive is present. If a client TTL is not specified, a default value (1 hour) will be used. The maximum allowed value is 31,622,400s (1 year). + * @type int $default_ttl + * Specifies the default TTL for cached content served by this origin for responses that do not have an existing valid TTL (max-age or s-max-age). Setting a TTL of "0" means "always revalidate". The value of defaultTTL cannot be set to a value greater than that of maxTTL, but can be equal. When the cacheMode is set to FORCE_CACHE_ALL, the defaultTTL will overwrite the TTL set in all responses. The maximum allowed value is 31,622,400s (1 year), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * @type int $max_ttl + * Specifies the maximum allowed TTL for cached content served by this origin. Cache directives that attempt to set a max-age or s-maxage higher than this, or an Expires header more than maxTTL seconds in the future will be capped at the value of maxTTL, as if it were the value of an s-maxage Cache-Control directive. Headers sent to the client will not be modified. Setting a TTL of "0" means "always revalidate". The maximum allowed value is 31,622,400s (1 year), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * @type bool $negative_caching + * Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects. This can reduce the load on your origin and improve end-user experience by reducing response latency. When the cache mode is set to CACHE_ALL_STATIC or USE_ORIGIN_HEADERS, negative caching applies to responses with the specified response code that lack any Cache-Control, Expires, or Pragma: no-cache directives. When the cache mode is set to FORCE_CACHE_ALL, negative caching applies to all responses with the specified response code, and override any caching headers. By default, Cloud CDN will apply the following default TTLs to these status codes: HTTP 300 (Multiple Choice), 301, 308 (Permanent Redirects): 10m HTTP 404 (Not Found), 410 (Gone), 451 (Unavailable For Legal Reasons): 120s HTTP 405 (Method Not Found), 421 (Misdirected Request), 501 (Not Implemented): 60s. These defaults can be overridden in negative_caching_policy. + * @type array<\Google\Cloud\Compute\V1\BackendBucketCdnPolicyNegativeCachingPolicy>|\Google\Protobuf\Internal\RepeatedField $negative_caching_policy + * Sets a cache TTL for the specified HTTP status code. negative_caching must be enabled to configure negative_caching_policy. Omitting the policy and leaving negative_caching enabled will use Cloud CDN's default cache TTLs. Note that when specifying an explicit negative_caching_policy, you should take care to specify a cache TTL for all response codes that you wish to cache. Cloud CDN will not apply any default negative caching when a policy exists. + * @type bool $request_coalescing + * If true then Cloud CDN will combine multiple concurrent cache fill requests into a small number of requests to the origin. + * @type int $serve_while_stale + * Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache. This setting defines the default "max-stale" duration for any cached responses that do not specify a max-stale directive. Stale responses that exceed the TTL configured here will not be served. The default limit (max-stale) is 86400s (1 day), which will allow stale content to be served up to this limit beyond the max-age (or s-max-age) of a cached response. The maximum allowed value is 604800 (1 week). Set this to zero (0) to disable serve-while-stale. + * @type int|string $signed_url_cache_max_age_sec + * Maximum number of seconds the response to a signed URL request will be considered fresh. After this time period, the response will be revalidated before being served. Defaults to 1hr (3600s). When serving responses to signed URL requests, Cloud CDN will internally behave as though all responses from this backend had a "Cache-Control: public, max-age=[TTL]" header, regardless of any existing Cache-Control header. The actual headers served in responses will not be altered. + * @type array|\Google\Protobuf\Internal\RepeatedField $signed_url_key_names + * [Output Only] Names of the keys for signing request URLs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. The cache is bypassed for all cdnPolicy.cacheMode settings. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader bypass_cache_on_request_headers = 486203082; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBypassCacheOnRequestHeaders() + { + return $this->bypass_cache_on_request_headers; + } + + /** + * Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. The cache is bypassed for all cdnPolicy.cacheMode settings. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader bypass_cache_on_request_headers = 486203082; + * @param array<\Google\Cloud\Compute\V1\BackendBucketCdnPolicyBypassCacheOnRequestHeader>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBypassCacheOnRequestHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\BackendBucketCdnPolicyBypassCacheOnRequestHeader::class); + $this->bypass_cache_on_request_headers = $arr; + + return $this; + } + + /** + * The CacheKeyPolicy for this CdnPolicy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendBucketCdnPolicyCacheKeyPolicy cache_key_policy = 159263727; + * @return \Google\Cloud\Compute\V1\BackendBucketCdnPolicyCacheKeyPolicy|null + */ + public function getCacheKeyPolicy() + { + return $this->cache_key_policy; + } + + public function hasCacheKeyPolicy() + { + return isset($this->cache_key_policy); + } + + public function clearCacheKeyPolicy() + { + unset($this->cache_key_policy); + } + + /** + * The CacheKeyPolicy for this CdnPolicy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendBucketCdnPolicyCacheKeyPolicy cache_key_policy = 159263727; + * @param \Google\Cloud\Compute\V1\BackendBucketCdnPolicyCacheKeyPolicy $var + * @return $this + */ + public function setCacheKeyPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BackendBucketCdnPolicyCacheKeyPolicy::class); + $this->cache_key_policy = $var; + + return $this; + } + + /** + * Specifies the cache setting for all responses from this backend. The possible values are: USE_ORIGIN_HEADERS Requires the origin to set valid caching headers to cache content. Responses without these headers will not be cached at Google's edge, and will require a full trip to the origin on every request, potentially impacting performance and increasing load on the origin server. FORCE_CACHE_ALL Cache all content, ignoring any "private", "no-store" or "no-cache" directives in Cache-Control response headers. Warning: this may result in Cloud CDN caching private, per-user (user identifiable) content. CACHE_ALL_STATIC Automatically cache static content, including common image formats, media (video and audio), and web assets (JavaScript and CSS). Requests and responses that are marked as uncacheable, as well as dynamic content (including HTML), will not be cached. + * Check the CacheMode enum for the list of possible values. + * + * Generated from protobuf field optional string cache_mode = 28877888; + * @return string + */ + public function getCacheMode() + { + return isset($this->cache_mode) ? $this->cache_mode : ''; + } + + public function hasCacheMode() + { + return isset($this->cache_mode); + } + + public function clearCacheMode() + { + unset($this->cache_mode); + } + + /** + * Specifies the cache setting for all responses from this backend. The possible values are: USE_ORIGIN_HEADERS Requires the origin to set valid caching headers to cache content. Responses without these headers will not be cached at Google's edge, and will require a full trip to the origin on every request, potentially impacting performance and increasing load on the origin server. FORCE_CACHE_ALL Cache all content, ignoring any "private", "no-store" or "no-cache" directives in Cache-Control response headers. Warning: this may result in Cloud CDN caching private, per-user (user identifiable) content. CACHE_ALL_STATIC Automatically cache static content, including common image formats, media (video and audio), and web assets (JavaScript and CSS). Requests and responses that are marked as uncacheable, as well as dynamic content (including HTML), will not be cached. + * Check the CacheMode enum for the list of possible values. + * + * Generated from protobuf field optional string cache_mode = 28877888; + * @param string $var + * @return $this + */ + public function setCacheMode($var) + { + GPBUtil::checkString($var, True); + $this->cache_mode = $var; + + return $this; + } + + /** + * Specifies a separate client (e.g. browser client) maximum TTL. This is used to clamp the max-age (or Expires) value sent to the client. With FORCE_CACHE_ALL, the lesser of client_ttl and default_ttl is used for the response max-age directive, along with a "public" directive. For cacheable content in CACHE_ALL_STATIC mode, client_ttl clamps the max-age from the origin (if specified), or else sets the response max-age directive to the lesser of the client_ttl and default_ttl, and also ensures a "public" cache-control directive is present. If a client TTL is not specified, a default value (1 hour) will be used. The maximum allowed value is 31,622,400s (1 year). + * + * Generated from protobuf field optional int32 client_ttl = 29034360; + * @return int + */ + public function getClientTtl() + { + return isset($this->client_ttl) ? $this->client_ttl : 0; + } + + public function hasClientTtl() + { + return isset($this->client_ttl); + } + + public function clearClientTtl() + { + unset($this->client_ttl); + } + + /** + * Specifies a separate client (e.g. browser client) maximum TTL. This is used to clamp the max-age (or Expires) value sent to the client. With FORCE_CACHE_ALL, the lesser of client_ttl and default_ttl is used for the response max-age directive, along with a "public" directive. For cacheable content in CACHE_ALL_STATIC mode, client_ttl clamps the max-age from the origin (if specified), or else sets the response max-age directive to the lesser of the client_ttl and default_ttl, and also ensures a "public" cache-control directive is present. If a client TTL is not specified, a default value (1 hour) will be used. The maximum allowed value is 31,622,400s (1 year). + * + * Generated from protobuf field optional int32 client_ttl = 29034360; + * @param int $var + * @return $this + */ + public function setClientTtl($var) + { + GPBUtil::checkInt32($var); + $this->client_ttl = $var; + + return $this; + } + + /** + * Specifies the default TTL for cached content served by this origin for responses that do not have an existing valid TTL (max-age or s-max-age). Setting a TTL of "0" means "always revalidate". The value of defaultTTL cannot be set to a value greater than that of maxTTL, but can be equal. When the cacheMode is set to FORCE_CACHE_ALL, the defaultTTL will overwrite the TTL set in all responses. The maximum allowed value is 31,622,400s (1 year), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * + * Generated from protobuf field optional int32 default_ttl = 100253422; + * @return int + */ + public function getDefaultTtl() + { + return isset($this->default_ttl) ? $this->default_ttl : 0; + } + + public function hasDefaultTtl() + { + return isset($this->default_ttl); + } + + public function clearDefaultTtl() + { + unset($this->default_ttl); + } + + /** + * Specifies the default TTL for cached content served by this origin for responses that do not have an existing valid TTL (max-age or s-max-age). Setting a TTL of "0" means "always revalidate". The value of defaultTTL cannot be set to a value greater than that of maxTTL, but can be equal. When the cacheMode is set to FORCE_CACHE_ALL, the defaultTTL will overwrite the TTL set in all responses. The maximum allowed value is 31,622,400s (1 year), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * + * Generated from protobuf field optional int32 default_ttl = 100253422; + * @param int $var + * @return $this + */ + public function setDefaultTtl($var) + { + GPBUtil::checkInt32($var); + $this->default_ttl = $var; + + return $this; + } + + /** + * Specifies the maximum allowed TTL for cached content served by this origin. Cache directives that attempt to set a max-age or s-maxage higher than this, or an Expires header more than maxTTL seconds in the future will be capped at the value of maxTTL, as if it were the value of an s-maxage Cache-Control directive. Headers sent to the client will not be modified. Setting a TTL of "0" means "always revalidate". The maximum allowed value is 31,622,400s (1 year), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * + * Generated from protobuf field optional int32 max_ttl = 307578001; + * @return int + */ + public function getMaxTtl() + { + return isset($this->max_ttl) ? $this->max_ttl : 0; + } + + public function hasMaxTtl() + { + return isset($this->max_ttl); + } + + public function clearMaxTtl() + { + unset($this->max_ttl); + } + + /** + * Specifies the maximum allowed TTL for cached content served by this origin. Cache directives that attempt to set a max-age or s-maxage higher than this, or an Expires header more than maxTTL seconds in the future will be capped at the value of maxTTL, as if it were the value of an s-maxage Cache-Control directive. Headers sent to the client will not be modified. Setting a TTL of "0" means "always revalidate". The maximum allowed value is 31,622,400s (1 year), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * + * Generated from protobuf field optional int32 max_ttl = 307578001; + * @param int $var + * @return $this + */ + public function setMaxTtl($var) + { + GPBUtil::checkInt32($var); + $this->max_ttl = $var; + + return $this; + } + + /** + * Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects. This can reduce the load on your origin and improve end-user experience by reducing response latency. When the cache mode is set to CACHE_ALL_STATIC or USE_ORIGIN_HEADERS, negative caching applies to responses with the specified response code that lack any Cache-Control, Expires, or Pragma: no-cache directives. When the cache mode is set to FORCE_CACHE_ALL, negative caching applies to all responses with the specified response code, and override any caching headers. By default, Cloud CDN will apply the following default TTLs to these status codes: HTTP 300 (Multiple Choice), 301, 308 (Permanent Redirects): 10m HTTP 404 (Not Found), 410 (Gone), 451 (Unavailable For Legal Reasons): 120s HTTP 405 (Method Not Found), 421 (Misdirected Request), 501 (Not Implemented): 60s. These defaults can be overridden in negative_caching_policy. + * + * Generated from protobuf field optional bool negative_caching = 336110005; + * @return bool + */ + public function getNegativeCaching() + { + return isset($this->negative_caching) ? $this->negative_caching : false; + } + + public function hasNegativeCaching() + { + return isset($this->negative_caching); + } + + public function clearNegativeCaching() + { + unset($this->negative_caching); + } + + /** + * Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects. This can reduce the load on your origin and improve end-user experience by reducing response latency. When the cache mode is set to CACHE_ALL_STATIC or USE_ORIGIN_HEADERS, negative caching applies to responses with the specified response code that lack any Cache-Control, Expires, or Pragma: no-cache directives. When the cache mode is set to FORCE_CACHE_ALL, negative caching applies to all responses with the specified response code, and override any caching headers. By default, Cloud CDN will apply the following default TTLs to these status codes: HTTP 300 (Multiple Choice), 301, 308 (Permanent Redirects): 10m HTTP 404 (Not Found), 410 (Gone), 451 (Unavailable For Legal Reasons): 120s HTTP 405 (Method Not Found), 421 (Misdirected Request), 501 (Not Implemented): 60s. These defaults can be overridden in negative_caching_policy. + * + * Generated from protobuf field optional bool negative_caching = 336110005; + * @param bool $var + * @return $this + */ + public function setNegativeCaching($var) + { + GPBUtil::checkBool($var); + $this->negative_caching = $var; + + return $this; + } + + /** + * Sets a cache TTL for the specified HTTP status code. negative_caching must be enabled to configure negative_caching_policy. Omitting the policy and leaving negative_caching enabled will use Cloud CDN's default cache TTLs. Note that when specifying an explicit negative_caching_policy, you should take care to specify a cache TTL for all response codes that you wish to cache. Cloud CDN will not apply any default negative caching when a policy exists. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy negative_caching_policy = 155359996; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNegativeCachingPolicy() + { + return $this->negative_caching_policy; + } + + /** + * Sets a cache TTL for the specified HTTP status code. negative_caching must be enabled to configure negative_caching_policy. Omitting the policy and leaving negative_caching enabled will use Cloud CDN's default cache TTLs. Note that when specifying an explicit negative_caching_policy, you should take care to specify a cache TTL for all response codes that you wish to cache. Cloud CDN will not apply any default negative caching when a policy exists. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy negative_caching_policy = 155359996; + * @param array<\Google\Cloud\Compute\V1\BackendBucketCdnPolicyNegativeCachingPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNegativeCachingPolicy($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\BackendBucketCdnPolicyNegativeCachingPolicy::class); + $this->negative_caching_policy = $arr; + + return $this; + } + + /** + * If true then Cloud CDN will combine multiple concurrent cache fill requests into a small number of requests to the origin. + * + * Generated from protobuf field optional bool request_coalescing = 532808276; + * @return bool + */ + public function getRequestCoalescing() + { + return isset($this->request_coalescing) ? $this->request_coalescing : false; + } + + public function hasRequestCoalescing() + { + return isset($this->request_coalescing); + } + + public function clearRequestCoalescing() + { + unset($this->request_coalescing); + } + + /** + * If true then Cloud CDN will combine multiple concurrent cache fill requests into a small number of requests to the origin. + * + * Generated from protobuf field optional bool request_coalescing = 532808276; + * @param bool $var + * @return $this + */ + public function setRequestCoalescing($var) + { + GPBUtil::checkBool($var); + $this->request_coalescing = $var; + + return $this; + } + + /** + * Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache. This setting defines the default "max-stale" duration for any cached responses that do not specify a max-stale directive. Stale responses that exceed the TTL configured here will not be served. The default limit (max-stale) is 86400s (1 day), which will allow stale content to be served up to this limit beyond the max-age (or s-max-age) of a cached response. The maximum allowed value is 604800 (1 week). Set this to zero (0) to disable serve-while-stale. + * + * Generated from protobuf field optional int32 serve_while_stale = 236682203; + * @return int + */ + public function getServeWhileStale() + { + return isset($this->serve_while_stale) ? $this->serve_while_stale : 0; + } + + public function hasServeWhileStale() + { + return isset($this->serve_while_stale); + } + + public function clearServeWhileStale() + { + unset($this->serve_while_stale); + } + + /** + * Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache. This setting defines the default "max-stale" duration for any cached responses that do not specify a max-stale directive. Stale responses that exceed the TTL configured here will not be served. The default limit (max-stale) is 86400s (1 day), which will allow stale content to be served up to this limit beyond the max-age (or s-max-age) of a cached response. The maximum allowed value is 604800 (1 week). Set this to zero (0) to disable serve-while-stale. + * + * Generated from protobuf field optional int32 serve_while_stale = 236682203; + * @param int $var + * @return $this + */ + public function setServeWhileStale($var) + { + GPBUtil::checkInt32($var); + $this->serve_while_stale = $var; + + return $this; + } + + /** + * Maximum number of seconds the response to a signed URL request will be considered fresh. After this time period, the response will be revalidated before being served. Defaults to 1hr (3600s). When serving responses to signed URL requests, Cloud CDN will internally behave as though all responses from this backend had a "Cache-Control: public, max-age=[TTL]" header, regardless of any existing Cache-Control header. The actual headers served in responses will not be altered. + * + * Generated from protobuf field optional int64 signed_url_cache_max_age_sec = 269374534; + * @return int|string + */ + public function getSignedUrlCacheMaxAgeSec() + { + return isset($this->signed_url_cache_max_age_sec) ? $this->signed_url_cache_max_age_sec : 0; + } + + public function hasSignedUrlCacheMaxAgeSec() + { + return isset($this->signed_url_cache_max_age_sec); + } + + public function clearSignedUrlCacheMaxAgeSec() + { + unset($this->signed_url_cache_max_age_sec); + } + + /** + * Maximum number of seconds the response to a signed URL request will be considered fresh. After this time period, the response will be revalidated before being served. Defaults to 1hr (3600s). When serving responses to signed URL requests, Cloud CDN will internally behave as though all responses from this backend had a "Cache-Control: public, max-age=[TTL]" header, regardless of any existing Cache-Control header. The actual headers served in responses will not be altered. + * + * Generated from protobuf field optional int64 signed_url_cache_max_age_sec = 269374534; + * @param int|string $var + * @return $this + */ + public function setSignedUrlCacheMaxAgeSec($var) + { + GPBUtil::checkInt64($var); + $this->signed_url_cache_max_age_sec = $var; + + return $this; + } + + /** + * [Output Only] Names of the keys for signing request URLs. + * + * Generated from protobuf field repeated string signed_url_key_names = 371848885; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSignedUrlKeyNames() + { + return $this->signed_url_key_names; + } + + /** + * [Output Only] Names of the keys for signing request URLs. + * + * Generated from protobuf field repeated string signed_url_key_names = 371848885; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSignedUrlKeyNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->signed_url_key_names = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketCdnPolicy/CacheMode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketCdnPolicy/CacheMode.php new file mode 100644 index 000000000000..6b26a448679b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketCdnPolicy/CacheMode.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.BackendBucketCdnPolicy.CacheMode + */ +class CacheMode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_CACHE_MODE = 0; + */ + const UNDEFINED_CACHE_MODE = 0; + /** + * Automatically cache static content, including common image formats, media (video and audio), and web assets (JavaScript and CSS). Requests and responses that are marked as uncacheable, as well as dynamic content (including HTML), will not be cached. + * + * Generated from protobuf enum CACHE_ALL_STATIC = 355027945; + */ + const CACHE_ALL_STATIC = 355027945; + /** + * Cache all content, ignoring any "private", "no-store" or "no-cache" directives in Cache-Control response headers. Warning: this may result in Cloud CDN caching private, per-user (user identifiable) content. + * + * Generated from protobuf enum FORCE_CACHE_ALL = 486026928; + */ + const FORCE_CACHE_ALL = 486026928; + /** + * Generated from protobuf enum INVALID_CACHE_MODE = 381295560; + */ + const INVALID_CACHE_MODE = 381295560; + /** + * Requires the origin to set valid caching headers to cache content. Responses without these headers will not be cached at Google's edge, and will require a full trip to the origin on every request, potentially impacting performance and increasing load on the origin server. + * + * Generated from protobuf enum USE_ORIGIN_HEADERS = 55380261; + */ + const USE_ORIGIN_HEADERS = 55380261; + + private static $valueToName = [ + self::UNDEFINED_CACHE_MODE => 'UNDEFINED_CACHE_MODE', + self::CACHE_ALL_STATIC => 'CACHE_ALL_STATIC', + self::FORCE_CACHE_ALL => 'FORCE_CACHE_ALL', + self::INVALID_CACHE_MODE => 'INVALID_CACHE_MODE', + self::USE_ORIGIN_HEADERS => 'USE_ORIGIN_HEADERS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CacheMode::class, \Google\Cloud\Compute\V1\BackendBucketCdnPolicy_CacheMode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketCdnPolicyBypassCacheOnRequestHeader.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketCdnPolicyBypassCacheOnRequestHeader.php new file mode 100644 index 000000000000..381725e21bb9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketCdnPolicyBypassCacheOnRequestHeader.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader + */ +class BackendBucketCdnPolicyBypassCacheOnRequestHeader extends \Google\Protobuf\Internal\Message +{ + /** + * The header field name to match on when bypassing cache. Values are case-insensitive. + * + * Generated from protobuf field optional string header_name = 110223613; + */ + protected $header_name = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $header_name + * The header field name to match on when bypassing cache. Values are case-insensitive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The header field name to match on when bypassing cache. Values are case-insensitive. + * + * Generated from protobuf field optional string header_name = 110223613; + * @return string + */ + public function getHeaderName() + { + return isset($this->header_name) ? $this->header_name : ''; + } + + public function hasHeaderName() + { + return isset($this->header_name); + } + + public function clearHeaderName() + { + unset($this->header_name); + } + + /** + * The header field name to match on when bypassing cache. Values are case-insensitive. + * + * Generated from protobuf field optional string header_name = 110223613; + * @param string $var + * @return $this + */ + public function setHeaderName($var) + { + GPBUtil::checkString($var, True); + $this->header_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketCdnPolicyCacheKeyPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketCdnPolicyCacheKeyPolicy.php new file mode 100644 index 000000000000..0d0514da7bd1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketCdnPolicyCacheKeyPolicy.php @@ -0,0 +1,101 @@ +google.cloud.compute.v1.BackendBucketCdnPolicyCacheKeyPolicy + */ +class BackendBucketCdnPolicyCacheKeyPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Allows HTTP request headers (by name) to be used in the cache key. + * + * Generated from protobuf field repeated string include_http_headers = 2489606; + */ + private $include_http_headers; + /** + * Names of query string parameters to include in cache keys. Default parameters are always included. '&' and '=' will be percent encoded and not treated as delimiters. + * + * Generated from protobuf field repeated string query_string_whitelist = 52456496; + */ + private $query_string_whitelist; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $include_http_headers + * Allows HTTP request headers (by name) to be used in the cache key. + * @type array|\Google\Protobuf\Internal\RepeatedField $query_string_whitelist + * Names of query string parameters to include in cache keys. Default parameters are always included. '&' and '=' will be percent encoded and not treated as delimiters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Allows HTTP request headers (by name) to be used in the cache key. + * + * Generated from protobuf field repeated string include_http_headers = 2489606; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIncludeHttpHeaders() + { + return $this->include_http_headers; + } + + /** + * Allows HTTP request headers (by name) to be used in the cache key. + * + * Generated from protobuf field repeated string include_http_headers = 2489606; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIncludeHttpHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->include_http_headers = $arr; + + return $this; + } + + /** + * Names of query string parameters to include in cache keys. Default parameters are always included. '&' and '=' will be percent encoded and not treated as delimiters. + * + * Generated from protobuf field repeated string query_string_whitelist = 52456496; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQueryStringWhitelist() + { + return $this->query_string_whitelist; + } + + /** + * Names of query string parameters to include in cache keys. Default parameters are always included. '&' and '=' will be percent encoded and not treated as delimiters. + * + * Generated from protobuf field repeated string query_string_whitelist = 52456496; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQueryStringWhitelist($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->query_string_whitelist = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketCdnPolicyNegativeCachingPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketCdnPolicyNegativeCachingPolicy.php new file mode 100644 index 000000000000..afefc245d1eb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketCdnPolicyNegativeCachingPolicy.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy + */ +class BackendBucketCdnPolicyNegativeCachingPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * The HTTP status code to define a TTL against. Only HTTP status codes 300, 301, 302, 307, 308, 404, 405, 410, 421, 451 and 501 are can be specified as values, and you cannot specify a status code more than once. + * + * Generated from protobuf field optional int32 code = 3059181; + */ + protected $code = null; + /** + * The TTL (in seconds) for which to cache responses with the corresponding status code. The maximum allowed value is 1800s (30 minutes), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * + * Generated from protobuf field optional int32 ttl = 115180; + */ + protected $ttl = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $code + * The HTTP status code to define a TTL against. Only HTTP status codes 300, 301, 302, 307, 308, 404, 405, 410, 421, 451 and 501 are can be specified as values, and you cannot specify a status code more than once. + * @type int $ttl + * The TTL (in seconds) for which to cache responses with the corresponding status code. The maximum allowed value is 1800s (30 minutes), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The HTTP status code to define a TTL against. Only HTTP status codes 300, 301, 302, 307, 308, 404, 405, 410, 421, 451 and 501 are can be specified as values, and you cannot specify a status code more than once. + * + * Generated from protobuf field optional int32 code = 3059181; + * @return int + */ + public function getCode() + { + return isset($this->code) ? $this->code : 0; + } + + public function hasCode() + { + return isset($this->code); + } + + public function clearCode() + { + unset($this->code); + } + + /** + * The HTTP status code to define a TTL against. Only HTTP status codes 300, 301, 302, 307, 308, 404, 405, 410, 421, 451 and 501 are can be specified as values, and you cannot specify a status code more than once. + * + * Generated from protobuf field optional int32 code = 3059181; + * @param int $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkInt32($var); + $this->code = $var; + + return $this; + } + + /** + * The TTL (in seconds) for which to cache responses with the corresponding status code. The maximum allowed value is 1800s (30 minutes), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * + * Generated from protobuf field optional int32 ttl = 115180; + * @return int + */ + public function getTtl() + { + return isset($this->ttl) ? $this->ttl : 0; + } + + public function hasTtl() + { + return isset($this->ttl); + } + + public function clearTtl() + { + unset($this->ttl); + } + + /** + * The TTL (in seconds) for which to cache responses with the corresponding status code. The maximum allowed value is 1800s (30 minutes), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * + * Generated from protobuf field optional int32 ttl = 115180; + * @param int $var + * @return $this + */ + public function setTtl($var) + { + GPBUtil::checkInt32($var); + $this->ttl = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketList.php new file mode 100644 index 000000000000..7314a3ea61ef --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.BackendBucketList + */ +class BackendBucketList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of BackendBucket resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendBucket items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\BackendBucket>|\Google\Protobuf\Internal\RepeatedField $items + * A list of BackendBucket 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 BackendBucket resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendBucket items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of BackendBucket resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendBucket items = 100526016; + * @param array<\Google\Cloud\Compute\V1\BackendBucket>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\BackendBucket::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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService.php new file mode 100644 index 000000000000..12ed1ae44ace --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService.php @@ -0,0 +1,1793 @@ +google.cloud.compute.v1.BackendService + */ +class BackendService extends \Google\Protobuf\Internal\Message +{ + /** + * Lifetime of cookies in seconds. This setting is applicable to Application Load Balancers and Traffic Director and requires GENERATED_COOKIE or HTTP_COOKIE session affinity. If set to 0, the cookie is non-persistent and lasts only until the end of the browser session (or equivalent). The maximum allowed value is two weeks (1,209,600). Not 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. + * + * Generated from protobuf field optional int32 affinity_cookie_ttl_sec = 369996954; + */ + protected $affinity_cookie_ttl_sec = null; + /** + * The list of backends that serve this BackendService. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Backend backends = 510839903; + */ + private $backends; + /** + * Cloud CDN configuration for this BackendService. Only available for specified load balancer types. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceCdnPolicy cdn_policy = 213976452; + */ + protected $cdn_policy = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.CircuitBreakers circuit_breakers = 421340061; + */ + protected $circuit_breakers = null; + /** + * Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + * Check the CompressionMode enum for the list of possible values. + * + * Generated from protobuf field optional string compression_mode = 95520988; + */ + protected $compression_mode = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ConnectionDraining connection_draining = 461096747; + */ + protected $connection_draining = null; + /** + * Connection Tracking configuration for this BackendService. Connection tracking policy settings are only available for external passthrough Network Load Balancers and internal passthrough Network Load Balancers. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceConnectionTrackingPolicy connection_tracking_policy = 143994969; + */ + protected $connection_tracking_policy = null; + /** + * Consistent Hash-based load balancing can be used to provide soft session affinity based on HTTP headers, cookies or other properties. This load balancing policy is applicable only for HTTP connections. The affinity to a particular destination host will be lost when one or more hosts are added/removed from the destination service. This field specifies parameters that control consistent hashing. This field is only applicable when localityLbPolicy is set to MAGLEV or RING_HASH. 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. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ConsistentHashLoadBalancerSettings consistent_hash = 905883; + */ + protected $consistent_hash = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * Headers that the load balancer adds to proxied requests. See [Creating custom headers](https://cloud.google.com/load-balancing/docs/custom-headers). + * + * Generated from protobuf field repeated string custom_request_headers = 27977992; + */ + private $custom_request_headers; + /** + * Headers that the load balancer adds to proxied responses. See [Creating custom headers](https://cloud.google.com/load-balancing/docs/custom-headers). + * + * Generated from protobuf field repeated string custom_response_headers = 387539094; + */ + private $custom_response_headers; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The resource URL for the edge security policy associated with this backend service. + * + * Generated from protobuf field optional string edge_security_policy = 41036943; + */ + protected $edge_security_policy = null; + /** + * If true, enables Cloud CDN for the backend service of a global external Application Load Balancer. + * + * Generated from protobuf field optional bool enable_c_d_n = 250733499; + */ + protected $enable_c_d_n = null; + /** + * Requires at least one backend instance group to be defined as a backup (failover) backend. For load balancers that have configurable failover: [Internal passthrough Network Load Balancers](https://cloud.google.com/load-balancing/docs/internal/failover-overview) and [external passthrough Network Load Balancers](https://cloud.google.com/load-balancing/docs/network/networklb-failover-overview). + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceFailoverPolicy failover_policy = 105658655; + */ + protected $failover_policy = null; + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a BackendService. An up-to-date fingerprint must be provided in order to update the BackendService, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a BackendService. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * The list of URLs to the healthChecks, httpHealthChecks (legacy), or httpsHealthChecks (legacy) resource for health checking this backend service. Not all backend services support legacy health checks. See Load balancer guide. Currently, at most one health check can be specified for each backend service. Backend services with instance group or zonal NEG backends must have a health check. Backend services with internet or serverless NEG backends must not have a health check. + * + * Generated from protobuf field repeated string health_checks = 448370606; + */ + private $health_checks; + /** + * The configurations for Identity-Aware Proxy on this resource. Not available for internal passthrough Network Load Balancers and external passthrough Network Load Balancers. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceIAP iap = 104024; + */ + protected $iap = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of resource. Always compute#backendService for backend services. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * 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. + * + * Generated from protobuf field optional string load_balancing_scheme = 363890244; + */ + protected $load_balancing_scheme = null; + /** + * 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; + */ + private $locality_lb_policies; + /** + * 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, INTERNAL_MANAGED, or EXTERNAL_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. + * + * Generated from protobuf field optional string locality_lb_policy = 131431487; + */ + protected $locality_lb_policy = null; + /** + * This field denotes the logging options for the load balancer traffic served by this backend service. If logging is enabled, logs will be exported to Stackdriver. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceLogConfig log_config = 351299741; + */ + protected $log_config = null; + /** + * Specifies the default maximum duration (timeout) for streams to this service. Duration is computed from the beginning of the stream until the response has been completely processed, including all retries. A stream that does not complete in this duration is closed. If not specified, there will be no timeout limit, i.e. the maximum duration is infinite. This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. This field is only allowed when the loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration max_stream_duration = 61428376; + */ + protected $max_stream_duration = null; + /** + * Deployment metadata associated with the resource to be set by a GKE hub controller and read by the backend RCTH + * + * Generated from protobuf field map metadatas = 8514340; + */ + private $metadatas; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * The URL of the network to which this backend service belongs. This field can only be specified when the load balancing scheme is set to INTERNAL. + * + * Generated from protobuf field optional string network = 232872494; + */ + protected $network = null; + /** + * Settings controlling the ejection of unhealthy backend endpoints from the load balancing pool of each individual proxy instance that processes the traffic for the given backend service. If not set, this feature is considered disabled. Results of the outlier detection algorithm (ejection of endpoints from the load balancing pool and returning them back to the pool) are executed independently by each proxy instance of the load balancer. In most cases, more than one proxy instance handles the traffic received by a backend service. Thus, it is possible that an unhealthy endpoint is detected and ejected by only some of the proxies, and while this happens, other proxies may continue to send requests to the same unhealthy endpoint until they detect and eject the unhealthy endpoint. Applicable backend endpoints can be: - VM instances in an Instance Group - Endpoints in a Zonal NEG (GCE_VM_IP, GCE_VM_IP_PORT) - Endpoints in a Hybrid Connectivity NEG (NON_GCP_PRIVATE_IP_PORT) - Serverless NEGs, that resolve to Cloud Run, App Engine, or Cloud Functions Services - Private Service Connect NEGs, that resolve to Google-managed regional API endpoints or managed services published using Private Service Connect Applicable backend service types can be: - A global backend service with the loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. - A regional backend service with the serviceProtocol set to HTTP, HTTPS, or HTTP2, and loadBalancingScheme set to INTERNAL_MANAGED or EXTERNAL_MANAGED. Not supported for Serverless NEGs. Not 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. + * + * Generated from protobuf field optional .google.cloud.compute.v1.OutlierDetection outlier_detection = 354625086; + */ + protected $outlier_detection = null; + /** + * Deprecated in favor of portName. The TCP port to connect on the backend. The default value is 80. For internal passthrough Network Load Balancers and external passthrough Network Load Balancers, omit port. + * + * Generated from protobuf field optional int32 port = 3446913; + */ + protected $port = null; + /** + * A named port on a backend instance group representing the port for communication to the backend VMs in that group. The named port must be [defined on each backend instance group](https://cloud.google.com/load-balancing/docs/backend-service#named_ports). This parameter has no meaning if the backends are NEGs. For internal passthrough Network Load Balancers and external passthrough Network Load Balancers, omit port_name. + * + * Generated from protobuf field optional string port_name = 41534345; + */ + protected $port_name = null; + /** + * The protocol this BackendService uses to communicate with backends. Possible values are HTTP, HTTPS, HTTP2, TCP, SSL, UDP or GRPC. depending on the chosen load balancer or Traffic Director configuration. Refer to the documentation for the load balancers or for Traffic Director for more information. Must be set to GRPC when the backend service is referenced by a URL map that is bound to target gRPC proxy. + * Check the Protocol enum for the list of possible values. + * + * Generated from protobuf field optional string protocol = 84577944; + */ + protected $protocol = null; + /** + * [Output Only] URL of the region where the regional backend service resides. This field is not applicable to global backend services. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] The resource URL for the security policy associated with this backend service. + * + * Generated from protobuf field optional string security_policy = 171082513; + */ + protected $security_policy = null; + /** + * This field specifies the security settings that apply to this backend service. This field is applicable to a global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecuritySettings security_settings = 478649922; + */ + protected $security_settings = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * URLs of networkservices.ServiceBinding resources. Can only be set if load balancing scheme is INTERNAL_SELF_MANAGED. If set, lists of backends and health checks must be both empty. + * + * Generated from protobuf field repeated string service_bindings = 133581016; + */ + private $service_bindings; + /** + * URL to networkservices.ServiceLbPolicy resource. Can only be set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global. + * + * Generated from protobuf field optional string service_lb_policy = 94848785; + */ + protected $service_lb_policy = null; + /** + * Type of session affinity to use. The default is NONE. Only NONE and HEADER_FIELD 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. For more details, see: [Session Affinity](https://cloud.google.com/load-balancing/docs/backend-service#session_affinity). + * Check the SessionAffinity enum for the list of possible values. + * + * Generated from protobuf field optional string session_affinity = 463888561; + */ + protected $session_affinity = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.Subsetting subsetting = 450283536; + */ + protected $subsetting = null; + /** + * The backend service timeout has a different meaning depending on the type of load balancer. For more information see, Backend service settings. The default is 30 seconds. The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. Not 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. Instead, use maxStreamDuration. + * + * Generated from protobuf field optional int32 timeout_sec = 79994995; + */ + protected $timeout_sec = null; + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendServiceUsedBy used_by = 389320729; + */ + private $used_by; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $affinity_cookie_ttl_sec + * Lifetime of cookies in seconds. This setting is applicable to Application Load Balancers and Traffic Director and requires GENERATED_COOKIE or HTTP_COOKIE session affinity. If set to 0, the cookie is non-persistent and lasts only until the end of the browser session (or equivalent). The maximum allowed value is two weeks (1,209,600). Not 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. + * @type array<\Google\Cloud\Compute\V1\Backend>|\Google\Protobuf\Internal\RepeatedField $backends + * The list of backends that serve this BackendService. + * @type \Google\Cloud\Compute\V1\BackendServiceCdnPolicy $cdn_policy + * Cloud CDN configuration for this BackendService. Only available for specified load balancer types. + * @type \Google\Cloud\Compute\V1\CircuitBreakers $circuit_breakers + * @type string $compression_mode + * Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + * Check the CompressionMode enum for the list of possible values. + * @type \Google\Cloud\Compute\V1\ConnectionDraining $connection_draining + * @type \Google\Cloud\Compute\V1\BackendServiceConnectionTrackingPolicy $connection_tracking_policy + * Connection Tracking configuration for this BackendService. Connection tracking policy settings are only available for external passthrough Network Load Balancers and internal passthrough Network Load Balancers. + * @type \Google\Cloud\Compute\V1\ConsistentHashLoadBalancerSettings $consistent_hash + * Consistent Hash-based load balancing can be used to provide soft session affinity based on HTTP headers, cookies or other properties. This load balancing policy is applicable only for HTTP connections. The affinity to a particular destination host will be lost when one or more hosts are added/removed from the destination service. This field specifies parameters that control consistent hashing. This field is only applicable when localityLbPolicy is set to MAGLEV or RING_HASH. 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. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type array|\Google\Protobuf\Internal\RepeatedField $custom_request_headers + * Headers that the load balancer adds to proxied requests. See [Creating custom headers](https://cloud.google.com/load-balancing/docs/custom-headers). + * @type array|\Google\Protobuf\Internal\RepeatedField $custom_response_headers + * Headers that the load balancer adds to proxied responses. See [Creating custom headers](https://cloud.google.com/load-balancing/docs/custom-headers). + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type string $edge_security_policy + * [Output Only] The resource URL for the edge security policy associated with this backend service. + * @type bool $enable_c_d_n + * If true, enables Cloud CDN for the backend service of a global external Application Load Balancer. + * @type \Google\Cloud\Compute\V1\BackendServiceFailoverPolicy $failover_policy + * Requires at least one backend instance group to be defined as a backup (failover) backend. For load balancers that have configurable failover: [Internal passthrough Network Load Balancers](https://cloud.google.com/load-balancing/docs/internal/failover-overview) and [external passthrough Network Load Balancers](https://cloud.google.com/load-balancing/docs/network/networklb-failover-overview). + * @type string $fingerprint + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a BackendService. An up-to-date fingerprint must be provided in order to update the BackendService, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a BackendService. + * @type array|\Google\Protobuf\Internal\RepeatedField $health_checks + * The list of URLs to the healthChecks, httpHealthChecks (legacy), or httpsHealthChecks (legacy) resource for health checking this backend service. Not all backend services support legacy health checks. See Load balancer guide. Currently, at most one health check can be specified for each backend service. Backend services with instance group or zonal NEG backends must have a health check. Backend services with internet or serverless NEG backends must not have a health check. + * @type \Google\Cloud\Compute\V1\BackendServiceIAP $iap + * The configurations for Identity-Aware Proxy on this resource. Not available for internal passthrough Network Load Balancers and external passthrough Network Load Balancers. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of resource. Always compute#backendService for backend services. + * @type string $load_balancing_scheme + * 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. 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, INTERNAL_MANAGED, or EXTERNAL_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. + * @type \Google\Cloud\Compute\V1\BackendServiceLogConfig $log_config + * This field denotes the logging options for the load balancer traffic served by this backend service. If logging is enabled, logs will be exported to Stackdriver. + * @type \Google\Cloud\Compute\V1\Duration $max_stream_duration + * Specifies the default maximum duration (timeout) for streams to this service. Duration is computed from the beginning of the stream until the response has been completely processed, including all retries. A stream that does not complete in this duration is closed. If not specified, there will be no timeout limit, i.e. the maximum duration is infinite. This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. This field is only allowed when the loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED. + * @type array|\Google\Protobuf\Internal\MapField $metadatas + * Deployment metadata associated with the resource to be set by a GKE hub controller and read by the backend RCTH + * @type string $name + * 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 string $network + * The URL of the network to which this backend service belongs. This field can only be specified when the load balancing scheme is set to INTERNAL. + * @type \Google\Cloud\Compute\V1\OutlierDetection $outlier_detection + * Settings controlling the ejection of unhealthy backend endpoints from the load balancing pool of each individual proxy instance that processes the traffic for the given backend service. If not set, this feature is considered disabled. Results of the outlier detection algorithm (ejection of endpoints from the load balancing pool and returning them back to the pool) are executed independently by each proxy instance of the load balancer. In most cases, more than one proxy instance handles the traffic received by a backend service. Thus, it is possible that an unhealthy endpoint is detected and ejected by only some of the proxies, and while this happens, other proxies may continue to send requests to the same unhealthy endpoint until they detect and eject the unhealthy endpoint. Applicable backend endpoints can be: - VM instances in an Instance Group - Endpoints in a Zonal NEG (GCE_VM_IP, GCE_VM_IP_PORT) - Endpoints in a Hybrid Connectivity NEG (NON_GCP_PRIVATE_IP_PORT) - Serverless NEGs, that resolve to Cloud Run, App Engine, or Cloud Functions Services - Private Service Connect NEGs, that resolve to Google-managed regional API endpoints or managed services published using Private Service Connect Applicable backend service types can be: - A global backend service with the loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. - A regional backend service with the serviceProtocol set to HTTP, HTTPS, or HTTP2, and loadBalancingScheme set to INTERNAL_MANAGED or EXTERNAL_MANAGED. Not supported for Serverless NEGs. Not 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. + * @type int $port + * Deprecated in favor of portName. The TCP port to connect on the backend. The default value is 80. For internal passthrough Network Load Balancers and external passthrough Network Load Balancers, omit port. + * @type string $port_name + * A named port on a backend instance group representing the port for communication to the backend VMs in that group. The named port must be [defined on each backend instance group](https://cloud.google.com/load-balancing/docs/backend-service#named_ports). This parameter has no meaning if the backends are NEGs. For internal passthrough Network Load Balancers and external passthrough Network Load Balancers, omit port_name. + * @type string $protocol + * The protocol this BackendService uses to communicate with backends. Possible values are HTTP, HTTPS, HTTP2, TCP, SSL, UDP or GRPC. depending on the chosen load balancer or Traffic Director configuration. Refer to the documentation for the load balancers or for Traffic Director for more information. Must be set to GRPC when the backend service is referenced by a URL map that is bound to target gRPC proxy. + * Check the Protocol enum for the list of possible values. + * @type string $region + * [Output Only] URL of the region where the regional backend service resides. This field is not applicable to global backend services. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * @type string $security_policy + * [Output Only] The resource URL for the security policy associated with this backend service. + * @type \Google\Cloud\Compute\V1\SecuritySettings $security_settings + * This field specifies the security settings that apply to this backend service. This field is applicable to a global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type array|\Google\Protobuf\Internal\RepeatedField $service_bindings + * URLs of networkservices.ServiceBinding resources. Can only be set if load balancing scheme is INTERNAL_SELF_MANAGED. If set, lists of backends and health checks must be both empty. + * @type string $service_lb_policy + * URL to networkservices.ServiceLbPolicy resource. Can only be set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global. + * @type string $session_affinity + * Type of session affinity to use. The default is NONE. Only NONE and HEADER_FIELD 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. For more details, see: [Session Affinity](https://cloud.google.com/load-balancing/docs/backend-service#session_affinity). + * Check the SessionAffinity enum for the list of possible values. + * @type \Google\Cloud\Compute\V1\Subsetting $subsetting + * @type int $timeout_sec + * The backend service timeout has a different meaning depending on the type of load balancer. For more information see, Backend service settings. The default is 30 seconds. The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. Not 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. Instead, use maxStreamDuration. + * @type array<\Google\Cloud\Compute\V1\BackendServiceUsedBy>|\Google\Protobuf\Internal\RepeatedField $used_by + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Lifetime of cookies in seconds. This setting is applicable to Application Load Balancers and Traffic Director and requires GENERATED_COOKIE or HTTP_COOKIE session affinity. If set to 0, the cookie is non-persistent and lasts only until the end of the browser session (or equivalent). The maximum allowed value is two weeks (1,209,600). Not 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. + * + * Generated from protobuf field optional int32 affinity_cookie_ttl_sec = 369996954; + * @return int + */ + public function getAffinityCookieTtlSec() + { + return isset($this->affinity_cookie_ttl_sec) ? $this->affinity_cookie_ttl_sec : 0; + } + + public function hasAffinityCookieTtlSec() + { + return isset($this->affinity_cookie_ttl_sec); + } + + public function clearAffinityCookieTtlSec() + { + unset($this->affinity_cookie_ttl_sec); + } + + /** + * Lifetime of cookies in seconds. This setting is applicable to Application Load Balancers and Traffic Director and requires GENERATED_COOKIE or HTTP_COOKIE session affinity. If set to 0, the cookie is non-persistent and lasts only until the end of the browser session (or equivalent). The maximum allowed value is two weeks (1,209,600). Not 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. + * + * Generated from protobuf field optional int32 affinity_cookie_ttl_sec = 369996954; + * @param int $var + * @return $this + */ + public function setAffinityCookieTtlSec($var) + { + GPBUtil::checkInt32($var); + $this->affinity_cookie_ttl_sec = $var; + + return $this; + } + + /** + * The list of backends that serve this BackendService. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Backend backends = 510839903; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackends() + { + return $this->backends; + } + + /** + * The list of backends that serve this BackendService. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Backend backends = 510839903; + * @param array<\Google\Cloud\Compute\V1\Backend>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackends($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Backend::class); + $this->backends = $arr; + + return $this; + } + + /** + * Cloud CDN configuration for this BackendService. Only available for specified load balancer types. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceCdnPolicy cdn_policy = 213976452; + * @return \Google\Cloud\Compute\V1\BackendServiceCdnPolicy|null + */ + public function getCdnPolicy() + { + return $this->cdn_policy; + } + + public function hasCdnPolicy() + { + return isset($this->cdn_policy); + } + + public function clearCdnPolicy() + { + unset($this->cdn_policy); + } + + /** + * Cloud CDN configuration for this BackendService. Only available for specified load balancer types. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceCdnPolicy cdn_policy = 213976452; + * @param \Google\Cloud\Compute\V1\BackendServiceCdnPolicy $var + * @return $this + */ + public function setCdnPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BackendServiceCdnPolicy::class); + $this->cdn_policy = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.CircuitBreakers circuit_breakers = 421340061; + * @return \Google\Cloud\Compute\V1\CircuitBreakers|null + */ + public function getCircuitBreakers() + { + return $this->circuit_breakers; + } + + public function hasCircuitBreakers() + { + return isset($this->circuit_breakers); + } + + public function clearCircuitBreakers() + { + unset($this->circuit_breakers); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.CircuitBreakers circuit_breakers = 421340061; + * @param \Google\Cloud\Compute\V1\CircuitBreakers $var + * @return $this + */ + public function setCircuitBreakers($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CircuitBreakers::class); + $this->circuit_breakers = $var; + + return $this; + } + + /** + * Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + * Check the CompressionMode enum for the list of possible values. + * + * Generated from protobuf field optional string compression_mode = 95520988; + * @return string + */ + public function getCompressionMode() + { + return isset($this->compression_mode) ? $this->compression_mode : ''; + } + + public function hasCompressionMode() + { + return isset($this->compression_mode); + } + + public function clearCompressionMode() + { + unset($this->compression_mode); + } + + /** + * Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header. + * Check the CompressionMode enum for the list of possible values. + * + * Generated from protobuf field optional string compression_mode = 95520988; + * @param string $var + * @return $this + */ + public function setCompressionMode($var) + { + GPBUtil::checkString($var, True); + $this->compression_mode = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ConnectionDraining connection_draining = 461096747; + * @return \Google\Cloud\Compute\V1\ConnectionDraining|null + */ + public function getConnectionDraining() + { + return $this->connection_draining; + } + + public function hasConnectionDraining() + { + return isset($this->connection_draining); + } + + public function clearConnectionDraining() + { + unset($this->connection_draining); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ConnectionDraining connection_draining = 461096747; + * @param \Google\Cloud\Compute\V1\ConnectionDraining $var + * @return $this + */ + public function setConnectionDraining($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ConnectionDraining::class); + $this->connection_draining = $var; + + return $this; + } + + /** + * Connection Tracking configuration for this BackendService. Connection tracking policy settings are only available for external passthrough Network Load Balancers and internal passthrough Network Load Balancers. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceConnectionTrackingPolicy connection_tracking_policy = 143994969; + * @return \Google\Cloud\Compute\V1\BackendServiceConnectionTrackingPolicy|null + */ + public function getConnectionTrackingPolicy() + { + return $this->connection_tracking_policy; + } + + public function hasConnectionTrackingPolicy() + { + return isset($this->connection_tracking_policy); + } + + public function clearConnectionTrackingPolicy() + { + unset($this->connection_tracking_policy); + } + + /** + * Connection Tracking configuration for this BackendService. Connection tracking policy settings are only available for external passthrough Network Load Balancers and internal passthrough Network Load Balancers. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceConnectionTrackingPolicy connection_tracking_policy = 143994969; + * @param \Google\Cloud\Compute\V1\BackendServiceConnectionTrackingPolicy $var + * @return $this + */ + public function setConnectionTrackingPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BackendServiceConnectionTrackingPolicy::class); + $this->connection_tracking_policy = $var; + + return $this; + } + + /** + * Consistent Hash-based load balancing can be used to provide soft session affinity based on HTTP headers, cookies or other properties. This load balancing policy is applicable only for HTTP connections. The affinity to a particular destination host will be lost when one or more hosts are added/removed from the destination service. This field specifies parameters that control consistent hashing. This field is only applicable when localityLbPolicy is set to MAGLEV or RING_HASH. 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. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ConsistentHashLoadBalancerSettings consistent_hash = 905883; + * @return \Google\Cloud\Compute\V1\ConsistentHashLoadBalancerSettings|null + */ + public function getConsistentHash() + { + return $this->consistent_hash; + } + + public function hasConsistentHash() + { + return isset($this->consistent_hash); + } + + public function clearConsistentHash() + { + unset($this->consistent_hash); + } + + /** + * Consistent Hash-based load balancing can be used to provide soft session affinity based on HTTP headers, cookies or other properties. This load balancing policy is applicable only for HTTP connections. The affinity to a particular destination host will be lost when one or more hosts are added/removed from the destination service. This field specifies parameters that control consistent hashing. This field is only applicable when localityLbPolicy is set to MAGLEV or RING_HASH. 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. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ConsistentHashLoadBalancerSettings consistent_hash = 905883; + * @param \Google\Cloud\Compute\V1\ConsistentHashLoadBalancerSettings $var + * @return $this + */ + public function setConsistentHash($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ConsistentHashLoadBalancerSettings::class); + $this->consistent_hash = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * Headers that the load balancer adds to proxied requests. See [Creating custom headers](https://cloud.google.com/load-balancing/docs/custom-headers). + * + * Generated from protobuf field repeated string custom_request_headers = 27977992; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCustomRequestHeaders() + { + return $this->custom_request_headers; + } + + /** + * Headers that the load balancer adds to proxied requests. See [Creating custom headers](https://cloud.google.com/load-balancing/docs/custom-headers). + * + * Generated from protobuf field repeated string custom_request_headers = 27977992; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCustomRequestHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->custom_request_headers = $arr; + + return $this; + } + + /** + * Headers that the load balancer adds to proxied responses. See [Creating custom headers](https://cloud.google.com/load-balancing/docs/custom-headers). + * + * Generated from protobuf field repeated string custom_response_headers = 387539094; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCustomResponseHeaders() + { + return $this->custom_response_headers; + } + + /** + * Headers that the load balancer adds to proxied responses. See [Creating custom headers](https://cloud.google.com/load-balancing/docs/custom-headers). + * + * Generated from protobuf field repeated string custom_response_headers = 387539094; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCustomResponseHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->custom_response_headers = $arr; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The resource URL for the edge security policy associated with this backend service. + * + * Generated from protobuf field optional string edge_security_policy = 41036943; + * @return string + */ + public function getEdgeSecurityPolicy() + { + return isset($this->edge_security_policy) ? $this->edge_security_policy : ''; + } + + public function hasEdgeSecurityPolicy() + { + return isset($this->edge_security_policy); + } + + public function clearEdgeSecurityPolicy() + { + unset($this->edge_security_policy); + } + + /** + * [Output Only] The resource URL for the edge security policy associated with this backend service. + * + * Generated from protobuf field optional string edge_security_policy = 41036943; + * @param string $var + * @return $this + */ + public function setEdgeSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->edge_security_policy = $var; + + return $this; + } + + /** + * If true, enables Cloud CDN for the backend service of a global external Application Load Balancer. + * + * Generated from protobuf field optional bool enable_c_d_n = 250733499; + * @return bool + */ + public function getEnableCDN() + { + return isset($this->enable_c_d_n) ? $this->enable_c_d_n : false; + } + + public function hasEnableCDN() + { + return isset($this->enable_c_d_n); + } + + public function clearEnableCDN() + { + unset($this->enable_c_d_n); + } + + /** + * If true, enables Cloud CDN for the backend service of a global external Application Load Balancer. + * + * Generated from protobuf field optional bool enable_c_d_n = 250733499; + * @param bool $var + * @return $this + */ + public function setEnableCDN($var) + { + GPBUtil::checkBool($var); + $this->enable_c_d_n = $var; + + return $this; + } + + /** + * Requires at least one backend instance group to be defined as a backup (failover) backend. For load balancers that have configurable failover: [Internal passthrough Network Load Balancers](https://cloud.google.com/load-balancing/docs/internal/failover-overview) and [external passthrough Network Load Balancers](https://cloud.google.com/load-balancing/docs/network/networklb-failover-overview). + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceFailoverPolicy failover_policy = 105658655; + * @return \Google\Cloud\Compute\V1\BackendServiceFailoverPolicy|null + */ + public function getFailoverPolicy() + { + return $this->failover_policy; + } + + public function hasFailoverPolicy() + { + return isset($this->failover_policy); + } + + public function clearFailoverPolicy() + { + unset($this->failover_policy); + } + + /** + * Requires at least one backend instance group to be defined as a backup (failover) backend. For load balancers that have configurable failover: [Internal passthrough Network Load Balancers](https://cloud.google.com/load-balancing/docs/internal/failover-overview) and [external passthrough Network Load Balancers](https://cloud.google.com/load-balancing/docs/network/networklb-failover-overview). + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceFailoverPolicy failover_policy = 105658655; + * @param \Google\Cloud\Compute\V1\BackendServiceFailoverPolicy $var + * @return $this + */ + public function setFailoverPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BackendServiceFailoverPolicy::class); + $this->failover_policy = $var; + + return $this; + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a BackendService. An up-to-date fingerprint must be provided in order to update the BackendService, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a BackendService. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a BackendService. An up-to-date fingerprint must be provided in order to update the BackendService, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a BackendService. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * The list of URLs to the healthChecks, httpHealthChecks (legacy), or httpsHealthChecks (legacy) resource for health checking this backend service. Not all backend services support legacy health checks. See Load balancer guide. Currently, at most one health check can be specified for each backend service. Backend services with instance group or zonal NEG backends must have a health check. Backend services with internet or serverless NEG backends must not have a health check. + * + * Generated from protobuf field repeated string health_checks = 448370606; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHealthChecks() + { + return $this->health_checks; + } + + /** + * The list of URLs to the healthChecks, httpHealthChecks (legacy), or httpsHealthChecks (legacy) resource for health checking this backend service. Not all backend services support legacy health checks. See Load balancer guide. Currently, at most one health check can be specified for each backend service. Backend services with instance group or zonal NEG backends must have a health check. Backend services with internet or serverless NEG backends must not have a health check. + * + * Generated from protobuf field repeated string health_checks = 448370606; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHealthChecks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->health_checks = $arr; + + return $this; + } + + /** + * The configurations for Identity-Aware Proxy on this resource. Not available for internal passthrough Network Load Balancers and external passthrough Network Load Balancers. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceIAP iap = 104024; + * @return \Google\Cloud\Compute\V1\BackendServiceIAP|null + */ + public function getIap() + { + return $this->iap; + } + + public function hasIap() + { + return isset($this->iap); + } + + public function clearIap() + { + unset($this->iap); + } + + /** + * The configurations for Identity-Aware Proxy on this resource. Not available for internal passthrough Network Load Balancers and external passthrough Network Load Balancers. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceIAP iap = 104024; + * @param \Google\Cloud\Compute\V1\BackendServiceIAP $var + * @return $this + */ + public function setIap($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BackendServiceIAP::class); + $this->iap = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#backendService for backend services. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#backendService for backend services. + * + * 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; + } + + /** + * 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. + * + * Generated from protobuf field optional string load_balancing_scheme = 363890244; + * @return string + */ + public function getLoadBalancingScheme() + { + return isset($this->load_balancing_scheme) ? $this->load_balancing_scheme : ''; + } + + public function hasLoadBalancingScheme() + { + return isset($this->load_balancing_scheme); + } + + public function clearLoadBalancingScheme() + { + unset($this->load_balancing_scheme); + } + + /** + * 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. + * + * Generated from protobuf field optional string load_balancing_scheme = 363890244; + * @param string $var + * @return $this + */ + public function setLoadBalancingScheme($var) + { + GPBUtil::checkString($var, True); + $this->load_balancing_scheme = $var; + + return $this; + } + + /** + * 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 + */ + public function getLocalityLbPolicies() + { + return $this->locality_lb_policies; + } + + /** + * 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 + * @return $this + */ + public function setLocalityLbPolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\BackendServiceLocalityLoadBalancingPolicyConfig::class); + $this->locality_lb_policies = $arr; + + return $this; + } + + /** + * 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, INTERNAL_MANAGED, or EXTERNAL_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. + * + * Generated from protobuf field optional string locality_lb_policy = 131431487; + * @return string + */ + public function getLocalityLbPolicy() + { + return isset($this->locality_lb_policy) ? $this->locality_lb_policy : ''; + } + + public function hasLocalityLbPolicy() + { + return isset($this->locality_lb_policy); + } + + public function clearLocalityLbPolicy() + { + unset($this->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, INTERNAL_MANAGED, or EXTERNAL_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. + * + * Generated from protobuf field optional string locality_lb_policy = 131431487; + * @param string $var + * @return $this + */ + public function setLocalityLbPolicy($var) + { + GPBUtil::checkString($var, True); + $this->locality_lb_policy = $var; + + return $this; + } + + /** + * This field denotes the logging options for the load balancer traffic served by this backend service. If logging is enabled, logs will be exported to Stackdriver. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceLogConfig log_config = 351299741; + * @return \Google\Cloud\Compute\V1\BackendServiceLogConfig|null + */ + public function getLogConfig() + { + return $this->log_config; + } + + public function hasLogConfig() + { + return isset($this->log_config); + } + + public function clearLogConfig() + { + unset($this->log_config); + } + + /** + * This field denotes the logging options for the load balancer traffic served by this backend service. If logging is enabled, logs will be exported to Stackdriver. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceLogConfig log_config = 351299741; + * @param \Google\Cloud\Compute\V1\BackendServiceLogConfig $var + * @return $this + */ + public function setLogConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BackendServiceLogConfig::class); + $this->log_config = $var; + + return $this; + } + + /** + * Specifies the default maximum duration (timeout) for streams to this service. Duration is computed from the beginning of the stream until the response has been completely processed, including all retries. A stream that does not complete in this duration is closed. If not specified, there will be no timeout limit, i.e. the maximum duration is infinite. This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. This field is only allowed when the loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration max_stream_duration = 61428376; + * @return \Google\Cloud\Compute\V1\Duration|null + */ + public function getMaxStreamDuration() + { + return $this->max_stream_duration; + } + + public function hasMaxStreamDuration() + { + return isset($this->max_stream_duration); + } + + public function clearMaxStreamDuration() + { + unset($this->max_stream_duration); + } + + /** + * Specifies the default maximum duration (timeout) for streams to this service. Duration is computed from the beginning of the stream until the response has been completely processed, including all retries. A stream that does not complete in this duration is closed. If not specified, there will be no timeout limit, i.e. the maximum duration is infinite. This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. This field is only allowed when the loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration max_stream_duration = 61428376; + * @param \Google\Cloud\Compute\V1\Duration $var + * @return $this + */ + public function setMaxStreamDuration($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Duration::class); + $this->max_stream_duration = $var; + + return $this; + } + + /** + * Deployment metadata associated with the resource to be set by a GKE hub controller and read by the backend RCTH + * + * Generated from protobuf field map metadatas = 8514340; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadatas() + { + return $this->metadatas; + } + + /** + * Deployment metadata associated with the resource to be set by a GKE hub controller and read by the backend RCTH + * + * Generated from protobuf field map metadatas = 8514340; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadatas($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadatas = $arr; + + return $this; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * The URL of the network to which this backend service belongs. This field can only be specified when the load balancing scheme is set to INTERNAL. + * + * Generated from protobuf field optional string network = 232872494; + * @return string + */ + public function getNetwork() + { + return isset($this->network) ? $this->network : ''; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * The URL of the network to which this backend service belongs. This field can only be specified when the load balancing scheme is set to INTERNAL. + * + * Generated from protobuf field optional string network = 232872494; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Settings controlling the ejection of unhealthy backend endpoints from the load balancing pool of each individual proxy instance that processes the traffic for the given backend service. If not set, this feature is considered disabled. Results of the outlier detection algorithm (ejection of endpoints from the load balancing pool and returning them back to the pool) are executed independently by each proxy instance of the load balancer. In most cases, more than one proxy instance handles the traffic received by a backend service. Thus, it is possible that an unhealthy endpoint is detected and ejected by only some of the proxies, and while this happens, other proxies may continue to send requests to the same unhealthy endpoint until they detect and eject the unhealthy endpoint. Applicable backend endpoints can be: - VM instances in an Instance Group - Endpoints in a Zonal NEG (GCE_VM_IP, GCE_VM_IP_PORT) - Endpoints in a Hybrid Connectivity NEG (NON_GCP_PRIVATE_IP_PORT) - Serverless NEGs, that resolve to Cloud Run, App Engine, or Cloud Functions Services - Private Service Connect NEGs, that resolve to Google-managed regional API endpoints or managed services published using Private Service Connect Applicable backend service types can be: - A global backend service with the loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. - A regional backend service with the serviceProtocol set to HTTP, HTTPS, or HTTP2, and loadBalancingScheme set to INTERNAL_MANAGED or EXTERNAL_MANAGED. Not supported for Serverless NEGs. Not 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. + * + * Generated from protobuf field optional .google.cloud.compute.v1.OutlierDetection outlier_detection = 354625086; + * @return \Google\Cloud\Compute\V1\OutlierDetection|null + */ + public function getOutlierDetection() + { + return $this->outlier_detection; + } + + public function hasOutlierDetection() + { + return isset($this->outlier_detection); + } + + public function clearOutlierDetection() + { + unset($this->outlier_detection); + } + + /** + * Settings controlling the ejection of unhealthy backend endpoints from the load balancing pool of each individual proxy instance that processes the traffic for the given backend service. If not set, this feature is considered disabled. Results of the outlier detection algorithm (ejection of endpoints from the load balancing pool and returning them back to the pool) are executed independently by each proxy instance of the load balancer. In most cases, more than one proxy instance handles the traffic received by a backend service. Thus, it is possible that an unhealthy endpoint is detected and ejected by only some of the proxies, and while this happens, other proxies may continue to send requests to the same unhealthy endpoint until they detect and eject the unhealthy endpoint. Applicable backend endpoints can be: - VM instances in an Instance Group - Endpoints in a Zonal NEG (GCE_VM_IP, GCE_VM_IP_PORT) - Endpoints in a Hybrid Connectivity NEG (NON_GCP_PRIVATE_IP_PORT) - Serverless NEGs, that resolve to Cloud Run, App Engine, or Cloud Functions Services - Private Service Connect NEGs, that resolve to Google-managed regional API endpoints or managed services published using Private Service Connect Applicable backend service types can be: - A global backend service with the loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL_MANAGED. - A regional backend service with the serviceProtocol set to HTTP, HTTPS, or HTTP2, and loadBalancingScheme set to INTERNAL_MANAGED or EXTERNAL_MANAGED. Not supported for Serverless NEGs. Not 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. + * + * Generated from protobuf field optional .google.cloud.compute.v1.OutlierDetection outlier_detection = 354625086; + * @param \Google\Cloud\Compute\V1\OutlierDetection $var + * @return $this + */ + public function setOutlierDetection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\OutlierDetection::class); + $this->outlier_detection = $var; + + return $this; + } + + /** + * Deprecated in favor of portName. The TCP port to connect on the backend. The default value is 80. For internal passthrough Network Load Balancers and external passthrough Network Load Balancers, omit port. + * + * Generated from protobuf field optional int32 port = 3446913; + * @return int + */ + public function getPort() + { + return isset($this->port) ? $this->port : 0; + } + + public function hasPort() + { + return isset($this->port); + } + + public function clearPort() + { + unset($this->port); + } + + /** + * Deprecated in favor of portName. The TCP port to connect on the backend. The default value is 80. For internal passthrough Network Load Balancers and external passthrough Network Load Balancers, omit port. + * + * Generated from protobuf field optional int32 port = 3446913; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + + /** + * A named port on a backend instance group representing the port for communication to the backend VMs in that group. The named port must be [defined on each backend instance group](https://cloud.google.com/load-balancing/docs/backend-service#named_ports). This parameter has no meaning if the backends are NEGs. For internal passthrough Network Load Balancers and external passthrough Network Load Balancers, omit port_name. + * + * Generated from protobuf field optional string port_name = 41534345; + * @return string + */ + public function getPortName() + { + return isset($this->port_name) ? $this->port_name : ''; + } + + public function hasPortName() + { + return isset($this->port_name); + } + + public function clearPortName() + { + unset($this->port_name); + } + + /** + * A named port on a backend instance group representing the port for communication to the backend VMs in that group. The named port must be [defined on each backend instance group](https://cloud.google.com/load-balancing/docs/backend-service#named_ports). This parameter has no meaning if the backends are NEGs. For internal passthrough Network Load Balancers and external passthrough Network Load Balancers, omit port_name. + * + * Generated from protobuf field optional string port_name = 41534345; + * @param string $var + * @return $this + */ + public function setPortName($var) + { + GPBUtil::checkString($var, True); + $this->port_name = $var; + + return $this; + } + + /** + * The protocol this BackendService uses to communicate with backends. Possible values are HTTP, HTTPS, HTTP2, TCP, SSL, UDP or GRPC. depending on the chosen load balancer or Traffic Director configuration. Refer to the documentation for the load balancers or for Traffic Director for more information. Must be set to GRPC when the backend service is referenced by a URL map that is bound to target gRPC proxy. + * Check the Protocol enum for the list of possible values. + * + * Generated from protobuf field optional string protocol = 84577944; + * @return string + */ + public function getProtocol() + { + return isset($this->protocol) ? $this->protocol : ''; + } + + public function hasProtocol() + { + return isset($this->protocol); + } + + public function clearProtocol() + { + unset($this->protocol); + } + + /** + * The protocol this BackendService uses to communicate with backends. Possible values are HTTP, HTTPS, HTTP2, TCP, SSL, UDP or GRPC. depending on the chosen load balancer or Traffic Director configuration. Refer to the documentation for the load balancers or for Traffic Director for more information. Must be set to GRPC when the backend service is referenced by a URL map that is bound to target gRPC proxy. + * Check the Protocol enum for the list of possible values. + * + * Generated from protobuf field optional string protocol = 84577944; + * @param string $var + * @return $this + */ + public function setProtocol($var) + { + GPBUtil::checkString($var, True); + $this->protocol = $var; + + return $this; + } + + /** + * [Output Only] URL of the region where the regional backend service resides. This field is not applicable to global backend services. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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 regional backend service resides. This field is not applicable to global backend services. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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 resource URL for the security policy associated with this backend service. + * + * Generated from protobuf field optional string security_policy = 171082513; + * @return string + */ + public function getSecurityPolicy() + { + return isset($this->security_policy) ? $this->security_policy : ''; + } + + public function hasSecurityPolicy() + { + return isset($this->security_policy); + } + + public function clearSecurityPolicy() + { + unset($this->security_policy); + } + + /** + * [Output Only] The resource URL for the security policy associated with this backend service. + * + * Generated from protobuf field optional string security_policy = 171082513; + * @param string $var + * @return $this + */ + public function setSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->security_policy = $var; + + return $this; + } + + /** + * This field specifies the security settings that apply to this backend service. This field is applicable to a global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecuritySettings security_settings = 478649922; + * @return \Google\Cloud\Compute\V1\SecuritySettings|null + */ + public function getSecuritySettings() + { + return $this->security_settings; + } + + public function hasSecuritySettings() + { + return isset($this->security_settings); + } + + public function clearSecuritySettings() + { + unset($this->security_settings); + } + + /** + * This field specifies the security settings that apply to this backend service. This field is applicable to a global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecuritySettings security_settings = 478649922; + * @param \Google\Cloud\Compute\V1\SecuritySettings $var + * @return $this + */ + public function setSecuritySettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecuritySettings::class); + $this->security_settings = $var; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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; + } + + /** + * URLs of networkservices.ServiceBinding resources. Can only be set if load balancing scheme is INTERNAL_SELF_MANAGED. If set, lists of backends and health checks must be both empty. + * + * Generated from protobuf field repeated string service_bindings = 133581016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServiceBindings() + { + return $this->service_bindings; + } + + /** + * URLs of networkservices.ServiceBinding resources. Can only be set if load balancing scheme is INTERNAL_SELF_MANAGED. If set, lists of backends and health checks must be both empty. + * + * Generated from protobuf field repeated string service_bindings = 133581016; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServiceBindings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->service_bindings = $arr; + + return $this; + } + + /** + * URL to networkservices.ServiceLbPolicy resource. Can only be set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global. + * + * Generated from protobuf field optional string service_lb_policy = 94848785; + * @return string + */ + public function getServiceLbPolicy() + { + return isset($this->service_lb_policy) ? $this->service_lb_policy : ''; + } + + public function hasServiceLbPolicy() + { + return isset($this->service_lb_policy); + } + + public function clearServiceLbPolicy() + { + unset($this->service_lb_policy); + } + + /** + * URL to networkservices.ServiceLbPolicy resource. Can only be set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global. + * + * Generated from protobuf field optional string service_lb_policy = 94848785; + * @param string $var + * @return $this + */ + public function setServiceLbPolicy($var) + { + GPBUtil::checkString($var, True); + $this->service_lb_policy = $var; + + return $this; + } + + /** + * Type of session affinity to use. The default is NONE. Only NONE and HEADER_FIELD 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. For more details, see: [Session Affinity](https://cloud.google.com/load-balancing/docs/backend-service#session_affinity). + * Check the SessionAffinity enum for the list of possible values. + * + * Generated from protobuf field optional string session_affinity = 463888561; + * @return string + */ + public function getSessionAffinity() + { + return isset($this->session_affinity) ? $this->session_affinity : ''; + } + + public function hasSessionAffinity() + { + return isset($this->session_affinity); + } + + public function clearSessionAffinity() + { + unset($this->session_affinity); + } + + /** + * Type of session affinity to use. The default is NONE. Only NONE and HEADER_FIELD 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. For more details, see: [Session Affinity](https://cloud.google.com/load-balancing/docs/backend-service#session_affinity). + * Check the SessionAffinity enum for the list of possible values. + * + * Generated from protobuf field optional string session_affinity = 463888561; + * @param string $var + * @return $this + */ + public function setSessionAffinity($var) + { + GPBUtil::checkString($var, True); + $this->session_affinity = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.Subsetting subsetting = 450283536; + * @return \Google\Cloud\Compute\V1\Subsetting|null + */ + public function getSubsetting() + { + return $this->subsetting; + } + + public function hasSubsetting() + { + return isset($this->subsetting); + } + + public function clearSubsetting() + { + unset($this->subsetting); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.Subsetting subsetting = 450283536; + * @param \Google\Cloud\Compute\V1\Subsetting $var + * @return $this + */ + public function setSubsetting($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Subsetting::class); + $this->subsetting = $var; + + return $this; + } + + /** + * The backend service timeout has a different meaning depending on the type of load balancer. For more information see, Backend service settings. The default is 30 seconds. The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. Not 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. Instead, use maxStreamDuration. + * + * Generated from protobuf field optional int32 timeout_sec = 79994995; + * @return int + */ + public function getTimeoutSec() + { + return isset($this->timeout_sec) ? $this->timeout_sec : 0; + } + + public function hasTimeoutSec() + { + return isset($this->timeout_sec); + } + + public function clearTimeoutSec() + { + unset($this->timeout_sec); + } + + /** + * The backend service timeout has a different meaning depending on the type of load balancer. For more information see, Backend service settings. The default is 30 seconds. The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds. This value can be overridden in the PathMatcher configuration of the UrlMap that references this backend service. Not 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. Instead, use maxStreamDuration. + * + * Generated from protobuf field optional int32 timeout_sec = 79994995; + * @param int $var + * @return $this + */ + public function setTimeoutSec($var) + { + GPBUtil::checkInt32($var); + $this->timeout_sec = $var; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendServiceUsedBy used_by = 389320729; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUsedBy() + { + return $this->used_by; + } + + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendServiceUsedBy used_by = 389320729; + * @param array<\Google\Cloud\Compute\V1\BackendServiceUsedBy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUsedBy($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\BackendServiceUsedBy::class); + $this->used_by = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/CompressionMode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/CompressionMode.php new file mode 100644 index 000000000000..a2b96a41b799 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/CompressionMode.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.BackendService.CompressionMode + */ +class CompressionMode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_COMPRESSION_MODE = 0; + */ + const UNDEFINED_COMPRESSION_MODE = 0; + /** + * Automatically uses the best compression based on the Accept-Encoding header sent by the client. + * + * Generated from protobuf enum AUTOMATIC = 165298699; + */ + const AUTOMATIC = 165298699; + /** + * Disables compression. Existing compressed responses cached by Cloud CDN will not be served to clients. + * + * Generated from protobuf enum DISABLED = 516696700; + */ + const DISABLED = 516696700; + + private static $valueToName = [ + self::UNDEFINED_COMPRESSION_MODE => 'UNDEFINED_COMPRESSION_MODE', + self::AUTOMATIC => 'AUTOMATIC', + self::DISABLED => 'DISABLED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CompressionMode::class, \Google\Cloud\Compute\V1\BackendService_CompressionMode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/LoadBalancingScheme.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/LoadBalancingScheme.php new file mode 100644 index 000000000000..996925ba51c7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/LoadBalancingScheme.php @@ -0,0 +1,90 @@ +google.cloud.compute.v1.BackendService.LoadBalancingScheme + */ +class LoadBalancingScheme +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_LOAD_BALANCING_SCHEME = 0; + */ + const UNDEFINED_LOAD_BALANCING_SCHEME = 0; + /** + * Signifies that this will be used for classic Application Load Balancers, global external proxy Network Load Balancers, or external passthrough Network Load Balancers. + * + * Generated from protobuf enum EXTERNAL = 35607499; + */ + const EXTERNAL = 35607499; + /** + * Signifies that this will be used for global external Application Load Balancers, regional external Application Load Balancers, or regional external proxy Network Load Balancers. + * + * Generated from protobuf enum EXTERNAL_MANAGED = 512006923; + */ + const EXTERNAL_MANAGED = 512006923; + /** + * Signifies that this will be used for internal passthrough Network Load Balancers. + * + * Generated from protobuf enum INTERNAL = 279295677; + */ + const INTERNAL = 279295677; + /** + * Signifies that this will be used for internal Application Load Balancers. + * + * Generated from protobuf enum INTERNAL_MANAGED = 37350397; + */ + const INTERNAL_MANAGED = 37350397; + /** + * Signifies that this will be used by Traffic Director. + * + * Generated from protobuf enum INTERNAL_SELF_MANAGED = 236211150; + */ + const INTERNAL_SELF_MANAGED = 236211150; + /** + * Generated from protobuf enum INVALID_LOAD_BALANCING_SCHEME = 275352060; + */ + const INVALID_LOAD_BALANCING_SCHEME = 275352060; + + private static $valueToName = [ + self::UNDEFINED_LOAD_BALANCING_SCHEME => 'UNDEFINED_LOAD_BALANCING_SCHEME', + self::EXTERNAL => 'EXTERNAL', + self::EXTERNAL_MANAGED => 'EXTERNAL_MANAGED', + self::INTERNAL => 'INTERNAL', + self::INTERNAL_MANAGED => 'INTERNAL_MANAGED', + self::INTERNAL_SELF_MANAGED => 'INTERNAL_SELF_MANAGED', + self::INVALID_LOAD_BALANCING_SCHEME => 'INVALID_LOAD_BALANCING_SCHEME', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LoadBalancingScheme::class, \Google\Cloud\Compute\V1\BackendService_LoadBalancingScheme::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/LocalityLbPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/LocalityLbPolicy.php new file mode 100644 index 000000000000..5f06f6f8bda4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/LocalityLbPolicy.php @@ -0,0 +1,104 @@ +google.cloud.compute.v1.BackendService.LocalityLbPolicy + */ +class LocalityLbPolicy +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_LOCALITY_LB_POLICY = 0; + */ + const UNDEFINED_LOCALITY_LB_POLICY = 0; + /** + * Generated from protobuf enum INVALID_LB_POLICY = 323318707; + */ + const INVALID_LB_POLICY = 323318707; + /** + * An O(1) algorithm which selects two random healthy hosts and picks the host which has fewer active requests. + * + * Generated from protobuf enum LEAST_REQUEST = 46604921; + */ + const LEAST_REQUEST = 46604921; + /** + * This algorithm implements consistent hashing to backends. Maglev can be 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 + * + * Generated from protobuf enum MAGLEV = 119180266; + */ + const MAGLEV = 119180266; + /** + * 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. + * + * Generated from protobuf enum ORIGINAL_DESTINATION = 166297216; + */ + const ORIGINAL_DESTINATION = 166297216; + /** + * The load balancer selects a random healthy host. + * + * Generated from protobuf enum RANDOM = 262527171; + */ + const RANDOM = 262527171; + /** + * 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. + * + * Generated from protobuf enum RING_HASH = 432795069; + */ + const RING_HASH = 432795069; + /** + * This is a simple policy in which each healthy backend is selected in round robin order. This is the default. + * + * 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', + self::INVALID_LB_POLICY => 'INVALID_LB_POLICY', + self::LEAST_REQUEST => 'LEAST_REQUEST', + self::MAGLEV => 'MAGLEV', + self::ORIGINAL_DESTINATION => 'ORIGINAL_DESTINATION', + self::RANDOM => 'RANDOM', + self::RING_HASH => 'RING_HASH', + self::ROUND_ROBIN => 'ROUND_ROBIN', + self::WEIGHTED_MAGLEV => 'WEIGHTED_MAGLEV', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LocalityLbPolicy::class, \Google\Cloud\Compute\V1\BackendService_LocalityLbPolicy::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/Protocol.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/Protocol.php new file mode 100644 index 000000000000..b61f600007ca --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/Protocol.php @@ -0,0 +1,102 @@ +google.cloud.compute.v1.BackendService.Protocol + */ +class Protocol +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PROTOCOL = 0; + */ + const UNDEFINED_PROTOCOL = 0; + /** + * gRPC (available for Traffic Director). + * + * Generated from protobuf enum GRPC = 2196510; + */ + const GRPC = 2196510; + /** + * Generated from protobuf enum HTTP = 2228360; + */ + const HTTP = 2228360; + /** + * HTTP/2 with SSL. + * + * Generated from protobuf enum HTTP2 = 69079210; + */ + const HTTP2 = 69079210; + /** + * Generated from protobuf enum HTTPS = 69079243; + */ + const HTTPS = 69079243; + /** + * TCP proxying with SSL. + * + * Generated from protobuf enum SSL = 82412; + */ + const SSL = 82412; + /** + * TCP proxying or TCP pass-through. + * + * Generated from protobuf enum TCP = 82881; + */ + const TCP = 82881; + /** + * UDP. + * + * Generated from protobuf enum UDP = 83873; + */ + const UDP = 83873; + /** + * If a Backend Service has UNSPECIFIED as its protocol, it can be used with any L3/L4 Forwarding Rules. + * + * Generated from protobuf enum UNSPECIFIED = 526786327; + */ + const UNSPECIFIED = 526786327; + + private static $valueToName = [ + self::UNDEFINED_PROTOCOL => 'UNDEFINED_PROTOCOL', + self::GRPC => 'GRPC', + self::HTTP => 'HTTP', + self::HTTP2 => 'HTTP2', + self::HTTPS => 'HTTPS', + self::SSL => 'SSL', + self::TCP => 'TCP', + self::UDP => 'UDP', + self::UNSPECIFIED => 'UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Protocol::class, \Google\Cloud\Compute\V1\BackendService_Protocol::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/SessionAffinity.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/SessionAffinity.php new file mode 100644 index 000000000000..0038566ca85b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/SessionAffinity.php @@ -0,0 +1,106 @@ +google.cloud.compute.v1.BackendService.SessionAffinity + */ +class SessionAffinity +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_SESSION_AFFINITY = 0; + */ + const UNDEFINED_SESSION_AFFINITY = 0; + /** + * 2-tuple hash on packet's source and destination IP addresses. Connections from the same source IP address to the same destination IP address will be served by the same backend VM while that VM remains healthy. + * + * Generated from protobuf enum CLIENT_IP = 345665051; + */ + const CLIENT_IP = 345665051; + /** + * 1-tuple hash only on packet's source IP address. Connections from the same source IP address will be served by the same backend VM while that VM remains healthy. This option can only be used for Internal TCP/UDP Load Balancing. + * + * Generated from protobuf enum CLIENT_IP_NO_DESTINATION = 106122516; + */ + const CLIENT_IP_NO_DESTINATION = 106122516; + /** + * 5-tuple hash on packet's source and destination IP addresses, IP protocol, and source and destination ports. Connections for the same IP protocol from the same source IP address and port to the same destination IP address and port will be served by the same backend VM while that VM remains healthy. This option cannot be used for HTTP(S) load balancing. + * + * Generated from protobuf enum CLIENT_IP_PORT_PROTO = 221722926; + */ + const CLIENT_IP_PORT_PROTO = 221722926; + /** + * 3-tuple hash on packet's source and destination IP addresses, and IP protocol. Connections for the same IP protocol from the same source IP address to the same destination IP address will be served by the same backend VM while that VM remains healthy. This option cannot be used for HTTP(S) load balancing. + * + * Generated from protobuf enum CLIENT_IP_PROTO = 25322148; + */ + const CLIENT_IP_PROTO = 25322148; + /** + * Hash based on a cookie generated by the L7 loadbalancer. Only valid for HTTP(S) load balancing. + * + * Generated from protobuf enum GENERATED_COOKIE = 370321204; + */ + const GENERATED_COOKIE = 370321204; + /** + * The hash is based on a user specified header field. + * + * Generated from protobuf enum HEADER_FIELD = 200737960; + */ + const HEADER_FIELD = 200737960; + /** + * The hash is based on a user provided cookie. + * + * Generated from protobuf enum HTTP_COOKIE = 494981627; + */ + const HTTP_COOKIE = 494981627; + /** + * No session affinity. Connections from the same client IP may go to any instance in the pool. + * + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + + private static $valueToName = [ + self::UNDEFINED_SESSION_AFFINITY => 'UNDEFINED_SESSION_AFFINITY', + self::CLIENT_IP => 'CLIENT_IP', + self::CLIENT_IP_NO_DESTINATION => 'CLIENT_IP_NO_DESTINATION', + self::CLIENT_IP_PORT_PROTO => 'CLIENT_IP_PORT_PROTO', + self::CLIENT_IP_PROTO => 'CLIENT_IP_PROTO', + self::GENERATED_COOKIE => 'GENERATED_COOKIE', + self::HEADER_FIELD => 'HEADER_FIELD', + self::HTTP_COOKIE => 'HTTP_COOKIE', + self::NONE => 'NONE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SessionAffinity::class, \Google\Cloud\Compute\V1\BackendService_SessionAffinity::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceAggregatedList.php new file mode 100644 index 000000000000..c1e5e2d3254c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceAggregatedList.php @@ -0,0 +1,321 @@ +google.cloud.compute.v1.BackendServiceAggregatedList + */ +class BackendServiceAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of BackendServicesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 BackendServicesScopedList 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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 BackendServicesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of BackendServicesScopedList 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\BackendServicesScopedList::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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceCdnPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceCdnPolicy.php new file mode 100644 index 000000000000..21eac371e826 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceCdnPolicy.php @@ -0,0 +1,535 @@ +google.cloud.compute.v1.BackendServiceCdnPolicy + */ +class BackendServiceCdnPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. The cache is bypassed for all cdnPolicy.cacheMode settings. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader bypass_cache_on_request_headers = 486203082; + */ + private $bypass_cache_on_request_headers; + /** + * The CacheKeyPolicy for this CdnPolicy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CacheKeyPolicy cache_key_policy = 159263727; + */ + protected $cache_key_policy = null; + /** + * Specifies the cache setting for all responses from this backend. The possible values are: USE_ORIGIN_HEADERS Requires the origin to set valid caching headers to cache content. Responses without these headers will not be cached at Google's edge, and will require a full trip to the origin on every request, potentially impacting performance and increasing load on the origin server. FORCE_CACHE_ALL Cache all content, ignoring any "private", "no-store" or "no-cache" directives in Cache-Control response headers. Warning: this may result in Cloud CDN caching private, per-user (user identifiable) content. CACHE_ALL_STATIC Automatically cache static content, including common image formats, media (video and audio), and web assets (JavaScript and CSS). Requests and responses that are marked as uncacheable, as well as dynamic content (including HTML), will not be cached. + * Check the CacheMode enum for the list of possible values. + * + * Generated from protobuf field optional string cache_mode = 28877888; + */ + protected $cache_mode = null; + /** + * Specifies a separate client (e.g. browser client) maximum TTL. This is used to clamp the max-age (or Expires) value sent to the client. With FORCE_CACHE_ALL, the lesser of client_ttl and default_ttl is used for the response max-age directive, along with a "public" directive. For cacheable content in CACHE_ALL_STATIC mode, client_ttl clamps the max-age from the origin (if specified), or else sets the response max-age directive to the lesser of the client_ttl and default_ttl, and also ensures a "public" cache-control directive is present. If a client TTL is not specified, a default value (1 hour) will be used. The maximum allowed value is 31,622,400s (1 year). + * + * Generated from protobuf field optional int32 client_ttl = 29034360; + */ + protected $client_ttl = null; + /** + * Specifies the default TTL for cached content served by this origin for responses that do not have an existing valid TTL (max-age or s-max-age). Setting a TTL of "0" means "always revalidate". The value of defaultTTL cannot be set to a value greater than that of maxTTL, but can be equal. When the cacheMode is set to FORCE_CACHE_ALL, the defaultTTL will overwrite the TTL set in all responses. The maximum allowed value is 31,622,400s (1 year), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * + * Generated from protobuf field optional int32 default_ttl = 100253422; + */ + protected $default_ttl = null; + /** + * Specifies the maximum allowed TTL for cached content served by this origin. Cache directives that attempt to set a max-age or s-maxage higher than this, or an Expires header more than maxTTL seconds in the future will be capped at the value of maxTTL, as if it were the value of an s-maxage Cache-Control directive. Headers sent to the client will not be modified. Setting a TTL of "0" means "always revalidate". The maximum allowed value is 31,622,400s (1 year), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * + * Generated from protobuf field optional int32 max_ttl = 307578001; + */ + protected $max_ttl = null; + /** + * Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects. This can reduce the load on your origin and improve end-user experience by reducing response latency. When the cache mode is set to CACHE_ALL_STATIC or USE_ORIGIN_HEADERS, negative caching applies to responses with the specified response code that lack any Cache-Control, Expires, or Pragma: no-cache directives. When the cache mode is set to FORCE_CACHE_ALL, negative caching applies to all responses with the specified response code, and override any caching headers. By default, Cloud CDN will apply the following default TTLs to these status codes: HTTP 300 (Multiple Choice), 301, 308 (Permanent Redirects): 10m HTTP 404 (Not Found), 410 (Gone), 451 (Unavailable For Legal Reasons): 120s HTTP 405 (Method Not Found), 421 (Misdirected Request), 501 (Not Implemented): 60s. These defaults can be overridden in negative_caching_policy. + * + * Generated from protobuf field optional bool negative_caching = 336110005; + */ + protected $negative_caching = null; + /** + * Sets a cache TTL for the specified HTTP status code. negative_caching must be enabled to configure negative_caching_policy. Omitting the policy and leaving negative_caching enabled will use Cloud CDN's default cache TTLs. Note that when specifying an explicit negative_caching_policy, you should take care to specify a cache TTL for all response codes that you wish to cache. Cloud CDN will not apply any default negative caching when a policy exists. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy negative_caching_policy = 155359996; + */ + private $negative_caching_policy; + /** + * If true then Cloud CDN will combine multiple concurrent cache fill requests into a small number of requests to the origin. + * + * Generated from protobuf field optional bool request_coalescing = 532808276; + */ + protected $request_coalescing = null; + /** + * Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache. This setting defines the default "max-stale" duration for any cached responses that do not specify a max-stale directive. Stale responses that exceed the TTL configured here will not be served. The default limit (max-stale) is 86400s (1 day), which will allow stale content to be served up to this limit beyond the max-age (or s-max-age) of a cached response. The maximum allowed value is 604800 (1 week). Set this to zero (0) to disable serve-while-stale. + * + * Generated from protobuf field optional int32 serve_while_stale = 236682203; + */ + protected $serve_while_stale = null; + /** + * Maximum number of seconds the response to a signed URL request will be considered fresh. After this time period, the response will be revalidated before being served. Defaults to 1hr (3600s). When serving responses to signed URL requests, Cloud CDN will internally behave as though all responses from this backend had a "Cache-Control: public, max-age=[TTL]" header, regardless of any existing Cache-Control header. The actual headers served in responses will not be altered. + * + * Generated from protobuf field optional int64 signed_url_cache_max_age_sec = 269374534; + */ + protected $signed_url_cache_max_age_sec = null; + /** + * [Output Only] Names of the keys for signing request URLs. + * + * Generated from protobuf field repeated string signed_url_key_names = 371848885; + */ + private $signed_url_key_names; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\BackendServiceCdnPolicyBypassCacheOnRequestHeader>|\Google\Protobuf\Internal\RepeatedField $bypass_cache_on_request_headers + * Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. The cache is bypassed for all cdnPolicy.cacheMode settings. + * @type \Google\Cloud\Compute\V1\CacheKeyPolicy $cache_key_policy + * The CacheKeyPolicy for this CdnPolicy. + * @type string $cache_mode + * Specifies the cache setting for all responses from this backend. The possible values are: USE_ORIGIN_HEADERS Requires the origin to set valid caching headers to cache content. Responses without these headers will not be cached at Google's edge, and will require a full trip to the origin on every request, potentially impacting performance and increasing load on the origin server. FORCE_CACHE_ALL Cache all content, ignoring any "private", "no-store" or "no-cache" directives in Cache-Control response headers. Warning: this may result in Cloud CDN caching private, per-user (user identifiable) content. CACHE_ALL_STATIC Automatically cache static content, including common image formats, media (video and audio), and web assets (JavaScript and CSS). Requests and responses that are marked as uncacheable, as well as dynamic content (including HTML), will not be cached. + * Check the CacheMode enum for the list of possible values. + * @type int $client_ttl + * Specifies a separate client (e.g. browser client) maximum TTL. This is used to clamp the max-age (or Expires) value sent to the client. With FORCE_CACHE_ALL, the lesser of client_ttl and default_ttl is used for the response max-age directive, along with a "public" directive. For cacheable content in CACHE_ALL_STATIC mode, client_ttl clamps the max-age from the origin (if specified), or else sets the response max-age directive to the lesser of the client_ttl and default_ttl, and also ensures a "public" cache-control directive is present. If a client TTL is not specified, a default value (1 hour) will be used. The maximum allowed value is 31,622,400s (1 year). + * @type int $default_ttl + * Specifies the default TTL for cached content served by this origin for responses that do not have an existing valid TTL (max-age or s-max-age). Setting a TTL of "0" means "always revalidate". The value of defaultTTL cannot be set to a value greater than that of maxTTL, but can be equal. When the cacheMode is set to FORCE_CACHE_ALL, the defaultTTL will overwrite the TTL set in all responses. The maximum allowed value is 31,622,400s (1 year), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * @type int $max_ttl + * Specifies the maximum allowed TTL for cached content served by this origin. Cache directives that attempt to set a max-age or s-maxage higher than this, or an Expires header more than maxTTL seconds in the future will be capped at the value of maxTTL, as if it were the value of an s-maxage Cache-Control directive. Headers sent to the client will not be modified. Setting a TTL of "0" means "always revalidate". The maximum allowed value is 31,622,400s (1 year), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * @type bool $negative_caching + * Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects. This can reduce the load on your origin and improve end-user experience by reducing response latency. When the cache mode is set to CACHE_ALL_STATIC or USE_ORIGIN_HEADERS, negative caching applies to responses with the specified response code that lack any Cache-Control, Expires, or Pragma: no-cache directives. When the cache mode is set to FORCE_CACHE_ALL, negative caching applies to all responses with the specified response code, and override any caching headers. By default, Cloud CDN will apply the following default TTLs to these status codes: HTTP 300 (Multiple Choice), 301, 308 (Permanent Redirects): 10m HTTP 404 (Not Found), 410 (Gone), 451 (Unavailable For Legal Reasons): 120s HTTP 405 (Method Not Found), 421 (Misdirected Request), 501 (Not Implemented): 60s. These defaults can be overridden in negative_caching_policy. + * @type array<\Google\Cloud\Compute\V1\BackendServiceCdnPolicyNegativeCachingPolicy>|\Google\Protobuf\Internal\RepeatedField $negative_caching_policy + * Sets a cache TTL for the specified HTTP status code. negative_caching must be enabled to configure negative_caching_policy. Omitting the policy and leaving negative_caching enabled will use Cloud CDN's default cache TTLs. Note that when specifying an explicit negative_caching_policy, you should take care to specify a cache TTL for all response codes that you wish to cache. Cloud CDN will not apply any default negative caching when a policy exists. + * @type bool $request_coalescing + * If true then Cloud CDN will combine multiple concurrent cache fill requests into a small number of requests to the origin. + * @type int $serve_while_stale + * Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache. This setting defines the default "max-stale" duration for any cached responses that do not specify a max-stale directive. Stale responses that exceed the TTL configured here will not be served. The default limit (max-stale) is 86400s (1 day), which will allow stale content to be served up to this limit beyond the max-age (or s-max-age) of a cached response. The maximum allowed value is 604800 (1 week). Set this to zero (0) to disable serve-while-stale. + * @type int|string $signed_url_cache_max_age_sec + * Maximum number of seconds the response to a signed URL request will be considered fresh. After this time period, the response will be revalidated before being served. Defaults to 1hr (3600s). When serving responses to signed URL requests, Cloud CDN will internally behave as though all responses from this backend had a "Cache-Control: public, max-age=[TTL]" header, regardless of any existing Cache-Control header. The actual headers served in responses will not be altered. + * @type array|\Google\Protobuf\Internal\RepeatedField $signed_url_key_names + * [Output Only] Names of the keys for signing request URLs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. The cache is bypassed for all cdnPolicy.cacheMode settings. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader bypass_cache_on_request_headers = 486203082; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBypassCacheOnRequestHeaders() + { + return $this->bypass_cache_on_request_headers; + } + + /** + * Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. The cache is bypassed for all cdnPolicy.cacheMode settings. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader bypass_cache_on_request_headers = 486203082; + * @param array<\Google\Cloud\Compute\V1\BackendServiceCdnPolicyBypassCacheOnRequestHeader>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBypassCacheOnRequestHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\BackendServiceCdnPolicyBypassCacheOnRequestHeader::class); + $this->bypass_cache_on_request_headers = $arr; + + return $this; + } + + /** + * The CacheKeyPolicy for this CdnPolicy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CacheKeyPolicy cache_key_policy = 159263727; + * @return \Google\Cloud\Compute\V1\CacheKeyPolicy|null + */ + public function getCacheKeyPolicy() + { + return $this->cache_key_policy; + } + + public function hasCacheKeyPolicy() + { + return isset($this->cache_key_policy); + } + + public function clearCacheKeyPolicy() + { + unset($this->cache_key_policy); + } + + /** + * The CacheKeyPolicy for this CdnPolicy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CacheKeyPolicy cache_key_policy = 159263727; + * @param \Google\Cloud\Compute\V1\CacheKeyPolicy $var + * @return $this + */ + public function setCacheKeyPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CacheKeyPolicy::class); + $this->cache_key_policy = $var; + + return $this; + } + + /** + * Specifies the cache setting for all responses from this backend. The possible values are: USE_ORIGIN_HEADERS Requires the origin to set valid caching headers to cache content. Responses without these headers will not be cached at Google's edge, and will require a full trip to the origin on every request, potentially impacting performance and increasing load on the origin server. FORCE_CACHE_ALL Cache all content, ignoring any "private", "no-store" or "no-cache" directives in Cache-Control response headers. Warning: this may result in Cloud CDN caching private, per-user (user identifiable) content. CACHE_ALL_STATIC Automatically cache static content, including common image formats, media (video and audio), and web assets (JavaScript and CSS). Requests and responses that are marked as uncacheable, as well as dynamic content (including HTML), will not be cached. + * Check the CacheMode enum for the list of possible values. + * + * Generated from protobuf field optional string cache_mode = 28877888; + * @return string + */ + public function getCacheMode() + { + return isset($this->cache_mode) ? $this->cache_mode : ''; + } + + public function hasCacheMode() + { + return isset($this->cache_mode); + } + + public function clearCacheMode() + { + unset($this->cache_mode); + } + + /** + * Specifies the cache setting for all responses from this backend. The possible values are: USE_ORIGIN_HEADERS Requires the origin to set valid caching headers to cache content. Responses without these headers will not be cached at Google's edge, and will require a full trip to the origin on every request, potentially impacting performance and increasing load on the origin server. FORCE_CACHE_ALL Cache all content, ignoring any "private", "no-store" or "no-cache" directives in Cache-Control response headers. Warning: this may result in Cloud CDN caching private, per-user (user identifiable) content. CACHE_ALL_STATIC Automatically cache static content, including common image formats, media (video and audio), and web assets (JavaScript and CSS). Requests and responses that are marked as uncacheable, as well as dynamic content (including HTML), will not be cached. + * Check the CacheMode enum for the list of possible values. + * + * Generated from protobuf field optional string cache_mode = 28877888; + * @param string $var + * @return $this + */ + public function setCacheMode($var) + { + GPBUtil::checkString($var, True); + $this->cache_mode = $var; + + return $this; + } + + /** + * Specifies a separate client (e.g. browser client) maximum TTL. This is used to clamp the max-age (or Expires) value sent to the client. With FORCE_CACHE_ALL, the lesser of client_ttl and default_ttl is used for the response max-age directive, along with a "public" directive. For cacheable content in CACHE_ALL_STATIC mode, client_ttl clamps the max-age from the origin (if specified), or else sets the response max-age directive to the lesser of the client_ttl and default_ttl, and also ensures a "public" cache-control directive is present. If a client TTL is not specified, a default value (1 hour) will be used. The maximum allowed value is 31,622,400s (1 year). + * + * Generated from protobuf field optional int32 client_ttl = 29034360; + * @return int + */ + public function getClientTtl() + { + return isset($this->client_ttl) ? $this->client_ttl : 0; + } + + public function hasClientTtl() + { + return isset($this->client_ttl); + } + + public function clearClientTtl() + { + unset($this->client_ttl); + } + + /** + * Specifies a separate client (e.g. browser client) maximum TTL. This is used to clamp the max-age (or Expires) value sent to the client. With FORCE_CACHE_ALL, the lesser of client_ttl and default_ttl is used for the response max-age directive, along with a "public" directive. For cacheable content in CACHE_ALL_STATIC mode, client_ttl clamps the max-age from the origin (if specified), or else sets the response max-age directive to the lesser of the client_ttl and default_ttl, and also ensures a "public" cache-control directive is present. If a client TTL is not specified, a default value (1 hour) will be used. The maximum allowed value is 31,622,400s (1 year). + * + * Generated from protobuf field optional int32 client_ttl = 29034360; + * @param int $var + * @return $this + */ + public function setClientTtl($var) + { + GPBUtil::checkInt32($var); + $this->client_ttl = $var; + + return $this; + } + + /** + * Specifies the default TTL for cached content served by this origin for responses that do not have an existing valid TTL (max-age or s-max-age). Setting a TTL of "0" means "always revalidate". The value of defaultTTL cannot be set to a value greater than that of maxTTL, but can be equal. When the cacheMode is set to FORCE_CACHE_ALL, the defaultTTL will overwrite the TTL set in all responses. The maximum allowed value is 31,622,400s (1 year), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * + * Generated from protobuf field optional int32 default_ttl = 100253422; + * @return int + */ + public function getDefaultTtl() + { + return isset($this->default_ttl) ? $this->default_ttl : 0; + } + + public function hasDefaultTtl() + { + return isset($this->default_ttl); + } + + public function clearDefaultTtl() + { + unset($this->default_ttl); + } + + /** + * Specifies the default TTL for cached content served by this origin for responses that do not have an existing valid TTL (max-age or s-max-age). Setting a TTL of "0" means "always revalidate". The value of defaultTTL cannot be set to a value greater than that of maxTTL, but can be equal. When the cacheMode is set to FORCE_CACHE_ALL, the defaultTTL will overwrite the TTL set in all responses. The maximum allowed value is 31,622,400s (1 year), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * + * Generated from protobuf field optional int32 default_ttl = 100253422; + * @param int $var + * @return $this + */ + public function setDefaultTtl($var) + { + GPBUtil::checkInt32($var); + $this->default_ttl = $var; + + return $this; + } + + /** + * Specifies the maximum allowed TTL for cached content served by this origin. Cache directives that attempt to set a max-age or s-maxage higher than this, or an Expires header more than maxTTL seconds in the future will be capped at the value of maxTTL, as if it were the value of an s-maxage Cache-Control directive. Headers sent to the client will not be modified. Setting a TTL of "0" means "always revalidate". The maximum allowed value is 31,622,400s (1 year), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * + * Generated from protobuf field optional int32 max_ttl = 307578001; + * @return int + */ + public function getMaxTtl() + { + return isset($this->max_ttl) ? $this->max_ttl : 0; + } + + public function hasMaxTtl() + { + return isset($this->max_ttl); + } + + public function clearMaxTtl() + { + unset($this->max_ttl); + } + + /** + * Specifies the maximum allowed TTL for cached content served by this origin. Cache directives that attempt to set a max-age or s-maxage higher than this, or an Expires header more than maxTTL seconds in the future will be capped at the value of maxTTL, as if it were the value of an s-maxage Cache-Control directive. Headers sent to the client will not be modified. Setting a TTL of "0" means "always revalidate". The maximum allowed value is 31,622,400s (1 year), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * + * Generated from protobuf field optional int32 max_ttl = 307578001; + * @param int $var + * @return $this + */ + public function setMaxTtl($var) + { + GPBUtil::checkInt32($var); + $this->max_ttl = $var; + + return $this; + } + + /** + * Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects. This can reduce the load on your origin and improve end-user experience by reducing response latency. When the cache mode is set to CACHE_ALL_STATIC or USE_ORIGIN_HEADERS, negative caching applies to responses with the specified response code that lack any Cache-Control, Expires, or Pragma: no-cache directives. When the cache mode is set to FORCE_CACHE_ALL, negative caching applies to all responses with the specified response code, and override any caching headers. By default, Cloud CDN will apply the following default TTLs to these status codes: HTTP 300 (Multiple Choice), 301, 308 (Permanent Redirects): 10m HTTP 404 (Not Found), 410 (Gone), 451 (Unavailable For Legal Reasons): 120s HTTP 405 (Method Not Found), 421 (Misdirected Request), 501 (Not Implemented): 60s. These defaults can be overridden in negative_caching_policy. + * + * Generated from protobuf field optional bool negative_caching = 336110005; + * @return bool + */ + public function getNegativeCaching() + { + return isset($this->negative_caching) ? $this->negative_caching : false; + } + + public function hasNegativeCaching() + { + return isset($this->negative_caching); + } + + public function clearNegativeCaching() + { + unset($this->negative_caching); + } + + /** + * Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects. This can reduce the load on your origin and improve end-user experience by reducing response latency. When the cache mode is set to CACHE_ALL_STATIC or USE_ORIGIN_HEADERS, negative caching applies to responses with the specified response code that lack any Cache-Control, Expires, or Pragma: no-cache directives. When the cache mode is set to FORCE_CACHE_ALL, negative caching applies to all responses with the specified response code, and override any caching headers. By default, Cloud CDN will apply the following default TTLs to these status codes: HTTP 300 (Multiple Choice), 301, 308 (Permanent Redirects): 10m HTTP 404 (Not Found), 410 (Gone), 451 (Unavailable For Legal Reasons): 120s HTTP 405 (Method Not Found), 421 (Misdirected Request), 501 (Not Implemented): 60s. These defaults can be overridden in negative_caching_policy. + * + * Generated from protobuf field optional bool negative_caching = 336110005; + * @param bool $var + * @return $this + */ + public function setNegativeCaching($var) + { + GPBUtil::checkBool($var); + $this->negative_caching = $var; + + return $this; + } + + /** + * Sets a cache TTL for the specified HTTP status code. negative_caching must be enabled to configure negative_caching_policy. Omitting the policy and leaving negative_caching enabled will use Cloud CDN's default cache TTLs. Note that when specifying an explicit negative_caching_policy, you should take care to specify a cache TTL for all response codes that you wish to cache. Cloud CDN will not apply any default negative caching when a policy exists. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy negative_caching_policy = 155359996; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNegativeCachingPolicy() + { + return $this->negative_caching_policy; + } + + /** + * Sets a cache TTL for the specified HTTP status code. negative_caching must be enabled to configure negative_caching_policy. Omitting the policy and leaving negative_caching enabled will use Cloud CDN's default cache TTLs. Note that when specifying an explicit negative_caching_policy, you should take care to specify a cache TTL for all response codes that you wish to cache. Cloud CDN will not apply any default negative caching when a policy exists. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy negative_caching_policy = 155359996; + * @param array<\Google\Cloud\Compute\V1\BackendServiceCdnPolicyNegativeCachingPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNegativeCachingPolicy($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\BackendServiceCdnPolicyNegativeCachingPolicy::class); + $this->negative_caching_policy = $arr; + + return $this; + } + + /** + * If true then Cloud CDN will combine multiple concurrent cache fill requests into a small number of requests to the origin. + * + * Generated from protobuf field optional bool request_coalescing = 532808276; + * @return bool + */ + public function getRequestCoalescing() + { + return isset($this->request_coalescing) ? $this->request_coalescing : false; + } + + public function hasRequestCoalescing() + { + return isset($this->request_coalescing); + } + + public function clearRequestCoalescing() + { + unset($this->request_coalescing); + } + + /** + * If true then Cloud CDN will combine multiple concurrent cache fill requests into a small number of requests to the origin. + * + * Generated from protobuf field optional bool request_coalescing = 532808276; + * @param bool $var + * @return $this + */ + public function setRequestCoalescing($var) + { + GPBUtil::checkBool($var); + $this->request_coalescing = $var; + + return $this; + } + + /** + * Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache. This setting defines the default "max-stale" duration for any cached responses that do not specify a max-stale directive. Stale responses that exceed the TTL configured here will not be served. The default limit (max-stale) is 86400s (1 day), which will allow stale content to be served up to this limit beyond the max-age (or s-max-age) of a cached response. The maximum allowed value is 604800 (1 week). Set this to zero (0) to disable serve-while-stale. + * + * Generated from protobuf field optional int32 serve_while_stale = 236682203; + * @return int + */ + public function getServeWhileStale() + { + return isset($this->serve_while_stale) ? $this->serve_while_stale : 0; + } + + public function hasServeWhileStale() + { + return isset($this->serve_while_stale); + } + + public function clearServeWhileStale() + { + unset($this->serve_while_stale); + } + + /** + * Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache. This setting defines the default "max-stale" duration for any cached responses that do not specify a max-stale directive. Stale responses that exceed the TTL configured here will not be served. The default limit (max-stale) is 86400s (1 day), which will allow stale content to be served up to this limit beyond the max-age (or s-max-age) of a cached response. The maximum allowed value is 604800 (1 week). Set this to zero (0) to disable serve-while-stale. + * + * Generated from protobuf field optional int32 serve_while_stale = 236682203; + * @param int $var + * @return $this + */ + public function setServeWhileStale($var) + { + GPBUtil::checkInt32($var); + $this->serve_while_stale = $var; + + return $this; + } + + /** + * Maximum number of seconds the response to a signed URL request will be considered fresh. After this time period, the response will be revalidated before being served. Defaults to 1hr (3600s). When serving responses to signed URL requests, Cloud CDN will internally behave as though all responses from this backend had a "Cache-Control: public, max-age=[TTL]" header, regardless of any existing Cache-Control header. The actual headers served in responses will not be altered. + * + * Generated from protobuf field optional int64 signed_url_cache_max_age_sec = 269374534; + * @return int|string + */ + public function getSignedUrlCacheMaxAgeSec() + { + return isset($this->signed_url_cache_max_age_sec) ? $this->signed_url_cache_max_age_sec : 0; + } + + public function hasSignedUrlCacheMaxAgeSec() + { + return isset($this->signed_url_cache_max_age_sec); + } + + public function clearSignedUrlCacheMaxAgeSec() + { + unset($this->signed_url_cache_max_age_sec); + } + + /** + * Maximum number of seconds the response to a signed URL request will be considered fresh. After this time period, the response will be revalidated before being served. Defaults to 1hr (3600s). When serving responses to signed URL requests, Cloud CDN will internally behave as though all responses from this backend had a "Cache-Control: public, max-age=[TTL]" header, regardless of any existing Cache-Control header. The actual headers served in responses will not be altered. + * + * Generated from protobuf field optional int64 signed_url_cache_max_age_sec = 269374534; + * @param int|string $var + * @return $this + */ + public function setSignedUrlCacheMaxAgeSec($var) + { + GPBUtil::checkInt64($var); + $this->signed_url_cache_max_age_sec = $var; + + return $this; + } + + /** + * [Output Only] Names of the keys for signing request URLs. + * + * Generated from protobuf field repeated string signed_url_key_names = 371848885; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSignedUrlKeyNames() + { + return $this->signed_url_key_names; + } + + /** + * [Output Only] Names of the keys for signing request URLs. + * + * Generated from protobuf field repeated string signed_url_key_names = 371848885; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSignedUrlKeyNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->signed_url_key_names = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceCdnPolicy/CacheMode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceCdnPolicy/CacheMode.php new file mode 100644 index 000000000000..4465ba508193 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceCdnPolicy/CacheMode.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.BackendServiceCdnPolicy.CacheMode + */ +class CacheMode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_CACHE_MODE = 0; + */ + const UNDEFINED_CACHE_MODE = 0; + /** + * Automatically cache static content, including common image formats, media (video and audio), and web assets (JavaScript and CSS). Requests and responses that are marked as uncacheable, as well as dynamic content (including HTML), will not be cached. + * + * Generated from protobuf enum CACHE_ALL_STATIC = 355027945; + */ + const CACHE_ALL_STATIC = 355027945; + /** + * Cache all content, ignoring any "private", "no-store" or "no-cache" directives in Cache-Control response headers. Warning: this may result in Cloud CDN caching private, per-user (user identifiable) content. + * + * Generated from protobuf enum FORCE_CACHE_ALL = 486026928; + */ + const FORCE_CACHE_ALL = 486026928; + /** + * Generated from protobuf enum INVALID_CACHE_MODE = 381295560; + */ + const INVALID_CACHE_MODE = 381295560; + /** + * Requires the origin to set valid caching headers to cache content. Responses without these headers will not be cached at Google's edge, and will require a full trip to the origin on every request, potentially impacting performance and increasing load on the origin server. + * + * Generated from protobuf enum USE_ORIGIN_HEADERS = 55380261; + */ + const USE_ORIGIN_HEADERS = 55380261; + + private static $valueToName = [ + self::UNDEFINED_CACHE_MODE => 'UNDEFINED_CACHE_MODE', + self::CACHE_ALL_STATIC => 'CACHE_ALL_STATIC', + self::FORCE_CACHE_ALL => 'FORCE_CACHE_ALL', + self::INVALID_CACHE_MODE => 'INVALID_CACHE_MODE', + self::USE_ORIGIN_HEADERS => 'USE_ORIGIN_HEADERS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CacheMode::class, \Google\Cloud\Compute\V1\BackendServiceCdnPolicy_CacheMode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceCdnPolicyBypassCacheOnRequestHeader.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceCdnPolicyBypassCacheOnRequestHeader.php new file mode 100644 index 000000000000..c47444b2c2b3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceCdnPolicyBypassCacheOnRequestHeader.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader + */ +class BackendServiceCdnPolicyBypassCacheOnRequestHeader extends \Google\Protobuf\Internal\Message +{ + /** + * The header field name to match on when bypassing cache. Values are case-insensitive. + * + * Generated from protobuf field optional string header_name = 110223613; + */ + protected $header_name = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $header_name + * The header field name to match on when bypassing cache. Values are case-insensitive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The header field name to match on when bypassing cache. Values are case-insensitive. + * + * Generated from protobuf field optional string header_name = 110223613; + * @return string + */ + public function getHeaderName() + { + return isset($this->header_name) ? $this->header_name : ''; + } + + public function hasHeaderName() + { + return isset($this->header_name); + } + + public function clearHeaderName() + { + unset($this->header_name); + } + + /** + * The header field name to match on when bypassing cache. Values are case-insensitive. + * + * Generated from protobuf field optional string header_name = 110223613; + * @param string $var + * @return $this + */ + public function setHeaderName($var) + { + GPBUtil::checkString($var, True); + $this->header_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceCdnPolicyNegativeCachingPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceCdnPolicyNegativeCachingPolicy.php new file mode 100644 index 000000000000..9a336afe5a4e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceCdnPolicyNegativeCachingPolicy.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy + */ +class BackendServiceCdnPolicyNegativeCachingPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * The HTTP status code to define a TTL against. Only HTTP status codes 300, 301, 302, 307, 308, 404, 405, 410, 421, 451 and 501 are can be specified as values, and you cannot specify a status code more than once. + * + * Generated from protobuf field optional int32 code = 3059181; + */ + protected $code = null; + /** + * The TTL (in seconds) for which to cache responses with the corresponding status code. The maximum allowed value is 1800s (30 minutes), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * + * Generated from protobuf field optional int32 ttl = 115180; + */ + protected $ttl = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $code + * The HTTP status code to define a TTL against. Only HTTP status codes 300, 301, 302, 307, 308, 404, 405, 410, 421, 451 and 501 are can be specified as values, and you cannot specify a status code more than once. + * @type int $ttl + * The TTL (in seconds) for which to cache responses with the corresponding status code. The maximum allowed value is 1800s (30 minutes), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The HTTP status code to define a TTL against. Only HTTP status codes 300, 301, 302, 307, 308, 404, 405, 410, 421, 451 and 501 are can be specified as values, and you cannot specify a status code more than once. + * + * Generated from protobuf field optional int32 code = 3059181; + * @return int + */ + public function getCode() + { + return isset($this->code) ? $this->code : 0; + } + + public function hasCode() + { + return isset($this->code); + } + + public function clearCode() + { + unset($this->code); + } + + /** + * The HTTP status code to define a TTL against. Only HTTP status codes 300, 301, 302, 307, 308, 404, 405, 410, 421, 451 and 501 are can be specified as values, and you cannot specify a status code more than once. + * + * Generated from protobuf field optional int32 code = 3059181; + * @param int $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkInt32($var); + $this->code = $var; + + return $this; + } + + /** + * The TTL (in seconds) for which to cache responses with the corresponding status code. The maximum allowed value is 1800s (30 minutes), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * + * Generated from protobuf field optional int32 ttl = 115180; + * @return int + */ + public function getTtl() + { + return isset($this->ttl) ? $this->ttl : 0; + } + + public function hasTtl() + { + return isset($this->ttl); + } + + public function clearTtl() + { + unset($this->ttl); + } + + /** + * The TTL (in seconds) for which to cache responses with the corresponding status code. The maximum allowed value is 1800s (30 minutes), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + * + * Generated from protobuf field optional int32 ttl = 115180; + * @param int $var + * @return $this + */ + public function setTtl($var) + { + GPBUtil::checkInt32($var); + $this->ttl = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceConnectionTrackingPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceConnectionTrackingPolicy.php new file mode 100644 index 000000000000..2512102d7135 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceConnectionTrackingPolicy.php @@ -0,0 +1,217 @@ +google.cloud.compute.v1.BackendServiceConnectionTrackingPolicy + */ +class BackendServiceConnectionTrackingPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies connection persistence when backends are unhealthy. The default value is DEFAULT_FOR_PROTOCOL. If set to DEFAULT_FOR_PROTOCOL, the existing connections persist on unhealthy backends only for connection-oriented protocols (TCP and SCTP) and only if the Tracking Mode is PER_CONNECTION (default tracking mode) or the Session Affinity is configured for 5-tuple. They do not persist for UDP. If set to NEVER_PERSIST, after a backend becomes unhealthy, the existing connections on the unhealthy backend are never persisted on the unhealthy backend. They are always diverted to newly selected healthy backends (unless all backends are unhealthy). If set to ALWAYS_PERSIST, existing connections always persist on unhealthy backends regardless of protocol and session affinity. It is generally not recommended to use this mode overriding the default. For more details, see [Connection Persistence for Network Load Balancing](https://cloud.google.com/load-balancing/docs/network/networklb-backend-service#connection-persistence) and [Connection Persistence for Internal TCP/UDP Load Balancing](https://cloud.google.com/load-balancing/docs/internal#connection-persistence). + * Check the ConnectionPersistenceOnUnhealthyBackends enum for the list of possible values. + * + * Generated from protobuf field optional string connection_persistence_on_unhealthy_backends = 152439033; + */ + protected $connection_persistence_on_unhealthy_backends = null; + /** + * Enable Strong Session Affinity for external passthrough Network Load Balancers. This option is not available publicly. + * + * Generated from protobuf field optional bool enable_strong_affinity = 24539924; + */ + protected $enable_strong_affinity = null; + /** + * Specifies how long to keep a Connection Tracking entry while there is no matching traffic (in seconds). For internal passthrough Network Load Balancers: - The minimum (default) is 10 minutes and the maximum is 16 hours. - It can be set only if Connection Tracking is less than 5-tuple (i.e. Session Affinity is CLIENT_IP_NO_DESTINATION, CLIENT_IP or CLIENT_IP_PROTO, and Tracking Mode is PER_SESSION). For external passthrough Network Load Balancers the default is 60 seconds. This option is not available publicly. + * + * Generated from protobuf field optional int32 idle_timeout_sec = 24977544; + */ + protected $idle_timeout_sec = null; + /** + * Specifies the key used for connection tracking. There are two options: - PER_CONNECTION: This is the default mode. The Connection Tracking is performed as per the Connection Key (default Hash Method) for the specific protocol. - PER_SESSION: The Connection Tracking is performed as per the configured Session Affinity. It matches the configured Session Affinity. For more details, see [Tracking Mode for Network Load Balancing](https://cloud.google.com/load-balancing/docs/network/networklb-backend-service#tracking-mode) and [Tracking Mode for Internal TCP/UDP Load Balancing](https://cloud.google.com/load-balancing/docs/internal#tracking-mode). + * Check the TrackingMode enum for the list of possible values. + * + * Generated from protobuf field optional string tracking_mode = 127757867; + */ + protected $tracking_mode = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $connection_persistence_on_unhealthy_backends + * Specifies connection persistence when backends are unhealthy. The default value is DEFAULT_FOR_PROTOCOL. If set to DEFAULT_FOR_PROTOCOL, the existing connections persist on unhealthy backends only for connection-oriented protocols (TCP and SCTP) and only if the Tracking Mode is PER_CONNECTION (default tracking mode) or the Session Affinity is configured for 5-tuple. They do not persist for UDP. If set to NEVER_PERSIST, after a backend becomes unhealthy, the existing connections on the unhealthy backend are never persisted on the unhealthy backend. They are always diverted to newly selected healthy backends (unless all backends are unhealthy). If set to ALWAYS_PERSIST, existing connections always persist on unhealthy backends regardless of protocol and session affinity. It is generally not recommended to use this mode overriding the default. For more details, see [Connection Persistence for Network Load Balancing](https://cloud.google.com/load-balancing/docs/network/networklb-backend-service#connection-persistence) and [Connection Persistence for Internal TCP/UDP Load Balancing](https://cloud.google.com/load-balancing/docs/internal#connection-persistence). + * Check the ConnectionPersistenceOnUnhealthyBackends enum for the list of possible values. + * @type bool $enable_strong_affinity + * Enable Strong Session Affinity for external passthrough Network Load Balancers. This option is not available publicly. + * @type int $idle_timeout_sec + * Specifies how long to keep a Connection Tracking entry while there is no matching traffic (in seconds). For internal passthrough Network Load Balancers: - The minimum (default) is 10 minutes and the maximum is 16 hours. - It can be set only if Connection Tracking is less than 5-tuple (i.e. Session Affinity is CLIENT_IP_NO_DESTINATION, CLIENT_IP or CLIENT_IP_PROTO, and Tracking Mode is PER_SESSION). For external passthrough Network Load Balancers the default is 60 seconds. This option is not available publicly. + * @type string $tracking_mode + * Specifies the key used for connection tracking. There are two options: - PER_CONNECTION: This is the default mode. The Connection Tracking is performed as per the Connection Key (default Hash Method) for the specific protocol. - PER_SESSION: The Connection Tracking is performed as per the configured Session Affinity. It matches the configured Session Affinity. For more details, see [Tracking Mode for Network Load Balancing](https://cloud.google.com/load-balancing/docs/network/networklb-backend-service#tracking-mode) and [Tracking Mode for Internal TCP/UDP Load Balancing](https://cloud.google.com/load-balancing/docs/internal#tracking-mode). + * Check the TrackingMode enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies connection persistence when backends are unhealthy. The default value is DEFAULT_FOR_PROTOCOL. If set to DEFAULT_FOR_PROTOCOL, the existing connections persist on unhealthy backends only for connection-oriented protocols (TCP and SCTP) and only if the Tracking Mode is PER_CONNECTION (default tracking mode) or the Session Affinity is configured for 5-tuple. They do not persist for UDP. If set to NEVER_PERSIST, after a backend becomes unhealthy, the existing connections on the unhealthy backend are never persisted on the unhealthy backend. They are always diverted to newly selected healthy backends (unless all backends are unhealthy). If set to ALWAYS_PERSIST, existing connections always persist on unhealthy backends regardless of protocol and session affinity. It is generally not recommended to use this mode overriding the default. For more details, see [Connection Persistence for Network Load Balancing](https://cloud.google.com/load-balancing/docs/network/networklb-backend-service#connection-persistence) and [Connection Persistence for Internal TCP/UDP Load Balancing](https://cloud.google.com/load-balancing/docs/internal#connection-persistence). + * Check the ConnectionPersistenceOnUnhealthyBackends enum for the list of possible values. + * + * Generated from protobuf field optional string connection_persistence_on_unhealthy_backends = 152439033; + * @return string + */ + public function getConnectionPersistenceOnUnhealthyBackends() + { + return isset($this->connection_persistence_on_unhealthy_backends) ? $this->connection_persistence_on_unhealthy_backends : ''; + } + + public function hasConnectionPersistenceOnUnhealthyBackends() + { + return isset($this->connection_persistence_on_unhealthy_backends); + } + + public function clearConnectionPersistenceOnUnhealthyBackends() + { + unset($this->connection_persistence_on_unhealthy_backends); + } + + /** + * Specifies connection persistence when backends are unhealthy. The default value is DEFAULT_FOR_PROTOCOL. If set to DEFAULT_FOR_PROTOCOL, the existing connections persist on unhealthy backends only for connection-oriented protocols (TCP and SCTP) and only if the Tracking Mode is PER_CONNECTION (default tracking mode) or the Session Affinity is configured for 5-tuple. They do not persist for UDP. If set to NEVER_PERSIST, after a backend becomes unhealthy, the existing connections on the unhealthy backend are never persisted on the unhealthy backend. They are always diverted to newly selected healthy backends (unless all backends are unhealthy). If set to ALWAYS_PERSIST, existing connections always persist on unhealthy backends regardless of protocol and session affinity. It is generally not recommended to use this mode overriding the default. For more details, see [Connection Persistence for Network Load Balancing](https://cloud.google.com/load-balancing/docs/network/networklb-backend-service#connection-persistence) and [Connection Persistence for Internal TCP/UDP Load Balancing](https://cloud.google.com/load-balancing/docs/internal#connection-persistence). + * Check the ConnectionPersistenceOnUnhealthyBackends enum for the list of possible values. + * + * Generated from protobuf field optional string connection_persistence_on_unhealthy_backends = 152439033; + * @param string $var + * @return $this + */ + public function setConnectionPersistenceOnUnhealthyBackends($var) + { + GPBUtil::checkString($var, True); + $this->connection_persistence_on_unhealthy_backends = $var; + + return $this; + } + + /** + * Enable Strong Session Affinity for external passthrough Network Load Balancers. This option is not available publicly. + * + * Generated from protobuf field optional bool enable_strong_affinity = 24539924; + * @return bool + */ + public function getEnableStrongAffinity() + { + return isset($this->enable_strong_affinity) ? $this->enable_strong_affinity : false; + } + + public function hasEnableStrongAffinity() + { + return isset($this->enable_strong_affinity); + } + + public function clearEnableStrongAffinity() + { + unset($this->enable_strong_affinity); + } + + /** + * Enable Strong Session Affinity for external passthrough Network Load Balancers. This option is not available publicly. + * + * Generated from protobuf field optional bool enable_strong_affinity = 24539924; + * @param bool $var + * @return $this + */ + public function setEnableStrongAffinity($var) + { + GPBUtil::checkBool($var); + $this->enable_strong_affinity = $var; + + return $this; + } + + /** + * Specifies how long to keep a Connection Tracking entry while there is no matching traffic (in seconds). For internal passthrough Network Load Balancers: - The minimum (default) is 10 minutes and the maximum is 16 hours. - It can be set only if Connection Tracking is less than 5-tuple (i.e. Session Affinity is CLIENT_IP_NO_DESTINATION, CLIENT_IP or CLIENT_IP_PROTO, and Tracking Mode is PER_SESSION). For external passthrough Network Load Balancers the default is 60 seconds. This option is not available publicly. + * + * Generated from protobuf field optional int32 idle_timeout_sec = 24977544; + * @return int + */ + public function getIdleTimeoutSec() + { + return isset($this->idle_timeout_sec) ? $this->idle_timeout_sec : 0; + } + + public function hasIdleTimeoutSec() + { + return isset($this->idle_timeout_sec); + } + + public function clearIdleTimeoutSec() + { + unset($this->idle_timeout_sec); + } + + /** + * Specifies how long to keep a Connection Tracking entry while there is no matching traffic (in seconds). For internal passthrough Network Load Balancers: - The minimum (default) is 10 minutes and the maximum is 16 hours. - It can be set only if Connection Tracking is less than 5-tuple (i.e. Session Affinity is CLIENT_IP_NO_DESTINATION, CLIENT_IP or CLIENT_IP_PROTO, and Tracking Mode is PER_SESSION). For external passthrough Network Load Balancers the default is 60 seconds. This option is not available publicly. + * + * Generated from protobuf field optional int32 idle_timeout_sec = 24977544; + * @param int $var + * @return $this + */ + public function setIdleTimeoutSec($var) + { + GPBUtil::checkInt32($var); + $this->idle_timeout_sec = $var; + + return $this; + } + + /** + * Specifies the key used for connection tracking. There are two options: - PER_CONNECTION: This is the default mode. The Connection Tracking is performed as per the Connection Key (default Hash Method) for the specific protocol. - PER_SESSION: The Connection Tracking is performed as per the configured Session Affinity. It matches the configured Session Affinity. For more details, see [Tracking Mode for Network Load Balancing](https://cloud.google.com/load-balancing/docs/network/networklb-backend-service#tracking-mode) and [Tracking Mode for Internal TCP/UDP Load Balancing](https://cloud.google.com/load-balancing/docs/internal#tracking-mode). + * Check the TrackingMode enum for the list of possible values. + * + * Generated from protobuf field optional string tracking_mode = 127757867; + * @return string + */ + public function getTrackingMode() + { + return isset($this->tracking_mode) ? $this->tracking_mode : ''; + } + + public function hasTrackingMode() + { + return isset($this->tracking_mode); + } + + public function clearTrackingMode() + { + unset($this->tracking_mode); + } + + /** + * Specifies the key used for connection tracking. There are two options: - PER_CONNECTION: This is the default mode. The Connection Tracking is performed as per the Connection Key (default Hash Method) for the specific protocol. - PER_SESSION: The Connection Tracking is performed as per the configured Session Affinity. It matches the configured Session Affinity. For more details, see [Tracking Mode for Network Load Balancing](https://cloud.google.com/load-balancing/docs/network/networklb-backend-service#tracking-mode) and [Tracking Mode for Internal TCP/UDP Load Balancing](https://cloud.google.com/load-balancing/docs/internal#tracking-mode). + * Check the TrackingMode enum for the list of possible values. + * + * Generated from protobuf field optional string tracking_mode = 127757867; + * @param string $var + * @return $this + */ + public function setTrackingMode($var) + { + GPBUtil::checkString($var, True); + $this->tracking_mode = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceConnectionTrackingPolicy/ConnectionPersistenceOnUnhealthyBackends.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceConnectionTrackingPolicy/ConnectionPersistenceOnUnhealthyBackends.php new file mode 100644 index 000000000000..1bb27326a9d8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceConnectionTrackingPolicy/ConnectionPersistenceOnUnhealthyBackends.php @@ -0,0 +1,65 @@ +google.cloud.compute.v1.BackendServiceConnectionTrackingPolicy.ConnectionPersistenceOnUnhealthyBackends + */ +class ConnectionPersistenceOnUnhealthyBackends +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_CONNECTION_PERSISTENCE_ON_UNHEALTHY_BACKENDS = 0; + */ + const UNDEFINED_CONNECTION_PERSISTENCE_ON_UNHEALTHY_BACKENDS = 0; + /** + * Generated from protobuf enum ALWAYS_PERSIST = 38400900; + */ + const ALWAYS_PERSIST = 38400900; + /** + * Generated from protobuf enum DEFAULT_FOR_PROTOCOL = 145265356; + */ + const DEFAULT_FOR_PROTOCOL = 145265356; + /** + * Generated from protobuf enum NEVER_PERSIST = 138646241; + */ + const NEVER_PERSIST = 138646241; + + private static $valueToName = [ + self::UNDEFINED_CONNECTION_PERSISTENCE_ON_UNHEALTHY_BACKENDS => 'UNDEFINED_CONNECTION_PERSISTENCE_ON_UNHEALTHY_BACKENDS', + self::ALWAYS_PERSIST => 'ALWAYS_PERSIST', + self::DEFAULT_FOR_PROTOCOL => 'DEFAULT_FOR_PROTOCOL', + self::NEVER_PERSIST => 'NEVER_PERSIST', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConnectionPersistenceOnUnhealthyBackends::class, \Google\Cloud\Compute\V1\BackendServiceConnectionTrackingPolicy_ConnectionPersistenceOnUnhealthyBackends::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceConnectionTrackingPolicy/TrackingMode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceConnectionTrackingPolicy/TrackingMode.php new file mode 100644 index 000000000000..21d568ec513b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceConnectionTrackingPolicy/TrackingMode.php @@ -0,0 +1,65 @@ +google.cloud.compute.v1.BackendServiceConnectionTrackingPolicy.TrackingMode + */ +class TrackingMode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TRACKING_MODE = 0; + */ + const UNDEFINED_TRACKING_MODE = 0; + /** + * Generated from protobuf enum INVALID_TRACKING_MODE = 49234371; + */ + const INVALID_TRACKING_MODE = 49234371; + /** + * Generated from protobuf enum PER_CONNECTION = 85162848; + */ + const PER_CONNECTION = 85162848; + /** + * Generated from protobuf enum PER_SESSION = 182099252; + */ + const PER_SESSION = 182099252; + + private static $valueToName = [ + self::UNDEFINED_TRACKING_MODE => 'UNDEFINED_TRACKING_MODE', + self::INVALID_TRACKING_MODE => 'INVALID_TRACKING_MODE', + self::PER_CONNECTION => 'PER_CONNECTION', + self::PER_SESSION => 'PER_SESSION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TrackingMode::class, \Google\Cloud\Compute\V1\BackendServiceConnectionTrackingPolicy_TrackingMode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceFailoverPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceFailoverPolicy.php new file mode 100644 index 000000000000..eedf9d113150 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceFailoverPolicy.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.BackendServiceFailoverPolicy + */ +class BackendServiceFailoverPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * This can be set to true only if the protocol is TCP. The default is false. + * + * Generated from protobuf field optional bool disable_connection_drain_on_failover = 182150753; + */ + protected $disable_connection_drain_on_failover = null; + /** + * If set to true, connections to the load balancer are dropped when all primary and all backup backend VMs are unhealthy.If set to false, connections are distributed among all primary VMs when all primary and all backup backend VMs are unhealthy. For load balancers that have configurable failover: [Internal passthrough Network Load Balancers](https://cloud.google.com/load-balancing/docs/internal/failover-overview) and [external passthrough Network Load Balancers](https://cloud.google.com/load-balancing/docs/network/networklb-failover-overview). The default is false. + * + * Generated from protobuf field optional bool drop_traffic_if_unhealthy = 112289428; + */ + protected $drop_traffic_if_unhealthy = null; + /** + * The value of the field must be in the range [0, 1]. If the value is 0, the load balancer performs a failover when the number of healthy primary VMs equals zero. For all other values, the load balancer performs a failover when the total number of healthy primary VMs is less than this ratio. For load balancers that have configurable failover: [Internal TCP/UDP Load Balancing](https://cloud.google.com/load-balancing/docs/internal/failover-overview) and [external TCP/UDP Load Balancing](https://cloud.google.com/load-balancing/docs/network/networklb-failover-overview). + * + * Generated from protobuf field optional float failover_ratio = 212667006; + */ + protected $failover_ratio = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $disable_connection_drain_on_failover + * This can be set to true only if the protocol is TCP. The default is false. + * @type bool $drop_traffic_if_unhealthy + * If set to true, connections to the load balancer are dropped when all primary and all backup backend VMs are unhealthy.If set to false, connections are distributed among all primary VMs when all primary and all backup backend VMs are unhealthy. For load balancers that have configurable failover: [Internal passthrough Network Load Balancers](https://cloud.google.com/load-balancing/docs/internal/failover-overview) and [external passthrough Network Load Balancers](https://cloud.google.com/load-balancing/docs/network/networklb-failover-overview). The default is false. + * @type float $failover_ratio + * The value of the field must be in the range [0, 1]. If the value is 0, the load balancer performs a failover when the number of healthy primary VMs equals zero. For all other values, the load balancer performs a failover when the total number of healthy primary VMs is less than this ratio. For load balancers that have configurable failover: [Internal TCP/UDP Load Balancing](https://cloud.google.com/load-balancing/docs/internal/failover-overview) and [external TCP/UDP Load Balancing](https://cloud.google.com/load-balancing/docs/network/networklb-failover-overview). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * This can be set to true only if the protocol is TCP. The default is false. + * + * Generated from protobuf field optional bool disable_connection_drain_on_failover = 182150753; + * @return bool + */ + public function getDisableConnectionDrainOnFailover() + { + return isset($this->disable_connection_drain_on_failover) ? $this->disable_connection_drain_on_failover : false; + } + + public function hasDisableConnectionDrainOnFailover() + { + return isset($this->disable_connection_drain_on_failover); + } + + public function clearDisableConnectionDrainOnFailover() + { + unset($this->disable_connection_drain_on_failover); + } + + /** + * This can be set to true only if the protocol is TCP. The default is false. + * + * Generated from protobuf field optional bool disable_connection_drain_on_failover = 182150753; + * @param bool $var + * @return $this + */ + public function setDisableConnectionDrainOnFailover($var) + { + GPBUtil::checkBool($var); + $this->disable_connection_drain_on_failover = $var; + + return $this; + } + + /** + * If set to true, connections to the load balancer are dropped when all primary and all backup backend VMs are unhealthy.If set to false, connections are distributed among all primary VMs when all primary and all backup backend VMs are unhealthy. For load balancers that have configurable failover: [Internal passthrough Network Load Balancers](https://cloud.google.com/load-balancing/docs/internal/failover-overview) and [external passthrough Network Load Balancers](https://cloud.google.com/load-balancing/docs/network/networklb-failover-overview). The default is false. + * + * Generated from protobuf field optional bool drop_traffic_if_unhealthy = 112289428; + * @return bool + */ + public function getDropTrafficIfUnhealthy() + { + return isset($this->drop_traffic_if_unhealthy) ? $this->drop_traffic_if_unhealthy : false; + } + + public function hasDropTrafficIfUnhealthy() + { + return isset($this->drop_traffic_if_unhealthy); + } + + public function clearDropTrafficIfUnhealthy() + { + unset($this->drop_traffic_if_unhealthy); + } + + /** + * If set to true, connections to the load balancer are dropped when all primary and all backup backend VMs are unhealthy.If set to false, connections are distributed among all primary VMs when all primary and all backup backend VMs are unhealthy. For load balancers that have configurable failover: [Internal passthrough Network Load Balancers](https://cloud.google.com/load-balancing/docs/internal/failover-overview) and [external passthrough Network Load Balancers](https://cloud.google.com/load-balancing/docs/network/networklb-failover-overview). The default is false. + * + * Generated from protobuf field optional bool drop_traffic_if_unhealthy = 112289428; + * @param bool $var + * @return $this + */ + public function setDropTrafficIfUnhealthy($var) + { + GPBUtil::checkBool($var); + $this->drop_traffic_if_unhealthy = $var; + + return $this; + } + + /** + * The value of the field must be in the range [0, 1]. If the value is 0, the load balancer performs a failover when the number of healthy primary VMs equals zero. For all other values, the load balancer performs a failover when the total number of healthy primary VMs is less than this ratio. For load balancers that have configurable failover: [Internal TCP/UDP Load Balancing](https://cloud.google.com/load-balancing/docs/internal/failover-overview) and [external TCP/UDP Load Balancing](https://cloud.google.com/load-balancing/docs/network/networklb-failover-overview). + * + * Generated from protobuf field optional float failover_ratio = 212667006; + * @return float + */ + public function getFailoverRatio() + { + return isset($this->failover_ratio) ? $this->failover_ratio : 0.0; + } + + public function hasFailoverRatio() + { + return isset($this->failover_ratio); + } + + public function clearFailoverRatio() + { + unset($this->failover_ratio); + } + + /** + * The value of the field must be in the range [0, 1]. If the value is 0, the load balancer performs a failover when the number of healthy primary VMs equals zero. For all other values, the load balancer performs a failover when the total number of healthy primary VMs is less than this ratio. For load balancers that have configurable failover: [Internal TCP/UDP Load Balancing](https://cloud.google.com/load-balancing/docs/internal/failover-overview) and [external TCP/UDP Load Balancing](https://cloud.google.com/load-balancing/docs/network/networklb-failover-overview). + * + * Generated from protobuf field optional float failover_ratio = 212667006; + * @param float $var + * @return $this + */ + public function setFailoverRatio($var) + { + GPBUtil::checkFloat($var); + $this->failover_ratio = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceGroupHealth.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceGroupHealth.php new file mode 100644 index 000000000000..55d0c4c92fd4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceGroupHealth.php @@ -0,0 +1,144 @@ +google.cloud.compute.v1.BackendServiceGroupHealth + */ +class BackendServiceGroupHealth extends \Google\Protobuf\Internal\Message +{ + /** + * Metadata defined as annotations on the network endpoint group. + * + * Generated from protobuf field map annotations = 112032548; + */ + private $annotations; + /** + * Health state of the backend instances or endpoints in requested instance or network endpoint group, determined based on configured health checks. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthStatus health_status = 380545845; + */ + private $health_status; + /** + * [Output Only] Type of resource. Always compute#backendServiceGroupHealth for the health of backend services. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Metadata defined as annotations on the network endpoint group. + * @type array<\Google\Cloud\Compute\V1\HealthStatus>|\Google\Protobuf\Internal\RepeatedField $health_status + * Health state of the backend instances or endpoints in requested instance or network endpoint group, determined based on configured health checks. + * @type string $kind + * [Output Only] Type of resource. Always compute#backendServiceGroupHealth for the health of backend services. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Metadata defined as annotations on the network endpoint group. + * + * Generated from protobuf field map annotations = 112032548; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Metadata defined as annotations on the network endpoint group. + * + * Generated from protobuf field map annotations = 112032548; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Health state of the backend instances or endpoints in requested instance or network endpoint group, determined based on configured health checks. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthStatus health_status = 380545845; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHealthStatus() + { + return $this->health_status; + } + + /** + * Health state of the backend instances or endpoints in requested instance or network endpoint group, determined based on configured health checks. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthStatus health_status = 380545845; + * @param array<\Google\Cloud\Compute\V1\HealthStatus>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHealthStatus($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\HealthStatus::class); + $this->health_status = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#backendServiceGroupHealth for the health of backend services. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#backendServiceGroupHealth for the health of backend services. + * + * 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceIAP.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceIAP.php new file mode 100644 index 000000000000..025a9a5ac8d5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceIAP.php @@ -0,0 +1,209 @@ +google.cloud.compute.v1.BackendServiceIAP + */ +class BackendServiceIAP extends \Google\Protobuf\Internal\Message +{ + /** + * Whether the serving infrastructure will authenticate and authorize all incoming requests. + * + * Generated from protobuf field optional bool enabled = 1018689; + */ + protected $enabled = null; + /** + * OAuth2 client ID to use for the authentication flow. + * + * Generated from protobuf field optional string oauth2_client_id = 314017611; + */ + protected $oauth2_client_id = null; + /** + * OAuth2 client secret to use for the authentication flow. For security reasons, this value cannot be retrieved via the API. Instead, the SHA-256 hash of the value is returned in the oauth2ClientSecretSha256 field. @InputOnly + * + * Generated from protobuf field optional string oauth2_client_secret = 50999520; + */ + protected $oauth2_client_secret = null; + /** + * [Output Only] SHA256 hash value for the field oauth2_client_secret above. + * + * Generated from protobuf field optional string oauth2_client_secret_sha256 = 112903782; + */ + protected $oauth2_client_secret_sha256 = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enabled + * Whether the serving infrastructure will authenticate and authorize all incoming requests. + * @type string $oauth2_client_id + * OAuth2 client ID to use for the authentication flow. + * @type string $oauth2_client_secret + * OAuth2 client secret to use for the authentication flow. For security reasons, this value cannot be retrieved via the API. Instead, the SHA-256 hash of the value is returned in the oauth2ClientSecretSha256 field. @InputOnly + * @type string $oauth2_client_secret_sha256 + * [Output Only] SHA256 hash value for the field oauth2_client_secret above. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Whether the serving infrastructure will authenticate and authorize all incoming requests. + * + * Generated from protobuf field optional bool enabled = 1018689; + * @return bool + */ + public function getEnabled() + { + return isset($this->enabled) ? $this->enabled : false; + } + + public function hasEnabled() + { + return isset($this->enabled); + } + + public function clearEnabled() + { + unset($this->enabled); + } + + /** + * Whether the serving infrastructure will authenticate and authorize all incoming requests. + * + * Generated from protobuf field optional bool enabled = 1018689; + * @param bool $var + * @return $this + */ + public function setEnabled($var) + { + GPBUtil::checkBool($var); + $this->enabled = $var; + + return $this; + } + + /** + * OAuth2 client ID to use for the authentication flow. + * + * Generated from protobuf field optional string oauth2_client_id = 314017611; + * @return string + */ + public function getOauth2ClientId() + { + return isset($this->oauth2_client_id) ? $this->oauth2_client_id : ''; + } + + public function hasOauth2ClientId() + { + return isset($this->oauth2_client_id); + } + + public function clearOauth2ClientId() + { + unset($this->oauth2_client_id); + } + + /** + * OAuth2 client ID to use for the authentication flow. + * + * Generated from protobuf field optional string oauth2_client_id = 314017611; + * @param string $var + * @return $this + */ + public function setOauth2ClientId($var) + { + GPBUtil::checkString($var, True); + $this->oauth2_client_id = $var; + + return $this; + } + + /** + * OAuth2 client secret to use for the authentication flow. For security reasons, this value cannot be retrieved via the API. Instead, the SHA-256 hash of the value is returned in the oauth2ClientSecretSha256 field. @InputOnly + * + * Generated from protobuf field optional string oauth2_client_secret = 50999520; + * @return string + */ + public function getOauth2ClientSecret() + { + return isset($this->oauth2_client_secret) ? $this->oauth2_client_secret : ''; + } + + public function hasOauth2ClientSecret() + { + return isset($this->oauth2_client_secret); + } + + public function clearOauth2ClientSecret() + { + unset($this->oauth2_client_secret); + } + + /** + * OAuth2 client secret to use for the authentication flow. For security reasons, this value cannot be retrieved via the API. Instead, the SHA-256 hash of the value is returned in the oauth2ClientSecretSha256 field. @InputOnly + * + * Generated from protobuf field optional string oauth2_client_secret = 50999520; + * @param string $var + * @return $this + */ + public function setOauth2ClientSecret($var) + { + GPBUtil::checkString($var, True); + $this->oauth2_client_secret = $var; + + return $this; + } + + /** + * [Output Only] SHA256 hash value for the field oauth2_client_secret above. + * + * Generated from protobuf field optional string oauth2_client_secret_sha256 = 112903782; + * @return string + */ + public function getOauth2ClientSecretSha256() + { + return isset($this->oauth2_client_secret_sha256) ? $this->oauth2_client_secret_sha256 : ''; + } + + public function hasOauth2ClientSecretSha256() + { + return isset($this->oauth2_client_secret_sha256); + } + + public function clearOauth2ClientSecretSha256() + { + unset($this->oauth2_client_secret_sha256); + } + + /** + * [Output Only] SHA256 hash value for the field oauth2_client_secret above. + * + * Generated from protobuf field optional string oauth2_client_secret_sha256 = 112903782; + * @param string $var + * @return $this + */ + public function setOauth2ClientSecretSha256($var) + { + GPBUtil::checkString($var, True); + $this->oauth2_client_secret_sha256 = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceList.php new file mode 100644 index 000000000000..3cda4ee81652 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.BackendServiceList + */ +class BackendServiceList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of BackendService resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendService items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#backendServiceList for lists of backend services. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\BackendService>|\Google\Protobuf\Internal\RepeatedField $items + * A list of BackendService resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#backendServiceList for lists of backend services. + * @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 BackendService resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendService items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of BackendService resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendService items = 100526016; + * @param array<\Google\Cloud\Compute\V1\BackendService>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\BackendService::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#backendServiceList for lists of backend services. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#backendServiceList for lists of backend services. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceListUsable.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceListUsable.php new file mode 100644 index 000000000000..3cc7c05f4e11 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceListUsable.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.BackendServiceListUsable + */ +class BackendServiceListUsable extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of BackendService resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendService items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#usableBackendServiceList for lists of usable backend services. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\BackendService>|\Google\Protobuf\Internal\RepeatedField $items + * A list of BackendService resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#usableBackendServiceList for lists of usable backend services. + * @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 BackendService resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendService items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of BackendService resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendService items = 100526016; + * @param array<\Google\Cloud\Compute\V1\BackendService>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\BackendService::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#usableBackendServiceList for lists of usable backend services. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#usableBackendServiceList for lists of usable backend services. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLocalityLoadBalancingPolicyConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLocalityLoadBalancingPolicyConfig.php new file mode 100644 index 000000000000..bbf1f1c9ebe0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLocalityLoadBalancingPolicyConfig.php @@ -0,0 +1,107 @@ +google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfig + */ +class BackendServiceLocalityLoadBalancingPolicyConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy custom_policy = 4818368; + */ + protected $custom_policy = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfigPolicy policy = 91071794; + */ + protected $policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy $custom_policy + * @type \Google\Cloud\Compute\V1\BackendServiceLocalityLoadBalancingPolicyConfigPolicy $policy + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy custom_policy = 4818368; + * @return \Google\Cloud\Compute\V1\BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy|null + */ + public function getCustomPolicy() + { + return $this->custom_policy; + } + + public function hasCustomPolicy() + { + return isset($this->custom_policy); + } + + public function clearCustomPolicy() + { + unset($this->custom_policy); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy custom_policy = 4818368; + * @param \Google\Cloud\Compute\V1\BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy $var + * @return $this + */ + public function setCustomPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy::class); + $this->custom_policy = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfigPolicy policy = 91071794; + * @return \Google\Cloud\Compute\V1\BackendServiceLocalityLoadBalancingPolicyConfigPolicy|null + */ + public function getPolicy() + { + return $this->policy; + } + + public function hasPolicy() + { + return isset($this->policy); + } + + public function clearPolicy() + { + unset($this->policy); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfigPolicy policy = 91071794; + * @param \Google\Cloud\Compute\V1\BackendServiceLocalityLoadBalancingPolicyConfigPolicy $var + * @return $this + */ + public function setPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BackendServiceLocalityLoadBalancingPolicyConfigPolicy::class); + $this->policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy.php new file mode 100644 index 000000000000..d3e4339a3dde --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy + */ +class BackendServiceLocalityLoadBalancingPolicyConfigCustomPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * An optional, arbitrary JSON object with configuration data, understood by a locally installed custom policy implementation. + * + * Generated from protobuf field optional string data = 3076010; + */ + protected $data = null; + /** + * 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; + */ + protected $name = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 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) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * An optional, arbitrary JSON object with configuration data, understood by a locally installed custom policy implementation. + * + * Generated from protobuf field optional string data = 3076010; + * @return string + */ + public function getData() + { + return isset($this->data) ? $this->data : ''; + } + + public function hasData() + { + return isset($this->data); + } + + public function clearData() + { + unset($this->data); + } + + /** + * An optional, arbitrary JSON object with configuration data, understood by a locally installed custom policy implementation. + * + * Generated from protobuf field optional string data = 3076010; + * @param string $var + * @return $this + */ + public function setData($var) + { + GPBUtil::checkString($var, True); + $this->data = $var; + + return $this; + } + + /** + * 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 + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * 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 + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLocalityLoadBalancingPolicyConfigPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLocalityLoadBalancingPolicyConfigPolicy.php new file mode 100644 index 000000000000..11d2d4197429 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLocalityLoadBalancingPolicyConfigPolicy.php @@ -0,0 +1,81 @@ +google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfigPolicy + */ +class BackendServiceLocalityLoadBalancingPolicyConfigPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * 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; + */ + protected $name = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * 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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + * @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 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; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLocalityLoadBalancingPolicyConfigPolicy/Name.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLocalityLoadBalancingPolicyConfigPolicy/Name.php new file mode 100644 index 000000000000..0c806d1b76e5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLocalityLoadBalancingPolicyConfigPolicy/Name.php @@ -0,0 +1,104 @@ +google.cloud.compute.v1.BackendServiceLocalityLoadBalancingPolicyConfigPolicy.Name + */ +class Name +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_NAME = 0; + */ + const UNDEFINED_NAME = 0; + /** + * Generated from protobuf enum INVALID_LB_POLICY = 323318707; + */ + const INVALID_LB_POLICY = 323318707; + /** + * An O(1) algorithm which selects two random healthy hosts and picks the host which has fewer active requests. + * + * Generated from protobuf enum LEAST_REQUEST = 46604921; + */ + const LEAST_REQUEST = 46604921; + /** + * This algorithm implements consistent hashing to backends. Maglev can be 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 + * + * Generated from protobuf enum MAGLEV = 119180266; + */ + const MAGLEV = 119180266; + /** + * 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. + * + * Generated from protobuf enum ORIGINAL_DESTINATION = 166297216; + */ + const ORIGINAL_DESTINATION = 166297216; + /** + * The load balancer selects a random healthy host. + * + * Generated from protobuf enum RANDOM = 262527171; + */ + const RANDOM = 262527171; + /** + * 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. + * + * Generated from protobuf enum RING_HASH = 432795069; + */ + const RING_HASH = 432795069; + /** + * This is a simple policy in which each healthy backend is selected in round robin order. This is the default. + * + * 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', + self::INVALID_LB_POLICY => 'INVALID_LB_POLICY', + self::LEAST_REQUEST => 'LEAST_REQUEST', + self::MAGLEV => 'MAGLEV', + self::ORIGINAL_DESTINATION => 'ORIGINAL_DESTINATION', + self::RANDOM => 'RANDOM', + self::RING_HASH => 'RING_HASH', + self::ROUND_ROBIN => 'ROUND_ROBIN', + self::WEIGHTED_MAGLEV => 'WEIGHTED_MAGLEV', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Name::class, \Google\Cloud\Compute\V1\BackendServiceLocalityLoadBalancingPolicyConfigPolicy_Name::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLogConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLogConfig.php new file mode 100644 index 000000000000..fd676ea5fa12 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLogConfig.php @@ -0,0 +1,203 @@ +google.cloud.compute.v1.BackendServiceLogConfig + */ +class BackendServiceLogConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Denotes whether to enable logging for the load balancer traffic served by this backend service. The default value is false. + * + * Generated from protobuf field optional bool enable = 311764355; + */ + protected $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; + */ + protected $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. + * + * Generated from protobuf field optional float sample_rate = 153193045; + */ + protected $sample_rate = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Denotes whether to enable logging for the load balancer traffic served by this backend service. The default value is false. + * + * Generated from protobuf field optional bool enable = 311764355; + * @return bool + */ + public function getEnable() + { + return isset($this->enable) ? $this->enable : false; + } + + public function hasEnable() + { + return isset($this->enable); + } + + public function clearEnable() + { + unset($this->enable); + } + + /** + * Denotes whether to enable logging for the load balancer traffic served by this backend service. The default value is false. + * + * Generated from protobuf field optional bool enable = 311764355; + * @param bool $var + * @return $this + */ + public function setEnable($var) + { + GPBUtil::checkBool($var); + $this->enable = $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. + * + * Generated from protobuf field optional float sample_rate = 153193045; + * @return float + */ + public function getSampleRate() + { + return isset($this->sample_rate) ? $this->sample_rate : 0.0; + } + + public function hasSampleRate() + { + return isset($this->sample_rate); + } + + public function clearSampleRate() + { + unset($this->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. + * + * Generated from protobuf field optional float sample_rate = 153193045; + * @param float $var + * @return $this + */ + public function setSampleRate($var) + { + GPBUtil::checkFloat($var); + $this->sample_rate = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLogConfig/OptionalMode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLogConfig/OptionalMode.php new file mode 100644 index 000000000000..b75137bc7100 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceLogConfig/OptionalMode.php @@ -0,0 +1,71 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(OptionalMode::class, \Google\Cloud\Compute\V1\BackendServiceLogConfig_OptionalMode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceReference.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceReference.php new file mode 100644 index 000000000000..26fe43a2a0a1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceReference.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.BackendServiceReference + */ +class BackendServiceReference extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string backend_service = 306946058; + */ + protected $backend_service = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_service + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string backend_service = 306946058; + * @return string + */ + public function getBackendService() + { + return isset($this->backend_service) ? $this->backend_service : ''; + } + + public function hasBackendService() + { + return isset($this->backend_service); + } + + public function clearBackendService() + { + unset($this->backend_service); + } + + /** + * Generated from protobuf field optional string backend_service = 306946058; + * @param string $var + * @return $this + */ + public function setBackendService($var) + { + GPBUtil::checkString($var, True); + $this->backend_service = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceUsedBy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceUsedBy.php new file mode 100644 index 000000000000..2828b8298983 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceUsedBy.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.BackendServiceUsedBy + */ +class BackendServiceUsedBy extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string reference = 148586315; + */ + protected $reference = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $reference + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string reference = 148586315; + * @return string + */ + public function getReference() + { + return isset($this->reference) ? $this->reference : ''; + } + + public function hasReference() + { + return isset($this->reference); + } + + public function clearReference() + { + unset($this->reference); + } + + /** + * Generated from protobuf field optional string reference = 148586315; + * @param string $var + * @return $this + */ + public function setReference($var) + { + GPBUtil::checkString($var, True); + $this->reference = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServicesScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServicesScopedList.php new file mode 100644 index 000000000000..103c1da93f9c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServicesScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.BackendServicesScopedList + */ +class BackendServicesScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * A list of BackendServices contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendService backend_services = 388522409; + */ + private $backend_services; + /** + * Informational warning which replaces the list of backend services when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\BackendService>|\Google\Protobuf\Internal\RepeatedField $backend_services + * A list of BackendServices contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * Informational warning which replaces the list of backend services when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of BackendServices contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendService backend_services = 388522409; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBackendServices() + { + return $this->backend_services; + } + + /** + * A list of BackendServices contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendService backend_services = 388522409; + * @param array<\Google\Cloud\Compute\V1\BackendService>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBackendServices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\BackendService::class); + $this->backend_services = $arr; + + return $this; + } + + /** + * Informational warning which replaces the list of backend services 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); + } + + /** + * Informational warning which replaces the list of backend services 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdPacket.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdPacket.php new file mode 100644 index 000000000000..62fc9a675e98 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdPacket.php @@ -0,0 +1,744 @@ +google.cloud.compute.v1.BfdPacket + */ +class BfdPacket extends \Google\Protobuf\Internal\Message +{ + /** + * The Authentication Present bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional bool authentication_present = 105974260; + */ + protected $authentication_present = null; + /** + * The Control Plane Independent bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional bool control_plane_independent = 62363573; + */ + protected $control_plane_independent = null; + /** + * The demand bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional bool demand = 275180107; + */ + protected $demand = null; + /** + * The diagnostic code specifies the local system's reason for the last change in session state. This allows remote systems to determine the reason that the previous session failed, for example. These diagnostic codes are specified in section 4.1 of RFC5880 + * Check the Diagnostic enum for the list of possible values. + * + * Generated from protobuf field optional string diagnostic = 62708647; + */ + protected $diagnostic = null; + /** + * The Final bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional bool final = 97436022; + */ + protected $final = null; + /** + * The length of the BFD Control packet in bytes. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional uint32 length = 504249062; + */ + protected $length = null; + /** + * The Required Min Echo RX Interval value in the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional uint32 min_echo_rx_interval_ms = 97286868; + */ + protected $min_echo_rx_interval_ms = null; + /** + * The Required Min RX Interval value in the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional uint32 min_rx_interval_ms = 463399028; + */ + protected $min_rx_interval_ms = null; + /** + * The Desired Min TX Interval value in the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional uint32 min_tx_interval_ms = 526023602; + */ + protected $min_tx_interval_ms = null; + /** + * The detection time multiplier of the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional uint32 multiplier = 191331777; + */ + protected $multiplier = null; + /** + * The multipoint bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional bool multipoint = 191421431; + */ + protected $multipoint = null; + /** + * The My Discriminator value in the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional uint32 my_discriminator = 76663113; + */ + protected $my_discriminator = null; + /** + * The Poll bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional bool poll = 3446719; + */ + protected $poll = null; + /** + * The current BFD session state as seen by the transmitting system. These states are specified in section 4.1 of RFC5880 + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + */ + protected $state = null; + /** + * The version number of the BFD protocol, as specified in section 4.1 of RFC5880. + * + * Generated from protobuf field optional uint32 version = 351608024; + */ + protected $version = null; + /** + * The Your Discriminator value in the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional uint32 your_discriminator = 515634064; + */ + protected $your_discriminator = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $authentication_present + * The Authentication Present bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * @type bool $control_plane_independent + * The Control Plane Independent bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * @type bool $demand + * The demand bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * @type string $diagnostic + * The diagnostic code specifies the local system's reason for the last change in session state. This allows remote systems to determine the reason that the previous session failed, for example. These diagnostic codes are specified in section 4.1 of RFC5880 + * Check the Diagnostic enum for the list of possible values. + * @type bool $final + * The Final bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * @type int $length + * The length of the BFD Control packet in bytes. This is specified in section 4.1 of RFC5880 + * @type int $min_echo_rx_interval_ms + * The Required Min Echo RX Interval value in the BFD packet. This is specified in section 4.1 of RFC5880 + * @type int $min_rx_interval_ms + * The Required Min RX Interval value in the BFD packet. This is specified in section 4.1 of RFC5880 + * @type int $min_tx_interval_ms + * The Desired Min TX Interval value in the BFD packet. This is specified in section 4.1 of RFC5880 + * @type int $multiplier + * The detection time multiplier of the BFD packet. This is specified in section 4.1 of RFC5880 + * @type bool $multipoint + * The multipoint bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * @type int $my_discriminator + * The My Discriminator value in the BFD packet. This is specified in section 4.1 of RFC5880 + * @type bool $poll + * The Poll bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * @type string $state + * The current BFD session state as seen by the transmitting system. These states are specified in section 4.1 of RFC5880 + * Check the State enum for the list of possible values. + * @type int $version + * The version number of the BFD protocol, as specified in section 4.1 of RFC5880. + * @type int $your_discriminator + * The Your Discriminator value in the BFD packet. This is specified in section 4.1 of RFC5880 + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The Authentication Present bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional bool authentication_present = 105974260; + * @return bool + */ + public function getAuthenticationPresent() + { + return isset($this->authentication_present) ? $this->authentication_present : false; + } + + public function hasAuthenticationPresent() + { + return isset($this->authentication_present); + } + + public function clearAuthenticationPresent() + { + unset($this->authentication_present); + } + + /** + * The Authentication Present bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional bool authentication_present = 105974260; + * @param bool $var + * @return $this + */ + public function setAuthenticationPresent($var) + { + GPBUtil::checkBool($var); + $this->authentication_present = $var; + + return $this; + } + + /** + * The Control Plane Independent bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional bool control_plane_independent = 62363573; + * @return bool + */ + public function getControlPlaneIndependent() + { + return isset($this->control_plane_independent) ? $this->control_plane_independent : false; + } + + public function hasControlPlaneIndependent() + { + return isset($this->control_plane_independent); + } + + public function clearControlPlaneIndependent() + { + unset($this->control_plane_independent); + } + + /** + * The Control Plane Independent bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional bool control_plane_independent = 62363573; + * @param bool $var + * @return $this + */ + public function setControlPlaneIndependent($var) + { + GPBUtil::checkBool($var); + $this->control_plane_independent = $var; + + return $this; + } + + /** + * The demand bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional bool demand = 275180107; + * @return bool + */ + public function getDemand() + { + return isset($this->demand) ? $this->demand : false; + } + + public function hasDemand() + { + return isset($this->demand); + } + + public function clearDemand() + { + unset($this->demand); + } + + /** + * The demand bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional bool demand = 275180107; + * @param bool $var + * @return $this + */ + public function setDemand($var) + { + GPBUtil::checkBool($var); + $this->demand = $var; + + return $this; + } + + /** + * The diagnostic code specifies the local system's reason for the last change in session state. This allows remote systems to determine the reason that the previous session failed, for example. These diagnostic codes are specified in section 4.1 of RFC5880 + * Check the Diagnostic enum for the list of possible values. + * + * Generated from protobuf field optional string diagnostic = 62708647; + * @return string + */ + public function getDiagnostic() + { + return isset($this->diagnostic) ? $this->diagnostic : ''; + } + + public function hasDiagnostic() + { + return isset($this->diagnostic); + } + + public function clearDiagnostic() + { + unset($this->diagnostic); + } + + /** + * The diagnostic code specifies the local system's reason for the last change in session state. This allows remote systems to determine the reason that the previous session failed, for example. These diagnostic codes are specified in section 4.1 of RFC5880 + * Check the Diagnostic enum for the list of possible values. + * + * Generated from protobuf field optional string diagnostic = 62708647; + * @param string $var + * @return $this + */ + public function setDiagnostic($var) + { + GPBUtil::checkString($var, True); + $this->diagnostic = $var; + + return $this; + } + + /** + * The Final bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional bool final = 97436022; + * @return bool + */ + public function getFinal() + { + return isset($this->final) ? $this->final : false; + } + + public function hasFinal() + { + return isset($this->final); + } + + public function clearFinal() + { + unset($this->final); + } + + /** + * The Final bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional bool final = 97436022; + * @param bool $var + * @return $this + */ + public function setFinal($var) + { + GPBUtil::checkBool($var); + $this->final = $var; + + return $this; + } + + /** + * The length of the BFD Control packet in bytes. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional uint32 length = 504249062; + * @return int + */ + public function getLength() + { + return isset($this->length) ? $this->length : 0; + } + + public function hasLength() + { + return isset($this->length); + } + + public function clearLength() + { + unset($this->length); + } + + /** + * The length of the BFD Control packet in bytes. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional uint32 length = 504249062; + * @param int $var + * @return $this + */ + public function setLength($var) + { + GPBUtil::checkUint32($var); + $this->length = $var; + + return $this; + } + + /** + * The Required Min Echo RX Interval value in the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional uint32 min_echo_rx_interval_ms = 97286868; + * @return int + */ + public function getMinEchoRxIntervalMs() + { + return isset($this->min_echo_rx_interval_ms) ? $this->min_echo_rx_interval_ms : 0; + } + + public function hasMinEchoRxIntervalMs() + { + return isset($this->min_echo_rx_interval_ms); + } + + public function clearMinEchoRxIntervalMs() + { + unset($this->min_echo_rx_interval_ms); + } + + /** + * The Required Min Echo RX Interval value in the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional uint32 min_echo_rx_interval_ms = 97286868; + * @param int $var + * @return $this + */ + public function setMinEchoRxIntervalMs($var) + { + GPBUtil::checkUint32($var); + $this->min_echo_rx_interval_ms = $var; + + return $this; + } + + /** + * The Required Min RX Interval value in the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional uint32 min_rx_interval_ms = 463399028; + * @return int + */ + public function getMinRxIntervalMs() + { + return isset($this->min_rx_interval_ms) ? $this->min_rx_interval_ms : 0; + } + + public function hasMinRxIntervalMs() + { + return isset($this->min_rx_interval_ms); + } + + public function clearMinRxIntervalMs() + { + unset($this->min_rx_interval_ms); + } + + /** + * The Required Min RX Interval value in the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional uint32 min_rx_interval_ms = 463399028; + * @param int $var + * @return $this + */ + public function setMinRxIntervalMs($var) + { + GPBUtil::checkUint32($var); + $this->min_rx_interval_ms = $var; + + return $this; + } + + /** + * The Desired Min TX Interval value in the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional uint32 min_tx_interval_ms = 526023602; + * @return int + */ + public function getMinTxIntervalMs() + { + return isset($this->min_tx_interval_ms) ? $this->min_tx_interval_ms : 0; + } + + public function hasMinTxIntervalMs() + { + return isset($this->min_tx_interval_ms); + } + + public function clearMinTxIntervalMs() + { + unset($this->min_tx_interval_ms); + } + + /** + * The Desired Min TX Interval value in the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional uint32 min_tx_interval_ms = 526023602; + * @param int $var + * @return $this + */ + public function setMinTxIntervalMs($var) + { + GPBUtil::checkUint32($var); + $this->min_tx_interval_ms = $var; + + return $this; + } + + /** + * The detection time multiplier of the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional uint32 multiplier = 191331777; + * @return int + */ + public function getMultiplier() + { + return isset($this->multiplier) ? $this->multiplier : 0; + } + + public function hasMultiplier() + { + return isset($this->multiplier); + } + + public function clearMultiplier() + { + unset($this->multiplier); + } + + /** + * The detection time multiplier of the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional uint32 multiplier = 191331777; + * @param int $var + * @return $this + */ + public function setMultiplier($var) + { + GPBUtil::checkUint32($var); + $this->multiplier = $var; + + return $this; + } + + /** + * The multipoint bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional bool multipoint = 191421431; + * @return bool + */ + public function getMultipoint() + { + return isset($this->multipoint) ? $this->multipoint : false; + } + + public function hasMultipoint() + { + return isset($this->multipoint); + } + + public function clearMultipoint() + { + unset($this->multipoint); + } + + /** + * The multipoint bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional bool multipoint = 191421431; + * @param bool $var + * @return $this + */ + public function setMultipoint($var) + { + GPBUtil::checkBool($var); + $this->multipoint = $var; + + return $this; + } + + /** + * The My Discriminator value in the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional uint32 my_discriminator = 76663113; + * @return int + */ + public function getMyDiscriminator() + { + return isset($this->my_discriminator) ? $this->my_discriminator : 0; + } + + public function hasMyDiscriminator() + { + return isset($this->my_discriminator); + } + + public function clearMyDiscriminator() + { + unset($this->my_discriminator); + } + + /** + * The My Discriminator value in the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional uint32 my_discriminator = 76663113; + * @param int $var + * @return $this + */ + public function setMyDiscriminator($var) + { + GPBUtil::checkUint32($var); + $this->my_discriminator = $var; + + return $this; + } + + /** + * The Poll bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional bool poll = 3446719; + * @return bool + */ + public function getPoll() + { + return isset($this->poll) ? $this->poll : false; + } + + public function hasPoll() + { + return isset($this->poll); + } + + public function clearPoll() + { + unset($this->poll); + } + + /** + * The Poll bit of the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional bool poll = 3446719; + * @param bool $var + * @return $this + */ + public function setPoll($var) + { + GPBUtil::checkBool($var); + $this->poll = $var; + + return $this; + } + + /** + * The current BFD session state as seen by the transmitting system. These states are specified in section 4.1 of RFC5880 + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @return string + */ + public function getState() + { + return isset($this->state) ? $this->state : ''; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * The current BFD session state as seen by the transmitting system. These states are specified in section 4.1 of RFC5880 + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + + /** + * The version number of the BFD protocol, as specified in section 4.1 of RFC5880. + * + * Generated from protobuf field optional uint32 version = 351608024; + * @return int + */ + public function getVersion() + { + return isset($this->version) ? $this->version : 0; + } + + public function hasVersion() + { + return isset($this->version); + } + + public function clearVersion() + { + unset($this->version); + } + + /** + * The version number of the BFD protocol, as specified in section 4.1 of RFC5880. + * + * Generated from protobuf field optional uint32 version = 351608024; + * @param int $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkUint32($var); + $this->version = $var; + + return $this; + } + + /** + * The Your Discriminator value in the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional uint32 your_discriminator = 515634064; + * @return int + */ + public function getYourDiscriminator() + { + return isset($this->your_discriminator) ? $this->your_discriminator : 0; + } + + public function hasYourDiscriminator() + { + return isset($this->your_discriminator); + } + + public function clearYourDiscriminator() + { + unset($this->your_discriminator); + } + + /** + * The Your Discriminator value in the BFD packet. This is specified in section 4.1 of RFC5880 + * + * Generated from protobuf field optional uint32 your_discriminator = 515634064; + * @param int $var + * @return $this + */ + public function setYourDiscriminator($var) + { + GPBUtil::checkUint32($var); + $this->your_discriminator = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdPacket/Diagnostic.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdPacket/Diagnostic.php new file mode 100644 index 000000000000..e707b769fe3f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdPacket/Diagnostic.php @@ -0,0 +1,100 @@ +google.cloud.compute.v1.BfdPacket.Diagnostic + */ +class Diagnostic +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_DIAGNOSTIC = 0; + */ + const UNDEFINED_DIAGNOSTIC = 0; + /** + * Generated from protobuf enum ADMINISTRATIVELY_DOWN = 121685798; + */ + const ADMINISTRATIVELY_DOWN = 121685798; + /** + * Generated from protobuf enum CONCATENATED_PATH_DOWN = 26186892; + */ + const CONCATENATED_PATH_DOWN = 26186892; + /** + * Generated from protobuf enum CONTROL_DETECTION_TIME_EXPIRED = 135478383; + */ + const CONTROL_DETECTION_TIME_EXPIRED = 135478383; + /** + * Generated from protobuf enum DIAGNOSTIC_UNSPECIFIED = 58720895; + */ + const DIAGNOSTIC_UNSPECIFIED = 58720895; + /** + * Generated from protobuf enum ECHO_FUNCTION_FAILED = 220687466; + */ + const ECHO_FUNCTION_FAILED = 220687466; + /** + * Generated from protobuf enum FORWARDING_PLANE_RESET = 19715882; + */ + const FORWARDING_PLANE_RESET = 19715882; + /** + * Generated from protobuf enum NEIGHBOR_SIGNALED_SESSION_DOWN = 374226742; + */ + const NEIGHBOR_SIGNALED_SESSION_DOWN = 374226742; + /** + * Generated from protobuf enum NO_DIAGNOSTIC = 222503141; + */ + const NO_DIAGNOSTIC = 222503141; + /** + * Generated from protobuf enum PATH_DOWN = 290605180; + */ + const PATH_DOWN = 290605180; + /** + * Generated from protobuf enum REVERSE_CONCATENATED_PATH_DOWN = 479337129; + */ + const REVERSE_CONCATENATED_PATH_DOWN = 479337129; + + private static $valueToName = [ + self::UNDEFINED_DIAGNOSTIC => 'UNDEFINED_DIAGNOSTIC', + self::ADMINISTRATIVELY_DOWN => 'ADMINISTRATIVELY_DOWN', + self::CONCATENATED_PATH_DOWN => 'CONCATENATED_PATH_DOWN', + self::CONTROL_DETECTION_TIME_EXPIRED => 'CONTROL_DETECTION_TIME_EXPIRED', + self::DIAGNOSTIC_UNSPECIFIED => 'DIAGNOSTIC_UNSPECIFIED', + self::ECHO_FUNCTION_FAILED => 'ECHO_FUNCTION_FAILED', + self::FORWARDING_PLANE_RESET => 'FORWARDING_PLANE_RESET', + self::NEIGHBOR_SIGNALED_SESSION_DOWN => 'NEIGHBOR_SIGNALED_SESSION_DOWN', + self::NO_DIAGNOSTIC => 'NO_DIAGNOSTIC', + self::PATH_DOWN => 'PATH_DOWN', + self::REVERSE_CONCATENATED_PATH_DOWN => 'REVERSE_CONCATENATED_PATH_DOWN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Diagnostic::class, \Google\Cloud\Compute\V1\BfdPacket_Diagnostic::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdPacket/State.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdPacket/State.php new file mode 100644 index 000000000000..bfa07560dad5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdPacket/State.php @@ -0,0 +1,75 @@ +google.cloud.compute.v1.BfdPacket.State + */ +class State +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATE = 0; + */ + const UNDEFINED_STATE = 0; + /** + * Generated from protobuf enum ADMIN_DOWN = 128544690; + */ + const ADMIN_DOWN = 128544690; + /** + * Generated from protobuf enum DOWN = 2104482; + */ + const DOWN = 2104482; + /** + * Generated from protobuf enum INIT = 2252048; + */ + const INIT = 2252048; + /** + * Generated from protobuf enum STATE_UNSPECIFIED = 470755401; + */ + const STATE_UNSPECIFIED = 470755401; + /** + * Generated from protobuf enum UP = 2715; + */ + const UP = 2715; + + private static $valueToName = [ + self::UNDEFINED_STATE => 'UNDEFINED_STATE', + self::ADMIN_DOWN => 'ADMIN_DOWN', + self::DOWN => 'DOWN', + self::INIT => 'INIT', + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::UP => 'UP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Compute\V1\BfdPacket_State::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdStatus.php new file mode 100644 index 000000000000..654b40e895fd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdStatus.php @@ -0,0 +1,475 @@ +google.cloud.compute.v1.BfdStatus + */ +class BfdStatus extends \Google\Protobuf\Internal\Message +{ + /** + * The BFD session initialization mode for this BGP peer. If set to ACTIVE, the Cloud Router will initiate the BFD session for this BGP peer. If set to PASSIVE, the Cloud Router will wait for the peer router to initiate the BFD session for this BGP peer. If set to DISABLED, BFD is disabled for this BGP peer. + * Check the BfdSessionInitializationMode enum for the list of possible values. + * + * Generated from protobuf field optional string bfd_session_initialization_mode = 218156954; + */ + protected $bfd_session_initialization_mode = null; + /** + * Unix timestamp of the most recent config update. + * + * Generated from protobuf field optional int64 config_update_timestamp_micros = 457195569; + */ + protected $config_update_timestamp_micros = null; + /** + * Control packet counts for the current BFD session. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BfdStatusPacketCounts control_packet_counts = 132573561; + */ + protected $control_packet_counts = null; + /** + * Inter-packet time interval statistics for control packets. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PacketIntervals control_packet_intervals = 500806649; + */ + private $control_packet_intervals; + /** + * The diagnostic code specifies the local system's reason for the last change in session state. This allows remote systems to determine the reason that the previous session failed, for example. These diagnostic codes are specified in section 4.1 of RFC5880 + * Check the LocalDiagnostic enum for the list of possible values. + * + * Generated from protobuf field optional string local_diagnostic = 463737083; + */ + protected $local_diagnostic = null; + /** + * The current BFD session state as seen by the transmitting system. These states are specified in section 4.1 of RFC5880 + * Check the LocalState enum for the list of possible values. + * + * Generated from protobuf field optional string local_state = 149195453; + */ + protected $local_state = null; + /** + * Negotiated transmit interval for control packets. + * + * Generated from protobuf field optional uint32 negotiated_local_control_tx_interval_ms = 21768340; + */ + protected $negotiated_local_control_tx_interval_ms = null; + /** + * The most recent Rx control packet for this BFD session. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BfdPacket rx_packet = 505069729; + */ + protected $rx_packet = null; + /** + * The most recent Tx control packet for this BFD session. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BfdPacket tx_packet = 111386275; + */ + protected $tx_packet = null; + /** + * Session uptime in milliseconds. Value will be 0 if session is not up. + * + * Generated from protobuf field optional int64 uptime_ms = 125398365; + */ + protected $uptime_ms = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $bfd_session_initialization_mode + * The BFD session initialization mode for this BGP peer. If set to ACTIVE, the Cloud Router will initiate the BFD session for this BGP peer. If set to PASSIVE, the Cloud Router will wait for the peer router to initiate the BFD session for this BGP peer. If set to DISABLED, BFD is disabled for this BGP peer. + * Check the BfdSessionInitializationMode enum for the list of possible values. + * @type int|string $config_update_timestamp_micros + * Unix timestamp of the most recent config update. + * @type \Google\Cloud\Compute\V1\BfdStatusPacketCounts $control_packet_counts + * Control packet counts for the current BFD session. + * @type array<\Google\Cloud\Compute\V1\PacketIntervals>|\Google\Protobuf\Internal\RepeatedField $control_packet_intervals + * Inter-packet time interval statistics for control packets. + * @type string $local_diagnostic + * The diagnostic code specifies the local system's reason for the last change in session state. This allows remote systems to determine the reason that the previous session failed, for example. These diagnostic codes are specified in section 4.1 of RFC5880 + * Check the LocalDiagnostic enum for the list of possible values. + * @type string $local_state + * The current BFD session state as seen by the transmitting system. These states are specified in section 4.1 of RFC5880 + * Check the LocalState enum for the list of possible values. + * @type int $negotiated_local_control_tx_interval_ms + * Negotiated transmit interval for control packets. + * @type \Google\Cloud\Compute\V1\BfdPacket $rx_packet + * The most recent Rx control packet for this BFD session. + * @type \Google\Cloud\Compute\V1\BfdPacket $tx_packet + * The most recent Tx control packet for this BFD session. + * @type int|string $uptime_ms + * Session uptime in milliseconds. Value will be 0 if session is not up. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The BFD session initialization mode for this BGP peer. If set to ACTIVE, the Cloud Router will initiate the BFD session for this BGP peer. If set to PASSIVE, the Cloud Router will wait for the peer router to initiate the BFD session for this BGP peer. If set to DISABLED, BFD is disabled for this BGP peer. + * Check the BfdSessionInitializationMode enum for the list of possible values. + * + * Generated from protobuf field optional string bfd_session_initialization_mode = 218156954; + * @return string + */ + public function getBfdSessionInitializationMode() + { + return isset($this->bfd_session_initialization_mode) ? $this->bfd_session_initialization_mode : ''; + } + + public function hasBfdSessionInitializationMode() + { + return isset($this->bfd_session_initialization_mode); + } + + public function clearBfdSessionInitializationMode() + { + unset($this->bfd_session_initialization_mode); + } + + /** + * The BFD session initialization mode for this BGP peer. If set to ACTIVE, the Cloud Router will initiate the BFD session for this BGP peer. If set to PASSIVE, the Cloud Router will wait for the peer router to initiate the BFD session for this BGP peer. If set to DISABLED, BFD is disabled for this BGP peer. + * Check the BfdSessionInitializationMode enum for the list of possible values. + * + * Generated from protobuf field optional string bfd_session_initialization_mode = 218156954; + * @param string $var + * @return $this + */ + public function setBfdSessionInitializationMode($var) + { + GPBUtil::checkString($var, True); + $this->bfd_session_initialization_mode = $var; + + return $this; + } + + /** + * Unix timestamp of the most recent config update. + * + * Generated from protobuf field optional int64 config_update_timestamp_micros = 457195569; + * @return int|string + */ + public function getConfigUpdateTimestampMicros() + { + return isset($this->config_update_timestamp_micros) ? $this->config_update_timestamp_micros : 0; + } + + public function hasConfigUpdateTimestampMicros() + { + return isset($this->config_update_timestamp_micros); + } + + public function clearConfigUpdateTimestampMicros() + { + unset($this->config_update_timestamp_micros); + } + + /** + * Unix timestamp of the most recent config update. + * + * Generated from protobuf field optional int64 config_update_timestamp_micros = 457195569; + * @param int|string $var + * @return $this + */ + public function setConfigUpdateTimestampMicros($var) + { + GPBUtil::checkInt64($var); + $this->config_update_timestamp_micros = $var; + + return $this; + } + + /** + * Control packet counts for the current BFD session. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BfdStatusPacketCounts control_packet_counts = 132573561; + * @return \Google\Cloud\Compute\V1\BfdStatusPacketCounts|null + */ + public function getControlPacketCounts() + { + return $this->control_packet_counts; + } + + public function hasControlPacketCounts() + { + return isset($this->control_packet_counts); + } + + public function clearControlPacketCounts() + { + unset($this->control_packet_counts); + } + + /** + * Control packet counts for the current BFD session. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BfdStatusPacketCounts control_packet_counts = 132573561; + * @param \Google\Cloud\Compute\V1\BfdStatusPacketCounts $var + * @return $this + */ + public function setControlPacketCounts($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BfdStatusPacketCounts::class); + $this->control_packet_counts = $var; + + return $this; + } + + /** + * Inter-packet time interval statistics for control packets. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PacketIntervals control_packet_intervals = 500806649; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getControlPacketIntervals() + { + return $this->control_packet_intervals; + } + + /** + * Inter-packet time interval statistics for control packets. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PacketIntervals control_packet_intervals = 500806649; + * @param array<\Google\Cloud\Compute\V1\PacketIntervals>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setControlPacketIntervals($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PacketIntervals::class); + $this->control_packet_intervals = $arr; + + return $this; + } + + /** + * The diagnostic code specifies the local system's reason for the last change in session state. This allows remote systems to determine the reason that the previous session failed, for example. These diagnostic codes are specified in section 4.1 of RFC5880 + * Check the LocalDiagnostic enum for the list of possible values. + * + * Generated from protobuf field optional string local_diagnostic = 463737083; + * @return string + */ + public function getLocalDiagnostic() + { + return isset($this->local_diagnostic) ? $this->local_diagnostic : ''; + } + + public function hasLocalDiagnostic() + { + return isset($this->local_diagnostic); + } + + public function clearLocalDiagnostic() + { + unset($this->local_diagnostic); + } + + /** + * The diagnostic code specifies the local system's reason for the last change in session state. This allows remote systems to determine the reason that the previous session failed, for example. These diagnostic codes are specified in section 4.1 of RFC5880 + * Check the LocalDiagnostic enum for the list of possible values. + * + * Generated from protobuf field optional string local_diagnostic = 463737083; + * @param string $var + * @return $this + */ + public function setLocalDiagnostic($var) + { + GPBUtil::checkString($var, True); + $this->local_diagnostic = $var; + + return $this; + } + + /** + * The current BFD session state as seen by the transmitting system. These states are specified in section 4.1 of RFC5880 + * Check the LocalState enum for the list of possible values. + * + * Generated from protobuf field optional string local_state = 149195453; + * @return string + */ + public function getLocalState() + { + return isset($this->local_state) ? $this->local_state : ''; + } + + public function hasLocalState() + { + return isset($this->local_state); + } + + public function clearLocalState() + { + unset($this->local_state); + } + + /** + * The current BFD session state as seen by the transmitting system. These states are specified in section 4.1 of RFC5880 + * Check the LocalState enum for the list of possible values. + * + * Generated from protobuf field optional string local_state = 149195453; + * @param string $var + * @return $this + */ + public function setLocalState($var) + { + GPBUtil::checkString($var, True); + $this->local_state = $var; + + return $this; + } + + /** + * Negotiated transmit interval for control packets. + * + * Generated from protobuf field optional uint32 negotiated_local_control_tx_interval_ms = 21768340; + * @return int + */ + public function getNegotiatedLocalControlTxIntervalMs() + { + return isset($this->negotiated_local_control_tx_interval_ms) ? $this->negotiated_local_control_tx_interval_ms : 0; + } + + public function hasNegotiatedLocalControlTxIntervalMs() + { + return isset($this->negotiated_local_control_tx_interval_ms); + } + + public function clearNegotiatedLocalControlTxIntervalMs() + { + unset($this->negotiated_local_control_tx_interval_ms); + } + + /** + * Negotiated transmit interval for control packets. + * + * Generated from protobuf field optional uint32 negotiated_local_control_tx_interval_ms = 21768340; + * @param int $var + * @return $this + */ + public function setNegotiatedLocalControlTxIntervalMs($var) + { + GPBUtil::checkUint32($var); + $this->negotiated_local_control_tx_interval_ms = $var; + + return $this; + } + + /** + * The most recent Rx control packet for this BFD session. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BfdPacket rx_packet = 505069729; + * @return \Google\Cloud\Compute\V1\BfdPacket|null + */ + public function getRxPacket() + { + return $this->rx_packet; + } + + public function hasRxPacket() + { + return isset($this->rx_packet); + } + + public function clearRxPacket() + { + unset($this->rx_packet); + } + + /** + * The most recent Rx control packet for this BFD session. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BfdPacket rx_packet = 505069729; + * @param \Google\Cloud\Compute\V1\BfdPacket $var + * @return $this + */ + public function setRxPacket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BfdPacket::class); + $this->rx_packet = $var; + + return $this; + } + + /** + * The most recent Tx control packet for this BFD session. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BfdPacket tx_packet = 111386275; + * @return \Google\Cloud\Compute\V1\BfdPacket|null + */ + public function getTxPacket() + { + return $this->tx_packet; + } + + public function hasTxPacket() + { + return isset($this->tx_packet); + } + + public function clearTxPacket() + { + unset($this->tx_packet); + } + + /** + * The most recent Tx control packet for this BFD session. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BfdPacket tx_packet = 111386275; + * @param \Google\Cloud\Compute\V1\BfdPacket $var + * @return $this + */ + public function setTxPacket($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BfdPacket::class); + $this->tx_packet = $var; + + return $this; + } + + /** + * Session uptime in milliseconds. Value will be 0 if session is not up. + * + * Generated from protobuf field optional int64 uptime_ms = 125398365; + * @return int|string + */ + public function getUptimeMs() + { + return isset($this->uptime_ms) ? $this->uptime_ms : 0; + } + + public function hasUptimeMs() + { + return isset($this->uptime_ms); + } + + public function clearUptimeMs() + { + unset($this->uptime_ms); + } + + /** + * Session uptime in milliseconds. Value will be 0 if session is not up. + * + * Generated from protobuf field optional int64 uptime_ms = 125398365; + * @param int|string $var + * @return $this + */ + public function setUptimeMs($var) + { + GPBUtil::checkInt64($var); + $this->uptime_ms = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdStatus/BfdSessionInitializationMode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdStatus/BfdSessionInitializationMode.php new file mode 100644 index 000000000000..388b3a746dad --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdStatus/BfdSessionInitializationMode.php @@ -0,0 +1,65 @@ +google.cloud.compute.v1.BfdStatus.BfdSessionInitializationMode + */ +class BfdSessionInitializationMode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_BFD_SESSION_INITIALIZATION_MODE = 0; + */ + const UNDEFINED_BFD_SESSION_INITIALIZATION_MODE = 0; + /** + * Generated from protobuf enum ACTIVE = 314733318; + */ + const ACTIVE = 314733318; + /** + * Generated from protobuf enum DISABLED = 516696700; + */ + const DISABLED = 516696700; + /** + * Generated from protobuf enum PASSIVE = 462813959; + */ + const PASSIVE = 462813959; + + private static $valueToName = [ + self::UNDEFINED_BFD_SESSION_INITIALIZATION_MODE => 'UNDEFINED_BFD_SESSION_INITIALIZATION_MODE', + self::ACTIVE => 'ACTIVE', + self::DISABLED => 'DISABLED', + self::PASSIVE => 'PASSIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BfdSessionInitializationMode::class, \Google\Cloud\Compute\V1\BfdStatus_BfdSessionInitializationMode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdStatus/LocalDiagnostic.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdStatus/LocalDiagnostic.php new file mode 100644 index 000000000000..5cd927acc4f4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdStatus/LocalDiagnostic.php @@ -0,0 +1,100 @@ +google.cloud.compute.v1.BfdStatus.LocalDiagnostic + */ +class LocalDiagnostic +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_LOCAL_DIAGNOSTIC = 0; + */ + const UNDEFINED_LOCAL_DIAGNOSTIC = 0; + /** + * Generated from protobuf enum ADMINISTRATIVELY_DOWN = 121685798; + */ + const ADMINISTRATIVELY_DOWN = 121685798; + /** + * Generated from protobuf enum CONCATENATED_PATH_DOWN = 26186892; + */ + const CONCATENATED_PATH_DOWN = 26186892; + /** + * Generated from protobuf enum CONTROL_DETECTION_TIME_EXPIRED = 135478383; + */ + const CONTROL_DETECTION_TIME_EXPIRED = 135478383; + /** + * Generated from protobuf enum DIAGNOSTIC_UNSPECIFIED = 58720895; + */ + const DIAGNOSTIC_UNSPECIFIED = 58720895; + /** + * Generated from protobuf enum ECHO_FUNCTION_FAILED = 220687466; + */ + const ECHO_FUNCTION_FAILED = 220687466; + /** + * Generated from protobuf enum FORWARDING_PLANE_RESET = 19715882; + */ + const FORWARDING_PLANE_RESET = 19715882; + /** + * Generated from protobuf enum NEIGHBOR_SIGNALED_SESSION_DOWN = 374226742; + */ + const NEIGHBOR_SIGNALED_SESSION_DOWN = 374226742; + /** + * Generated from protobuf enum NO_DIAGNOSTIC = 222503141; + */ + const NO_DIAGNOSTIC = 222503141; + /** + * Generated from protobuf enum PATH_DOWN = 290605180; + */ + const PATH_DOWN = 290605180; + /** + * Generated from protobuf enum REVERSE_CONCATENATED_PATH_DOWN = 479337129; + */ + const REVERSE_CONCATENATED_PATH_DOWN = 479337129; + + private static $valueToName = [ + self::UNDEFINED_LOCAL_DIAGNOSTIC => 'UNDEFINED_LOCAL_DIAGNOSTIC', + self::ADMINISTRATIVELY_DOWN => 'ADMINISTRATIVELY_DOWN', + self::CONCATENATED_PATH_DOWN => 'CONCATENATED_PATH_DOWN', + self::CONTROL_DETECTION_TIME_EXPIRED => 'CONTROL_DETECTION_TIME_EXPIRED', + self::DIAGNOSTIC_UNSPECIFIED => 'DIAGNOSTIC_UNSPECIFIED', + self::ECHO_FUNCTION_FAILED => 'ECHO_FUNCTION_FAILED', + self::FORWARDING_PLANE_RESET => 'FORWARDING_PLANE_RESET', + self::NEIGHBOR_SIGNALED_SESSION_DOWN => 'NEIGHBOR_SIGNALED_SESSION_DOWN', + self::NO_DIAGNOSTIC => 'NO_DIAGNOSTIC', + self::PATH_DOWN => 'PATH_DOWN', + self::REVERSE_CONCATENATED_PATH_DOWN => 'REVERSE_CONCATENATED_PATH_DOWN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LocalDiagnostic::class, \Google\Cloud\Compute\V1\BfdStatus_LocalDiagnostic::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdStatus/LocalState.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdStatus/LocalState.php new file mode 100644 index 000000000000..f7263de547d6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdStatus/LocalState.php @@ -0,0 +1,75 @@ +google.cloud.compute.v1.BfdStatus.LocalState + */ +class LocalState +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_LOCAL_STATE = 0; + */ + const UNDEFINED_LOCAL_STATE = 0; + /** + * Generated from protobuf enum ADMIN_DOWN = 128544690; + */ + const ADMIN_DOWN = 128544690; + /** + * Generated from protobuf enum DOWN = 2104482; + */ + const DOWN = 2104482; + /** + * Generated from protobuf enum INIT = 2252048; + */ + const INIT = 2252048; + /** + * Generated from protobuf enum STATE_UNSPECIFIED = 470755401; + */ + const STATE_UNSPECIFIED = 470755401; + /** + * Generated from protobuf enum UP = 2715; + */ + const UP = 2715; + + private static $valueToName = [ + self::UNDEFINED_LOCAL_STATE => 'UNDEFINED_LOCAL_STATE', + self::ADMIN_DOWN => 'ADMIN_DOWN', + self::DOWN => 'DOWN', + self::INIT => 'INIT', + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::UP => 'UP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LocalState::class, \Google\Cloud\Compute\V1\BfdStatus_LocalState::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdStatusPacketCounts.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdStatusPacketCounts.php new file mode 100644 index 000000000000..ac61018e6224 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BfdStatusPacketCounts.php @@ -0,0 +1,208 @@ +google.cloud.compute.v1.BfdStatusPacketCounts + */ +class BfdStatusPacketCounts extends \Google\Protobuf\Internal\Message +{ + /** + * Number of packets received since the beginning of the current BFD session. + * + * Generated from protobuf field optional uint32 num_rx = 39375263; + */ + protected $num_rx = null; + /** + * Number of packets received that were rejected because of errors since the beginning of the current BFD session. + * + * Generated from protobuf field optional uint32 num_rx_rejected = 281007902; + */ + protected $num_rx_rejected = null; + /** + * Number of packets received that were successfully processed since the beginning of the current BFD session. + * + * Generated from protobuf field optional uint32 num_rx_successful = 455361850; + */ + protected $num_rx_successful = null; + /** + * Number of packets transmitted since the beginning of the current BFD session. + * + * Generated from protobuf field optional uint32 num_tx = 39375325; + */ + protected $num_tx = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $num_rx + * Number of packets received since the beginning of the current BFD session. + * @type int $num_rx_rejected + * Number of packets received that were rejected because of errors since the beginning of the current BFD session. + * @type int $num_rx_successful + * Number of packets received that were successfully processed since the beginning of the current BFD session. + * @type int $num_tx + * Number of packets transmitted since the beginning of the current BFD session. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Number of packets received since the beginning of the current BFD session. + * + * Generated from protobuf field optional uint32 num_rx = 39375263; + * @return int + */ + public function getNumRx() + { + return isset($this->num_rx) ? $this->num_rx : 0; + } + + public function hasNumRx() + { + return isset($this->num_rx); + } + + public function clearNumRx() + { + unset($this->num_rx); + } + + /** + * Number of packets received since the beginning of the current BFD session. + * + * Generated from protobuf field optional uint32 num_rx = 39375263; + * @param int $var + * @return $this + */ + public function setNumRx($var) + { + GPBUtil::checkUint32($var); + $this->num_rx = $var; + + return $this; + } + + /** + * Number of packets received that were rejected because of errors since the beginning of the current BFD session. + * + * Generated from protobuf field optional uint32 num_rx_rejected = 281007902; + * @return int + */ + public function getNumRxRejected() + { + return isset($this->num_rx_rejected) ? $this->num_rx_rejected : 0; + } + + public function hasNumRxRejected() + { + return isset($this->num_rx_rejected); + } + + public function clearNumRxRejected() + { + unset($this->num_rx_rejected); + } + + /** + * Number of packets received that were rejected because of errors since the beginning of the current BFD session. + * + * Generated from protobuf field optional uint32 num_rx_rejected = 281007902; + * @param int $var + * @return $this + */ + public function setNumRxRejected($var) + { + GPBUtil::checkUint32($var); + $this->num_rx_rejected = $var; + + return $this; + } + + /** + * Number of packets received that were successfully processed since the beginning of the current BFD session. + * + * Generated from protobuf field optional uint32 num_rx_successful = 455361850; + * @return int + */ + public function getNumRxSuccessful() + { + return isset($this->num_rx_successful) ? $this->num_rx_successful : 0; + } + + public function hasNumRxSuccessful() + { + return isset($this->num_rx_successful); + } + + public function clearNumRxSuccessful() + { + unset($this->num_rx_successful); + } + + /** + * Number of packets received that were successfully processed since the beginning of the current BFD session. + * + * Generated from protobuf field optional uint32 num_rx_successful = 455361850; + * @param int $var + * @return $this + */ + public function setNumRxSuccessful($var) + { + GPBUtil::checkUint32($var); + $this->num_rx_successful = $var; + + return $this; + } + + /** + * Number of packets transmitted since the beginning of the current BFD session. + * + * Generated from protobuf field optional uint32 num_tx = 39375325; + * @return int + */ + public function getNumTx() + { + return isset($this->num_tx) ? $this->num_tx : 0; + } + + public function hasNumTx() + { + return isset($this->num_tx); + } + + public function clearNumTx() + { + unset($this->num_tx); + } + + /** + * Number of packets transmitted since the beginning of the current BFD session. + * + * Generated from protobuf field optional uint32 num_tx = 39375325; + * @param int $var + * @return $this + */ + public function setNumTx($var) + { + GPBUtil::checkUint32($var); + $this->num_tx = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Binding.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Binding.php new file mode 100644 index 000000000000..d1a1c0c350ff --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Binding.php @@ -0,0 +1,199 @@ +google.cloud.compute.v1.Binding + */ +class Binding extends \Google\Protobuf\Internal\Message +{ + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional string binding_id = 441088277; + */ + protected $binding_id = null; + /** + * 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). + * + * Generated from protobuf field optional .google.cloud.compute.v1.Expr condition = 212430107; + */ + protected $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`. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workforce identity pool. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/group/{group_id}`: All workforce identities in a group. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All workforce identities with a specific attribute value. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/*`: All identities in a workforce identity pool. * `principal://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workload identity pool. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool group. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All identities in a workload identity pool with a certain attribute. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/*`: All identities in a workload identity pool. * `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. * `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: Deleted single identity in a workforce identity pool. For example, `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value`. + * + * Generated from protobuf field repeated string members = 412010777; + */ + private $members; + /** + * Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview of the IAM roles and permissions, see the [IAM documentation](https://cloud.google.com/iam/docs/roles-overview). For a list of the available pre-defined roles, see [here](https://cloud.google.com/iam/docs/understanding-roles). + * + * Generated from protobuf field optional string role = 3506294; + */ + protected $role = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $binding_id + * This is deprecated and has no effect. Do not use. + * @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`. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workforce identity pool. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/group/{group_id}`: All workforce identities in a group. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All workforce identities with a specific attribute value. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/*`: All identities in a workforce identity pool. * `principal://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workload identity pool. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool group. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All identities in a workload identity pool with a certain attribute. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/*`: All identities in a workload identity pool. * `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. * `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: Deleted single identity in a workforce identity pool. For example, `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value`. + * @type string $role + * Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview of the IAM roles and permissions, see the [IAM documentation](https://cloud.google.com/iam/docs/roles-overview). For a list of the available pre-defined roles, see [here](https://cloud.google.com/iam/docs/understanding-roles). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional string binding_id = 441088277; + * @return string + */ + public function getBindingId() + { + return isset($this->binding_id) ? $this->binding_id : ''; + } + + public function hasBindingId() + { + return isset($this->binding_id); + } + + public function clearBindingId() + { + unset($this->binding_id); + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional string binding_id = 441088277; + * @param string $var + * @return $this + */ + public function setBindingId($var) + { + GPBUtil::checkString($var, True); + $this->binding_id = $var; + + return $this; + } + + /** + * 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). + * + * Generated from protobuf field optional .google.cloud.compute.v1.Expr condition = 212430107; + * @return \Google\Cloud\Compute\V1\Expr|null + */ + public function getCondition() + { + return $this->condition; + } + + public function hasCondition() + { + return isset($this->condition); + } + + public function clearCondition() + { + unset($this->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). + * + * Generated from protobuf field optional .google.cloud.compute.v1.Expr condition = 212430107; + * @param \Google\Cloud\Compute\V1\Expr $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Expr::class); + $this->condition = $var; + + return $this; + } + + /** + * 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`. * `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workforce identity pool. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/group/{group_id}`: All workforce identities in a group. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All workforce identities with a specific attribute value. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/*`: All identities in a workforce identity pool. * `principal://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workload identity pool. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool group. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All identities in a workload identity pool with a certain attribute. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/*`: All identities in a workload identity pool. * `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. * `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: Deleted single identity in a workforce identity pool. For example, `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value`. + * + * Generated from protobuf field repeated string members = 412010777; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMembers() + { + return $this->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`. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workforce identity pool. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/group/{group_id}`: All workforce identities in a group. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All workforce identities with a specific attribute value. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/*`: All identities in a workforce identity pool. * `principal://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workload identity pool. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool group. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All identities in a workload identity pool with a certain attribute. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/*`: All identities in a workload identity pool. * `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. * `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: Deleted single identity in a workforce identity pool. For example, `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value`. + * + * Generated from protobuf field repeated string members = 412010777; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMembers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->members = $arr; + + return $this; + } + + /** + * Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview of the IAM roles and permissions, see the [IAM documentation](https://cloud.google.com/iam/docs/roles-overview). For a list of the available pre-defined roles, see [here](https://cloud.google.com/iam/docs/understanding-roles). + * + * Generated from protobuf field optional string role = 3506294; + * @return string + */ + public function getRole() + { + return isset($this->role) ? $this->role : ''; + } + + public function hasRole() + { + return isset($this->role); + } + + public function clearRole() + { + unset($this->role); + } + + /** + * Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview of the IAM roles and permissions, see the [IAM documentation](https://cloud.google.com/iam/docs/roles-overview). For a list of the available pre-defined roles, see [here](https://cloud.google.com/iam/docs/understanding-roles). + * + * Generated from protobuf field optional string role = 3506294; + * @param string $var + * @return $this + */ + public function setRole($var) + { + GPBUtil::checkString($var, True); + $this->role = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertDiskRequest.php new file mode 100644 index 000000000000..d60771e992a2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertDiskRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.BulkInsertDiskRequest + */ +class BulkInsertDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BulkInsertDiskResource bulk_insert_disk_resource_resource = 289799382 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $bulk_insert_disk_resource_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param \Google\Cloud\Compute\V1\BulkInsertDiskResource $bulkInsertDiskResourceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\BulkInsertDiskRequest + * + * @experimental + */ + public static function build(string $project, string $zone, \Google\Cloud\Compute\V1\BulkInsertDiskResource $bulkInsertDiskResourceResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setBulkInsertDiskResourceResource($bulkInsertDiskResourceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\BulkInsertDiskResource $bulk_insert_disk_resource_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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BulkInsertDiskResource bulk_insert_disk_resource_resource = 289799382 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\BulkInsertDiskResource|null + */ + public function getBulkInsertDiskResourceResource() + { + return $this->bulk_insert_disk_resource_resource; + } + + public function hasBulkInsertDiskResourceResource() + { + return isset($this->bulk_insert_disk_resource_resource); + } + + public function clearBulkInsertDiskResourceResource() + { + unset($this->bulk_insert_disk_resource_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BulkInsertDiskResource bulk_insert_disk_resource_resource = 289799382 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\BulkInsertDiskResource $var + * @return $this + */ + public function setBulkInsertDiskResourceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BulkInsertDiskResource::class); + $this->bulk_insert_disk_resource_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertDiskResource.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertDiskResource.php new file mode 100644 index 000000000000..4af890eddc9a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertDiskResource.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.BulkInsertDiskResource + */ +class BulkInsertDiskResource extends \Google\Protobuf\Internal\Message +{ + /** + * The URL of the DiskConsistencyGroupPolicy for the group of disks to clone. This may be a full or partial URL, such as: - https://www.googleapis.com/compute/v1/projects/project/regions/region /resourcePolicies/resourcePolicy - projects/project/regions/region/resourcePolicies/resourcePolicy - regions/region/resourcePolicies/resourcePolicy + * + * Generated from protobuf field optional string source_consistency_group_policy = 19616093; + */ + protected $source_consistency_group_policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $source_consistency_group_policy + * The URL of the DiskConsistencyGroupPolicy for the group of disks to clone. This may be a full or partial URL, such as: - https://www.googleapis.com/compute/v1/projects/project/regions/region /resourcePolicies/resourcePolicy - projects/project/regions/region/resourcePolicies/resourcePolicy - regions/region/resourcePolicies/resourcePolicy + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The URL of the DiskConsistencyGroupPolicy for the group of disks to clone. This may be a full or partial URL, such as: - https://www.googleapis.com/compute/v1/projects/project/regions/region /resourcePolicies/resourcePolicy - projects/project/regions/region/resourcePolicies/resourcePolicy - regions/region/resourcePolicies/resourcePolicy + * + * Generated from protobuf field optional string source_consistency_group_policy = 19616093; + * @return string + */ + public function getSourceConsistencyGroupPolicy() + { + return isset($this->source_consistency_group_policy) ? $this->source_consistency_group_policy : ''; + } + + public function hasSourceConsistencyGroupPolicy() + { + return isset($this->source_consistency_group_policy); + } + + public function clearSourceConsistencyGroupPolicy() + { + unset($this->source_consistency_group_policy); + } + + /** + * The URL of the DiskConsistencyGroupPolicy for the group of disks to clone. This may be a full or partial URL, such as: - https://www.googleapis.com/compute/v1/projects/project/regions/region /resourcePolicies/resourcePolicy - projects/project/regions/region/resourcePolicies/resourcePolicy - regions/region/resourcePolicies/resourcePolicy + * + * Generated from protobuf field optional string source_consistency_group_policy = 19616093; + * @param string $var + * @return $this + */ + public function setSourceConsistencyGroupPolicy($var) + { + GPBUtil::checkString($var, True); + $this->source_consistency_group_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertInstanceRequest.php new file mode 100644 index 000000000000..27a57ccdb4b9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertInstanceRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.BulkInsertInstanceRequest + */ +class BulkInsertInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BulkInsertInstanceResource bulk_insert_instance_resource_resource = 41427278 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $bulk_insert_instance_resource_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param \Google\Cloud\Compute\V1\BulkInsertInstanceResource $bulkInsertInstanceResourceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\BulkInsertInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, \Google\Cloud\Compute\V1\BulkInsertInstanceResource $bulkInsertInstanceResourceResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setBulkInsertInstanceResourceResource($bulkInsertInstanceResourceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\BulkInsertInstanceResource $bulk_insert_instance_resource_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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BulkInsertInstanceResource bulk_insert_instance_resource_resource = 41427278 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\BulkInsertInstanceResource|null + */ + public function getBulkInsertInstanceResourceResource() + { + return $this->bulk_insert_instance_resource_resource; + } + + public function hasBulkInsertInstanceResourceResource() + { + return isset($this->bulk_insert_instance_resource_resource); + } + + public function clearBulkInsertInstanceResourceResource() + { + unset($this->bulk_insert_instance_resource_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BulkInsertInstanceResource bulk_insert_instance_resource_resource = 41427278 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\BulkInsertInstanceResource $var + * @return $this + */ + public function setBulkInsertInstanceResourceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BulkInsertInstanceResource::class); + $this->bulk_insert_instance_resource_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertInstanceResource.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertInstanceResource.php new file mode 100644 index 000000000000..d97bc03f69ac --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertInstanceResource.php @@ -0,0 +1,331 @@ +google.cloud.compute.v1.BulkInsertInstanceResource + */ +class BulkInsertInstanceResource extends \Google\Protobuf\Internal\Message +{ + /** + * The maximum number of instances to create. + * + * Generated from protobuf field optional int64 count = 94851343; + */ + protected $count = null; + /** + * The instance properties defining the VM instances to be created. Required if sourceInstanceTemplate is not provided. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceProperties instance_properties = 215355165; + */ + protected $instance_properties = null; + /** + * Policy for chosing target zone. For more information, see Create VMs in bulk . + * + * Generated from protobuf field optional .google.cloud.compute.v1.LocationPolicy location_policy = 465689852; + */ + protected $location_policy = null; + /** + * The minimum number of instances to create. If no min_count is specified then count is used as the default value. If min_count instances cannot be created, then no instances will be created and instances already created will be deleted. + * + * Generated from protobuf field optional int64 min_count = 523228386; + */ + protected $min_count = null; + /** + * The string pattern used for the names of the VMs. Either name_pattern or per_instance_properties must be set. The pattern must contain one continuous sequence of placeholder hash characters (#) with each character corresponding to one digit of the generated instance name. Example: a name_pattern of inst-#### generates instance names such as inst-0001 and inst-0002. If existing instances in the same project and zone have names that match the name pattern then the generated instance numbers start after the biggest existing number. For example, if there exists an instance with name inst-0050, then instance names generated using the pattern inst-#### begin with inst-0051. The name pattern placeholder #...# can contain up to 18 characters. + * + * Generated from protobuf field optional string name_pattern = 413815260; + */ + protected $name_pattern = null; + /** + * Per-instance properties to be set on individual instances. Keys of this map specify requested instance names. Can be empty if name_pattern is used. + * + * Generated from protobuf field map per_instance_properties = 108502267; + */ + private $per_instance_properties; + /** + * Specifies the instance template from which to create instances. You may combine sourceInstanceTemplate with instanceProperties to override specific values from an existing instance template. Bulk API follows the semantics of JSON Merge Patch described by RFC 7396. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project /global/instanceTemplates/instanceTemplate - projects/project/global/instanceTemplates/instanceTemplate - global/instanceTemplates/instanceTemplate This field is optional. + * + * Generated from protobuf field optional string source_instance_template = 332423616; + */ + protected $source_instance_template = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $count + * The maximum number of instances to create. + * @type \Google\Cloud\Compute\V1\InstanceProperties $instance_properties + * The instance properties defining the VM instances to be created. Required if sourceInstanceTemplate is not provided. + * @type \Google\Cloud\Compute\V1\LocationPolicy $location_policy + * Policy for chosing target zone. For more information, see Create VMs in bulk . + * @type int|string $min_count + * The minimum number of instances to create. If no min_count is specified then count is used as the default value. If min_count instances cannot be created, then no instances will be created and instances already created will be deleted. + * @type string $name_pattern + * The string pattern used for the names of the VMs. Either name_pattern or per_instance_properties must be set. The pattern must contain one continuous sequence of placeholder hash characters (#) with each character corresponding to one digit of the generated instance name. Example: a name_pattern of inst-#### generates instance names such as inst-0001 and inst-0002. If existing instances in the same project and zone have names that match the name pattern then the generated instance numbers start after the biggest existing number. For example, if there exists an instance with name inst-0050, then instance names generated using the pattern inst-#### begin with inst-0051. The name pattern placeholder #...# can contain up to 18 characters. + * @type array|\Google\Protobuf\Internal\MapField $per_instance_properties + * Per-instance properties to be set on individual instances. Keys of this map specify requested instance names. Can be empty if name_pattern is used. + * @type string $source_instance_template + * Specifies the instance template from which to create instances. You may combine sourceInstanceTemplate with instanceProperties to override specific values from an existing instance template. Bulk API follows the semantics of JSON Merge Patch described by RFC 7396. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project /global/instanceTemplates/instanceTemplate - projects/project/global/instanceTemplates/instanceTemplate - global/instanceTemplates/instanceTemplate This field is optional. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The maximum number of instances to create. + * + * Generated from protobuf field optional int64 count = 94851343; + * @return int|string + */ + public function getCount() + { + return isset($this->count) ? $this->count : 0; + } + + public function hasCount() + { + return isset($this->count); + } + + public function clearCount() + { + unset($this->count); + } + + /** + * The maximum number of instances to create. + * + * Generated from protobuf field optional int64 count = 94851343; + * @param int|string $var + * @return $this + */ + public function setCount($var) + { + GPBUtil::checkInt64($var); + $this->count = $var; + + return $this; + } + + /** + * The instance properties defining the VM instances to be created. Required if sourceInstanceTemplate is not provided. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceProperties instance_properties = 215355165; + * @return \Google\Cloud\Compute\V1\InstanceProperties|null + */ + public function getInstanceProperties() + { + return $this->instance_properties; + } + + public function hasInstanceProperties() + { + return isset($this->instance_properties); + } + + public function clearInstanceProperties() + { + unset($this->instance_properties); + } + + /** + * The instance properties defining the VM instances to be created. Required if sourceInstanceTemplate is not provided. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceProperties instance_properties = 215355165; + * @param \Google\Cloud\Compute\V1\InstanceProperties $var + * @return $this + */ + public function setInstanceProperties($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceProperties::class); + $this->instance_properties = $var; + + return $this; + } + + /** + * Policy for chosing target zone. For more information, see Create VMs in bulk . + * + * Generated from protobuf field optional .google.cloud.compute.v1.LocationPolicy location_policy = 465689852; + * @return \Google\Cloud\Compute\V1\LocationPolicy|null + */ + public function getLocationPolicy() + { + return $this->location_policy; + } + + public function hasLocationPolicy() + { + return isset($this->location_policy); + } + + public function clearLocationPolicy() + { + unset($this->location_policy); + } + + /** + * Policy for chosing target zone. For more information, see Create VMs in bulk . + * + * Generated from protobuf field optional .google.cloud.compute.v1.LocationPolicy location_policy = 465689852; + * @param \Google\Cloud\Compute\V1\LocationPolicy $var + * @return $this + */ + public function setLocationPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\LocationPolicy::class); + $this->location_policy = $var; + + return $this; + } + + /** + * The minimum number of instances to create. If no min_count is specified then count is used as the default value. If min_count instances cannot be created, then no instances will be created and instances already created will be deleted. + * + * Generated from protobuf field optional int64 min_count = 523228386; + * @return int|string + */ + public function getMinCount() + { + return isset($this->min_count) ? $this->min_count : 0; + } + + public function hasMinCount() + { + return isset($this->min_count); + } + + public function clearMinCount() + { + unset($this->min_count); + } + + /** + * The minimum number of instances to create. If no min_count is specified then count is used as the default value. If min_count instances cannot be created, then no instances will be created and instances already created will be deleted. + * + * Generated from protobuf field optional int64 min_count = 523228386; + * @param int|string $var + * @return $this + */ + public function setMinCount($var) + { + GPBUtil::checkInt64($var); + $this->min_count = $var; + + return $this; + } + + /** + * The string pattern used for the names of the VMs. Either name_pattern or per_instance_properties must be set. The pattern must contain one continuous sequence of placeholder hash characters (#) with each character corresponding to one digit of the generated instance name. Example: a name_pattern of inst-#### generates instance names such as inst-0001 and inst-0002. If existing instances in the same project and zone have names that match the name pattern then the generated instance numbers start after the biggest existing number. For example, if there exists an instance with name inst-0050, then instance names generated using the pattern inst-#### begin with inst-0051. The name pattern placeholder #...# can contain up to 18 characters. + * + * Generated from protobuf field optional string name_pattern = 413815260; + * @return string + */ + public function getNamePattern() + { + return isset($this->name_pattern) ? $this->name_pattern : ''; + } + + public function hasNamePattern() + { + return isset($this->name_pattern); + } + + public function clearNamePattern() + { + unset($this->name_pattern); + } + + /** + * The string pattern used for the names of the VMs. Either name_pattern or per_instance_properties must be set. The pattern must contain one continuous sequence of placeholder hash characters (#) with each character corresponding to one digit of the generated instance name. Example: a name_pattern of inst-#### generates instance names such as inst-0001 and inst-0002. If existing instances in the same project and zone have names that match the name pattern then the generated instance numbers start after the biggest existing number. For example, if there exists an instance with name inst-0050, then instance names generated using the pattern inst-#### begin with inst-0051. The name pattern placeholder #...# can contain up to 18 characters. + * + * Generated from protobuf field optional string name_pattern = 413815260; + * @param string $var + * @return $this + */ + public function setNamePattern($var) + { + GPBUtil::checkString($var, True); + $this->name_pattern = $var; + + return $this; + } + + /** + * Per-instance properties to be set on individual instances. Keys of this map specify requested instance names. Can be empty if name_pattern is used. + * + * Generated from protobuf field map per_instance_properties = 108502267; + * @return \Google\Protobuf\Internal\MapField + */ + public function getPerInstanceProperties() + { + return $this->per_instance_properties; + } + + /** + * Per-instance properties to be set on individual instances. Keys of this map specify requested instance names. Can be empty if name_pattern is used. + * + * Generated from protobuf field map per_instance_properties = 108502267; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setPerInstanceProperties($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\BulkInsertInstanceResourcePerInstanceProperties::class); + $this->per_instance_properties = $arr; + + return $this; + } + + /** + * Specifies the instance template from which to create instances. You may combine sourceInstanceTemplate with instanceProperties to override specific values from an existing instance template. Bulk API follows the semantics of JSON Merge Patch described by RFC 7396. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project /global/instanceTemplates/instanceTemplate - projects/project/global/instanceTemplates/instanceTemplate - global/instanceTemplates/instanceTemplate This field is optional. + * + * Generated from protobuf field optional string source_instance_template = 332423616; + * @return string + */ + public function getSourceInstanceTemplate() + { + return isset($this->source_instance_template) ? $this->source_instance_template : ''; + } + + public function hasSourceInstanceTemplate() + { + return isset($this->source_instance_template); + } + + public function clearSourceInstanceTemplate() + { + unset($this->source_instance_template); + } + + /** + * Specifies the instance template from which to create instances. You may combine sourceInstanceTemplate with instanceProperties to override specific values from an existing instance template. Bulk API follows the semantics of JSON Merge Patch described by RFC 7396. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project /global/instanceTemplates/instanceTemplate - projects/project/global/instanceTemplates/instanceTemplate - global/instanceTemplates/instanceTemplate This field is optional. + * + * Generated from protobuf field optional string source_instance_template = 332423616; + * @param string $var + * @return $this + */ + public function setSourceInstanceTemplate($var) + { + GPBUtil::checkString($var, True); + $this->source_instance_template = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertInstanceResourcePerInstanceProperties.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertInstanceResourcePerInstanceProperties.php new file mode 100644 index 000000000000..394fdae695c9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertInstanceResourcePerInstanceProperties.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties + */ +class BulkInsertInstanceResourcePerInstanceProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies the hostname of the instance. More details in: https://cloud.google.com/compute/docs/instances/custom-hostname-vm#naming_convention + * + * Generated from protobuf field optional string hostname = 237067315; + */ + protected $hostname = null; + /** + * This field is only temporary. It will be removed. Do not use it. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $hostname + * Specifies the hostname of the instance. More details in: https://cloud.google.com/compute/docs/instances/custom-hostname-vm#naming_convention + * @type string $name + * This field is only temporary. It will be removed. Do not use it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies the hostname of the instance. More details in: https://cloud.google.com/compute/docs/instances/custom-hostname-vm#naming_convention + * + * Generated from protobuf field optional string hostname = 237067315; + * @return string + */ + public function getHostname() + { + return isset($this->hostname) ? $this->hostname : ''; + } + + public function hasHostname() + { + return isset($this->hostname); + } + + public function clearHostname() + { + unset($this->hostname); + } + + /** + * Specifies the hostname of the instance. More details in: https://cloud.google.com/compute/docs/instances/custom-hostname-vm#naming_convention + * + * Generated from protobuf field optional string hostname = 237067315; + * @param string $var + * @return $this + */ + public function setHostname($var) + { + GPBUtil::checkString($var, True); + $this->hostname = $var; + + return $this; + } + + /** + * This field is only temporary. It will be removed. Do not use it. + * + * 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); + } + + /** + * This field is only temporary. It will be removed. Do not use it. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertOperationStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertOperationStatus.php new file mode 100644 index 000000000000..7a4be2a061f4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertOperationStatus.php @@ -0,0 +1,256 @@ +google.cloud.compute.v1.BulkInsertOperationStatus + */ +class BulkInsertOperationStatus extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Count of VMs successfully created so far. + * + * Generated from protobuf field optional int32 created_vm_count = 396924158; + */ + protected $created_vm_count = null; + /** + * [Output Only] Count of VMs that got deleted during rollback. + * + * Generated from protobuf field optional int32 deleted_vm_count = 271756013; + */ + protected $deleted_vm_count = null; + /** + * [Output Only] Count of VMs that started creating but encountered an error. + * + * Generated from protobuf field optional int32 failed_to_create_vm_count = 58384104; + */ + protected $failed_to_create_vm_count = null; + /** + * [Output Only] Creation status of BulkInsert operation - information if the flow is rolling forward or rolling back. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + /** + * [Output Only] Count of VMs originally planned to be created. + * + * Generated from protobuf field optional int32 target_vm_count = 532975733; + */ + protected $target_vm_count = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $created_vm_count + * [Output Only] Count of VMs successfully created so far. + * @type int $deleted_vm_count + * [Output Only] Count of VMs that got deleted during rollback. + * @type int $failed_to_create_vm_count + * [Output Only] Count of VMs that started creating but encountered an error. + * @type string $status + * [Output Only] Creation status of BulkInsert operation - information if the flow is rolling forward or rolling back. + * Check the Status enum for the list of possible values. + * @type int $target_vm_count + * [Output Only] Count of VMs originally planned to be created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Count of VMs successfully created so far. + * + * Generated from protobuf field optional int32 created_vm_count = 396924158; + * @return int + */ + public function getCreatedVmCount() + { + return isset($this->created_vm_count) ? $this->created_vm_count : 0; + } + + public function hasCreatedVmCount() + { + return isset($this->created_vm_count); + } + + public function clearCreatedVmCount() + { + unset($this->created_vm_count); + } + + /** + * [Output Only] Count of VMs successfully created so far. + * + * Generated from protobuf field optional int32 created_vm_count = 396924158; + * @param int $var + * @return $this + */ + public function setCreatedVmCount($var) + { + GPBUtil::checkInt32($var); + $this->created_vm_count = $var; + + return $this; + } + + /** + * [Output Only] Count of VMs that got deleted during rollback. + * + * Generated from protobuf field optional int32 deleted_vm_count = 271756013; + * @return int + */ + public function getDeletedVmCount() + { + return isset($this->deleted_vm_count) ? $this->deleted_vm_count : 0; + } + + public function hasDeletedVmCount() + { + return isset($this->deleted_vm_count); + } + + public function clearDeletedVmCount() + { + unset($this->deleted_vm_count); + } + + /** + * [Output Only] Count of VMs that got deleted during rollback. + * + * Generated from protobuf field optional int32 deleted_vm_count = 271756013; + * @param int $var + * @return $this + */ + public function setDeletedVmCount($var) + { + GPBUtil::checkInt32($var); + $this->deleted_vm_count = $var; + + return $this; + } + + /** + * [Output Only] Count of VMs that started creating but encountered an error. + * + * Generated from protobuf field optional int32 failed_to_create_vm_count = 58384104; + * @return int + */ + public function getFailedToCreateVmCount() + { + return isset($this->failed_to_create_vm_count) ? $this->failed_to_create_vm_count : 0; + } + + public function hasFailedToCreateVmCount() + { + return isset($this->failed_to_create_vm_count); + } + + public function clearFailedToCreateVmCount() + { + unset($this->failed_to_create_vm_count); + } + + /** + * [Output Only] Count of VMs that started creating but encountered an error. + * + * Generated from protobuf field optional int32 failed_to_create_vm_count = 58384104; + * @param int $var + * @return $this + */ + public function setFailedToCreateVmCount($var) + { + GPBUtil::checkInt32($var); + $this->failed_to_create_vm_count = $var; + + return $this; + } + + /** + * [Output Only] Creation status of BulkInsert operation - information if the flow is rolling forward or rolling back. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] Creation status of BulkInsert operation - information if the flow is rolling forward or rolling back. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + + /** + * [Output Only] Count of VMs originally planned to be created. + * + * Generated from protobuf field optional int32 target_vm_count = 532975733; + * @return int + */ + public function getTargetVmCount() + { + return isset($this->target_vm_count) ? $this->target_vm_count : 0; + } + + public function hasTargetVmCount() + { + return isset($this->target_vm_count); + } + + public function clearTargetVmCount() + { + unset($this->target_vm_count); + } + + /** + * [Output Only] Count of VMs originally planned to be created. + * + * Generated from protobuf field optional int32 target_vm_count = 532975733; + * @param int $var + * @return $this + */ + public function setTargetVmCount($var) + { + GPBUtil::checkInt32($var); + $this->target_vm_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertOperationStatus/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertOperationStatus/Status.php new file mode 100644 index 000000000000..320c0e52cfe6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertOperationStatus/Status.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.BulkInsertOperationStatus.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * Rolling forward - creating VMs. + * + * Generated from protobuf enum CREATING = 455564985; + */ + const CREATING = 455564985; + /** + * Done + * + * Generated from protobuf enum DONE = 2104194; + */ + const DONE = 2104194; + /** + * Rolling back - cleaning up after an error. + * + * Generated from protobuf enum ROLLING_BACK = 259411649; + */ + const ROLLING_BACK = 259411649; + /** + * Generated from protobuf enum STATUS_UNSPECIFIED = 42133066; + */ + const STATUS_UNSPECIFIED = 42133066; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::CREATING => 'CREATING', + self::DONE => 'DONE', + self::ROLLING_BACK => 'ROLLING_BACK', + self::STATUS_UNSPECIFIED => 'STATUS_UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\BulkInsertOperationStatus_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertRegionDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertRegionDiskRequest.php new file mode 100644 index 000000000000..751f8b18af09 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertRegionDiskRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.BulkInsertRegionDiskRequest + */ +class BulkInsertRegionDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BulkInsertDiskResource bulk_insert_disk_resource_resource = 289799382 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $bulk_insert_disk_resource_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"]; + */ + protected $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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param \Google\Cloud\Compute\V1\BulkInsertDiskResource $bulkInsertDiskResourceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\BulkInsertRegionDiskRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\BulkInsertDiskResource $bulkInsertDiskResourceResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setBulkInsertDiskResourceResource($bulkInsertDiskResourceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\BulkInsertDiskResource $bulk_insert_disk_resource_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.BulkInsertDiskResource bulk_insert_disk_resource_resource = 289799382 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\BulkInsertDiskResource|null + */ + public function getBulkInsertDiskResourceResource() + { + return $this->bulk_insert_disk_resource_resource; + } + + public function hasBulkInsertDiskResourceResource() + { + return isset($this->bulk_insert_disk_resource_resource); + } + + public function clearBulkInsertDiskResourceResource() + { + unset($this->bulk_insert_disk_resource_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BulkInsertDiskResource bulk_insert_disk_resource_resource = 289799382 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\BulkInsertDiskResource $var + * @return $this + */ + public function setBulkInsertDiskResourceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BulkInsertDiskResource::class); + $this->bulk_insert_disk_resource_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertRegionInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertRegionInstanceRequest.php new file mode 100644 index 000000000000..33f6340d830f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BulkInsertRegionInstanceRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.BulkInsertRegionInstanceRequest + */ +class BulkInsertRegionInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BulkInsertInstanceResource bulk_insert_instance_resource_resource = 41427278 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $bulk_insert_instance_resource_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"]; + */ + protected $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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param \Google\Cloud\Compute\V1\BulkInsertInstanceResource $bulkInsertInstanceResourceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\BulkInsertRegionInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\BulkInsertInstanceResource $bulkInsertInstanceResourceResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setBulkInsertInstanceResourceResource($bulkInsertInstanceResourceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\BulkInsertInstanceResource $bulk_insert_instance_resource_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.BulkInsertInstanceResource bulk_insert_instance_resource_resource = 41427278 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\BulkInsertInstanceResource|null + */ + public function getBulkInsertInstanceResourceResource() + { + return $this->bulk_insert_instance_resource_resource; + } + + public function hasBulkInsertInstanceResourceResource() + { + return isset($this->bulk_insert_instance_resource_resource); + } + + public function clearBulkInsertInstanceResourceResource() + { + unset($this->bulk_insert_instance_resource_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BulkInsertInstanceResource bulk_insert_instance_resource_resource = 41427278 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\BulkInsertInstanceResource $var + * @return $this + */ + public function setBulkInsertInstanceResourceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BulkInsertInstanceResource::class); + $this->bulk_insert_instance_resource_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CacheInvalidationRule.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CacheInvalidationRule.php new file mode 100644 index 000000000000..2feb2eee247c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CacheInvalidationRule.php @@ -0,0 +1,113 @@ +google.cloud.compute.v1.CacheInvalidationRule + */ +class CacheInvalidationRule extends \Google\Protobuf\Internal\Message +{ + /** + * If set, this invalidation rule will only apply to requests with a Host header matching host. + * + * Generated from protobuf field optional string host = 3208616; + */ + protected $host = null; + /** + * Generated from protobuf field optional string path = 3433509; + */ + protected $path = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $host + * If set, this invalidation rule will only apply to requests with a Host header matching host. + * @type string $path + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * If set, this invalidation rule will only apply to requests with a Host header matching host. + * + * Generated from protobuf field optional string host = 3208616; + * @return string + */ + public function getHost() + { + return isset($this->host) ? $this->host : ''; + } + + public function hasHost() + { + return isset($this->host); + } + + public function clearHost() + { + unset($this->host); + } + + /** + * If set, this invalidation rule will only apply to requests with a Host header matching host. + * + * Generated from protobuf field optional string host = 3208616; + * @param string $var + * @return $this + */ + public function setHost($var) + { + GPBUtil::checkString($var, True); + $this->host = $var; + + return $this; + } + + /** + * Generated from protobuf field optional string path = 3433509; + * @return string + */ + public function getPath() + { + return isset($this->path) ? $this->path : ''; + } + + public function hasPath() + { + return isset($this->path); + } + + public function clearPath() + { + unset($this->path); + } + + /** + * Generated from protobuf field optional string path = 3433509; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CacheKeyPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CacheKeyPolicy.php new file mode 100644 index 000000000000..e2b55657b05b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CacheKeyPolicy.php @@ -0,0 +1,301 @@ +google.cloud.compute.v1.CacheKeyPolicy + */ +class CacheKeyPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * If true, requests to different hosts will be cached separately. + * + * Generated from protobuf field optional bool include_host = 486867679; + */ + protected $include_host = null; + /** + * Allows HTTP request headers (by name) to be used in the cache key. + * + * Generated from protobuf field repeated string include_http_headers = 2489606; + */ + private $include_http_headers; + /** + * Allows HTTP cookies (by name) to be used in the cache key. The name=value pair will be used in the cache key Cloud CDN generates. + * + * Generated from protobuf field repeated string include_named_cookies = 87316530; + */ + private $include_named_cookies; + /** + * If true, http and https requests will be cached separately. + * + * Generated from protobuf field optional bool include_protocol = 303507535; + */ + protected $include_protocol = null; + /** + * If true, include query string parameters in the cache key according to query_string_whitelist and query_string_blacklist. If neither is set, the entire query string will be included. If false, the query string will be excluded from the cache key entirely. + * + * Generated from protobuf field optional bool include_query_string = 474036639; + */ + protected $include_query_string = null; + /** + * Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters. + * + * Generated from protobuf field repeated string query_string_blacklist = 354964742; + */ + private $query_string_blacklist; + /** + * Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters. + * + * Generated from protobuf field repeated string query_string_whitelist = 52456496; + */ + private $query_string_whitelist; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $include_host + * If true, requests to different hosts will be cached separately. + * @type array|\Google\Protobuf\Internal\RepeatedField $include_http_headers + * Allows HTTP request headers (by name) to be used in the cache key. + * @type array|\Google\Protobuf\Internal\RepeatedField $include_named_cookies + * Allows HTTP cookies (by name) to be used in the cache key. The name=value pair will be used in the cache key Cloud CDN generates. + * @type bool $include_protocol + * If true, http and https requests will be cached separately. + * @type bool $include_query_string + * If true, include query string parameters in the cache key according to query_string_whitelist and query_string_blacklist. If neither is set, the entire query string will be included. If false, the query string will be excluded from the cache key entirely. + * @type array|\Google\Protobuf\Internal\RepeatedField $query_string_blacklist + * Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters. + * @type array|\Google\Protobuf\Internal\RepeatedField $query_string_whitelist + * Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * If true, requests to different hosts will be cached separately. + * + * Generated from protobuf field optional bool include_host = 486867679; + * @return bool + */ + public function getIncludeHost() + { + return isset($this->include_host) ? $this->include_host : false; + } + + public function hasIncludeHost() + { + return isset($this->include_host); + } + + public function clearIncludeHost() + { + unset($this->include_host); + } + + /** + * If true, requests to different hosts will be cached separately. + * + * Generated from protobuf field optional bool include_host = 486867679; + * @param bool $var + * @return $this + */ + public function setIncludeHost($var) + { + GPBUtil::checkBool($var); + $this->include_host = $var; + + return $this; + } + + /** + * Allows HTTP request headers (by name) to be used in the cache key. + * + * Generated from protobuf field repeated string include_http_headers = 2489606; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIncludeHttpHeaders() + { + return $this->include_http_headers; + } + + /** + * Allows HTTP request headers (by name) to be used in the cache key. + * + * Generated from protobuf field repeated string include_http_headers = 2489606; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIncludeHttpHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->include_http_headers = $arr; + + return $this; + } + + /** + * Allows HTTP cookies (by name) to be used in the cache key. The name=value pair will be used in the cache key Cloud CDN generates. + * + * Generated from protobuf field repeated string include_named_cookies = 87316530; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIncludeNamedCookies() + { + return $this->include_named_cookies; + } + + /** + * Allows HTTP cookies (by name) to be used in the cache key. The name=value pair will be used in the cache key Cloud CDN generates. + * + * Generated from protobuf field repeated string include_named_cookies = 87316530; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIncludeNamedCookies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->include_named_cookies = $arr; + + return $this; + } + + /** + * If true, http and https requests will be cached separately. + * + * Generated from protobuf field optional bool include_protocol = 303507535; + * @return bool + */ + public function getIncludeProtocol() + { + return isset($this->include_protocol) ? $this->include_protocol : false; + } + + public function hasIncludeProtocol() + { + return isset($this->include_protocol); + } + + public function clearIncludeProtocol() + { + unset($this->include_protocol); + } + + /** + * If true, http and https requests will be cached separately. + * + * Generated from protobuf field optional bool include_protocol = 303507535; + * @param bool $var + * @return $this + */ + public function setIncludeProtocol($var) + { + GPBUtil::checkBool($var); + $this->include_protocol = $var; + + return $this; + } + + /** + * If true, include query string parameters in the cache key according to query_string_whitelist and query_string_blacklist. If neither is set, the entire query string will be included. If false, the query string will be excluded from the cache key entirely. + * + * Generated from protobuf field optional bool include_query_string = 474036639; + * @return bool + */ + public function getIncludeQueryString() + { + return isset($this->include_query_string) ? $this->include_query_string : false; + } + + public function hasIncludeQueryString() + { + return isset($this->include_query_string); + } + + public function clearIncludeQueryString() + { + unset($this->include_query_string); + } + + /** + * If true, include query string parameters in the cache key according to query_string_whitelist and query_string_blacklist. If neither is set, the entire query string will be included. If false, the query string will be excluded from the cache key entirely. + * + * Generated from protobuf field optional bool include_query_string = 474036639; + * @param bool $var + * @return $this + */ + public function setIncludeQueryString($var) + { + GPBUtil::checkBool($var); + $this->include_query_string = $var; + + return $this; + } + + /** + * Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters. + * + * Generated from protobuf field repeated string query_string_blacklist = 354964742; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQueryStringBlacklist() + { + return $this->query_string_blacklist; + } + + /** + * Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters. + * + * Generated from protobuf field repeated string query_string_blacklist = 354964742; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQueryStringBlacklist($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->query_string_blacklist = $arr; + + return $this; + } + + /** + * Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters. + * + * Generated from protobuf field repeated string query_string_whitelist = 52456496; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQueryStringWhitelist() + { + return $this->query_string_whitelist; + } + + /** + * Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters. + * + * Generated from protobuf field repeated string query_string_whitelist = 52456496; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQueryStringWhitelist($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->query_string_whitelist = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CancelInstanceGroupManagerResizeRequestRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CancelInstanceGroupManagerResizeRequestRequest.php new file mode 100644 index 000000000000..56e9f3608759 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CancelInstanceGroupManagerResizeRequestRequest.php @@ -0,0 +1,232 @@ +google.cloud.compute.v1.CancelInstanceGroupManagerResizeRequestRequest + */ +class CancelInstanceGroupManagerResizeRequestRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group. The name should conform to RFC1035 or be a resource ID. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the resize request to cancel. The name should conform to RFC1035 or be a resource ID. + * + * Generated from protobuf field string resize_request = 216941060 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resize_request = ''; + /** + * The name of the zone where the managed instance group is located. The name should conform to RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. The name should conform to RFC1035. + * @param string $instanceGroupManager The name of the managed instance group. The name should conform to RFC1035 or be a resource ID. + * @param string $resizeRequest The name of the resize request to cancel. The name should conform to RFC1035 or be a resource ID. + * + * @return \Google\Cloud\Compute\V1\CancelInstanceGroupManagerResizeRequestRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager, string $resizeRequest): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager) + ->setResizeRequest($resizeRequest); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group. The name should conform to RFC1035 or be a resource ID. + * @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 $resize_request + * The name of the resize request to cancel. The name should conform to RFC1035 or be a resource ID. + * @type string $zone + * The name of the zone where the managed instance group is located. The name should conform to RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the managed instance group. The name should conform to RFC1035 or be a resource ID. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. The name should conform to RFC1035 or be a resource ID. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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 resize request to cancel. The name should conform to RFC1035 or be a resource ID. + * + * Generated from protobuf field string resize_request = 216941060 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResizeRequest() + { + return $this->resize_request; + } + + /** + * The name of the resize request to cancel. The name should conform to RFC1035 or be a resource ID. + * + * Generated from protobuf field string resize_request = 216941060 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResizeRequest($var) + { + GPBUtil::checkString($var, True); + $this->resize_request = $var; + + return $this; + } + + /** + * The name of the zone where the managed instance group is located. The name should conform to RFC1035. + * + * 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 where the managed instance group is located. The name should conform to RFC1035. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CircuitBreakers.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CircuitBreakers.php new file mode 100644 index 000000000000..d996fe70835a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CircuitBreakers.php @@ -0,0 +1,253 @@ +google.cloud.compute.v1.CircuitBreakers + */ +class CircuitBreakers extends \Google\Protobuf\Internal\Message +{ + /** + * The maximum number of connections to the backend service. If not specified, there is no limit. Not 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. + * + * Generated from protobuf field optional int32 max_connections = 110652154; + */ + protected $max_connections = null; + /** + * The maximum number of pending requests allowed to the backend service. If not specified, there is no limit. Not 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. + * + * Generated from protobuf field optional int32 max_pending_requests = 375558887; + */ + protected $max_pending_requests = null; + /** + * The maximum number of parallel requests that allowed to the backend service. If not specified, there is no limit. + * + * Generated from protobuf field optional int32 max_requests = 28097599; + */ + protected $max_requests = null; + /** + * Maximum requests for a single connection to the backend service. This parameter is respected by both the HTTP/1.1 and HTTP/2 implementations. If not specified, there is no limit. Setting this parameter to 1 will effectively disable keep alive. Not 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. + * + * Generated from protobuf field optional int32 max_requests_per_connection = 361630528; + */ + protected $max_requests_per_connection = null; + /** + * The maximum number of parallel retries allowed to the backend cluster. If not specified, the default is 1. Not 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. + * + * Generated from protobuf field optional int32 max_retries = 55546219; + */ + protected $max_retries = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $max_connections + * The maximum number of connections to the backend service. If not specified, there is no limit. Not 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. + * @type int $max_pending_requests + * The maximum number of pending requests allowed to the backend service. If not specified, there is no limit. Not 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. + * @type int $max_requests + * The maximum number of parallel requests that allowed to the backend service. If not specified, there is no limit. + * @type int $max_requests_per_connection + * Maximum requests for a single connection to the backend service. This parameter is respected by both the HTTP/1.1 and HTTP/2 implementations. If not specified, there is no limit. Setting this parameter to 1 will effectively disable keep alive. Not 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. + * @type int $max_retries + * The maximum number of parallel retries allowed to the backend cluster. If not specified, the default is 1. Not 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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The maximum number of connections to the backend service. If not specified, there is no limit. Not 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. + * + * Generated from protobuf field optional int32 max_connections = 110652154; + * @return int + */ + public function getMaxConnections() + { + return isset($this->max_connections) ? $this->max_connections : 0; + } + + public function hasMaxConnections() + { + return isset($this->max_connections); + } + + public function clearMaxConnections() + { + unset($this->max_connections); + } + + /** + * The maximum number of connections to the backend service. If not specified, there is no limit. Not 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. + * + * Generated from protobuf field optional int32 max_connections = 110652154; + * @param int $var + * @return $this + */ + public function setMaxConnections($var) + { + GPBUtil::checkInt32($var); + $this->max_connections = $var; + + return $this; + } + + /** + * The maximum number of pending requests allowed to the backend service. If not specified, there is no limit. Not 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. + * + * Generated from protobuf field optional int32 max_pending_requests = 375558887; + * @return int + */ + public function getMaxPendingRequests() + { + return isset($this->max_pending_requests) ? $this->max_pending_requests : 0; + } + + public function hasMaxPendingRequests() + { + return isset($this->max_pending_requests); + } + + public function clearMaxPendingRequests() + { + unset($this->max_pending_requests); + } + + /** + * The maximum number of pending requests allowed to the backend service. If not specified, there is no limit. Not 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. + * + * Generated from protobuf field optional int32 max_pending_requests = 375558887; + * @param int $var + * @return $this + */ + public function setMaxPendingRequests($var) + { + GPBUtil::checkInt32($var); + $this->max_pending_requests = $var; + + return $this; + } + + /** + * The maximum number of parallel requests that allowed to the backend service. If not specified, there is no limit. + * + * Generated from protobuf field optional int32 max_requests = 28097599; + * @return int + */ + public function getMaxRequests() + { + return isset($this->max_requests) ? $this->max_requests : 0; + } + + public function hasMaxRequests() + { + return isset($this->max_requests); + } + + public function clearMaxRequests() + { + unset($this->max_requests); + } + + /** + * The maximum number of parallel requests that allowed to the backend service. If not specified, there is no limit. + * + * Generated from protobuf field optional int32 max_requests = 28097599; + * @param int $var + * @return $this + */ + public function setMaxRequests($var) + { + GPBUtil::checkInt32($var); + $this->max_requests = $var; + + return $this; + } + + /** + * Maximum requests for a single connection to the backend service. This parameter is respected by both the HTTP/1.1 and HTTP/2 implementations. If not specified, there is no limit. Setting this parameter to 1 will effectively disable keep alive. Not 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. + * + * Generated from protobuf field optional int32 max_requests_per_connection = 361630528; + * @return int + */ + public function getMaxRequestsPerConnection() + { + return isset($this->max_requests_per_connection) ? $this->max_requests_per_connection : 0; + } + + public function hasMaxRequestsPerConnection() + { + return isset($this->max_requests_per_connection); + } + + public function clearMaxRequestsPerConnection() + { + unset($this->max_requests_per_connection); + } + + /** + * Maximum requests for a single connection to the backend service. This parameter is respected by both the HTTP/1.1 and HTTP/2 implementations. If not specified, there is no limit. Setting this parameter to 1 will effectively disable keep alive. Not 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. + * + * Generated from protobuf field optional int32 max_requests_per_connection = 361630528; + * @param int $var + * @return $this + */ + public function setMaxRequestsPerConnection($var) + { + GPBUtil::checkInt32($var); + $this->max_requests_per_connection = $var; + + return $this; + } + + /** + * The maximum number of parallel retries allowed to the backend cluster. If not specified, the default is 1. Not 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. + * + * Generated from protobuf field optional int32 max_retries = 55546219; + * @return int + */ + public function getMaxRetries() + { + return isset($this->max_retries) ? $this->max_retries : 0; + } + + public function hasMaxRetries() + { + return isset($this->max_retries); + } + + public function clearMaxRetries() + { + unset($this->max_retries); + } + + /** + * The maximum number of parallel retries allowed to the backend cluster. If not specified, the default is 1. Not 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. + * + * Generated from protobuf field optional int32 max_retries = 55546219; + * @param int $var + * @return $this + */ + public function setMaxRetries($var) + { + GPBUtil::checkInt32($var); + $this->max_retries = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CloneRulesFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CloneRulesFirewallPolicyRequest.php new file mode 100644 index 000000000000..08c504b4bec4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CloneRulesFirewallPolicyRequest.php @@ -0,0 +1,168 @@ +google.cloud.compute.v1.CloneRulesFirewallPolicyRequest + */ +class CloneRulesFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * 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; + */ + protected $request_id = null; + /** + * The firewall policy from which to copy rules. + * + * Generated from protobuf field optional string source_firewall_policy = 25013549; + */ + protected $source_firewall_policy = null; + + /** + * @param string $firewallPolicy Name of the firewall policy to update. + * + * @return \Google\Cloud\Compute\V1\CloneRulesFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $firewallPolicy): self + { + return (new self()) + ->setFirewallPolicy($firewallPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to update. + * @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 $source_firewall_policy + * The firewall policy from which to copy rules. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $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 firewall policy from which to copy rules. + * + * Generated from protobuf field optional string source_firewall_policy = 25013549; + * @return string + */ + public function getSourceFirewallPolicy() + { + return isset($this->source_firewall_policy) ? $this->source_firewall_policy : ''; + } + + public function hasSourceFirewallPolicy() + { + return isset($this->source_firewall_policy); + } + + public function clearSourceFirewallPolicy() + { + unset($this->source_firewall_policy); + } + + /** + * The firewall policy from which to copy rules. + * + * Generated from protobuf field optional string source_firewall_policy = 25013549; + * @param string $var + * @return $this + */ + public function setSourceFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->source_firewall_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CloneRulesNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CloneRulesNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..393414f16d35 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CloneRulesNetworkFirewallPolicyRequest.php @@ -0,0 +1,204 @@ +google.cloud.compute.v1.CloneRulesNetworkFirewallPolicyRequest + */ +class CloneRulesNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The firewall policy from which to copy rules. + * + * Generated from protobuf field optional string source_firewall_policy = 25013549; + */ + protected $source_firewall_policy = null; + + /** + * @param string $project Project ID for this request. + * @param string $firewallPolicy Name of the firewall policy to update. + * + * @return \Google\Cloud\Compute\V1\CloneRulesNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $firewallPolicy): self + { + return (new self()) + ->setProject($project) + ->setFirewallPolicy($firewallPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to update. + * @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 $source_firewall_policy + * The firewall policy from which to copy rules. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $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 firewall policy from which to copy rules. + * + * Generated from protobuf field optional string source_firewall_policy = 25013549; + * @return string + */ + public function getSourceFirewallPolicy() + { + return isset($this->source_firewall_policy) ? $this->source_firewall_policy : ''; + } + + public function hasSourceFirewallPolicy() + { + return isset($this->source_firewall_policy); + } + + public function clearSourceFirewallPolicy() + { + unset($this->source_firewall_policy); + } + + /** + * The firewall policy from which to copy rules. + * + * Generated from protobuf field optional string source_firewall_policy = 25013549; + * @param string $var + * @return $this + */ + public function setSourceFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->source_firewall_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CloneRulesRegionNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CloneRulesRegionNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..3a812a3eddab --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CloneRulesRegionNetworkFirewallPolicyRequest.php @@ -0,0 +1,240 @@ +google.cloud.compute.v1.CloneRulesRegionNetworkFirewallPolicyRequest + */ +class CloneRulesRegionNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The firewall policy from which to copy rules. + * + * Generated from protobuf field optional string source_firewall_policy = 25013549; + */ + protected $source_firewall_policy = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $firewallPolicy Name of the firewall policy to update. + * + * @return \Google\Cloud\Compute\V1\CloneRulesRegionNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $firewallPolicy): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setFirewallPolicy($firewallPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to update. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 $source_firewall_policy + * The firewall policy from which to copy rules. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * The firewall policy from which to copy rules. + * + * Generated from protobuf field optional string source_firewall_policy = 25013549; + * @return string + */ + public function getSourceFirewallPolicy() + { + return isset($this->source_firewall_policy) ? $this->source_firewall_policy : ''; + } + + public function hasSourceFirewallPolicy() + { + return isset($this->source_firewall_policy); + } + + public function clearSourceFirewallPolicy() + { + unset($this->source_firewall_policy); + } + + /** + * The firewall policy from which to copy rules. + * + * Generated from protobuf field optional string source_firewall_policy = 25013549; + * @param string $var + * @return $this + */ + public function setSourceFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->source_firewall_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Commitment.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Commitment.php new file mode 100644 index 000000000000..7dff15483c03 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Commitment.php @@ -0,0 +1,933 @@ +google.cloud.compute.v1.Commitment + */ +class Commitment extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies whether to enable automatic renewal for the commitment. The default value is false if not specified. The field can be updated until the day of the commitment expiration at 12:00am PST. If the field is set to true, the commitment will be automatically renewed for either one or three years according to the terms of the existing commitment. + * + * Generated from protobuf field optional bool auto_renew = 495520765; + */ + protected $auto_renew = null; + /** + * The category of the commitment. Category MACHINE specifies commitments composed of machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE specifies commitments composed of software licenses, listed in licenseResources. Note that only MACHINE commitments should have a Type specified. + * Check the Category enum for the list of possible values. + * + * Generated from protobuf field optional string category = 50511102; + */ + protected $category = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] Commitment end time in RFC3339 text format. + * + * Generated from protobuf field optional string end_timestamp = 468096690; + */ + protected $end_timestamp = null; + /** + * Specifies the already existing reservations to attach to the Commitment. This field is optional, and it can be a full or partial URL. For example, the following are valid URLs to an reservation: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /reservations/reservation - projects/project/zones/zone/reservations/reservation + * + * Generated from protobuf field repeated string existing_reservations = 493028443; + */ + private $existing_reservations; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#commitment for commitments. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * The license specification required as part of a license commitment. + * + * Generated from protobuf field optional .google.cloud.compute.v1.LicenseResourceCommitment license_resource = 437955148; + */ + protected $license_resource = null; + /** + * List of source commitments to be merged into a new commitment. + * + * Generated from protobuf field repeated string merge_source_commitments = 188093761; + */ + private $merge_source_commitments; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * The plan for this commitment, which determines duration and discount rate. The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years). + * Check the Plan enum for the list of possible values. + * + * Generated from protobuf field optional string plan = 3443497; + */ + protected $plan = null; + /** + * [Output Only] URL of the region where this commitment may be used. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * List of create-on-create reservations for this commitment. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Reservation reservations = 399717927; + */ + private $reservations; + /** + * A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965; + */ + private $resources; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * Source commitment to be split into a new commitment. + * + * Generated from protobuf field optional string split_source_commitment = 402611156; + */ + protected $split_source_commitment = null; + /** + * [Output Only] Commitment start time in RFC3339 text format. + * + * Generated from protobuf field optional string start_timestamp = 83645817; + */ + protected $start_timestamp = null; + /** + * [Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + /** + * [Output Only] An optional, human-readable explanation of the status. + * + * Generated from protobuf field optional string status_message = 297428154; + */ + protected $status_message = null; + /** + * The type of commitment, which affects the discount rate and the eligible resources. Type MEMORY_OPTIMIZED specifies a commitment that will only apply to memory optimized machines. Type ACCELERATOR_OPTIMIZED specifies a commitment that will only apply to accelerator optimized machines. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $auto_renew + * Specifies whether to enable automatic renewal for the commitment. The default value is false if not specified. The field can be updated until the day of the commitment expiration at 12:00am PST. If the field is set to true, the commitment will be automatically renewed for either one or three years according to the terms of the existing commitment. + * @type string $category + * The category of the commitment. Category MACHINE specifies commitments composed of machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE specifies commitments composed of software licenses, listed in licenseResources. Note that only MACHINE commitments should have a Type specified. + * Check the Category enum for the list of possible values. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type string $end_timestamp + * [Output Only] Commitment end time in RFC3339 text format. + * @type array|\Google\Protobuf\Internal\RepeatedField $existing_reservations + * Specifies the already existing reservations to attach to the Commitment. This field is optional, and it can be a full or partial URL. For example, the following are valid URLs to an reservation: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /reservations/reservation - projects/project/zones/zone/reservations/reservation + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of the resource. Always compute#commitment for commitments. + * @type \Google\Cloud\Compute\V1\LicenseResourceCommitment $license_resource + * The license specification required as part of a license commitment. + * @type array|\Google\Protobuf\Internal\RepeatedField $merge_source_commitments + * List of source commitments to be merged into a new commitment. + * @type string $name + * 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 string $plan + * The plan for this commitment, which determines duration and discount rate. The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years). + * Check the Plan enum for the list of possible values. + * @type string $region + * [Output Only] URL of the region where this commitment may be used. + * @type array<\Google\Cloud\Compute\V1\Reservation>|\Google\Protobuf\Internal\RepeatedField $reservations + * List of create-on-create reservations for this commitment. + * @type array<\Google\Cloud\Compute\V1\ResourceCommitment>|\Google\Protobuf\Internal\RepeatedField $resources + * A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $split_source_commitment + * Source commitment to be split into a new commitment. + * @type string $start_timestamp + * [Output Only] Commitment start time in RFC3339 text format. + * @type string $status + * [Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED. + * Check the Status enum for the list of possible values. + * @type string $status_message + * [Output Only] An optional, human-readable explanation of the status. + * @type string $type + * The type of commitment, which affects the discount rate and the eligible resources. Type MEMORY_OPTIMIZED specifies a commitment that will only apply to memory optimized machines. Type ACCELERATOR_OPTIMIZED specifies a commitment that will only apply to accelerator optimized machines. + * Check the Type enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies whether to enable automatic renewal for the commitment. The default value is false if not specified. The field can be updated until the day of the commitment expiration at 12:00am PST. If the field is set to true, the commitment will be automatically renewed for either one or three years according to the terms of the existing commitment. + * + * Generated from protobuf field optional bool auto_renew = 495520765; + * @return bool + */ + public function getAutoRenew() + { + return isset($this->auto_renew) ? $this->auto_renew : false; + } + + public function hasAutoRenew() + { + return isset($this->auto_renew); + } + + public function clearAutoRenew() + { + unset($this->auto_renew); + } + + /** + * Specifies whether to enable automatic renewal for the commitment. The default value is false if not specified. The field can be updated until the day of the commitment expiration at 12:00am PST. If the field is set to true, the commitment will be automatically renewed for either one or three years according to the terms of the existing commitment. + * + * Generated from protobuf field optional bool auto_renew = 495520765; + * @param bool $var + * @return $this + */ + public function setAutoRenew($var) + { + GPBUtil::checkBool($var); + $this->auto_renew = $var; + + return $this; + } + + /** + * The category of the commitment. Category MACHINE specifies commitments composed of machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE specifies commitments composed of software licenses, listed in licenseResources. Note that only MACHINE commitments should have a Type specified. + * Check the Category enum for the list of possible values. + * + * Generated from protobuf field optional string category = 50511102; + * @return string + */ + public function getCategory() + { + return isset($this->category) ? $this->category : ''; + } + + public function hasCategory() + { + return isset($this->category); + } + + public function clearCategory() + { + unset($this->category); + } + + /** + * The category of the commitment. Category MACHINE specifies commitments composed of machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE specifies commitments composed of software licenses, listed in licenseResources. Note that only MACHINE commitments should have a Type specified. + * Check the Category enum for the list of possible values. + * + * Generated from protobuf field optional string category = 50511102; + * @param string $var + * @return $this + */ + public function setCategory($var) + { + GPBUtil::checkString($var, True); + $this->category = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] Commitment end time in RFC3339 text format. + * + * Generated from protobuf field optional string end_timestamp = 468096690; + * @return string + */ + public function getEndTimestamp() + { + return isset($this->end_timestamp) ? $this->end_timestamp : ''; + } + + public function hasEndTimestamp() + { + return isset($this->end_timestamp); + } + + public function clearEndTimestamp() + { + unset($this->end_timestamp); + } + + /** + * [Output Only] Commitment end time in RFC3339 text format. + * + * Generated from protobuf field optional string end_timestamp = 468096690; + * @param string $var + * @return $this + */ + public function setEndTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->end_timestamp = $var; + + return $this; + } + + /** + * Specifies the already existing reservations to attach to the Commitment. This field is optional, and it can be a full or partial URL. For example, the following are valid URLs to an reservation: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /reservations/reservation - projects/project/zones/zone/reservations/reservation + * + * Generated from protobuf field repeated string existing_reservations = 493028443; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExistingReservations() + { + return $this->existing_reservations; + } + + /** + * Specifies the already existing reservations to attach to the Commitment. This field is optional, and it can be a full or partial URL. For example, the following are valid URLs to an reservation: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /reservations/reservation - projects/project/zones/zone/reservations/reservation + * + * Generated from protobuf field repeated string existing_reservations = 493028443; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExistingReservations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->existing_reservations = $arr; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#commitment for commitments. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#commitment for commitments. + * + * 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; + } + + /** + * The license specification required as part of a license commitment. + * + * Generated from protobuf field optional .google.cloud.compute.v1.LicenseResourceCommitment license_resource = 437955148; + * @return \Google\Cloud\Compute\V1\LicenseResourceCommitment|null + */ + public function getLicenseResource() + { + return $this->license_resource; + } + + public function hasLicenseResource() + { + return isset($this->license_resource); + } + + public function clearLicenseResource() + { + unset($this->license_resource); + } + + /** + * The license specification required as part of a license commitment. + * + * Generated from protobuf field optional .google.cloud.compute.v1.LicenseResourceCommitment license_resource = 437955148; + * @param \Google\Cloud\Compute\V1\LicenseResourceCommitment $var + * @return $this + */ + public function setLicenseResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\LicenseResourceCommitment::class); + $this->license_resource = $var; + + return $this; + } + + /** + * List of source commitments to be merged into a new commitment. + * + * Generated from protobuf field repeated string merge_source_commitments = 188093761; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMergeSourceCommitments() + { + return $this->merge_source_commitments; + } + + /** + * List of source commitments to be merged into a new commitment. + * + * Generated from protobuf field repeated string merge_source_commitments = 188093761; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMergeSourceCommitments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->merge_source_commitments = $arr; + + return $this; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * The plan for this commitment, which determines duration and discount rate. The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years). + * Check the Plan enum for the list of possible values. + * + * Generated from protobuf field optional string plan = 3443497; + * @return string + */ + public function getPlan() + { + return isset($this->plan) ? $this->plan : ''; + } + + public function hasPlan() + { + return isset($this->plan); + } + + public function clearPlan() + { + unset($this->plan); + } + + /** + * The plan for this commitment, which determines duration and discount rate. The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years). + * Check the Plan enum for the list of possible values. + * + * Generated from protobuf field optional string plan = 3443497; + * @param string $var + * @return $this + */ + public function setPlan($var) + { + GPBUtil::checkString($var, True); + $this->plan = $var; + + return $this; + } + + /** + * [Output Only] URL of the region where this commitment may be used. + * + * 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 this commitment may be used. + * + * 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; + } + + /** + * List of create-on-create reservations for this commitment. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Reservation reservations = 399717927; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReservations() + { + return $this->reservations; + } + + /** + * List of create-on-create reservations for this commitment. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Reservation reservations = 399717927; + * @param array<\Google\Cloud\Compute\V1\Reservation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReservations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Reservation::class); + $this->reservations = $arr; + + return $this; + } + + /** + * A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResources() + { + return $this->resources; + } + + /** + * A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965; + * @param array<\Google\Cloud\Compute\V1\ResourceCommitment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ResourceCommitment::class); + $this->resources = $arr; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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; + } + + /** + * Source commitment to be split into a new commitment. + * + * Generated from protobuf field optional string split_source_commitment = 402611156; + * @return string + */ + public function getSplitSourceCommitment() + { + return isset($this->split_source_commitment) ? $this->split_source_commitment : ''; + } + + public function hasSplitSourceCommitment() + { + return isset($this->split_source_commitment); + } + + public function clearSplitSourceCommitment() + { + unset($this->split_source_commitment); + } + + /** + * Source commitment to be split into a new commitment. + * + * Generated from protobuf field optional string split_source_commitment = 402611156; + * @param string $var + * @return $this + */ + public function setSplitSourceCommitment($var) + { + GPBUtil::checkString($var, True); + $this->split_source_commitment = $var; + + return $this; + } + + /** + * [Output Only] Commitment start time in RFC3339 text format. + * + * Generated from protobuf field optional string start_timestamp = 83645817; + * @return string + */ + public function getStartTimestamp() + { + return isset($this->start_timestamp) ? $this->start_timestamp : ''; + } + + public function hasStartTimestamp() + { + return isset($this->start_timestamp); + } + + public function clearStartTimestamp() + { + unset($this->start_timestamp); + } + + /** + * [Output Only] Commitment start time in RFC3339 text format. + * + * Generated from protobuf field optional string start_timestamp = 83645817; + * @param string $var + * @return $this + */ + public function setStartTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->start_timestamp = $var; + + return $this; + } + + /** + * [Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + + /** + * [Output Only] An optional, human-readable explanation of the status. + * + * Generated from protobuf field optional string status_message = 297428154; + * @return string + */ + public function getStatusMessage() + { + return isset($this->status_message) ? $this->status_message : ''; + } + + public function hasStatusMessage() + { + return isset($this->status_message); + } + + public function clearStatusMessage() + { + unset($this->status_message); + } + + /** + * [Output Only] An optional, human-readable explanation of the status. + * + * Generated from protobuf field optional string status_message = 297428154; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * The type of commitment, which affects the discount rate and the eligible resources. Type MEMORY_OPTIMIZED specifies a commitment that will only apply to memory optimized machines. Type ACCELERATOR_OPTIMIZED specifies a commitment that will only apply to accelerator optimized machines. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * The type of commitment, which affects the discount rate and the eligible resources. Type MEMORY_OPTIMIZED specifies a commitment that will only apply to memory optimized machines. Type ACCELERATOR_OPTIMIZED specifies a commitment that will only apply to accelerator optimized machines. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Commitment/Category.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Commitment/Category.php new file mode 100644 index 000000000000..142ca1e216ee --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Commitment/Category.php @@ -0,0 +1,65 @@ +google.cloud.compute.v1.Commitment.Category + */ +class Category +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_CATEGORY = 0; + */ + const UNDEFINED_CATEGORY = 0; + /** + * Generated from protobuf enum CATEGORY_UNSPECIFIED = 509189462; + */ + const CATEGORY_UNSPECIFIED = 509189462; + /** + * Generated from protobuf enum LICENSE = 347869217; + */ + const LICENSE = 347869217; + /** + * Generated from protobuf enum MACHINE = 469553191; + */ + const MACHINE = 469553191; + + private static $valueToName = [ + self::UNDEFINED_CATEGORY => 'UNDEFINED_CATEGORY', + self::CATEGORY_UNSPECIFIED => 'CATEGORY_UNSPECIFIED', + self::LICENSE => 'LICENSE', + self::MACHINE => 'MACHINE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Category::class, \Google\Cloud\Compute\V1\Commitment_Category::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Commitment/Plan.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Commitment/Plan.php new file mode 100644 index 000000000000..797f78d0facd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Commitment/Plan.php @@ -0,0 +1,65 @@ +google.cloud.compute.v1.Commitment.Plan + */ +class Plan +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PLAN = 0; + */ + const UNDEFINED_PLAN = 0; + /** + * Generated from protobuf enum INVALID = 530283991; + */ + const INVALID = 530283991; + /** + * Generated from protobuf enum THIRTY_SIX_MONTH = 266295942; + */ + const THIRTY_SIX_MONTH = 266295942; + /** + * Generated from protobuf enum TWELVE_MONTH = 173083962; + */ + const TWELVE_MONTH = 173083962; + + private static $valueToName = [ + self::UNDEFINED_PLAN => 'UNDEFINED_PLAN', + self::INVALID => 'INVALID', + self::THIRTY_SIX_MONTH => 'THIRTY_SIX_MONTH', + self::TWELVE_MONTH => 'TWELVE_MONTH', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Plan::class, \Google\Cloud\Compute\V1\Commitment_Plan::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Commitment/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Commitment/Status.php new file mode 100644 index 000000000000..556e47a0d6c1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Commitment/Status.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.Commitment.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * Generated from protobuf enum ACTIVE = 314733318; + */ + 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; + /** + * Generated from protobuf enum CREATING = 455564985; + */ + const CREATING = 455564985; + /** + * Generated from protobuf enum EXPIRED = 482489093; + */ + const EXPIRED = 482489093; + /** + * Generated from protobuf enum NOT_YET_ACTIVE = 20607337; + */ + const NOT_YET_ACTIVE = 20607337; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::ACTIVE => 'ACTIVE', + self::CANCELLED => 'CANCELLED', + self::CREATING => 'CREATING', + self::EXPIRED => 'EXPIRED', + self::NOT_YET_ACTIVE => 'NOT_YET_ACTIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\Commitment_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Commitment/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Commitment/Type.php new file mode 100644 index 000000000000..8042269d1ef1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Commitment/Type.php @@ -0,0 +1,140 @@ +google.cloud.compute.v1.Commitment.Type + */ +class Type +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TYPE = 0; + */ + const UNDEFINED_TYPE = 0; + /** + * Generated from protobuf enum ACCELERATOR_OPTIMIZED = 280848403; + */ + const ACCELERATOR_OPTIMIZED = 280848403; + /** + * Generated from protobuf enum ACCELERATOR_OPTIMIZED_A3 = 158574526; + */ + const ACCELERATOR_OPTIMIZED_A3 = 158574526; + /** + * Generated from protobuf enum COMPUTE_OPTIMIZED = 158349023; + */ + const COMPUTE_OPTIMIZED = 158349023; + /** + * 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 COMPUTE_OPTIMIZED_C3D = 383246484; + */ + const COMPUTE_OPTIMIZED_C3D = 383246484; + /** + * Generated from protobuf enum COMPUTE_OPTIMIZED_H3 = 428004939; + */ + const COMPUTE_OPTIMIZED_H3 = 428004939; + /** + * Generated from protobuf enum GENERAL_PURPOSE = 299793543; + */ + const GENERAL_PURPOSE = 299793543; + /** + * Generated from protobuf enum GENERAL_PURPOSE_E2 = 301911877; + */ + const GENERAL_PURPOSE_E2 = 301911877; + /** + * Generated from protobuf enum GENERAL_PURPOSE_N2 = 301912156; + */ + const GENERAL_PURPOSE_N2 = 301912156; + /** + * Generated from protobuf enum GENERAL_PURPOSE_N2D = 232471400; + */ + const GENERAL_PURPOSE_N2D = 232471400; + /** + * Generated from protobuf enum GENERAL_PURPOSE_N4 = 301912158; + */ + const GENERAL_PURPOSE_N4 = 301912158; + /** + * Generated from protobuf enum GENERAL_PURPOSE_T2D = 232477166; + */ + const GENERAL_PURPOSE_T2D = 232477166; + /** + * Generated from protobuf enum GRAPHICS_OPTIMIZED = 68500563; + */ + const GRAPHICS_OPTIMIZED = 68500563; + /** + * Generated from protobuf enum MEMORY_OPTIMIZED = 281753417; + */ + const MEMORY_OPTIMIZED = 281753417; + /** + * Generated from protobuf enum MEMORY_OPTIMIZED_M3 = 276301372; + */ + const MEMORY_OPTIMIZED_M3 = 276301372; + /** + * Generated from protobuf enum STORAGE_OPTIMIZED_Z3 = 316796085; + */ + const STORAGE_OPTIMIZED_Z3 = 316796085; + /** + * Generated from protobuf enum TYPE_UNSPECIFIED = 437714322; + */ + const TYPE_UNSPECIFIED = 437714322; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::ACCELERATOR_OPTIMIZED => 'ACCELERATOR_OPTIMIZED', + self::ACCELERATOR_OPTIMIZED_A3 => 'ACCELERATOR_OPTIMIZED_A3', + self::COMPUTE_OPTIMIZED => 'COMPUTE_OPTIMIZED', + self::COMPUTE_OPTIMIZED_C2D => 'COMPUTE_OPTIMIZED_C2D', + self::COMPUTE_OPTIMIZED_C3 => 'COMPUTE_OPTIMIZED_C3', + self::COMPUTE_OPTIMIZED_C3D => 'COMPUTE_OPTIMIZED_C3D', + self::COMPUTE_OPTIMIZED_H3 => 'COMPUTE_OPTIMIZED_H3', + self::GENERAL_PURPOSE => 'GENERAL_PURPOSE', + self::GENERAL_PURPOSE_E2 => 'GENERAL_PURPOSE_E2', + self::GENERAL_PURPOSE_N2 => 'GENERAL_PURPOSE_N2', + self::GENERAL_PURPOSE_N2D => 'GENERAL_PURPOSE_N2D', + self::GENERAL_PURPOSE_N4 => 'GENERAL_PURPOSE_N4', + self::GENERAL_PURPOSE_T2D => 'GENERAL_PURPOSE_T2D', + self::GRAPHICS_OPTIMIZED => 'GRAPHICS_OPTIMIZED', + self::MEMORY_OPTIMIZED => 'MEMORY_OPTIMIZED', + self::MEMORY_OPTIMIZED_M3 => 'MEMORY_OPTIMIZED_M3', + self::STORAGE_OPTIMIZED_Z3 => 'STORAGE_OPTIMIZED_Z3', + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Compute\V1\Commitment_Type::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CommitmentAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CommitmentAggregatedList.php new file mode 100644 index 000000000000..b1a63b295e64 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CommitmentAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.CommitmentAggregatedList + */ +class CommitmentAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of CommitmentsScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#commitmentAggregatedList for aggregated lists of commitments. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 CommitmentsScopedList resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#commitmentAggregatedList for aggregated lists of commitments. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 CommitmentsScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of CommitmentsScopedList 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\CommitmentsScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#commitmentAggregatedList for aggregated lists of commitments. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#commitmentAggregatedList for aggregated lists of commitments. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CommitmentList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CommitmentList.php new file mode 100644 index 000000000000..0452101976dc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CommitmentList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.CommitmentList + */ +class CommitmentList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of Commitment resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Commitment items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#commitmentList for lists of commitments. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\Commitment>|\Google\Protobuf\Internal\RepeatedField $items + * A list of Commitment resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#commitmentList for lists of commitments. + * @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 Commitment resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Commitment items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of Commitment resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Commitment items = 100526016; + * @param array<\Google\Cloud\Compute\V1\Commitment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Commitment::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#commitmentList for lists of commitments. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#commitmentList for lists of commitments. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CommitmentsScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CommitmentsScopedList.php new file mode 100644 index 000000000000..e1701e7c0504 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CommitmentsScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.CommitmentsScopedList + */ +class CommitmentsScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A list of commitments contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Commitment commitments = 450664446; + */ + private $commitments; + /** + * [Output Only] Informational warning which replaces the list of commitments when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\Commitment>|\Google\Protobuf\Internal\RepeatedField $commitments + * [Output Only] A list of commitments contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] Informational warning which replaces the list of commitments 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 commitments contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Commitment commitments = 450664446; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCommitments() + { + return $this->commitments; + } + + /** + * [Output Only] A list of commitments contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Commitment commitments = 450664446; + * @param array<\Google\Cloud\Compute\V1\Commitment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCommitments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Commitment::class); + $this->commitments = $arr; + + return $this; + } + + /** + * [Output Only] Informational warning which replaces the list of commitments 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] Informational warning which replaces the list of commitments 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Condition.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Condition.php new file mode 100644 index 000000000000..c9f3c5d80789 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Condition.php @@ -0,0 +1,255 @@ +google.cloud.compute.v1.Condition + */ +class Condition extends \Google\Protobuf\Internal\Message +{ + /** + * This is deprecated and has no effect. Do not use. + * Check the Iam enum for the list of possible values. + * + * Generated from protobuf field optional string iam = 104021; + */ + protected $iam = null; + /** + * This is deprecated and has no effect. Do not use. + * Check the Op enum for the list of possible values. + * + * Generated from protobuf field optional string op = 3553; + */ + protected $op = null; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional string svc = 114272; + */ + protected $svc = null; + /** + * This is deprecated and has no effect. Do not use. + * Check the Sys enum for the list of possible values. + * + * Generated from protobuf field optional string sys = 114381; + */ + protected $sys = null; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated string values = 249928994; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $iam + * This is deprecated and has no effect. Do not use. + * Check the Iam enum for the list of possible values. + * @type string $op + * This is deprecated and has no effect. Do not use. + * Check the Op enum for the list of possible values. + * @type string $svc + * This is deprecated and has no effect. Do not use. + * @type string $sys + * This is deprecated and has no effect. Do not use. + * Check the Sys enum for the list of possible values. + * @type array|\Google\Protobuf\Internal\RepeatedField $values + * This is deprecated and has no effect. Do not use. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * This is deprecated and has no effect. Do not use. + * Check the Iam enum for the list of possible values. + * + * Generated from protobuf field optional string iam = 104021; + * @return string + */ + public function getIam() + { + return isset($this->iam) ? $this->iam : ''; + } + + public function hasIam() + { + return isset($this->iam); + } + + public function clearIam() + { + unset($this->iam); + } + + /** + * This is deprecated and has no effect. Do not use. + * Check the Iam enum for the list of possible values. + * + * Generated from protobuf field optional string iam = 104021; + * @param string $var + * @return $this + */ + public function setIam($var) + { + GPBUtil::checkString($var, True); + $this->iam = $var; + + return $this; + } + + /** + * This is deprecated and has no effect. Do not use. + * 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); + } + + /** + * This is deprecated and has no effect. Do not use. + * 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; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional string svc = 114272; + * @return string + */ + public function getSvc() + { + return isset($this->svc) ? $this->svc : ''; + } + + public function hasSvc() + { + return isset($this->svc); + } + + public function clearSvc() + { + unset($this->svc); + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional string svc = 114272; + * @param string $var + * @return $this + */ + public function setSvc($var) + { + GPBUtil::checkString($var, True); + $this->svc = $var; + + return $this; + } + + /** + * This is deprecated and has no effect. Do not use. + * Check the Sys enum for the list of possible values. + * + * Generated from protobuf field optional string sys = 114381; + * @return string + */ + public function getSys() + { + return isset($this->sys) ? $this->sys : ''; + } + + public function hasSys() + { + return isset($this->sys); + } + + public function clearSys() + { + unset($this->sys); + } + + /** + * This is deprecated and has no effect. Do not use. + * Check the Sys enum for the list of possible values. + * + * Generated from protobuf field optional string sys = 114381; + * @param string $var + * @return $this + */ + public function setSys($var) + { + GPBUtil::checkString($var, True); + $this->sys = $var; + + return $this; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated string values = 249928994; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated string values = 249928994; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->values = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Condition/Iam.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Condition/Iam.php new file mode 100644 index 000000000000..8c79b08ea1f6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Condition/Iam.php @@ -0,0 +1,101 @@ +google.cloud.compute.v1.Condition.Iam + */ +class Iam +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_IAM = 0; + */ + const UNDEFINED_IAM = 0; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum APPROVER = 357258949; + */ + const APPROVER = 357258949; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum ATTRIBUTION = 232465503; + */ + const ATTRIBUTION = 232465503; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum AUTHORITY = 504108835; + */ + const AUTHORITY = 504108835; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum CREDENTIALS_TYPE = 348222141; + */ + const CREDENTIALS_TYPE = 348222141; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum CREDS_ASSERTION = 332343272; + */ + const CREDS_ASSERTION = 332343272; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum JUSTIFICATION_TYPE = 206147719; + */ + const JUSTIFICATION_TYPE = 206147719; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum SECURITY_REALM = 526269616; + */ + const SECURITY_REALM = 526269616; + + private static $valueToName = [ + self::UNDEFINED_IAM => 'UNDEFINED_IAM', + self::APPROVER => 'APPROVER', + self::ATTRIBUTION => 'ATTRIBUTION', + self::AUTHORITY => 'AUTHORITY', + self::CREDENTIALS_TYPE => 'CREDENTIALS_TYPE', + self::CREDS_ASSERTION => 'CREDS_ASSERTION', + self::JUSTIFICATION_TYPE => 'JUSTIFICATION_TYPE', + self::SECURITY_REALM => 'SECURITY_REALM', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Iam::class, \Google\Cloud\Compute\V1\Condition_Iam::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Condition/Op.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Condition/Op.php new file mode 100644 index 000000000000..66ed57087086 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Condition/Op.php @@ -0,0 +1,92 @@ +google.cloud.compute.v1.Condition.Op + */ +class Op +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_OP = 0; + */ + const UNDEFINED_OP = 0; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum DISCHARGED = 266338274; + */ + const DISCHARGED = 266338274; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum EQUALS = 442201023; + */ + const EQUALS = 442201023; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum IN = 2341; + */ + const IN = 2341; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum NOT_EQUALS = 19718859; + */ + const NOT_EQUALS = 19718859; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum NOT_IN = 161144369; + */ + const NOT_IN = 161144369; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum NO_OP = 74481951; + */ + const NO_OP = 74481951; + + private static $valueToName = [ + self::UNDEFINED_OP => 'UNDEFINED_OP', + self::DISCHARGED => 'DISCHARGED', + self::EQUALS => 'EQUALS', + self::IN => 'IN', + self::NOT_EQUALS => 'NOT_EQUALS', + self::NOT_IN => 'NOT_IN', + self::NO_OP => 'NO_OP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Op::class, \Google\Cloud\Compute\V1\Condition_Op::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Condition/Sys.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Condition/Sys.php new file mode 100644 index 000000000000..ff894cff87e8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Condition/Sys.php @@ -0,0 +1,80 @@ +google.cloud.compute.v1.Condition.Sys + */ +class Sys +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_SYS = 0; + */ + const UNDEFINED_SYS = 0; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum IP = 2343; + */ + const IP = 2343; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum NAME = 2388619; + */ + const NAME = 2388619; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum REGION = 266017524; + */ + const REGION = 266017524; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum SERVICE = 17781397; + */ + const SERVICE = 17781397; + + private static $valueToName = [ + self::UNDEFINED_SYS => 'UNDEFINED_SYS', + self::IP => 'IP', + self::NAME => 'NAME', + self::REGION => 'REGION', + self::SERVICE => 'SERVICE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Sys::class, \Google\Cloud\Compute\V1\Condition_Sys::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ConfidentialInstanceConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ConfidentialInstanceConfig.php new file mode 100644 index 000000000000..a01769912cd2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ConfidentialInstanceConfig.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.ConfidentialInstanceConfig + */ +class ConfidentialInstanceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Defines whether the instance should have confidential compute enabled. + * + * Generated from protobuf field optional bool enable_confidential_compute = 102135228; + */ + protected $enable_confidential_compute = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_confidential_compute + * Defines whether the instance should have confidential compute enabled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Defines whether the instance should have confidential compute enabled. + * + * Generated from protobuf field optional bool enable_confidential_compute = 102135228; + * @return bool + */ + public function getEnableConfidentialCompute() + { + return isset($this->enable_confidential_compute) ? $this->enable_confidential_compute : false; + } + + public function hasEnableConfidentialCompute() + { + return isset($this->enable_confidential_compute); + } + + public function clearEnableConfidentialCompute() + { + unset($this->enable_confidential_compute); + } + + /** + * Defines whether the instance should have confidential compute enabled. + * + * Generated from protobuf field optional bool enable_confidential_compute = 102135228; + * @param bool $var + * @return $this + */ + public function setEnableConfidentialCompute($var) + { + GPBUtil::checkBool($var); + $this->enable_confidential_compute = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ConnectionDraining.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ConnectionDraining.php new file mode 100644 index 000000000000..18e70071893a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ConnectionDraining.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.ConnectionDraining + */ +class ConnectionDraining extends \Google\Protobuf\Internal\Message +{ + /** + * Configures a duration timeout for existing requests on a removed backend instance. For supported load balancers and protocols, as described in Enabling connection draining. + * + * Generated from protobuf field optional int32 draining_timeout_sec = 225127070; + */ + protected $draining_timeout_sec = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $draining_timeout_sec + * Configures a duration timeout for existing requests on a removed backend instance. For supported load balancers and protocols, as described in Enabling connection draining. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Configures a duration timeout for existing requests on a removed backend instance. For supported load balancers and protocols, as described in Enabling connection draining. + * + * Generated from protobuf field optional int32 draining_timeout_sec = 225127070; + * @return int + */ + public function getDrainingTimeoutSec() + { + return isset($this->draining_timeout_sec) ? $this->draining_timeout_sec : 0; + } + + public function hasDrainingTimeoutSec() + { + return isset($this->draining_timeout_sec); + } + + public function clearDrainingTimeoutSec() + { + unset($this->draining_timeout_sec); + } + + /** + * Configures a duration timeout for existing requests on a removed backend instance. For supported load balancers and protocols, as described in Enabling connection draining. + * + * Generated from protobuf field optional int32 draining_timeout_sec = 225127070; + * @param int $var + * @return $this + */ + public function setDrainingTimeoutSec($var) + { + GPBUtil::checkInt32($var); + $this->draining_timeout_sec = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ConsistentHashLoadBalancerSettings.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ConsistentHashLoadBalancerSettings.php new file mode 100644 index 000000000000..c1f481293536 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ConsistentHashLoadBalancerSettings.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.ConsistentHashLoadBalancerSettings + */ +class ConsistentHashLoadBalancerSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Hash is based on HTTP Cookie. This field describes a HTTP cookie that will be used as the hash key for the consistent hash load balancer. If the cookie is not present, it will be generated. This field is applicable if the sessionAffinity is set to HTTP_COOKIE. Not 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. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie http_cookie = 6673915; + */ + protected $http_cookie = null; + /** + * The hash based on the value of the specified header field. This field is applicable if the sessionAffinity is set to HEADER_FIELD. + * + * Generated from protobuf field optional string http_header_name = 234798022; + */ + protected $http_header_name = null; + /** + * The minimum number of virtual nodes to use for the hash ring. Defaults to 1024. Larger ring sizes result in more granular load distributions. If the number of hosts in the load balancing pool is larger than the ring size, each host will be assigned a single virtual node. + * + * Generated from protobuf field optional int64 minimum_ring_size = 234380735; + */ + protected $minimum_ring_size = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\ConsistentHashLoadBalancerSettingsHttpCookie $http_cookie + * Hash is based on HTTP Cookie. This field describes a HTTP cookie that will be used as the hash key for the consistent hash load balancer. If the cookie is not present, it will be generated. This field is applicable if the sessionAffinity is set to HTTP_COOKIE. Not 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. + * @type string $http_header_name + * The hash based on the value of the specified header field. This field is applicable if the sessionAffinity is set to HEADER_FIELD. + * @type int|string $minimum_ring_size + * The minimum number of virtual nodes to use for the hash ring. Defaults to 1024. Larger ring sizes result in more granular load distributions. If the number of hosts in the load balancing pool is larger than the ring size, each host will be assigned a single virtual node. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Hash is based on HTTP Cookie. This field describes a HTTP cookie that will be used as the hash key for the consistent hash load balancer. If the cookie is not present, it will be generated. This field is applicable if the sessionAffinity is set to HTTP_COOKIE. Not 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. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie http_cookie = 6673915; + * @return \Google\Cloud\Compute\V1\ConsistentHashLoadBalancerSettingsHttpCookie|null + */ + public function getHttpCookie() + { + return $this->http_cookie; + } + + public function hasHttpCookie() + { + return isset($this->http_cookie); + } + + public function clearHttpCookie() + { + unset($this->http_cookie); + } + + /** + * Hash is based on HTTP Cookie. This field describes a HTTP cookie that will be used as the hash key for the consistent hash load balancer. If the cookie is not present, it will be generated. This field is applicable if the sessionAffinity is set to HTTP_COOKIE. Not 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. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie http_cookie = 6673915; + * @param \Google\Cloud\Compute\V1\ConsistentHashLoadBalancerSettingsHttpCookie $var + * @return $this + */ + public function setHttpCookie($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ConsistentHashLoadBalancerSettingsHttpCookie::class); + $this->http_cookie = $var; + + return $this; + } + + /** + * The hash based on the value of the specified header field. This field is applicable if the sessionAffinity is set to HEADER_FIELD. + * + * Generated from protobuf field optional string http_header_name = 234798022; + * @return string + */ + public function getHttpHeaderName() + { + return isset($this->http_header_name) ? $this->http_header_name : ''; + } + + public function hasHttpHeaderName() + { + return isset($this->http_header_name); + } + + public function clearHttpHeaderName() + { + unset($this->http_header_name); + } + + /** + * The hash based on the value of the specified header field. This field is applicable if the sessionAffinity is set to HEADER_FIELD. + * + * Generated from protobuf field optional string http_header_name = 234798022; + * @param string $var + * @return $this + */ + public function setHttpHeaderName($var) + { + GPBUtil::checkString($var, True); + $this->http_header_name = $var; + + return $this; + } + + /** + * The minimum number of virtual nodes to use for the hash ring. Defaults to 1024. Larger ring sizes result in more granular load distributions. If the number of hosts in the load balancing pool is larger than the ring size, each host will be assigned a single virtual node. + * + * Generated from protobuf field optional int64 minimum_ring_size = 234380735; + * @return int|string + */ + public function getMinimumRingSize() + { + return isset($this->minimum_ring_size) ? $this->minimum_ring_size : 0; + } + + public function hasMinimumRingSize() + { + return isset($this->minimum_ring_size); + } + + public function clearMinimumRingSize() + { + unset($this->minimum_ring_size); + } + + /** + * The minimum number of virtual nodes to use for the hash ring. Defaults to 1024. Larger ring sizes result in more granular load distributions. If the number of hosts in the load balancing pool is larger than the ring size, each host will be assigned a single virtual node. + * + * Generated from protobuf field optional int64 minimum_ring_size = 234380735; + * @param int|string $var + * @return $this + */ + public function setMinimumRingSize($var) + { + GPBUtil::checkInt64($var); + $this->minimum_ring_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ConsistentHashLoadBalancerSettingsHttpCookie.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ConsistentHashLoadBalancerSettingsHttpCookie.php new file mode 100644 index 000000000000..964b87a9026c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ConsistentHashLoadBalancerSettingsHttpCookie.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie + */ +class ConsistentHashLoadBalancerSettingsHttpCookie extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the cookie. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Path to set for the cookie. + * + * Generated from protobuf field optional string path = 3433509; + */ + protected $path = null; + /** + * Lifetime of the cookie. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration ttl = 115180; + */ + protected $ttl = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of the cookie. + * @type string $path + * Path to set for the cookie. + * @type \Google\Cloud\Compute\V1\Duration $ttl + * Lifetime of the cookie. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the cookie. + * + * 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); + } + + /** + * Name of the cookie. + * + * 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; + } + + /** + * Path to set for the cookie. + * + * Generated from protobuf field optional string path = 3433509; + * @return string + */ + public function getPath() + { + return isset($this->path) ? $this->path : ''; + } + + public function hasPath() + { + return isset($this->path); + } + + public function clearPath() + { + unset($this->path); + } + + /** + * Path to set for the cookie. + * + * Generated from protobuf field optional string path = 3433509; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + + /** + * Lifetime of the cookie. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration ttl = 115180; + * @return \Google\Cloud\Compute\V1\Duration|null + */ + public function getTtl() + { + return $this->ttl; + } + + public function hasTtl() + { + return isset($this->ttl); + } + + public function clearTtl() + { + unset($this->ttl); + } + + /** + * Lifetime of the cookie. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration ttl = 115180; + * @param \Google\Cloud\Compute\V1\Duration $var + * @return $this + */ + public function setTtl($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Duration::class); + $this->ttl = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CorsPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CorsPolicy.php new file mode 100644 index 000000000000..fda854a647c1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CorsPolicy.php @@ -0,0 +1,335 @@ +google.cloud.compute.v1.CorsPolicy + */ +class CorsPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This field translates to the Access-Control-Allow-Credentials header. Default is false. + * + * Generated from protobuf field optional bool allow_credentials = 481263366; + */ + protected $allow_credentials = null; + /** + * Specifies the content for the Access-Control-Allow-Headers header. + * + * Generated from protobuf field repeated string allow_headers = 45179024; + */ + private $allow_headers; + /** + * Specifies the content for the Access-Control-Allow-Methods header. + * + * Generated from protobuf field repeated string allow_methods = 205405372; + */ + private $allow_methods; + /** + * Specifies a regular expression that matches allowed origins. For more information, see regular expression syntax . An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field repeated string allow_origin_regexes = 215385810; + */ + private $allow_origin_regexes; + /** + * Specifies the list of origins that is allowed to do CORS requests. An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes. + * + * Generated from protobuf field repeated string allow_origins = 194914071; + */ + private $allow_origins; + /** + * If true, disables the CORS policy. The default value is false, which indicates that the CORS policy is in effect. + * + * Generated from protobuf field optional bool disabled = 270940796; + */ + protected $disabled = null; + /** + * Specifies the content for the Access-Control-Expose-Headers header. + * + * Generated from protobuf field repeated string expose_headers = 247604747; + */ + private $expose_headers; + /** + * Specifies how long results of a preflight request can be cached in seconds. This field translates to the Access-Control-Max-Age header. + * + * Generated from protobuf field optional int32 max_age = 307559332; + */ + protected $max_age = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $allow_credentials + * In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This field translates to the Access-Control-Allow-Credentials header. Default is false. + * @type array|\Google\Protobuf\Internal\RepeatedField $allow_headers + * Specifies the content for the Access-Control-Allow-Headers header. + * @type array|\Google\Protobuf\Internal\RepeatedField $allow_methods + * Specifies the content for the Access-Control-Allow-Methods header. + * @type array|\Google\Protobuf\Internal\RepeatedField $allow_origin_regexes + * Specifies a regular expression that matches allowed origins. For more information, see regular expression syntax . An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED. + * @type array|\Google\Protobuf\Internal\RepeatedField $allow_origins + * Specifies the list of origins that is allowed to do CORS requests. An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes. + * @type bool $disabled + * If true, disables the CORS policy. The default value is false, which indicates that the CORS policy is in effect. + * @type array|\Google\Protobuf\Internal\RepeatedField $expose_headers + * Specifies the content for the Access-Control-Expose-Headers header. + * @type int $max_age + * Specifies how long results of a preflight request can be cached in seconds. This field translates to the Access-Control-Max-Age header. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This field translates to the Access-Control-Allow-Credentials header. Default is false. + * + * Generated from protobuf field optional bool allow_credentials = 481263366; + * @return bool + */ + public function getAllowCredentials() + { + return isset($this->allow_credentials) ? $this->allow_credentials : false; + } + + public function hasAllowCredentials() + { + return isset($this->allow_credentials); + } + + public function clearAllowCredentials() + { + unset($this->allow_credentials); + } + + /** + * In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This field translates to the Access-Control-Allow-Credentials header. Default is false. + * + * Generated from protobuf field optional bool allow_credentials = 481263366; + * @param bool $var + * @return $this + */ + public function setAllowCredentials($var) + { + GPBUtil::checkBool($var); + $this->allow_credentials = $var; + + return $this; + } + + /** + * Specifies the content for the Access-Control-Allow-Headers header. + * + * Generated from protobuf field repeated string allow_headers = 45179024; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowHeaders() + { + return $this->allow_headers; + } + + /** + * Specifies the content for the Access-Control-Allow-Headers header. + * + * Generated from protobuf field repeated string allow_headers = 45179024; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allow_headers = $arr; + + return $this; + } + + /** + * Specifies the content for the Access-Control-Allow-Methods header. + * + * Generated from protobuf field repeated string allow_methods = 205405372; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowMethods() + { + return $this->allow_methods; + } + + /** + * Specifies the content for the Access-Control-Allow-Methods header. + * + * Generated from protobuf field repeated string allow_methods = 205405372; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowMethods($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allow_methods = $arr; + + return $this; + } + + /** + * Specifies a regular expression that matches allowed origins. For more information, see regular expression syntax . An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field repeated string allow_origin_regexes = 215385810; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowOriginRegexes() + { + return $this->allow_origin_regexes; + } + + /** + * Specifies a regular expression that matches allowed origins. For more information, see regular expression syntax . An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field repeated string allow_origin_regexes = 215385810; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowOriginRegexes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allow_origin_regexes = $arr; + + return $this; + } + + /** + * Specifies the list of origins that is allowed to do CORS requests. An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes. + * + * Generated from protobuf field repeated string allow_origins = 194914071; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowOrigins() + { + return $this->allow_origins; + } + + /** + * Specifies the list of origins that is allowed to do CORS requests. An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes. + * + * Generated from protobuf field repeated string allow_origins = 194914071; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowOrigins($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->allow_origins = $arr; + + return $this; + } + + /** + * If true, disables the CORS policy. The default value is false, which indicates that the CORS policy is in effect. + * + * Generated from protobuf field optional bool disabled = 270940796; + * @return bool + */ + public function getDisabled() + { + return isset($this->disabled) ? $this->disabled : false; + } + + public function hasDisabled() + { + return isset($this->disabled); + } + + public function clearDisabled() + { + unset($this->disabled); + } + + /** + * If true, disables the CORS policy. The default value is false, which indicates that the CORS policy is in effect. + * + * Generated from protobuf field optional bool disabled = 270940796; + * @param bool $var + * @return $this + */ + public function setDisabled($var) + { + GPBUtil::checkBool($var); + $this->disabled = $var; + + return $this; + } + + /** + * Specifies the content for the Access-Control-Expose-Headers header. + * + * Generated from protobuf field repeated string expose_headers = 247604747; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExposeHeaders() + { + return $this->expose_headers; + } + + /** + * Specifies the content for the Access-Control-Expose-Headers header. + * + * Generated from protobuf field repeated string expose_headers = 247604747; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExposeHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->expose_headers = $arr; + + return $this; + } + + /** + * Specifies how long results of a preflight request can be cached in seconds. This field translates to the Access-Control-Max-Age header. + * + * Generated from protobuf field optional int32 max_age = 307559332; + * @return int + */ + public function getMaxAge() + { + return isset($this->max_age) ? $this->max_age : 0; + } + + public function hasMaxAge() + { + return isset($this->max_age); + } + + public function clearMaxAge() + { + unset($this->max_age); + } + + /** + * Specifies how long results of a preflight request can be cached in seconds. This field translates to the Access-Control-Max-Age header. + * + * Generated from protobuf field optional int32 max_age = 307559332; + * @param int $var + * @return $this + */ + public function setMaxAge($var) + { + GPBUtil::checkInt32($var); + $this->max_age = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CreateInstancesInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CreateInstancesInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..d51a8dabea87 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CreateInstancesInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest + */ +class CreateInstancesInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest instance_group_managers_create_instances_request_resource = 24558867 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_managers_create_instances_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"]; + */ + protected $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. 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; + */ + protected $request_id = null; + /** + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @param string $instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersCreateInstancesRequest $instanceGroupManagersCreateInstancesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\CreateInstancesInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager, \Google\Cloud\Compute\V1\InstanceGroupManagersCreateInstancesRequest $instanceGroupManagersCreateInstancesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersCreateInstancesRequestResource($instanceGroupManagersCreateInstancesRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group. It should conform to RFC1035. + * @type \Google\Cloud\Compute\V1\InstanceGroupManagersCreateInstancesRequest $instance_group_managers_create_instances_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. 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 where the managed instance group is located. It should conform to RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest instance_group_managers_create_instances_request_resource = 24558867 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagersCreateInstancesRequest|null + */ + public function getInstanceGroupManagersCreateInstancesRequestResource() + { + return $this->instance_group_managers_create_instances_request_resource; + } + + public function hasInstanceGroupManagersCreateInstancesRequestResource() + { + return isset($this->instance_group_managers_create_instances_request_resource); + } + + public function clearInstanceGroupManagersCreateInstancesRequestResource() + { + unset($this->instance_group_managers_create_instances_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest instance_group_managers_create_instances_request_resource = 24558867 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersCreateInstancesRequest $var + * @return $this + */ + public function setInstanceGroupManagersCreateInstancesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagersCreateInstancesRequest::class); + $this->instance_group_managers_create_instances_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. 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. 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 where the managed instance group is located. It should conform to RFC1035. + * + * 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 where the managed instance group is located. It should conform to RFC1035. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CreateInstancesRegionInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CreateInstancesRegionInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..799663b8e322 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CreateInstancesRegionInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest + */ +class CreateInstancesRegionInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The name of the region where the managed instance group is located. It should conform to RFC1035. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest region_instance_group_managers_create_instances_request_resource = 359014280 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_instance_group_managers_create_instances_request_resource = null; + /** + * 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. 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region where the managed instance group is located. It should conform to RFC1035. + * @param string $instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagersCreateInstancesRequest $regionInstanceGroupManagersCreateInstancesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\CreateInstancesRegionInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroupManager, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersCreateInstancesRequest $regionInstanceGroupManagersCreateInstancesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroupManager($instanceGroupManager) + ->setRegionInstanceGroupManagersCreateInstancesRequestResource($regionInstanceGroupManagersCreateInstancesRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group. It should conform to RFC1035. + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region where the managed instance group is located. It should conform to RFC1035. + * @type \Google\Cloud\Compute\V1\RegionInstanceGroupManagersCreateInstancesRequest $region_instance_group_managers_create_instances_request_resource + * The body resource 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. 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 managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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 where the managed instance group is located. It should conform to RFC1035. + * + * 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 where the managed instance group is located. It should conform to RFC1035. + * + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest region_instance_group_managers_create_instances_request_resource = 359014280 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionInstanceGroupManagersCreateInstancesRequest|null + */ + public function getRegionInstanceGroupManagersCreateInstancesRequestResource() + { + return $this->region_instance_group_managers_create_instances_request_resource; + } + + public function hasRegionInstanceGroupManagersCreateInstancesRequestResource() + { + return isset($this->region_instance_group_managers_create_instances_request_resource); + } + + public function clearRegionInstanceGroupManagersCreateInstancesRequestResource() + { + unset($this->region_instance_group_managers_create_instances_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest region_instance_group_managers_create_instances_request_resource = 359014280 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagersCreateInstancesRequest $var + * @return $this + */ + public function setRegionInstanceGroupManagersCreateInstancesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersCreateInstancesRequest::class); + $this->region_instance_group_managers_create_instances_request_resource = $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. 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. 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CreateSnapshotDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CreateSnapshotDiskRequest.php new file mode 100644 index 000000000000..3f2f81645bb9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CreateSnapshotDiskRequest.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.CreateSnapshotDiskRequest + */ +class CreateSnapshotDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the persistent disk to snapshot. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk = ''; + /** + * [Input Only] Whether to attempt an application consistent snapshot by informing the OS to prepare for the snapshot process. + * + * Generated from protobuf field optional bool guest_flush = 385550813; + */ + protected $guest_flush = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Snapshot snapshot_resource = 481319977 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $snapshot_resource = 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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $disk Name of the persistent disk to snapshot. + * @param \Google\Cloud\Compute\V1\Snapshot $snapshotResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\CreateSnapshotDiskRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $disk, \Google\Cloud\Compute\V1\Snapshot $snapshotResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setDisk($disk) + ->setSnapshotResource($snapshotResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $disk + * Name of the persistent disk to snapshot. + * @type bool $guest_flush + * [Input Only] Whether to attempt an application consistent snapshot by informing the OS to prepare for the snapshot process. + * @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 \Google\Cloud\Compute\V1\Snapshot $snapshot_resource + * The body resource for 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); + } + + /** + * Name of the persistent disk to snapshot. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisk() + { + return $this->disk; + } + + /** + * Name of the persistent disk to snapshot. + * + * 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; + } + + /** + * [Input Only] Whether to attempt an application consistent snapshot by informing the OS to prepare for the snapshot process. + * + * Generated from protobuf field optional bool guest_flush = 385550813; + * @return bool + */ + public function getGuestFlush() + { + return isset($this->guest_flush) ? $this->guest_flush : false; + } + + public function hasGuestFlush() + { + return isset($this->guest_flush); + } + + public function clearGuestFlush() + { + unset($this->guest_flush); + } + + /** + * [Input Only] Whether to attempt an application consistent snapshot by informing the OS to prepare for the snapshot process. + * + * Generated from protobuf field optional bool guest_flush = 385550813; + * @param bool $var + * @return $this + */ + public function setGuestFlush($var) + { + GPBUtil::checkBool($var); + $this->guest_flush = $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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Snapshot snapshot_resource = 481319977 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Snapshot|null + */ + public function getSnapshotResource() + { + return $this->snapshot_resource; + } + + public function hasSnapshotResource() + { + return isset($this->snapshot_resource); + } + + public function clearSnapshotResource() + { + unset($this->snapshot_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Snapshot snapshot_resource = 481319977 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Snapshot $var + * @return $this + */ + public function setSnapshotResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Snapshot::class); + $this->snapshot_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CreateSnapshotRegionDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CreateSnapshotRegionDiskRequest.php new file mode 100644 index 000000000000..e4586e901089 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CreateSnapshotRegionDiskRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.CreateSnapshotRegionDiskRequest + */ +class CreateSnapshotRegionDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the regional persistent disk to snapshot. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Snapshot snapshot_resource = 481319977 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $snapshot_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $disk Name of the regional persistent disk to snapshot. + * @param \Google\Cloud\Compute\V1\Snapshot $snapshotResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\CreateSnapshotRegionDiskRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $disk, \Google\Cloud\Compute\V1\Snapshot $snapshotResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setDisk($disk) + ->setSnapshotResource($snapshotResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $disk + * Name of the regional persistent disk to snapshot. + * @type string $project + * Project ID for this request. + * @type string $region + * 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 \Google\Cloud\Compute\V1\Snapshot $snapshot_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the regional persistent disk to snapshot. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisk() + { + return $this->disk; + } + + /** + * Name of the regional persistent disk to snapshot. + * + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Snapshot snapshot_resource = 481319977 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Snapshot|null + */ + public function getSnapshotResource() + { + return $this->snapshot_resource; + } + + public function hasSnapshotResource() + { + return isset($this->snapshot_resource); + } + + public function clearSnapshotResource() + { + unset($this->snapshot_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Snapshot snapshot_resource = 481319977 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Snapshot $var + * @return $this + */ + public function setSnapshotResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Snapshot::class); + $this->snapshot_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CustomerEncryptionKey.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CustomerEncryptionKey.php new file mode 100644 index 000000000000..668e43d26db7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CustomerEncryptionKey.php @@ -0,0 +1,252 @@ +google.cloud.compute.v1.CustomerEncryptionKey + */ +class CustomerEncryptionKey extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the encryption key that is stored in Google Cloud KMS. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key The fully-qualifed key name may be returned for resource GET requests. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key /cryptoKeyVersions/1 + * + * Generated from protobuf field optional string kms_key_name = 484373913; + */ + protected $kms_key_name = null; + /** + * The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. For example: "kmsKeyServiceAccount": "name@project_id.iam.gserviceaccount.com/ + * + * Generated from protobuf field optional string kms_key_service_account = 209986261; + */ + protected $kms_key_service_account = null; + /** + * Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rawKey": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=" + * + * Generated from protobuf field optional string raw_key = 449196488; + */ + protected $raw_key = null; + /** + * Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rsaEncryptedKey": "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JFH z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUiFoD D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe==" The key must meet the following requirements before you can provide it to Compute Engine: 1. The key is wrapped using a RSA public key certificate provided by Google. 2. After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at: https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem + * + * Generated from protobuf field optional string rsa_encrypted_key = 335487397; + */ + protected $rsa_encrypted_key = null; + /** + * [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. + * + * Generated from protobuf field optional string sha256 = 170112551; + */ + protected $sha256 = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $kms_key_name + * The name of the encryption key that is stored in Google Cloud KMS. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key The fully-qualifed key name may be returned for resource GET requests. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key /cryptoKeyVersions/1 + * @type string $kms_key_service_account + * The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. For example: "kmsKeyServiceAccount": "name@project_id.iam.gserviceaccount.com/ + * @type string $raw_key + * Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rawKey": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=" + * @type string $rsa_encrypted_key + * Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rsaEncryptedKey": "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JFH z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUiFoD D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe==" The key must meet the following requirements before you can provide it to Compute Engine: 1. The key is wrapped using a RSA public key certificate provided by Google. 2. After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at: https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem + * @type string $sha256 + * [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the encryption key that is stored in Google Cloud KMS. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key The fully-qualifed key name may be returned for resource GET requests. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key /cryptoKeyVersions/1 + * + * Generated from protobuf field optional string kms_key_name = 484373913; + * @return string + */ + public function getKmsKeyName() + { + return isset($this->kms_key_name) ? $this->kms_key_name : ''; + } + + public function hasKmsKeyName() + { + return isset($this->kms_key_name); + } + + public function clearKmsKeyName() + { + unset($this->kms_key_name); + } + + /** + * The name of the encryption key that is stored in Google Cloud KMS. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key The fully-qualifed key name may be returned for resource GET requests. For example: "kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key /cryptoKeyVersions/1 + * + * Generated from protobuf field optional string kms_key_name = 484373913; + * @param string $var + * @return $this + */ + public function setKmsKeyName($var) + { + GPBUtil::checkString($var, True); + $this->kms_key_name = $var; + + return $this; + } + + /** + * The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. For example: "kmsKeyServiceAccount": "name@project_id.iam.gserviceaccount.com/ + * + * Generated from protobuf field optional string kms_key_service_account = 209986261; + * @return string + */ + public function getKmsKeyServiceAccount() + { + return isset($this->kms_key_service_account) ? $this->kms_key_service_account : ''; + } + + public function hasKmsKeyServiceAccount() + { + return isset($this->kms_key_service_account); + } + + public function clearKmsKeyServiceAccount() + { + unset($this->kms_key_service_account); + } + + /** + * The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. For example: "kmsKeyServiceAccount": "name@project_id.iam.gserviceaccount.com/ + * + * Generated from protobuf field optional string kms_key_service_account = 209986261; + * @param string $var + * @return $this + */ + public function setKmsKeyServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->kms_key_service_account = $var; + + return $this; + } + + /** + * Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rawKey": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=" + * + * Generated from protobuf field optional string raw_key = 449196488; + * @return string + */ + public function getRawKey() + { + return isset($this->raw_key) ? $this->raw_key : ''; + } + + public function hasRawKey() + { + return isset($this->raw_key); + } + + public function clearRawKey() + { + unset($this->raw_key); + } + + /** + * Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rawKey": "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=" + * + * Generated from protobuf field optional string raw_key = 449196488; + * @param string $var + * @return $this + */ + public function setRawKey($var) + { + GPBUtil::checkString($var, True); + $this->raw_key = $var; + + return $this; + } + + /** + * Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rsaEncryptedKey": "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JFH z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUiFoD D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe==" The key must meet the following requirements before you can provide it to Compute Engine: 1. The key is wrapped using a RSA public key certificate provided by Google. 2. After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at: https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem + * + * Generated from protobuf field optional string rsa_encrypted_key = 335487397; + * @return string + */ + public function getRsaEncryptedKey() + { + return isset($this->rsa_encrypted_key) ? $this->rsa_encrypted_key : ''; + } + + public function hasRsaEncryptedKey() + { + return isset($this->rsa_encrypted_key); + } + + public function clearRsaEncryptedKey() + { + unset($this->rsa_encrypted_key); + } + + /** + * Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. For example: "rsaEncryptedKey": "ieCx/NcW06PcT7Ep1X6LUTc/hLvUDYyzSZPPVCVPTVEohpeHASqC8uw5TzyO9U+Fka9JFH z0mBibXUInrC/jEk014kCK/NPjYgEMOyssZ4ZINPKxlUh2zn1bV+MCaTICrdmuSBTWlUUiFoD D6PYznLwh8ZNdaheCeZ8ewEXgFQ8V+sDroLaN3Xs3MDTXQEMMoNUXMCZEIpg9Vtp9x2oe==" The key must meet the following requirements before you can provide it to Compute Engine: 1. The key is wrapped using a RSA public key certificate provided by Google. 2. After being wrapped, the key must be encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate provided by Google at: https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem + * + * Generated from protobuf field optional string rsa_encrypted_key = 335487397; + * @param string $var + * @return $this + */ + public function setRsaEncryptedKey($var) + { + GPBUtil::checkString($var, True); + $this->rsa_encrypted_key = $var; + + return $this; + } + + /** + * [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. + * + * Generated from protobuf field optional string sha256 = 170112551; + * @return string + */ + public function getSha256() + { + return isset($this->sha256) ? $this->sha256 : ''; + } + + public function hasSha256() + { + return isset($this->sha256); + } + + public function clearSha256() + { + unset($this->sha256); + } + + /** + * [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. + * + * Generated from protobuf field optional string sha256 = 170112551; + * @param string $var + * @return $this + */ + public function setSha256($var) + { + GPBUtil::checkString($var, True); + $this->sha256 = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CustomerEncryptionKeyProtectedDisk.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CustomerEncryptionKeyProtectedDisk.php new file mode 100644 index 000000000000..cd4ca6141b55 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CustomerEncryptionKeyProtectedDisk.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk + */ +class CustomerEncryptionKeyProtectedDisk extends \Google\Protobuf\Internal\Message +{ + /** + * Decrypts data associated with the disk with a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677; + */ + protected $disk_encryption_key = null; + /** + * Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks. For example: "source": "/compute/v1/projects/project_id/zones/zone/disks/ disk_name + * + * Generated from protobuf field optional string source = 177235995; + */ + protected $source = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\CustomerEncryptionKey $disk_encryption_key + * Decrypts data associated with the disk with a customer-supplied encryption key. + * @type string $source + * Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks. For example: "source": "/compute/v1/projects/project_id/zones/zone/disks/ disk_name + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Decrypts data associated with the disk with a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677; + * @return \Google\Cloud\Compute\V1\CustomerEncryptionKey|null + */ + public function getDiskEncryptionKey() + { + return $this->disk_encryption_key; + } + + public function hasDiskEncryptionKey() + { + return isset($this->disk_encryption_key); + } + + public function clearDiskEncryptionKey() + { + unset($this->disk_encryption_key); + } + + /** + * Decrypts data associated with the disk with a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677; + * @param \Google\Cloud\Compute\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setDiskEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomerEncryptionKey::class); + $this->disk_encryption_key = $var; + + return $this; + } + + /** + * Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks. For example: "source": "/compute/v1/projects/project_id/zones/zone/disks/ disk_name + * + * Generated from protobuf field optional string source = 177235995; + * @return string + */ + public function getSource() + { + return isset($this->source) ? $this->source : ''; + } + + public function hasSource() + { + return isset($this->source); + } + + public function clearSource() + { + unset($this->source); + } + + /** + * Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks. For example: "source": "/compute/v1/projects/project_id/zones/zone/disks/ disk_name + * + * Generated from protobuf field optional string source = 177235995; + * @param string $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkString($var, True); + $this->source = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Data.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Data.php new file mode 100644 index 000000000000..182d0504db39 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Data.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.Data + */ +class Data extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + * + * Generated from protobuf field optional string key = 106079; + */ + protected $key = null; + /** + * [Output Only] A warning data value corresponding to the key. + * + * Generated from protobuf field optional string value = 111972721; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + * @type string $value + * [Output Only] A warning data value corresponding to the key. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + * + * Generated from protobuf field optional string key = 106079; + * @return string + */ + public function getKey() + { + return isset($this->key) ? $this->key : ''; + } + + public function hasKey() + { + return isset($this->key); + } + + public function clearKey() + { + unset($this->key); + } + + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + * + * Generated from protobuf field optional string key = 106079; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * [Output Only] A warning data value corresponding to the key. + * + * Generated from protobuf field optional string value = 111972721; + * @return string + */ + public function getValue() + { + return isset($this->value) ? $this->value : ''; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * [Output Only] A warning data value corresponding to the key. + * + * Generated from protobuf field optional string value = 111972721; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteAccessConfigInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteAccessConfigInstanceRequest.php new file mode 100644 index 000000000000..83808a46a0ac --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteAccessConfigInstanceRequest.php @@ -0,0 +1,268 @@ +google.cloud.compute.v1.DeleteAccessConfigInstanceRequest + */ +class DeleteAccessConfigInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the access config to delete. + * + * Generated from protobuf field string access_config = 72856189 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $access_config = ''; + /** + * The instance name for this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * The name of the network interface. + * + * Generated from protobuf field string network_interface = 365387880 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_interface = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance The instance name for this request. + * @param string $accessConfig The name of the access config to delete. + * @param string $networkInterface The name of the network interface. + * + * @return \Google\Cloud\Compute\V1\DeleteAccessConfigInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, string $accessConfig, string $networkInterface): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setAccessConfig($accessConfig) + ->setNetworkInterface($networkInterface); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $access_config + * The name of the access config to delete. + * @type string $instance + * The instance name for this request. + * @type string $network_interface + * The name of the network interface. + * @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 name of the access config to delete. + * + * Generated from protobuf field string access_config = 72856189 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAccessConfig() + { + return $this->access_config; + } + + /** + * The name of the access config to delete. + * + * Generated from protobuf field string access_config = 72856189 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAccessConfig($var) + { + GPBUtil::checkString($var, True); + $this->access_config = $var; + + return $this; + } + + /** + * 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 name of the network interface. + * + * Generated from protobuf field string network_interface = 365387880 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkInterface() + { + return $this->network_interface; + } + + /** + * The name of the network interface. + * + * Generated from protobuf field string network_interface = 365387880 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkInterface($var) + { + GPBUtil::checkString($var, True); + $this->network_interface = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteAddressRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteAddressRequest.php new file mode 100644 index 000000000000..a11c30051a82 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteAddressRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteAddressRequest + */ +class DeleteAddressRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the address resource to delete. + * + * Generated from protobuf field string address = 462920692 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $address = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $address Name of the address resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteAddressRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $address): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setAddress($address); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $address + * Name of the address resource to delete. + * @type string $project + * Project ID for this request. + * @type string $region + * 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); + } + + /** + * Name of the address resource to delete. + * + * Generated from protobuf field string address = 462920692 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAddress() + { + return $this->address; + } + + /** + * Name of the address resource to delete. + * + * Generated from protobuf field string address = 462920692 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkString($var, True); + $this->address = $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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteAutoscalerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteAutoscalerRequest.php new file mode 100644 index 000000000000..c67c60b3b9f3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteAutoscalerRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteAutoscalerRequest + */ +class DeleteAutoscalerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the autoscaler to delete. + * + * Generated from protobuf field string autoscaler = 517258967 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $autoscaler = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * 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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone for this request. + * @param string $autoscaler Name of the autoscaler to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteAutoscalerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $autoscaler): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setAutoscaler($autoscaler); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $autoscaler + * Name of the autoscaler to delete. + * @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 + * Name of the zone for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the autoscaler to delete. + * + * Generated from protobuf field string autoscaler = 517258967 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAutoscaler() + { + return $this->autoscaler; + } + + /** + * Name of the autoscaler to delete. + * + * Generated from protobuf field string autoscaler = 517258967 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAutoscaler($var) + { + GPBUtil::checkString($var, True); + $this->autoscaler = $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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteBackendBucketRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteBackendBucketRequest.php new file mode 100644 index 000000000000..4a24375dee05 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteBackendBucketRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteBackendBucketRequest + */ +class DeleteBackendBucketRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the BackendBucket resource to delete. + * + * Generated from protobuf field string backend_bucket = 91714037 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_bucket = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $backendBucket Name of the BackendBucket resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteBackendBucketRequest + * + * @experimental + */ + public static function build(string $project, string $backendBucket): self + { + return (new self()) + ->setProject($project) + ->setBackendBucket($backendBucket); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_bucket + * Name of the BackendBucket resource to delete. + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the BackendBucket resource to delete. + * + * Generated from protobuf field string backend_bucket = 91714037 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackendBucket() + { + return $this->backend_bucket; + } + + /** + * Name of the BackendBucket resource to delete. + * + * Generated from protobuf field string backend_bucket = 91714037 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackendBucket($var) + { + GPBUtil::checkString($var, True); + $this->backend_bucket = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteBackendServiceRequest.php new file mode 100644 index 000000000000..651a6177bf8c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteBackendServiceRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteBackendServiceRequest + */ +class DeleteBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the BackendService resource to delete. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_service = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $backendService Name of the BackendService resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, string $backendService): self + { + return (new self()) + ->setProject($project) + ->setBackendService($backendService); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_service + * Name of the BackendService resource to delete. + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the BackendService resource to delete. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackendService() + { + return $this->backend_service; + } + + /** + * Name of the BackendService resource to delete. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackendService($var) + { + GPBUtil::checkString($var, True); + $this->backend_service = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteDiskRequest.php new file mode 100644 index 000000000000..e63a19c54995 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteDiskRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteDiskRequest + */ +class DeleteDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the persistent disk to delete. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $disk Name of the persistent disk to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteDiskRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $disk): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setDisk($disk); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $disk + * Name of the persistent disk to delete. + * @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); + } + + /** + * Name of the persistent disk to delete. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisk() + { + return $this->disk; + } + + /** + * Name of the persistent disk to delete. + * + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteExternalVpnGatewayRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteExternalVpnGatewayRequest.php new file mode 100644 index 000000000000..55b4b2204962 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteExternalVpnGatewayRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteExternalVpnGatewayRequest + */ +class DeleteExternalVpnGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the externalVpnGateways to delete. + * + * Generated from protobuf field string external_vpn_gateway = 109898629 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $external_vpn_gateway = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $externalVpnGateway Name of the externalVpnGateways to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteExternalVpnGatewayRequest + * + * @experimental + */ + public static function build(string $project, string $externalVpnGateway): self + { + return (new self()) + ->setProject($project) + ->setExternalVpnGateway($externalVpnGateway); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $external_vpn_gateway + * Name of the externalVpnGateways to delete. + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the externalVpnGateways to delete. + * + * Generated from protobuf field string external_vpn_gateway = 109898629 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getExternalVpnGateway() + { + return $this->external_vpn_gateway; + } + + /** + * Name of the externalVpnGateways to delete. + * + * Generated from protobuf field string external_vpn_gateway = 109898629 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setExternalVpnGateway($var) + { + GPBUtil::checkString($var, True); + $this->external_vpn_gateway = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteFirewallPolicyRequest.php new file mode 100644 index 000000000000..5a92dc55f450 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteFirewallPolicyRequest.php @@ -0,0 +1,124 @@ +google.cloud.compute.v1.DeleteFirewallPolicyRequest + */ +class DeleteFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to delete. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $firewallPolicy Name of the firewall policy to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $firewallPolicy): self + { + return (new self()) + ->setFirewallPolicy($firewallPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to delete. + * @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); + } + + /** + * Name of the firewall policy to delete. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to delete. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteFirewallRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteFirewallRequest.php new file mode 100644 index 000000000000..af6ab6708021 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteFirewallRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteFirewallRequest + */ +class DeleteFirewallRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall rule to delete. + * + * Generated from protobuf field string firewall = 511016192 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $firewall Name of the firewall rule to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteFirewallRequest + * + * @experimental + */ + public static function build(string $project, string $firewall): self + { + return (new self()) + ->setProject($project) + ->setFirewall($firewall); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall + * Name of the firewall rule to delete. + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall rule to delete. + * + * Generated from protobuf field string firewall = 511016192 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewall() + { + return $this->firewall; + } + + /** + * Name of the firewall rule to delete. + * + * Generated from protobuf field string firewall = 511016192 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewall($var) + { + GPBUtil::checkString($var, True); + $this->firewall = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteForwardingRuleRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteForwardingRuleRequest.php new file mode 100644 index 000000000000..50054e9a73c7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteForwardingRuleRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteForwardingRuleRequest + */ +class DeleteForwardingRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the ForwardingRule resource to delete. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $forwarding_rule = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $forwardingRule Name of the ForwardingRule resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteForwardingRuleRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $forwardingRule): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setForwardingRule($forwardingRule); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $forwarding_rule + * Name of the ForwardingRule resource to delete. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the ForwardingRule resource to delete. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getForwardingRule() + { + return $this->forwarding_rule; + } + + /** + * Name of the ForwardingRule resource to delete. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setForwardingRule($var) + { + GPBUtil::checkString($var, True); + $this->forwarding_rule = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalAddressRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalAddressRequest.php new file mode 100644 index 000000000000..fd095f71804e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalAddressRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteGlobalAddressRequest + */ +class DeleteGlobalAddressRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the address resource to delete. + * + * Generated from protobuf field string address = 462920692 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $address = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $address Name of the address resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteGlobalAddressRequest + * + * @experimental + */ + public static function build(string $project, string $address): self + { + return (new self()) + ->setProject($project) + ->setAddress($address); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $address + * Name of the address resource to delete. + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the address resource to delete. + * + * Generated from protobuf field string address = 462920692 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAddress() + { + return $this->address; + } + + /** + * Name of the address resource to delete. + * + * Generated from protobuf field string address = 462920692 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkString($var, True); + $this->address = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalForwardingRuleRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalForwardingRuleRequest.php new file mode 100644 index 000000000000..6c4ba14f8ac7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalForwardingRuleRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest + */ +class DeleteGlobalForwardingRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the ForwardingRule resource to delete. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $forwarding_rule = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $forwardingRule Name of the ForwardingRule resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteGlobalForwardingRuleRequest + * + * @experimental + */ + public static function build(string $project, string $forwardingRule): self + { + return (new self()) + ->setProject($project) + ->setForwardingRule($forwardingRule); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $forwarding_rule + * Name of the ForwardingRule resource to delete. + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the ForwardingRule resource to delete. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getForwardingRule() + { + return $this->forwarding_rule; + } + + /** + * Name of the ForwardingRule resource to delete. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setForwardingRule($var) + { + GPBUtil::checkString($var, True); + $this->forwarding_rule = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalNetworkEndpointGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalNetworkEndpointGroupRequest.php new file mode 100644 index 000000000000..6ccd7f9280cd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalNetworkEndpointGroupRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest + */ +class DeleteGlobalNetworkEndpointGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the network endpoint group to delete. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_endpoint_group = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $networkEndpointGroup The name of the network endpoint group to delete. It should comply with RFC1035. + * + * @return \Google\Cloud\Compute\V1\DeleteGlobalNetworkEndpointGroupRequest + * + * @experimental + */ + public static function build(string $project, string $networkEndpointGroup): self + { + return (new self()) + ->setProject($project) + ->setNetworkEndpointGroup($networkEndpointGroup); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network_endpoint_group + * The name of the network endpoint group to delete. It should comply with RFC1035. + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the network endpoint group to delete. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkEndpointGroup() + { + return $this->network_endpoint_group; + } + + /** + * The name of the network endpoint group to delete. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkEndpointGroup($var) + { + GPBUtil::checkString($var, True); + $this->network_endpoint_group = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalOperationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalOperationRequest.php new file mode 100644 index 000000000000..ba15a8a59fbe --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalOperationRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.DeleteGlobalOperationRequest + */ +class DeleteGlobalOperationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the Operations resource to delete. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $operation = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $operation Name of the Operations resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteGlobalOperationRequest + * + * @experimental + */ + public static function build(string $project, string $operation): self + { + return (new self()) + ->setProject($project) + ->setOperation($operation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $operation + * Name of the Operations resource to delete. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the Operations resource to delete. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getOperation() + { + return $this->operation; + } + + /** + * Name of the Operations resource to delete. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setOperation($var) + { + GPBUtil::checkString($var, True); + $this->operation = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalOperationResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalOperationResponse.php new file mode 100644 index 000000000000..664cb293d2bd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalOperationResponse.php @@ -0,0 +1,33 @@ +google.cloud.compute.v1.DeleteGlobalOperationResponse + */ +class DeleteGlobalOperationResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalOrganizationOperationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalOrganizationOperationRequest.php new file mode 100644 index 000000000000..92045ee266dd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalOrganizationOperationRequest.php @@ -0,0 +1,124 @@ +google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest + */ +class DeleteGlobalOrganizationOperationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the Operations resource to delete. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $operation = ''; + /** + * Parent ID for this request. + * + * Generated from protobuf field optional string parent_id = 459714768; + */ + protected $parent_id = null; + + /** + * @param string $operation Name of the Operations resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest + * + * @experimental + */ + public static function build(string $operation): self + { + return (new self()) + ->setOperation($operation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $operation + * Name of the Operations resource to delete. + * @type string $parent_id + * Parent ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the Operations resource to delete. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getOperation() + { + return $this->operation; + } + + /** + * Name of the Operations resource to delete. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setOperation($var) + { + GPBUtil::checkString($var, True); + $this->operation = $var; + + return $this; + } + + /** + * Parent ID for this request. + * + * Generated from protobuf field optional string parent_id = 459714768; + * @return string + */ + public function getParentId() + { + return isset($this->parent_id) ? $this->parent_id : ''; + } + + public function hasParentId() + { + return isset($this->parent_id); + } + + public function clearParentId() + { + unset($this->parent_id); + } + + /** + * Parent ID for this request. + * + * Generated from protobuf field optional string parent_id = 459714768; + * @param string $var + * @return $this + */ + public function setParentId($var) + { + GPBUtil::checkString($var, True); + $this->parent_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalOrganizationOperationResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalOrganizationOperationResponse.php new file mode 100644 index 000000000000..e51a89eb5cf7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalOrganizationOperationResponse.php @@ -0,0 +1,33 @@ +google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse + */ +class DeleteGlobalOrganizationOperationResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalPublicDelegatedPrefixeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalPublicDelegatedPrefixeRequest.php new file mode 100644 index 000000000000..7fc4b03a47d7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteGlobalPublicDelegatedPrefixeRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest + */ +class DeleteGlobalPublicDelegatedPrefixeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the PublicDelegatedPrefix resource to delete. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $public_delegated_prefix = ''; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $publicDelegatedPrefix Name of the PublicDelegatedPrefix resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteGlobalPublicDelegatedPrefixeRequest + * + * @experimental + */ + public static function build(string $project, string $publicDelegatedPrefix): self + { + return (new self()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $public_delegated_prefix + * Name of the PublicDelegatedPrefix resource to delete. + * @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); + } + + /** + * 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; + } + + /** + * Name of the PublicDelegatedPrefix resource to delete. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPublicDelegatedPrefix() + { + return $this->public_delegated_prefix; + } + + /** + * Name of the PublicDelegatedPrefix resource to delete. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPublicDelegatedPrefix($var) + { + GPBUtil::checkString($var, True); + $this->public_delegated_prefix = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteHealthCheckRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteHealthCheckRequest.php new file mode 100644 index 000000000000..d5f6ac1852f0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteHealthCheckRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteHealthCheckRequest + */ +class DeleteHealthCheckRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the HealthCheck resource to delete. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $health_check = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $healthCheck Name of the HealthCheck resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteHealthCheckRequest + * + * @experimental + */ + public static function build(string $project, string $healthCheck): self + { + return (new self()) + ->setProject($project) + ->setHealthCheck($healthCheck); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $health_check + * Name of the HealthCheck resource to delete. + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the HealthCheck resource to delete. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getHealthCheck() + { + return $this->health_check; + } + + /** + * Name of the HealthCheck resource to delete. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setHealthCheck($var) + { + GPBUtil::checkString($var, True); + $this->health_check = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteImageRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteImageRequest.php new file mode 100644 index 000000000000..f74d6ebe5f1d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteImageRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteImageRequest + */ +class DeleteImageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the image resource to delete. + * + * Generated from protobuf field string image = 100313435 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $image = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $image Name of the image resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteImageRequest + * + * @experimental + */ + public static function build(string $project, string $image): self + { + return (new self()) + ->setProject($project) + ->setImage($image); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $image + * Name of the image resource to delete. + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the image resource to delete. + * + * Generated from protobuf field string image = 100313435 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getImage() + { + return $this->image; + } + + /** + * Name of the image resource to delete. + * + * Generated from protobuf field string image = 100313435 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkString($var, True); + $this->image = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..b0dabaf711fc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstanceGroupManagerRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteInstanceGroupManagerRequest + */ +class DeleteInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group to delete. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the zone where the managed instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. + * @param string $instanceGroupManager The name of the managed instance group to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group to delete. + * @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 where the managed instance group is located. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the managed instance group to delete. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group to delete. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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 where the managed instance group is located. + * + * 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 where the managed instance group is located. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstanceGroupManagerResizeRequestRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstanceGroupManagerResizeRequestRequest.php new file mode 100644 index 000000000000..31433b7f5b72 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstanceGroupManagerResizeRequestRequest.php @@ -0,0 +1,232 @@ +google.cloud.compute.v1.DeleteInstanceGroupManagerResizeRequestRequest + */ +class DeleteInstanceGroupManagerResizeRequestRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group. The name should conform to RFC1035 or be a resource ID. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the resize request to delete. The name should conform to RFC1035 or be a resource ID. + * + * Generated from protobuf field string resize_request = 216941060 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resize_request = ''; + /** + * The name of the zone where the managed instance group is located. The name should conform to RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. The name should conform to RFC1035. + * @param string $instanceGroupManager The name of the managed instance group. The name should conform to RFC1035 or be a resource ID. + * @param string $resizeRequest The name of the resize request to delete. The name should conform to RFC1035 or be a resource ID. + * + * @return \Google\Cloud\Compute\V1\DeleteInstanceGroupManagerResizeRequestRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager, string $resizeRequest): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager) + ->setResizeRequest($resizeRequest); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group. The name should conform to RFC1035 or be a resource ID. + * @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 $resize_request + * The name of the resize request to delete. The name should conform to RFC1035 or be a resource ID. + * @type string $zone + * The name of the zone where the managed instance group is located. The name should conform to RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the managed instance group. The name should conform to RFC1035 or be a resource ID. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. The name should conform to RFC1035 or be a resource ID. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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 resize request to delete. The name should conform to RFC1035 or be a resource ID. + * + * Generated from protobuf field string resize_request = 216941060 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResizeRequest() + { + return $this->resize_request; + } + + /** + * The name of the resize request to delete. The name should conform to RFC1035 or be a resource ID. + * + * Generated from protobuf field string resize_request = 216941060 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResizeRequest($var) + { + GPBUtil::checkString($var, True); + $this->resize_request = $var; + + return $this; + } + + /** + * The name of the zone where the managed instance group is located. The name should conform to RFC1035. + * + * 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 where the managed instance group is located. The name should conform to RFC1035. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstanceGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstanceGroupRequest.php new file mode 100644 index 000000000000..85b64ebf23b2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstanceGroupRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteInstanceGroupRequest + */ +class DeleteInstanceGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the instance group to delete. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the zone where the instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the instance group is located. + * @param string $instanceGroup The name of the instance group to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteInstanceGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroup): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroup($instanceGroup); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group + * The name of the instance group to delete. + * @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 where the instance group is located. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the instance group to delete. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroup() + { + return $this->instance_group; + } + + /** + * The name of the instance group to delete. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroup($var) + { + GPBUtil::checkString($var, True); + $this->instance_group = $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 where the instance group is located. + * + * 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 where the instance group is located. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstanceRequest.php new file mode 100644 index 000000000000..d80de01acdf8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstanceRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteInstanceRequest + */ +class DeleteInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the instance resource to delete. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name of the instance resource to delete. + * @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); + } + + /** + * Name of the instance resource to delete. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance resource to delete. + * + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstanceTemplateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstanceTemplateRequest.php new file mode 100644 index 000000000000..db0357032127 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstanceTemplateRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteInstanceTemplateRequest + */ +class DeleteInstanceTemplateRequest 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]; + */ + protected $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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $instanceTemplate The name of the instance template to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteInstanceTemplateRequest + * + * @experimental + */ + public static function build(string $project, string $instanceTemplate): self + { + return (new self()) + ->setProject($project) + ->setInstanceTemplate($instanceTemplate); + } + + /** + * 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 $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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstancesInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstancesInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..2f718c34feb2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstancesInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest + */ +class DeleteInstancesInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest instance_group_managers_delete_instances_request_resource = 166421252 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_managers_delete_instances_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the zone where the managed instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. + * @param string $instanceGroupManager The name of the managed instance group. + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersDeleteInstancesRequest $instanceGroupManagersDeleteInstancesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\DeleteInstancesInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager, \Google\Cloud\Compute\V1\InstanceGroupManagersDeleteInstancesRequest $instanceGroupManagersDeleteInstancesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersDeleteInstancesRequestResource($instanceGroupManagersDeleteInstancesRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group. + * @type \Google\Cloud\Compute\V1\InstanceGroupManagersDeleteInstancesRequest $instance_group_managers_delete_instances_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 where the managed instance group is located. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest instance_group_managers_delete_instances_request_resource = 166421252 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagersDeleteInstancesRequest|null + */ + public function getInstanceGroupManagersDeleteInstancesRequestResource() + { + return $this->instance_group_managers_delete_instances_request_resource; + } + + public function hasInstanceGroupManagersDeleteInstancesRequestResource() + { + return isset($this->instance_group_managers_delete_instances_request_resource); + } + + public function clearInstanceGroupManagersDeleteInstancesRequestResource() + { + unset($this->instance_group_managers_delete_instances_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest instance_group_managers_delete_instances_request_resource = 166421252 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersDeleteInstancesRequest $var + * @return $this + */ + public function setInstanceGroupManagersDeleteInstancesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagersDeleteInstancesRequest::class); + $this->instance_group_managers_delete_instances_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 where the managed instance group is located. + * + * 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 where the managed instance group is located. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstancesRegionInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstancesRegionInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..3379183b9249 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstancesRegionInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest + */ +class DeleteInstancesRegionInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest region_instance_group_managers_delete_instances_request_resource = 500876665 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_instance_group_managers_delete_instances_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $instanceGroupManager Name of the managed instance group. + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagersDeleteInstancesRequest $regionInstanceGroupManagersDeleteInstancesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\DeleteInstancesRegionInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroupManager, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersDeleteInstancesRequest $regionInstanceGroupManagersDeleteInstancesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroupManager($instanceGroupManager) + ->setRegionInstanceGroupManagersDeleteInstancesRequestResource($regionInstanceGroupManagersDeleteInstancesRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * Name of the managed instance group. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type \Google\Cloud\Compute\V1\RegionInstanceGroupManagersDeleteInstancesRequest $region_instance_group_managers_delete_instances_request_resource + * The body resource 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); + } + + /** + * Name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * Name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest region_instance_group_managers_delete_instances_request_resource = 500876665 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionInstanceGroupManagersDeleteInstancesRequest|null + */ + public function getRegionInstanceGroupManagersDeleteInstancesRequestResource() + { + return $this->region_instance_group_managers_delete_instances_request_resource; + } + + public function hasRegionInstanceGroupManagersDeleteInstancesRequestResource() + { + return isset($this->region_instance_group_managers_delete_instances_request_resource); + } + + public function clearRegionInstanceGroupManagersDeleteInstancesRequestResource() + { + unset($this->region_instance_group_managers_delete_instances_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest region_instance_group_managers_delete_instances_request_resource = 500876665 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagersDeleteInstancesRequest $var + * @return $this + */ + public function setRegionInstanceGroupManagersDeleteInstancesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersDeleteInstancesRequest::class); + $this->region_instance_group_managers_delete_instances_request_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstantSnapshotRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstantSnapshotRequest.php new file mode 100644 index 000000000000..cfef609a04a4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInstantSnapshotRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteInstantSnapshotRequest + */ +class DeleteInstantSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the InstantSnapshot resource to delete. + * + * Generated from protobuf field string instant_snapshot = 391638626 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instant_snapshot = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instantSnapshot Name of the InstantSnapshot resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteInstantSnapshotRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instantSnapshot): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstantSnapshot($instantSnapshot); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instant_snapshot + * Name of the InstantSnapshot resource to delete. + * @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); + } + + /** + * Name of the InstantSnapshot resource to delete. + * + * Generated from protobuf field string instant_snapshot = 391638626 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstantSnapshot() + { + return $this->instant_snapshot; + } + + /** + * Name of the InstantSnapshot resource to delete. + * + * Generated from protobuf field string instant_snapshot = 391638626 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstantSnapshot($var) + { + GPBUtil::checkString($var, True); + $this->instant_snapshot = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInterconnectAttachmentRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInterconnectAttachmentRequest.php new file mode 100644 index 000000000000..9c12870fae06 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInterconnectAttachmentRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteInterconnectAttachmentRequest + */ +class DeleteInterconnectAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the interconnect attachment to delete. + * + * Generated from protobuf field string interconnect_attachment = 308135284 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $interconnect_attachment = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $interconnectAttachment Name of the interconnect attachment to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteInterconnectAttachmentRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $interconnectAttachment): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInterconnectAttachment($interconnectAttachment); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $interconnect_attachment + * Name of the interconnect attachment to delete. + * @type string $project + * Project ID for this request. + * @type string $region + * 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); + } + + /** + * Name of the interconnect attachment to delete. + * + * Generated from protobuf field string interconnect_attachment = 308135284 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInterconnectAttachment() + { + return $this->interconnect_attachment; + } + + /** + * Name of the interconnect attachment to delete. + * + * Generated from protobuf field string interconnect_attachment = 308135284 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInterconnectAttachment($var) + { + GPBUtil::checkString($var, True); + $this->interconnect_attachment = $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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInterconnectRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInterconnectRequest.php new file mode 100644 index 000000000000..20d086f3e0d0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteInterconnectRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteInterconnectRequest + */ +class DeleteInterconnectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the interconnect to delete. + * + * Generated from protobuf field string interconnect = 224601230 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $interconnect = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $interconnect Name of the interconnect to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteInterconnectRequest + * + * @experimental + */ + public static function build(string $project, string $interconnect): self + { + return (new self()) + ->setProject($project) + ->setInterconnect($interconnect); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $interconnect + * Name of the interconnect to delete. + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the interconnect to delete. + * + * Generated from protobuf field string interconnect = 224601230 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInterconnect() + { + return $this->interconnect; + } + + /** + * Name of the interconnect to delete. + * + * Generated from protobuf field string interconnect = 224601230 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInterconnect($var) + { + GPBUtil::checkString($var, True); + $this->interconnect = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteLicenseRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteLicenseRequest.php new file mode 100644 index 000000000000..ed8681ad2da3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteLicenseRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteLicenseRequest + */ +class DeleteLicenseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the license resource to delete. + * + * Generated from protobuf field string license = 166757441 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $license = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $license Name of the license resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteLicenseRequest + * + * @experimental + */ + public static function build(string $project, string $license): self + { + return (new self()) + ->setProject($project) + ->setLicense($license); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $license + * Name of the license resource to delete. + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the license resource to delete. + * + * Generated from protobuf field string license = 166757441 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLicense() + { + return $this->license; + } + + /** + * Name of the license resource to delete. + * + * Generated from protobuf field string license = 166757441 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLicense($var) + { + GPBUtil::checkString($var, True); + $this->license = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteMachineImageRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteMachineImageRequest.php new file mode 100644 index 000000000000..ef53d66ddff0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteMachineImageRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteMachineImageRequest + */ +class DeleteMachineImageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the machine image to delete. + * + * Generated from protobuf field string machine_image = 69189475 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $machine_image = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $machineImage The name of the machine image to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteMachineImageRequest + * + * @experimental + */ + public static function build(string $project, string $machineImage): self + { + return (new self()) + ->setProject($project) + ->setMachineImage($machineImage); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $machine_image + * The name of the machine image to delete. + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the machine image to delete. + * + * Generated from protobuf field string machine_image = 69189475 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getMachineImage() + { + return $this->machine_image; + } + + /** + * The name of the machine image to delete. + * + * Generated from protobuf field string machine_image = 69189475 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setMachineImage($var) + { + GPBUtil::checkString($var, True); + $this->machine_image = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNetworkAttachmentRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNetworkAttachmentRequest.php new file mode 100644 index 000000000000..7bd52f26c713 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNetworkAttachmentRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteNetworkAttachmentRequest + */ +class DeleteNetworkAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the NetworkAttachment resource to delete. + * + * Generated from protobuf field string network_attachment = 224644052 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_attachment = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region of this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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). end_interface: MixerMutationRequestBuilder + * + * Generated from protobuf field optional string request_id = 37109963; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region of this request. + * @param string $networkAttachment Name of the NetworkAttachment resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteNetworkAttachmentRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $networkAttachment): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setNetworkAttachment($networkAttachment); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network_attachment + * Name of the NetworkAttachment resource to delete. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region of 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). end_interface: MixerMutationRequestBuilder + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the NetworkAttachment resource to delete. + * + * Generated from protobuf field string network_attachment = 224644052 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkAttachment() + { + return $this->network_attachment; + } + + /** + * Name of the NetworkAttachment resource to delete. + * + * Generated from protobuf field string network_attachment = 224644052 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkAttachment($var) + { + GPBUtil::checkString($var, True); + $this->network_attachment = $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; + } + + /** + * Name of the region of 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; + } + + /** + * Name of the region of 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). end_interface: MixerMutationRequestBuilder + * + * 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). end_interface: MixerMutationRequestBuilder + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNetworkEdgeSecurityServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNetworkEdgeSecurityServiceRequest.php new file mode 100644 index 000000000000..02bfdc310fbe --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNetworkEdgeSecurityServiceRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteNetworkEdgeSecurityServiceRequest + */ +class DeleteNetworkEdgeSecurityServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the network edge security service to delete. + * + * Generated from protobuf field string network_edge_security_service = 157011879 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_edge_security_service = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $networkEdgeSecurityService Name of the network edge security service to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteNetworkEdgeSecurityServiceRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $networkEdgeSecurityService): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setNetworkEdgeSecurityService($networkEdgeSecurityService); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network_edge_security_service + * Name of the network edge security service to delete. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the network edge security service to delete. + * + * Generated from protobuf field string network_edge_security_service = 157011879 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkEdgeSecurityService() + { + return $this->network_edge_security_service; + } + + /** + * Name of the network edge security service to delete. + * + * Generated from protobuf field string network_edge_security_service = 157011879 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkEdgeSecurityService($var) + { + GPBUtil::checkString($var, True); + $this->network_edge_security_service = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNetworkEndpointGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNetworkEndpointGroupRequest.php new file mode 100644 index 000000000000..1a56a6fc4115 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNetworkEndpointGroupRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest + */ +class DeleteNetworkEndpointGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the network endpoint group to delete. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_endpoint_group = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @param string $networkEndpointGroup The name of the network endpoint group to delete. It should comply with RFC1035. + * + * @return \Google\Cloud\Compute\V1\DeleteNetworkEndpointGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $networkEndpointGroup): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setNetworkEndpointGroup($networkEndpointGroup); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network_endpoint_group + * The name of the network endpoint group to delete. It should comply with RFC1035. + * @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 where the network endpoint group is located. It should comply with RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the network endpoint group to delete. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkEndpointGroup() + { + return $this->network_endpoint_group; + } + + /** + * The name of the network endpoint group to delete. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkEndpointGroup($var) + { + GPBUtil::checkString($var, True); + $this->network_endpoint_group = $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 where the network endpoint group is located. It should comply with RFC1035. + * + * 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 where the network endpoint group is located. It should comply with RFC1035. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..1c7e5b3d62a9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNetworkFirewallPolicyRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteNetworkFirewallPolicyRequest + */ +class DeleteNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to delete. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $firewallPolicy Name of the firewall policy to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $firewallPolicy): self + { + return (new self()) + ->setProject($project) + ->setFirewallPolicy($firewallPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to delete. + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall policy to delete. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to delete. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNetworkRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNetworkRequest.php new file mode 100644 index 000000000000..8e51626cfbbb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNetworkRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteNetworkRequest + */ +class DeleteNetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the network to delete. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $network Name of the network to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteNetworkRequest + * + * @experimental + */ + public static function build(string $project, string $network): self + { + return (new self()) + ->setProject($project) + ->setNetwork($network); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Name of the network to delete. + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the network to delete. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Name of the network to delete. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNodeGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNodeGroupRequest.php new file mode 100644 index 000000000000..2d813cd4ac3e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNodeGroupRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteNodeGroupRequest + */ +class DeleteNodeGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the NodeGroup resource to delete. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $node_group = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $nodeGroup Name of the NodeGroup resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteNodeGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $nodeGroup): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setNodeGroup($nodeGroup); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $node_group + * Name of the NodeGroup resource to delete. + * @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); + } + + /** + * Name of the NodeGroup resource to delete. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNodeGroup() + { + return $this->node_group; + } + + /** + * Name of the NodeGroup resource to delete. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNodeGroup($var) + { + GPBUtil::checkString($var, True); + $this->node_group = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNodeTemplateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNodeTemplateRequest.php new file mode 100644 index 000000000000..b298db1b7c4e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNodeTemplateRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteNodeTemplateRequest + */ +class DeleteNodeTemplateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the NodeTemplate resource to delete. + * + * Generated from protobuf field string node_template = 323154455 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $node_template = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $nodeTemplate Name of the NodeTemplate resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteNodeTemplateRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $nodeTemplate): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setNodeTemplate($nodeTemplate); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $node_template + * Name of the NodeTemplate resource 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); + } + + /** + * Name of the NodeTemplate resource to delete. + * + * Generated from protobuf field string node_template = 323154455 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNodeTemplate() + { + return $this->node_template; + } + + /** + * Name of the NodeTemplate resource to delete. + * + * Generated from protobuf field string node_template = 323154455 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNodeTemplate($var) + { + GPBUtil::checkString($var, True); + $this->node_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNodesNodeGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNodesNodeGroupRequest.php new file mode 100644 index 000000000000..9ca8acbf6332 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteNodesNodeGroupRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.DeleteNodesNodeGroupRequest + */ +class DeleteNodesNodeGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the NodeGroup resource whose nodes will be deleted. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $node_group = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeGroupsDeleteNodesRequest node_groups_delete_nodes_request_resource = 183298962 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $node_groups_delete_nodes_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $nodeGroup Name of the NodeGroup resource whose nodes will be deleted. + * @param \Google\Cloud\Compute\V1\NodeGroupsDeleteNodesRequest $nodeGroupsDeleteNodesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\DeleteNodesNodeGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $nodeGroup, \Google\Cloud\Compute\V1\NodeGroupsDeleteNodesRequest $nodeGroupsDeleteNodesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setNodeGroup($nodeGroup) + ->setNodeGroupsDeleteNodesRequestResource($nodeGroupsDeleteNodesRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $node_group + * Name of the NodeGroup resource whose nodes will be deleted. + * @type \Google\Cloud\Compute\V1\NodeGroupsDeleteNodesRequest $node_groups_delete_nodes_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); + } + + /** + * Name of the NodeGroup resource whose nodes will be deleted. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNodeGroup() + { + return $this->node_group; + } + + /** + * Name of the NodeGroup resource whose nodes will be deleted. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNodeGroup($var) + { + GPBUtil::checkString($var, True); + $this->node_group = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeGroupsDeleteNodesRequest node_groups_delete_nodes_request_resource = 183298962 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NodeGroupsDeleteNodesRequest|null + */ + public function getNodeGroupsDeleteNodesRequestResource() + { + return $this->node_groups_delete_nodes_request_resource; + } + + public function hasNodeGroupsDeleteNodesRequestResource() + { + return isset($this->node_groups_delete_nodes_request_resource); + } + + public function clearNodeGroupsDeleteNodesRequestResource() + { + unset($this->node_groups_delete_nodes_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeGroupsDeleteNodesRequest node_groups_delete_nodes_request_resource = 183298962 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NodeGroupsDeleteNodesRequest $var + * @return $this + */ + public function setNodeGroupsDeleteNodesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NodeGroupsDeleteNodesRequest::class); + $this->node_groups_delete_nodes_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeletePacketMirroringRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeletePacketMirroringRequest.php new file mode 100644 index 000000000000..946ddac2188d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeletePacketMirroringRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeletePacketMirroringRequest + */ +class DeletePacketMirroringRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the PacketMirroring resource to delete. + * + * Generated from protobuf field string packet_mirroring = 22305996 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $packet_mirroring = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $packetMirroring Name of the PacketMirroring resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeletePacketMirroringRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $packetMirroring): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setPacketMirroring($packetMirroring); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $packet_mirroring + * Name of the PacketMirroring resource to delete. + * @type string $project + * Project ID for this request. + * @type string $region + * 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); + } + + /** + * Name of the PacketMirroring resource to delete. + * + * Generated from protobuf field string packet_mirroring = 22305996 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPacketMirroring() + { + return $this->packet_mirroring; + } + + /** + * Name of the PacketMirroring resource to delete. + * + * Generated from protobuf field string packet_mirroring = 22305996 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPacketMirroring($var) + { + GPBUtil::checkString($var, True); + $this->packet_mirroring = $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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeletePerInstanceConfigsInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeletePerInstanceConfigsInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..ef0a7993a104 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeletePerInstanceConfigsInstanceGroupManagerRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest + */ +class DeletePerInstanceConfigsInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq instance_group_managers_delete_per_instance_configs_req_resource = 362427680 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_managers_delete_per_instance_configs_req_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"]; + */ + protected $project = ''; + /** + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @param string $instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersDeletePerInstanceConfigsReq $instanceGroupManagersDeletePerInstanceConfigsReqResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\DeletePerInstanceConfigsInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager, \Google\Cloud\Compute\V1\InstanceGroupManagersDeletePerInstanceConfigsReq $instanceGroupManagersDeletePerInstanceConfigsReqResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersDeletePerInstanceConfigsReqResource($instanceGroupManagersDeletePerInstanceConfigsReqResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group. It should conform to RFC1035. + * @type \Google\Cloud\Compute\V1\InstanceGroupManagersDeletePerInstanceConfigsReq $instance_group_managers_delete_per_instance_configs_req_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $zone + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq instance_group_managers_delete_per_instance_configs_req_resource = 362427680 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagersDeletePerInstanceConfigsReq|null + */ + public function getInstanceGroupManagersDeletePerInstanceConfigsReqResource() + { + return $this->instance_group_managers_delete_per_instance_configs_req_resource; + } + + public function hasInstanceGroupManagersDeletePerInstanceConfigsReqResource() + { + return isset($this->instance_group_managers_delete_per_instance_configs_req_resource); + } + + public function clearInstanceGroupManagersDeletePerInstanceConfigsReqResource() + { + unset($this->instance_group_managers_delete_per_instance_configs_req_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq instance_group_managers_delete_per_instance_configs_req_resource = 362427680 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersDeletePerInstanceConfigsReq $var + * @return $this + */ + public function setInstanceGroupManagersDeletePerInstanceConfigsReqResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagersDeletePerInstanceConfigsReq::class); + $this->instance_group_managers_delete_per_instance_configs_req_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 zone where the managed instance group is located. It should conform to RFC1035. + * + * 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 where the managed instance group is located. It should conform to RFC1035. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..c8cd755f17c9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + */ +class DeletePerInstanceConfigsRegionInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request, should conform to RFC1035. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq region_instance_group_manager_delete_instance_config_req_resource = 740741 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_instance_group_manager_delete_instance_config_req_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request, should conform to RFC1035. + * @param string $instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagerDeleteInstanceConfigReq $regionInstanceGroupManagerDeleteInstanceConfigReqResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroupManager, \Google\Cloud\Compute\V1\RegionInstanceGroupManagerDeleteInstanceConfigReq $regionInstanceGroupManagerDeleteInstanceConfigReqResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroupManager($instanceGroupManager) + ->setRegionInstanceGroupManagerDeleteInstanceConfigReqResource($regionInstanceGroupManagerDeleteInstanceConfigReqResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group. It should conform to RFC1035. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request, should conform to RFC1035. + * @type \Google\Cloud\Compute\V1\RegionInstanceGroupManagerDeleteInstanceConfigReq $region_instance_group_manager_delete_instance_config_req_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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; + } + + /** + * Name of the region scoping this request, should conform to RFC1035. + * + * 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; + } + + /** + * Name of the region scoping this request, should conform to RFC1035. + * + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq region_instance_group_manager_delete_instance_config_req_resource = 740741 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionInstanceGroupManagerDeleteInstanceConfigReq|null + */ + public function getRegionInstanceGroupManagerDeleteInstanceConfigReqResource() + { + return $this->region_instance_group_manager_delete_instance_config_req_resource; + } + + public function hasRegionInstanceGroupManagerDeleteInstanceConfigReqResource() + { + return isset($this->region_instance_group_manager_delete_instance_config_req_resource); + } + + public function clearRegionInstanceGroupManagerDeleteInstanceConfigReqResource() + { + unset($this->region_instance_group_manager_delete_instance_config_req_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq region_instance_group_manager_delete_instance_config_req_resource = 740741 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagerDeleteInstanceConfigReq $var + * @return $this + */ + public function setRegionInstanceGroupManagerDeleteInstanceConfigReqResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionInstanceGroupManagerDeleteInstanceConfigReq::class); + $this->region_instance_group_manager_delete_instance_config_req_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeletePublicAdvertisedPrefixeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeletePublicAdvertisedPrefixeRequest.php new file mode 100644 index 000000000000..924eda03a58b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeletePublicAdvertisedPrefixeRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest + */ +class DeletePublicAdvertisedPrefixeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the PublicAdvertisedPrefix resource to delete. + * + * Generated from protobuf field string public_advertised_prefix = 101874590 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $public_advertised_prefix = ''; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $publicAdvertisedPrefix Name of the PublicAdvertisedPrefix resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeletePublicAdvertisedPrefixeRequest + * + * @experimental + */ + public static function build(string $project, string $publicAdvertisedPrefix): self + { + return (new self()) + ->setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $public_advertised_prefix + * Name of the PublicAdvertisedPrefix resource to delete. + * @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); + } + + /** + * 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; + } + + /** + * Name of the PublicAdvertisedPrefix resource to delete. + * + * Generated from protobuf field string public_advertised_prefix = 101874590 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPublicAdvertisedPrefix() + { + return $this->public_advertised_prefix; + } + + /** + * Name of the PublicAdvertisedPrefix resource to delete. + * + * Generated from protobuf field string public_advertised_prefix = 101874590 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPublicAdvertisedPrefix($var) + { + GPBUtil::checkString($var, True); + $this->public_advertised_prefix = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeletePublicDelegatedPrefixeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeletePublicDelegatedPrefixeRequest.php new file mode 100644 index 000000000000..a2c01a9ac080 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeletePublicDelegatedPrefixeRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest + */ +class DeletePublicDelegatedPrefixeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the PublicDelegatedPrefix resource to delete. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $public_delegated_prefix = ''; + /** + * Name of the region of this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region of this request. + * @param string $publicDelegatedPrefix Name of the PublicDelegatedPrefix resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeletePublicDelegatedPrefixeRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $publicDelegatedPrefix): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setPublicDelegatedPrefix($publicDelegatedPrefix); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $public_delegated_prefix + * Name of the PublicDelegatedPrefix resource to delete. + * @type string $region + * Name of the region of 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); + } + + /** + * 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; + } + + /** + * Name of the PublicDelegatedPrefix resource to delete. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPublicDelegatedPrefix() + { + return $this->public_delegated_prefix; + } + + /** + * Name of the PublicDelegatedPrefix resource to delete. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPublicDelegatedPrefix($var) + { + GPBUtil::checkString($var, True); + $this->public_delegated_prefix = $var; + + return $this; + } + + /** + * Name of the region of 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; + } + + /** + * Name of the region of 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionAutoscalerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionAutoscalerRequest.php new file mode 100644 index 000000000000..604f0c38eab7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionAutoscalerRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteRegionAutoscalerRequest + */ +class DeleteRegionAutoscalerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the autoscaler to delete. + * + * Generated from protobuf field string autoscaler = 517258967 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $autoscaler = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $autoscaler Name of the autoscaler to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteRegionAutoscalerRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $autoscaler): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setAutoscaler($autoscaler); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $autoscaler + * Name of the autoscaler to delete. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the autoscaler to delete. + * + * Generated from protobuf field string autoscaler = 517258967 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAutoscaler() + { + return $this->autoscaler; + } + + /** + * Name of the autoscaler to delete. + * + * Generated from protobuf field string autoscaler = 517258967 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAutoscaler($var) + { + GPBUtil::checkString($var, True); + $this->autoscaler = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionBackendServiceRequest.php new file mode 100644 index 000000000000..afd66b4c47ac --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionBackendServiceRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteRegionBackendServiceRequest + */ +class DeleteRegionBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the BackendService resource to delete. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_service = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $backendService Name of the BackendService resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteRegionBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $backendService): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setBackendService($backendService); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_service + * Name of the BackendService resource to delete. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the BackendService resource to delete. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackendService() + { + return $this->backend_service; + } + + /** + * Name of the BackendService resource to delete. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackendService($var) + { + GPBUtil::checkString($var, True); + $this->backend_service = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionDiskRequest.php new file mode 100644 index 000000000000..072f6a3b0ac6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionDiskRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteRegionDiskRequest + */ +class DeleteRegionDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the regional persistent disk to delete. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $disk Name of the regional persistent disk to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteRegionDiskRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $disk): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setDisk($disk); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $disk + * Name of the regional persistent disk to delete. + * @type string $project + * Project ID for this request. + * @type string $region + * 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); + } + + /** + * Name of the regional persistent disk to delete. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisk() + { + return $this->disk; + } + + /** + * Name of the regional persistent disk to delete. + * + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionHealthCheckRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionHealthCheckRequest.php new file mode 100644 index 000000000000..9cc2dac5f584 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionHealthCheckRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteRegionHealthCheckRequest + */ +class DeleteRegionHealthCheckRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the HealthCheck resource to delete. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $health_check = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $healthCheck Name of the HealthCheck resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteRegionHealthCheckRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $healthCheck): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setHealthCheck($healthCheck); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $health_check + * Name of the HealthCheck resource to delete. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the HealthCheck resource to delete. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getHealthCheck() + { + return $this->health_check; + } + + /** + * Name of the HealthCheck resource to delete. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setHealthCheck($var) + { + GPBUtil::checkString($var, True); + $this->health_check = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionHealthCheckServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionHealthCheckServiceRequest.php new file mode 100644 index 000000000000..814ea05db8ba --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionHealthCheckServiceRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest + */ +class DeleteRegionHealthCheckServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the HealthCheckService to delete. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string health_check_service = 408374747 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $health_check_service = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $healthCheckService Name of the HealthCheckService to delete. The name must be 1-63 characters long, and comply with RFC1035. + * + * @return \Google\Cloud\Compute\V1\DeleteRegionHealthCheckServiceRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $healthCheckService): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setHealthCheckService($healthCheckService); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $health_check_service + * Name of the HealthCheckService to delete. The name must be 1-63 characters long, and comply with RFC1035. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the HealthCheckService to delete. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string health_check_service = 408374747 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getHealthCheckService() + { + return $this->health_check_service; + } + + /** + * Name of the HealthCheckService to delete. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string health_check_service = 408374747 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setHealthCheckService($var) + { + GPBUtil::checkString($var, True); + $this->health_check_service = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..440c7660b4eb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionInstanceGroupManagerRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest + */ +class DeleteRegionInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the managed instance group to delete. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $instanceGroupManager Name of the managed instance group to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteRegionInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroupManager): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroupManager($instanceGroupManager); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * Name of the managed instance group to delete. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the managed instance group to delete. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * Name of the managed instance group to delete. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionInstanceTemplateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionInstanceTemplateRequest.php new file mode 100644 index 000000000000..7086be486330 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionInstanceTemplateRequest.php @@ -0,0 +1,196 @@ +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]; + */ + protected $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"]; + */ + protected $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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $instanceTemplate The name of the instance template to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteRegionInstanceTemplateRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceTemplate): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceTemplate($instanceTemplate); + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionInstantSnapshotRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionInstantSnapshotRequest.php new file mode 100644 index 000000000000..d51beda56198 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionInstantSnapshotRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteRegionInstantSnapshotRequest + */ +class DeleteRegionInstantSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the InstantSnapshot resource to delete. + * + * Generated from protobuf field string instant_snapshot = 391638626 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instant_snapshot = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $instantSnapshot Name of the InstantSnapshot resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteRegionInstantSnapshotRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instantSnapshot): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstantSnapshot($instantSnapshot); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instant_snapshot + * Name of the InstantSnapshot resource 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); + } + + /** + * Name of the InstantSnapshot resource to delete. + * + * Generated from protobuf field string instant_snapshot = 391638626 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstantSnapshot() + { + return $this->instant_snapshot; + } + + /** + * Name of the InstantSnapshot resource to delete. + * + * Generated from protobuf field string instant_snapshot = 391638626 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstantSnapshot($var) + { + GPBUtil::checkString($var, True); + $this->instant_snapshot = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionNetworkEndpointGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionNetworkEndpointGroupRequest.php new file mode 100644 index 000000000000..cd7825917c03 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionNetworkEndpointGroupRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest + */ +class DeleteRegionNetworkEndpointGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the network endpoint group to delete. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_endpoint_group = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The name of the region where the network endpoint group is located. It should comply with RFC1035. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region where the network endpoint group is located. It should comply with RFC1035. + * @param string $networkEndpointGroup The name of the network endpoint group to delete. It should comply with RFC1035. + * + * @return \Google\Cloud\Compute\V1\DeleteRegionNetworkEndpointGroupRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $networkEndpointGroup): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setNetworkEndpointGroup($networkEndpointGroup); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network_endpoint_group + * The name of the network endpoint group to delete. It should comply with RFC1035. + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region where the network endpoint group is located. It should comply with RFC1035. + * @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 network endpoint group to delete. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkEndpointGroup() + { + return $this->network_endpoint_group; + } + + /** + * The name of the network endpoint group to delete. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkEndpointGroup($var) + { + GPBUtil::checkString($var, True); + $this->network_endpoint_group = $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 where the network endpoint group is located. It should comply with RFC1035. + * + * 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 where the network endpoint group is located. It should comply with RFC1035. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..523493331572 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionNetworkFirewallPolicyRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteRegionNetworkFirewallPolicyRequest + */ +class DeleteRegionNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to delete. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $firewallPolicy Name of the firewall policy to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteRegionNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $firewallPolicy): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setFirewallPolicy($firewallPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to delete. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the firewall policy to delete. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to delete. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionNotificationEndpointRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionNotificationEndpointRequest.php new file mode 100644 index 000000000000..22d00a7512ba --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionNotificationEndpointRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest + */ +class DeleteRegionNotificationEndpointRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the NotificationEndpoint resource to delete. + * + * Generated from protobuf field string notification_endpoint = 376807017 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $notification_endpoint = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $notificationEndpoint Name of the NotificationEndpoint resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteRegionNotificationEndpointRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $notificationEndpoint): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setNotificationEndpoint($notificationEndpoint); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $notification_endpoint + * Name of the NotificationEndpoint resource to delete. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the NotificationEndpoint resource to delete. + * + * Generated from protobuf field string notification_endpoint = 376807017 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNotificationEndpoint() + { + return $this->notification_endpoint; + } + + /** + * Name of the NotificationEndpoint resource to delete. + * + * Generated from protobuf field string notification_endpoint = 376807017 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNotificationEndpoint($var) + { + GPBUtil::checkString($var, True); + $this->notification_endpoint = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionOperationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionOperationRequest.php new file mode 100644 index 000000000000..968e0f17e8e2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionOperationRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.DeleteRegionOperationRequest + */ +class DeleteRegionOperationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the Operations resource to delete. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $operation = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $operation Name of the Operations resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteRegionOperationRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $operation): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setOperation($operation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $operation + * Name of the Operations resource to delete. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the Operations resource to delete. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getOperation() + { + return $this->operation; + } + + /** + * Name of the Operations resource to delete. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setOperation($var) + { + GPBUtil::checkString($var, True); + $this->operation = $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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionOperationResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionOperationResponse.php new file mode 100644 index 000000000000..b8e42a609807 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionOperationResponse.php @@ -0,0 +1,33 @@ +google.cloud.compute.v1.DeleteRegionOperationResponse + */ +class DeleteRegionOperationResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionSecurityPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionSecurityPolicyRequest.php new file mode 100644 index 000000000000..c52c83418a55 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionSecurityPolicyRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteRegionSecurityPolicyRequest + */ +class DeleteRegionSecurityPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the security policy to delete. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $securityPolicy Name of the security policy to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteRegionSecurityPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $securityPolicy): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 $security_policy + * Name of the security policy to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the security policy to delete. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSecurityPolicy() + { + return $this->security_policy; + } + + /** + * Name of the security policy to delete. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->security_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionSslCertificateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionSslCertificateRequest.php new file mode 100644 index 000000000000..76f186fe84e0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionSslCertificateRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteRegionSslCertificateRequest + */ +class DeleteRegionSslCertificateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the SslCertificate resource to delete. + * + * Generated from protobuf field string ssl_certificate = 46443492 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ssl_certificate = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $sslCertificate Name of the SslCertificate resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteRegionSslCertificateRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $sslCertificate): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setSslCertificate($sslCertificate); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 $ssl_certificate + * Name of the SslCertificate resource to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the SslCertificate resource to delete. + * + * Generated from protobuf field string ssl_certificate = 46443492 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSslCertificate() + { + return $this->ssl_certificate; + } + + /** + * Name of the SslCertificate resource to delete. + * + * Generated from protobuf field string ssl_certificate = 46443492 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSslCertificate($var) + { + GPBUtil::checkString($var, True); + $this->ssl_certificate = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionSslPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionSslPolicyRequest.php new file mode 100644 index 000000000000..14c9e6262a7e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionSslPolicyRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteRegionSslPolicyRequest + */ +class DeleteRegionSslPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string ssl_policy = 295190213 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ssl_policy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $sslPolicy Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. + * + * @return \Google\Cloud\Compute\V1\DeleteRegionSslPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $sslPolicy): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setSslPolicy($sslPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 $ssl_policy + * Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string ssl_policy = 295190213 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSslPolicy() + { + return $this->ssl_policy; + } + + /** + * Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string ssl_policy = 295190213 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSslPolicy($var) + { + GPBUtil::checkString($var, True); + $this->ssl_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionTargetHttpProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionTargetHttpProxyRequest.php new file mode 100644 index 000000000000..fec987d6a913 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionTargetHttpProxyRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest + */ +class DeleteRegionTargetHttpProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the TargetHttpProxy resource to delete. + * + * Generated from protobuf field string target_http_proxy = 206872421 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_http_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetHttpProxy Name of the TargetHttpProxy resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteRegionTargetHttpProxyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $targetHttpProxy): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpProxy($targetHttpProxy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 $target_http_proxy + * Name of the TargetHttpProxy resource to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the TargetHttpProxy resource to delete. + * + * Generated from protobuf field string target_http_proxy = 206872421 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetHttpProxy() + { + return $this->target_http_proxy; + } + + /** + * Name of the TargetHttpProxy resource to delete. + * + * Generated from protobuf field string target_http_proxy = 206872421 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetHttpProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_http_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionTargetHttpsProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionTargetHttpsProxyRequest.php new file mode 100644 index 000000000000..5b1b71cf7320 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionTargetHttpsProxyRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest + */ +class DeleteRegionTargetHttpsProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the TargetHttpsProxy resource to delete. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_https_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteRegionTargetHttpsProxyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $targetHttpsProxy): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpsProxy($targetHttpsProxy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 $target_https_proxy + * Name of the TargetHttpsProxy resource to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the TargetHttpsProxy resource to delete. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetHttpsProxy() + { + return $this->target_https_proxy; + } + + /** + * Name of the TargetHttpsProxy resource to delete. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetHttpsProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_https_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionTargetTcpProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionTargetTcpProxyRequest.php new file mode 100644 index 000000000000..7f8c10f25370 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionTargetTcpProxyRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteRegionTargetTcpProxyRequest + */ +class DeleteRegionTargetTcpProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the TargetTcpProxy resource to delete. + * + * Generated from protobuf field string target_tcp_proxy = 503065442 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_tcp_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetTcpProxy Name of the TargetTcpProxy resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteRegionTargetTcpProxyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $targetTcpProxy): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetTcpProxy($targetTcpProxy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 $target_tcp_proxy + * Name of the TargetTcpProxy resource to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the TargetTcpProxy resource to delete. + * + * Generated from protobuf field string target_tcp_proxy = 503065442 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetTcpProxy() + { + return $this->target_tcp_proxy; + } + + /** + * Name of the TargetTcpProxy resource to delete. + * + * Generated from protobuf field string target_tcp_proxy = 503065442 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetTcpProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_tcp_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionUrlMapRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionUrlMapRequest.php new file mode 100644 index 000000000000..a2ded264c587 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRegionUrlMapRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteRegionUrlMapRequest + */ +class DeleteRegionUrlMapRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * + * Generated from protobuf field optional string request_id = 37109963; + */ + protected $request_id = null; + /** + * Name of the UrlMap resource to delete. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url_map = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $urlMap Name of the UrlMap resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteRegionUrlMapRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $urlMap): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setUrlMap($urlMap); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type string $request_id + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * @type string $url_map + * Name of the UrlMap resource to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * + * 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); + } + + /** + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * + * 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; + } + + /** + * Name of the UrlMap resource to delete. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUrlMap() + { + return $this->url_map; + } + + /** + * Name of the UrlMap resource to delete. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUrlMap($var) + { + GPBUtil::checkString($var, True); + $this->url_map = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteReservationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteReservationRequest.php new file mode 100644 index 000000000000..00511e3d303a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteReservationRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteReservationRequest + */ +class DeleteReservationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the reservation to delete. + * + * Generated from protobuf field string reservation = 47530956 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $reservation = ''; + /** + * 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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone for this request. + * @param string $reservation Name of the reservation to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteReservationRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $reservation): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setReservation($reservation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $reservation + * Name of the reservation to delete. + * @type string $zone + * Name of the zone for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the reservation to delete. + * + * Generated from protobuf field string reservation = 47530956 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getReservation() + { + return $this->reservation; + } + + /** + * Name of the reservation to delete. + * + * Generated from protobuf field string reservation = 47530956 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setReservation($var) + { + GPBUtil::checkString($var, True); + $this->reservation = $var; + + return $this; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteResourcePolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteResourcePolicyRequest.php new file mode 100644 index 000000000000..270a46a67665 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteResourcePolicyRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteResourcePolicyRequest + */ +class DeleteResourcePolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the resource policy to delete. + * + * Generated from protobuf field string resource_policy = 159240835 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource_policy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $resourcePolicy Name of the resource policy to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteResourcePolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resourcePolicy): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResourcePolicy($resourcePolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * 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 $resource_policy + * Name of the resource policy to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Name of the resource policy to delete. + * + * Generated from protobuf field string resource_policy = 159240835 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResourcePolicy() + { + return $this->resource_policy; + } + + /** + * Name of the resource policy to delete. + * + * Generated from protobuf field string resource_policy = 159240835 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResourcePolicy($var) + { + GPBUtil::checkString($var, True); + $this->resource_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRouteRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRouteRequest.php new file mode 100644 index 000000000000..cad8da12a967 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRouteRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteRouteRequest + */ +class DeleteRouteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the Route resource to delete. + * + * Generated from protobuf field string route = 108704329 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $route = ''; + + /** + * @param string $project Project ID for this request. + * @param string $route Name of the Route resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteRouteRequest + * + * @experimental + */ + public static function build(string $project, string $route): self + { + return (new self()) + ->setProject($project) + ->setRoute($route); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $route + * Name of the Route resource to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the Route resource to delete. + * + * Generated from protobuf field string route = 108704329 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRoute() + { + return $this->route; + } + + /** + * Name of the Route resource to delete. + * + * Generated from protobuf field string route = 108704329 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRoute($var) + { + GPBUtil::checkString($var, True); + $this->route = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRouterRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRouterRequest.php new file mode 100644 index 000000000000..bcc52268c573 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteRouterRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteRouterRequest + */ +class DeleteRouterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the Router resource to delete. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $router = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $router Name of the Router resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteRouterRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $router): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * 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 $router + * Name of the Router resource to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Name of the Router resource to delete. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRouter() + { + return $this->router; + } + + /** + * Name of the Router resource to delete. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRouter($var) + { + GPBUtil::checkString($var, True); + $this->router = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSecurityPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSecurityPolicyRequest.php new file mode 100644 index 000000000000..a365299ada2e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSecurityPolicyRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteSecurityPolicyRequest + */ +class DeleteSecurityPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the security policy to delete. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $securityPolicy Name of the security policy to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteSecurityPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $securityPolicy): self + { + return (new self()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $security_policy + * Name of the security policy to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the security policy to delete. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSecurityPolicy() + { + return $this->security_policy; + } + + /** + * Name of the security policy to delete. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->security_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteServiceAttachmentRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteServiceAttachmentRequest.php new file mode 100644 index 000000000000..1df40c90e65f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteServiceAttachmentRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteServiceAttachmentRequest + */ +class DeleteServiceAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region of this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the ServiceAttachment resource to delete. + * + * Generated from protobuf field string service_attachment = 338957549 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service_attachment = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region of this request. + * @param string $serviceAttachment Name of the ServiceAttachment resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteServiceAttachmentRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $serviceAttachment): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setServiceAttachment($serviceAttachment); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region of 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 $service_attachment + * Name of the ServiceAttachment resource to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region of 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; + } + + /** + * Name of the region of 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; + } + + /** + * Name of the ServiceAttachment resource to delete. + * + * Generated from protobuf field string service_attachment = 338957549 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getServiceAttachment() + { + return $this->service_attachment; + } + + /** + * Name of the ServiceAttachment resource to delete. + * + * Generated from protobuf field string service_attachment = 338957549 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setServiceAttachment($var) + { + GPBUtil::checkString($var, True); + $this->service_attachment = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSignedUrlKeyBackendBucketRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSignedUrlKeyBackendBucketRequest.php new file mode 100644 index 000000000000..f4933a4b70d6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSignedUrlKeyBackendBucketRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest + */ +class DeleteSignedUrlKeyBackendBucketRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_bucket = 91714037 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_bucket = ''; + /** + * The name of the Signed URL Key to delete. + * + * Generated from protobuf field string key_name = 500938859 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $key_name = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $backendBucket Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @param string $keyName The name of the Signed URL Key to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteSignedUrlKeyBackendBucketRequest + * + * @experimental + */ + public static function build(string $project, string $backendBucket, string $keyName): self + { + return (new self()) + ->setProject($project) + ->setBackendBucket($backendBucket) + ->setKeyName($keyName); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_bucket + * Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @type string $key_name + * The name of the Signed URL Key to delete. + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_bucket = 91714037 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackendBucket() + { + return $this->backend_bucket; + } + + /** + * Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_bucket = 91714037 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackendBucket($var) + { + GPBUtil::checkString($var, True); + $this->backend_bucket = $var; + + return $this; + } + + /** + * The name of the Signed URL Key to delete. + * + * Generated from protobuf field string key_name = 500938859 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getKeyName() + { + return $this->key_name; + } + + /** + * The name of the Signed URL Key to delete. + * + * Generated from protobuf field string key_name = 500938859 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setKeyName($var) + { + GPBUtil::checkString($var, True); + $this->key_name = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSignedUrlKeyBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSignedUrlKeyBackendServiceRequest.php new file mode 100644 index 000000000000..c0178f9f0405 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSignedUrlKeyBackendServiceRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest + */ +class DeleteSignedUrlKeyBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_service = ''; + /** + * The name of the Signed URL Key to delete. + * + * Generated from protobuf field string key_name = 500938859 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $key_name = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $backendService Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @param string $keyName The name of the Signed URL Key to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteSignedUrlKeyBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, string $backendService, string $keyName): self + { + return (new self()) + ->setProject($project) + ->setBackendService($backendService) + ->setKeyName($keyName); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_service + * Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @type string $key_name + * The name of the Signed URL Key to delete. + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackendService() + { + return $this->backend_service; + } + + /** + * Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackendService($var) + { + GPBUtil::checkString($var, True); + $this->backend_service = $var; + + return $this; + } + + /** + * The name of the Signed URL Key to delete. + * + * Generated from protobuf field string key_name = 500938859 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getKeyName() + { + return $this->key_name; + } + + /** + * The name of the Signed URL Key to delete. + * + * Generated from protobuf field string key_name = 500938859 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setKeyName($var) + { + GPBUtil::checkString($var, True); + $this->key_name = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSnapshotRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSnapshotRequest.php new file mode 100644 index 000000000000..f9c364f4bfaf --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSnapshotRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteSnapshotRequest + */ +class DeleteSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the Snapshot resource to delete. + * + * Generated from protobuf field string snapshot = 284874180 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $snapshot = ''; + + /** + * @param string $project Project ID for this request. + * @param string $snapshot Name of the Snapshot resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteSnapshotRequest + * + * @experimental + */ + public static function build(string $project, string $snapshot): self + { + return (new self()) + ->setProject($project) + ->setSnapshot($snapshot); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $snapshot + * Name of the Snapshot resource to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the Snapshot resource to delete. + * + * Generated from protobuf field string snapshot = 284874180 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSnapshot() + { + return $this->snapshot; + } + + /** + * Name of the Snapshot resource to delete. + * + * Generated from protobuf field string snapshot = 284874180 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSnapshot($var) + { + GPBUtil::checkString($var, True); + $this->snapshot = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSslCertificateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSslCertificateRequest.php new file mode 100644 index 000000000000..41860141b225 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSslCertificateRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteSslCertificateRequest + */ +class DeleteSslCertificateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the SslCertificate resource to delete. + * + * Generated from protobuf field string ssl_certificate = 46443492 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ssl_certificate = ''; + + /** + * @param string $project Project ID for this request. + * @param string $sslCertificate Name of the SslCertificate resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteSslCertificateRequest + * + * @experimental + */ + public static function build(string $project, string $sslCertificate): self + { + return (new self()) + ->setProject($project) + ->setSslCertificate($sslCertificate); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $ssl_certificate + * Name of the SslCertificate resource to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the SslCertificate resource to delete. + * + * Generated from protobuf field string ssl_certificate = 46443492 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSslCertificate() + { + return $this->ssl_certificate; + } + + /** + * Name of the SslCertificate resource to delete. + * + * Generated from protobuf field string ssl_certificate = 46443492 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSslCertificate($var) + { + GPBUtil::checkString($var, True); + $this->ssl_certificate = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSslPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSslPolicyRequest.php new file mode 100644 index 000000000000..43358777bbd1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSslPolicyRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteSslPolicyRequest + */ +class DeleteSslPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string ssl_policy = 295190213 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ssl_policy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $sslPolicy Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. + * + * @return \Google\Cloud\Compute\V1\DeleteSslPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $sslPolicy): self + { + return (new self()) + ->setProject($project) + ->setSslPolicy($sslPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $ssl_policy + * Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string ssl_policy = 295190213 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSslPolicy() + { + return $this->ssl_policy; + } + + /** + * Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string ssl_policy = 295190213 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSslPolicy($var) + { + GPBUtil::checkString($var, True); + $this->ssl_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteStoragePoolRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteStoragePoolRequest.php new file mode 100644 index 000000000000..88e6be1f22c4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteStoragePoolRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteStoragePoolRequest + */ +class DeleteStoragePoolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the storage pool to delete. + * + * Generated from protobuf field string storage_pool = 360473440 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $storage_pool = ''; + /** + * 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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $storagePool Name of the storage pool to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteStoragePoolRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $storagePool): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setStoragePool($storagePool); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $storage_pool + * Name of the storage pool to delete. + * @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); + } + + /** + * 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; + } + + /** + * Name of the storage pool to delete. + * + * Generated from protobuf field string storage_pool = 360473440 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getStoragePool() + { + return $this->storage_pool; + } + + /** + * Name of the storage pool to delete. + * + * Generated from protobuf field string storage_pool = 360473440 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setStoragePool($var) + { + GPBUtil::checkString($var, True); + $this->storage_pool = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSubnetworkRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSubnetworkRequest.php new file mode 100644 index 000000000000..d11748215191 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteSubnetworkRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteSubnetworkRequest + */ +class DeleteSubnetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the Subnetwork resource to delete. + * + * Generated from protobuf field string subnetwork = 307827694 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $subnetwork = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $subnetwork Name of the Subnetwork resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteSubnetworkRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $subnetwork): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 $subnetwork + * Name of the Subnetwork resource to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the Subnetwork resource to delete. + * + * Generated from protobuf field string subnetwork = 307827694 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSubnetwork() + { + return $this->subnetwork; + } + + /** + * Name of the Subnetwork resource to delete. + * + * Generated from protobuf field string subnetwork = 307827694 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetGrpcProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetGrpcProxyRequest.php new file mode 100644 index 000000000000..ee031595bb0e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetGrpcProxyRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteTargetGrpcProxyRequest + */ +class DeleteTargetGrpcProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the TargetGrpcProxy resource to delete. + * + * Generated from protobuf field string target_grpc_proxy = 5020283 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_grpc_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $targetGrpcProxy Name of the TargetGrpcProxy resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteTargetGrpcProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetGrpcProxy): self + { + return (new self()) + ->setProject($project) + ->setTargetGrpcProxy($targetGrpcProxy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $target_grpc_proxy + * Name of the TargetGrpcProxy resource to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the TargetGrpcProxy resource to delete. + * + * Generated from protobuf field string target_grpc_proxy = 5020283 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetGrpcProxy() + { + return $this->target_grpc_proxy; + } + + /** + * Name of the TargetGrpcProxy resource to delete. + * + * Generated from protobuf field string target_grpc_proxy = 5020283 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetGrpcProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_grpc_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetHttpProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetHttpProxyRequest.php new file mode 100644 index 000000000000..4c471adbb5be --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetHttpProxyRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteTargetHttpProxyRequest + */ +class DeleteTargetHttpProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the TargetHttpProxy resource to delete. + * + * Generated from protobuf field string target_http_proxy = 206872421 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_http_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $targetHttpProxy Name of the TargetHttpProxy resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteTargetHttpProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetHttpProxy): self + { + return (new self()) + ->setProject($project) + ->setTargetHttpProxy($targetHttpProxy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $target_http_proxy + * Name of the TargetHttpProxy resource to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the TargetHttpProxy resource to delete. + * + * Generated from protobuf field string target_http_proxy = 206872421 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetHttpProxy() + { + return $this->target_http_proxy; + } + + /** + * Name of the TargetHttpProxy resource to delete. + * + * Generated from protobuf field string target_http_proxy = 206872421 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetHttpProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_http_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetHttpsProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetHttpsProxyRequest.php new file mode 100644 index 000000000000..c7bb6d404f32 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetHttpsProxyRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteTargetHttpsProxyRequest + */ +class DeleteTargetHttpsProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the TargetHttpsProxy resource to delete. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_https_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteTargetHttpsProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetHttpsProxy): self + { + return (new self()) + ->setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $target_https_proxy + * Name of the TargetHttpsProxy resource to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the TargetHttpsProxy resource to delete. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetHttpsProxy() + { + return $this->target_https_proxy; + } + + /** + * Name of the TargetHttpsProxy resource to delete. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetHttpsProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_https_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetInstanceRequest.php new file mode 100644 index 000000000000..7f53264b7ca7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetInstanceRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteTargetInstanceRequest + */ +class DeleteTargetInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the TargetInstance resource to delete. + * + * Generated from protobuf field string target_instance = 289769347 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_instance = ''; + /** + * Name of the zone scoping this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone scoping this request. + * @param string $targetInstance Name of the TargetInstance resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteTargetInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $targetInstance): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setTargetInstance($targetInstance); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $target_instance + * Name of the TargetInstance resource to delete. + * @type string $zone + * Name of the zone scoping this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the TargetInstance resource to delete. + * + * Generated from protobuf field string target_instance = 289769347 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetInstance() + { + return $this->target_instance; + } + + /** + * Name of the TargetInstance resource to delete. + * + * Generated from protobuf field string target_instance = 289769347 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetInstance($var) + { + GPBUtil::checkString($var, True); + $this->target_instance = $var; + + return $this; + } + + /** + * Name of the zone scoping 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; + } + + /** + * Name of the zone scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetPoolRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetPoolRequest.php new file mode 100644 index 000000000000..846aa41f799e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetPoolRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteTargetPoolRequest + */ +class DeleteTargetPoolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the TargetPool resource to delete. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_pool = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetPool Name of the TargetPool resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteTargetPoolRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $targetPool): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 $target_pool + * Name of the TargetPool resource to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the TargetPool resource to delete. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetPool() + { + return $this->target_pool; + } + + /** + * Name of the TargetPool resource to delete. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetPool($var) + { + GPBUtil::checkString($var, True); + $this->target_pool = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetSslProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetSslProxyRequest.php new file mode 100644 index 000000000000..c78a98106373 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetSslProxyRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteTargetSslProxyRequest + */ +class DeleteTargetSslProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the TargetSslProxy resource to delete. + * + * Generated from protobuf field string target_ssl_proxy = 338795853 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_ssl_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $targetSslProxy Name of the TargetSslProxy resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteTargetSslProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetSslProxy): self + { + return (new self()) + ->setProject($project) + ->setTargetSslProxy($targetSslProxy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $target_ssl_proxy + * Name of the TargetSslProxy resource to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the TargetSslProxy resource to delete. + * + * Generated from protobuf field string target_ssl_proxy = 338795853 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetSslProxy() + { + return $this->target_ssl_proxy; + } + + /** + * Name of the TargetSslProxy resource to delete. + * + * Generated from protobuf field string target_ssl_proxy = 338795853 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetSslProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_ssl_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetTcpProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetTcpProxyRequest.php new file mode 100644 index 000000000000..5c2e8195c735 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetTcpProxyRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteTargetTcpProxyRequest + */ +class DeleteTargetTcpProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the TargetTcpProxy resource to delete. + * + * Generated from protobuf field string target_tcp_proxy = 503065442 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_tcp_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $targetTcpProxy Name of the TargetTcpProxy resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteTargetTcpProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetTcpProxy): self + { + return (new self()) + ->setProject($project) + ->setTargetTcpProxy($targetTcpProxy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $target_tcp_proxy + * Name of the TargetTcpProxy resource to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the TargetTcpProxy resource to delete. + * + * Generated from protobuf field string target_tcp_proxy = 503065442 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetTcpProxy() + { + return $this->target_tcp_proxy; + } + + /** + * Name of the TargetTcpProxy resource to delete. + * + * Generated from protobuf field string target_tcp_proxy = 503065442 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetTcpProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_tcp_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetVpnGatewayRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetVpnGatewayRequest.php new file mode 100644 index 000000000000..f5364a433bad --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteTargetVpnGatewayRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteTargetVpnGatewayRequest + */ +class DeleteTargetVpnGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the target VPN gateway to delete. + * + * Generated from protobuf field string target_vpn_gateway = 532512843 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_vpn_gateway = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $targetVpnGateway Name of the target VPN gateway to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteTargetVpnGatewayRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $targetVpnGateway): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetVpnGateway($targetVpnGateway); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * 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 $target_vpn_gateway + * Name of the target VPN gateway to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Name of the target VPN gateway to delete. + * + * Generated from protobuf field string target_vpn_gateway = 532512843 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetVpnGateway() + { + return $this->target_vpn_gateway; + } + + /** + * Name of the target VPN gateway to delete. + * + * Generated from protobuf field string target_vpn_gateway = 532512843 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetVpnGateway($var) + { + GPBUtil::checkString($var, True); + $this->target_vpn_gateway = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteUrlMapRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteUrlMapRequest.php new file mode 100644 index 000000000000..7af276966097 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteUrlMapRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.DeleteUrlMapRequest + */ +class DeleteUrlMapRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the UrlMap resource to delete. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url_map = ''; + + /** + * @param string $project Project ID for this request. + * @param string $urlMap Name of the UrlMap resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteUrlMapRequest + * + * @experimental + */ + public static function build(string $project, string $urlMap): self + { + return (new self()) + ->setProject($project) + ->setUrlMap($urlMap); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $url_map + * Name of the UrlMap resource to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the UrlMap resource to delete. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUrlMap() + { + return $this->url_map; + } + + /** + * Name of the UrlMap resource to delete. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUrlMap($var) + { + GPBUtil::checkString($var, True); + $this->url_map = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteVpnGatewayRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteVpnGatewayRequest.php new file mode 100644 index 000000000000..ae66d648f27a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteVpnGatewayRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteVpnGatewayRequest + */ +class DeleteVpnGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the VPN gateway to delete. + * + * Generated from protobuf field string vpn_gateway = 406684153 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $vpn_gateway = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $vpnGateway Name of the VPN gateway to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteVpnGatewayRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $vpnGateway): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setVpnGateway($vpnGateway); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * 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 $vpn_gateway + * Name of the VPN gateway to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Name of the VPN gateway to delete. + * + * Generated from protobuf field string vpn_gateway = 406684153 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getVpnGateway() + { + return $this->vpn_gateway; + } + + /** + * Name of the VPN gateway to delete. + * + * Generated from protobuf field string vpn_gateway = 406684153 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setVpnGateway($var) + { + GPBUtil::checkString($var, True); + $this->vpn_gateway = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteVpnTunnelRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteVpnTunnelRequest.php new file mode 100644 index 000000000000..9912f05ffd4f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteVpnTunnelRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.DeleteVpnTunnelRequest + */ +class DeleteVpnTunnelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the VpnTunnel resource to delete. + * + * Generated from protobuf field string vpn_tunnel = 143821331 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $vpn_tunnel = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $vpnTunnel Name of the VpnTunnel resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteVpnTunnelRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $vpnTunnel): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setVpnTunnel($vpnTunnel); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * 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 $vpn_tunnel + * Name of the VpnTunnel resource to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Name of the VpnTunnel resource to delete. + * + * Generated from protobuf field string vpn_tunnel = 143821331 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getVpnTunnel() + { + return $this->vpn_tunnel; + } + + /** + * Name of the VpnTunnel resource to delete. + * + * Generated from protobuf field string vpn_tunnel = 143821331 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setVpnTunnel($var) + { + GPBUtil::checkString($var, True); + $this->vpn_tunnel = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteZoneOperationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteZoneOperationRequest.php new file mode 100644 index 000000000000..bb2f2588f7f2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteZoneOperationRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.DeleteZoneOperationRequest + */ +class DeleteZoneOperationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the Operations resource to delete. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $operation = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone for this request. + * @param string $operation Name of the Operations resource to delete. + * + * @return \Google\Cloud\Compute\V1\DeleteZoneOperationRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $operation): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setOperation($operation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $operation + * Name of the Operations resource to delete. + * @type string $project + * Project ID for this request. + * @type string $zone + * Name of the zone for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the Operations resource to delete. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getOperation() + { + return $this->operation; + } + + /** + * Name of the Operations resource to delete. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setOperation($var) + { + GPBUtil::checkString($var, True); + $this->operation = $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; + } + + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteZoneOperationResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteZoneOperationResponse.php new file mode 100644 index 000000000000..ec30ce694338 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeleteZoneOperationResponse.php @@ -0,0 +1,33 @@ +google.cloud.compute.v1.DeleteZoneOperationResponse + */ +class DeleteZoneOperationResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Denied.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Denied.php new file mode 100644 index 000000000000..a34c497c0238 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Denied.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.Denied + */ +class Denied extends \Google\Protobuf\Internal\Message +{ + /** + * The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. + * + * Generated from protobuf field optional string I_p_protocol = 488094525; + */ + protected $I_p_protocol = null; + /** + * An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + * + * Generated from protobuf field repeated string ports = 106854418; + */ + private $ports; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $I_p_protocol + * The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. + * @type array|\Google\Protobuf\Internal\RepeatedField $ports + * An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. + * + * Generated from protobuf field optional string I_p_protocol = 488094525; + * @return string + */ + public function getIPProtocol() + { + return isset($this->I_p_protocol) ? $this->I_p_protocol : ''; + } + + public function hasIPProtocol() + { + return isset($this->I_p_protocol); + } + + public function clearIPProtocol() + { + unset($this->I_p_protocol); + } + + /** + * The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. + * + * Generated from protobuf field optional string I_p_protocol = 488094525; + * @param string $var + * @return $this + */ + public function setIPProtocol($var) + { + GPBUtil::checkString($var, True); + $this->I_p_protocol = $var; + + return $this; + } + + /** + * An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + * + * Generated from protobuf field repeated string ports = 106854418; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPorts() + { + return $this->ports; + } + + /** + * An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + * + * Generated from protobuf field repeated string ports = 106854418; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPorts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ports = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeprecateImageRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeprecateImageRequest.php new file mode 100644 index 000000000000..5e1fea3b3ce8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeprecateImageRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.DeprecateImageRequest + */ +class DeprecateImageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.DeprecationStatus deprecation_status_resource = 333006064 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $deprecation_status_resource = null; + /** + * Image name. + * + * Generated from protobuf field string image = 100313435 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $image = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $image Image name. + * @param \Google\Cloud\Compute\V1\DeprecationStatus $deprecationStatusResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\DeprecateImageRequest + * + * @experimental + */ + public static function build(string $project, string $image, \Google\Cloud\Compute\V1\DeprecationStatus $deprecationStatusResource): self + { + return (new self()) + ->setProject($project) + ->setImage($image) + ->setDeprecationStatusResource($deprecationStatusResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\DeprecationStatus $deprecation_status_resource + * The body resource for this request + * @type string $image + * Image name. + * @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). + * } + */ + 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.DeprecationStatus deprecation_status_resource = 333006064 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\DeprecationStatus|null + */ + public function getDeprecationStatusResource() + { + return $this->deprecation_status_resource; + } + + public function hasDeprecationStatusResource() + { + return isset($this->deprecation_status_resource); + } + + public function clearDeprecationStatusResource() + { + unset($this->deprecation_status_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.DeprecationStatus deprecation_status_resource = 333006064 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\DeprecationStatus $var + * @return $this + */ + public function setDeprecationStatusResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DeprecationStatus::class); + $this->deprecation_status_resource = $var; + + return $this; + } + + /** + * Image name. + * + * Generated from protobuf field string image = 100313435 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getImage() + { + return $this->image; + } + + /** + * Image name. + * + * Generated from protobuf field string image = 100313435 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkString($var, True); + $this->image = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeprecationStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeprecationStatus.php new file mode 100644 index 000000000000..72a0b9bc2324 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeprecationStatus.php @@ -0,0 +1,257 @@ +google.cloud.compute.v1.DeprecationStatus + */ +class DeprecationStatus extends \Google\Protobuf\Internal\Message +{ + /** + * An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DELETED. This is only informational and the status will not change unless the client explicitly changes it. + * + * Generated from protobuf field optional string deleted = 476721177; + */ + protected $deleted = null; + /** + * An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DEPRECATED. This is only informational and the status will not change unless the client explicitly changes it. + * + * Generated from protobuf field optional string deprecated = 515138995; + */ + protected $deprecated = null; + /** + * An optional RFC3339 timestamp on or after which the state of this resource is intended to change to OBSOLETE. This is only informational and the status will not change unless the client explicitly changes it. + * + * Generated from protobuf field optional string obsolete = 357647769; + */ + protected $obsolete = null; + /** + * The URL of the suggested replacement for a deprecated resource. The suggested replacement resource must be the same kind of resource as the deprecated resource. + * + * Generated from protobuf field optional string replacement = 430919186; + */ + protected $replacement = null; + /** + * The deprecation state of this resource. This can be ACTIVE, DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the end of life date for an image, can use ACTIVE. Operations which create a new resource using a DEPRECATED resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. Operations which use OBSOLETE or DELETED resources will be rejected and result in an error. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + */ + protected $state = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $deleted + * An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DELETED. This is only informational and the status will not change unless the client explicitly changes it. + * @type string $deprecated + * An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DEPRECATED. This is only informational and the status will not change unless the client explicitly changes it. + * @type string $obsolete + * An optional RFC3339 timestamp on or after which the state of this resource is intended to change to OBSOLETE. This is only informational and the status will not change unless the client explicitly changes it. + * @type string $replacement + * The URL of the suggested replacement for a deprecated resource. The suggested replacement resource must be the same kind of resource as the deprecated resource. + * @type string $state + * The deprecation state of this resource. This can be ACTIVE, DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the end of life date for an image, can use ACTIVE. Operations which create a new resource using a DEPRECATED resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. Operations which use OBSOLETE or DELETED resources will be rejected and result in an error. + * Check the State enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DELETED. This is only informational and the status will not change unless the client explicitly changes it. + * + * Generated from protobuf field optional string deleted = 476721177; + * @return string + */ + public function getDeleted() + { + return isset($this->deleted) ? $this->deleted : ''; + } + + public function hasDeleted() + { + return isset($this->deleted); + } + + public function clearDeleted() + { + unset($this->deleted); + } + + /** + * An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DELETED. This is only informational and the status will not change unless the client explicitly changes it. + * + * Generated from protobuf field optional string deleted = 476721177; + * @param string $var + * @return $this + */ + public function setDeleted($var) + { + GPBUtil::checkString($var, True); + $this->deleted = $var; + + return $this; + } + + /** + * An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DEPRECATED. This is only informational and the status will not change unless the client explicitly changes it. + * + * Generated from protobuf field optional string deprecated = 515138995; + * @return string + */ + public function getDeprecated() + { + return isset($this->deprecated) ? $this->deprecated : ''; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DEPRECATED. This is only informational and the status will not change unless the client explicitly changes it. + * + * Generated from protobuf field optional string deprecated = 515138995; + * @param string $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkString($var, True); + $this->deprecated = $var; + + return $this; + } + + /** + * An optional RFC3339 timestamp on or after which the state of this resource is intended to change to OBSOLETE. This is only informational and the status will not change unless the client explicitly changes it. + * + * Generated from protobuf field optional string obsolete = 357647769; + * @return string + */ + public function getObsolete() + { + return isset($this->obsolete) ? $this->obsolete : ''; + } + + public function hasObsolete() + { + return isset($this->obsolete); + } + + public function clearObsolete() + { + unset($this->obsolete); + } + + /** + * An optional RFC3339 timestamp on or after which the state of this resource is intended to change to OBSOLETE. This is only informational and the status will not change unless the client explicitly changes it. + * + * Generated from protobuf field optional string obsolete = 357647769; + * @param string $var + * @return $this + */ + public function setObsolete($var) + { + GPBUtil::checkString($var, True); + $this->obsolete = $var; + + return $this; + } + + /** + * The URL of the suggested replacement for a deprecated resource. The suggested replacement resource must be the same kind of resource as the deprecated resource. + * + * Generated from protobuf field optional string replacement = 430919186; + * @return string + */ + public function getReplacement() + { + return isset($this->replacement) ? $this->replacement : ''; + } + + public function hasReplacement() + { + return isset($this->replacement); + } + + public function clearReplacement() + { + unset($this->replacement); + } + + /** + * The URL of the suggested replacement for a deprecated resource. The suggested replacement resource must be the same kind of resource as the deprecated resource. + * + * Generated from protobuf field optional string replacement = 430919186; + * @param string $var + * @return $this + */ + public function setReplacement($var) + { + GPBUtil::checkString($var, True); + $this->replacement = $var; + + return $this; + } + + /** + * The deprecation state of this resource. This can be ACTIVE, DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the end of life date for an image, can use ACTIVE. Operations which create a new resource using a DEPRECATED resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. Operations which use OBSOLETE or DELETED resources will be rejected and result in an error. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @return string + */ + public function getState() + { + return isset($this->state) ? $this->state : ''; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * The deprecation state of this resource. This can be ACTIVE, DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the end of life date for an image, can use ACTIVE. Operations which create a new resource using a DEPRECATED resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. Operations which use OBSOLETE or DELETED resources will be rejected and result in an error. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeprecationStatus/State.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeprecationStatus/State.php new file mode 100644 index 000000000000..d13947fc4e2b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DeprecationStatus/State.php @@ -0,0 +1,70 @@ +google.cloud.compute.v1.DeprecationStatus.State + */ +class State +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATE = 0; + */ + const UNDEFINED_STATE = 0; + /** + * Generated from protobuf enum ACTIVE = 314733318; + */ + const ACTIVE = 314733318; + /** + * Generated from protobuf enum DELETED = 120962041; + */ + const DELETED = 120962041; + /** + * Generated from protobuf enum DEPRECATED = 463360435; + */ + const DEPRECATED = 463360435; + /** + * Generated from protobuf enum OBSOLETE = 66532761; + */ + const OBSOLETE = 66532761; + + private static $valueToName = [ + self::UNDEFINED_STATE => 'UNDEFINED_STATE', + self::ACTIVE => 'ACTIVE', + self::DELETED => 'DELETED', + self::DEPRECATED => 'DEPRECATED', + self::OBSOLETE => 'OBSOLETE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Compute\V1\DeprecationStatus_State::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DetachDiskInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DetachDiskInstanceRequest.php new file mode 100644 index 000000000000..cdaeaf8cf24b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DetachDiskInstanceRequest.php @@ -0,0 +1,232 @@ +google.cloud.compute.v1.DetachDiskInstanceRequest + */ +class DetachDiskInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names. + * + * Generated from protobuf field string device_name = 67541716 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $device_name = ''; + /** + * Instance name for this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Instance name for this request. + * @param string $deviceName The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names. + * + * @return \Google\Cloud\Compute\V1\DetachDiskInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, string $deviceName): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setDeviceName($deviceName); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $device_name + * The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names. + * @type string $instance + * Instance name 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 device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names. + * + * Generated from protobuf field string device_name = 67541716 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDeviceName() + { + return $this->device_name; + } + + /** + * The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names. + * + * Generated from protobuf field string device_name = 67541716 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDeviceName($var) + { + GPBUtil::checkString($var, True); + $this->device_name = $var; + + return $this; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.php new file mode 100644 index 000000000000..9a7434a18c47 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + */ +class DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest global_network_endpoint_groups_detach_endpoints_request_resource = 8898269 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $global_network_endpoint_groups_detach_endpoints_request_resource = null; + /** + * The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_endpoint_group = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $networkEndpointGroup The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + * @param \Google\Cloud\Compute\V1\GlobalNetworkEndpointGroupsDetachEndpointsRequest $globalNetworkEndpointGroupsDetachEndpointsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * + * @experimental + */ + public static function build(string $project, string $networkEndpointGroup, \Google\Cloud\Compute\V1\GlobalNetworkEndpointGroupsDetachEndpointsRequest $globalNetworkEndpointGroupsDetachEndpointsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setGlobalNetworkEndpointGroupsDetachEndpointsRequestResource($globalNetworkEndpointGroupsDetachEndpointsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\GlobalNetworkEndpointGroupsDetachEndpointsRequest $global_network_endpoint_groups_detach_endpoints_request_resource + * The body resource for this request + * @type string $network_endpoint_group + * The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + * @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). + * } + */ + 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.GlobalNetworkEndpointGroupsDetachEndpointsRequest global_network_endpoint_groups_detach_endpoints_request_resource = 8898269 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\GlobalNetworkEndpointGroupsDetachEndpointsRequest|null + */ + public function getGlobalNetworkEndpointGroupsDetachEndpointsRequestResource() + { + return $this->global_network_endpoint_groups_detach_endpoints_request_resource; + } + + public function hasGlobalNetworkEndpointGroupsDetachEndpointsRequestResource() + { + return isset($this->global_network_endpoint_groups_detach_endpoints_request_resource); + } + + public function clearGlobalNetworkEndpointGroupsDetachEndpointsRequestResource() + { + unset($this->global_network_endpoint_groups_detach_endpoints_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest global_network_endpoint_groups_detach_endpoints_request_resource = 8898269 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\GlobalNetworkEndpointGroupsDetachEndpointsRequest $var + * @return $this + */ + public function setGlobalNetworkEndpointGroupsDetachEndpointsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\GlobalNetworkEndpointGroupsDetachEndpointsRequest::class); + $this->global_network_endpoint_groups_detach_endpoints_request_resource = $var; + + return $this; + } + + /** + * The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkEndpointGroup() + { + return $this->network_endpoint_group; + } + + /** + * The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkEndpointGroup($var) + { + GPBUtil::checkString($var, True); + $this->network_endpoint_group = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DetachNetworkEndpointsNetworkEndpointGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DetachNetworkEndpointsNetworkEndpointGroupRequest.php new file mode 100644 index 000000000000..f0575729ea85 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DetachNetworkEndpointsNetworkEndpointGroupRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest + */ +class DetachNetworkEndpointsNetworkEndpointGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_endpoint_group = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest network_endpoint_groups_detach_endpoints_request_resource = 515608697 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_endpoint_groups_detach_endpoints_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @param string $networkEndpointGroup The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + * @param \Google\Cloud\Compute\V1\NetworkEndpointGroupsDetachEndpointsRequest $networkEndpointGroupsDetachEndpointsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\DetachNetworkEndpointsNetworkEndpointGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $networkEndpointGroup, \Google\Cloud\Compute\V1\NetworkEndpointGroupsDetachEndpointsRequest $networkEndpointGroupsDetachEndpointsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setNetworkEndpointGroupsDetachEndpointsRequestResource($networkEndpointGroupsDetachEndpointsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network_endpoint_group + * The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + * @type \Google\Cloud\Compute\V1\NetworkEndpointGroupsDetachEndpointsRequest $network_endpoint_groups_detach_endpoints_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 where the network endpoint group is located. It should comply with RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkEndpointGroup() + { + return $this->network_endpoint_group; + } + + /** + * The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkEndpointGroup($var) + { + GPBUtil::checkString($var, True); + $this->network_endpoint_group = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest network_endpoint_groups_detach_endpoints_request_resource = 515608697 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NetworkEndpointGroupsDetachEndpointsRequest|null + */ + public function getNetworkEndpointGroupsDetachEndpointsRequestResource() + { + return $this->network_endpoint_groups_detach_endpoints_request_resource; + } + + public function hasNetworkEndpointGroupsDetachEndpointsRequestResource() + { + return isset($this->network_endpoint_groups_detach_endpoints_request_resource); + } + + public function clearNetworkEndpointGroupsDetachEndpointsRequestResource() + { + unset($this->network_endpoint_groups_detach_endpoints_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest network_endpoint_groups_detach_endpoints_request_resource = 515608697 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NetworkEndpointGroupsDetachEndpointsRequest $var + * @return $this + */ + public function setNetworkEndpointGroupsDetachEndpointsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkEndpointGroupsDetachEndpointsRequest::class); + $this->network_endpoint_groups_detach_endpoints_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 where the network endpoint group is located. It should comply with RFC1035. + * + * 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 where the network endpoint group is located. It should comply with RFC1035. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DetachNetworkEndpointsRegionNetworkEndpointGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DetachNetworkEndpointsRegionNetworkEndpointGroupRequest.php new file mode 100644 index 000000000000..ac33a492c615 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DetachNetworkEndpointsRegionNetworkEndpointGroupRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.DetachNetworkEndpointsRegionNetworkEndpointGroupRequest + */ +class DetachNetworkEndpointsRegionNetworkEndpointGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the network endpoint group you are detaching network endpoints from. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_endpoint_group = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The name of the region where the network endpoint group is located. It should comply with RFC1035. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionNetworkEndpointGroupsDetachEndpointsRequest region_network_endpoint_groups_detach_endpoints_request_resource = 313193198 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_network_endpoint_groups_detach_endpoints_request_resource = null; + /** + * 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). end_interface: MixerMutationRequestBuilder + * + * Generated from protobuf field optional string request_id = 37109963; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region where the network endpoint group is located. It should comply with RFC1035. + * @param string $networkEndpointGroup The name of the network endpoint group you are detaching network endpoints from. It should comply with RFC1035. + * @param \Google\Cloud\Compute\V1\RegionNetworkEndpointGroupsDetachEndpointsRequest $regionNetworkEndpointGroupsDetachEndpointsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\DetachNetworkEndpointsRegionNetworkEndpointGroupRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $networkEndpointGroup, \Google\Cloud\Compute\V1\RegionNetworkEndpointGroupsDetachEndpointsRequest $regionNetworkEndpointGroupsDetachEndpointsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setRegionNetworkEndpointGroupsDetachEndpointsRequestResource($regionNetworkEndpointGroupsDetachEndpointsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network_endpoint_group + * The name of the network endpoint group you are detaching network endpoints from. It should comply with RFC1035. + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region where the network endpoint group is located. It should comply with RFC1035. + * @type \Google\Cloud\Compute\V1\RegionNetworkEndpointGroupsDetachEndpointsRequest $region_network_endpoint_groups_detach_endpoints_request_resource + * The body resource 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). end_interface: MixerMutationRequestBuilder + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the network endpoint group you are detaching network endpoints from. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkEndpointGroup() + { + return $this->network_endpoint_group; + } + + /** + * The name of the network endpoint group you are detaching network endpoints from. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkEndpointGroup($var) + { + GPBUtil::checkString($var, True); + $this->network_endpoint_group = $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 where the network endpoint group is located. It should comply with RFC1035. + * + * 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 where the network endpoint group is located. It should comply with RFC1035. + * + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionNetworkEndpointGroupsDetachEndpointsRequest region_network_endpoint_groups_detach_endpoints_request_resource = 313193198 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionNetworkEndpointGroupsDetachEndpointsRequest|null + */ + public function getRegionNetworkEndpointGroupsDetachEndpointsRequestResource() + { + return $this->region_network_endpoint_groups_detach_endpoints_request_resource; + } + + public function hasRegionNetworkEndpointGroupsDetachEndpointsRequestResource() + { + return isset($this->region_network_endpoint_groups_detach_endpoints_request_resource); + } + + public function clearRegionNetworkEndpointGroupsDetachEndpointsRequestResource() + { + unset($this->region_network_endpoint_groups_detach_endpoints_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionNetworkEndpointGroupsDetachEndpointsRequest region_network_endpoint_groups_detach_endpoints_request_resource = 313193198 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionNetworkEndpointGroupsDetachEndpointsRequest $var + * @return $this + */ + public function setRegionNetworkEndpointGroupsDetachEndpointsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionNetworkEndpointGroupsDetachEndpointsRequest::class); + $this->region_network_endpoint_groups_detach_endpoints_request_resource = $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). end_interface: MixerMutationRequestBuilder + * + * 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). end_interface: MixerMutationRequestBuilder + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisableXpnHostProjectRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisableXpnHostProjectRequest.php new file mode 100644 index 000000000000..a1b79ab98e4e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisableXpnHostProjectRequest.php @@ -0,0 +1,124 @@ +google.cloud.compute.v1.DisableXpnHostProjectRequest + */ +class DisableXpnHostProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\DisableXpnHostProjectRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisableXpnResourceProjectRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisableXpnResourceProjectRequest.php new file mode 100644 index 000000000000..63675243e7ad --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisableXpnResourceProjectRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.DisableXpnResourceProjectRequest + */ +class DisableXpnResourceProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ProjectsDisableXpnResourceRequest projects_disable_xpn_resource_request_resource = 209136170 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $projects_disable_xpn_resource_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\ProjectsDisableXpnResourceRequest $projectsDisableXpnResourceRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\DisableXpnResourceProjectRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\ProjectsDisableXpnResourceRequest $projectsDisableXpnResourceRequestResource): self + { + return (new self()) + ->setProject($project) + ->setProjectsDisableXpnResourceRequestResource($projectsDisableXpnResourceRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type \Google\Cloud\Compute\V1\ProjectsDisableXpnResourceRequest $projects_disable_xpn_resource_request_resource + * The body resource 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); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ProjectsDisableXpnResourceRequest projects_disable_xpn_resource_request_resource = 209136170 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ProjectsDisableXpnResourceRequest|null + */ + public function getProjectsDisableXpnResourceRequestResource() + { + return $this->projects_disable_xpn_resource_request_resource; + } + + public function hasProjectsDisableXpnResourceRequestResource() + { + return isset($this->projects_disable_xpn_resource_request_resource); + } + + public function clearProjectsDisableXpnResourceRequestResource() + { + unset($this->projects_disable_xpn_resource_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ProjectsDisableXpnResourceRequest projects_disable_xpn_resource_request_resource = 209136170 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ProjectsDisableXpnResourceRequest $var + * @return $this + */ + public function setProjectsDisableXpnResourceRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ProjectsDisableXpnResourceRequest::class); + $this->projects_disable_xpn_resource_request_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Disk.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Disk.php new file mode 100644 index 000000000000..dbe9f5b1984b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Disk.php @@ -0,0 +1,2117 @@ +google.cloud.compute.v1.Disk + */ +class Disk extends \Google\Protobuf\Internal\Message +{ + /** + * The architecture of the disk. Valid values are ARM64 or X86_64. + * Check the Architecture enum for the list of possible values. + * + * Generated from protobuf field optional string architecture = 302803283; + */ + protected $architecture = null; + /** + * Disk asynchronously replicated into this disk. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DiskAsyncReplication async_primary_disk = 180517533; + */ + protected $async_primary_disk = null; + /** + * [Output Only] A list of disks this disk is asynchronously replicated to. + * + * Generated from protobuf field map async_secondary_disks = 322925608; + */ + private $async_secondary_disks; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Encrypts the disk using a customer-supplied encryption key or a customer-managed encryption key. Encryption keys do not protect access to metadata of the disk. After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later. For example, to create a disk snapshot, to create a disk image, to create a machine image, or to attach the disk to a virtual machine. After you encrypt a disk with a customer-managed key, the diskEncryptionKey.kmsKeyName is set to a key *version* name once the disk is created. The disk is encrypted with this version of the key. In the response, diskEncryptionKey.kmsKeyName appears in the following format: "diskEncryptionKey.kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key /cryptoKeysVersions/version If you do not provide an encryption key when creating the disk, then the disk is encrypted using an automatically generated key and you don't need to provide a key to use the disk later. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677; + */ + protected $disk_encryption_key = null; + /** + * Whether this disk is using confidential compute mode. + * + * Generated from protobuf field optional bool enable_confidential_compute = 102135228; + */ + protected $enable_confidential_compute = null; + /** + * A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545; + */ + private $guest_os_features; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#disk for disks. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * A fingerprint for the labels being applied to this disk, 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 disk. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + */ + protected $label_fingerprint = null; + /** + * Labels to apply to this disk. These can be later modified by the setLabels method. + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + /** + * [Output Only] Last attach timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string last_attach_timestamp = 42159653; + */ + protected $last_attach_timestamp = null; + /** + * [Output Only] Last detach timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string last_detach_timestamp = 56471027; + */ + protected $last_detach_timestamp = null; + /** + * Integer license codes indicating which licenses are attached to this disk. + * + * Generated from protobuf field repeated int64 license_codes = 45482664; + */ + private $license_codes; + /** + * A list of publicly visible licenses. Reserved for Google's use. + * + * Generated from protobuf field repeated string licenses = 337642578; + */ + private $licenses; + /** + * An opaque location hint used to place the disk close to other resources. This field is for use by internal tools that use the public API. + * + * Generated from protobuf field optional string location_hint = 350519505; + */ + protected $location_hint = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Internal use only. + * + * Generated from protobuf field optional string options = 361137822; + */ + protected $options = null; + /** + * Input only. [Input Only] Additional params passed with the request, but not persisted as part of resource payload. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DiskParams params = 78313862; + */ + protected $params = null; + /** + * Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. The currently supported size is 4096, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project. + * + * Generated from protobuf field optional int64 physical_block_size_bytes = 420007943; + */ + protected $physical_block_size_bytes = null; + /** + * Indicates how many IOPS to provision for the disk. This sets the number of I/O operations per second that the disk can handle. Values must be between 10,000 and 120,000. For more details, see the Extreme persistent disk documentation. + * + * Generated from protobuf field optional int64 provisioned_iops = 186769108; + */ + protected $provisioned_iops = null; + /** + * Indicates how much throughput to provision for the disk. This sets the number of throughput mb per second that the disk can handle. Values must be greater than or equal to 1. + * + * Generated from protobuf field optional int64 provisioned_throughput = 526524181; + */ + protected $provisioned_throughput = null; + /** + * [Output Only] URL of the region where the disk resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * URLs of the zones where the disk should be replicated to. Only applicable for regional resources. + * + * Generated from protobuf field repeated string replica_zones = 48438272; + */ + private $replica_zones; + /** + * Resource policies applied to this disk for automatic snapshot creations. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + */ + private $resource_policies; + /** + * [Output Only] Status information for the disk resource. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DiskResourceStatus resource_status = 249429315; + */ + protected $resource_status = null; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzi = 480964257; + */ + protected $satisfies_pzi = null; + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + */ + protected $satisfies_pzs = null; + /** + * [Output Only] Server-defined fully-qualified URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * Size, in GB, of the persistent disk. You can specify this field when creating a persistent disk using the sourceImage, sourceSnapshot, or sourceDisk parameter, or specify it alone to create an empty persistent disk. If you specify this field along with a source, the value of sizeGb must not be less than the size of the source. Acceptable values are greater than 0. + * + * Generated from protobuf field optional int64 size_gb = 494929369; + */ + protected $size_gb = null; + /** + * [Output Only] URL of the DiskConsistencyGroupPolicy for a secondary disk that was created using a consistency group. + * + * Generated from protobuf field optional string source_consistency_group_policy = 19616093; + */ + protected $source_consistency_group_policy = null; + /** + * [Output Only] ID of the DiskConsistencyGroupPolicy for a secondary disk that was created using a consistency group. + * + * Generated from protobuf field optional string source_consistency_group_policy_id = 267568957; + */ + protected $source_consistency_group_policy_id = null; + /** + * The source disk used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - https://www.googleapis.com/compute/v1/projects/project/regions/region /disks/disk - projects/project/zones/zone/disks/disk - projects/project/regions/region/disks/disk - zones/zone/disks/disk - regions/region/disks/disk + * + * Generated from protobuf field optional string source_disk = 451753793; + */ + protected $source_disk = null; + /** + * [Output Only] The unique ID of the disk used to create this disk. This value identifies the exact disk that was used to create this persistent disk. For example, if you created the persistent disk from a disk that was later deleted and recreated under the same name, the source disk ID would identify the exact version of the disk that was used. + * + * Generated from protobuf field optional string source_disk_id = 454190809; + */ + protected $source_disk_id = null; + /** + * The source image used to create this disk. If the source image is deleted, this field will not be set. To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-9 to use the latest Debian 9 image: projects/debian-cloud/global/images/family/debian-9 Alternatively, use a specific version of a public operating system image: projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD To create a disk with a custom image that you created, specify the image name in the following format: global/images/my-custom-image You can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name: global/images/family/my-image-family + * + * Generated from protobuf field optional string source_image = 50443319; + */ + protected $source_image = null; + /** + * The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_image_encryption_key = 381503659; + */ + protected $source_image_encryption_key = null; + /** + * [Output Only] The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used. + * + * Generated from protobuf field optional string source_image_id = 55328291; + */ + protected $source_image_id = null; + /** + * The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instantSnapshots/instantSnapshot - projects/project/zones/zone/instantSnapshots/instantSnapshot - zones/zone/instantSnapshots/instantSnapshot + * + * Generated from protobuf field optional string source_instant_snapshot = 219202054; + */ + protected $source_instant_snapshot = null; + /** + * [Output Only] The unique ID of the instant snapshot used to create this disk. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact version of the instant snapshot that was used. + * + * Generated from protobuf field optional string source_instant_snapshot_id = 287582708; + */ + protected $source_instant_snapshot_id = null; + /** + * The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project /global/snapshots/snapshot - projects/project/global/snapshots/snapshot - global/snapshots/snapshot + * + * Generated from protobuf field optional string source_snapshot = 126061928; + */ + protected $source_snapshot = null; + /** + * The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_snapshot_encryption_key = 303679322; + */ + protected $source_snapshot_encryption_key = null; + /** + * [Output Only] The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used. + * + * Generated from protobuf field optional string source_snapshot_id = 98962258; + */ + protected $source_snapshot_id = null; + /** + * The full Google Cloud Storage URI where the disk image is stored. This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. Valid URIs may start with gs:// or https://storage.googleapis.com/. This flag is not optimized for creating multiple disks from a source storage object. To create many disks from a source storage object, use gcloud compute images import instead. + * + * Generated from protobuf field optional string source_storage_object = 233052711; + */ + protected $source_storage_object = null; + /** + * [Output Only] The status of disk creation. - CREATING: Disk is provisioning. - RESTORING: Source data is being copied into the disk. - FAILED: Disk creation failed. - READY: Disk is ready for use. - DELETING: Disk is deleting. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + /** + * The storage pool in which the new disk is created. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /storagePools/storagePool - projects/project/zones/zone/storagePools/storagePool - zones/zone/storagePools/storagePool + * + * Generated from protobuf field optional string storage_pool = 360473440; + */ + protected $storage_pool = null; + /** + * URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk. For example: projects/project /zones/zone/diskTypes/pd-ssd . See Persistent disk types. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + /** + * [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance + * + * Generated from protobuf field repeated string users = 111578632; + */ + private $users; + /** + * [Output Only] URL of the zone where the disk resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + */ + protected $zone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $architecture + * The architecture of the disk. Valid values are ARM64 or X86_64. + * Check the Architecture enum for the list of possible values. + * @type \Google\Cloud\Compute\V1\DiskAsyncReplication $async_primary_disk + * Disk asynchronously replicated into this disk. + * @type array|\Google\Protobuf\Internal\MapField $async_secondary_disks + * [Output Only] A list of disks this disk is asynchronously replicated to. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type \Google\Cloud\Compute\V1\CustomerEncryptionKey $disk_encryption_key + * Encrypts the disk using a customer-supplied encryption key or a customer-managed encryption key. Encryption keys do not protect access to metadata of the disk. After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later. For example, to create a disk snapshot, to create a disk image, to create a machine image, or to attach the disk to a virtual machine. After you encrypt a disk with a customer-managed key, the diskEncryptionKey.kmsKeyName is set to a key *version* name once the disk is created. The disk is encrypted with this version of the key. In the response, diskEncryptionKey.kmsKeyName appears in the following format: "diskEncryptionKey.kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key /cryptoKeysVersions/version If you do not provide an encryption key when creating the disk, then the disk is encrypted using an automatically generated key and you don't need to provide a key to use the disk later. + * @type bool $enable_confidential_compute + * Whether this disk is using confidential compute mode. + * @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. Read Enabling guest operating system features to see a list of available options. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of the resource. Always compute#disk for disks. + * @type string $label_fingerprint + * A fingerprint for the labels being applied to this disk, 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 disk. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels to apply to this disk. These can be later modified by the setLabels method. + * @type string $last_attach_timestamp + * [Output Only] Last attach timestamp in RFC3339 text format. + * @type string $last_detach_timestamp + * [Output Only] Last detach timestamp in RFC3339 text format. + * @type array|array|\Google\Protobuf\Internal\RepeatedField $license_codes + * Integer license codes indicating which licenses are attached to this disk. + * @type array|\Google\Protobuf\Internal\RepeatedField $licenses + * A list of publicly visible licenses. Reserved for Google's use. + * @type string $location_hint + * An opaque location hint used to place the disk close to other resources. This field is for use by internal tools that use the public API. + * @type string $name + * 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 string $options + * Internal use only. + * @type \Google\Cloud\Compute\V1\DiskParams $params + * Input only. [Input Only] Additional params passed with the request, but not persisted as part of resource payload. + * @type int|string $physical_block_size_bytes + * Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. The currently supported size is 4096, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project. + * @type int|string $provisioned_iops + * Indicates how many IOPS to provision for the disk. This sets the number of I/O operations per second that the disk can handle. Values must be between 10,000 and 120,000. For more details, see the Extreme persistent disk documentation. + * @type int|string $provisioned_throughput + * Indicates how much throughput to provision for the disk. This sets the number of throughput mb per second that the disk can handle. Values must be greater than or equal to 1. + * @type string $region + * [Output Only] URL of the region where the disk resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * @type array|\Google\Protobuf\Internal\RepeatedField $replica_zones + * URLs of the zones where the disk should be replicated to. Only applicable for regional resources. + * @type array|\Google\Protobuf\Internal\RepeatedField $resource_policies + * Resource policies applied to this disk for automatic snapshot creations. + * @type \Google\Cloud\Compute\V1\DiskResourceStatus $resource_status + * [Output Only] Status information for the disk resource. + * @type bool $satisfies_pzi + * Output only. Reserved for future use. + * @type bool $satisfies_pzs + * [Output Only] Reserved for future use. + * @type string $self_link + * [Output Only] Server-defined fully-qualified URL for this resource. + * @type int|string $size_gb + * Size, in GB, of the persistent disk. You can specify this field when creating a persistent disk using the sourceImage, sourceSnapshot, or sourceDisk parameter, or specify it alone to create an empty persistent disk. If you specify this field along with a source, the value of sizeGb must not be less than the size of the source. Acceptable values are greater than 0. + * @type string $source_consistency_group_policy + * [Output Only] URL of the DiskConsistencyGroupPolicy for a secondary disk that was created using a consistency group. + * @type string $source_consistency_group_policy_id + * [Output Only] ID of the DiskConsistencyGroupPolicy for a secondary disk that was created using a consistency group. + * @type string $source_disk + * The source disk used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - https://www.googleapis.com/compute/v1/projects/project/regions/region /disks/disk - projects/project/zones/zone/disks/disk - projects/project/regions/region/disks/disk - zones/zone/disks/disk - regions/region/disks/disk + * @type string $source_disk_id + * [Output Only] The unique ID of the disk used to create this disk. This value identifies the exact disk that was used to create this persistent disk. For example, if you created the persistent disk from a disk that was later deleted and recreated under the same name, the source disk ID would identify the exact version of the disk that was used. + * @type string $source_image + * The source image used to create this disk. If the source image is deleted, this field will not be set. To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-9 to use the latest Debian 9 image: projects/debian-cloud/global/images/family/debian-9 Alternatively, use a specific version of a public operating system image: projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD To create a disk with a custom image that you created, specify the image name in the following format: global/images/my-custom-image You can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name: global/images/family/my-image-family + * @type \Google\Cloud\Compute\V1\CustomerEncryptionKey $source_image_encryption_key + * The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. + * @type string $source_image_id + * [Output Only] The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used. + * @type string $source_instant_snapshot + * The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instantSnapshots/instantSnapshot - projects/project/zones/zone/instantSnapshots/instantSnapshot - zones/zone/instantSnapshots/instantSnapshot + * @type string $source_instant_snapshot_id + * [Output Only] The unique ID of the instant snapshot used to create this disk. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact version of the instant snapshot that was used. + * @type string $source_snapshot + * The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project /global/snapshots/snapshot - projects/project/global/snapshots/snapshot - global/snapshots/snapshot + * @type \Google\Cloud\Compute\V1\CustomerEncryptionKey $source_snapshot_encryption_key + * The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. + * @type string $source_snapshot_id + * [Output Only] The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used. + * @type string $source_storage_object + * The full Google Cloud Storage URI where the disk image is stored. This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. Valid URIs may start with gs:// or https://storage.googleapis.com/. This flag is not optimized for creating multiple disks from a source storage object. To create many disks from a source storage object, use gcloud compute images import instead. + * @type string $status + * [Output Only] The status of disk creation. - CREATING: Disk is provisioning. - RESTORING: Source data is being copied into the disk. - FAILED: Disk creation failed. - READY: Disk is ready for use. - DELETING: Disk is deleting. + * Check the Status enum for the list of possible values. + * @type string $storage_pool + * The storage pool in which the new disk is created. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /storagePools/storagePool - projects/project/zones/zone/storagePools/storagePool - zones/zone/storagePools/storagePool + * @type string $type + * URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk. For example: projects/project /zones/zone/diskTypes/pd-ssd . See Persistent disk types. + * @type array|\Google\Protobuf\Internal\RepeatedField $users + * [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance + * @type string $zone + * [Output Only] URL of the zone where the disk resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The architecture of the disk. Valid values are ARM64 or X86_64. + * Check the Architecture enum for the list of possible values. + * + * Generated from protobuf field optional string architecture = 302803283; + * @return string + */ + public function getArchitecture() + { + return isset($this->architecture) ? $this->architecture : ''; + } + + public function hasArchitecture() + { + return isset($this->architecture); + } + + public function clearArchitecture() + { + unset($this->architecture); + } + + /** + * The architecture of the disk. Valid values are ARM64 or X86_64. + * Check the Architecture enum for the list of possible values. + * + * Generated from protobuf field optional string architecture = 302803283; + * @param string $var + * @return $this + */ + public function setArchitecture($var) + { + GPBUtil::checkString($var, True); + $this->architecture = $var; + + return $this; + } + + /** + * Disk asynchronously replicated into this disk. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DiskAsyncReplication async_primary_disk = 180517533; + * @return \Google\Cloud\Compute\V1\DiskAsyncReplication|null + */ + public function getAsyncPrimaryDisk() + { + return $this->async_primary_disk; + } + + public function hasAsyncPrimaryDisk() + { + return isset($this->async_primary_disk); + } + + public function clearAsyncPrimaryDisk() + { + unset($this->async_primary_disk); + } + + /** + * Disk asynchronously replicated into this disk. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DiskAsyncReplication async_primary_disk = 180517533; + * @param \Google\Cloud\Compute\V1\DiskAsyncReplication $var + * @return $this + */ + public function setAsyncPrimaryDisk($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DiskAsyncReplication::class); + $this->async_primary_disk = $var; + + return $this; + } + + /** + * [Output Only] A list of disks this disk is asynchronously replicated to. + * + * Generated from protobuf field map async_secondary_disks = 322925608; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAsyncSecondaryDisks() + { + return $this->async_secondary_disks; + } + + /** + * [Output Only] A list of disks this disk is asynchronously replicated to. + * + * Generated from protobuf field map async_secondary_disks = 322925608; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAsyncSecondaryDisks($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\DiskAsyncReplicationList::class); + $this->async_secondary_disks = $arr; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Encrypts the disk using a customer-supplied encryption key or a customer-managed encryption key. Encryption keys do not protect access to metadata of the disk. After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later. For example, to create a disk snapshot, to create a disk image, to create a machine image, or to attach the disk to a virtual machine. After you encrypt a disk with a customer-managed key, the diskEncryptionKey.kmsKeyName is set to a key *version* name once the disk is created. The disk is encrypted with this version of the key. In the response, diskEncryptionKey.kmsKeyName appears in the following format: "diskEncryptionKey.kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key /cryptoKeysVersions/version If you do not provide an encryption key when creating the disk, then the disk is encrypted using an automatically generated key and you don't need to provide a key to use the disk later. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677; + * @return \Google\Cloud\Compute\V1\CustomerEncryptionKey|null + */ + public function getDiskEncryptionKey() + { + return $this->disk_encryption_key; + } + + public function hasDiskEncryptionKey() + { + return isset($this->disk_encryption_key); + } + + public function clearDiskEncryptionKey() + { + unset($this->disk_encryption_key); + } + + /** + * Encrypts the disk using a customer-supplied encryption key or a customer-managed encryption key. Encryption keys do not protect access to metadata of the disk. After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later. For example, to create a disk snapshot, to create a disk image, to create a machine image, or to attach the disk to a virtual machine. After you encrypt a disk with a customer-managed key, the diskEncryptionKey.kmsKeyName is set to a key *version* name once the disk is created. The disk is encrypted with this version of the key. In the response, diskEncryptionKey.kmsKeyName appears in the following format: "diskEncryptionKey.kmsKeyName": "projects/kms_project_id/locations/region/keyRings/ key_region/cryptoKeys/key /cryptoKeysVersions/version If you do not provide an encryption key when creating the disk, then the disk is encrypted using an automatically generated key and you don't need to provide a key to use the disk later. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677; + * @param \Google\Cloud\Compute\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setDiskEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomerEncryptionKey::class); + $this->disk_encryption_key = $var; + + return $this; + } + + /** + * Whether this disk is using confidential compute mode. + * + * Generated from protobuf field optional bool enable_confidential_compute = 102135228; + * @return bool + */ + public function getEnableConfidentialCompute() + { + return isset($this->enable_confidential_compute) ? $this->enable_confidential_compute : false; + } + + public function hasEnableConfidentialCompute() + { + return isset($this->enable_confidential_compute); + } + + public function clearEnableConfidentialCompute() + { + unset($this->enable_confidential_compute); + } + + /** + * Whether this disk is using confidential compute mode. + * + * Generated from protobuf field optional bool enable_confidential_compute = 102135228; + * @param bool $var + * @return $this + */ + public function setEnableConfidentialCompute($var) + { + GPBUtil::checkBool($var); + $this->enable_confidential_compute = $var; + + return $this; + } + + /** + * A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGuestOsFeatures() + { + return $this->guest_os_features; + } + + /** + * A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545; + * @param array<\Google\Cloud\Compute\V1\GuestOsFeature>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGuestOsFeatures($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\GuestOsFeature::class); + $this->guest_os_features = $arr; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#disk for disks. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#disk for disks. + * + * 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; + } + + /** + * A fingerprint for the labels being applied to this disk, 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 disk. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @return string + */ + public function getLabelFingerprint() + { + return isset($this->label_fingerprint) ? $this->label_fingerprint : ''; + } + + public function hasLabelFingerprint() + { + return isset($this->label_fingerprint); + } + + public function clearLabelFingerprint() + { + unset($this->label_fingerprint); + } + + /** + * A fingerprint for the labels being applied to this disk, 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 disk. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @param string $var + * @return $this + */ + public function setLabelFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->label_fingerprint = $var; + + return $this; + } + + /** + * Labels to apply to this disk. These can be later modified by the setLabels method. + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels to apply to this disk. These can be later modified by the setLabels method. + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * [Output Only] Last attach timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string last_attach_timestamp = 42159653; + * @return string + */ + public function getLastAttachTimestamp() + { + return isset($this->last_attach_timestamp) ? $this->last_attach_timestamp : ''; + } + + public function hasLastAttachTimestamp() + { + return isset($this->last_attach_timestamp); + } + + public function clearLastAttachTimestamp() + { + unset($this->last_attach_timestamp); + } + + /** + * [Output Only] Last attach timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string last_attach_timestamp = 42159653; + * @param string $var + * @return $this + */ + public function setLastAttachTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->last_attach_timestamp = $var; + + return $this; + } + + /** + * [Output Only] Last detach timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string last_detach_timestamp = 56471027; + * @return string + */ + public function getLastDetachTimestamp() + { + return isset($this->last_detach_timestamp) ? $this->last_detach_timestamp : ''; + } + + public function hasLastDetachTimestamp() + { + return isset($this->last_detach_timestamp); + } + + public function clearLastDetachTimestamp() + { + unset($this->last_detach_timestamp); + } + + /** + * [Output Only] Last detach timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string last_detach_timestamp = 56471027; + * @param string $var + * @return $this + */ + public function setLastDetachTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->last_detach_timestamp = $var; + + return $this; + } + + /** + * Integer license codes indicating which licenses are attached to this disk. + * + * Generated from protobuf field repeated int64 license_codes = 45482664; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLicenseCodes() + { + return $this->license_codes; + } + + /** + * Integer license codes indicating which licenses are attached to this disk. + * + * Generated from protobuf field repeated int64 license_codes = 45482664; + * @param array|array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLicenseCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT64); + $this->license_codes = $arr; + + return $this; + } + + /** + * A list of publicly visible licenses. Reserved for Google's use. + * + * Generated from protobuf field repeated string licenses = 337642578; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLicenses() + { + return $this->licenses; + } + + /** + * A list of publicly visible licenses. Reserved for Google's use. + * + * Generated from protobuf field repeated string licenses = 337642578; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLicenses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->licenses = $arr; + + return $this; + } + + /** + * An opaque location hint used to place the disk close to other resources. This field is for use by internal tools that use the public API. + * + * Generated from protobuf field optional string location_hint = 350519505; + * @return string + */ + public function getLocationHint() + { + return isset($this->location_hint) ? $this->location_hint : ''; + } + + public function hasLocationHint() + { + return isset($this->location_hint); + } + + public function clearLocationHint() + { + unset($this->location_hint); + } + + /** + * An opaque location hint used to place the disk close to other resources. This field is for use by internal tools that use the public API. + * + * Generated from protobuf field optional string location_hint = 350519505; + * @param string $var + * @return $this + */ + public function setLocationHint($var) + { + GPBUtil::checkString($var, True); + $this->location_hint = $var; + + return $this; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * Internal use only. + * + * Generated from protobuf field optional string options = 361137822; + * @return string + */ + public function getOptions() + { + return isset($this->options) ? $this->options : ''; + } + + public function hasOptions() + { + return isset($this->options); + } + + public function clearOptions() + { + unset($this->options); + } + + /** + * Internal use only. + * + * Generated from protobuf field optional string options = 361137822; + * @param string $var + * @return $this + */ + public function setOptions($var) + { + GPBUtil::checkString($var, True); + $this->options = $var; + + return $this; + } + + /** + * Input only. [Input Only] Additional params passed with the request, but not persisted as part of resource payload. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DiskParams params = 78313862; + * @return \Google\Cloud\Compute\V1\DiskParams|null + */ + public function getParams() + { + return $this->params; + } + + public function hasParams() + { + return isset($this->params); + } + + public function clearParams() + { + unset($this->params); + } + + /** + * Input only. [Input Only] Additional params passed with the request, but not persisted as part of resource payload. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DiskParams params = 78313862; + * @param \Google\Cloud\Compute\V1\DiskParams $var + * @return $this + */ + public function setParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DiskParams::class); + $this->params = $var; + + return $this; + } + + /** + * Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. The currently supported size is 4096, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project. + * + * Generated from protobuf field optional int64 physical_block_size_bytes = 420007943; + * @return int|string + */ + public function getPhysicalBlockSizeBytes() + { + return isset($this->physical_block_size_bytes) ? $this->physical_block_size_bytes : 0; + } + + public function hasPhysicalBlockSizeBytes() + { + return isset($this->physical_block_size_bytes); + } + + public function clearPhysicalBlockSizeBytes() + { + unset($this->physical_block_size_bytes); + } + + /** + * Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. The currently supported size is 4096, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project. + * + * Generated from protobuf field optional int64 physical_block_size_bytes = 420007943; + * @param int|string $var + * @return $this + */ + public function setPhysicalBlockSizeBytes($var) + { + GPBUtil::checkInt64($var); + $this->physical_block_size_bytes = $var; + + return $this; + } + + /** + * Indicates how many IOPS to provision for the disk. This sets the number of I/O operations per second that the disk can handle. Values must be between 10,000 and 120,000. For more details, see the Extreme persistent disk documentation. + * + * Generated from protobuf field optional int64 provisioned_iops = 186769108; + * @return int|string + */ + public function getProvisionedIops() + { + return isset($this->provisioned_iops) ? $this->provisioned_iops : 0; + } + + public function hasProvisionedIops() + { + return isset($this->provisioned_iops); + } + + public function clearProvisionedIops() + { + unset($this->provisioned_iops); + } + + /** + * Indicates how many IOPS to provision for the disk. This sets the number of I/O operations per second that the disk can handle. Values must be between 10,000 and 120,000. For more details, see the Extreme persistent disk documentation. + * + * Generated from protobuf field optional int64 provisioned_iops = 186769108; + * @param int|string $var + * @return $this + */ + public function setProvisionedIops($var) + { + GPBUtil::checkInt64($var); + $this->provisioned_iops = $var; + + return $this; + } + + /** + * Indicates how much throughput to provision for the disk. This sets the number of throughput mb per second that the disk can handle. Values must be greater than or equal to 1. + * + * Generated from protobuf field optional int64 provisioned_throughput = 526524181; + * @return int|string + */ + public function getProvisionedThroughput() + { + return isset($this->provisioned_throughput) ? $this->provisioned_throughput : 0; + } + + public function hasProvisionedThroughput() + { + return isset($this->provisioned_throughput); + } + + public function clearProvisionedThroughput() + { + unset($this->provisioned_throughput); + } + + /** + * Indicates how much throughput to provision for the disk. This sets the number of throughput mb per second that the disk can handle. Values must be greater than or equal to 1. + * + * Generated from protobuf field optional int64 provisioned_throughput = 526524181; + * @param int|string $var + * @return $this + */ + public function setProvisionedThroughput($var) + { + GPBUtil::checkInt64($var); + $this->provisioned_throughput = $var; + + return $this; + } + + /** + * [Output Only] URL of the region where the disk resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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 disk resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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; + } + + /** + * URLs of the zones where the disk should be replicated to. Only applicable for regional resources. + * + * Generated from protobuf field repeated string replica_zones = 48438272; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReplicaZones() + { + return $this->replica_zones; + } + + /** + * URLs of the zones where the disk should be replicated to. Only applicable for regional resources. + * + * Generated from protobuf field repeated string replica_zones = 48438272; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReplicaZones($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->replica_zones = $arr; + + return $this; + } + + /** + * Resource policies applied to this disk for automatic snapshot creations. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourcePolicies() + { + return $this->resource_policies; + } + + /** + * Resource policies applied to this disk for automatic snapshot creations. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourcePolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_policies = $arr; + + return $this; + } + + /** + * [Output Only] Status information for the disk resource. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DiskResourceStatus resource_status = 249429315; + * @return \Google\Cloud\Compute\V1\DiskResourceStatus|null + */ + public function getResourceStatus() + { + return $this->resource_status; + } + + public function hasResourceStatus() + { + return isset($this->resource_status); + } + + public function clearResourceStatus() + { + unset($this->resource_status); + } + + /** + * [Output Only] Status information for the disk resource. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DiskResourceStatus resource_status = 249429315; + * @param \Google\Cloud\Compute\V1\DiskResourceStatus $var + * @return $this + */ + public function setResourceStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DiskResourceStatus::class); + $this->resource_status = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzi = 480964257; + * @return bool + */ + public function getSatisfiesPzi() + { + return isset($this->satisfies_pzi) ? $this->satisfies_pzi : false; + } + + public function hasSatisfiesPzi() + { + return isset($this->satisfies_pzi); + } + + public function clearSatisfiesPzi() + { + unset($this->satisfies_pzi); + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzi = 480964257; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + * @return bool + */ + public function getSatisfiesPzs() + { + return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; + } + + public function hasSatisfiesPzs() + { + return isset($this->satisfies_pzs); + } + + public function clearSatisfiesPzs() + { + unset($this->satisfies_pzs); + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * [Output Only] Server-defined fully-qualified 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 fully-qualified 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; + } + + /** + * Size, in GB, of the persistent disk. You can specify this field when creating a persistent disk using the sourceImage, sourceSnapshot, or sourceDisk parameter, or specify it alone to create an empty persistent disk. If you specify this field along with a source, the value of sizeGb must not be less than the size of the source. Acceptable values are greater than 0. + * + * Generated from protobuf field optional int64 size_gb = 494929369; + * @return int|string + */ + public function getSizeGb() + { + return isset($this->size_gb) ? $this->size_gb : 0; + } + + public function hasSizeGb() + { + return isset($this->size_gb); + } + + public function clearSizeGb() + { + unset($this->size_gb); + } + + /** + * Size, in GB, of the persistent disk. You can specify this field when creating a persistent disk using the sourceImage, sourceSnapshot, or sourceDisk parameter, or specify it alone to create an empty persistent disk. If you specify this field along with a source, the value of sizeGb must not be less than the size of the source. Acceptable values are greater than 0. + * + * Generated from protobuf field optional int64 size_gb = 494929369; + * @param int|string $var + * @return $this + */ + public function setSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->size_gb = $var; + + return $this; + } + + /** + * [Output Only] URL of the DiskConsistencyGroupPolicy for a secondary disk that was created using a consistency group. + * + * Generated from protobuf field optional string source_consistency_group_policy = 19616093; + * @return string + */ + public function getSourceConsistencyGroupPolicy() + { + return isset($this->source_consistency_group_policy) ? $this->source_consistency_group_policy : ''; + } + + public function hasSourceConsistencyGroupPolicy() + { + return isset($this->source_consistency_group_policy); + } + + public function clearSourceConsistencyGroupPolicy() + { + unset($this->source_consistency_group_policy); + } + + /** + * [Output Only] URL of the DiskConsistencyGroupPolicy for a secondary disk that was created using a consistency group. + * + * Generated from protobuf field optional string source_consistency_group_policy = 19616093; + * @param string $var + * @return $this + */ + public function setSourceConsistencyGroupPolicy($var) + { + GPBUtil::checkString($var, True); + $this->source_consistency_group_policy = $var; + + return $this; + } + + /** + * [Output Only] ID of the DiskConsistencyGroupPolicy for a secondary disk that was created using a consistency group. + * + * Generated from protobuf field optional string source_consistency_group_policy_id = 267568957; + * @return string + */ + public function getSourceConsistencyGroupPolicyId() + { + return isset($this->source_consistency_group_policy_id) ? $this->source_consistency_group_policy_id : ''; + } + + public function hasSourceConsistencyGroupPolicyId() + { + return isset($this->source_consistency_group_policy_id); + } + + public function clearSourceConsistencyGroupPolicyId() + { + unset($this->source_consistency_group_policy_id); + } + + /** + * [Output Only] ID of the DiskConsistencyGroupPolicy for a secondary disk that was created using a consistency group. + * + * Generated from protobuf field optional string source_consistency_group_policy_id = 267568957; + * @param string $var + * @return $this + */ + public function setSourceConsistencyGroupPolicyId($var) + { + GPBUtil::checkString($var, True); + $this->source_consistency_group_policy_id = $var; + + return $this; + } + + /** + * The source disk used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - https://www.googleapis.com/compute/v1/projects/project/regions/region /disks/disk - projects/project/zones/zone/disks/disk - projects/project/regions/region/disks/disk - zones/zone/disks/disk - regions/region/disks/disk + * + * Generated from protobuf field optional string source_disk = 451753793; + * @return string + */ + public function getSourceDisk() + { + return isset($this->source_disk) ? $this->source_disk : ''; + } + + public function hasSourceDisk() + { + return isset($this->source_disk); + } + + public function clearSourceDisk() + { + unset($this->source_disk); + } + + /** + * The source disk used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - https://www.googleapis.com/compute/v1/projects/project/regions/region /disks/disk - projects/project/zones/zone/disks/disk - projects/project/regions/region/disks/disk - zones/zone/disks/disk - regions/region/disks/disk + * + * Generated from protobuf field optional string source_disk = 451753793; + * @param string $var + * @return $this + */ + public function setSourceDisk($var) + { + GPBUtil::checkString($var, True); + $this->source_disk = $var; + + return $this; + } + + /** + * [Output Only] The unique ID of the disk used to create this disk. This value identifies the exact disk that was used to create this persistent disk. For example, if you created the persistent disk from a disk that was later deleted and recreated under the same name, the source disk ID would identify the exact version of the disk that was used. + * + * Generated from protobuf field optional string source_disk_id = 454190809; + * @return string + */ + public function getSourceDiskId() + { + return isset($this->source_disk_id) ? $this->source_disk_id : ''; + } + + public function hasSourceDiskId() + { + return isset($this->source_disk_id); + } + + public function clearSourceDiskId() + { + unset($this->source_disk_id); + } + + /** + * [Output Only] The unique ID of the disk used to create this disk. This value identifies the exact disk that was used to create this persistent disk. For example, if you created the persistent disk from a disk that was later deleted and recreated under the same name, the source disk ID would identify the exact version of the disk that was used. + * + * Generated from protobuf field optional string source_disk_id = 454190809; + * @param string $var + * @return $this + */ + public function setSourceDiskId($var) + { + GPBUtil::checkString($var, True); + $this->source_disk_id = $var; + + return $this; + } + + /** + * The source image used to create this disk. If the source image is deleted, this field will not be set. To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-9 to use the latest Debian 9 image: projects/debian-cloud/global/images/family/debian-9 Alternatively, use a specific version of a public operating system image: projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD To create a disk with a custom image that you created, specify the image name in the following format: global/images/my-custom-image You can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name: global/images/family/my-image-family + * + * Generated from protobuf field optional string source_image = 50443319; + * @return string + */ + public function getSourceImage() + { + return isset($this->source_image) ? $this->source_image : ''; + } + + public function hasSourceImage() + { + return isset($this->source_image); + } + + public function clearSourceImage() + { + unset($this->source_image); + } + + /** + * The source image used to create this disk. If the source image is deleted, this field will not be set. To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-9 to use the latest Debian 9 image: projects/debian-cloud/global/images/family/debian-9 Alternatively, use a specific version of a public operating system image: projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD To create a disk with a custom image that you created, specify the image name in the following format: global/images/my-custom-image You can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name: global/images/family/my-image-family + * + * Generated from protobuf field optional string source_image = 50443319; + * @param string $var + * @return $this + */ + public function setSourceImage($var) + { + GPBUtil::checkString($var, True); + $this->source_image = $var; + + return $this; + } + + /** + * The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_image_encryption_key = 381503659; + * @return \Google\Cloud\Compute\V1\CustomerEncryptionKey|null + */ + public function getSourceImageEncryptionKey() + { + return $this->source_image_encryption_key; + } + + public function hasSourceImageEncryptionKey() + { + return isset($this->source_image_encryption_key); + } + + public function clearSourceImageEncryptionKey() + { + unset($this->source_image_encryption_key); + } + + /** + * The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_image_encryption_key = 381503659; + * @param \Google\Cloud\Compute\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setSourceImageEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomerEncryptionKey::class); + $this->source_image_encryption_key = $var; + + return $this; + } + + /** + * [Output Only] The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used. + * + * Generated from protobuf field optional string source_image_id = 55328291; + * @return string + */ + public function getSourceImageId() + { + return isset($this->source_image_id) ? $this->source_image_id : ''; + } + + public function hasSourceImageId() + { + return isset($this->source_image_id); + } + + public function clearSourceImageId() + { + unset($this->source_image_id); + } + + /** + * [Output Only] The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used. + * + * Generated from protobuf field optional string source_image_id = 55328291; + * @param string $var + * @return $this + */ + public function setSourceImageId($var) + { + GPBUtil::checkString($var, True); + $this->source_image_id = $var; + + return $this; + } + + /** + * The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instantSnapshots/instantSnapshot - projects/project/zones/zone/instantSnapshots/instantSnapshot - zones/zone/instantSnapshots/instantSnapshot + * + * Generated from protobuf field optional string source_instant_snapshot = 219202054; + * @return string + */ + public function getSourceInstantSnapshot() + { + return isset($this->source_instant_snapshot) ? $this->source_instant_snapshot : ''; + } + + public function hasSourceInstantSnapshot() + { + return isset($this->source_instant_snapshot); + } + + public function clearSourceInstantSnapshot() + { + unset($this->source_instant_snapshot); + } + + /** + * The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instantSnapshots/instantSnapshot - projects/project/zones/zone/instantSnapshots/instantSnapshot - zones/zone/instantSnapshots/instantSnapshot + * + * Generated from protobuf field optional string source_instant_snapshot = 219202054; + * @param string $var + * @return $this + */ + public function setSourceInstantSnapshot($var) + { + GPBUtil::checkString($var, True); + $this->source_instant_snapshot = $var; + + return $this; + } + + /** + * [Output Only] The unique ID of the instant snapshot used to create this disk. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact version of the instant snapshot that was used. + * + * Generated from protobuf field optional string source_instant_snapshot_id = 287582708; + * @return string + */ + public function getSourceInstantSnapshotId() + { + return isset($this->source_instant_snapshot_id) ? $this->source_instant_snapshot_id : ''; + } + + public function hasSourceInstantSnapshotId() + { + return isset($this->source_instant_snapshot_id); + } + + public function clearSourceInstantSnapshotId() + { + unset($this->source_instant_snapshot_id); + } + + /** + * [Output Only] The unique ID of the instant snapshot used to create this disk. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact version of the instant snapshot that was used. + * + * Generated from protobuf field optional string source_instant_snapshot_id = 287582708; + * @param string $var + * @return $this + */ + public function setSourceInstantSnapshotId($var) + { + GPBUtil::checkString($var, True); + $this->source_instant_snapshot_id = $var; + + return $this; + } + + /** + * The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project /global/snapshots/snapshot - projects/project/global/snapshots/snapshot - global/snapshots/snapshot + * + * Generated from protobuf field optional string source_snapshot = 126061928; + * @return string + */ + public function getSourceSnapshot() + { + return isset($this->source_snapshot) ? $this->source_snapshot : ''; + } + + public function hasSourceSnapshot() + { + return isset($this->source_snapshot); + } + + public function clearSourceSnapshot() + { + unset($this->source_snapshot); + } + + /** + * The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project /global/snapshots/snapshot - projects/project/global/snapshots/snapshot - global/snapshots/snapshot + * + * Generated from protobuf field optional string source_snapshot = 126061928; + * @param string $var + * @return $this + */ + public function setSourceSnapshot($var) + { + GPBUtil::checkString($var, True); + $this->source_snapshot = $var; + + return $this; + } + + /** + * The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_snapshot_encryption_key = 303679322; + * @return \Google\Cloud\Compute\V1\CustomerEncryptionKey|null + */ + public function getSourceSnapshotEncryptionKey() + { + return $this->source_snapshot_encryption_key; + } + + public function hasSourceSnapshotEncryptionKey() + { + return isset($this->source_snapshot_encryption_key); + } + + public function clearSourceSnapshotEncryptionKey() + { + unset($this->source_snapshot_encryption_key); + } + + /** + * The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_snapshot_encryption_key = 303679322; + * @param \Google\Cloud\Compute\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setSourceSnapshotEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomerEncryptionKey::class); + $this->source_snapshot_encryption_key = $var; + + return $this; + } + + /** + * [Output Only] The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used. + * + * Generated from protobuf field optional string source_snapshot_id = 98962258; + * @return string + */ + public function getSourceSnapshotId() + { + return isset($this->source_snapshot_id) ? $this->source_snapshot_id : ''; + } + + public function hasSourceSnapshotId() + { + return isset($this->source_snapshot_id); + } + + public function clearSourceSnapshotId() + { + unset($this->source_snapshot_id); + } + + /** + * [Output Only] The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used. + * + * Generated from protobuf field optional string source_snapshot_id = 98962258; + * @param string $var + * @return $this + */ + public function setSourceSnapshotId($var) + { + GPBUtil::checkString($var, True); + $this->source_snapshot_id = $var; + + return $this; + } + + /** + * The full Google Cloud Storage URI where the disk image is stored. This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. Valid URIs may start with gs:// or https://storage.googleapis.com/. This flag is not optimized for creating multiple disks from a source storage object. To create many disks from a source storage object, use gcloud compute images import instead. + * + * Generated from protobuf field optional string source_storage_object = 233052711; + * @return string + */ + public function getSourceStorageObject() + { + return isset($this->source_storage_object) ? $this->source_storage_object : ''; + } + + public function hasSourceStorageObject() + { + return isset($this->source_storage_object); + } + + public function clearSourceStorageObject() + { + unset($this->source_storage_object); + } + + /** + * The full Google Cloud Storage URI where the disk image is stored. This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. Valid URIs may start with gs:// or https://storage.googleapis.com/. This flag is not optimized for creating multiple disks from a source storage object. To create many disks from a source storage object, use gcloud compute images import instead. + * + * Generated from protobuf field optional string source_storage_object = 233052711; + * @param string $var + * @return $this + */ + public function setSourceStorageObject($var) + { + GPBUtil::checkString($var, True); + $this->source_storage_object = $var; + + return $this; + } + + /** + * [Output Only] The status of disk creation. - CREATING: Disk is provisioning. - RESTORING: Source data is being copied into the disk. - FAILED: Disk creation failed. - READY: Disk is ready for use. - DELETING: Disk is deleting. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] The status of disk creation. - CREATING: Disk is provisioning. - RESTORING: Source data is being copied into the disk. - FAILED: Disk creation failed. - READY: Disk is ready for use. - DELETING: Disk is deleting. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + + /** + * The storage pool in which the new disk is created. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /storagePools/storagePool - projects/project/zones/zone/storagePools/storagePool - zones/zone/storagePools/storagePool + * + * Generated from protobuf field optional string storage_pool = 360473440; + * @return string + */ + public function getStoragePool() + { + return isset($this->storage_pool) ? $this->storage_pool : ''; + } + + public function hasStoragePool() + { + return isset($this->storage_pool); + } + + public function clearStoragePool() + { + unset($this->storage_pool); + } + + /** + * The storage pool in which the new disk is created. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /storagePools/storagePool - projects/project/zones/zone/storagePools/storagePool - zones/zone/storagePools/storagePool + * + * Generated from protobuf field optional string storage_pool = 360473440; + * @param string $var + * @return $this + */ + public function setStoragePool($var) + { + GPBUtil::checkString($var, True); + $this->storage_pool = $var; + + return $this; + } + + /** + * URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk. For example: projects/project /zones/zone/diskTypes/pd-ssd . See Persistent disk types. + * + * Generated from protobuf field optional string type = 3575610; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk. For example: projects/project /zones/zone/diskTypes/pd-ssd . See Persistent disk types. + * + * Generated from protobuf field optional string type = 3575610; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance + * + * Generated from protobuf field repeated string users = 111578632; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUsers() + { + return $this->users; + } + + /** + * [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance + * + * Generated from protobuf field repeated string users = 111578632; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUsers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->users = $arr; + + return $this; + } + + /** + * [Output Only] URL of the zone where the disk resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + * @return string + */ + public function getZone() + { + return isset($this->zone) ? $this->zone : ''; + } + + public function hasZone() + { + return isset($this->zone); + } + + public function clearZone() + { + unset($this->zone); + } + + /** + * [Output Only] URL of the zone where the disk resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Disk/Architecture.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Disk/Architecture.php new file mode 100644 index 000000000000..ccb903e6eeaf --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Disk/Architecture.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.Disk.Architecture + */ +class Architecture +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ARCHITECTURE = 0; + */ + const UNDEFINED_ARCHITECTURE = 0; + /** + * Default value indicating Architecture is not set. + * + * Generated from protobuf enum ARCHITECTURE_UNSPECIFIED = 394750507; + */ + const ARCHITECTURE_UNSPECIFIED = 394750507; + /** + * Machines with architecture ARM64 + * + * Generated from protobuf enum ARM64 = 62547450; + */ + const ARM64 = 62547450; + /** + * Machines with architecture X86_64 + * + * Generated from protobuf enum X86_64 = 425300551; + */ + const X86_64 = 425300551; + + private static $valueToName = [ + self::UNDEFINED_ARCHITECTURE => 'UNDEFINED_ARCHITECTURE', + self::ARCHITECTURE_UNSPECIFIED => 'ARCHITECTURE_UNSPECIFIED', + self::ARM64 => 'ARM64', + self::X86_64 => 'X86_64', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Architecture::class, \Google\Cloud\Compute\V1\Disk_Architecture::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Disk/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Disk/Status.php new file mode 100644 index 000000000000..40269c514b1f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Disk/Status.php @@ -0,0 +1,92 @@ +google.cloud.compute.v1.Disk.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * Disk is provisioning + * + * Generated from protobuf enum CREATING = 455564985; + */ + const CREATING = 455564985; + /** + * Disk is deleting. + * + * Generated from protobuf enum DELETING = 528602024; + */ + const DELETING = 528602024; + /** + * Disk creation failed. + * + * Generated from protobuf enum FAILED = 455706685; + */ + const FAILED = 455706685; + /** + * Disk is ready for use. + * + * Generated from protobuf enum READY = 77848963; + */ + const READY = 77848963; + /** + * Source data is being copied into the disk. + * + * Generated from protobuf enum RESTORING = 404263851; + */ + const RESTORING = 404263851; + /** + * Disk is currently unavailable and cannot be accessed, attached or detached. + * + * Generated from protobuf enum UNAVAILABLE = 413756464; + */ + const UNAVAILABLE = 413756464; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::CREATING => 'CREATING', + self::DELETING => 'DELETING', + self::FAILED => 'FAILED', + self::READY => 'READY', + self::RESTORING => 'RESTORING', + self::UNAVAILABLE => 'UNAVAILABLE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\Disk_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskAggregatedList.php new file mode 100644 index 000000000000..e4f632536f15 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.DiskAggregatedList + */ +class DiskAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of DisksScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#diskAggregatedList for aggregated lists of persistent disks. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 DisksScopedList resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#diskAggregatedList for aggregated lists of persistent disks. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 DisksScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of DisksScopedList 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\DisksScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#diskAggregatedList for aggregated lists of persistent disks. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#diskAggregatedList for aggregated lists of persistent disks. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskAsyncReplication.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskAsyncReplication.php new file mode 100644 index 000000000000..342490dc10ad --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskAsyncReplication.php @@ -0,0 +1,208 @@ +google.cloud.compute.v1.DiskAsyncReplication + */ +class DiskAsyncReplication extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] URL of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group. + * + * Generated from protobuf field optional string consistency_group_policy = 1991097; + */ + protected $consistency_group_policy = null; + /** + * [Output Only] ID of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group. + * + * Generated from protobuf field optional string consistency_group_policy_id = 261065057; + */ + protected $consistency_group_policy_id = null; + /** + * The other disk asynchronously replicated to or from the current disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk + * + * Generated from protobuf field optional string disk = 3083677; + */ + protected $disk = null; + /** + * [Output Only] The unique ID of the other disk asynchronously replicated to or from the current disk. This value identifies the exact disk that was used to create this replication. For example, if you started replicating the persistent disk from a disk that was later deleted and recreated under the same name, the disk ID would identify the exact version of the disk that was used. + * + * Generated from protobuf field optional string disk_id = 60990205; + */ + protected $disk_id = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $consistency_group_policy + * [Output Only] URL of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group. + * @type string $consistency_group_policy_id + * [Output Only] ID of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group. + * @type string $disk + * The other disk asynchronously replicated to or from the current disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk + * @type string $disk_id + * [Output Only] The unique ID of the other disk asynchronously replicated to or from the current disk. This value identifies the exact disk that was used to create this replication. For example, if you started replicating the persistent disk from a disk that was later deleted and recreated under the same name, the disk ID would identify the exact version of the disk that was used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] URL of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group. + * + * Generated from protobuf field optional string consistency_group_policy = 1991097; + * @return string + */ + public function getConsistencyGroupPolicy() + { + return isset($this->consistency_group_policy) ? $this->consistency_group_policy : ''; + } + + public function hasConsistencyGroupPolicy() + { + return isset($this->consistency_group_policy); + } + + public function clearConsistencyGroupPolicy() + { + unset($this->consistency_group_policy); + } + + /** + * [Output Only] URL of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group. + * + * Generated from protobuf field optional string consistency_group_policy = 1991097; + * @param string $var + * @return $this + */ + public function setConsistencyGroupPolicy($var) + { + GPBUtil::checkString($var, True); + $this->consistency_group_policy = $var; + + return $this; + } + + /** + * [Output Only] ID of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group. + * + * Generated from protobuf field optional string consistency_group_policy_id = 261065057; + * @return string + */ + public function getConsistencyGroupPolicyId() + { + return isset($this->consistency_group_policy_id) ? $this->consistency_group_policy_id : ''; + } + + public function hasConsistencyGroupPolicyId() + { + return isset($this->consistency_group_policy_id); + } + + public function clearConsistencyGroupPolicyId() + { + unset($this->consistency_group_policy_id); + } + + /** + * [Output Only] ID of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group. + * + * Generated from protobuf field optional string consistency_group_policy_id = 261065057; + * @param string $var + * @return $this + */ + public function setConsistencyGroupPolicyId($var) + { + GPBUtil::checkString($var, True); + $this->consistency_group_policy_id = $var; + + return $this; + } + + /** + * The other disk asynchronously replicated to or from the current disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk + * + * Generated from protobuf field optional string disk = 3083677; + * @return string + */ + public function getDisk() + { + return isset($this->disk) ? $this->disk : ''; + } + + public function hasDisk() + { + return isset($this->disk); + } + + public function clearDisk() + { + unset($this->disk); + } + + /** + * The other disk asynchronously replicated to or from the current disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk + * + * Generated from protobuf field optional string disk = 3083677; + * @param string $var + * @return $this + */ + public function setDisk($var) + { + GPBUtil::checkString($var, True); + $this->disk = $var; + + return $this; + } + + /** + * [Output Only] The unique ID of the other disk asynchronously replicated to or from the current disk. This value identifies the exact disk that was used to create this replication. For example, if you started replicating the persistent disk from a disk that was later deleted and recreated under the same name, the disk ID would identify the exact version of the disk that was used. + * + * Generated from protobuf field optional string disk_id = 60990205; + * @return string + */ + public function getDiskId() + { + return isset($this->disk_id) ? $this->disk_id : ''; + } + + public function hasDiskId() + { + return isset($this->disk_id); + } + + public function clearDiskId() + { + unset($this->disk_id); + } + + /** + * [Output Only] The unique ID of the other disk asynchronously replicated to or from the current disk. This value identifies the exact disk that was used to create this replication. For example, if you started replicating the persistent disk from a disk that was later deleted and recreated under the same name, the disk ID would identify the exact version of the disk that was used. + * + * Generated from protobuf field optional string disk_id = 60990205; + * @param string $var + * @return $this + */ + public function setDiskId($var) + { + GPBUtil::checkString($var, True); + $this->disk_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskAsyncReplicationList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskAsyncReplicationList.php new file mode 100644 index 000000000000..15f1cd7ab9f3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskAsyncReplicationList.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.DiskAsyncReplicationList + */ +class DiskAsyncReplicationList extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional .google.cloud.compute.v1.DiskAsyncReplication async_replication_disk = 231794067; + */ + protected $async_replication_disk = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\DiskAsyncReplication $async_replication_disk + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.DiskAsyncReplication async_replication_disk = 231794067; + * @return \Google\Cloud\Compute\V1\DiskAsyncReplication|null + */ + public function getAsyncReplicationDisk() + { + return $this->async_replication_disk; + } + + public function hasAsyncReplicationDisk() + { + return isset($this->async_replication_disk); + } + + public function clearAsyncReplicationDisk() + { + unset($this->async_replication_disk); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.DiskAsyncReplication async_replication_disk = 231794067; + * @param \Google\Cloud\Compute\V1\DiskAsyncReplication $var + * @return $this + */ + public function setAsyncReplicationDisk($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DiskAsyncReplication::class); + $this->async_replication_disk = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskInstantiationConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskInstantiationConfig.php new file mode 100644 index 000000000000..06de762466a7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskInstantiationConfig.php @@ -0,0 +1,213 @@ +google.cloud.compute.v1.DiskInstantiationConfig + */ +class DiskInstantiationConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance). + * + * Generated from protobuf field optional bool auto_delete = 464761403; + */ + protected $auto_delete = null; + /** + * The custom source image to be used to restore this disk when instantiating this instance template. + * + * Generated from protobuf field optional string custom_image = 184123149; + */ + protected $custom_image = null; + /** + * Specifies the device name of the disk to which the configurations apply to. + * + * Generated from protobuf field optional string device_name = 67541716; + */ + protected $device_name = null; + /** + * Specifies whether to include the disk and what image to use. Possible values are: - source-image: to use the same image that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks. - source-image-family: to use the same image family that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks. - custom-image: to use a user-provided image url for disk creation. Applicable to the boot disk and additional read-write disks. - attach-read-only: to attach a read-only disk. Applicable to read-only disks. - do-not-include: to exclude a disk from the template. Applicable to additional read-write disks, local SSDs, and read-only disks. + * Check the InstantiateFrom enum for the list of possible values. + * + * Generated from protobuf field optional string instantiate_from = 393383903; + */ + protected $instantiate_from = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $auto_delete + * Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance). + * @type string $custom_image + * The custom source image to be used to restore this disk when instantiating this instance template. + * @type string $device_name + * Specifies the device name of the disk to which the configurations apply to. + * @type string $instantiate_from + * Specifies whether to include the disk and what image to use. Possible values are: - source-image: to use the same image that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks. - source-image-family: to use the same image family that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks. - custom-image: to use a user-provided image url for disk creation. Applicable to the boot disk and additional read-write disks. - attach-read-only: to attach a read-only disk. Applicable to read-only disks. - do-not-include: to exclude a disk from the template. Applicable to additional read-write disks, local SSDs, and read-only disks. + * Check the InstantiateFrom enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance). + * + * Generated from protobuf field optional bool auto_delete = 464761403; + * @return bool + */ + public function getAutoDelete() + { + return isset($this->auto_delete) ? $this->auto_delete : false; + } + + public function hasAutoDelete() + { + return isset($this->auto_delete); + } + + public function clearAutoDelete() + { + unset($this->auto_delete); + } + + /** + * Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance). + * + * Generated from protobuf field optional bool auto_delete = 464761403; + * @param bool $var + * @return $this + */ + public function setAutoDelete($var) + { + GPBUtil::checkBool($var); + $this->auto_delete = $var; + + return $this; + } + + /** + * The custom source image to be used to restore this disk when instantiating this instance template. + * + * Generated from protobuf field optional string custom_image = 184123149; + * @return string + */ + public function getCustomImage() + { + return isset($this->custom_image) ? $this->custom_image : ''; + } + + public function hasCustomImage() + { + return isset($this->custom_image); + } + + public function clearCustomImage() + { + unset($this->custom_image); + } + + /** + * The custom source image to be used to restore this disk when instantiating this instance template. + * + * Generated from protobuf field optional string custom_image = 184123149; + * @param string $var + * @return $this + */ + public function setCustomImage($var) + { + GPBUtil::checkString($var, True); + $this->custom_image = $var; + + return $this; + } + + /** + * Specifies the device name of the disk to which the configurations apply to. + * + * Generated from protobuf field optional string device_name = 67541716; + * @return string + */ + public function getDeviceName() + { + return isset($this->device_name) ? $this->device_name : ''; + } + + public function hasDeviceName() + { + return isset($this->device_name); + } + + public function clearDeviceName() + { + unset($this->device_name); + } + + /** + * Specifies the device name of the disk to which the configurations apply to. + * + * Generated from protobuf field optional string device_name = 67541716; + * @param string $var + * @return $this + */ + public function setDeviceName($var) + { + GPBUtil::checkString($var, True); + $this->device_name = $var; + + return $this; + } + + /** + * Specifies whether to include the disk and what image to use. Possible values are: - source-image: to use the same image that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks. - source-image-family: to use the same image family that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks. - custom-image: to use a user-provided image url for disk creation. Applicable to the boot disk and additional read-write disks. - attach-read-only: to attach a read-only disk. Applicable to read-only disks. - do-not-include: to exclude a disk from the template. Applicable to additional read-write disks, local SSDs, and read-only disks. + * Check the InstantiateFrom enum for the list of possible values. + * + * Generated from protobuf field optional string instantiate_from = 393383903; + * @return string + */ + public function getInstantiateFrom() + { + return isset($this->instantiate_from) ? $this->instantiate_from : ''; + } + + public function hasInstantiateFrom() + { + return isset($this->instantiate_from); + } + + public function clearInstantiateFrom() + { + unset($this->instantiate_from); + } + + /** + * Specifies whether to include the disk and what image to use. Possible values are: - source-image: to use the same image that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks. - source-image-family: to use the same image family that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks. - custom-image: to use a user-provided image url for disk creation. Applicable to the boot disk and additional read-write disks. - attach-read-only: to attach a read-only disk. Applicable to read-only disks. - do-not-include: to exclude a disk from the template. Applicable to additional read-write disks, local SSDs, and read-only disks. + * Check the InstantiateFrom enum for the list of possible values. + * + * Generated from protobuf field optional string instantiate_from = 393383903; + * @param string $var + * @return $this + */ + public function setInstantiateFrom($var) + { + GPBUtil::checkString($var, True); + $this->instantiate_from = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskInstantiationConfig/InstantiateFrom.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskInstantiationConfig/InstantiateFrom.php new file mode 100644 index 000000000000..ed5c6e68d158 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskInstantiationConfig/InstantiateFrom.php @@ -0,0 +1,103 @@ +google.cloud.compute.v1.DiskInstantiationConfig.InstantiateFrom + */ +class InstantiateFrom +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_INSTANTIATE_FROM = 0; + */ + const UNDEFINED_INSTANTIATE_FROM = 0; + /** + * Attach the existing disk in read-only mode. The request will fail if the disk was attached in read-write mode on the source instance. Applicable to: read-only disks. + * + * Generated from protobuf enum ATTACH_READ_ONLY = 513775419; + */ + const ATTACH_READ_ONLY = 513775419; + /** + * Create a blank disk. The disk will be created unformatted. Applicable to: additional read-write disks, local SSDs. + * + * Generated from protobuf enum BLANK = 63281460; + */ + const BLANK = 63281460; + /** + * Use the custom image specified in the custom_image field. Applicable to: boot disk, additional read-write disks. + * + * Generated from protobuf enum CUSTOM_IMAGE = 196311789; + */ + const CUSTOM_IMAGE = 196311789; + /** + * Use the default instantiation option for the corresponding type of disk. For boot disk and any other R/W disks, new custom images will be created from each disk. For read-only disks, they will be attached in read-only mode. Local SSD disks will be created as blank volumes. + * + * Generated from protobuf enum DEFAULT = 115302945; + */ + const PBDEFAULT = 115302945; + /** + * Do not include the disk in the instance template. Applicable to: additional read-write disks, local SSDs, read-only disks. + * + * Generated from protobuf enum DO_NOT_INCLUDE = 104218952; + */ + const DO_NOT_INCLUDE = 104218952; + /** + * Use the same source image used for creation of the source instance's corresponding disk. The request will fail if the source VM's disk was created from a snapshot. Applicable to: boot disk, additional read-write disks. + * + * Generated from protobuf enum SOURCE_IMAGE = 62631959; + */ + const SOURCE_IMAGE = 62631959; + /** + * Use the same source image family used for creation of the source instance's corresponding disk. The request will fail if the source image of the source disk does not belong to any image family. Applicable to: boot disk, additional read-write disks. + * + * Generated from protobuf enum SOURCE_IMAGE_FAMILY = 76850316; + */ + const SOURCE_IMAGE_FAMILY = 76850316; + + private static $valueToName = [ + self::UNDEFINED_INSTANTIATE_FROM => 'UNDEFINED_INSTANTIATE_FROM', + self::ATTACH_READ_ONLY => 'ATTACH_READ_ONLY', + self::BLANK => 'BLANK', + self::CUSTOM_IMAGE => 'CUSTOM_IMAGE', + self::PBDEFAULT => 'DEFAULT', + self::DO_NOT_INCLUDE => 'DO_NOT_INCLUDE', + self::SOURCE_IMAGE => 'SOURCE_IMAGE', + self::SOURCE_IMAGE_FAMILY => 'SOURCE_IMAGE_FAMILY', + ]; + + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(InstantiateFrom::class, \Google\Cloud\Compute\V1\DiskInstantiationConfig_InstantiateFrom::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskList.php new file mode 100644 index 000000000000..abfde790a352 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.DiskList + */ +class DiskList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of Disk resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Disk items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#diskList for lists of disks. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\Disk>|\Google\Protobuf\Internal\RepeatedField $items + * A list of Disk resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#diskList for lists of disks. + * @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 Disk resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Disk items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of Disk resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Disk items = 100526016; + * @param array<\Google\Cloud\Compute\V1\Disk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Disk::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#diskList for lists of disks. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#diskList for lists of disks. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskMoveRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskMoveRequest.php new file mode 100644 index 000000000000..af83a7deeb58 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskMoveRequest.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.DiskMoveRequest + */ +class DiskMoveRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The URL of the destination zone to move the disk. This can be a full or partial URL. For example, the following are all valid URLs to a zone: - https://www.googleapis.com/compute/v1/projects/project/zones/zone - projects/project/zones/zone - zones/zone + * + * Generated from protobuf field optional string destination_zone = 131854653; + */ + protected $destination_zone = null; + /** + * The URL of the target disk to move. This can be a full or partial URL. For example, the following are all valid URLs to a disk: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk + * + * Generated from protobuf field optional string target_disk = 62433163; + */ + protected $target_disk = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $destination_zone + * The URL of the destination zone to move the disk. This can be a full or partial URL. For example, the following are all valid URLs to a zone: - https://www.googleapis.com/compute/v1/projects/project/zones/zone - projects/project/zones/zone - zones/zone + * @type string $target_disk + * The URL of the target disk to move. This can be a full or partial URL. For example, the following are all valid URLs to a disk: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The URL of the destination zone to move the disk. This can be a full or partial URL. For example, the following are all valid URLs to a zone: - https://www.googleapis.com/compute/v1/projects/project/zones/zone - projects/project/zones/zone - zones/zone + * + * Generated from protobuf field optional string destination_zone = 131854653; + * @return string + */ + public function getDestinationZone() + { + return isset($this->destination_zone) ? $this->destination_zone : ''; + } + + public function hasDestinationZone() + { + return isset($this->destination_zone); + } + + public function clearDestinationZone() + { + unset($this->destination_zone); + } + + /** + * The URL of the destination zone to move the disk. This can be a full or partial URL. For example, the following are all valid URLs to a zone: - https://www.googleapis.com/compute/v1/projects/project/zones/zone - projects/project/zones/zone - zones/zone + * + * Generated from protobuf field optional string destination_zone = 131854653; + * @param string $var + * @return $this + */ + public function setDestinationZone($var) + { + GPBUtil::checkString($var, True); + $this->destination_zone = $var; + + return $this; + } + + /** + * The URL of the target disk to move. This can be a full or partial URL. For example, the following are all valid URLs to a disk: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk + * + * Generated from protobuf field optional string target_disk = 62433163; + * @return string + */ + public function getTargetDisk() + { + return isset($this->target_disk) ? $this->target_disk : ''; + } + + public function hasTargetDisk() + { + return isset($this->target_disk); + } + + public function clearTargetDisk() + { + unset($this->target_disk); + } + + /** + * The URL of the target disk to move. This can be a full or partial URL. For example, the following are all valid URLs to a disk: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk + * + * Generated from protobuf field optional string target_disk = 62433163; + * @param string $var + * @return $this + */ + public function setTargetDisk($var) + { + GPBUtil::checkString($var, True); + $this->target_disk = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskParams.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskParams.php new file mode 100644 index 000000000000..97e4b936d581 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskParams.php @@ -0,0 +1,67 @@ +google.cloud.compute.v1.DiskParams + */ +class DiskParams extends \Google\Protobuf\Internal\Message +{ + /** + * Resource manager tags to be bound to the disk. Tag keys and values have the same definition as resource manager tags. Keys must be in the format `tagKeys/{tag_key_id}`, and values are in the format `tagValues/456`. The field is ignored (both PUT & PATCH) when empty. + * + * Generated from protobuf field map resource_manager_tags = 377671164; + */ + private $resource_manager_tags; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $resource_manager_tags + * Resource manager tags to be bound to the disk. Tag keys and values have the same definition as resource manager tags. Keys must be in the format `tagKeys/{tag_key_id}`, and values are in the format `tagValues/456`. The field is ignored (both PUT & PATCH) when empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Resource manager tags to be bound to the disk. Tag keys and values have the same definition as resource manager tags. Keys must be in the format `tagKeys/{tag_key_id}`, and values are in the format `tagValues/456`. The field is ignored (both PUT & PATCH) when empty. + * + * Generated from protobuf field map resource_manager_tags = 377671164; + * @return \Google\Protobuf\Internal\MapField + */ + public function getResourceManagerTags() + { + return $this->resource_manager_tags; + } + + /** + * Resource manager tags to be bound to the disk. Tag keys and values have the same definition as resource manager tags. Keys must be in the format `tagKeys/{tag_key_id}`, and values are in the format `tagValues/456`. The field is ignored (both PUT & PATCH) when empty. + * + * Generated from protobuf field map resource_manager_tags = 377671164; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setResourceManagerTags($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_manager_tags = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskResourceStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskResourceStatus.php new file mode 100644 index 000000000000..83db94a520a8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskResourceStatus.php @@ -0,0 +1,103 @@ +google.cloud.compute.v1.DiskResourceStatus + */ +class DiskResourceStatus extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional .google.cloud.compute.v1.DiskResourceStatusAsyncReplicationStatus async_primary_disk = 180517533; + */ + protected $async_primary_disk = null; + /** + * Key: disk, value: AsyncReplicationStatus message + * + * Generated from protobuf field map async_secondary_disks = 322925608; + */ + private $async_secondary_disks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\DiskResourceStatusAsyncReplicationStatus $async_primary_disk + * @type array|\Google\Protobuf\Internal\MapField $async_secondary_disks + * Key: disk, value: AsyncReplicationStatus message + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.DiskResourceStatusAsyncReplicationStatus async_primary_disk = 180517533; + * @return \Google\Cloud\Compute\V1\DiskResourceStatusAsyncReplicationStatus|null + */ + public function getAsyncPrimaryDisk() + { + return $this->async_primary_disk; + } + + public function hasAsyncPrimaryDisk() + { + return isset($this->async_primary_disk); + } + + public function clearAsyncPrimaryDisk() + { + unset($this->async_primary_disk); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.DiskResourceStatusAsyncReplicationStatus async_primary_disk = 180517533; + * @param \Google\Cloud\Compute\V1\DiskResourceStatusAsyncReplicationStatus $var + * @return $this + */ + public function setAsyncPrimaryDisk($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DiskResourceStatusAsyncReplicationStatus::class); + $this->async_primary_disk = $var; + + return $this; + } + + /** + * Key: disk, value: AsyncReplicationStatus message + * + * Generated from protobuf field map async_secondary_disks = 322925608; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAsyncSecondaryDisks() + { + return $this->async_secondary_disks; + } + + /** + * Key: disk, value: AsyncReplicationStatus message + * + * Generated from protobuf field map async_secondary_disks = 322925608; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAsyncSecondaryDisks($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\DiskResourceStatusAsyncReplicationStatus::class); + $this->async_secondary_disks = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskResourceStatusAsyncReplicationStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskResourceStatusAsyncReplicationStatus.php new file mode 100644 index 000000000000..e2a0b2b2c362 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskResourceStatusAsyncReplicationStatus.php @@ -0,0 +1,80 @@ +google.cloud.compute.v1.DiskResourceStatusAsyncReplicationStatus + */ +class DiskResourceStatusAsyncReplicationStatus extends \Google\Protobuf\Internal\Message +{ + /** + * + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + */ + protected $state = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $state + * + * Check the State enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @return string + */ + public function getState() + { + return isset($this->state) ? $this->state : ''; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskResourceStatusAsyncReplicationStatus/State.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskResourceStatusAsyncReplicationStatus/State.php new file mode 100644 index 000000000000..c07c24438245 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskResourceStatusAsyncReplicationStatus/State.php @@ -0,0 +1,89 @@ +google.cloud.compute.v1.DiskResourceStatusAsyncReplicationStatus.State + */ +class State +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATE = 0; + */ + const UNDEFINED_STATE = 0; + /** + * Replication is active. + * + * Generated from protobuf enum ACTIVE = 314733318; + */ + const ACTIVE = 314733318; + /** + * Secondary disk is created and is waiting for replication to start. + * + * Generated from protobuf enum CREATED = 135924424; + */ + const CREATED = 135924424; + /** + * Replication is starting. + * + * Generated from protobuf enum STARTING = 488820800; + */ + const STARTING = 488820800; + /** + * Generated from protobuf enum STATE_UNSPECIFIED = 470755401; + */ + const STATE_UNSPECIFIED = 470755401; + /** + * Replication is stopped. + * + * Generated from protobuf enum STOPPED = 444276141; + */ + const STOPPED = 444276141; + /** + * Replication is stopping. + * + * Generated from protobuf enum STOPPING = 350791796; + */ + const STOPPING = 350791796; + + private static $valueToName = [ + self::UNDEFINED_STATE => 'UNDEFINED_STATE', + self::ACTIVE => 'ACTIVE', + self::CREATED => 'CREATED', + self::STARTING => 'STARTING', + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::STOPPED => 'STOPPED', + self::STOPPING => 'STOPPING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Compute\V1\DiskResourceStatusAsyncReplicationStatus_State::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskType.php new file mode 100644 index 000000000000..792708a0ed1c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskType.php @@ -0,0 +1,517 @@ +google.cloud.compute.v1.DiskType + */ +class DiskType extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * [Output Only] Server-defined default disk size in GB. + * + * Generated from protobuf field optional int64 default_disk_size_gb = 270619253; + */ + protected $default_disk_size_gb = null; + /** + * [Output Only] The deprecation status associated with this disk type. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + */ + protected $deprecated = null; + /** + * [Output Only] An optional description of this resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#diskType for disk types. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * [Output Only] Name of the resource. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] URL of the region where the disk type resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] An optional textual description of the valid disk size, such as "10GB-10TB". + * + * Generated from protobuf field optional string valid_disk_size = 493962464; + */ + protected $valid_disk_size = null; + /** + * [Output Only] URL of the zone where the disk type resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + */ + protected $zone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type int|string $default_disk_size_gb + * [Output Only] Server-defined default disk size in GB. + * @type \Google\Cloud\Compute\V1\DeprecationStatus $deprecated + * [Output Only] The deprecation status associated with this disk type. + * @type string $description + * [Output Only] An optional description of this resource. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of the resource. Always compute#diskType for disk types. + * @type string $name + * [Output Only] Name of the resource. + * @type string $region + * [Output Only] URL of the region where the disk type resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $valid_disk_size + * [Output Only] An optional textual description of the valid disk size, such as "10GB-10TB". + * @type string $zone + * [Output Only] URL of the zone where the disk type resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * [Output Only] Server-defined default disk size in GB. + * + * Generated from protobuf field optional int64 default_disk_size_gb = 270619253; + * @return int|string + */ + public function getDefaultDiskSizeGb() + { + return isset($this->default_disk_size_gb) ? $this->default_disk_size_gb : 0; + } + + public function hasDefaultDiskSizeGb() + { + return isset($this->default_disk_size_gb); + } + + public function clearDefaultDiskSizeGb() + { + unset($this->default_disk_size_gb); + } + + /** + * [Output Only] Server-defined default disk size in GB. + * + * Generated from protobuf field optional int64 default_disk_size_gb = 270619253; + * @param int|string $var + * @return $this + */ + public function setDefaultDiskSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->default_disk_size_gb = $var; + + return $this; + } + + /** + * [Output Only] The deprecation status associated with this disk type. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + * @return \Google\Cloud\Compute\V1\DeprecationStatus|null + */ + public function getDeprecated() + { + return $this->deprecated; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * [Output Only] The deprecation status associated with this disk type. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + * @param \Google\Cloud\Compute\V1\DeprecationStatus $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DeprecationStatus::class); + $this->deprecated = $var; + + return $this; + } + + /** + * [Output Only] An optional description of this resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * [Output Only] An optional description of this resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#diskType for disk types. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#diskType for disk types. + * + * 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] Name of the resource. + * + * 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); + } + + /** + * [Output Only] Name of the resource. + * + * 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; + } + + /** + * [Output Only] URL of the region where the disk type resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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 disk type resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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] Server-defined URL for the 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 the 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] An optional textual description of the valid disk size, such as "10GB-10TB". + * + * Generated from protobuf field optional string valid_disk_size = 493962464; + * @return string + */ + public function getValidDiskSize() + { + return isset($this->valid_disk_size) ? $this->valid_disk_size : ''; + } + + public function hasValidDiskSize() + { + return isset($this->valid_disk_size); + } + + public function clearValidDiskSize() + { + unset($this->valid_disk_size); + } + + /** + * [Output Only] An optional textual description of the valid disk size, such as "10GB-10TB". + * + * Generated from protobuf field optional string valid_disk_size = 493962464; + * @param string $var + * @return $this + */ + public function setValidDiskSize($var) + { + GPBUtil::checkString($var, True); + $this->valid_disk_size = $var; + + return $this; + } + + /** + * [Output Only] URL of the zone where the disk type resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + * @return string + */ + public function getZone() + { + return isset($this->zone) ? $this->zone : ''; + } + + public function hasZone() + { + return isset($this->zone); + } + + public function clearZone() + { + unset($this->zone); + } + + /** + * [Output Only] URL of the zone where the disk type resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskTypeAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskTypeAggregatedList.php new file mode 100644 index 000000000000..2599645a3cb1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskTypeAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.DiskTypeAggregatedList + */ +class DiskTypeAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of DiskTypesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#diskTypeAggregatedList. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 DiskTypesScopedList resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#diskTypeAggregatedList. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 DiskTypesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of DiskTypesScopedList 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\DiskTypesScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#diskTypeAggregatedList. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#diskTypeAggregatedList. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskTypeList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskTypeList.php new file mode 100644 index 000000000000..d5c6cda8a6dc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskTypeList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.DiskTypeList + */ +class DiskTypeList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of DiskType resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.DiskType items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#diskTypeList for disk types. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\DiskType>|\Google\Protobuf\Internal\RepeatedField $items + * A list of DiskType resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#diskTypeList for disk types. + * @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 DiskType resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.DiskType items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of DiskType resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.DiskType items = 100526016; + * @param array<\Google\Cloud\Compute\V1\DiskType>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\DiskType::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#diskTypeList for disk types. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#diskTypeList for disk types. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskTypesScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskTypesScopedList.php new file mode 100644 index 000000000000..811b02178a60 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DiskTypesScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.DiskTypesScopedList + */ +class DiskTypesScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A list of disk types contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.DiskType disk_types = 198926167; + */ + private $disk_types; + /** + * [Output Only] Informational warning which replaces the list of disk types when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\DiskType>|\Google\Protobuf\Internal\RepeatedField $disk_types + * [Output Only] A list of disk types contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] Informational warning which replaces the list of disk types 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 disk types contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.DiskType disk_types = 198926167; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDiskTypes() + { + return $this->disk_types; + } + + /** + * [Output Only] A list of disk types contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.DiskType disk_types = 198926167; + * @param array<\Google\Cloud\Compute\V1\DiskType>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDiskTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\DiskType::class); + $this->disk_types = $arr; + + return $this; + } + + /** + * [Output Only] Informational warning which replaces the list of disk types 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] Informational warning which replaces the list of disk types 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksAddResourcePoliciesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksAddResourcePoliciesRequest.php new file mode 100644 index 000000000000..4f1754df2537 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksAddResourcePoliciesRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.DisksAddResourcePoliciesRequest + */ +class DisksAddResourcePoliciesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Full or relative path to the resource policy to be added to this disk. You can only specify one resource policy. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + */ + private $resource_policies; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $resource_policies + * Full or relative path to the resource policy to be added to this disk. You can only specify one resource policy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Full or relative path to the resource policy to be added to this disk. You can only specify one resource policy. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourcePolicies() + { + return $this->resource_policies; + } + + /** + * Full or relative path to the resource policy to be added to this disk. You can only specify one resource policy. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourcePolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_policies = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksRemoveResourcePoliciesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksRemoveResourcePoliciesRequest.php new file mode 100644 index 000000000000..7b49b01ae366 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksRemoveResourcePoliciesRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest + */ +class DisksRemoveResourcePoliciesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Resource policies to be removed from this disk. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + */ + private $resource_policies; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $resource_policies + * Resource policies to be removed from this disk. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Resource policies to be removed from this disk. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourcePolicies() + { + return $this->resource_policies; + } + + /** + * Resource policies to be removed from this disk. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourcePolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_policies = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksResizeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksResizeRequest.php new file mode 100644 index 000000000000..2472469394fd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksResizeRequest.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.DisksResizeRequest + */ +class DisksResizeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The new size of the persistent disk, which is specified in GB. + * + * Generated from protobuf field optional int64 size_gb = 494929369; + */ + protected $size_gb = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $size_gb + * The new size of the persistent disk, which is specified in GB. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The new size of the persistent disk, which is specified in GB. + * + * Generated from protobuf field optional int64 size_gb = 494929369; + * @return int|string + */ + public function getSizeGb() + { + return isset($this->size_gb) ? $this->size_gb : 0; + } + + public function hasSizeGb() + { + return isset($this->size_gb); + } + + public function clearSizeGb() + { + unset($this->size_gb); + } + + /** + * The new size of the persistent disk, which is specified in GB. + * + * Generated from protobuf field optional int64 size_gb = 494929369; + * @param int|string $var + * @return $this + */ + public function setSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->size_gb = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksScopedList.php new file mode 100644 index 000000000000..a819d3cd5e4c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.DisksScopedList + */ +class DisksScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A list of disks contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Disk disks = 95594102; + */ + private $disks; + /** + * [Output Only] Informational warning which replaces the list of disks when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\Disk>|\Google\Protobuf\Internal\RepeatedField $disks + * [Output Only] A list of disks contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] Informational warning which replaces the list of disks 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 disks contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Disk disks = 95594102; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisks() + { + return $this->disks; + } + + /** + * [Output Only] A list of disks contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Disk disks = 95594102; + * @param array<\Google\Cloud\Compute\V1\Disk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Disk::class); + $this->disks = $arr; + + return $this; + } + + /** + * [Output Only] Informational warning which replaces the list of disks 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] Informational warning which replaces the list of disks 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksStartAsyncReplicationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksStartAsyncReplicationRequest.php new file mode 100644 index 000000000000..ad5447020182 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksStartAsyncReplicationRequest.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.DisksStartAsyncReplicationRequest + */ +class DisksStartAsyncReplicationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The secondary disk to start asynchronous replication to. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - https://www.googleapis.com/compute/v1/projects/project/regions/region /disks/disk - projects/project/zones/zone/disks/disk - projects/project/regions/region/disks/disk - zones/zone/disks/disk - regions/region/disks/disk + * + * Generated from protobuf field optional string async_secondary_disk = 131645867; + */ + protected $async_secondary_disk = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $async_secondary_disk + * The secondary disk to start asynchronous replication to. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - https://www.googleapis.com/compute/v1/projects/project/regions/region /disks/disk - projects/project/zones/zone/disks/disk - projects/project/regions/region/disks/disk - zones/zone/disks/disk - regions/region/disks/disk + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The secondary disk to start asynchronous replication to. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - https://www.googleapis.com/compute/v1/projects/project/regions/region /disks/disk - projects/project/zones/zone/disks/disk - projects/project/regions/region/disks/disk - zones/zone/disks/disk - regions/region/disks/disk + * + * Generated from protobuf field optional string async_secondary_disk = 131645867; + * @return string + */ + public function getAsyncSecondaryDisk() + { + return isset($this->async_secondary_disk) ? $this->async_secondary_disk : ''; + } + + public function hasAsyncSecondaryDisk() + { + return isset($this->async_secondary_disk); + } + + public function clearAsyncSecondaryDisk() + { + unset($this->async_secondary_disk); + } + + /** + * The secondary disk to start asynchronous replication to. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - https://www.googleapis.com/compute/v1/projects/project/regions/region /disks/disk - projects/project/zones/zone/disks/disk - projects/project/regions/region/disks/disk - zones/zone/disks/disk - regions/region/disks/disk + * + * Generated from protobuf field optional string async_secondary_disk = 131645867; + * @param string $var + * @return $this + */ + public function setAsyncSecondaryDisk($var) + { + GPBUtil::checkString($var, True); + $this->async_secondary_disk = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksStopGroupAsyncReplicationResource.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksStopGroupAsyncReplicationResource.php new file mode 100644 index 000000000000..d134b338a2eb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisksStopGroupAsyncReplicationResource.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.DisksStopGroupAsyncReplicationResource + */ +class DisksStopGroupAsyncReplicationResource extends \Google\Protobuf\Internal\Message +{ + /** + * The URL of the DiskConsistencyGroupPolicy for the group of disks to stop. This may be a full or partial URL, such as: - https://www.googleapis.com/compute/v1/projects/project/regions/region /resourcePolicies/resourcePolicy - projects/project/regions/region/resourcePolicies/resourcePolicy - regions/region/resourcePolicies/resourcePolicy + * + * Generated from protobuf field optional string resource_policy = 159240835; + */ + protected $resource_policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $resource_policy + * The URL of the DiskConsistencyGroupPolicy for the group of disks to stop. This may be a full or partial URL, such as: - https://www.googleapis.com/compute/v1/projects/project/regions/region /resourcePolicies/resourcePolicy - projects/project/regions/region/resourcePolicies/resourcePolicy - regions/region/resourcePolicies/resourcePolicy + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The URL of the DiskConsistencyGroupPolicy for the group of disks to stop. This may be a full or partial URL, such as: - https://www.googleapis.com/compute/v1/projects/project/regions/region /resourcePolicies/resourcePolicy - projects/project/regions/region/resourcePolicies/resourcePolicy - regions/region/resourcePolicies/resourcePolicy + * + * Generated from protobuf field optional string resource_policy = 159240835; + * @return string + */ + public function getResourcePolicy() + { + return isset($this->resource_policy) ? $this->resource_policy : ''; + } + + public function hasResourcePolicy() + { + return isset($this->resource_policy); + } + + public function clearResourcePolicy() + { + unset($this->resource_policy); + } + + /** + * The URL of the DiskConsistencyGroupPolicy for the group of disks to stop. This may be a full or partial URL, such as: - https://www.googleapis.com/compute/v1/projects/project/regions/region /resourcePolicies/resourcePolicy - projects/project/regions/region/resourcePolicies/resourcePolicy - regions/region/resourcePolicies/resourcePolicy + * + * Generated from protobuf field optional string resource_policy = 159240835; + * @param string $var + * @return $this + */ + public function setResourcePolicy($var) + { + GPBUtil::checkString($var, True); + $this->resource_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisplayDevice.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisplayDevice.php new file mode 100644 index 000000000000..caaac6dfef3b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DisplayDevice.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.DisplayDevice + */ +class DisplayDevice extends \Google\Protobuf\Internal\Message +{ + /** + * Defines whether the instance has Display enabled. + * + * Generated from protobuf field optional bool enable_display = 14266886; + */ + protected $enable_display = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_display + * Defines whether the instance has Display enabled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Defines whether the instance has Display enabled. + * + * Generated from protobuf field optional bool enable_display = 14266886; + * @return bool + */ + public function getEnableDisplay() + { + return isset($this->enable_display) ? $this->enable_display : false; + } + + public function hasEnableDisplay() + { + return isset($this->enable_display); + } + + public function clearEnableDisplay() + { + unset($this->enable_display); + } + + /** + * Defines whether the instance has Display enabled. + * + * Generated from protobuf field optional bool enable_display = 14266886; + * @param bool $var + * @return $this + */ + public function setEnableDisplay($var) + { + GPBUtil::checkBool($var); + $this->enable_display = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DistributionPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DistributionPolicy.php new file mode 100644 index 000000000000..cd5bdd981794 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DistributionPolicy.php @@ -0,0 +1,114 @@ +google.cloud.compute.v1.DistributionPolicy + */ +class DistributionPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * The distribution shape to which the group converges either proactively or on resize events (depending on the value set in updatePolicy.instanceRedistributionType). + * Check the TargetShape enum for the list of possible values. + * + * Generated from protobuf field optional string target_shape = 338621299; + */ + protected $target_shape = null; + /** + * Zones where the regional managed instance group will create and manage its instances. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.DistributionPolicyZoneConfiguration zones = 116085319; + */ + private $zones; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $target_shape + * The distribution shape to which the group converges either proactively or on resize events (depending on the value set in updatePolicy.instanceRedistributionType). + * Check the TargetShape enum for the list of possible values. + * @type array<\Google\Cloud\Compute\V1\DistributionPolicyZoneConfiguration>|\Google\Protobuf\Internal\RepeatedField $zones + * Zones where the regional managed instance group will create and manage its instances. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The distribution shape to which the group converges either proactively or on resize events (depending on the value set in updatePolicy.instanceRedistributionType). + * Check the TargetShape enum for the list of possible values. + * + * Generated from protobuf field optional string target_shape = 338621299; + * @return string + */ + public function getTargetShape() + { + return isset($this->target_shape) ? $this->target_shape : ''; + } + + public function hasTargetShape() + { + return isset($this->target_shape); + } + + public function clearTargetShape() + { + unset($this->target_shape); + } + + /** + * The distribution shape to which the group converges either proactively or on resize events (depending on the value set in updatePolicy.instanceRedistributionType). + * Check the TargetShape enum for the list of possible values. + * + * Generated from protobuf field optional string target_shape = 338621299; + * @param string $var + * @return $this + */ + public function setTargetShape($var) + { + GPBUtil::checkString($var, True); + $this->target_shape = $var; + + return $this; + } + + /** + * Zones where the regional managed instance group will create and manage its instances. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.DistributionPolicyZoneConfiguration zones = 116085319; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getZones() + { + return $this->zones; + } + + /** + * Zones where the regional managed instance group will create and manage its instances. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.DistributionPolicyZoneConfiguration zones = 116085319; + * @param array<\Google\Cloud\Compute\V1\DistributionPolicyZoneConfiguration>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setZones($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\DistributionPolicyZoneConfiguration::class); + $this->zones = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DistributionPolicy/TargetShape.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DistributionPolicy/TargetShape.php new file mode 100644 index 000000000000..86389f722b75 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DistributionPolicy/TargetShape.php @@ -0,0 +1,78 @@ +google.cloud.compute.v1.DistributionPolicy.TargetShape + */ +class TargetShape +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TARGET_SHAPE = 0; + */ + const UNDEFINED_TARGET_SHAPE = 0; + /** + * The group picks zones for creating VM instances to fulfill the requested number of VMs within present resource constraints and to maximize utilization of unused zonal reservations. Recommended for batch workloads that do not require high availability. + * + * Generated from protobuf enum ANY = 64972; + */ + const ANY = 64972; + /** + * The group creates all VM instances within a single zone. The zone is selected based on the present resource constraints and to maximize utilization of unused zonal reservations. Recommended for batch workloads with heavy interprocess communication. + * + * Generated from protobuf enum ANY_SINGLE_ZONE = 61100880; + */ + const ANY_SINGLE_ZONE = 61100880; + /** + * The group prioritizes acquisition of resources, scheduling VMs in zones where resources are available while distributing VMs as evenly as possible across selected zones to minimize the impact of zonal failure. Recommended for highly available serving workloads. + * + * Generated from protobuf enum BALANCED = 468409608; + */ + const BALANCED = 468409608; + /** + * The group schedules VM instance creation and deletion to achieve and maintain an even number of managed instances across the selected zones. The distribution is even when the number of managed instances does not differ by more than 1 between any two zones. Recommended for highly available serving workloads. + * + * Generated from protobuf enum EVEN = 2140442; + */ + const EVEN = 2140442; + + private static $valueToName = [ + self::UNDEFINED_TARGET_SHAPE => 'UNDEFINED_TARGET_SHAPE', + self::ANY => 'ANY', + self::ANY_SINGLE_ZONE => 'ANY_SINGLE_ZONE', + self::BALANCED => 'BALANCED', + self::EVEN => 'EVEN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TargetShape::class, \Google\Cloud\Compute\V1\DistributionPolicy_TargetShape::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DistributionPolicyZoneConfiguration.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DistributionPolicyZoneConfiguration.php new file mode 100644 index 000000000000..377fcfecd7fc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/DistributionPolicyZoneConfiguration.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.DistributionPolicyZoneConfiguration + */ +class DistributionPolicyZoneConfiguration extends \Google\Protobuf\Internal\Message +{ + /** + * The URL of the zone. The zone must exist in the region where the managed instance group is located. + * + * Generated from protobuf field optional string zone = 3744684; + */ + protected $zone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $zone + * The URL of the zone. The zone must exist in the region where the managed instance group is located. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The URL of the zone. The zone must exist in the region where the managed instance group is located. + * + * Generated from protobuf field optional string zone = 3744684; + * @return string + */ + public function getZone() + { + return isset($this->zone) ? $this->zone : ''; + } + + public function hasZone() + { + return isset($this->zone); + } + + public function clearZone() + { + unset($this->zone); + } + + /** + * The URL of the zone. The zone must exist in the region where the managed instance group is located. + * + * Generated from protobuf field optional string zone = 3744684; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Duration.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Duration.php new file mode 100644 index 000000000000..fb27945fa449 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Duration.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.Duration + */ +class Duration extends \Google\Protobuf\Internal\Message +{ + /** + * Span of time that's a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 `seconds` field and a positive `nanos` field. Must be from 0 to 999,999,999 inclusive. + * + * Generated from protobuf field optional int32 nanos = 104586303; + */ + protected $nanos = null; + /** + * Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + * + * Generated from protobuf field optional int64 seconds = 359484031; + */ + protected $seconds = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $nanos + * Span of time that's a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 `seconds` field and a positive `nanos` field. Must be from 0 to 999,999,999 inclusive. + * @type int|string $seconds + * Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Span of time that's a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 `seconds` field and a positive `nanos` field. Must be from 0 to 999,999,999 inclusive. + * + * Generated from protobuf field optional int32 nanos = 104586303; + * @return int + */ + public function getNanos() + { + return isset($this->nanos) ? $this->nanos : 0; + } + + public function hasNanos() + { + return isset($this->nanos); + } + + public function clearNanos() + { + unset($this->nanos); + } + + /** + * Span of time that's a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 `seconds` field and a positive `nanos` field. Must be from 0 to 999,999,999 inclusive. + * + * Generated from protobuf field optional int32 nanos = 104586303; + * @param int $var + * @return $this + */ + public function setNanos($var) + { + GPBUtil::checkInt32($var); + $this->nanos = $var; + + return $this; + } + + /** + * Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + * + * Generated from protobuf field optional int64 seconds = 359484031; + * @return int|string + */ + public function getSeconds() + { + return isset($this->seconds) ? $this->seconds : 0; + } + + public function hasSeconds() + { + return isset($this->seconds); + } + + public function clearSeconds() + { + unset($this->seconds); + } + + /** + * Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + * + * Generated from protobuf field optional int64 seconds = 359484031; + * @param int|string $var + * @return $this + */ + public function setSeconds($var) + { + GPBUtil::checkInt64($var); + $this->seconds = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/EnableXpnHostProjectRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/EnableXpnHostProjectRequest.php new file mode 100644 index 000000000000..2a3447ae1659 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/EnableXpnHostProjectRequest.php @@ -0,0 +1,124 @@ +google.cloud.compute.v1.EnableXpnHostProjectRequest + */ +class EnableXpnHostProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\EnableXpnHostProjectRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/EnableXpnResourceProjectRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/EnableXpnResourceProjectRequest.php new file mode 100644 index 000000000000..79f4c2241d77 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/EnableXpnResourceProjectRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.EnableXpnResourceProjectRequest + */ +class EnableXpnResourceProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ProjectsEnableXpnResourceRequest projects_enable_xpn_resource_request_resource = 421980207 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $projects_enable_xpn_resource_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\ProjectsEnableXpnResourceRequest $projectsEnableXpnResourceRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\EnableXpnResourceProjectRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\ProjectsEnableXpnResourceRequest $projectsEnableXpnResourceRequestResource): self + { + return (new self()) + ->setProject($project) + ->setProjectsEnableXpnResourceRequestResource($projectsEnableXpnResourceRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type \Google\Cloud\Compute\V1\ProjectsEnableXpnResourceRequest $projects_enable_xpn_resource_request_resource + * The body resource 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); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ProjectsEnableXpnResourceRequest projects_enable_xpn_resource_request_resource = 421980207 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ProjectsEnableXpnResourceRequest|null + */ + public function getProjectsEnableXpnResourceRequestResource() + { + return $this->projects_enable_xpn_resource_request_resource; + } + + public function hasProjectsEnableXpnResourceRequestResource() + { + return isset($this->projects_enable_xpn_resource_request_resource); + } + + public function clearProjectsEnableXpnResourceRequestResource() + { + unset($this->projects_enable_xpn_resource_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ProjectsEnableXpnResourceRequest projects_enable_xpn_resource_request_resource = 421980207 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ProjectsEnableXpnResourceRequest $var + * @return $this + */ + public function setProjectsEnableXpnResourceRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ProjectsEnableXpnResourceRequest::class); + $this->projects_enable_xpn_resource_request_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Error.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Error.php new file mode 100644 index 000000000000..8f502ef40cbf --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Error.php @@ -0,0 +1,67 @@ +google.cloud.compute.v1.Error + */ +class Error extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The array of errors encountered while processing this operation. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Errors errors = 315977579; + */ + private $errors; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\Errors>|\Google\Protobuf\Internal\RepeatedField $errors + * [Output Only] The array of errors encountered while processing this operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The array of errors encountered while processing this operation. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Errors errors = 315977579; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getErrors() + { + return $this->errors; + } + + /** + * [Output Only] The array of errors encountered while processing this operation. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Errors errors = 315977579; + * @param array<\Google\Cloud\Compute\V1\Errors>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Errors::class); + $this->errors = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ErrorDetails.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ErrorDetails.php new file mode 100644 index 000000000000..1ca52087a048 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ErrorDetails.php @@ -0,0 +1,180 @@ +google.cloud.compute.v1.ErrorDetails + */ +class ErrorDetails extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ErrorInfo error_info = 25251973; + */ + protected $error_info = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.Help help = 3198785; + */ + protected $help = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.LocalizedMessage localized_message = 404537155; + */ + protected $localized_message = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.QuotaExceededInfo quota_info = 93923861; + */ + protected $quota_info = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\ErrorInfo $error_info + * @type \Google\Cloud\Compute\V1\Help $help + * @type \Google\Cloud\Compute\V1\LocalizedMessage $localized_message + * @type \Google\Cloud\Compute\V1\QuotaExceededInfo $quota_info + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ErrorInfo error_info = 25251973; + * @return \Google\Cloud\Compute\V1\ErrorInfo|null + */ + public function getErrorInfo() + { + return $this->error_info; + } + + public function hasErrorInfo() + { + return isset($this->error_info); + } + + public function clearErrorInfo() + { + unset($this->error_info); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ErrorInfo error_info = 25251973; + * @param \Google\Cloud\Compute\V1\ErrorInfo $var + * @return $this + */ + public function setErrorInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ErrorInfo::class); + $this->error_info = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.Help help = 3198785; + * @return \Google\Cloud\Compute\V1\Help|null + */ + public function getHelp() + { + return $this->help; + } + + public function hasHelp() + { + return isset($this->help); + } + + public function clearHelp() + { + unset($this->help); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.Help help = 3198785; + * @param \Google\Cloud\Compute\V1\Help $var + * @return $this + */ + public function setHelp($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Help::class); + $this->help = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.LocalizedMessage localized_message = 404537155; + * @return \Google\Cloud\Compute\V1\LocalizedMessage|null + */ + public function getLocalizedMessage() + { + return $this->localized_message; + } + + public function hasLocalizedMessage() + { + return isset($this->localized_message); + } + + public function clearLocalizedMessage() + { + unset($this->localized_message); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.LocalizedMessage localized_message = 404537155; + * @param \Google\Cloud\Compute\V1\LocalizedMessage $var + * @return $this + */ + public function setLocalizedMessage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\LocalizedMessage::class); + $this->localized_message = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.QuotaExceededInfo quota_info = 93923861; + * @return \Google\Cloud\Compute\V1\QuotaExceededInfo|null + */ + public function getQuotaInfo() + { + return $this->quota_info; + } + + public function hasQuotaInfo() + { + return isset($this->quota_info); + } + + public function clearQuotaInfo() + { + unset($this->quota_info); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.QuotaExceededInfo quota_info = 93923861; + * @param \Google\Cloud\Compute\V1\QuotaExceededInfo $var + * @return $this + */ + public function setQuotaInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\QuotaExceededInfo::class); + $this->quota_info = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ErrorInfo.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ErrorInfo.php new file mode 100644 index 000000000000..f2f62ce1b882 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ErrorInfo.php @@ -0,0 +1,155 @@ +google.cloud.compute.v1.ErrorInfo + */ +class ErrorInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com". + * + * Generated from protobuf field optional string domain = 284415172; + */ + protected $domain = null; + /** + * Additional structured details about this error. Keys must match /a-z+/ but should ideally be lowerCamelCase. Also they must be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request. + * + * Generated from protobuf field map metadatas = 8514340; + */ + private $metadatas; + /** + * The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match a regular expression of `A-Z+[A-Z0-9]`, which represents UPPER_SNAKE_CASE. + * + * Generated from protobuf field optional string reason = 138777156; + */ + protected $reason = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $domain + * The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com". + * @type array|\Google\Protobuf\Internal\MapField $metadatas + * Additional structured details about this error. Keys must match /a-z+/ but should ideally be lowerCamelCase. Also they must be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request. + * @type string $reason + * The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match a regular expression of `A-Z+[A-Z0-9]`, which represents UPPER_SNAKE_CASE. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com". + * + * Generated from protobuf field optional string domain = 284415172; + * @return string + */ + public function getDomain() + { + return isset($this->domain) ? $this->domain : ''; + } + + public function hasDomain() + { + return isset($this->domain); + } + + public function clearDomain() + { + unset($this->domain); + } + + /** + * The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com". + * + * Generated from protobuf field optional string domain = 284415172; + * @param string $var + * @return $this + */ + public function setDomain($var) + { + GPBUtil::checkString($var, True); + $this->domain = $var; + + return $this; + } + + /** + * Additional structured details about this error. Keys must match /a-z+/ but should ideally be lowerCamelCase. Also they must be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request. + * + * Generated from protobuf field map metadatas = 8514340; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadatas() + { + return $this->metadatas; + } + + /** + * Additional structured details about this error. Keys must match /a-z+/ but should ideally be lowerCamelCase. Also they must be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request. + * + * Generated from protobuf field map metadatas = 8514340; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadatas($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadatas = $arr; + + return $this; + } + + /** + * The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match a regular expression of `A-Z+[A-Z0-9]`, which represents UPPER_SNAKE_CASE. + * + * Generated from protobuf field optional string reason = 138777156; + * @return string + */ + public function getReason() + { + return isset($this->reason) ? $this->reason : ''; + } + + public function hasReason() + { + return isset($this->reason); + } + + public function clearReason() + { + unset($this->reason); + } + + /** + * The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match a regular expression of `A-Z+[A-Z0-9]`, which represents UPPER_SNAKE_CASE. + * + * Generated from protobuf field optional string reason = 138777156; + * @param string $var + * @return $this + */ + public function setReason($var) + { + GPBUtil::checkString($var, True); + $this->reason = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Errors.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Errors.php new file mode 100644 index 000000000000..232efc194aeb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Errors.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.Errors + */ +class Errors extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The error type identifier for this error. + * + * Generated from protobuf field optional string code = 3059181; + */ + protected $code = null; + /** + * [Output Only] An optional list of messages that contain the error details. There is a set of defined message types to use for providing details.The syntax depends on the error code. For example, QuotaExceededInfo will have details when the error code is QUOTA_EXCEEDED. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ErrorDetails error_details = 274653963; + */ + private $error_details; + /** + * [Output Only] Indicates the field in the request that caused the error. This property is optional. + * + * Generated from protobuf field optional string location = 290430901; + */ + protected $location = null; + /** + * [Output Only] An optional, human-readable error message. + * + * Generated from protobuf field optional string message = 418054151; + */ + protected $message = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $code + * [Output Only] The error type identifier for this error. + * @type array<\Google\Cloud\Compute\V1\ErrorDetails>|\Google\Protobuf\Internal\RepeatedField $error_details + * [Output Only] An optional list of messages that contain the error details. There is a set of defined message types to use for providing details.The syntax depends on the error code. For example, QuotaExceededInfo will have details when the error code is QUOTA_EXCEEDED. + * @type string $location + * [Output Only] Indicates the field in the request that caused the error. This property is optional. + * @type string $message + * [Output Only] An optional, human-readable error message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The error type identifier for this error. + * + * Generated from protobuf field optional string code = 3059181; + * @return string + */ + public function getCode() + { + return isset($this->code) ? $this->code : ''; + } + + public function hasCode() + { + return isset($this->code); + } + + public function clearCode() + { + unset($this->code); + } + + /** + * [Output Only] The error type identifier for this error. + * + * Generated from protobuf field optional string code = 3059181; + * @param string $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkString($var, True); + $this->code = $var; + + return $this; + } + + /** + * [Output Only] An optional list of messages that contain the error details. There is a set of defined message types to use for providing details.The syntax depends on the error code. For example, QuotaExceededInfo will have details when the error code is QUOTA_EXCEEDED. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ErrorDetails error_details = 274653963; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getErrorDetails() + { + return $this->error_details; + } + + /** + * [Output Only] An optional list of messages that contain the error details. There is a set of defined message types to use for providing details.The syntax depends on the error code. For example, QuotaExceededInfo will have details when the error code is QUOTA_EXCEEDED. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ErrorDetails error_details = 274653963; + * @param array<\Google\Cloud\Compute\V1\ErrorDetails>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setErrorDetails($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ErrorDetails::class); + $this->error_details = $arr; + + return $this; + } + + /** + * [Output Only] Indicates the field in the request that caused the error. This property is optional. + * + * Generated from protobuf field optional string location = 290430901; + * @return string + */ + public function getLocation() + { + return isset($this->location) ? $this->location : ''; + } + + public function hasLocation() + { + return isset($this->location); + } + + public function clearLocation() + { + unset($this->location); + } + + /** + * [Output Only] Indicates the field in the request that caused the error. This property is optional. + * + * Generated from protobuf field optional string location = 290430901; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * [Output Only] An optional, human-readable error message. + * + * Generated from protobuf field optional string message = 418054151; + * @return string + */ + public function getMessage() + { + return isset($this->message) ? $this->message : ''; + } + + public function hasMessage() + { + return isset($this->message); + } + + public function clearMessage() + { + unset($this->message); + } + + /** + * [Output Only] An optional, human-readable error message. + * + * Generated from protobuf field optional string message = 418054151; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExchangedPeeringRoute.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExchangedPeeringRoute.php new file mode 100644 index 000000000000..e74aeec28197 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExchangedPeeringRoute.php @@ -0,0 +1,256 @@ +google.cloud.compute.v1.ExchangedPeeringRoute + */ +class ExchangedPeeringRoute extends \Google\Protobuf\Internal\Message +{ + /** + * The destination range of the route. + * + * Generated from protobuf field optional string dest_range = 381327712; + */ + protected $dest_range = null; + /** + * True if the peering route has been imported from a peer. The actual import happens if the field networkPeering.importCustomRoutes is true for this network, and networkPeering.exportCustomRoutes is true for the peer network, and the import does not result in a route conflict. + * + * Generated from protobuf field optional bool imported = 114502404; + */ + protected $imported = null; + /** + * The region of peering route next hop, only applies to dynamic routes. + * + * Generated from protobuf field optional string next_hop_region = 122577014; + */ + protected $next_hop_region = null; + /** + * The priority of the peering route. + * + * Generated from protobuf field optional uint32 priority = 445151652; + */ + protected $priority = null; + /** + * The type of the peering route. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $dest_range + * The destination range of the route. + * @type bool $imported + * True if the peering route has been imported from a peer. The actual import happens if the field networkPeering.importCustomRoutes is true for this network, and networkPeering.exportCustomRoutes is true for the peer network, and the import does not result in a route conflict. + * @type string $next_hop_region + * The region of peering route next hop, only applies to dynamic routes. + * @type int $priority + * The priority of the peering route. + * @type string $type + * The type of the peering route. + * Check the Type enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The destination range of the route. + * + * Generated from protobuf field optional string dest_range = 381327712; + * @return string + */ + public function getDestRange() + { + return isset($this->dest_range) ? $this->dest_range : ''; + } + + public function hasDestRange() + { + return isset($this->dest_range); + } + + public function clearDestRange() + { + unset($this->dest_range); + } + + /** + * The destination range of the route. + * + * Generated from protobuf field optional string dest_range = 381327712; + * @param string $var + * @return $this + */ + public function setDestRange($var) + { + GPBUtil::checkString($var, True); + $this->dest_range = $var; + + return $this; + } + + /** + * True if the peering route has been imported from a peer. The actual import happens if the field networkPeering.importCustomRoutes is true for this network, and networkPeering.exportCustomRoutes is true for the peer network, and the import does not result in a route conflict. + * + * Generated from protobuf field optional bool imported = 114502404; + * @return bool + */ + public function getImported() + { + return isset($this->imported) ? $this->imported : false; + } + + public function hasImported() + { + return isset($this->imported); + } + + public function clearImported() + { + unset($this->imported); + } + + /** + * True if the peering route has been imported from a peer. The actual import happens if the field networkPeering.importCustomRoutes is true for this network, and networkPeering.exportCustomRoutes is true for the peer network, and the import does not result in a route conflict. + * + * Generated from protobuf field optional bool imported = 114502404; + * @param bool $var + * @return $this + */ + public function setImported($var) + { + GPBUtil::checkBool($var); + $this->imported = $var; + + return $this; + } + + /** + * The region of peering route next hop, only applies to dynamic routes. + * + * Generated from protobuf field optional string next_hop_region = 122577014; + * @return string + */ + public function getNextHopRegion() + { + return isset($this->next_hop_region) ? $this->next_hop_region : ''; + } + + public function hasNextHopRegion() + { + return isset($this->next_hop_region); + } + + public function clearNextHopRegion() + { + unset($this->next_hop_region); + } + + /** + * The region of peering route next hop, only applies to dynamic routes. + * + * Generated from protobuf field optional string next_hop_region = 122577014; + * @param string $var + * @return $this + */ + public function setNextHopRegion($var) + { + GPBUtil::checkString($var, True); + $this->next_hop_region = $var; + + return $this; + } + + /** + * The priority of the peering route. + * + * Generated from protobuf field optional uint32 priority = 445151652; + * @return int + */ + public function getPriority() + { + return isset($this->priority) ? $this->priority : 0; + } + + public function hasPriority() + { + return isset($this->priority); + } + + public function clearPriority() + { + unset($this->priority); + } + + /** + * The priority of the peering route. + * + * Generated from protobuf field optional uint32 priority = 445151652; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkUint32($var); + $this->priority = $var; + + return $this; + } + + /** + * The type of the peering route. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * The type of the peering route. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExchangedPeeringRoute/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExchangedPeeringRoute/Type.php new file mode 100644 index 000000000000..edb7eb2c0f4f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExchangedPeeringRoute/Type.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.ExchangedPeeringRoute.Type + */ +class Type +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TYPE = 0; + */ + const UNDEFINED_TYPE = 0; + /** + * For routes exported from local network. + * + * Generated from protobuf enum DYNAMIC_PEERING_ROUTE = 469794858; + */ + const DYNAMIC_PEERING_ROUTE = 469794858; + /** + * The peering route. + * + * Generated from protobuf enum STATIC_PEERING_ROUTE = 473407545; + */ + const STATIC_PEERING_ROUTE = 473407545; + /** + * The peering route corresponding to subnetwork range. + * + * Generated from protobuf enum SUBNET_PEERING_ROUTE = 465782504; + */ + const SUBNET_PEERING_ROUTE = 465782504; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::DYNAMIC_PEERING_ROUTE => 'DYNAMIC_PEERING_ROUTE', + self::STATIC_PEERING_ROUTE => 'STATIC_PEERING_ROUTE', + self::SUBNET_PEERING_ROUTE => 'SUBNET_PEERING_ROUTE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Compute\V1\ExchangedPeeringRoute_Type::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExchangedPeeringRoutesList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExchangedPeeringRoutesList.php new file mode 100644 index 000000000000..c5f3f54170a3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExchangedPeeringRoutesList.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.ExchangedPeeringRoutesList + */ +class ExchangedPeeringRoutesList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of ExchangedPeeringRoute resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ExchangedPeeringRoute items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#exchangedPeeringRoutesList for exchanged peering routes lists. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\ExchangedPeeringRoute>|\Google\Protobuf\Internal\RepeatedField $items + * A list of ExchangedPeeringRoute resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#exchangedPeeringRoutesList for exchanged peering routes lists. + * @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 ExchangedPeeringRoute resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ExchangedPeeringRoute items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of ExchangedPeeringRoute resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ExchangedPeeringRoute items = 100526016; + * @param array<\Google\Cloud\Compute\V1\ExchangedPeeringRoute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ExchangedPeeringRoute::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#exchangedPeeringRoutesList for exchanged peering routes lists. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#exchangedPeeringRoutesList for exchanged peering routes lists. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExpandIpCidrRangeSubnetworkRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExpandIpCidrRangeSubnetworkRequest.php new file mode 100644 index 000000000000..9ffde28fe313 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExpandIpCidrRangeSubnetworkRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest + */ +class ExpandIpCidrRangeSubnetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the Subnetwork resource to update. + * + * Generated from protobuf field string subnetwork = 307827694 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $subnetwork = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest subnetworks_expand_ip_cidr_range_request_resource = 477014110 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $subnetworks_expand_ip_cidr_range_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $subnetwork Name of the Subnetwork resource to update. + * @param \Google\Cloud\Compute\V1\SubnetworksExpandIpCidrRangeRequest $subnetworksExpandIpCidrRangeRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\ExpandIpCidrRangeSubnetworkRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $subnetwork, \Google\Cloud\Compute\V1\SubnetworksExpandIpCidrRangeRequest $subnetworksExpandIpCidrRangeRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork) + ->setSubnetworksExpandIpCidrRangeRequestResource($subnetworksExpandIpCidrRangeRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 $subnetwork + * Name of the Subnetwork resource to update. + * @type \Google\Cloud\Compute\V1\SubnetworksExpandIpCidrRangeRequest $subnetworks_expand_ip_cidr_range_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the Subnetwork resource to update. + * + * Generated from protobuf field string subnetwork = 307827694 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSubnetwork() + { + return $this->subnetwork; + } + + /** + * Name of the Subnetwork resource to update. + * + * Generated from protobuf field string subnetwork = 307827694 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest subnetworks_expand_ip_cidr_range_request_resource = 477014110 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SubnetworksExpandIpCidrRangeRequest|null + */ + public function getSubnetworksExpandIpCidrRangeRequestResource() + { + return $this->subnetworks_expand_ip_cidr_range_request_resource; + } + + public function hasSubnetworksExpandIpCidrRangeRequestResource() + { + return isset($this->subnetworks_expand_ip_cidr_range_request_resource); + } + + public function clearSubnetworksExpandIpCidrRangeRequestResource() + { + unset($this->subnetworks_expand_ip_cidr_range_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest subnetworks_expand_ip_cidr_range_request_resource = 477014110 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SubnetworksExpandIpCidrRangeRequest $var + * @return $this + */ + public function setSubnetworksExpandIpCidrRangeRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SubnetworksExpandIpCidrRangeRequest::class); + $this->subnetworks_expand_ip_cidr_range_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Expr.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Expr.php new file mode 100644 index 000000000000..c591d666993f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Expr.php @@ -0,0 +1,209 @@ +google.cloud.compute.v1.Expr + */ +class Expr extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Textual representation of an expression in Common Expression Language syntax. + * + * Generated from protobuf field optional string expression = 352031384; + */ + protected $expression = null; + /** + * Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file. + * + * Generated from protobuf field optional string location = 290430901; + */ + protected $location = null; + /** + * Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression. + * + * Generated from protobuf field optional string title = 110371416; + */ + protected $title = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $description + * Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. + * @type string $expression + * Textual representation of an expression in Common Expression Language syntax. + * @type string $location + * Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file. + * @type string $title + * Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Textual representation of an expression in Common Expression Language syntax. + * + * Generated from protobuf field optional string expression = 352031384; + * @return string + */ + public function getExpression() + { + return isset($this->expression) ? $this->expression : ''; + } + + public function hasExpression() + { + return isset($this->expression); + } + + public function clearExpression() + { + unset($this->expression); + } + + /** + * Textual representation of an expression in Common Expression Language syntax. + * + * Generated from protobuf field optional string expression = 352031384; + * @param string $var + * @return $this + */ + public function setExpression($var) + { + GPBUtil::checkString($var, True); + $this->expression = $var; + + return $this; + } + + /** + * Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file. + * + * Generated from protobuf field optional string location = 290430901; + * @return string + */ + public function getLocation() + { + return isset($this->location) ? $this->location : ''; + } + + public function hasLocation() + { + return isset($this->location); + } + + public function clearLocation() + { + unset($this->location); + } + + /** + * Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file. + * + * Generated from protobuf field optional string location = 290430901; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression. + * + * Generated from protobuf field optional string title = 110371416; + * @return string + */ + public function getTitle() + { + return isset($this->title) ? $this->title : ''; + } + + public function hasTitle() + { + return isset($this->title); + } + + public function clearTitle() + { + unset($this->title); + } + + /** + * Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression. + * + * Generated from protobuf field optional string title = 110371416; + * @param string $var + * @return $this + */ + public function setTitle($var) + { + GPBUtil::checkString($var, True); + $this->title = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExternalVpnGateway.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExternalVpnGateway.php new file mode 100644 index 000000000000..5e7b0d50ee33 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExternalVpnGateway.php @@ -0,0 +1,457 @@ +google.cloud.compute.v1.ExternalVpnGateway + */ +class ExternalVpnGateway extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * A list of interfaces for this external VPN gateway. If your peer-side gateway is an on-premises gateway and non-AWS cloud providers' gateway, at most two interfaces can be provided for an external VPN gateway. If your peer side is an AWS virtual private gateway, four interfaces should be provided for an external VPN gateway. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ExternalVpnGatewayInterface interfaces = 12073562; + */ + private $interfaces; + /** + * [Output Only] Type of the resource. Always compute#externalVpnGateway for externalVpnGateways. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * A fingerprint for the labels being applied to this ExternalVpnGateway, 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 ExternalVpnGateway. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + */ + protected $label_fingerprint = null; + /** + * 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. + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Indicates the user-supplied redundancy type of this external VPN gateway. + * Check the RedundancyType enum for the list of possible values. + * + * Generated from protobuf field optional string redundancy_type = 271443740; + */ + protected $redundancy_type = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type array<\Google\Cloud\Compute\V1\ExternalVpnGatewayInterface>|\Google\Protobuf\Internal\RepeatedField $interfaces + * A list of interfaces for this external VPN gateway. If your peer-side gateway is an on-premises gateway and non-AWS cloud providers' gateway, at most two interfaces can be provided for an external VPN gateway. If your peer side is an AWS virtual private gateway, four interfaces should be provided for an external VPN gateway. + * @type string $kind + * [Output Only] Type of the resource. Always compute#externalVpnGateway for externalVpnGateways. + * @type string $label_fingerprint + * A fingerprint for the labels being applied to this ExternalVpnGateway, 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 ExternalVpnGateway. + * @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 + * 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 string $redundancy_type + * Indicates the user-supplied redundancy type of this external VPN gateway. + * Check the RedundancyType enum for the list of possible values. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * A list of interfaces for this external VPN gateway. If your peer-side gateway is an on-premises gateway and non-AWS cloud providers' gateway, at most two interfaces can be provided for an external VPN gateway. If your peer side is an AWS virtual private gateway, four interfaces should be provided for an external VPN gateway. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ExternalVpnGatewayInterface interfaces = 12073562; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInterfaces() + { + return $this->interfaces; + } + + /** + * A list of interfaces for this external VPN gateway. If your peer-side gateway is an on-premises gateway and non-AWS cloud providers' gateway, at most two interfaces can be provided for an external VPN gateway. If your peer side is an AWS virtual private gateway, four interfaces should be provided for an external VPN gateway. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ExternalVpnGatewayInterface interfaces = 12073562; + * @param array<\Google\Cloud\Compute\V1\ExternalVpnGatewayInterface>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInterfaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ExternalVpnGatewayInterface::class); + $this->interfaces = $arr; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#externalVpnGateway for externalVpnGateways. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#externalVpnGateway for externalVpnGateways. + * + * 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; + } + + /** + * A fingerprint for the labels being applied to this ExternalVpnGateway, 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 ExternalVpnGateway. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @return string + */ + public function getLabelFingerprint() + { + return isset($this->label_fingerprint) ? $this->label_fingerprint : ''; + } + + public function hasLabelFingerprint() + { + return isset($this->label_fingerprint); + } + + public function clearLabelFingerprint() + { + unset($this->label_fingerprint); + } + + /** + * A fingerprint for the labels being applied to this ExternalVpnGateway, 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 ExternalVpnGateway. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @param string $var + * @return $this + */ + public function setLabelFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->label_fingerprint = $var; + + return $this; + } + + /** + * 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. + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->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. + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * Indicates the user-supplied redundancy type of this external VPN gateway. + * Check the RedundancyType enum for the list of possible values. + * + * Generated from protobuf field optional string redundancy_type = 271443740; + * @return string + */ + public function getRedundancyType() + { + return isset($this->redundancy_type) ? $this->redundancy_type : ''; + } + + public function hasRedundancyType() + { + return isset($this->redundancy_type); + } + + public function clearRedundancyType() + { + unset($this->redundancy_type); + } + + /** + * Indicates the user-supplied redundancy type of this external VPN gateway. + * Check the RedundancyType enum for the list of possible values. + * + * Generated from protobuf field optional string redundancy_type = 271443740; + * @param string $var + * @return $this + */ + public function setRedundancyType($var) + { + GPBUtil::checkString($var, True); + $this->redundancy_type = $var; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExternalVpnGateway/RedundancyType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExternalVpnGateway/RedundancyType.php new file mode 100644 index 000000000000..87bb27d1676b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExternalVpnGateway/RedundancyType.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.ExternalVpnGateway.RedundancyType + */ +class RedundancyType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_REDUNDANCY_TYPE = 0; + */ + const UNDEFINED_REDUNDANCY_TYPE = 0; + /** + * The external VPN gateway has four public IP addresses; at the time of writing this API, the AWS virtual private gateway is an example which has four public IP addresses for high availability connections; there should be two VPN connections in the AWS virtual private gateway , each AWS VPN connection has two public IP addresses; please make sure to put two public IP addresses from one AWS VPN connection into interfaces 0 and 1 of this external VPN gateway, and put the other two public IP addresses from another AWS VPN connection into interfaces 2 and 3 of this external VPN gateway. When displaying highly available configuration status for the VPN tunnels connected to FOUR_IPS_REDUNDANCY external VPN gateway, Google will always detect whether interfaces 0 and 1 are connected on one interface of HA Cloud VPN gateway, and detect whether interfaces 2 and 3 are connected to another interface of the HA Cloud VPN gateway. + * + * Generated from protobuf enum FOUR_IPS_REDUNDANCY = 520087913; + */ + const FOUR_IPS_REDUNDANCY = 520087913; + /** + * The external VPN gateway has only one public IP address which internally provide redundancy or failover. + * + * Generated from protobuf enum SINGLE_IP_INTERNALLY_REDUNDANT = 133914873; + */ + const SINGLE_IP_INTERNALLY_REDUNDANT = 133914873; + /** + * The external VPN gateway has two public IP addresses which are redundant with each other, the following two types of setup on your on-premises side would have this type of redundancy: (1) Two separate on-premises gateways, each with one public IP address, the two on-premises gateways are redundant with each other. (2) A single on-premise gateway with two public IP addresses that are redundant with eatch other. + * + * Generated from protobuf enum TWO_IPS_REDUNDANCY = 367049635; + */ + const TWO_IPS_REDUNDANCY = 367049635; + + private static $valueToName = [ + self::UNDEFINED_REDUNDANCY_TYPE => 'UNDEFINED_REDUNDANCY_TYPE', + self::FOUR_IPS_REDUNDANCY => 'FOUR_IPS_REDUNDANCY', + self::SINGLE_IP_INTERNALLY_REDUNDANT => 'SINGLE_IP_INTERNALLY_REDUNDANT', + self::TWO_IPS_REDUNDANCY => 'TWO_IPS_REDUNDANCY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RedundancyType::class, \Google\Cloud\Compute\V1\ExternalVpnGateway_RedundancyType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExternalVpnGatewayInterface.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExternalVpnGatewayInterface.php new file mode 100644 index 000000000000..be6f9b269d5e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExternalVpnGatewayInterface.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.ExternalVpnGatewayInterface + */ +class ExternalVpnGatewayInterface extends \Google\Protobuf\Internal\Message +{ + /** + * The numeric ID of this interface. The allowed input values for this id for different redundancy types of external VPN gateway: - SINGLE_IP_INTERNALLY_REDUNDANT - 0 - TWO_IPS_REDUNDANCY - 0, 1 - FOUR_IPS_REDUNDANCY - 0, 1, 2, 3 + * + * Generated from protobuf field optional uint32 id = 3355; + */ + protected $id = null; + /** + * IP address of the interface in the external VPN gateway. Only IPv4 is supported. This IP address can be either from your on-premise gateway or another Cloud provider's VPN gateway, it cannot be an IP address from Google Compute Engine. + * + * Generated from protobuf field optional string ip_address = 406272220; + */ + protected $ip_address = null; + /** + * IPv6 address of the interface in the external VPN gateway. This IPv6 address can be either from your on-premise gateway or another Cloud provider's VPN gateway, it cannot be an IP address from Google Compute Engine. Must specify an IPv6 address (not IPV4-mapped) using any format described in RFC 4291 (e.g. 2001:db8:0:0:2d9:51:0:0). The output format is RFC 5952 format (e.g. 2001:db8::2d9:51:0:0). + * + * Generated from protobuf field optional string ipv6_address = 341563804; + */ + protected $ipv6_address = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $id + * The numeric ID of this interface. The allowed input values for this id for different redundancy types of external VPN gateway: - SINGLE_IP_INTERNALLY_REDUNDANT - 0 - TWO_IPS_REDUNDANCY - 0, 1 - FOUR_IPS_REDUNDANCY - 0, 1, 2, 3 + * @type string $ip_address + * IP address of the interface in the external VPN gateway. Only IPv4 is supported. This IP address can be either from your on-premise gateway or another Cloud provider's VPN gateway, it cannot be an IP address from Google Compute Engine. + * @type string $ipv6_address + * IPv6 address of the interface in the external VPN gateway. This IPv6 address can be either from your on-premise gateway or another Cloud provider's VPN gateway, it cannot be an IP address from Google Compute Engine. Must specify an IPv6 address (not IPV4-mapped) using any format described in RFC 4291 (e.g. 2001:db8:0:0:2d9:51:0:0). The output format is RFC 5952 format (e.g. 2001:db8::2d9:51:0:0). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The numeric ID of this interface. The allowed input values for this id for different redundancy types of external VPN gateway: - SINGLE_IP_INTERNALLY_REDUNDANT - 0 - TWO_IPS_REDUNDANCY - 0, 1 - FOUR_IPS_REDUNDANCY - 0, 1, 2, 3 + * + * Generated from protobuf field optional uint32 id = 3355; + * @return int + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * The numeric ID of this interface. The allowed input values for this id for different redundancy types of external VPN gateway: - SINGLE_IP_INTERNALLY_REDUNDANT - 0 - TWO_IPS_REDUNDANCY - 0, 1 - FOUR_IPS_REDUNDANCY - 0, 1, 2, 3 + * + * Generated from protobuf field optional uint32 id = 3355; + * @param int $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint32($var); + $this->id = $var; + + return $this; + } + + /** + * IP address of the interface in the external VPN gateway. Only IPv4 is supported. This IP address can be either from your on-premise gateway or another Cloud provider's VPN gateway, it cannot be an IP address from Google Compute Engine. + * + * Generated from protobuf field optional string ip_address = 406272220; + * @return string + */ + public function getIpAddress() + { + return isset($this->ip_address) ? $this->ip_address : ''; + } + + public function hasIpAddress() + { + return isset($this->ip_address); + } + + public function clearIpAddress() + { + unset($this->ip_address); + } + + /** + * IP address of the interface in the external VPN gateway. Only IPv4 is supported. This IP address can be either from your on-premise gateway or another Cloud provider's VPN gateway, it cannot be an IP address from Google Compute Engine. + * + * Generated from protobuf field optional string ip_address = 406272220; + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + + /** + * IPv6 address of the interface in the external VPN gateway. This IPv6 address can be either from your on-premise gateway or another Cloud provider's VPN gateway, it cannot be an IP address from Google Compute Engine. Must specify an IPv6 address (not IPV4-mapped) using any format described in RFC 4291 (e.g. 2001:db8:0:0:2d9:51:0:0). The output format is RFC 5952 format (e.g. 2001:db8::2d9:51:0:0). + * + * Generated from protobuf field optional string ipv6_address = 341563804; + * @return string + */ + public function getIpv6Address() + { + return isset($this->ipv6_address) ? $this->ipv6_address : ''; + } + + public function hasIpv6Address() + { + return isset($this->ipv6_address); + } + + public function clearIpv6Address() + { + unset($this->ipv6_address); + } + + /** + * IPv6 address of the interface in the external VPN gateway. This IPv6 address can be either from your on-premise gateway or another Cloud provider's VPN gateway, it cannot be an IP address from Google Compute Engine. Must specify an IPv6 address (not IPV4-mapped) using any format described in RFC 4291 (e.g. 2001:db8:0:0:2d9:51:0:0). The output format is RFC 5952 format (e.g. 2001:db8::2d9:51:0:0). + * + * Generated from protobuf field optional string ipv6_address = 341563804; + * @param string $var + * @return $this + */ + public function setIpv6Address($var) + { + GPBUtil::checkString($var, True); + $this->ipv6_address = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExternalVpnGatewayList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExternalVpnGatewayList.php new file mode 100644 index 000000000000..04cd872b1a6b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ExternalVpnGatewayList.php @@ -0,0 +1,324 @@ +google.cloud.compute.v1.ExternalVpnGatewayList + */ +class ExternalVpnGatewayList extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string etag = 3123477; + */ + protected $etag = null; + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of ExternalVpnGateway resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ExternalVpnGateway items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#externalVpnGatewayList for lists of externalVpnGateways. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $etag + * @type string $id + * [Output Only] Unique identifier for the resource; defined by the server. + * @type array<\Google\Cloud\Compute\V1\ExternalVpnGateway>|\Google\Protobuf\Internal\RepeatedField $items + * A list of ExternalVpnGateway resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#externalVpnGatewayList for lists of externalVpnGateways. + * @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); + } + + /** + * Generated from protobuf field optional string etag = 3123477; + * @return string + */ + public function getEtag() + { + return isset($this->etag) ? $this->etag : ''; + } + + public function hasEtag() + { + return isset($this->etag); + } + + public function clearEtag() + { + unset($this->etag); + } + + /** + * Generated from protobuf field optional string etag = 3123477; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * [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 ExternalVpnGateway resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ExternalVpnGateway items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of ExternalVpnGateway resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ExternalVpnGateway items = 100526016; + * @param array<\Google\Cloud\Compute\V1\ExternalVpnGateway>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ExternalVpnGateway::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#externalVpnGatewayList for lists of externalVpnGateways. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#externalVpnGatewayList for lists of externalVpnGateways. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FileContentBuffer.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FileContentBuffer.php new file mode 100644 index 000000000000..3207ca9ab9aa --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FileContentBuffer.php @@ -0,0 +1,124 @@ +google.cloud.compute.v1.FileContentBuffer + */ +class FileContentBuffer extends \Google\Protobuf\Internal\Message +{ + /** + * The raw content in the secure keys file. + * + * Generated from protobuf field optional string content = 414659705; + */ + protected $content = null; + /** + * The file type of source file. + * Check the FileType enum for the list of possible values. + * + * Generated from protobuf field optional string file_type = 294346781; + */ + protected $file_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $content + * The raw content in the secure keys file. + * @type string $file_type + * The file type of source file. + * Check the FileType enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The raw content in the secure keys file. + * + * Generated from protobuf field optional string content = 414659705; + * @return string + */ + public function getContent() + { + return isset($this->content) ? $this->content : ''; + } + + public function hasContent() + { + return isset($this->content); + } + + public function clearContent() + { + unset($this->content); + } + + /** + * The raw content in the secure keys file. + * + * Generated from protobuf field optional string content = 414659705; + * @param string $var + * @return $this + */ + public function setContent($var) + { + GPBUtil::checkString($var, True); + $this->content = $var; + + return $this; + } + + /** + * The file type of source file. + * Check the FileType enum for the list of possible values. + * + * Generated from protobuf field optional string file_type = 294346781; + * @return string + */ + public function getFileType() + { + return isset($this->file_type) ? $this->file_type : ''; + } + + public function hasFileType() + { + return isset($this->file_type); + } + + public function clearFileType() + { + unset($this->file_type); + } + + /** + * The file type of source file. + * Check the FileType enum for the list of possible values. + * + * Generated from protobuf field optional string file_type = 294346781; + * @param string $var + * @return $this + */ + public function setFileType($var) + { + GPBUtil::checkString($var, True); + $this->file_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FileContentBuffer/FileType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FileContentBuffer/FileType.php new file mode 100644 index 000000000000..a0f05b079f1e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FileContentBuffer/FileType.php @@ -0,0 +1,65 @@ +google.cloud.compute.v1.FileContentBuffer.FileType + */ +class FileType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_FILE_TYPE = 0; + */ + const UNDEFINED_FILE_TYPE = 0; + /** + * Generated from protobuf enum BIN = 65767; + */ + const BIN = 65767; + /** + * Generated from protobuf enum UNDEFINED = 137851184; + */ + const UNDEFINED = 137851184; + /** + * Generated from protobuf enum X509 = 2674086; + */ + const X509 = 2674086; + + private static $valueToName = [ + self::UNDEFINED_FILE_TYPE => 'UNDEFINED_FILE_TYPE', + self::BIN => 'BIN', + self::UNDEFINED => 'UNDEFINED', + self::X509 => 'X509', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FileType::class, \Google\Cloud\Compute\V1\FileContentBuffer_FileType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Firewall.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Firewall.php new file mode 100644 index 000000000000..7574c2b9886c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Firewall.php @@ -0,0 +1,793 @@ +google.cloud.compute.v1.Firewall + */ +class Firewall extends \Google\Protobuf\Internal\Message +{ + /** + * The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Allowed allowed = 162398632; + */ + private $allowed; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a denied connection. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Denied denied = 275217307; + */ + private $denied; + /** + * An optional description of this resource. Provide this field when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * If destination ranges are specified, the firewall rule applies only to traffic that has destination IP address in these ranges. These ranges must be expressed in CIDR format. Both IPv4 and IPv6 are supported. + * + * Generated from protobuf field repeated string destination_ranges = 305699879; + */ + private $destination_ranges; + /** + * Direction of traffic to which this firewall applies, either `INGRESS` or `EGRESS`. The default is `INGRESS`. For `EGRESS` traffic, you cannot specify the sourceTags fields. + * Check the Direction enum for the list of possible values. + * + * Generated from protobuf field optional string direction = 111150975; + */ + protected $direction = null; + /** + * Denotes whether the firewall rule is disabled. When set to true, the firewall rule is not enforced and the network behaves as if it did not exist. If this is unspecified, the firewall rule will be enabled. + * + * Generated from protobuf field optional bool disabled = 270940796; + */ + protected $disabled = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#firewall for firewall rules. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * This field denotes the logging options for a particular firewall rule. If logging is enabled, logs will be exported to Cloud Logging. + * + * Generated from protobuf field optional .google.cloud.compute.v1.FirewallLogConfig log_config = 351299741; + */ + protected $log_config = null; + /** + * 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])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * URL of the network resource for this firewall rule. If not specified when creating a firewall rule, the default network is used: global/networks/default If you choose to specify this field, you can specify the network as a full or partial URL. For example, the following are all valid URLs: - https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network - projects/myproject/global/networks/my-network - global/networks/default + * + * Generated from protobuf field optional string network = 232872494; + */ + protected $network = null; + /** + * Priority for this rule. This is an integer between `0` and `65535`, both inclusive. The default value is `1000`. Relative priorities determine which rule takes effect if multiple rules apply. Lower values indicate higher priority. For example, a rule with priority `0` has higher precedence than a rule with priority `1`. DENY rules take precedence over ALLOW rules if they have equal priority. Note that VPC networks have implied rules with a priority of `65535`. To avoid conflicts with the implied rules, use a priority number less than `65535`. + * + * Generated from protobuf field optional int32 priority = 445151652; + */ + protected $priority = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * If source ranges are specified, the firewall rule applies only to traffic that has a source IP address in these ranges. These ranges must be expressed in CIDR format. One or both of sourceRanges and sourceTags may be set. If both fields are set, the rule applies to traffic that has a source IP address within sourceRanges OR a source IP from a resource with a matching tag listed in the sourceTags field. The connection does not need to match both fields for the rule to apply. Both IPv4 and IPv6 are supported. + * + * Generated from protobuf field repeated string source_ranges = 200097658; + */ + private $source_ranges; + /** + * If source service accounts are specified, the firewall rules apply only to traffic originating from an instance with a service account in this list. Source service accounts cannot be used to control traffic to an instance's external IP address because service accounts are associated with an instance, not an IP address. sourceRanges can be set at the same time as sourceServiceAccounts. If both are set, the firewall applies to traffic that has a source IP address within the sourceRanges OR a source IP that belongs to an instance with service account listed in sourceServiceAccount. The connection does not need to match both fields for the firewall to apply. sourceServiceAccounts cannot be used at the same time as sourceTags or targetTags. + * + * Generated from protobuf field repeated string source_service_accounts = 105100756; + */ + private $source_service_accounts; + /** + * If source tags are specified, the firewall rule applies only to traffic with source IPs that match the primary network interfaces of VM instances that have the tag and are in the same VPC network. Source tags cannot be used to control traffic to an instance's external IP address, it only applies to traffic between instances in the same virtual network. Because tags are associated with instances, not IP addresses. One or both of sourceRanges and sourceTags may be set. If both fields are set, the firewall applies to traffic that has a source IP address within sourceRanges OR a source IP from a resource with a matching tag listed in the sourceTags field. The connection does not need to match both fields for the firewall to apply. + * + * Generated from protobuf field repeated string source_tags = 452222397; + */ + private $source_tags; + /** + * A list of service accounts indicating sets of instances located in the network that may make network connections as specified in allowed[]. targetServiceAccounts cannot be used at the same time as targetTags or sourceTags. If neither targetServiceAccounts nor targetTags are specified, the firewall rule applies to all instances on the specified network. + * + * Generated from protobuf field repeated string target_service_accounts = 457639710; + */ + private $target_service_accounts; + /** + * A list of tags that controls which instances the firewall rule applies to. If targetTags are specified, then the firewall rule applies only to instances in the VPC network that have one of those tags. If no targetTags are specified, the firewall rule applies to all instances on the specified network. + * + * Generated from protobuf field repeated string target_tags = 62901767; + */ + private $target_tags; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\Allowed>|\Google\Protobuf\Internal\RepeatedField $allowed + * The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type array<\Google\Cloud\Compute\V1\Denied>|\Google\Protobuf\Internal\RepeatedField $denied + * The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a denied connection. + * @type string $description + * An optional description of this resource. Provide this field when you create the resource. + * @type array|\Google\Protobuf\Internal\RepeatedField $destination_ranges + * If destination ranges are specified, the firewall rule applies only to traffic that has destination IP address in these ranges. These ranges must be expressed in CIDR format. Both IPv4 and IPv6 are supported. + * @type string $direction + * Direction of traffic to which this firewall applies, either `INGRESS` or `EGRESS`. The default is `INGRESS`. For `EGRESS` traffic, you cannot specify the sourceTags fields. + * Check the Direction enum for the list of possible values. + * @type bool $disabled + * Denotes whether the firewall rule is disabled. When set to true, the firewall rule is not enforced and the network behaves as if it did not exist. If this is unspecified, the firewall rule will be enabled. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of the resource. Always compute#firewall for firewall rules. + * @type \Google\Cloud\Compute\V1\FirewallLogConfig $log_config + * This field denotes the logging options for a particular firewall rule. If logging is enabled, logs will be exported to Cloud Logging. + * @type string $name + * 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])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. + * @type string $network + * URL of the network resource for this firewall rule. If not specified when creating a firewall rule, the default network is used: global/networks/default If you choose to specify this field, you can specify the network as a full or partial URL. For example, the following are all valid URLs: - https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network - projects/myproject/global/networks/my-network - global/networks/default + * @type int $priority + * Priority for this rule. This is an integer between `0` and `65535`, both inclusive. The default value is `1000`. Relative priorities determine which rule takes effect if multiple rules apply. Lower values indicate higher priority. For example, a rule with priority `0` has higher precedence than a rule with priority `1`. DENY rules take precedence over ALLOW rules if they have equal priority. Note that VPC networks have implied rules with a priority of `65535`. To avoid conflicts with the implied rules, use a priority number less than `65535`. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type array|\Google\Protobuf\Internal\RepeatedField $source_ranges + * If source ranges are specified, the firewall rule applies only to traffic that has a source IP address in these ranges. These ranges must be expressed in CIDR format. One or both of sourceRanges and sourceTags may be set. If both fields are set, the rule applies to traffic that has a source IP address within sourceRanges OR a source IP from a resource with a matching tag listed in the sourceTags field. The connection does not need to match both fields for the rule to apply. Both IPv4 and IPv6 are supported. + * @type array|\Google\Protobuf\Internal\RepeatedField $source_service_accounts + * If source service accounts are specified, the firewall rules apply only to traffic originating from an instance with a service account in this list. Source service accounts cannot be used to control traffic to an instance's external IP address because service accounts are associated with an instance, not an IP address. sourceRanges can be set at the same time as sourceServiceAccounts. If both are set, the firewall applies to traffic that has a source IP address within the sourceRanges OR a source IP that belongs to an instance with service account listed in sourceServiceAccount. The connection does not need to match both fields for the firewall to apply. sourceServiceAccounts cannot be used at the same time as sourceTags or targetTags. + * @type array|\Google\Protobuf\Internal\RepeatedField $source_tags + * If source tags are specified, the firewall rule applies only to traffic with source IPs that match the primary network interfaces of VM instances that have the tag and are in the same VPC network. Source tags cannot be used to control traffic to an instance's external IP address, it only applies to traffic between instances in the same virtual network. Because tags are associated with instances, not IP addresses. One or both of sourceRanges and sourceTags may be set. If both fields are set, the firewall applies to traffic that has a source IP address within sourceRanges OR a source IP from a resource with a matching tag listed in the sourceTags field. The connection does not need to match both fields for the firewall to apply. + * @type array|\Google\Protobuf\Internal\RepeatedField $target_service_accounts + * A list of service accounts indicating sets of instances located in the network that may make network connections as specified in allowed[]. targetServiceAccounts cannot be used at the same time as targetTags or sourceTags. If neither targetServiceAccounts nor targetTags are specified, the firewall rule applies to all instances on the specified network. + * @type array|\Google\Protobuf\Internal\RepeatedField $target_tags + * A list of tags that controls which instances the firewall rule applies to. If targetTags are specified, then the firewall rule applies only to instances in the VPC network that have one of those tags. If no targetTags are specified, the firewall rule applies to all instances on the specified network. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Allowed allowed = 162398632; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAllowed() + { + return $this->allowed; + } + + /** + * The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Allowed allowed = 162398632; + * @param array<\Google\Cloud\Compute\V1\Allowed>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAllowed($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Allowed::class); + $this->allowed = $arr; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a denied connection. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Denied denied = 275217307; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDenied() + { + return $this->denied; + } + + /** + * The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a denied connection. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Denied denied = 275217307; + * @param array<\Google\Cloud\Compute\V1\Denied>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDenied($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Denied::class); + $this->denied = $arr; + + return $this; + } + + /** + * An optional description of this resource. Provide this field when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this field when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * If destination ranges are specified, the firewall rule applies only to traffic that has destination IP address in these ranges. These ranges must be expressed in CIDR format. Both IPv4 and IPv6 are supported. + * + * Generated from protobuf field repeated string destination_ranges = 305699879; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDestinationRanges() + { + return $this->destination_ranges; + } + + /** + * If destination ranges are specified, the firewall rule applies only to traffic that has destination IP address in these ranges. These ranges must be expressed in CIDR format. Both IPv4 and IPv6 are supported. + * + * Generated from protobuf field repeated string destination_ranges = 305699879; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDestinationRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->destination_ranges = $arr; + + return $this; + } + + /** + * Direction of traffic to which this firewall applies, either `INGRESS` or `EGRESS`. The default is `INGRESS`. For `EGRESS` traffic, you cannot specify the sourceTags fields. + * Check the Direction enum for the list of possible values. + * + * Generated from protobuf field optional string direction = 111150975; + * @return string + */ + public function getDirection() + { + return isset($this->direction) ? $this->direction : ''; + } + + public function hasDirection() + { + return isset($this->direction); + } + + public function clearDirection() + { + unset($this->direction); + } + + /** + * Direction of traffic to which this firewall applies, either `INGRESS` or `EGRESS`. The default is `INGRESS`. For `EGRESS` traffic, you cannot specify the sourceTags fields. + * Check the Direction enum for the list of possible values. + * + * Generated from protobuf field optional string direction = 111150975; + * @param string $var + * @return $this + */ + public function setDirection($var) + { + GPBUtil::checkString($var, True); + $this->direction = $var; + + return $this; + } + + /** + * Denotes whether the firewall rule is disabled. When set to true, the firewall rule is not enforced and the network behaves as if it did not exist. If this is unspecified, the firewall rule will be enabled. + * + * Generated from protobuf field optional bool disabled = 270940796; + * @return bool + */ + public function getDisabled() + { + return isset($this->disabled) ? $this->disabled : false; + } + + public function hasDisabled() + { + return isset($this->disabled); + } + + public function clearDisabled() + { + unset($this->disabled); + } + + /** + * Denotes whether the firewall rule is disabled. When set to true, the firewall rule is not enforced and the network behaves as if it did not exist. If this is unspecified, the firewall rule will be enabled. + * + * Generated from protobuf field optional bool disabled = 270940796; + * @param bool $var + * @return $this + */ + public function setDisabled($var) + { + GPBUtil::checkBool($var); + $this->disabled = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#firewall for firewall rules. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#firewall for firewall rules. + * + * 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; + } + + /** + * This field denotes the logging options for a particular firewall rule. If logging is enabled, logs will be exported to Cloud Logging. + * + * Generated from protobuf field optional .google.cloud.compute.v1.FirewallLogConfig log_config = 351299741; + * @return \Google\Cloud\Compute\V1\FirewallLogConfig|null + */ + public function getLogConfig() + { + return $this->log_config; + } + + public function hasLogConfig() + { + return isset($this->log_config); + } + + public function clearLogConfig() + { + unset($this->log_config); + } + + /** + * This field denotes the logging options for a particular firewall rule. If logging is enabled, logs will be exported to Cloud Logging. + * + * Generated from protobuf field optional .google.cloud.compute.v1.FirewallLogConfig log_config = 351299741; + * @param \Google\Cloud\Compute\V1\FirewallLogConfig $var + * @return $this + */ + public function setLogConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\FirewallLogConfig::class); + $this->log_config = $var; + + return $this; + } + + /** + * 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])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. + * + * 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); + } + + /** + * 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])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. + * + * 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; + } + + /** + * URL of the network resource for this firewall rule. If not specified when creating a firewall rule, the default network is used: global/networks/default If you choose to specify this field, you can specify the network as a full or partial URL. For example, the following are all valid URLs: - https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network - projects/myproject/global/networks/my-network - global/networks/default + * + * Generated from protobuf field optional string network = 232872494; + * @return string + */ + public function getNetwork() + { + return isset($this->network) ? $this->network : ''; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * URL of the network resource for this firewall rule. If not specified when creating a firewall rule, the default network is used: global/networks/default If you choose to specify this field, you can specify the network as a full or partial URL. For example, the following are all valid URLs: - https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network - projects/myproject/global/networks/my-network - global/networks/default + * + * Generated from protobuf field optional string network = 232872494; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Priority for this rule. This is an integer between `0` and `65535`, both inclusive. The default value is `1000`. Relative priorities determine which rule takes effect if multiple rules apply. Lower values indicate higher priority. For example, a rule with priority `0` has higher precedence than a rule with priority `1`. DENY rules take precedence over ALLOW rules if they have equal priority. Note that VPC networks have implied rules with a priority of `65535`. To avoid conflicts with the implied rules, use a priority number less than `65535`. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @return int + */ + public function getPriority() + { + return isset($this->priority) ? $this->priority : 0; + } + + public function hasPriority() + { + return isset($this->priority); + } + + public function clearPriority() + { + unset($this->priority); + } + + /** + * Priority for this rule. This is an integer between `0` and `65535`, both inclusive. The default value is `1000`. Relative priorities determine which rule takes effect if multiple rules apply. Lower values indicate higher priority. For example, a rule with priority `0` has higher precedence than a rule with priority `1`. DENY rules take precedence over ALLOW rules if they have equal priority. Note that VPC networks have implied rules with a priority of `65535`. To avoid conflicts with the implied rules, use a priority number less than `65535`. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt32($var); + $this->priority = $var; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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; + } + + /** + * If source ranges are specified, the firewall rule applies only to traffic that has a source IP address in these ranges. These ranges must be expressed in CIDR format. One or both of sourceRanges and sourceTags may be set. If both fields are set, the rule applies to traffic that has a source IP address within sourceRanges OR a source IP from a resource with a matching tag listed in the sourceTags field. The connection does not need to match both fields for the rule to apply. Both IPv4 and IPv6 are supported. + * + * Generated from protobuf field repeated string source_ranges = 200097658; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSourceRanges() + { + return $this->source_ranges; + } + + /** + * If source ranges are specified, the firewall rule applies only to traffic that has a source IP address in these ranges. These ranges must be expressed in CIDR format. One or both of sourceRanges and sourceTags may be set. If both fields are set, the rule applies to traffic that has a source IP address within sourceRanges OR a source IP from a resource with a matching tag listed in the sourceTags field. The connection does not need to match both fields for the rule to apply. Both IPv4 and IPv6 are supported. + * + * Generated from protobuf field repeated string source_ranges = 200097658; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSourceRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->source_ranges = $arr; + + return $this; + } + + /** + * If source service accounts are specified, the firewall rules apply only to traffic originating from an instance with a service account in this list. Source service accounts cannot be used to control traffic to an instance's external IP address because service accounts are associated with an instance, not an IP address. sourceRanges can be set at the same time as sourceServiceAccounts. If both are set, the firewall applies to traffic that has a source IP address within the sourceRanges OR a source IP that belongs to an instance with service account listed in sourceServiceAccount. The connection does not need to match both fields for the firewall to apply. sourceServiceAccounts cannot be used at the same time as sourceTags or targetTags. + * + * Generated from protobuf field repeated string source_service_accounts = 105100756; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSourceServiceAccounts() + { + return $this->source_service_accounts; + } + + /** + * If source service accounts are specified, the firewall rules apply only to traffic originating from an instance with a service account in this list. Source service accounts cannot be used to control traffic to an instance's external IP address because service accounts are associated with an instance, not an IP address. sourceRanges can be set at the same time as sourceServiceAccounts. If both are set, the firewall applies to traffic that has a source IP address within the sourceRanges OR a source IP that belongs to an instance with service account listed in sourceServiceAccount. The connection does not need to match both fields for the firewall to apply. sourceServiceAccounts cannot be used at the same time as sourceTags or targetTags. + * + * Generated from protobuf field repeated string source_service_accounts = 105100756; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSourceServiceAccounts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->source_service_accounts = $arr; + + return $this; + } + + /** + * If source tags are specified, the firewall rule applies only to traffic with source IPs that match the primary network interfaces of VM instances that have the tag and are in the same VPC network. Source tags cannot be used to control traffic to an instance's external IP address, it only applies to traffic between instances in the same virtual network. Because tags are associated with instances, not IP addresses. One or both of sourceRanges and sourceTags may be set. If both fields are set, the firewall applies to traffic that has a source IP address within sourceRanges OR a source IP from a resource with a matching tag listed in the sourceTags field. The connection does not need to match both fields for the firewall to apply. + * + * Generated from protobuf field repeated string source_tags = 452222397; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSourceTags() + { + return $this->source_tags; + } + + /** + * If source tags are specified, the firewall rule applies only to traffic with source IPs that match the primary network interfaces of VM instances that have the tag and are in the same VPC network. Source tags cannot be used to control traffic to an instance's external IP address, it only applies to traffic between instances in the same virtual network. Because tags are associated with instances, not IP addresses. One or both of sourceRanges and sourceTags may be set. If both fields are set, the firewall applies to traffic that has a source IP address within sourceRanges OR a source IP from a resource with a matching tag listed in the sourceTags field. The connection does not need to match both fields for the firewall to apply. + * + * Generated from protobuf field repeated string source_tags = 452222397; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSourceTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->source_tags = $arr; + + return $this; + } + + /** + * A list of service accounts indicating sets of instances located in the network that may make network connections as specified in allowed[]. targetServiceAccounts cannot be used at the same time as targetTags or sourceTags. If neither targetServiceAccounts nor targetTags are specified, the firewall rule applies to all instances on the specified network. + * + * Generated from protobuf field repeated string target_service_accounts = 457639710; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetServiceAccounts() + { + return $this->target_service_accounts; + } + + /** + * A list of service accounts indicating sets of instances located in the network that may make network connections as specified in allowed[]. targetServiceAccounts cannot be used at the same time as targetTags or sourceTags. If neither targetServiceAccounts nor targetTags are specified, the firewall rule applies to all instances on the specified network. + * + * Generated from protobuf field repeated string target_service_accounts = 457639710; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetServiceAccounts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->target_service_accounts = $arr; + + return $this; + } + + /** + * A list of tags that controls which instances the firewall rule applies to. If targetTags are specified, then the firewall rule applies only to instances in the VPC network that have one of those tags. If no targetTags are specified, the firewall rule applies to all instances on the specified network. + * + * Generated from protobuf field repeated string target_tags = 62901767; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetTags() + { + return $this->target_tags; + } + + /** + * A list of tags that controls which instances the firewall rule applies to. If targetTags are specified, then the firewall rule applies only to instances in the VPC network that have one of those tags. If no targetTags are specified, the firewall rule applies to all instances on the specified network. + * + * Generated from protobuf field repeated string target_tags = 62901767; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->target_tags = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Firewall/Direction.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Firewall/Direction.php new file mode 100644 index 000000000000..ae5f01496fca --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Firewall/Direction.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.Firewall.Direction + */ +class Direction +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_DIRECTION = 0; + */ + const UNDEFINED_DIRECTION = 0; + /** + * Indicates that firewall should apply to outgoing traffic. + * + * Generated from protobuf enum EGRESS = 432880501; + */ + const EGRESS = 432880501; + /** + * Indicates that firewall should apply to incoming traffic. + * + * Generated from protobuf enum INGRESS = 516931221; + */ + const INGRESS = 516931221; + + private static $valueToName = [ + self::UNDEFINED_DIRECTION => 'UNDEFINED_DIRECTION', + self::EGRESS => 'EGRESS', + self::INGRESS => 'INGRESS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Direction::class, \Google\Cloud\Compute\V1\Firewall_Direction::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallList.php new file mode 100644 index 000000000000..4661f6f4b551 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.FirewallList + */ +class FirewallList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of Firewall resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Firewall items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#firewallList for lists of firewalls. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\Firewall>|\Google\Protobuf\Internal\RepeatedField $items + * A list of Firewall resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#firewallList for lists of firewalls. + * @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 Firewall resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Firewall items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of Firewall resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Firewall items = 100526016; + * @param array<\Google\Cloud\Compute\V1\Firewall>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Firewall::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#firewallList for lists of firewalls. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#firewallList for lists of firewalls. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallLogConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallLogConfig.php new file mode 100644 index 000000000000..585bfe18acbd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallLogConfig.php @@ -0,0 +1,125 @@ +google.cloud.compute.v1.FirewallLogConfig + */ +class FirewallLogConfig extends \Google\Protobuf\Internal\Message +{ + /** + * This field denotes whether to enable logging for a particular firewall rule. + * + * Generated from protobuf field optional bool enable = 311764355; + */ + protected $enable = null; + /** + * This field can only be specified for a particular firewall rule if logging is enabled for that rule. This field denotes whether to include or exclude metadata for firewall logs. + * Check the Metadata enum for the list of possible values. + * + * Generated from protobuf field optional string metadata = 86866735; + */ + protected $metadata = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable + * This field denotes whether to enable logging for a particular firewall rule. + * @type string $metadata + * This field can only be specified for a particular firewall rule if logging is enabled for that rule. This field denotes whether to include or exclude metadata for firewall logs. + * Check the Metadata enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * This field denotes whether to enable logging for a particular firewall rule. + * + * Generated from protobuf field optional bool enable = 311764355; + * @return bool + */ + public function getEnable() + { + return isset($this->enable) ? $this->enable : false; + } + + public function hasEnable() + { + return isset($this->enable); + } + + public function clearEnable() + { + unset($this->enable); + } + + /** + * This field denotes whether to enable logging for a particular firewall rule. + * + * Generated from protobuf field optional bool enable = 311764355; + * @param bool $var + * @return $this + */ + public function setEnable($var) + { + GPBUtil::checkBool($var); + $this->enable = $var; + + return $this; + } + + /** + * This field can only be specified for a particular firewall rule if logging is enabled for that rule. This field denotes whether to include or exclude metadata for firewall logs. + * Check the Metadata enum for the list of possible values. + * + * Generated from protobuf field optional string metadata = 86866735; + * @return string + */ + public function getMetadata() + { + return isset($this->metadata) ? $this->metadata : ''; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * This field can only be specified for a particular firewall rule if logging is enabled for that rule. This field denotes whether to include or exclude metadata for firewall logs. + * Check the Metadata enum for the list of possible values. + * + * Generated from protobuf field optional string metadata = 86866735; + * @param string $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkString($var, True); + $this->metadata = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallLogConfig/Metadata.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallLogConfig/Metadata.php new file mode 100644 index 000000000000..cfaa805a25ca --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallLogConfig/Metadata.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.FirewallLogConfig.Metadata + */ +class Metadata +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_METADATA = 0; + */ + const UNDEFINED_METADATA = 0; + /** + * Generated from protobuf enum EXCLUDE_ALL_METADATA = 334519954; + */ + const EXCLUDE_ALL_METADATA = 334519954; + /** + * Generated from protobuf enum INCLUDE_ALL_METADATA = 164619908; + */ + const INCLUDE_ALL_METADATA = 164619908; + + private static $valueToName = [ + self::UNDEFINED_METADATA => 'UNDEFINED_METADATA', + self::EXCLUDE_ALL_METADATA => 'EXCLUDE_ALL_METADATA', + self::INCLUDE_ALL_METADATA => 'INCLUDE_ALL_METADATA', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Metadata::class, \Google\Cloud\Compute\V1\FirewallLogConfig_Metadata::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPoliciesListAssociationsResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPoliciesListAssociationsResponse.php new file mode 100644 index 000000000000..5529d46716c6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPoliciesListAssociationsResponse.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse + */ +class FirewallPoliciesListAssociationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of associations. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyAssociation associations = 508736530; + */ + private $associations; + /** + * [Output Only] Type of firewallPolicy associations. Always compute#FirewallPoliciesListAssociations for lists of firewallPolicy associations. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\FirewallPolicyAssociation>|\Google\Protobuf\Internal\RepeatedField $associations + * A list of associations. + * @type string $kind + * [Output Only] Type of firewallPolicy associations. Always compute#FirewallPoliciesListAssociations for lists of firewallPolicy associations. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of associations. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyAssociation associations = 508736530; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAssociations() + { + return $this->associations; + } + + /** + * A list of associations. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyAssociation associations = 508736530; + * @param array<\Google\Cloud\Compute\V1\FirewallPolicyAssociation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAssociations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\FirewallPolicyAssociation::class); + $this->associations = $arr; + + return $this; + } + + /** + * [Output Only] Type of firewallPolicy associations. Always compute#FirewallPoliciesListAssociations for lists of firewallPolicy associations. + * + * 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); + } + + /** + * [Output Only] Type of firewallPolicy associations. Always compute#FirewallPoliciesListAssociations for lists of firewallPolicy associations. + * + * 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicy.php new file mode 100644 index 000000000000..fde1e23c383a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicy.php @@ -0,0 +1,673 @@ +google.cloud.compute.v1.FirewallPolicy + */ +class FirewallPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * A list of associations that belong to this firewall policy. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyAssociation associations = 508736530; + */ + private $associations; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Deprecated, please use short name instead. User-provided name of the Organization firewall policy. The name should be unique in the organization in which the firewall policy is created. This field is not applicable to network firewall policies. This name must be set on creation and cannot be changed. 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. + * + * Generated from protobuf field optional string display_name = 4473832; + */ + protected $display_name = null; + /** + * Specifies a fingerprint for this resource, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make get() request to the firewall policy. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output only] Type of the resource. Always compute#firewallPolicyfor firewall policies + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * Name of the resource. For Organization Firewall Policies it's a [Output Only] numeric ID allocated by Google Cloud which uniquely identifies the Organization Firewall Policy. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] The parent of the firewall policy. This field is not applicable to network firewall policies. + * + * Generated from protobuf field optional string parent = 78317738; + */ + protected $parent = null; + /** + * [Output Only] URL of the region where the regional firewall policy resides. This field is not applicable to global firewall policies. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples. + * + * Generated from protobuf field optional int32 rule_tuple_count = 388342037; + */ + protected $rule_tuple_count = null; + /** + * A list of rules that belong to this policy. There must always be a default rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a firewall policy, a default rule with action "allow" will be added. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyRule rules = 108873975; + */ + private $rules; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Server-defined URL for this resource with the resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + */ + protected $self_link_with_id = null; + /** + * User-provided name of the Organization firewall policy. The name should be unique in the organization in which the firewall policy is created. This field is not applicable to network firewall policies. This name must be set on creation and cannot be changed. 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. + * + * Generated from protobuf field optional string short_name = 492051566; + */ + protected $short_name = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\FirewallPolicyAssociation>|\Google\Protobuf\Internal\RepeatedField $associations + * A list of associations that belong to this firewall policy. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type string $display_name + * Deprecated, please use short name instead. User-provided name of the Organization firewall policy. The name should be unique in the organization in which the firewall policy is created. This field is not applicable to network firewall policies. This name must be set on creation and cannot be changed. 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 string $fingerprint + * Specifies a fingerprint for this resource, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make get() request to the firewall policy. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output only] Type of the resource. Always compute#firewallPolicyfor firewall policies + * @type string $name + * Name of the resource. For Organization Firewall Policies it's a [Output Only] numeric ID allocated by Google Cloud which uniquely identifies the Organization Firewall Policy. + * @type string $parent + * [Output Only] The parent of the firewall policy. This field is not applicable to network firewall policies. + * @type string $region + * [Output Only] URL of the region where the regional firewall policy resides. This field is not applicable to global firewall policies. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * @type int $rule_tuple_count + * [Output Only] Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples. + * @type array<\Google\Cloud\Compute\V1\FirewallPolicyRule>|\Google\Protobuf\Internal\RepeatedField $rules + * A list of rules that belong to this policy. There must always be a default rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a firewall policy, a default rule with action "allow" will be added. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $self_link_with_id + * [Output Only] Server-defined URL for this resource with the resource id. + * @type string $short_name + * User-provided name of the Organization firewall policy. The name should be unique in the organization in which the firewall policy is created. This field is not applicable to network firewall policies. This name must be set on creation and cannot be changed. 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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of associations that belong to this firewall policy. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyAssociation associations = 508736530; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAssociations() + { + return $this->associations; + } + + /** + * A list of associations that belong to this firewall policy. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyAssociation associations = 508736530; + * @param array<\Google\Cloud\Compute\V1\FirewallPolicyAssociation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAssociations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\FirewallPolicyAssociation::class); + $this->associations = $arr; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Deprecated, please use short name instead. User-provided name of the Organization firewall policy. The name should be unique in the organization in which the firewall policy is created. This field is not applicable to network firewall policies. This name must be set on creation and cannot be changed. 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. + * + * Generated from protobuf field optional string display_name = 4473832; + * @return string + */ + public function getDisplayName() + { + return isset($this->display_name) ? $this->display_name : ''; + } + + public function hasDisplayName() + { + return isset($this->display_name); + } + + public function clearDisplayName() + { + unset($this->display_name); + } + + /** + * Deprecated, please use short name instead. User-provided name of the Organization firewall policy. The name should be unique in the organization in which the firewall policy is created. This field is not applicable to network firewall policies. This name must be set on creation and cannot be changed. 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. + * + * Generated from protobuf field optional string display_name = 4473832; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * Specifies a fingerprint for this resource, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make get() request to the firewall policy. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Specifies a fingerprint for this resource, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make get() request to the firewall policy. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output only] Type of the resource. Always compute#firewallPolicyfor firewall policies + * + * 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); + } + + /** + * [Output only] Type of the resource. Always compute#firewallPolicyfor firewall policies + * + * 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; + } + + /** + * Name of the resource. For Organization Firewall Policies it's a [Output Only] numeric ID allocated by Google Cloud which uniquely identifies the Organization Firewall Policy. + * + * 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); + } + + /** + * Name of the resource. For Organization Firewall Policies it's a [Output Only] numeric ID allocated by Google Cloud which uniquely identifies the Organization Firewall Policy. + * + * 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; + } + + /** + * [Output Only] The parent of the firewall policy. This field is not applicable to network firewall policies. + * + * Generated from protobuf field optional string parent = 78317738; + * @return string + */ + public function getParent() + { + return isset($this->parent) ? $this->parent : ''; + } + + public function hasParent() + { + return isset($this->parent); + } + + public function clearParent() + { + unset($this->parent); + } + + /** + * [Output Only] The parent of the firewall policy. This field is not applicable to network firewall policies. + * + * Generated from protobuf field optional string parent = 78317738; + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * [Output Only] URL of the region where the regional firewall policy resides. This field is not applicable to global firewall policies. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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 regional firewall policy resides. This field is not applicable to global firewall policies. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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] Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples. + * + * Generated from protobuf field optional int32 rule_tuple_count = 388342037; + * @return int + */ + public function getRuleTupleCount() + { + return isset($this->rule_tuple_count) ? $this->rule_tuple_count : 0; + } + + public function hasRuleTupleCount() + { + return isset($this->rule_tuple_count); + } + + public function clearRuleTupleCount() + { + unset($this->rule_tuple_count); + } + + /** + * [Output Only] Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples. + * + * Generated from protobuf field optional int32 rule_tuple_count = 388342037; + * @param int $var + * @return $this + */ + public function setRuleTupleCount($var) + { + GPBUtil::checkInt32($var); + $this->rule_tuple_count = $var; + + return $this; + } + + /** + * A list of rules that belong to this policy. There must always be a default rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a firewall policy, a default rule with action "allow" will be added. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyRule rules = 108873975; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * A list of rules that belong to this policy. There must always be a default rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a firewall policy, a default rule with action "allow" will be added. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyRule rules = 108873975; + * @param array<\Google\Cloud\Compute\V1\FirewallPolicyRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\FirewallPolicyRule::class); + $this->rules = $arr; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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] Server-defined URL for this resource with the resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + * @return string + */ + public function getSelfLinkWithId() + { + return isset($this->self_link_with_id) ? $this->self_link_with_id : ''; + } + + public function hasSelfLinkWithId() + { + return isset($this->self_link_with_id); + } + + public function clearSelfLinkWithId() + { + unset($this->self_link_with_id); + } + + /** + * [Output Only] Server-defined URL for this resource with the resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + * @param string $var + * @return $this + */ + public function setSelfLinkWithId($var) + { + GPBUtil::checkString($var, True); + $this->self_link_with_id = $var; + + return $this; + } + + /** + * User-provided name of the Organization firewall policy. The name should be unique in the organization in which the firewall policy is created. This field is not applicable to network firewall policies. This name must be set on creation and cannot be changed. 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. + * + * Generated from protobuf field optional string short_name = 492051566; + * @return string + */ + public function getShortName() + { + return isset($this->short_name) ? $this->short_name : ''; + } + + public function hasShortName() + { + return isset($this->short_name); + } + + public function clearShortName() + { + unset($this->short_name); + } + + /** + * User-provided name of the Organization firewall policy. The name should be unique in the organization in which the firewall policy is created. This field is not applicable to network firewall policies. This name must be set on creation and cannot be changed. 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. + * + * Generated from protobuf field optional string short_name = 492051566; + * @param string $var + * @return $this + */ + public function setShortName($var) + { + GPBUtil::checkString($var, True); + $this->short_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyAssociation.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyAssociation.php new file mode 100644 index 000000000000..07d36ff4f38f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyAssociation.php @@ -0,0 +1,252 @@ +google.cloud.compute.v1.FirewallPolicyAssociation + */ +class FirewallPolicyAssociation extends \Google\Protobuf\Internal\Message +{ + /** + * The target that the firewall policy is attached to. + * + * Generated from protobuf field optional string attachment_target = 175773741; + */ + protected $attachment_target = null; + /** + * [Output Only] Deprecated, please use short name instead. The display name of the firewall policy of the association. + * + * Generated from protobuf field optional string display_name = 4473832; + */ + protected $display_name = null; + /** + * [Output Only] The firewall policy ID of the association. + * + * Generated from protobuf field optional string firewall_policy_id = 357211849; + */ + protected $firewall_policy_id = null; + /** + * The name for an association. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] The short name of the firewall policy of the association. + * + * Generated from protobuf field optional string short_name = 492051566; + */ + protected $short_name = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $attachment_target + * The target that the firewall policy is attached to. + * @type string $display_name + * [Output Only] Deprecated, please use short name instead. The display name of the firewall policy of the association. + * @type string $firewall_policy_id + * [Output Only] The firewall policy ID of the association. + * @type string $name + * The name for an association. + * @type string $short_name + * [Output Only] The short name of the firewall policy of the association. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The target that the firewall policy is attached to. + * + * Generated from protobuf field optional string attachment_target = 175773741; + * @return string + */ + public function getAttachmentTarget() + { + return isset($this->attachment_target) ? $this->attachment_target : ''; + } + + public function hasAttachmentTarget() + { + return isset($this->attachment_target); + } + + public function clearAttachmentTarget() + { + unset($this->attachment_target); + } + + /** + * The target that the firewall policy is attached to. + * + * Generated from protobuf field optional string attachment_target = 175773741; + * @param string $var + * @return $this + */ + public function setAttachmentTarget($var) + { + GPBUtil::checkString($var, True); + $this->attachment_target = $var; + + return $this; + } + + /** + * [Output Only] Deprecated, please use short name instead. The display name of the firewall policy of the association. + * + * Generated from protobuf field optional string display_name = 4473832; + * @return string + */ + public function getDisplayName() + { + return isset($this->display_name) ? $this->display_name : ''; + } + + public function hasDisplayName() + { + return isset($this->display_name); + } + + public function clearDisplayName() + { + unset($this->display_name); + } + + /** + * [Output Only] Deprecated, please use short name instead. The display name of the firewall policy of the association. + * + * Generated from protobuf field optional string display_name = 4473832; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * [Output Only] The firewall policy ID of the association. + * + * Generated from protobuf field optional string firewall_policy_id = 357211849; + * @return string + */ + public function getFirewallPolicyId() + { + return isset($this->firewall_policy_id) ? $this->firewall_policy_id : ''; + } + + public function hasFirewallPolicyId() + { + return isset($this->firewall_policy_id); + } + + public function clearFirewallPolicyId() + { + unset($this->firewall_policy_id); + } + + /** + * [Output Only] The firewall policy ID of the association. + * + * Generated from protobuf field optional string firewall_policy_id = 357211849; + * @param string $var + * @return $this + */ + public function setFirewallPolicyId($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy_id = $var; + + return $this; + } + + /** + * The name for an association. + * + * 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 for an association. + * + * 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; + } + + /** + * [Output Only] The short name of the firewall policy of the association. + * + * Generated from protobuf field optional string short_name = 492051566; + * @return string + */ + public function getShortName() + { + return isset($this->short_name) ? $this->short_name : ''; + } + + public function hasShortName() + { + return isset($this->short_name); + } + + public function clearShortName() + { + unset($this->short_name); + } + + /** + * [Output Only] The short name of the firewall policy of the association. + * + * Generated from protobuf field optional string short_name = 492051566; + * @param string $var + * @return $this + */ + public function setShortName($var) + { + GPBUtil::checkString($var, True); + $this->short_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyList.php new file mode 100644 index 000000000000..579406261ac6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyList.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.FirewallPolicyList + */ +class FirewallPolicyList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of FirewallPolicy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicy items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#firewallPolicyList for listsof FirewallPolicies + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\FirewallPolicy>|\Google\Protobuf\Internal\RepeatedField $items + * A list of FirewallPolicy resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#firewallPolicyList for listsof FirewallPolicies + * @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 \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 FirewallPolicy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicy items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of FirewallPolicy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicy items = 100526016; + * @param array<\Google\Cloud\Compute\V1\FirewallPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\FirewallPolicy::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#firewallPolicyList for listsof FirewallPolicies + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#firewallPolicyList for listsof FirewallPolicies + * + * 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] 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRule.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRule.php new file mode 100644 index 000000000000..b6f025a9433e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRule.php @@ -0,0 +1,667 @@ +google.cloud.compute.v1.FirewallPolicyRule + */ +class FirewallPolicyRule extends \Google\Protobuf\Internal\Message +{ + /** + * The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny" and "goto_next". + * + * Generated from protobuf field optional string action = 187661878; + */ + protected $action = null; + /** + * An optional description for this resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * The direction in which this rule applies. + * Check the Direction enum for the list of possible values. + * + * Generated from protobuf field optional string direction = 111150975; + */ + protected $direction = null; + /** + * Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled. + * + * Generated from protobuf field optional bool disabled = 270940796; + */ + protected $disabled = null; + /** + * Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on "goto_next" rules. + * + * Generated from protobuf field optional bool enable_logging = 295396515; + */ + protected $enable_logging = null; + /** + * [Output only] Type of the resource. Always compute#firewallPolicyRule for firewall policy rules + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + * + * Generated from protobuf field optional .google.cloud.compute.v1.FirewallPolicyRuleMatcher match = 103668165; + */ + protected $match = null; + /** + * An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority. + * + * Generated from protobuf field optional int32 priority = 445151652; + */ + protected $priority = null; + /** + * An optional name for the rule. This field is not a unique identifier and can be updated. + * + * Generated from protobuf field optional string rule_name = 55286254; + */ + protected $rule_name = null; + /** + * [Output Only] Calculation of the complexity of a single firewall policy rule. + * + * Generated from protobuf field optional int32 rule_tuple_count = 388342037; + */ + protected $rule_tuple_count = null; + /** + * A fully-qualified URL of a SecurityProfile resource instance. Example: https://networksecurity.googleapis.com/v1/projects/{project}/locations/{location}/securityProfileGroups/my-security-profile-group Must be specified if action = 'apply_security_profile_group' and cannot be specified for other actions. + * + * Generated from protobuf field optional string security_profile_group = 207411626; + */ + protected $security_profile_group = null; + /** + * A list of network resource URLs to which this rule applies. This field allows you to control which network's VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule. + * + * Generated from protobuf field repeated string target_resources = 528230647; + */ + private $target_resources; + /** + * A list of secure tags that controls which instances the firewall rule applies to. If targetSecureTag are specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the target_secure_tag are in INEFFECTIVE state, then this rule will be ignored. targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyRuleSecureTag target_secure_tags = 468132403; + */ + private $target_secure_tags; + /** + * A list of service accounts indicating the sets of instances that are applied with this rule. + * + * Generated from protobuf field repeated string target_service_accounts = 457639710; + */ + private $target_service_accounts; + /** + * Boolean flag indicating if the traffic should be TLS decrypted. Can be set only if action = 'apply_security_profile_group' and cannot be set for other actions. + * + * Generated from protobuf field optional bool tls_inspect = 43425488; + */ + protected $tls_inspect = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $action + * The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny" and "goto_next". + * @type string $description + * An optional description for this resource. + * @type string $direction + * The direction in which this rule applies. + * Check the Direction enum for the list of possible values. + * @type bool $disabled + * Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled. + * @type bool $enable_logging + * Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on "goto_next" rules. + * @type string $kind + * [Output only] Type of the resource. Always compute#firewallPolicyRule for firewall policy rules + * @type \Google\Cloud\Compute\V1\FirewallPolicyRuleMatcher $match + * A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + * @type int $priority + * An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority. + * @type string $rule_name + * An optional name for the rule. This field is not a unique identifier and can be updated. + * @type int $rule_tuple_count + * [Output Only] Calculation of the complexity of a single firewall policy rule. + * @type string $security_profile_group + * A fully-qualified URL of a SecurityProfile resource instance. Example: https://networksecurity.googleapis.com/v1/projects/{project}/locations/{location}/securityProfileGroups/my-security-profile-group Must be specified if action = 'apply_security_profile_group' and cannot be specified for other actions. + * @type array|\Google\Protobuf\Internal\RepeatedField $target_resources + * A list of network resource URLs to which this rule applies. This field allows you to control which network's VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule. + * @type array<\Google\Cloud\Compute\V1\FirewallPolicyRuleSecureTag>|\Google\Protobuf\Internal\RepeatedField $target_secure_tags + * A list of secure tags that controls which instances the firewall rule applies to. If targetSecureTag are specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the target_secure_tag are in INEFFECTIVE state, then this rule will be ignored. targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. + * @type array|\Google\Protobuf\Internal\RepeatedField $target_service_accounts + * A list of service accounts indicating the sets of instances that are applied with this rule. + * @type bool $tls_inspect + * Boolean flag indicating if the traffic should be TLS decrypted. Can be set only if action = 'apply_security_profile_group' and cannot be set for other actions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny" and "goto_next". + * + * Generated from protobuf field optional string action = 187661878; + * @return string + */ + public function getAction() + { + return isset($this->action) ? $this->action : ''; + } + + public function hasAction() + { + return isset($this->action); + } + + public function clearAction() + { + unset($this->action); + } + + /** + * The Action to perform when the client connection triggers the rule. Valid actions are "allow", "deny" and "goto_next". + * + * Generated from protobuf field optional string action = 187661878; + * @param string $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkString($var, True); + $this->action = $var; + + return $this; + } + + /** + * An optional description for this resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description for this resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The direction in which this rule applies. + * Check the Direction enum for the list of possible values. + * + * Generated from protobuf field optional string direction = 111150975; + * @return string + */ + public function getDirection() + { + return isset($this->direction) ? $this->direction : ''; + } + + public function hasDirection() + { + return isset($this->direction); + } + + public function clearDirection() + { + unset($this->direction); + } + + /** + * The direction in which this rule applies. + * Check the Direction enum for the list of possible values. + * + * Generated from protobuf field optional string direction = 111150975; + * @param string $var + * @return $this + */ + public function setDirection($var) + { + GPBUtil::checkString($var, True); + $this->direction = $var; + + return $this; + } + + /** + * Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled. + * + * Generated from protobuf field optional bool disabled = 270940796; + * @return bool + */ + public function getDisabled() + { + return isset($this->disabled) ? $this->disabled : false; + } + + public function hasDisabled() + { + return isset($this->disabled); + } + + public function clearDisabled() + { + unset($this->disabled); + } + + /** + * Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled. + * + * Generated from protobuf field optional bool disabled = 270940796; + * @param bool $var + * @return $this + */ + public function setDisabled($var) + { + GPBUtil::checkBool($var); + $this->disabled = $var; + + return $this; + } + + /** + * Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on "goto_next" rules. + * + * Generated from protobuf field optional bool enable_logging = 295396515; + * @return bool + */ + public function getEnableLogging() + { + return isset($this->enable_logging) ? $this->enable_logging : false; + } + + public function hasEnableLogging() + { + return isset($this->enable_logging); + } + + public function clearEnableLogging() + { + unset($this->enable_logging); + } + + /** + * Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on "goto_next" rules. + * + * Generated from protobuf field optional bool enable_logging = 295396515; + * @param bool $var + * @return $this + */ + public function setEnableLogging($var) + { + GPBUtil::checkBool($var); + $this->enable_logging = $var; + + return $this; + } + + /** + * [Output only] Type of the resource. Always compute#firewallPolicyRule for firewall policy rules + * + * 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); + } + + /** + * [Output only] Type of the resource. Always compute#firewallPolicyRule for firewall policy rules + * + * 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; + } + + /** + * A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + * + * Generated from protobuf field optional .google.cloud.compute.v1.FirewallPolicyRuleMatcher match = 103668165; + * @return \Google\Cloud\Compute\V1\FirewallPolicyRuleMatcher|null + */ + public function getMatch() + { + return $this->match; + } + + public function hasMatch() + { + return isset($this->match); + } + + public function clearMatch() + { + unset($this->match); + } + + /** + * A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + * + * Generated from protobuf field optional .google.cloud.compute.v1.FirewallPolicyRuleMatcher match = 103668165; + * @param \Google\Cloud\Compute\V1\FirewallPolicyRuleMatcher $var + * @return $this + */ + public function setMatch($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\FirewallPolicyRuleMatcher::class); + $this->match = $var; + + return $this; + } + + /** + * An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @return int + */ + public function getPriority() + { + return isset($this->priority) ? $this->priority : 0; + } + + public function hasPriority() + { + return isset($this->priority); + } + + public function clearPriority() + { + unset($this->priority); + } + + /** + * An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt32($var); + $this->priority = $var; + + return $this; + } + + /** + * An optional name for the rule. This field is not a unique identifier and can be updated. + * + * Generated from protobuf field optional string rule_name = 55286254; + * @return string + */ + public function getRuleName() + { + return isset($this->rule_name) ? $this->rule_name : ''; + } + + public function hasRuleName() + { + return isset($this->rule_name); + } + + public function clearRuleName() + { + unset($this->rule_name); + } + + /** + * An optional name for the rule. This field is not a unique identifier and can be updated. + * + * Generated from protobuf field optional string rule_name = 55286254; + * @param string $var + * @return $this + */ + public function setRuleName($var) + { + GPBUtil::checkString($var, True); + $this->rule_name = $var; + + return $this; + } + + /** + * [Output Only] Calculation of the complexity of a single firewall policy rule. + * + * Generated from protobuf field optional int32 rule_tuple_count = 388342037; + * @return int + */ + public function getRuleTupleCount() + { + return isset($this->rule_tuple_count) ? $this->rule_tuple_count : 0; + } + + public function hasRuleTupleCount() + { + return isset($this->rule_tuple_count); + } + + public function clearRuleTupleCount() + { + unset($this->rule_tuple_count); + } + + /** + * [Output Only] Calculation of the complexity of a single firewall policy rule. + * + * Generated from protobuf field optional int32 rule_tuple_count = 388342037; + * @param int $var + * @return $this + */ + public function setRuleTupleCount($var) + { + GPBUtil::checkInt32($var); + $this->rule_tuple_count = $var; + + return $this; + } + + /** + * A fully-qualified URL of a SecurityProfile resource instance. Example: https://networksecurity.googleapis.com/v1/projects/{project}/locations/{location}/securityProfileGroups/my-security-profile-group Must be specified if action = 'apply_security_profile_group' and cannot be specified for other actions. + * + * Generated from protobuf field optional string security_profile_group = 207411626; + * @return string + */ + public function getSecurityProfileGroup() + { + return isset($this->security_profile_group) ? $this->security_profile_group : ''; + } + + public function hasSecurityProfileGroup() + { + return isset($this->security_profile_group); + } + + public function clearSecurityProfileGroup() + { + unset($this->security_profile_group); + } + + /** + * A fully-qualified URL of a SecurityProfile resource instance. Example: https://networksecurity.googleapis.com/v1/projects/{project}/locations/{location}/securityProfileGroups/my-security-profile-group Must be specified if action = 'apply_security_profile_group' and cannot be specified for other actions. + * + * Generated from protobuf field optional string security_profile_group = 207411626; + * @param string $var + * @return $this + */ + public function setSecurityProfileGroup($var) + { + GPBUtil::checkString($var, True); + $this->security_profile_group = $var; + + return $this; + } + + /** + * A list of network resource URLs to which this rule applies. This field allows you to control which network's VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule. + * + * Generated from protobuf field repeated string target_resources = 528230647; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetResources() + { + return $this->target_resources; + } + + /** + * A list of network resource URLs to which this rule applies. This field allows you to control which network's VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule. + * + * Generated from protobuf field repeated string target_resources = 528230647; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetResources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->target_resources = $arr; + + return $this; + } + + /** + * A list of secure tags that controls which instances the firewall rule applies to. If targetSecureTag are specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the target_secure_tag are in INEFFECTIVE state, then this rule will be ignored. targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyRuleSecureTag target_secure_tags = 468132403; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetSecureTags() + { + return $this->target_secure_tags; + } + + /** + * A list of secure tags that controls which instances the firewall rule applies to. If targetSecureTag are specified, then the firewall rule applies only to instances in the VPC network that have one of those EFFECTIVE secure tags, if all the target_secure_tag are in INEFFECTIVE state, then this rule will be ignored. targetSecureTag may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureTag are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label tags allowed is 256. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyRuleSecureTag target_secure_tags = 468132403; + * @param array<\Google\Cloud\Compute\V1\FirewallPolicyRuleSecureTag>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetSecureTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\FirewallPolicyRuleSecureTag::class); + $this->target_secure_tags = $arr; + + return $this; + } + + /** + * A list of service accounts indicating the sets of instances that are applied with this rule. + * + * Generated from protobuf field repeated string target_service_accounts = 457639710; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetServiceAccounts() + { + return $this->target_service_accounts; + } + + /** + * A list of service accounts indicating the sets of instances that are applied with this rule. + * + * Generated from protobuf field repeated string target_service_accounts = 457639710; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetServiceAccounts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->target_service_accounts = $arr; + + return $this; + } + + /** + * Boolean flag indicating if the traffic should be TLS decrypted. Can be set only if action = 'apply_security_profile_group' and cannot be set for other actions. + * + * Generated from protobuf field optional bool tls_inspect = 43425488; + * @return bool + */ + public function getTlsInspect() + { + return isset($this->tls_inspect) ? $this->tls_inspect : false; + } + + public function hasTlsInspect() + { + return isset($this->tls_inspect); + } + + public function clearTlsInspect() + { + unset($this->tls_inspect); + } + + /** + * Boolean flag indicating if the traffic should be TLS decrypted. Can be set only if action = 'apply_security_profile_group' and cannot be set for other actions. + * + * Generated from protobuf field optional bool tls_inspect = 43425488; + * @param bool $var + * @return $this + */ + public function setTlsInspect($var) + { + GPBUtil::checkBool($var); + $this->tls_inspect = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRule/Direction.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRule/Direction.php new file mode 100644 index 000000000000..026ff0950ae8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRule/Direction.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.FirewallPolicyRule.Direction + */ +class Direction +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_DIRECTION = 0; + */ + const UNDEFINED_DIRECTION = 0; + /** + * Generated from protobuf enum EGRESS = 432880501; + */ + const EGRESS = 432880501; + /** + * Generated from protobuf enum INGRESS = 516931221; + */ + const INGRESS = 516931221; + + private static $valueToName = [ + self::UNDEFINED_DIRECTION => 'UNDEFINED_DIRECTION', + self::EGRESS => 'EGRESS', + self::INGRESS => 'INGRESS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Direction::class, \Google\Cloud\Compute\V1\FirewallPolicyRule_Direction::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRuleMatcher.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRuleMatcher.php new file mode 100644 index 000000000000..12f3c8215391 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRuleMatcher.php @@ -0,0 +1,441 @@ +google.cloud.compute.v1.FirewallPolicyRuleMatcher + */ +class FirewallPolicyRuleMatcher extends \Google\Protobuf\Internal\Message +{ + /** + * Address groups which should be matched against the traffic destination. Maximum number of destination address groups is 10. + * + * Generated from protobuf field repeated string dest_address_groups = 468760508; + */ + private $dest_address_groups; + /** + * Fully Qualified Domain Name (FQDN) which should be matched against traffic destination. Maximum number of destination fqdn allowed is 100. + * + * Generated from protobuf field repeated string dest_fqdns = 370712737; + */ + private $dest_fqdns; + /** + * CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 5000. + * + * Generated from protobuf field repeated string dest_ip_ranges = 337357713; + */ + private $dest_ip_ranges; + /** + * Region codes whose IP addresses will be used to match for destination of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of dest region codes allowed is 5000. + * + * Generated from protobuf field repeated string dest_region_codes = 199120280; + */ + private $dest_region_codes; + /** + * Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic destination. + * + * Generated from protobuf field repeated string dest_threat_intelligences = 119896492; + */ + private $dest_threat_intelligences; + /** + * Pairs of IP protocols and ports that the rule should match. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config layer4_configs = 373534261; + */ + private $layer4_configs; + /** + * Address groups which should be matched against the traffic source. Maximum number of source address groups is 10. + * + * Generated from protobuf field repeated string src_address_groups = 436423738; + */ + private $src_address_groups; + /** + * Fully Qualified Domain Name (FQDN) which should be matched against traffic source. Maximum number of source fqdn allowed is 100. + * + * Generated from protobuf field repeated string src_fqdns = 435906147; + */ + private $src_fqdns; + /** + * CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 5000. + * + * Generated from protobuf field repeated string src_ip_ranges = 432128083; + */ + private $src_ip_ranges; + /** + * Region codes whose IP addresses will be used to match for source of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of source region codes allowed is 5000. + * + * Generated from protobuf field repeated string src_region_codes = 99086742; + */ + private $src_region_codes; + /** + * List of secure tag values, which should be matched at the source of the traffic. For INGRESS rule, if all the srcSecureTag are INEFFECTIVE, and there is no srcIpRange, this rule will be ignored. Maximum number of source tag values allowed is 256. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyRuleSecureTag src_secure_tags = 508791302; + */ + private $src_secure_tags; + /** + * Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic source. + * + * Generated from protobuf field repeated string src_threat_intelligences = 323631018; + */ + private $src_threat_intelligences; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $dest_address_groups + * Address groups which should be matched against the traffic destination. Maximum number of destination address groups is 10. + * @type array|\Google\Protobuf\Internal\RepeatedField $dest_fqdns + * Fully Qualified Domain Name (FQDN) which should be matched against traffic destination. Maximum number of destination fqdn allowed is 100. + * @type array|\Google\Protobuf\Internal\RepeatedField $dest_ip_ranges + * CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 5000. + * @type array|\Google\Protobuf\Internal\RepeatedField $dest_region_codes + * Region codes whose IP addresses will be used to match for destination of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of dest region codes allowed is 5000. + * @type array|\Google\Protobuf\Internal\RepeatedField $dest_threat_intelligences + * Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic destination. + * @type array<\Google\Cloud\Compute\V1\FirewallPolicyRuleMatcherLayer4Config>|\Google\Protobuf\Internal\RepeatedField $layer4_configs + * Pairs of IP protocols and ports that the rule should match. + * @type array|\Google\Protobuf\Internal\RepeatedField $src_address_groups + * Address groups which should be matched against the traffic source. Maximum number of source address groups is 10. + * @type array|\Google\Protobuf\Internal\RepeatedField $src_fqdns + * Fully Qualified Domain Name (FQDN) which should be matched against traffic source. Maximum number of source fqdn allowed is 100. + * @type array|\Google\Protobuf\Internal\RepeatedField $src_ip_ranges + * CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 5000. + * @type array|\Google\Protobuf\Internal\RepeatedField $src_region_codes + * Region codes whose IP addresses will be used to match for source of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of source region codes allowed is 5000. + * @type array<\Google\Cloud\Compute\V1\FirewallPolicyRuleSecureTag>|\Google\Protobuf\Internal\RepeatedField $src_secure_tags + * List of secure tag values, which should be matched at the source of the traffic. For INGRESS rule, if all the srcSecureTag are INEFFECTIVE, and there is no srcIpRange, this rule will be ignored. Maximum number of source tag values allowed is 256. + * @type array|\Google\Protobuf\Internal\RepeatedField $src_threat_intelligences + * Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic source. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Address groups which should be matched against the traffic destination. Maximum number of destination address groups is 10. + * + * Generated from protobuf field repeated string dest_address_groups = 468760508; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDestAddressGroups() + { + return $this->dest_address_groups; + } + + /** + * Address groups which should be matched against the traffic destination. Maximum number of destination address groups is 10. + * + * Generated from protobuf field repeated string dest_address_groups = 468760508; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDestAddressGroups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->dest_address_groups = $arr; + + return $this; + } + + /** + * Fully Qualified Domain Name (FQDN) which should be matched against traffic destination. Maximum number of destination fqdn allowed is 100. + * + * Generated from protobuf field repeated string dest_fqdns = 370712737; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDestFqdns() + { + return $this->dest_fqdns; + } + + /** + * Fully Qualified Domain Name (FQDN) which should be matched against traffic destination. Maximum number of destination fqdn allowed is 100. + * + * Generated from protobuf field repeated string dest_fqdns = 370712737; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDestFqdns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->dest_fqdns = $arr; + + return $this; + } + + /** + * CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 5000. + * + * Generated from protobuf field repeated string dest_ip_ranges = 337357713; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDestIpRanges() + { + return $this->dest_ip_ranges; + } + + /** + * CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 5000. + * + * Generated from protobuf field repeated string dest_ip_ranges = 337357713; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDestIpRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->dest_ip_ranges = $arr; + + return $this; + } + + /** + * Region codes whose IP addresses will be used to match for destination of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of dest region codes allowed is 5000. + * + * Generated from protobuf field repeated string dest_region_codes = 199120280; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDestRegionCodes() + { + return $this->dest_region_codes; + } + + /** + * Region codes whose IP addresses will be used to match for destination of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of dest region codes allowed is 5000. + * + * Generated from protobuf field repeated string dest_region_codes = 199120280; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDestRegionCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->dest_region_codes = $arr; + + return $this; + } + + /** + * Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic destination. + * + * Generated from protobuf field repeated string dest_threat_intelligences = 119896492; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDestThreatIntelligences() + { + return $this->dest_threat_intelligences; + } + + /** + * Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic destination. + * + * Generated from protobuf field repeated string dest_threat_intelligences = 119896492; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDestThreatIntelligences($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->dest_threat_intelligences = $arr; + + return $this; + } + + /** + * Pairs of IP protocols and ports that the rule should match. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config layer4_configs = 373534261; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLayer4Configs() + { + return $this->layer4_configs; + } + + /** + * Pairs of IP protocols and ports that the rule should match. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config layer4_configs = 373534261; + * @param array<\Google\Cloud\Compute\V1\FirewallPolicyRuleMatcherLayer4Config>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLayer4Configs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\FirewallPolicyRuleMatcherLayer4Config::class); + $this->layer4_configs = $arr; + + return $this; + } + + /** + * Address groups which should be matched against the traffic source. Maximum number of source address groups is 10. + * + * Generated from protobuf field repeated string src_address_groups = 436423738; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSrcAddressGroups() + { + return $this->src_address_groups; + } + + /** + * Address groups which should be matched against the traffic source. Maximum number of source address groups is 10. + * + * Generated from protobuf field repeated string src_address_groups = 436423738; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSrcAddressGroups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->src_address_groups = $arr; + + return $this; + } + + /** + * Fully Qualified Domain Name (FQDN) which should be matched against traffic source. Maximum number of source fqdn allowed is 100. + * + * Generated from protobuf field repeated string src_fqdns = 435906147; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSrcFqdns() + { + return $this->src_fqdns; + } + + /** + * Fully Qualified Domain Name (FQDN) which should be matched against traffic source. Maximum number of source fqdn allowed is 100. + * + * Generated from protobuf field repeated string src_fqdns = 435906147; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSrcFqdns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->src_fqdns = $arr; + + return $this; + } + + /** + * CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 5000. + * + * Generated from protobuf field repeated string src_ip_ranges = 432128083; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSrcIpRanges() + { + return $this->src_ip_ranges; + } + + /** + * CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 5000. + * + * Generated from protobuf field repeated string src_ip_ranges = 432128083; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSrcIpRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->src_ip_ranges = $arr; + + return $this; + } + + /** + * Region codes whose IP addresses will be used to match for source of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of source region codes allowed is 5000. + * + * Generated from protobuf field repeated string src_region_codes = 99086742; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSrcRegionCodes() + { + return $this->src_region_codes; + } + + /** + * Region codes whose IP addresses will be used to match for source of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex."US" Maximum number of source region codes allowed is 5000. + * + * Generated from protobuf field repeated string src_region_codes = 99086742; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSrcRegionCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->src_region_codes = $arr; + + return $this; + } + + /** + * List of secure tag values, which should be matched at the source of the traffic. For INGRESS rule, if all the srcSecureTag are INEFFECTIVE, and there is no srcIpRange, this rule will be ignored. Maximum number of source tag values allowed is 256. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyRuleSecureTag src_secure_tags = 508791302; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSrcSecureTags() + { + return $this->src_secure_tags; + } + + /** + * List of secure tag values, which should be matched at the source of the traffic. For INGRESS rule, if all the srcSecureTag are INEFFECTIVE, and there is no srcIpRange, this rule will be ignored. Maximum number of source tag values allowed is 256. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyRuleSecureTag src_secure_tags = 508791302; + * @param array<\Google\Cloud\Compute\V1\FirewallPolicyRuleSecureTag>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSrcSecureTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\FirewallPolicyRuleSecureTag::class); + $this->src_secure_tags = $arr; + + return $this; + } + + /** + * Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic source. + * + * Generated from protobuf field repeated string src_threat_intelligences = 323631018; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSrcThreatIntelligences() + { + return $this->src_threat_intelligences; + } + + /** + * Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic source. + * + * Generated from protobuf field repeated string src_threat_intelligences = 323631018; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSrcThreatIntelligences($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->src_threat_intelligences = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRuleMatcherLayer4Config.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRuleMatcherLayer4Config.php new file mode 100644 index 000000000000..aea21ff42098 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRuleMatcherLayer4Config.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config + */ +class FirewallPolicyRuleMatcherLayer4Config extends \Google\Protobuf\Internal\Message +{ + /** + * The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number. + * + * Generated from protobuf field optional string ip_protocol = 475958960; + */ + protected $ip_protocol = null; + /** + * An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + * + * Generated from protobuf field repeated string ports = 106854418; + */ + private $ports; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ip_protocol + * The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number. + * @type array|\Google\Protobuf\Internal\RepeatedField $ports + * An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number. + * + * Generated from protobuf field optional string ip_protocol = 475958960; + * @return string + */ + public function getIpProtocol() + { + return isset($this->ip_protocol) ? $this->ip_protocol : ''; + } + + public function hasIpProtocol() + { + return isset($this->ip_protocol); + } + + public function clearIpProtocol() + { + unset($this->ip_protocol); + } + + /** + * The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number. + * + * Generated from protobuf field optional string ip_protocol = 475958960; + * @param string $var + * @return $this + */ + public function setIpProtocol($var) + { + GPBUtil::checkString($var, True); + $this->ip_protocol = $var; + + return $this; + } + + /** + * An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + * + * Generated from protobuf field repeated string ports = 106854418; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPorts() + { + return $this->ports; + } + + /** + * An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + * + * Generated from protobuf field repeated string ports = 106854418; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPorts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ports = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRuleSecureTag.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRuleSecureTag.php new file mode 100644 index 000000000000..38bd61e12736 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRuleSecureTag.php @@ -0,0 +1,124 @@ +google.cloud.compute.v1.FirewallPolicyRuleSecureTag + */ +class FirewallPolicyRuleSecureTag extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the secure tag, created with TagManager's TagValue API. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] State of the secure tag, either `EFFECTIVE` or `INEFFECTIVE`. A secure tag is `INEFFECTIVE` when it is deleted or its network is deleted. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + */ + protected $state = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of the secure tag, created with TagManager's TagValue API. + * @type string $state + * [Output Only] State of the secure tag, either `EFFECTIVE` or `INEFFECTIVE`. A secure tag is `INEFFECTIVE` when it is deleted or its network is deleted. + * Check the State enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the secure tag, created with TagManager's TagValue API. + * + * 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); + } + + /** + * Name of the secure tag, created with TagManager's TagValue API. + * + * 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; + } + + /** + * [Output Only] State of the secure tag, either `EFFECTIVE` or `INEFFECTIVE`. A secure tag is `INEFFECTIVE` when it is deleted or its network is deleted. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @return string + */ + public function getState() + { + return isset($this->state) ? $this->state : ''; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * [Output Only] State of the secure tag, either `EFFECTIVE` or `INEFFECTIVE`. A secure tag is `INEFFECTIVE` when it is deleted or its network is deleted. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRuleSecureTag/State.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRuleSecureTag/State.php new file mode 100644 index 000000000000..adcec9fc4af4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FirewallPolicyRuleSecureTag/State.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.FirewallPolicyRuleSecureTag.State + */ +class State +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATE = 0; + */ + const UNDEFINED_STATE = 0; + /** + * Generated from protobuf enum EFFECTIVE = 244201863; + */ + const EFFECTIVE = 244201863; + /** + * Generated from protobuf enum INEFFECTIVE = 304458242; + */ + const INEFFECTIVE = 304458242; + + private static $valueToName = [ + self::UNDEFINED_STATE => 'UNDEFINED_STATE', + self::EFFECTIVE => 'EFFECTIVE', + self::INEFFECTIVE => 'INEFFECTIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Compute\V1\FirewallPolicyRuleSecureTag_State::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FixedOrPercent.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FixedOrPercent.php new file mode 100644 index 000000000000..94f9e7939e6e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/FixedOrPercent.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.FixedOrPercent + */ +class FixedOrPercent extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Absolute value of VM instances calculated based on the specific mode. - If the value is fixed, then the calculated value is equal to the fixed value. - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded. + * + * Generated from protobuf field optional int32 calculated = 472082878; + */ + protected $calculated = null; + /** + * Specifies a fixed number of VM instances. This must be a positive integer. + * + * Generated from protobuf field optional int32 fixed = 97445748; + */ + protected $fixed = null; + /** + * Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%. + * + * Generated from protobuf field optional int32 percent = 394814533; + */ + protected $percent = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $calculated + * [Output Only] Absolute value of VM instances calculated based on the specific mode. - If the value is fixed, then the calculated value is equal to the fixed value. - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded. + * @type int $fixed + * Specifies a fixed number of VM instances. This must be a positive integer. + * @type int $percent + * Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Absolute value of VM instances calculated based on the specific mode. - If the value is fixed, then the calculated value is equal to the fixed value. - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded. + * + * Generated from protobuf field optional int32 calculated = 472082878; + * @return int + */ + public function getCalculated() + { + return isset($this->calculated) ? $this->calculated : 0; + } + + public function hasCalculated() + { + return isset($this->calculated); + } + + public function clearCalculated() + { + unset($this->calculated); + } + + /** + * [Output Only] Absolute value of VM instances calculated based on the specific mode. - If the value is fixed, then the calculated value is equal to the fixed value. - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded. + * + * Generated from protobuf field optional int32 calculated = 472082878; + * @param int $var + * @return $this + */ + public function setCalculated($var) + { + GPBUtil::checkInt32($var); + $this->calculated = $var; + + return $this; + } + + /** + * Specifies a fixed number of VM instances. This must be a positive integer. + * + * Generated from protobuf field optional int32 fixed = 97445748; + * @return int + */ + public function getFixed() + { + return isset($this->fixed) ? $this->fixed : 0; + } + + public function hasFixed() + { + return isset($this->fixed); + } + + public function clearFixed() + { + unset($this->fixed); + } + + /** + * Specifies a fixed number of VM instances. This must be a positive integer. + * + * Generated from protobuf field optional int32 fixed = 97445748; + * @param int $var + * @return $this + */ + public function setFixed($var) + { + GPBUtil::checkInt32($var); + $this->fixed = $var; + + return $this; + } + + /** + * Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%. + * + * Generated from protobuf field optional int32 percent = 394814533; + * @return int + */ + public function getPercent() + { + return isset($this->percent) ? $this->percent : 0; + } + + public function hasPercent() + { + return isset($this->percent); + } + + public function clearPercent() + { + unset($this->percent); + } + + /** + * Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%. + * + * Generated from protobuf field optional int32 percent = 394814533; + * @param int $var + * @return $this + */ + public function setPercent($var) + { + GPBUtil::checkInt32($var); + $this->percent = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule.php new file mode 100644 index 000000000000..e567fa8989d0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule.php @@ -0,0 +1,1543 @@ +google.cloud.compute.v1.ForwardingRule + */ +class ForwardingRule extends \Google\Protobuf\Internal\Message +{ + /** + * IP address for which this forwarding rule accepts traffic. When a client sends traffic to this IP address, the forwarding rule directs the traffic to the referenced target or backendService. While creating a forwarding rule, specifying an IPAddress is required under the following circumstances: - When the target is set to targetGrpcProxy and validateForProxyless is set to true, the IPAddress should be set to 0.0.0.0. - When the target is a Private Service Connect Google APIs bundle, you must specify an IPAddress. Otherwise, you can optionally specify an IP address that references an existing static (reserved) IP address resource. When omitted, Google Cloud assigns an ephemeral IP address. Use one of the following formats to specify an IP address while creating a forwarding rule: * IP address number, as in `100.1.2.3` * IPv6 address range, as in `2600:1234::/96` * Full resource URL, as in https://www.googleapis.com/compute/v1/projects/ project_id/regions/region/addresses/address-name * Partial URL or by name, as in: - projects/project_id/regions/region/addresses/address-name - regions/region/addresses/address-name - global/addresses/address-name - address-name The forwarding rule's target or backendService, and in most cases, also the loadBalancingScheme, determine the type of IP address that you can use. For detailed information, see [IP address specifications](https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications). When reading an IPAddress, the API always returns the IP address number. + * + * Generated from protobuf field optional string I_p_address = 42976943; + */ + protected $I_p_address = null; + /** + * The IP protocol to which this rule applies. For protocol forwarding, valid options are TCP, UDP, ESP, AH, SCTP, ICMP and L3_DEFAULT. The valid IP protocols are different for different load balancing products as described in [Load balancing features](https://cloud.google.com/load-balancing/docs/features#protocols_from_the_load_balancer_to_the_backends). + * Check the IPProtocolEnum enum for the list of possible values. + * + * Generated from protobuf field optional string I_p_protocol = 488094525; + */ + protected $I_p_protocol = null; + /** + * The ports, portRange, and allPorts fields are mutually exclusive. Only packets addressed to ports in the specified range will be forwarded to the backends configured with this forwarding rule. The allPorts field has the following limitations: - It requires that the forwarding rule IPProtocol be TCP, UDP, SCTP, or L3_DEFAULT. - It's applicable only to the following products: internal passthrough Network Load Balancers, backend service-based external passthrough Network Load Balancers, and internal and external protocol forwarding. - Set this field to true to allow packets addressed to any port or packets lacking destination port information (for example, UDP fragments after the first fragment) to be forwarded to the backends configured with this forwarding rule. The L3_DEFAULT protocol requires allPorts be set to true. + * + * Generated from protobuf field optional bool all_ports = 445175796; + */ + protected $all_ports = null; + /** + * If set to true, clients can access the internal passthrough Network Load Balancers, the regional internal Application Load Balancer, and the regional internal proxy Network Load Balancer from all regions. If false, only allows access from the local region the load balancer is located at. Note that for INTERNAL_MANAGED forwarding rules, this field cannot be changed after the forwarding rule is created. + * + * Generated from protobuf field optional bool allow_global_access = 499409674; + */ + protected $allow_global_access = null; + /** + * This is used in PSC consumer ForwardingRule to control whether the PSC endpoint can be accessed from another region. + * + * Generated from protobuf field optional bool allow_psc_global_access = 263471819; + */ + protected $allow_psc_global_access = null; + /** + * Identifies the backend service to which the forwarding rule sends traffic. Required for internal and external passthrough Network Load Balancers; must be omitted for all other load balancer types. + * + * Generated from protobuf field optional string backend_service = 306946058; + */ + protected $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; + */ + protected $base_forwarding_rule = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a ForwardingRule. Include the fingerprint in patch request to ensure that you do not overwrite changes that were applied from another concurrent request. To see the latest fingerprint, make a get() request to retrieve a ForwardingRule. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP in EXTERNAL_IPV6_FORWARDING_RULE_CREATION mode. Use one of the following formats to specify a sub-PDP when creating an IPv6 NetLB forwarding rule using BYOIP: Full resource URL, as in https://www.googleapis.com/compute/v1/projects/project_id/regions/region /publicDelegatedPrefixes/sub-pdp-name Partial URL, as in: - projects/project_id/regions/region/publicDelegatedPrefixes/sub-pdp-name - regions/region/publicDelegatedPrefixes/sub-pdp-name + * + * Generated from protobuf field optional string ip_collection = 176818358; + */ + protected $ip_collection = null; + /** + * The IP Version that will be used by this forwarding rule. Valid options are IPV4 or IPV6. + * Check the IpVersion enum for the list of possible values. + * + * Generated from protobuf field optional string ip_version = 294959552; + */ + protected $ip_version = null; + /** + * Indicates whether or not this load balancer can be used as a collector for packet mirroring. To prevent mirroring loops, instances behind this load balancer will not have their traffic mirrored even if a PacketMirroring rule applies to them. This can only be set to true for load balancers that have their loadBalancingScheme set to INTERNAL. + * + * Generated from protobuf field optional bool is_mirroring_collector = 119255164; + */ + protected $is_mirroring_collector = null; + /** + * [Output Only] Type of the resource. Always compute#forwardingRule for forwarding rule resources. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * A fingerprint for the labels being applied to this resource, 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 ForwardingRule. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + */ + protected $label_fingerprint = null; + /** + * 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. + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + /** + * Specifies the forwarding rule type. For more information about forwarding rules, refer to Forwarding rule concepts. + * Check the LoadBalancingScheme enum for the list of possible values. + * + * Generated from protobuf field optional string load_balancing_scheme = 363890244; + */ + protected $load_balancing_scheme = null; + /** + * Opaque filter criteria used by load balancer to restrict routing configuration to a limited set of xDS compliant clients. In their xDS requests to load balancer, xDS clients present node metadata. When there is a match, the relevant configuration is made available to those proxies. Otherwise, all the resources (e.g. TargetHttpProxy, UrlMap) referenced by the ForwardingRule are not visible to those proxies. For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels must match the corresponding label provided in the metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match with corresponding labels provided in the metadata. If multiple metadataFilters are specified, all of them need to be satisfied in order to be considered a match. metadataFilters specified here will be applifed before those specified in the UrlMap that this ForwardingRule references. metadataFilters only applies to Loadbalancers that have their loadBalancingScheme set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.MetadataFilter metadata_filters = 464725739; + */ + private $metadata_filters; + /** + * 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. For Private Service Connect forwarding rules that forward traffic to Google APIs, the forwarding rule name must be a 1-20 characters string with lowercase letters and numbers and must start with a letter. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * This field is not used for global external load balancing. For internal passthrough Network Load Balancers, this field identifies the network that the load balanced IP should belong to for this forwarding rule. If the subnetwork is specified, the network of the subnetwork will be used. If neither subnetwork nor this field is specified, the default network will be used. For Private Service Connect forwarding rules that forward traffic to Google APIs, a network must be provided. + * + * Generated from protobuf field optional string network = 232872494; + */ + protected $network = null; + /** + * This signifies the networking tier used for configuring this load balancer and can only take the following values: PREMIUM, STANDARD. For regional ForwardingRule, the valid values are PREMIUM and STANDARD. For GlobalForwardingRule, the valid value is PREMIUM. If this field is not specified, it is assumed to be PREMIUM. If IPAddress is specified, this value must be equal to the networkTier of the Address. + * Check the NetworkTier enum for the list of possible values. + * + * Generated from protobuf field optional string network_tier = 517397843; + */ + protected $network_tier = null; + /** + * This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. Once set, this field is not mutable. + * + * Generated from protobuf field optional bool no_automate_dns_zone = 64546991; + */ + protected $no_automate_dns_zone = null; + /** + * The ports, portRange, and allPorts fields are mutually exclusive. Only packets addressed to ports in the specified range will be forwarded to the backends configured with this forwarding rule. The portRange field has the following limitations: - It requires that the forwarding rule IPProtocol be TCP, UDP, or SCTP, and - It's applicable only to the following products: external passthrough Network Load Balancers, internal and external proxy Network Load Balancers, internal and external Application Load Balancers, external protocol forwarding, and Classic VPN. - Some products have restrictions on what ports can be used. See port specifications for details. For external forwarding rules, two or more forwarding rules cannot use the same [IPAddress, IPProtocol] pair, and cannot have overlapping portRanges. For internal forwarding rules within the same VPC network, two or more forwarding rules cannot use the same [IPAddress, IPProtocol] pair, and cannot have overlapping portRanges. @pattern: \\d+(?:-\\d+)? + * + * Generated from protobuf field optional string port_range = 217518079; + */ + protected $port_range = null; + /** + * The ports, portRange, and allPorts fields are mutually exclusive. Only packets addressed to ports in the specified range will be forwarded to the backends configured with this forwarding rule. The ports field has the following limitations: - It requires that the forwarding rule IPProtocol be TCP, UDP, or SCTP, and - It's applicable only to the following products: internal passthrough Network Load Balancers, backend service-based external passthrough Network Load Balancers, and internal protocol forwarding. - You can specify a list of up to five ports by number, separated by commas. The ports can be contiguous or discontiguous. For external forwarding rules, two or more forwarding rules cannot use the same [IPAddress, IPProtocol] pair if they share at least one port number. For internal forwarding rules within the same VPC network, two or more forwarding rules cannot use the same [IPAddress, IPProtocol] pair if they share at least one port number. @pattern: \\d+(?:-\\d+)? + * + * Generated from protobuf field repeated string ports = 106854418; + */ + private $ports; + /** + * [Output Only] The PSC connection id of the PSC forwarding rule. + * + * Generated from protobuf field optional uint64 psc_connection_id = 292082397; + */ + protected $psc_connection_id = null; + /** + * + * Check the PscConnectionStatus enum for the list of possible values. + * + * Generated from protobuf field optional string psc_connection_status = 184149172; + */ + protected $psc_connection_status = null; + /** + * [Output Only] URL of the region where the regional forwarding rule resides. This field is not applicable to global forwarding rules. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * Service Directory resources to register this forwarding rule with. Currently, only supports a single Service Directory resource. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration service_directory_registrations = 223549694; + */ + private $service_directory_registrations; + /** + * 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. + * + * Generated from protobuf field optional string service_label = 417008874; + */ + protected $service_label = null; + /** + * [Output Only] The internal fully qualified service name for this forwarding rule. This field is only used for internal load balancing. + * + * Generated from protobuf field optional string service_name = 359880149; + */ + protected $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 with internal load balancers and external passthrough Network Load Balancers 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. + * + * Generated from protobuf field optional string subnetwork = 307827694; + */ + protected $subnetwork = null; + /** + * The URL of the target resource to receive the matched traffic. For regional forwarding rules, this target must be in the same region as the forwarding rule. For global forwarding rules, this target must be a global load balancing resource. The forwarded traffic must be of a type appropriate to the target object. - For load balancers, see the "Target" column in [Port specifications](https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications). - For Private Service Connect forwarding rules that forward traffic to Google APIs, provide the name of a supported Google API bundle: - vpc-sc - APIs that support VPC Service Controls. - all-apis - All supported Google APIs. - For Private Service Connect forwarding rules that forward traffic to managed services, the target must be a service attachment. The target is not mutable once set as a service attachment. + * + * Generated from protobuf field optional string target = 192835985; + */ + protected $target = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $I_p_address + * IP address for which this forwarding rule accepts traffic. When a client sends traffic to this IP address, the forwarding rule directs the traffic to the referenced target or backendService. While creating a forwarding rule, specifying an IPAddress is required under the following circumstances: - When the target is set to targetGrpcProxy and validateForProxyless is set to true, the IPAddress should be set to 0.0.0.0. - When the target is a Private Service Connect Google APIs bundle, you must specify an IPAddress. Otherwise, you can optionally specify an IP address that references an existing static (reserved) IP address resource. When omitted, Google Cloud assigns an ephemeral IP address. Use one of the following formats to specify an IP address while creating a forwarding rule: * IP address number, as in `100.1.2.3` * IPv6 address range, as in `2600:1234::/96` * Full resource URL, as in https://www.googleapis.com/compute/v1/projects/ project_id/regions/region/addresses/address-name * Partial URL or by name, as in: - projects/project_id/regions/region/addresses/address-name - regions/region/addresses/address-name - global/addresses/address-name - address-name The forwarding rule's target or backendService, and in most cases, also the loadBalancingScheme, determine the type of IP address that you can use. For detailed information, see [IP address specifications](https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications). When reading an IPAddress, the API always returns the IP address number. + * @type string $I_p_protocol + * The IP protocol to which this rule applies. For protocol forwarding, valid options are TCP, UDP, ESP, AH, SCTP, ICMP and L3_DEFAULT. The valid IP protocols are different for different load balancing products as described in [Load balancing features](https://cloud.google.com/load-balancing/docs/features#protocols_from_the_load_balancer_to_the_backends). + * Check the IPProtocolEnum enum for the list of possible values. + * @type bool $all_ports + * The ports, portRange, and allPorts fields are mutually exclusive. Only packets addressed to ports in the specified range will be forwarded to the backends configured with this forwarding rule. The allPorts field has the following limitations: - It requires that the forwarding rule IPProtocol be TCP, UDP, SCTP, or L3_DEFAULT. - It's applicable only to the following products: internal passthrough Network Load Balancers, backend service-based external passthrough Network Load Balancers, and internal and external protocol forwarding. - Set this field to true to allow packets addressed to any port or packets lacking destination port information (for example, UDP fragments after the first fragment) to be forwarded to the backends configured with this forwarding rule. The L3_DEFAULT protocol requires allPorts be set to true. + * @type bool $allow_global_access + * If set to true, clients can access the internal passthrough Network Load Balancers, the regional internal Application Load Balancer, and the regional internal proxy Network Load Balancer from all regions. If false, only allows access from the local region the load balancer is located at. Note that for INTERNAL_MANAGED forwarding rules, this field cannot be changed after the forwarding rule is created. + * @type bool $allow_psc_global_access + * This is used in PSC consumer ForwardingRule to control whether the PSC endpoint can be accessed from another region. + * @type string $backend_service + * Identifies the backend service to which the forwarding rule sends traffic. Required for internal and external passthrough Network Load Balancers; 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 + * An optional description of this resource. Provide this property when you create the resource. + * @type string $fingerprint + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a ForwardingRule. Include the fingerprint in patch request to ensure that you do not overwrite changes that were applied from another concurrent request. To see the latest fingerprint, make a get() request to retrieve a ForwardingRule. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $ip_collection + * Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP in EXTERNAL_IPV6_FORWARDING_RULE_CREATION mode. Use one of the following formats to specify a sub-PDP when creating an IPv6 NetLB forwarding rule using BYOIP: Full resource URL, as in https://www.googleapis.com/compute/v1/projects/project_id/regions/region /publicDelegatedPrefixes/sub-pdp-name Partial URL, as in: - projects/project_id/regions/region/publicDelegatedPrefixes/sub-pdp-name - regions/region/publicDelegatedPrefixes/sub-pdp-name + * @type string $ip_version + * The IP Version that will be used by this forwarding rule. Valid options are IPV4 or IPV6. + * Check the IpVersion enum for the list of possible values. + * @type bool $is_mirroring_collector + * Indicates whether or not this load balancer can be used as a collector for packet mirroring. To prevent mirroring loops, instances behind this load balancer will not have their traffic mirrored even if a PacketMirroring rule applies to them. This can only be set to true for load balancers that have their loadBalancingScheme set to INTERNAL. + * @type string $kind + * [Output Only] Type of the resource. Always compute#forwardingRule for forwarding rule resources. + * @type string $label_fingerprint + * A fingerprint for the labels being applied to this resource, 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 ForwardingRule. + * @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 $load_balancing_scheme + * Specifies the forwarding rule type. For more information about forwarding rules, refer to Forwarding rule concepts. + * Check the LoadBalancingScheme enum for the list of possible values. + * @type array<\Google\Cloud\Compute\V1\MetadataFilter>|\Google\Protobuf\Internal\RepeatedField $metadata_filters + * Opaque filter criteria used by load balancer to restrict routing configuration to a limited set of xDS compliant clients. In their xDS requests to load balancer, xDS clients present node metadata. When there is a match, the relevant configuration is made available to those proxies. Otherwise, all the resources (e.g. TargetHttpProxy, UrlMap) referenced by the ForwardingRule are not visible to those proxies. For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels must match the corresponding label provided in the metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match with corresponding labels provided in the metadata. If multiple metadataFilters are specified, all of them need to be satisfied in order to be considered a match. metadataFilters specified here will be applifed before those specified in the UrlMap that this ForwardingRule references. metadataFilters only applies to Loadbalancers that have their loadBalancingScheme set to INTERNAL_SELF_MANAGED. + * @type string $name + * 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. For Private Service Connect forwarding rules that forward traffic to Google APIs, the forwarding rule name must be a 1-20 characters string with lowercase letters and numbers and must start with a letter. + * @type string $network + * This field is not used for global external load balancing. For internal passthrough Network Load Balancers, this field identifies the network that the load balanced IP should belong to for this forwarding rule. If the subnetwork is specified, the network of the subnetwork will be used. If neither subnetwork nor this field is specified, the default network will be used. For Private Service Connect forwarding rules that forward traffic to Google APIs, a network must be provided. + * @type string $network_tier + * This signifies the networking tier used for configuring this load balancer and can only take the following values: PREMIUM, STANDARD. For regional ForwardingRule, the valid values are PREMIUM and STANDARD. For GlobalForwardingRule, the valid value is PREMIUM. If this field is not specified, it is assumed to be PREMIUM. If IPAddress is specified, this value must be equal to the networkTier of the Address. + * Check the NetworkTier enum for the list of possible values. + * @type bool $no_automate_dns_zone + * This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. Once set, this field is not mutable. + * @type string $port_range + * The ports, portRange, and allPorts fields are mutually exclusive. Only packets addressed to ports in the specified range will be forwarded to the backends configured with this forwarding rule. The portRange field has the following limitations: - It requires that the forwarding rule IPProtocol be TCP, UDP, or SCTP, and - It's applicable only to the following products: external passthrough Network Load Balancers, internal and external proxy Network Load Balancers, internal and external Application Load Balancers, external protocol forwarding, and Classic VPN. - Some products have restrictions on what ports can be used. See port specifications for details. For external forwarding rules, two or more forwarding rules cannot use the same [IPAddress, IPProtocol] pair, and cannot have overlapping portRanges. For internal forwarding rules within the same VPC network, two or more forwarding rules cannot use the same [IPAddress, IPProtocol] pair, and cannot have overlapping portRanges. @pattern: \\d+(?:-\\d+)? + * @type array|\Google\Protobuf\Internal\RepeatedField $ports + * The ports, portRange, and allPorts fields are mutually exclusive. Only packets addressed to ports in the specified range will be forwarded to the backends configured with this forwarding rule. The ports field has the following limitations: - It requires that the forwarding rule IPProtocol be TCP, UDP, or SCTP, and - It's applicable only to the following products: internal passthrough Network Load Balancers, backend service-based external passthrough Network Load Balancers, and internal protocol forwarding. - You can specify a list of up to five ports by number, separated by commas. The ports can be contiguous or discontiguous. For external forwarding rules, two or more forwarding rules cannot use the same [IPAddress, IPProtocol] pair if they share at least one port number. For internal forwarding rules within the same VPC network, two or more forwarding rules cannot use the same [IPAddress, IPProtocol] pair if they share at least one port number. @pattern: \\d+(?:-\\d+)? + * @type int|string $psc_connection_id + * [Output Only] The PSC connection id of the PSC forwarding rule. + * @type string $psc_connection_status + * + * Check the PscConnectionStatus enum for the list of possible values. + * @type string $region + * [Output Only] URL of the region where the regional forwarding rule resides. This field is not applicable to global forwarding rules. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type array<\Google\Cloud\Compute\V1\ForwardingRuleServiceDirectoryRegistration>|\Google\Protobuf\Internal\RepeatedField $service_directory_registrations + * Service Directory resources to register this forwarding rule with. Currently, only supports a single Service Directory resource. + * @type string $service_label + * 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 with internal load balancers and external passthrough Network Load Balancers 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 + * The URL of the target resource to receive the matched traffic. For regional forwarding rules, this target must be in the same region as the forwarding rule. For global forwarding rules, this target must be a global load balancing resource. The forwarded traffic must be of a type appropriate to the target object. - For load balancers, see the "Target" column in [Port specifications](https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications). - For Private Service Connect forwarding rules that forward traffic to Google APIs, provide the name of a supported Google API bundle: - vpc-sc - APIs that support VPC Service Controls. - all-apis - All supported Google APIs. - For Private Service Connect forwarding rules that forward traffic to managed services, the target must be a service attachment. The target is not mutable once set as a service attachment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * IP address for which this forwarding rule accepts traffic. When a client sends traffic to this IP address, the forwarding rule directs the traffic to the referenced target or backendService. While creating a forwarding rule, specifying an IPAddress is required under the following circumstances: - When the target is set to targetGrpcProxy and validateForProxyless is set to true, the IPAddress should be set to 0.0.0.0. - When the target is a Private Service Connect Google APIs bundle, you must specify an IPAddress. Otherwise, you can optionally specify an IP address that references an existing static (reserved) IP address resource. When omitted, Google Cloud assigns an ephemeral IP address. Use one of the following formats to specify an IP address while creating a forwarding rule: * IP address number, as in `100.1.2.3` * IPv6 address range, as in `2600:1234::/96` * Full resource URL, as in https://www.googleapis.com/compute/v1/projects/ project_id/regions/region/addresses/address-name * Partial URL or by name, as in: - projects/project_id/regions/region/addresses/address-name - regions/region/addresses/address-name - global/addresses/address-name - address-name The forwarding rule's target or backendService, and in most cases, also the loadBalancingScheme, determine the type of IP address that you can use. For detailed information, see [IP address specifications](https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications). When reading an IPAddress, the API always returns the IP address number. + * + * Generated from protobuf field optional string I_p_address = 42976943; + * @return string + */ + public function getIPAddress() + { + return isset($this->I_p_address) ? $this->I_p_address : ''; + } + + public function hasIPAddress() + { + return isset($this->I_p_address); + } + + public function clearIPAddress() + { + unset($this->I_p_address); + } + + /** + * IP address for which this forwarding rule accepts traffic. When a client sends traffic to this IP address, the forwarding rule directs the traffic to the referenced target or backendService. While creating a forwarding rule, specifying an IPAddress is required under the following circumstances: - When the target is set to targetGrpcProxy and validateForProxyless is set to true, the IPAddress should be set to 0.0.0.0. - When the target is a Private Service Connect Google APIs bundle, you must specify an IPAddress. Otherwise, you can optionally specify an IP address that references an existing static (reserved) IP address resource. When omitted, Google Cloud assigns an ephemeral IP address. Use one of the following formats to specify an IP address while creating a forwarding rule: * IP address number, as in `100.1.2.3` * IPv6 address range, as in `2600:1234::/96` * Full resource URL, as in https://www.googleapis.com/compute/v1/projects/ project_id/regions/region/addresses/address-name * Partial URL or by name, as in: - projects/project_id/regions/region/addresses/address-name - regions/region/addresses/address-name - global/addresses/address-name - address-name The forwarding rule's target or backendService, and in most cases, also the loadBalancingScheme, determine the type of IP address that you can use. For detailed information, see [IP address specifications](https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications). When reading an IPAddress, the API always returns the IP address number. + * + * Generated from protobuf field optional string I_p_address = 42976943; + * @param string $var + * @return $this + */ + public function setIPAddress($var) + { + GPBUtil::checkString($var, True); + $this->I_p_address = $var; + + return $this; + } + + /** + * The IP protocol to which this rule applies. For protocol forwarding, valid options are TCP, UDP, ESP, AH, SCTP, ICMP and L3_DEFAULT. The valid IP protocols are different for different load balancing products as described in [Load balancing features](https://cloud.google.com/load-balancing/docs/features#protocols_from_the_load_balancer_to_the_backends). + * Check the IPProtocolEnum enum for the list of possible values. + * + * Generated from protobuf field optional string I_p_protocol = 488094525; + * @return string + */ + public function getIPProtocol() + { + return isset($this->I_p_protocol) ? $this->I_p_protocol : ''; + } + + public function hasIPProtocol() + { + return isset($this->I_p_protocol); + } + + public function clearIPProtocol() + { + unset($this->I_p_protocol); + } + + /** + * The IP protocol to which this rule applies. For protocol forwarding, valid options are TCP, UDP, ESP, AH, SCTP, ICMP and L3_DEFAULT. The valid IP protocols are different for different load balancing products as described in [Load balancing features](https://cloud.google.com/load-balancing/docs/features#protocols_from_the_load_balancer_to_the_backends). + * Check the IPProtocolEnum enum for the list of possible values. + * + * Generated from protobuf field optional string I_p_protocol = 488094525; + * @param string $var + * @return $this + */ + public function setIPProtocol($var) + { + GPBUtil::checkString($var, True); + $this->I_p_protocol = $var; + + return $this; + } + + /** + * The ports, portRange, and allPorts fields are mutually exclusive. Only packets addressed to ports in the specified range will be forwarded to the backends configured with this forwarding rule. The allPorts field has the following limitations: - It requires that the forwarding rule IPProtocol be TCP, UDP, SCTP, or L3_DEFAULT. - It's applicable only to the following products: internal passthrough Network Load Balancers, backend service-based external passthrough Network Load Balancers, and internal and external protocol forwarding. - Set this field to true to allow packets addressed to any port or packets lacking destination port information (for example, UDP fragments after the first fragment) to be forwarded to the backends configured with this forwarding rule. The L3_DEFAULT protocol requires allPorts be set to true. + * + * Generated from protobuf field optional bool all_ports = 445175796; + * @return bool + */ + public function getAllPorts() + { + return isset($this->all_ports) ? $this->all_ports : false; + } + + public function hasAllPorts() + { + return isset($this->all_ports); + } + + public function clearAllPorts() + { + unset($this->all_ports); + } + + /** + * The ports, portRange, and allPorts fields are mutually exclusive. Only packets addressed to ports in the specified range will be forwarded to the backends configured with this forwarding rule. The allPorts field has the following limitations: - It requires that the forwarding rule IPProtocol be TCP, UDP, SCTP, or L3_DEFAULT. - It's applicable only to the following products: internal passthrough Network Load Balancers, backend service-based external passthrough Network Load Balancers, and internal and external protocol forwarding. - Set this field to true to allow packets addressed to any port or packets lacking destination port information (for example, UDP fragments after the first fragment) to be forwarded to the backends configured with this forwarding rule. The L3_DEFAULT protocol requires allPorts be set to true. + * + * Generated from protobuf field optional bool all_ports = 445175796; + * @param bool $var + * @return $this + */ + public function setAllPorts($var) + { + GPBUtil::checkBool($var); + $this->all_ports = $var; + + return $this; + } + + /** + * If set to true, clients can access the internal passthrough Network Load Balancers, the regional internal Application Load Balancer, and the regional internal proxy Network Load Balancer from all regions. If false, only allows access from the local region the load balancer is located at. Note that for INTERNAL_MANAGED forwarding rules, this field cannot be changed after the forwarding rule is created. + * + * Generated from protobuf field optional bool allow_global_access = 499409674; + * @return bool + */ + public function getAllowGlobalAccess() + { + return isset($this->allow_global_access) ? $this->allow_global_access : false; + } + + public function hasAllowGlobalAccess() + { + return isset($this->allow_global_access); + } + + public function clearAllowGlobalAccess() + { + unset($this->allow_global_access); + } + + /** + * If set to true, clients can access the internal passthrough Network Load Balancers, the regional internal Application Load Balancer, and the regional internal proxy Network Load Balancer from all regions. If false, only allows access from the local region the load balancer is located at. Note that for INTERNAL_MANAGED forwarding rules, this field cannot be changed after the forwarding rule is created. + * + * Generated from protobuf field optional bool allow_global_access = 499409674; + * @param bool $var + * @return $this + */ + public function setAllowGlobalAccess($var) + { + GPBUtil::checkBool($var); + $this->allow_global_access = $var; + + return $this; + } + + /** + * This is used in PSC consumer ForwardingRule to control whether the PSC endpoint can be accessed from another region. + * + * Generated from protobuf field optional bool allow_psc_global_access = 263471819; + * @return bool + */ + public function getAllowPscGlobalAccess() + { + return isset($this->allow_psc_global_access) ? $this->allow_psc_global_access : false; + } + + public function hasAllowPscGlobalAccess() + { + return isset($this->allow_psc_global_access); + } + + public function clearAllowPscGlobalAccess() + { + unset($this->allow_psc_global_access); + } + + /** + * This is used in PSC consumer ForwardingRule to control whether the PSC endpoint can be accessed from another region. + * + * Generated from protobuf field optional bool allow_psc_global_access = 263471819; + * @param bool $var + * @return $this + */ + public function setAllowPscGlobalAccess($var) + { + GPBUtil::checkBool($var); + $this->allow_psc_global_access = $var; + + return $this; + } + + /** + * Identifies the backend service to which the forwarding rule sends traffic. Required for internal and external passthrough Network Load Balancers; must be omitted for all other load balancer types. + * + * Generated from protobuf field optional string backend_service = 306946058; + * @return string + */ + public function getBackendService() + { + return isset($this->backend_service) ? $this->backend_service : ''; + } + + public function hasBackendService() + { + return isset($this->backend_service); + } + + public function clearBackendService() + { + unset($this->backend_service); + } + + /** + * Identifies the backend service to which the forwarding rule sends traffic. Required for internal and external passthrough Network Load Balancers; must be omitted for all other load balancer types. + * + * Generated from protobuf field optional string backend_service = 306946058; + * @param string $var + * @return $this + */ + public function setBackendService($var) + { + GPBUtil::checkString($var, True); + $this->backend_service = $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. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a ForwardingRule. Include the fingerprint in patch request to ensure that you do not overwrite changes that were applied from another concurrent request. To see the latest fingerprint, make a get() request to retrieve a ForwardingRule. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a ForwardingRule. Include the fingerprint in patch request to ensure that you do not overwrite changes that were applied from another concurrent request. To see the latest fingerprint, make a get() request to retrieve a ForwardingRule. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP in EXTERNAL_IPV6_FORWARDING_RULE_CREATION mode. Use one of the following formats to specify a sub-PDP when creating an IPv6 NetLB forwarding rule using BYOIP: Full resource URL, as in https://www.googleapis.com/compute/v1/projects/project_id/regions/region /publicDelegatedPrefixes/sub-pdp-name Partial URL, as in: - projects/project_id/regions/region/publicDelegatedPrefixes/sub-pdp-name - regions/region/publicDelegatedPrefixes/sub-pdp-name + * + * Generated from protobuf field optional string ip_collection = 176818358; + * @return string + */ + public function getIpCollection() + { + return isset($this->ip_collection) ? $this->ip_collection : ''; + } + + public function hasIpCollection() + { + return isset($this->ip_collection); + } + + public function clearIpCollection() + { + unset($this->ip_collection); + } + + /** + * Resource reference of a PublicDelegatedPrefix. The PDP must be a sub-PDP in EXTERNAL_IPV6_FORWARDING_RULE_CREATION mode. Use one of the following formats to specify a sub-PDP when creating an IPv6 NetLB forwarding rule using BYOIP: Full resource URL, as in https://www.googleapis.com/compute/v1/projects/project_id/regions/region /publicDelegatedPrefixes/sub-pdp-name Partial URL, as in: - projects/project_id/regions/region/publicDelegatedPrefixes/sub-pdp-name - regions/region/publicDelegatedPrefixes/sub-pdp-name + * + * Generated from protobuf field optional string ip_collection = 176818358; + * @param string $var + * @return $this + */ + public function setIpCollection($var) + { + GPBUtil::checkString($var, True); + $this->ip_collection = $var; + + return $this; + } + + /** + * The IP Version that will be used by this forwarding rule. Valid options are IPV4 or IPV6. + * Check the IpVersion enum for the list of possible values. + * + * Generated from protobuf field optional string ip_version = 294959552; + * @return string + */ + public function getIpVersion() + { + return isset($this->ip_version) ? $this->ip_version : ''; + } + + public function hasIpVersion() + { + return isset($this->ip_version); + } + + public function clearIpVersion() + { + unset($this->ip_version); + } + + /** + * The IP Version that will be used by this forwarding rule. Valid options are IPV4 or IPV6. + * Check the IpVersion enum for the list of possible values. + * + * Generated from protobuf field optional string ip_version = 294959552; + * @param string $var + * @return $this + */ + public function setIpVersion($var) + { + GPBUtil::checkString($var, True); + $this->ip_version = $var; + + return $this; + } + + /** + * Indicates whether or not this load balancer can be used as a collector for packet mirroring. To prevent mirroring loops, instances behind this load balancer will not have their traffic mirrored even if a PacketMirroring rule applies to them. This can only be set to true for load balancers that have their loadBalancingScheme set to INTERNAL. + * + * Generated from protobuf field optional bool is_mirroring_collector = 119255164; + * @return bool + */ + public function getIsMirroringCollector() + { + return isset($this->is_mirroring_collector) ? $this->is_mirroring_collector : false; + } + + public function hasIsMirroringCollector() + { + return isset($this->is_mirroring_collector); + } + + public function clearIsMirroringCollector() + { + unset($this->is_mirroring_collector); + } + + /** + * Indicates whether or not this load balancer can be used as a collector for packet mirroring. To prevent mirroring loops, instances behind this load balancer will not have their traffic mirrored even if a PacketMirroring rule applies to them. This can only be set to true for load balancers that have their loadBalancingScheme set to INTERNAL. + * + * Generated from protobuf field optional bool is_mirroring_collector = 119255164; + * @param bool $var + * @return $this + */ + public function setIsMirroringCollector($var) + { + GPBUtil::checkBool($var); + $this->is_mirroring_collector = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#forwardingRule for forwarding rule resources. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#forwardingRule for forwarding rule resources. + * + * 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; + } + + /** + * A fingerprint for the labels being applied to this resource, 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 ForwardingRule. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @return string + */ + public function getLabelFingerprint() + { + return isset($this->label_fingerprint) ? $this->label_fingerprint : ''; + } + + public function hasLabelFingerprint() + { + return isset($this->label_fingerprint); + } + + public function clearLabelFingerprint() + { + unset($this->label_fingerprint); + } + + /** + * A fingerprint for the labels being applied to this resource, 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 ForwardingRule. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @param string $var + * @return $this + */ + public function setLabelFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->label_fingerprint = $var; + + return $this; + } + + /** + * 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. + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->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. + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Specifies the forwarding rule type. For more information about forwarding rules, refer to Forwarding rule concepts. + * Check the LoadBalancingScheme enum for the list of possible values. + * + * Generated from protobuf field optional string load_balancing_scheme = 363890244; + * @return string + */ + public function getLoadBalancingScheme() + { + return isset($this->load_balancing_scheme) ? $this->load_balancing_scheme : ''; + } + + public function hasLoadBalancingScheme() + { + return isset($this->load_balancing_scheme); + } + + public function clearLoadBalancingScheme() + { + unset($this->load_balancing_scheme); + } + + /** + * Specifies the forwarding rule type. For more information about forwarding rules, refer to Forwarding rule concepts. + * Check the LoadBalancingScheme enum for the list of possible values. + * + * Generated from protobuf field optional string load_balancing_scheme = 363890244; + * @param string $var + * @return $this + */ + public function setLoadBalancingScheme($var) + { + GPBUtil::checkString($var, True); + $this->load_balancing_scheme = $var; + + return $this; + } + + /** + * Opaque filter criteria used by load balancer to restrict routing configuration to a limited set of xDS compliant clients. In their xDS requests to load balancer, xDS clients present node metadata. When there is a match, the relevant configuration is made available to those proxies. Otherwise, all the resources (e.g. TargetHttpProxy, UrlMap) referenced by the ForwardingRule are not visible to those proxies. For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels must match the corresponding label provided in the metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match with corresponding labels provided in the metadata. If multiple metadataFilters are specified, all of them need to be satisfied in order to be considered a match. metadataFilters specified here will be applifed before those specified in the UrlMap that this ForwardingRule references. metadataFilters only applies to Loadbalancers that have their loadBalancingScheme set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.MetadataFilter metadata_filters = 464725739; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMetadataFilters() + { + return $this->metadata_filters; + } + + /** + * Opaque filter criteria used by load balancer to restrict routing configuration to a limited set of xDS compliant clients. In their xDS requests to load balancer, xDS clients present node metadata. When there is a match, the relevant configuration is made available to those proxies. Otherwise, all the resources (e.g. TargetHttpProxy, UrlMap) referenced by the ForwardingRule are not visible to those proxies. For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels must match the corresponding label provided in the metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match with corresponding labels provided in the metadata. If multiple metadataFilters are specified, all of them need to be satisfied in order to be considered a match. metadataFilters specified here will be applifed before those specified in the UrlMap that this ForwardingRule references. metadataFilters only applies to Loadbalancers that have their loadBalancingScheme set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.MetadataFilter metadata_filters = 464725739; + * @param array<\Google\Cloud\Compute\V1\MetadataFilter>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMetadataFilters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\MetadataFilter::class); + $this->metadata_filters = $arr; + + return $this; + } + + /** + * 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. For Private Service Connect forwarding rules that forward traffic to Google APIs, the forwarding rule name must be a 1-20 characters string with lowercase letters and numbers and must start with a letter. + * + * 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); + } + + /** + * 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. For Private Service Connect forwarding rules that forward traffic to Google APIs, the forwarding rule name must be a 1-20 characters string with lowercase letters and numbers and must start with a letter. + * + * 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; + } + + /** + * This field is not used for global external load balancing. For internal passthrough Network Load Balancers, this field identifies the network that the load balanced IP should belong to for this forwarding rule. If the subnetwork is specified, the network of the subnetwork will be used. If neither subnetwork nor this field is specified, the default network will be used. For Private Service Connect forwarding rules that forward traffic to Google APIs, a network must be provided. + * + * Generated from protobuf field optional string network = 232872494; + * @return string + */ + public function getNetwork() + { + return isset($this->network) ? $this->network : ''; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * This field is not used for global external load balancing. For internal passthrough Network Load Balancers, this field identifies the network that the load balanced IP should belong to for this forwarding rule. If the subnetwork is specified, the network of the subnetwork will be used. If neither subnetwork nor this field is specified, the default network will be used. For Private Service Connect forwarding rules that forward traffic to Google APIs, a network must be provided. + * + * Generated from protobuf field optional string network = 232872494; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * This signifies the networking tier used for configuring this load balancer and can only take the following values: PREMIUM, STANDARD. For regional ForwardingRule, the valid values are PREMIUM and STANDARD. For GlobalForwardingRule, the valid value is PREMIUM. If this field is not specified, it is assumed to be PREMIUM. If IPAddress is specified, this value must be equal to the networkTier of the Address. + * Check the NetworkTier enum for the list of possible values. + * + * Generated from protobuf field optional string network_tier = 517397843; + * @return string + */ + public function getNetworkTier() + { + return isset($this->network_tier) ? $this->network_tier : ''; + } + + public function hasNetworkTier() + { + return isset($this->network_tier); + } + + public function clearNetworkTier() + { + unset($this->network_tier); + } + + /** + * This signifies the networking tier used for configuring this load balancer and can only take the following values: PREMIUM, STANDARD. For regional ForwardingRule, the valid values are PREMIUM and STANDARD. For GlobalForwardingRule, the valid value is PREMIUM. If this field is not specified, it is assumed to be PREMIUM. If IPAddress is specified, this value must be equal to the networkTier of the Address. + * Check the NetworkTier enum for the list of possible values. + * + * Generated from protobuf field optional string network_tier = 517397843; + * @param string $var + * @return $this + */ + public function setNetworkTier($var) + { + GPBUtil::checkString($var, True); + $this->network_tier = $var; + + return $this; + } + + /** + * This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. Once set, this field is not mutable. + * + * Generated from protobuf field optional bool no_automate_dns_zone = 64546991; + * @return bool + */ + public function getNoAutomateDnsZone() + { + return isset($this->no_automate_dns_zone) ? $this->no_automate_dns_zone : false; + } + + public function hasNoAutomateDnsZone() + { + return isset($this->no_automate_dns_zone); + } + + public function clearNoAutomateDnsZone() + { + unset($this->no_automate_dns_zone); + } + + /** + * This is used in PSC consumer ForwardingRule to control whether it should try to auto-generate a DNS zone or not. Non-PSC forwarding rules do not use this field. Once set, this field is not mutable. + * + * Generated from protobuf field optional bool no_automate_dns_zone = 64546991; + * @param bool $var + * @return $this + */ + public function setNoAutomateDnsZone($var) + { + GPBUtil::checkBool($var); + $this->no_automate_dns_zone = $var; + + return $this; + } + + /** + * The ports, portRange, and allPorts fields are mutually exclusive. Only packets addressed to ports in the specified range will be forwarded to the backends configured with this forwarding rule. The portRange field has the following limitations: - It requires that the forwarding rule IPProtocol be TCP, UDP, or SCTP, and - It's applicable only to the following products: external passthrough Network Load Balancers, internal and external proxy Network Load Balancers, internal and external Application Load Balancers, external protocol forwarding, and Classic VPN. - Some products have restrictions on what ports can be used. See port specifications for details. For external forwarding rules, two or more forwarding rules cannot use the same [IPAddress, IPProtocol] pair, and cannot have overlapping portRanges. For internal forwarding rules within the same VPC network, two or more forwarding rules cannot use the same [IPAddress, IPProtocol] pair, and cannot have overlapping portRanges. @pattern: \\d+(?:-\\d+)? + * + * Generated from protobuf field optional string port_range = 217518079; + * @return string + */ + public function getPortRange() + { + return isset($this->port_range) ? $this->port_range : ''; + } + + public function hasPortRange() + { + return isset($this->port_range); + } + + public function clearPortRange() + { + unset($this->port_range); + } + + /** + * The ports, portRange, and allPorts fields are mutually exclusive. Only packets addressed to ports in the specified range will be forwarded to the backends configured with this forwarding rule. The portRange field has the following limitations: - It requires that the forwarding rule IPProtocol be TCP, UDP, or SCTP, and - It's applicable only to the following products: external passthrough Network Load Balancers, internal and external proxy Network Load Balancers, internal and external Application Load Balancers, external protocol forwarding, and Classic VPN. - Some products have restrictions on what ports can be used. See port specifications for details. For external forwarding rules, two or more forwarding rules cannot use the same [IPAddress, IPProtocol] pair, and cannot have overlapping portRanges. For internal forwarding rules within the same VPC network, two or more forwarding rules cannot use the same [IPAddress, IPProtocol] pair, and cannot have overlapping portRanges. @pattern: \\d+(?:-\\d+)? + * + * Generated from protobuf field optional string port_range = 217518079; + * @param string $var + * @return $this + */ + public function setPortRange($var) + { + GPBUtil::checkString($var, True); + $this->port_range = $var; + + return $this; + } + + /** + * The ports, portRange, and allPorts fields are mutually exclusive. Only packets addressed to ports in the specified range will be forwarded to the backends configured with this forwarding rule. The ports field has the following limitations: - It requires that the forwarding rule IPProtocol be TCP, UDP, or SCTP, and - It's applicable only to the following products: internal passthrough Network Load Balancers, backend service-based external passthrough Network Load Balancers, and internal protocol forwarding. - You can specify a list of up to five ports by number, separated by commas. The ports can be contiguous or discontiguous. For external forwarding rules, two or more forwarding rules cannot use the same [IPAddress, IPProtocol] pair if they share at least one port number. For internal forwarding rules within the same VPC network, two or more forwarding rules cannot use the same [IPAddress, IPProtocol] pair if they share at least one port number. @pattern: \\d+(?:-\\d+)? + * + * Generated from protobuf field repeated string ports = 106854418; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPorts() + { + return $this->ports; + } + + /** + * The ports, portRange, and allPorts fields are mutually exclusive. Only packets addressed to ports in the specified range will be forwarded to the backends configured with this forwarding rule. The ports field has the following limitations: - It requires that the forwarding rule IPProtocol be TCP, UDP, or SCTP, and - It's applicable only to the following products: internal passthrough Network Load Balancers, backend service-based external passthrough Network Load Balancers, and internal protocol forwarding. - You can specify a list of up to five ports by number, separated by commas. The ports can be contiguous or discontiguous. For external forwarding rules, two or more forwarding rules cannot use the same [IPAddress, IPProtocol] pair if they share at least one port number. For internal forwarding rules within the same VPC network, two or more forwarding rules cannot use the same [IPAddress, IPProtocol] pair if they share at least one port number. @pattern: \\d+(?:-\\d+)? + * + * Generated from protobuf field repeated string ports = 106854418; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPorts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ports = $arr; + + return $this; + } + + /** + * [Output Only] The PSC connection id of the PSC forwarding rule. + * + * Generated from protobuf field optional uint64 psc_connection_id = 292082397; + * @return int|string + */ + public function getPscConnectionId() + { + return isset($this->psc_connection_id) ? $this->psc_connection_id : 0; + } + + public function hasPscConnectionId() + { + return isset($this->psc_connection_id); + } + + public function clearPscConnectionId() + { + unset($this->psc_connection_id); + } + + /** + * [Output Only] The PSC connection id of the PSC forwarding rule. + * + * Generated from protobuf field optional uint64 psc_connection_id = 292082397; + * @param int|string $var + * @return $this + */ + public function setPscConnectionId($var) + { + GPBUtil::checkUint64($var); + $this->psc_connection_id = $var; + + return $this; + } + + /** + * + * Check the PscConnectionStatus enum for the list of possible values. + * + * Generated from protobuf field optional string psc_connection_status = 184149172; + * @return string + */ + public function getPscConnectionStatus() + { + return isset($this->psc_connection_status) ? $this->psc_connection_status : ''; + } + + public function hasPscConnectionStatus() + { + return isset($this->psc_connection_status); + } + + public function clearPscConnectionStatus() + { + unset($this->psc_connection_status); + } + + /** + * + * Check the PscConnectionStatus enum for the list of possible values. + * + * Generated from protobuf field optional string psc_connection_status = 184149172; + * @param string $var + * @return $this + */ + public function setPscConnectionStatus($var) + { + GPBUtil::checkString($var, True); + $this->psc_connection_status = $var; + + return $this; + } + + /** + * [Output Only] URL of the region where the regional forwarding rule resides. This field is not applicable to global forwarding rules. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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 regional forwarding rule resides. This field is not applicable to global forwarding rules. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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] Server-defined URL for the 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 the 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; + } + + /** + * Service Directory resources to register this forwarding rule with. Currently, only supports a single Service Directory resource. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration service_directory_registrations = 223549694; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServiceDirectoryRegistrations() + { + return $this->service_directory_registrations; + } + + /** + * Service Directory resources to register this forwarding rule with. Currently, only supports a single Service Directory resource. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration service_directory_registrations = 223549694; + * @param array<\Google\Cloud\Compute\V1\ForwardingRuleServiceDirectoryRegistration>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServiceDirectoryRegistrations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ForwardingRuleServiceDirectoryRegistration::class); + $this->service_directory_registrations = $arr; + + return $this; + } + + /** + * 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. + * + * Generated from protobuf field optional string service_label = 417008874; + * @return string + */ + public function getServiceLabel() + { + return isset($this->service_label) ? $this->service_label : ''; + } + + public function hasServiceLabel() + { + return isset($this->service_label); + } + + public function clearServiceLabel() + { + unset($this->service_label); + } + + /** + * 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. + * + * Generated from protobuf field optional string service_label = 417008874; + * @param string $var + * @return $this + */ + public function setServiceLabel($var) + { + GPBUtil::checkString($var, True); + $this->service_label = $var; + + return $this; + } + + /** + * [Output Only] The internal fully qualified service name for this forwarding rule. This field is only used for internal load balancing. + * + * Generated from protobuf field optional string service_name = 359880149; + * @return string + */ + public function getServiceName() + { + return isset($this->service_name) ? $this->service_name : ''; + } + + public function hasServiceName() + { + return isset($this->service_name); + } + + public function clearServiceName() + { + unset($this->service_name); + } + + /** + * [Output Only] The internal fully qualified service name for this forwarding rule. This field is only used for internal load balancing. + * + * Generated from protobuf field optional string service_name = 359880149; + * @param string $var + * @return $this + */ + public function setServiceName($var) + { + GPBUtil::checkString($var, True); + $this->service_name = $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 with internal load balancers and external passthrough Network Load Balancers 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. + * + * Generated from protobuf field optional string subnetwork = 307827694; + * @return string + */ + public function getSubnetwork() + { + return isset($this->subnetwork) ? $this->subnetwork : ''; + } + + public function hasSubnetwork() + { + return isset($this->subnetwork); + } + + public function clearSubnetwork() + { + unset($this->subnetwork); + } + + /** + * This field identifies the subnetwork that the load balanced IP should belong to for this forwarding rule, used with internal load balancers and external passthrough Network Load Balancers 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. + * + * Generated from protobuf field optional string subnetwork = 307827694; + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork = $var; + + return $this; + } + + /** + * The URL of the target resource to receive the matched traffic. For regional forwarding rules, this target must be in the same region as the forwarding rule. For global forwarding rules, this target must be a global load balancing resource. The forwarded traffic must be of a type appropriate to the target object. - For load balancers, see the "Target" column in [Port specifications](https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications). - For Private Service Connect forwarding rules that forward traffic to Google APIs, provide the name of a supported Google API bundle: - vpc-sc - APIs that support VPC Service Controls. - all-apis - All supported Google APIs. - For Private Service Connect forwarding rules that forward traffic to managed services, the target must be a service attachment. The target is not mutable once set as a service attachment. + * + * Generated from protobuf field optional string target = 192835985; + * @return string + */ + public function getTarget() + { + return isset($this->target) ? $this->target : ''; + } + + public function hasTarget() + { + return isset($this->target); + } + + public function clearTarget() + { + unset($this->target); + } + + /** + * The URL of the target resource to receive the matched traffic. For regional forwarding rules, this target must be in the same region as the forwarding rule. For global forwarding rules, this target must be a global load balancing resource. The forwarded traffic must be of a type appropriate to the target object. - For load balancers, see the "Target" column in [Port specifications](https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications). - For Private Service Connect forwarding rules that forward traffic to Google APIs, provide the name of a supported Google API bundle: - vpc-sc - APIs that support VPC Service Controls. - all-apis - All supported Google APIs. - For Private Service Connect forwarding rules that forward traffic to managed services, the target must be a service attachment. The target is not mutable once set as a service attachment. + * + * Generated from protobuf field optional string target = 192835985; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule/IPProtocolEnum.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule/IPProtocolEnum.php new file mode 100644 index 000000000000..eddbfa7b7110 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule/IPProtocolEnum.php @@ -0,0 +1,85 @@ +google.cloud.compute.v1.ForwardingRule.IPProtocolEnum + */ +class IPProtocolEnum +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_I_P_PROTOCOL_ENUM = 0; + */ + const UNDEFINED_I_P_PROTOCOL_ENUM = 0; + /** + * Generated from protobuf enum AH = 2087; + */ + const AH = 2087; + /** + * Generated from protobuf enum ESP = 68962; + */ + const ESP = 68962; + /** + * Generated from protobuf enum ICMP = 2241597; + */ + const ICMP = 2241597; + /** + * Generated from protobuf enum L3_DEFAULT = 48151369; + */ + const L3_DEFAULT = 48151369; + /** + * Generated from protobuf enum SCTP = 2539724; + */ + const SCTP = 2539724; + /** + * Generated from protobuf enum TCP = 82881; + */ + const TCP = 82881; + /** + * Generated from protobuf enum UDP = 83873; + */ + const UDP = 83873; + + private static $valueToName = [ + self::UNDEFINED_I_P_PROTOCOL_ENUM => 'UNDEFINED_I_P_PROTOCOL_ENUM', + self::AH => 'AH', + self::ESP => 'ESP', + self::ICMP => 'ICMP', + self::L3_DEFAULT => 'L3_DEFAULT', + self::SCTP => 'SCTP', + self::TCP => 'TCP', + self::UDP => 'UDP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IPProtocolEnum::class, \Google\Cloud\Compute\V1\ForwardingRule_IPProtocolEnum::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule/IpVersion.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule/IpVersion.php new file mode 100644 index 000000000000..977d1cb77b87 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule/IpVersion.php @@ -0,0 +1,65 @@ +google.cloud.compute.v1.ForwardingRule.IpVersion + */ +class IpVersion +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_IP_VERSION = 0; + */ + const UNDEFINED_IP_VERSION = 0; + /** + * Generated from protobuf enum IPV4 = 2254341; + */ + const IPV4 = 2254341; + /** + * Generated from protobuf enum IPV6 = 2254343; + */ + const IPV6 = 2254343; + /** + * Generated from protobuf enum UNSPECIFIED_VERSION = 21850000; + */ + const UNSPECIFIED_VERSION = 21850000; + + private static $valueToName = [ + self::UNDEFINED_IP_VERSION => 'UNDEFINED_IP_VERSION', + self::IPV4 => 'IPV4', + self::IPV6 => 'IPV6', + self::UNSPECIFIED_VERSION => 'UNSPECIFIED_VERSION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IpVersion::class, \Google\Cloud\Compute\V1\ForwardingRule_IpVersion::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule/LoadBalancingScheme.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule/LoadBalancingScheme.php new file mode 100644 index 000000000000..e0d7f61eebf1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule/LoadBalancingScheme.php @@ -0,0 +1,80 @@ +google.cloud.compute.v1.ForwardingRule.LoadBalancingScheme + */ +class LoadBalancingScheme +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_LOAD_BALANCING_SCHEME = 0; + */ + const UNDEFINED_LOAD_BALANCING_SCHEME = 0; + /** + * Generated from protobuf enum EXTERNAL = 35607499; + */ + const EXTERNAL = 35607499; + /** + * Generated from protobuf enum EXTERNAL_MANAGED = 512006923; + */ + const EXTERNAL_MANAGED = 512006923; + /** + * Generated from protobuf enum INTERNAL = 279295677; + */ + const INTERNAL = 279295677; + /** + * Generated from protobuf enum INTERNAL_MANAGED = 37350397; + */ + const INTERNAL_MANAGED = 37350397; + /** + * Generated from protobuf enum INTERNAL_SELF_MANAGED = 236211150; + */ + const INTERNAL_SELF_MANAGED = 236211150; + /** + * Generated from protobuf enum INVALID = 530283991; + */ + const INVALID = 530283991; + + private static $valueToName = [ + self::UNDEFINED_LOAD_BALANCING_SCHEME => 'UNDEFINED_LOAD_BALANCING_SCHEME', + self::EXTERNAL => 'EXTERNAL', + self::EXTERNAL_MANAGED => 'EXTERNAL_MANAGED', + self::INTERNAL => 'INTERNAL', + self::INTERNAL_MANAGED => 'INTERNAL_MANAGED', + self::INTERNAL_SELF_MANAGED => 'INTERNAL_SELF_MANAGED', + self::INVALID => 'INVALID', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LoadBalancingScheme::class, \Google\Cloud\Compute\V1\ForwardingRule_LoadBalancingScheme::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule/NetworkTier.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule/NetworkTier.php new file mode 100644 index 000000000000..2f2bfb1f5eaa --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule/NetworkTier.php @@ -0,0 +1,78 @@ +google.cloud.compute.v1.ForwardingRule.NetworkTier + */ +class NetworkTier +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_NETWORK_TIER = 0; + */ + const UNDEFINED_NETWORK_TIER = 0; + /** + * Public internet quality with fixed bandwidth. + * + * Generated from protobuf enum FIXED_STANDARD = 310464328; + */ + const FIXED_STANDARD = 310464328; + /** + * High quality, Google-grade network tier, support for all networking products. + * + * Generated from protobuf enum PREMIUM = 399530551; + */ + const PREMIUM = 399530551; + /** + * Public internet quality, only limited support for other networking products. + * + * Generated from protobuf enum STANDARD = 484642493; + */ + const STANDARD = 484642493; + /** + * (Output only) Temporary tier for FIXED_STANDARD when fixed standard tier is expired or not configured. + * + * Generated from protobuf enum STANDARD_OVERRIDES_FIXED_STANDARD = 465847234; + */ + const STANDARD_OVERRIDES_FIXED_STANDARD = 465847234; + + private static $valueToName = [ + self::UNDEFINED_NETWORK_TIER => 'UNDEFINED_NETWORK_TIER', + self::FIXED_STANDARD => 'FIXED_STANDARD', + self::PREMIUM => 'PREMIUM', + self::STANDARD => 'STANDARD', + self::STANDARD_OVERRIDES_FIXED_STANDARD => 'STANDARD_OVERRIDES_FIXED_STANDARD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NetworkTier::class, \Google\Cloud\Compute\V1\ForwardingRule_NetworkTier::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule/PscConnectionStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule/PscConnectionStatus.php new file mode 100644 index 000000000000..f0c42e67192c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRule/PscConnectionStatus.php @@ -0,0 +1,89 @@ +google.cloud.compute.v1.ForwardingRule.PscConnectionStatus + */ +class PscConnectionStatus +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PSC_CONNECTION_STATUS = 0; + */ + const UNDEFINED_PSC_CONNECTION_STATUS = 0; + /** + * The connection has been accepted by the producer. + * + * Generated from protobuf enum ACCEPTED = 246714279; + */ + const ACCEPTED = 246714279; + /** + * The connection has been closed by the producer and will not serve traffic going forward. + * + * Generated from protobuf enum CLOSED = 380163436; + */ + const CLOSED = 380163436; + /** + * The connection has been accepted by the producer, but the producer needs to take further action before the forwarding rule can serve traffic. + * + * Generated from protobuf enum NEEDS_ATTENTION = 344491452; + */ + const NEEDS_ATTENTION = 344491452; + /** + * The connection is pending acceptance by the producer. + * + * Generated from protobuf enum PENDING = 35394935; + */ + const PENDING = 35394935; + /** + * The connection has been rejected by the producer. + * + * Generated from protobuf enum REJECTED = 174130302; + */ + const REJECTED = 174130302; + /** + * Generated from protobuf enum STATUS_UNSPECIFIED = 42133066; + */ + const STATUS_UNSPECIFIED = 42133066; + + private static $valueToName = [ + self::UNDEFINED_PSC_CONNECTION_STATUS => 'UNDEFINED_PSC_CONNECTION_STATUS', + self::ACCEPTED => 'ACCEPTED', + self::CLOSED => 'CLOSED', + self::NEEDS_ATTENTION => 'NEEDS_ATTENTION', + self::PENDING => 'PENDING', + self::REJECTED => 'REJECTED', + self::STATUS_UNSPECIFIED => 'STATUS_UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PscConnectionStatus::class, \Google\Cloud\Compute\V1\ForwardingRule_PscConnectionStatus::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRuleAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRuleAggregatedList.php new file mode 100644 index 000000000000..1e3b38d3fc38 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRuleAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.ForwardingRuleAggregatedList + */ +class ForwardingRuleAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of ForwardingRulesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#forwardingRuleAggregatedList for lists of forwarding rules. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 ForwardingRulesScopedList resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#forwardingRuleAggregatedList for lists of forwarding rules. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 ForwardingRulesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of ForwardingRulesScopedList 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\ForwardingRulesScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#forwardingRuleAggregatedList for lists of forwarding rules. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#forwardingRuleAggregatedList for lists of forwarding rules. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRuleList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRuleList.php new file mode 100644 index 000000000000..3ea2c35af9f1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRuleList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.ForwardingRuleList + */ +class ForwardingRuleList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of ForwardingRule resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ForwardingRule items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\ForwardingRule>|\Google\Protobuf\Internal\RepeatedField $items + * A list of ForwardingRule 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 ForwardingRule resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ForwardingRule items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of ForwardingRule resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ForwardingRule items = 100526016; + * @param array<\Google\Cloud\Compute\V1\ForwardingRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ForwardingRule::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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRuleReference.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRuleReference.php new file mode 100644 index 000000000000..dc12ac824832 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRuleReference.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.ForwardingRuleReference + */ +class ForwardingRuleReference extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string forwarding_rule = 269964030; + */ + protected $forwarding_rule = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $forwarding_rule + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string forwarding_rule = 269964030; + * @return string + */ + public function getForwardingRule() + { + return isset($this->forwarding_rule) ? $this->forwarding_rule : ''; + } + + public function hasForwardingRule() + { + return isset($this->forwarding_rule); + } + + public function clearForwardingRule() + { + unset($this->forwarding_rule); + } + + /** + * Generated from protobuf field optional string forwarding_rule = 269964030; + * @param string $var + * @return $this + */ + public function setForwardingRule($var) + { + GPBUtil::checkString($var, True); + $this->forwarding_rule = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRuleServiceDirectoryRegistration.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRuleServiceDirectoryRegistration.php new file mode 100644 index 000000000000..ea22e86911a0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRuleServiceDirectoryRegistration.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration + */ +class ForwardingRuleServiceDirectoryRegistration extends \Google\Protobuf\Internal\Message +{ + /** + * Service Directory namespace to register the forwarding rule under. + * + * Generated from protobuf field optional string namespace = 178476379; + */ + protected $namespace = null; + /** + * Service Directory service to register the forwarding rule under. + * + * Generated from protobuf field optional string service = 373540533; + */ + protected $service = null; + /** + * [Optional] Service Directory region to register this global forwarding rule under. Default to "us-central1". Only used for PSC for Google APIs. All PSC for Google APIs forwarding rules on the same network should use the same Service Directory region. + * + * Generated from protobuf field optional string service_directory_region = 74030416; + */ + protected $service_directory_region = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $namespace + * Service Directory namespace to register the forwarding rule under. + * @type string $service + * Service Directory service to register the forwarding rule under. + * @type string $service_directory_region + * [Optional] Service Directory region to register this global forwarding rule under. Default to "us-central1". Only used for PSC for Google APIs. All PSC for Google APIs forwarding rules on the same network should use the same Service Directory region. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Service Directory namespace to register the forwarding rule under. + * + * Generated from protobuf field optional string namespace = 178476379; + * @return string + */ + public function getNamespace() + { + return isset($this->namespace) ? $this->namespace : ''; + } + + public function hasNamespace() + { + return isset($this->namespace); + } + + public function clearNamespace() + { + unset($this->namespace); + } + + /** + * Service Directory namespace to register the forwarding rule under. + * + * Generated from protobuf field optional string namespace = 178476379; + * @param string $var + * @return $this + */ + public function setNamespace($var) + { + GPBUtil::checkString($var, True); + $this->namespace = $var; + + return $this; + } + + /** + * Service Directory service to register the forwarding rule under. + * + * Generated from protobuf field optional string service = 373540533; + * @return string + */ + public function getService() + { + return isset($this->service) ? $this->service : ''; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * Service Directory service to register the forwarding rule under. + * + * Generated from protobuf field optional string service = 373540533; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * [Optional] Service Directory region to register this global forwarding rule under. Default to "us-central1". Only used for PSC for Google APIs. All PSC for Google APIs forwarding rules on the same network should use the same Service Directory region. + * + * Generated from protobuf field optional string service_directory_region = 74030416; + * @return string + */ + public function getServiceDirectoryRegion() + { + return isset($this->service_directory_region) ? $this->service_directory_region : ''; + } + + public function hasServiceDirectoryRegion() + { + return isset($this->service_directory_region); + } + + public function clearServiceDirectoryRegion() + { + unset($this->service_directory_region); + } + + /** + * [Optional] Service Directory region to register this global forwarding rule under. Default to "us-central1". Only used for PSC for Google APIs. All PSC for Google APIs forwarding rules on the same network should use the same Service Directory region. + * + * Generated from protobuf field optional string service_directory_region = 74030416; + * @param string $var + * @return $this + */ + public function setServiceDirectoryRegion($var) + { + GPBUtil::checkString($var, True); + $this->service_directory_region = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRulesScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRulesScopedList.php new file mode 100644 index 000000000000..801c7f62f1c9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ForwardingRulesScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.ForwardingRulesScopedList + */ +class ForwardingRulesScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * A list of forwarding rules contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ForwardingRule forwarding_rules = 315821365; + */ + private $forwarding_rules; + /** + * Informational warning which replaces the list of forwarding rules when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\ForwardingRule>|\Google\Protobuf\Internal\RepeatedField $forwarding_rules + * A list of forwarding rules contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * Informational warning which replaces the list of forwarding rules when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of forwarding rules contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ForwardingRule forwarding_rules = 315821365; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getForwardingRules() + { + return $this->forwarding_rules; + } + + /** + * A list of forwarding rules contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ForwardingRule forwarding_rules = 315821365; + * @param array<\Google\Cloud\Compute\V1\ForwardingRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setForwardingRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ForwardingRule::class); + $this->forwarding_rules = $arr; + + return $this; + } + + /** + * Informational warning which replaces the list of forwarding rules 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); + } + + /** + * Informational warning which replaces the list of forwarding rules 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GRPCHealthCheck.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GRPCHealthCheck.php new file mode 100644 index 000000000000..6ede0d816ac3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GRPCHealthCheck.php @@ -0,0 +1,212 @@ +google.cloud.compute.v1.GRPCHealthCheck + */ +class GRPCHealthCheck extends \Google\Protobuf\Internal\Message +{ + /** + * The gRPC service name for the health check. This field is optional. The value of grpc_service_name has the following meanings by convention: - Empty service_name means the overall status of all services at the backend. - Non-empty service_name means the health of that gRPC service, as defined by the owner of the service. The grpc_service_name can only be ASCII. + * + * Generated from protobuf field optional string grpc_service_name = 136533078; + */ + protected $grpc_service_name = null; + /** + * The TCP port number to which the health check prober sends packets. Valid values are 1 through 65535. + * + * Generated from protobuf field optional int32 port = 3446913; + */ + protected $port = null; + /** + * Not supported. + * + * Generated from protobuf field optional string port_name = 41534345; + */ + protected $port_name = null; + /** + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * + * Generated from protobuf field optional string port_specification = 51590597; + */ + protected $port_specification = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $grpc_service_name + * The gRPC service name for the health check. This field is optional. The value of grpc_service_name has the following meanings by convention: - Empty service_name means the overall status of all services at the backend. - Non-empty service_name means the health of that gRPC service, as defined by the owner of the service. The grpc_service_name can only be ASCII. + * @type int $port + * The TCP port number to which the health check prober sends packets. Valid values are 1 through 65535. + * @type string $port_name + * Not supported. + * @type string $port_specification + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The gRPC service name for the health check. This field is optional. The value of grpc_service_name has the following meanings by convention: - Empty service_name means the overall status of all services at the backend. - Non-empty service_name means the health of that gRPC service, as defined by the owner of the service. The grpc_service_name can only be ASCII. + * + * Generated from protobuf field optional string grpc_service_name = 136533078; + * @return string + */ + public function getGrpcServiceName() + { + return isset($this->grpc_service_name) ? $this->grpc_service_name : ''; + } + + public function hasGrpcServiceName() + { + return isset($this->grpc_service_name); + } + + public function clearGrpcServiceName() + { + unset($this->grpc_service_name); + } + + /** + * The gRPC service name for the health check. This field is optional. The value of grpc_service_name has the following meanings by convention: - Empty service_name means the overall status of all services at the backend. - Non-empty service_name means the health of that gRPC service, as defined by the owner of the service. The grpc_service_name can only be ASCII. + * + * Generated from protobuf field optional string grpc_service_name = 136533078; + * @param string $var + * @return $this + */ + public function setGrpcServiceName($var) + { + GPBUtil::checkString($var, True); + $this->grpc_service_name = $var; + + return $this; + } + + /** + * The TCP port number to which the health check prober sends packets. Valid values are 1 through 65535. + * + * Generated from protobuf field optional int32 port = 3446913; + * @return int + */ + public function getPort() + { + return isset($this->port) ? $this->port : 0; + } + + public function hasPort() + { + return isset($this->port); + } + + public function clearPort() + { + unset($this->port); + } + + /** + * The TCP port number to which the health check prober sends packets. Valid values are 1 through 65535. + * + * Generated from protobuf field optional int32 port = 3446913; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + + /** + * Not supported. + * + * Generated from protobuf field optional string port_name = 41534345; + * @return string + */ + public function getPortName() + { + return isset($this->port_name) ? $this->port_name : ''; + } + + public function hasPortName() + { + return isset($this->port_name); + } + + public function clearPortName() + { + unset($this->port_name); + } + + /** + * Not supported. + * + * Generated from protobuf field optional string port_name = 41534345; + * @param string $var + * @return $this + */ + public function setPortName($var) + { + GPBUtil::checkString($var, True); + $this->port_name = $var; + + return $this; + } + + /** + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * + * Generated from protobuf field optional string port_specification = 51590597; + * @return string + */ + public function getPortSpecification() + { + return isset($this->port_specification) ? $this->port_specification : ''; + } + + public function hasPortSpecification() + { + return isset($this->port_specification); + } + + public function clearPortSpecification() + { + unset($this->port_specification); + } + + /** + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * + * Generated from protobuf field optional string port_specification = 51590597; + * @param string $var + * @return $this + */ + public function setPortSpecification($var) + { + GPBUtil::checkString($var, True); + $this->port_specification = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GRPCHealthCheck/PortSpecification.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GRPCHealthCheck/PortSpecification.php new file mode 100644 index 000000000000..75ca26b50625 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GRPCHealthCheck/PortSpecification.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.GRPCHealthCheck.PortSpecification + */ +class PortSpecification +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PORT_SPECIFICATION = 0; + */ + const UNDEFINED_PORT_SPECIFICATION = 0; + /** + * The port number in the health check's port is used for health checking. Applies to network endpoint group and instance group backends. + * + * Generated from protobuf enum USE_FIXED_PORT = 190235748; + */ + const USE_FIXED_PORT = 190235748; + /** + * Not supported. + * + * Generated from protobuf enum USE_NAMED_PORT = 349300671; + */ + const USE_NAMED_PORT = 349300671; + /** + * For network endpoint group backends, the health check uses the port number specified on each endpoint in the network endpoint group. For instance group backends, the health check uses the port number specified for the backend service's named port defined in the instance group's named ports. + * + * Generated from protobuf enum USE_SERVING_PORT = 362637516; + */ + const USE_SERVING_PORT = 362637516; + + private static $valueToName = [ + self::UNDEFINED_PORT_SPECIFICATION => 'UNDEFINED_PORT_SPECIFICATION', + self::USE_FIXED_PORT => 'USE_FIXED_PORT', + self::USE_NAMED_PORT => 'USE_NAMED_PORT', + self::USE_SERVING_PORT => 'USE_SERVING_PORT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PortSpecification::class, \Google\Cloud\Compute\V1\GRPCHealthCheck_PortSpecification::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAcceleratorTypeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAcceleratorTypeRequest.php new file mode 100644 index 000000000000..f9fc64171d9e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAcceleratorTypeRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetAcceleratorTypeRequest + */ +class GetAcceleratorTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the accelerator type to return. + * + * Generated from protobuf field string accelerator_type = 138031246 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $accelerator_type = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $acceleratorType Name of the accelerator type to return. + * + * @return \Google\Cloud\Compute\V1\GetAcceleratorTypeRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $acceleratorType): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setAcceleratorType($acceleratorType); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $accelerator_type + * Name of the accelerator type to return. + * @type string $project + * Project ID for 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); + } + + /** + * Name of the accelerator type to return. + * + * Generated from protobuf field string accelerator_type = 138031246 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAcceleratorType() + { + return $this->accelerator_type; + } + + /** + * Name of the accelerator type to return. + * + * Generated from protobuf field string accelerator_type = 138031246 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAcceleratorType($var) + { + GPBUtil::checkString($var, True); + $this->accelerator_type = $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 zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAddressRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAddressRequest.php new file mode 100644 index 000000000000..ef94ed037d88 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAddressRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetAddressRequest + */ +class GetAddressRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the address resource to return. + * + * Generated from protobuf field string address = 462920692 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $address = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $address Name of the address resource to return. + * + * @return \Google\Cloud\Compute\V1\GetAddressRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $address): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setAddress($address); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $address + * Name of the address resource to return. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the address resource to return. + * + * Generated from protobuf field string address = 462920692 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAddress() + { + return $this->address; + } + + /** + * Name of the address resource to return. + * + * Generated from protobuf field string address = 462920692 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkString($var, True); + $this->address = $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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAssociationFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAssociationFirewallPolicyRequest.php new file mode 100644 index 000000000000..8cd26a2fc4f7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAssociationFirewallPolicyRequest.php @@ -0,0 +1,124 @@ +google.cloud.compute.v1.GetAssociationFirewallPolicyRequest + */ +class GetAssociationFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to which the queried rule belongs. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * The name of the association to get from the firewall policy. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + + /** + * @param string $firewallPolicy Name of the firewall policy to which the queried rule belongs. + * + * @return \Google\Cloud\Compute\V1\GetAssociationFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $firewallPolicy): self + { + return (new self()) + ->setFirewallPolicy($firewallPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to which the queried rule belongs. + * @type string $name + * The name of the association to get from the firewall policy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall policy to which the queried rule belongs. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to which the queried rule belongs. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * The name of the association to get from the firewall policy. + * + * 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 of the association to get from the firewall policy. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAssociationNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAssociationNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..a92e7a5b8c9e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAssociationNetworkFirewallPolicyRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.GetAssociationNetworkFirewallPolicyRequest + */ +class GetAssociationNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to which the queried association belongs. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * The name of the association to get from the firewall policy. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $firewallPolicy Name of the firewall policy to which the queried association belongs. + * + * @return \Google\Cloud\Compute\V1\GetAssociationNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $firewallPolicy): self + { + return (new self()) + ->setProject($project) + ->setFirewallPolicy($firewallPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to which the queried association belongs. + * @type string $name + * The name of the association to get from the firewall policy. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall policy to which the queried association belongs. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to which the queried association belongs. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * The name of the association to get from the firewall policy. + * + * 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 of the association to get from the firewall policy. + * + * 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; + } + + /** + * 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAssociationRegionNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAssociationRegionNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..fdc72cd7038a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAssociationRegionNetworkFirewallPolicyRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.GetAssociationRegionNetworkFirewallPolicyRequest + */ +class GetAssociationRegionNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to which the queried association belongs. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * The name of the association to get from the firewall policy. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $firewallPolicy Name of the firewall policy to which the queried association belongs. + * + * @return \Google\Cloud\Compute\V1\GetAssociationRegionNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $firewallPolicy): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setFirewallPolicy($firewallPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to which the queried association belongs. + * @type string $name + * The name of the association to get from the firewall policy. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall policy to which the queried association belongs. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to which the queried association belongs. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * The name of the association to get from the firewall policy. + * + * 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 of the association to get from the firewall policy. + * + * 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; + } + + /** + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAutoscalerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAutoscalerRequest.php new file mode 100644 index 000000000000..5d4cacd45ae4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetAutoscalerRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetAutoscalerRequest + */ +class GetAutoscalerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the autoscaler to return. + * + * Generated from protobuf field string autoscaler = 517258967 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $autoscaler = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone for this request. + * @param string $autoscaler Name of the autoscaler to return. + * + * @return \Google\Cloud\Compute\V1\GetAutoscalerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $autoscaler): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setAutoscaler($autoscaler); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $autoscaler + * Name of the autoscaler to return. + * @type string $project + * Project ID for this request. + * @type string $zone + * Name of the zone for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the autoscaler to return. + * + * Generated from protobuf field string autoscaler = 517258967 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAutoscaler() + { + return $this->autoscaler; + } + + /** + * Name of the autoscaler to return. + * + * Generated from protobuf field string autoscaler = 517258967 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAutoscaler($var) + { + GPBUtil::checkString($var, True); + $this->autoscaler = $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; + } + + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetBackendBucketRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetBackendBucketRequest.php new file mode 100644 index 000000000000..86938d583ac8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetBackendBucketRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetBackendBucketRequest + */ +class GetBackendBucketRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the BackendBucket resource to return. + * + * Generated from protobuf field string backend_bucket = 91714037 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_bucket = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $backendBucket Name of the BackendBucket resource to return. + * + * @return \Google\Cloud\Compute\V1\GetBackendBucketRequest + * + * @experimental + */ + public static function build(string $project, string $backendBucket): self + { + return (new self()) + ->setProject($project) + ->setBackendBucket($backendBucket); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_bucket + * Name of the BackendBucket resource to return. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the BackendBucket resource to return. + * + * Generated from protobuf field string backend_bucket = 91714037 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackendBucket() + { + return $this->backend_bucket; + } + + /** + * Name of the BackendBucket resource to return. + * + * Generated from protobuf field string backend_bucket = 91714037 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackendBucket($var) + { + GPBUtil::checkString($var, True); + $this->backend_bucket = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetBackendServiceRequest.php new file mode 100644 index 000000000000..4a2bc31dc033 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetBackendServiceRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetBackendServiceRequest + */ +class GetBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the BackendService resource to return. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_service = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $backendService Name of the BackendService resource to return. + * + * @return \Google\Cloud\Compute\V1\GetBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, string $backendService): self + { + return (new self()) + ->setProject($project) + ->setBackendService($backendService); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_service + * Name of the BackendService resource to return. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the BackendService resource to return. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackendService() + { + return $this->backend_service; + } + + /** + * Name of the BackendService resource to return. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackendService($var) + { + GPBUtil::checkString($var, True); + $this->backend_service = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetDiagnosticsInterconnectRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetDiagnosticsInterconnectRequest.php new file mode 100644 index 000000000000..b74c59308e5e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetDiagnosticsInterconnectRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetDiagnosticsInterconnectRequest + */ +class GetDiagnosticsInterconnectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the interconnect resource to query. + * + * Generated from protobuf field string interconnect = 224601230 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $interconnect = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $interconnect Name of the interconnect resource to query. + * + * @return \Google\Cloud\Compute\V1\GetDiagnosticsInterconnectRequest + * + * @experimental + */ + public static function build(string $project, string $interconnect): self + { + return (new self()) + ->setProject($project) + ->setInterconnect($interconnect); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $interconnect + * Name of the interconnect resource to query. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the interconnect resource to query. + * + * Generated from protobuf field string interconnect = 224601230 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInterconnect() + { + return $this->interconnect; + } + + /** + * Name of the interconnect resource to query. + * + * Generated from protobuf field string interconnect = 224601230 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInterconnect($var) + { + GPBUtil::checkString($var, True); + $this->interconnect = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetDiskRequest.php new file mode 100644 index 000000000000..dd85398dfc0e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetDiskRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetDiskRequest + */ +class GetDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the persistent disk to return. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $disk Name of the persistent disk to return. + * + * @return \Google\Cloud\Compute\V1\GetDiskRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $disk): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setDisk($disk); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $disk + * Name of the persistent disk to return. + * @type string $project + * Project ID for 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); + } + + /** + * Name of the persistent disk to return. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisk() + { + return $this->disk; + } + + /** + * Name of the persistent disk to return. + * + * 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; + } + + /** + * 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 zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetDiskTypeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetDiskTypeRequest.php new file mode 100644 index 000000000000..7a20732c799b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetDiskTypeRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetDiskTypeRequest + */ +class GetDiskTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the disk type to return. + * + * Generated from protobuf field string disk_type = 93009052 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk_type = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $diskType Name of the disk type to return. + * + * @return \Google\Cloud\Compute\V1\GetDiskTypeRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $diskType): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setDiskType($diskType); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $disk_type + * Name of the disk type to return. + * @type string $project + * Project ID for 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); + } + + /** + * Name of the disk type to return. + * + * Generated from protobuf field string disk_type = 93009052 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDiskType() + { + return $this->disk_type; + } + + /** + * Name of the disk type to return. + * + * Generated from protobuf field string disk_type = 93009052 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDiskType($var) + { + GPBUtil::checkString($var, True); + $this->disk_type = $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 zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetEffectiveFirewallsInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetEffectiveFirewallsInstanceRequest.php new file mode 100644 index 000000000000..a28cf82df162 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetEffectiveFirewallsInstanceRequest.php @@ -0,0 +1,188 @@ +google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest + */ +class GetEffectiveFirewallsInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * The name of the network interface to get the effective firewalls. + * + * Generated from protobuf field string network_interface = 365387880 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_interface = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance scoping this request. + * @param string $networkInterface The name of the network interface to get the effective firewalls. + * + * @return \Google\Cloud\Compute\V1\GetEffectiveFirewallsInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, string $networkInterface): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setNetworkInterface($networkInterface); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name of the instance scoping this request. + * @type string $network_interface + * The name of the network interface to get the effective firewalls. + * @type string $project + * Project ID for 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); + } + + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance scoping 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 name of the network interface to get the effective firewalls. + * + * Generated from protobuf field string network_interface = 365387880 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkInterface() + { + return $this->network_interface; + } + + /** + * The name of the network interface to get the effective firewalls. + * + * Generated from protobuf field string network_interface = 365387880 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkInterface($var) + { + GPBUtil::checkString($var, True); + $this->network_interface = $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 zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetEffectiveFirewallsNetworkRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetEffectiveFirewallsNetworkRequest.php new file mode 100644 index 000000000000..cb855b425d1a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetEffectiveFirewallsNetworkRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest + */ +class GetEffectiveFirewallsNetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the network for this request. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $network Name of the network for this request. + * + * @return \Google\Cloud\Compute\V1\GetEffectiveFirewallsNetworkRequest + * + * @experimental + */ + public static function build(string $project, string $network): self + { + return (new self()) + ->setProject($project) + ->setNetwork($network); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Name of the network for this request. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the network for this request. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Name of the network for this request. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..326279575976 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest + */ +class GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Network reference + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $network Network reference + * + * @return \Google\Cloud\Compute\V1\GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $network): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setNetwork($network); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Network reference + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Network reference + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Network reference + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetExternalVpnGatewayRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetExternalVpnGatewayRequest.php new file mode 100644 index 000000000000..bdf85e869e9f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetExternalVpnGatewayRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetExternalVpnGatewayRequest + */ +class GetExternalVpnGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the externalVpnGateway to return. + * + * Generated from protobuf field string external_vpn_gateway = 109898629 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $external_vpn_gateway = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $externalVpnGateway Name of the externalVpnGateway to return. + * + * @return \Google\Cloud\Compute\V1\GetExternalVpnGatewayRequest + * + * @experimental + */ + public static function build(string $project, string $externalVpnGateway): self + { + return (new self()) + ->setProject($project) + ->setExternalVpnGateway($externalVpnGateway); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $external_vpn_gateway + * Name of the externalVpnGateway to return. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the externalVpnGateway to return. + * + * Generated from protobuf field string external_vpn_gateway = 109898629 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getExternalVpnGateway() + { + return $this->external_vpn_gateway; + } + + /** + * Name of the externalVpnGateway to return. + * + * Generated from protobuf field string external_vpn_gateway = 109898629 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setExternalVpnGateway($var) + { + GPBUtil::checkString($var, True); + $this->external_vpn_gateway = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetFirewallPolicyRequest.php new file mode 100644 index 000000000000..feb0e2003105 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetFirewallPolicyRequest.php @@ -0,0 +1,80 @@ +google.cloud.compute.v1.GetFirewallPolicyRequest + */ +class GetFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to get. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + + /** + * @param string $firewallPolicy Name of the firewall policy to get. + * + * @return \Google\Cloud\Compute\V1\GetFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $firewallPolicy): self + { + return (new self()) + ->setFirewallPolicy($firewallPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall policy to get. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to get. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetFirewallRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetFirewallRequest.php new file mode 100644 index 000000000000..3b14d810540d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetFirewallRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetFirewallRequest + */ +class GetFirewallRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall rule to return. + * + * Generated from protobuf field string firewall = 511016192 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $firewall Name of the firewall rule to return. + * + * @return \Google\Cloud\Compute\V1\GetFirewallRequest + * + * @experimental + */ + public static function build(string $project, string $firewall): self + { + return (new self()) + ->setProject($project) + ->setFirewall($firewall); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall + * Name of the firewall rule to return. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall rule to return. + * + * Generated from protobuf field string firewall = 511016192 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewall() + { + return $this->firewall; + } + + /** + * Name of the firewall rule to return. + * + * Generated from protobuf field string firewall = 511016192 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewall($var) + { + GPBUtil::checkString($var, True); + $this->firewall = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetForwardingRuleRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetForwardingRuleRequest.php new file mode 100644 index 000000000000..9d39c759a6d3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetForwardingRuleRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetForwardingRuleRequest + */ +class GetForwardingRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the ForwardingRule resource to return. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $forwarding_rule = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $forwardingRule Name of the ForwardingRule resource to return. + * + * @return \Google\Cloud\Compute\V1\GetForwardingRuleRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $forwardingRule): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setForwardingRule($forwardingRule); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $forwarding_rule + * Name of the ForwardingRule resource to return. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the ForwardingRule resource to return. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getForwardingRule() + { + return $this->forwarding_rule; + } + + /** + * Name of the ForwardingRule resource to return. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setForwardingRule($var) + { + GPBUtil::checkString($var, True); + $this->forwarding_rule = $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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetFromFamilyImageRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetFromFamilyImageRequest.php new file mode 100644 index 000000000000..8459666d0dba --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetFromFamilyImageRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetFromFamilyImageRequest + */ +class GetFromFamilyImageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the image family to search for. + * + * Generated from protobuf field string family = 328751972 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $family = ''; + /** + * 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]; + */ + protected $project = ''; + + /** + * @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 string $family Name of the image family to search for. + * + * @return \Google\Cloud\Compute\V1\GetFromFamilyImageRequest + * + * @experimental + */ + public static function build(string $project, string $family): self + { + return (new self()) + ->setProject($project) + ->setFamily($family); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $family + * Name of the image family to search for. + * @type string $project + * 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) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the image family to search for. + * + * Generated from protobuf field string family = 328751972 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFamily() + { + return $this->family; + } + + /** + * Name of the image family to search for. + * + * Generated from protobuf field string family = 328751972 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFamily($var) + { + GPBUtil::checkString($var, True); + $this->family = $var; + + return $this; + } + + /** + * 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 + */ + public function getProject() + { + return $this->project; + } + + /** + * 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 + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalAddressRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalAddressRequest.php new file mode 100644 index 000000000000..a5fa1e6ca07e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalAddressRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetGlobalAddressRequest + */ +class GetGlobalAddressRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the address resource to return. + * + * Generated from protobuf field string address = 462920692 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $address = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $address Name of the address resource to return. + * + * @return \Google\Cloud\Compute\V1\GetGlobalAddressRequest + * + * @experimental + */ + public static function build(string $project, string $address): self + { + return (new self()) + ->setProject($project) + ->setAddress($address); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $address + * Name of the address resource to return. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the address resource to return. + * + * Generated from protobuf field string address = 462920692 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAddress() + { + return $this->address; + } + + /** + * Name of the address resource to return. + * + * Generated from protobuf field string address = 462920692 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkString($var, True); + $this->address = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalForwardingRuleRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalForwardingRuleRequest.php new file mode 100644 index 000000000000..2cfa6246a5d8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalForwardingRuleRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetGlobalForwardingRuleRequest + */ +class GetGlobalForwardingRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the ForwardingRule resource to return. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $forwarding_rule = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $forwardingRule Name of the ForwardingRule resource to return. + * + * @return \Google\Cloud\Compute\V1\GetGlobalForwardingRuleRequest + * + * @experimental + */ + public static function build(string $project, string $forwardingRule): self + { + return (new self()) + ->setProject($project) + ->setForwardingRule($forwardingRule); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $forwarding_rule + * Name of the ForwardingRule resource to return. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the ForwardingRule resource to return. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getForwardingRule() + { + return $this->forwarding_rule; + } + + /** + * Name of the ForwardingRule resource to return. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setForwardingRule($var) + { + GPBUtil::checkString($var, True); + $this->forwarding_rule = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalNetworkEndpointGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalNetworkEndpointGroupRequest.php new file mode 100644 index 000000000000..06846c22f458 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalNetworkEndpointGroupRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest + */ +class GetGlobalNetworkEndpointGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the network endpoint group. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_endpoint_group = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $networkEndpointGroup The name of the network endpoint group. It should comply with RFC1035. + * + * @return \Google\Cloud\Compute\V1\GetGlobalNetworkEndpointGroupRequest + * + * @experimental + */ + public static function build(string $project, string $networkEndpointGroup): self + { + return (new self()) + ->setProject($project) + ->setNetworkEndpointGroup($networkEndpointGroup); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network_endpoint_group + * The name of the network endpoint group. It should comply with RFC1035. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the network endpoint group. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkEndpointGroup() + { + return $this->network_endpoint_group; + } + + /** + * The name of the network endpoint group. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkEndpointGroup($var) + { + GPBUtil::checkString($var, True); + $this->network_endpoint_group = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalOperationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalOperationRequest.php new file mode 100644 index 000000000000..9271b6d894b7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalOperationRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetGlobalOperationRequest + */ +class GetGlobalOperationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the Operations resource to return. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_response_field) = "name"]; + */ + protected $operation = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $operation Name of the Operations resource to return. + * + * @return \Google\Cloud\Compute\V1\GetGlobalOperationRequest + * + * @experimental + */ + public static function build(string $project, string $operation): self + { + return (new self()) + ->setProject($project) + ->setOperation($operation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $operation + * Name of the Operations resource to return. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the Operations resource to return. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_response_field) = "name"]; + * @return string + */ + public function getOperation() + { + return $this->operation; + } + + /** + * Name of the Operations resource to return. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_response_field) = "name"]; + * @param string $var + * @return $this + */ + public function setOperation($var) + { + GPBUtil::checkString($var, True); + $this->operation = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalOrganizationOperationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalOrganizationOperationRequest.php new file mode 100644 index 000000000000..875f02fc31c0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalOrganizationOperationRequest.php @@ -0,0 +1,124 @@ +google.cloud.compute.v1.GetGlobalOrganizationOperationRequest + */ +class GetGlobalOrganizationOperationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the Operations resource to return. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_response_field) = "name"]; + */ + protected $operation = ''; + /** + * Parent ID for this request. + * + * Generated from protobuf field optional string parent_id = 459714768; + */ + protected $parent_id = null; + + /** + * @param string $operation Name of the Operations resource to return. + * + * @return \Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest + * + * @experimental + */ + public static function build(string $operation): self + { + return (new self()) + ->setOperation($operation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $operation + * Name of the Operations resource to return. + * @type string $parent_id + * Parent ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the Operations resource to return. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_response_field) = "name"]; + * @return string + */ + public function getOperation() + { + return $this->operation; + } + + /** + * Name of the Operations resource to return. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_response_field) = "name"]; + * @param string $var + * @return $this + */ + public function setOperation($var) + { + GPBUtil::checkString($var, True); + $this->operation = $var; + + return $this; + } + + /** + * Parent ID for this request. + * + * Generated from protobuf field optional string parent_id = 459714768; + * @return string + */ + public function getParentId() + { + return isset($this->parent_id) ? $this->parent_id : ''; + } + + public function hasParentId() + { + return isset($this->parent_id); + } + + public function clearParentId() + { + unset($this->parent_id); + } + + /** + * Parent ID for this request. + * + * Generated from protobuf field optional string parent_id = 459714768; + * @param string $var + * @return $this + */ + public function setParentId($var) + { + GPBUtil::checkString($var, True); + $this->parent_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalPublicDelegatedPrefixeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalPublicDelegatedPrefixeRequest.php new file mode 100644 index 000000000000..ccac629248ac --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGlobalPublicDelegatedPrefixeRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest + */ +class GetGlobalPublicDelegatedPrefixeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the PublicDelegatedPrefix resource to return. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $public_delegated_prefix = ''; + + /** + * @param string $project Project ID for this request. + * @param string $publicDelegatedPrefix Name of the PublicDelegatedPrefix resource to return. + * + * @return \Google\Cloud\Compute\V1\GetGlobalPublicDelegatedPrefixeRequest + * + * @experimental + */ + public static function build(string $project, string $publicDelegatedPrefix): self + { + return (new self()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $public_delegated_prefix + * Name of the PublicDelegatedPrefix resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the PublicDelegatedPrefix resource to return. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPublicDelegatedPrefix() + { + return $this->public_delegated_prefix; + } + + /** + * Name of the PublicDelegatedPrefix resource to return. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPublicDelegatedPrefix($var) + { + GPBUtil::checkString($var, True); + $this->public_delegated_prefix = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGuestAttributesInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGuestAttributesInstanceRequest.php new file mode 100644 index 000000000000..844557b4027c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetGuestAttributesInstanceRequest.php @@ -0,0 +1,240 @@ +google.cloud.compute.v1.GetGuestAttributesInstanceRequest + */ +class GetGuestAttributesInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Specifies the guest attributes path to be queried. + * + * Generated from protobuf field optional string query_path = 368591164; + */ + protected $query_path = null; + /** + * Specifies the key for the guest attributes entry. + * + * Generated from protobuf field optional string variable_key = 164364828; + */ + protected $variable_key = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance scoping this request. + * + * @return \Google\Cloud\Compute\V1\GetGuestAttributesInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name of the instance scoping this request. + * @type string $project + * Project ID for this request. + * @type string $query_path + * Specifies the guest attributes path to be queried. + * @type string $variable_key + * Specifies the key for the guest attributes entry. + * @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); + } + + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance scoping 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; + } + + /** + * 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; + } + + /** + * Specifies the guest attributes path to be queried. + * + * Generated from protobuf field optional string query_path = 368591164; + * @return string + */ + public function getQueryPath() + { + return isset($this->query_path) ? $this->query_path : ''; + } + + public function hasQueryPath() + { + return isset($this->query_path); + } + + public function clearQueryPath() + { + unset($this->query_path); + } + + /** + * Specifies the guest attributes path to be queried. + * + * Generated from protobuf field optional string query_path = 368591164; + * @param string $var + * @return $this + */ + public function setQueryPath($var) + { + GPBUtil::checkString($var, True); + $this->query_path = $var; + + return $this; + } + + /** + * Specifies the key for the guest attributes entry. + * + * Generated from protobuf field optional string variable_key = 164364828; + * @return string + */ + public function getVariableKey() + { + return isset($this->variable_key) ? $this->variable_key : ''; + } + + public function hasVariableKey() + { + return isset($this->variable_key); + } + + public function clearVariableKey() + { + unset($this->variable_key); + } + + /** + * Specifies the key for the guest attributes entry. + * + * Generated from protobuf field optional string variable_key = 164364828; + * @param string $var + * @return $this + */ + public function setVariableKey($var) + { + GPBUtil::checkString($var, True); + $this->variable_key = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetHealthBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetHealthBackendServiceRequest.php new file mode 100644 index 000000000000..9ada0a24c276 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetHealthBackendServiceRequest.php @@ -0,0 +1,155 @@ +google.cloud.compute.v1.GetHealthBackendServiceRequest + */ +class GetHealthBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the BackendService resource to which the queried instance belongs. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_service = ''; + /** + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ResourceGroupReference resource_group_reference_resource = 112951123 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource_group_reference_resource = null; + + /** + * @param string $project + * @param string $backendService Name of the BackendService resource to which the queried instance belongs. + * @param \Google\Cloud\Compute\V1\ResourceGroupReference $resourceGroupReferenceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\GetHealthBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, string $backendService, \Google\Cloud\Compute\V1\ResourceGroupReference $resourceGroupReferenceResource): self + { + return (new self()) + ->setProject($project) + ->setBackendService($backendService) + ->setResourceGroupReferenceResource($resourceGroupReferenceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_service + * Name of the BackendService resource to which the queried instance belongs. + * @type string $project + * @type \Google\Cloud\Compute\V1\ResourceGroupReference $resource_group_reference_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the BackendService resource to which the queried instance belongs. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackendService() + { + return $this->backend_service; + } + + /** + * Name of the BackendService resource to which the queried instance belongs. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackendService($var) + { + GPBUtil::checkString($var, True); + $this->backend_service = $var; + + return $this; + } + + /** + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ResourceGroupReference resource_group_reference_resource = 112951123 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ResourceGroupReference|null + */ + public function getResourceGroupReferenceResource() + { + return $this->resource_group_reference_resource; + } + + public function hasResourceGroupReferenceResource() + { + return isset($this->resource_group_reference_resource); + } + + public function clearResourceGroupReferenceResource() + { + unset($this->resource_group_reference_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ResourceGroupReference resource_group_reference_resource = 112951123 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ResourceGroupReference $var + * @return $this + */ + public function setResourceGroupReferenceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ResourceGroupReference::class); + $this->resource_group_reference_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetHealthCheckRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetHealthCheckRequest.php new file mode 100644 index 000000000000..71eb4a6d375b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetHealthCheckRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetHealthCheckRequest + */ +class GetHealthCheckRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the HealthCheck resource to return. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $health_check = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $healthCheck Name of the HealthCheck resource to return. + * + * @return \Google\Cloud\Compute\V1\GetHealthCheckRequest + * + * @experimental + */ + public static function build(string $project, string $healthCheck): self + { + return (new self()) + ->setProject($project) + ->setHealthCheck($healthCheck); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $health_check + * Name of the HealthCheck resource to return. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the HealthCheck resource to return. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getHealthCheck() + { + return $this->health_check; + } + + /** + * Name of the HealthCheck resource to return. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setHealthCheck($var) + { + GPBUtil::checkString($var, True); + $this->health_check = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetHealthRegionBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetHealthRegionBackendServiceRequest.php new file mode 100644 index 000000000000..7e72c2b493c1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetHealthRegionBackendServiceRequest.php @@ -0,0 +1,191 @@ +google.cloud.compute.v1.GetHealthRegionBackendServiceRequest + */ +class GetHealthRegionBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the BackendService resource for which to get health. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_service = ''; + /** + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ResourceGroupReference resource_group_reference_resource = 112951123 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource_group_reference_resource = null; + + /** + * @param string $project + * @param string $region Name of the region scoping this request. + * @param string $backendService Name of the BackendService resource for which to get health. + * @param \Google\Cloud\Compute\V1\ResourceGroupReference $resourceGroupReferenceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\GetHealthRegionBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $backendService, \Google\Cloud\Compute\V1\ResourceGroupReference $resourceGroupReferenceResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setBackendService($backendService) + ->setResourceGroupReferenceResource($resourceGroupReferenceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_service + * Name of the BackendService resource for which to get health. + * @type string $project + * @type string $region + * Name of the region scoping this request. + * @type \Google\Cloud\Compute\V1\ResourceGroupReference $resource_group_reference_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the BackendService resource for which to get health. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackendService() + { + return $this->backend_service; + } + + /** + * Name of the BackendService resource for which to get health. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackendService($var) + { + GPBUtil::checkString($var, True); + $this->backend_service = $var; + + return $this; + } + + /** + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ResourceGroupReference resource_group_reference_resource = 112951123 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ResourceGroupReference|null + */ + public function getResourceGroupReferenceResource() + { + return $this->resource_group_reference_resource; + } + + public function hasResourceGroupReferenceResource() + { + return isset($this->resource_group_reference_resource); + } + + public function clearResourceGroupReferenceResource() + { + unset($this->resource_group_reference_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ResourceGroupReference resource_group_reference_resource = 112951123 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ResourceGroupReference $var + * @return $this + */ + public function setResourceGroupReferenceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ResourceGroupReference::class); + $this->resource_group_reference_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetHealthTargetPoolRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetHealthTargetPoolRequest.php new file mode 100644 index 000000000000..14c8ff05c1e5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetHealthTargetPoolRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.GetHealthTargetPoolRequest + */ +class GetHealthTargetPoolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceReference instance_reference_resource = 292926060 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_reference_resource = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name of the TargetPool resource to which the queried instance belongs. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_pool = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetPool Name of the TargetPool resource to which the queried instance belongs. + * @param \Google\Cloud\Compute\V1\InstanceReference $instanceReferenceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\GetHealthTargetPoolRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $targetPool, \Google\Cloud\Compute\V1\InstanceReference $instanceReferenceResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setInstanceReferenceResource($instanceReferenceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\InstanceReference $instance_reference_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type string $target_pool + * Name of the TargetPool resource to which the queried instance belongs. + * } + */ + 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.InstanceReference instance_reference_resource = 292926060 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceReference|null + */ + public function getInstanceReferenceResource() + { + return $this->instance_reference_resource; + } + + public function hasInstanceReferenceResource() + { + return isset($this->instance_reference_resource); + } + + public function clearInstanceReferenceResource() + { + unset($this->instance_reference_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceReference instance_reference_resource = 292926060 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceReference $var + * @return $this + */ + public function setInstanceReferenceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceReference::class); + $this->instance_reference_resource = $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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the TargetPool resource to which the queried instance belongs. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetPool() + { + return $this->target_pool; + } + + /** + * Name of the TargetPool resource to which the queried instance belongs. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetPool($var) + { + GPBUtil::checkString($var, True); + $this->target_pool = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyBackendBucketRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyBackendBucketRequest.php new file mode 100644 index 000000000000..5a732995411c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyBackendBucketRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.GetIamPolicyBackendBucketRequest + */ +class GetIamPolicyBackendBucketRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicyBackendBucketRequest + * + * @experimental + */ + public static function build(string $project, string $resource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyBackendServiceRequest.php new file mode 100644 index 000000000000..9663916f3530 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyBackendServiceRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.GetIamPolicyBackendServiceRequest + */ +class GetIamPolicyBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicyBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, string $resource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyDiskRequest.php new file mode 100644 index 000000000000..3105fed16fae --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyDiskRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.GetIamPolicyDiskRequest + */ +class GetIamPolicyDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicyDiskRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $resource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for 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); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyFirewallPolicyRequest.php new file mode 100644 index 000000000000..2d6d72424986 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyFirewallPolicyRequest.php @@ -0,0 +1,124 @@ +google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest + */ +class GetIamPolicyFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicyFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $resource): self + { + return (new self()) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $var; + + return $this; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyImageRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyImageRequest.php new file mode 100644 index 000000000000..ff73f525ede8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyImageRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.GetIamPolicyImageRequest + */ +class GetIamPolicyImageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicyImageRequest + * + * @experimental + */ + public static function build(string $project, string $resource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyInstanceRequest.php new file mode 100644 index 000000000000..59f4918cd4ad --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyInstanceRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.GetIamPolicyInstanceRequest + */ +class GetIamPolicyInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicyInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $resource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for 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); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyInstanceTemplateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyInstanceTemplateRequest.php new file mode 100644 index 000000000000..cf8b04d11174 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyInstanceTemplateRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest + */ +class GetIamPolicyInstanceTemplateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicyInstanceTemplateRequest + * + * @experimental + */ + public static function build(string $project, string $resource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyInstantSnapshotRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyInstantSnapshotRequest.php new file mode 100644 index 000000000000..54737f8f2530 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyInstantSnapshotRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.GetIamPolicyInstantSnapshotRequest + */ +class GetIamPolicyInstantSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicyInstantSnapshotRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $resource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for 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); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyLicenseRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyLicenseRequest.php new file mode 100644 index 000000000000..b82eb83c15cb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyLicenseRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.GetIamPolicyLicenseRequest + */ +class GetIamPolicyLicenseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicyLicenseRequest + * + * @experimental + */ + public static function build(string $project, string $resource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyMachineImageRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyMachineImageRequest.php new file mode 100644 index 000000000000..6cbaff12c5ca --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyMachineImageRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.GetIamPolicyMachineImageRequest + */ +class GetIamPolicyMachineImageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicyMachineImageRequest + * + * @experimental + */ + public static function build(string $project, string $resource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyNetworkAttachmentRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyNetworkAttachmentRequest.php new file mode 100644 index 000000000000..6ce1031997e2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyNetworkAttachmentRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.GetIamPolicyNetworkAttachmentRequest + */ +class GetIamPolicyNetworkAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicyNetworkAttachmentRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..a3a1ed9e46e5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyNetworkFirewallPolicyRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.GetIamPolicyNetworkFirewallPolicyRequest + */ +class GetIamPolicyNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicyNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $resource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyNodeGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyNodeGroupRequest.php new file mode 100644 index 000000000000..dc6ddb820b07 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyNodeGroupRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.GetIamPolicyNodeGroupRequest + */ +class GetIamPolicyNodeGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicyNodeGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $resource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for 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); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyNodeTemplateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyNodeTemplateRequest.php new file mode 100644 index 000000000000..83ada4e433a2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyNodeTemplateRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest + */ +class GetIamPolicyNodeTemplateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicyNodeTemplateRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyRegionBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyRegionBackendServiceRequest.php new file mode 100644 index 000000000000..4e69b23ca09f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyRegionBackendServiceRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.GetIamPolicyRegionBackendServiceRequest + */ +class GetIamPolicyRegionBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicyRegionBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyRegionDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyRegionDiskRequest.php new file mode 100644 index 000000000000..73bc1719662f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyRegionDiskRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.GetIamPolicyRegionDiskRequest + */ +class GetIamPolicyRegionDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicyRegionDiskRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyRegionInstantSnapshotRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyRegionInstantSnapshotRequest.php new file mode 100644 index 000000000000..50977b203751 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyRegionInstantSnapshotRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.GetIamPolicyRegionInstantSnapshotRequest + */ +class GetIamPolicyRegionInstantSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicyRegionInstantSnapshotRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyRegionNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyRegionNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..6cbe482c0ec4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyRegionNetworkFirewallPolicyRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.GetIamPolicyRegionNetworkFirewallPolicyRequest + */ +class GetIamPolicyRegionNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicyRegionNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyReservationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyReservationRequest.php new file mode 100644 index 000000000000..7d873cb76f0c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyReservationRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.GetIamPolicyReservationRequest + */ +class GetIamPolicyReservationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicyReservationRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $resource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for 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); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyResourcePolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyResourcePolicyRequest.php new file mode 100644 index 000000000000..0311c8287366 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyResourcePolicyRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest + */ +class GetIamPolicyResourcePolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicyResourcePolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyServiceAttachmentRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyServiceAttachmentRequest.php new file mode 100644 index 000000000000..2ee486e75c6e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyServiceAttachmentRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.GetIamPolicyServiceAttachmentRequest + */ +class GetIamPolicyServiceAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicyServiceAttachmentRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicySnapshotRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicySnapshotRequest.php new file mode 100644 index 000000000000..aaca3b1264cd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicySnapshotRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.GetIamPolicySnapshotRequest + */ +class GetIamPolicySnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicySnapshotRequest + * + * @experimental + */ + public static function build(string $project, string $resource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyStoragePoolRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyStoragePoolRequest.php new file mode 100644 index 000000000000..e2bf700ff734 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicyStoragePoolRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.GetIamPolicyStoragePoolRequest + */ +class GetIamPolicyStoragePoolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicyStoragePoolRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $resource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for 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); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicySubnetworkRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicySubnetworkRequest.php new file mode 100644 index 000000000000..ae79017d7598 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetIamPolicySubnetworkRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.GetIamPolicySubnetworkRequest + */ +class GetIamPolicySubnetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + */ + protected $options_requested_policy_version = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\GetIamPolicySubnetworkRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $options_requested_policy_version + * Requested IAM Policy version. + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @return int + */ + public function getOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version) ? $this->options_requested_policy_version : 0; + } + + public function hasOptionsRequestedPolicyVersion() + { + return isset($this->options_requested_policy_version); + } + + public function clearOptionsRequestedPolicyVersion() + { + unset($this->options_requested_policy_version); + } + + /** + * Requested IAM Policy version. + * + * Generated from protobuf field optional int32 options_requested_policy_version = 499220029; + * @param int $var + * @return $this + */ + public function setOptionsRequestedPolicyVersion($var) + { + GPBUtil::checkInt32($var); + $this->options_requested_policy_version = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetImageFamilyViewRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetImageFamilyViewRequest.php new file mode 100644 index 000000000000..5dd7979e2478 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetImageFamilyViewRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetImageFamilyViewRequest + */ +class GetImageFamilyViewRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the image family to search for. + * + * Generated from protobuf field string family = 328751972 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $family = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $family Name of the image family to search for. + * + * @return \Google\Cloud\Compute\V1\GetImageFamilyViewRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $family): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setFamily($family); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $family + * Name of the image family to search for. + * @type string $project + * Project ID for 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); + } + + /** + * Name of the image family to search for. + * + * Generated from protobuf field string family = 328751972 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFamily() + { + return $this->family; + } + + /** + * Name of the image family to search for. + * + * Generated from protobuf field string family = 328751972 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFamily($var) + { + GPBUtil::checkString($var, True); + $this->family = $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 zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetImageRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetImageRequest.php new file mode 100644 index 000000000000..11607a0b003b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetImageRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetImageRequest + */ +class GetImageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the image resource to return. + * + * Generated from protobuf field string image = 100313435 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $image = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $image Name of the image resource to return. + * + * @return \Google\Cloud\Compute\V1\GetImageRequest + * + * @experimental + */ + public static function build(string $project, string $image): self + { + return (new self()) + ->setProject($project) + ->setImage($image); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $image + * Name of the image resource to return. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the image resource to return. + * + * Generated from protobuf field string image = 100313435 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getImage() + { + return $this->image; + } + + /** + * Name of the image resource to return. + * + * Generated from protobuf field string image = 100313435 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkString($var, True); + $this->image = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..c7df32c4971a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceGroupManagerRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetInstanceGroupManagerRequest + */ +class GetInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the zone where the managed instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. + * @param string $instanceGroupManager The name of the managed instance group. + * + * @return \Google\Cloud\Compute\V1\GetInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group. + * @type string $project + * Project ID for this request. + * @type string $zone + * The name of the zone where the managed instance group is located. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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 zone where the managed instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * The name of the zone where the managed instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceGroupManagerResizeRequestRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceGroupManagerResizeRequestRequest.php new file mode 100644 index 000000000000..58418bdf9cd7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceGroupManagerResizeRequestRequest.php @@ -0,0 +1,188 @@ +google.cloud.compute.v1.GetInstanceGroupManagerResizeRequestRequest + */ +class GetInstanceGroupManagerResizeRequestRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group. Name should conform to RFC1035 or be a resource ID. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the resize request. Name should conform to RFC1035 or be a resource ID. + * + * Generated from protobuf field string resize_request = 216941060 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resize_request = ''; + /** + * Name of the href="/compute/docs/regions-zones/#available">zone scoping this request. Name should conform to RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the href="/compute/docs/regions-zones/#available">zone scoping this request. Name should conform to RFC1035. + * @param string $instanceGroupManager The name of the managed instance group. Name should conform to RFC1035 or be a resource ID. + * @param string $resizeRequest The name of the resize request. Name should conform to RFC1035 or be a resource ID. + * + * @return \Google\Cloud\Compute\V1\GetInstanceGroupManagerResizeRequestRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager, string $resizeRequest): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager) + ->setResizeRequest($resizeRequest); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group. Name should conform to RFC1035 or be a resource ID. + * @type string $project + * Project ID for this request. + * @type string $resize_request + * The name of the resize request. Name should conform to RFC1035 or be a resource ID. + * @type string $zone + * Name of the href="/compute/docs/regions-zones/#available">zone scoping this request. Name should conform to RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the managed instance group. Name should conform to RFC1035 or be a resource ID. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. Name should conform to RFC1035 or be a resource ID. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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 resize request. Name should conform to RFC1035 or be a resource ID. + * + * Generated from protobuf field string resize_request = 216941060 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResizeRequest() + { + return $this->resize_request; + } + + /** + * The name of the resize request. Name should conform to RFC1035 or be a resource ID. + * + * Generated from protobuf field string resize_request = 216941060 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResizeRequest($var) + { + GPBUtil::checkString($var, True); + $this->resize_request = $var; + + return $this; + } + + /** + * Name of the href="/compute/docs/regions-zones/#available">zone scoping this request. Name should conform to RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Name of the href="/compute/docs/regions-zones/#available">zone scoping this request. Name should conform to RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceGroupRequest.php new file mode 100644 index 000000000000..034c9fefa6ba --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceGroupRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetInstanceGroupRequest + */ +class GetInstanceGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the instance group. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the zone where the instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the instance group is located. + * @param string $instanceGroup The name of the instance group. + * + * @return \Google\Cloud\Compute\V1\GetInstanceGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroup): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroup($instanceGroup); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group + * The name of the instance group. + * @type string $project + * Project ID for this request. + * @type string $zone + * The name of the zone where the instance group is located. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the instance group. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroup() + { + return $this->instance_group; + } + + /** + * The name of the instance group. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroup($var) + { + GPBUtil::checkString($var, True); + $this->instance_group = $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 zone where the instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * The name of the zone where the instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceRequest.php new file mode 100644 index 000000000000..0f63cc098ae0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetInstanceRequest + */ +class GetInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the instance resource to return. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance resource to return. + * + * @return \Google\Cloud\Compute\V1\GetInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name of the instance resource to return. + * @type string $project + * Project ID for 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); + } + + /** + * Name of the instance resource to return. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance resource to return. + * + * 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; + } + + /** + * 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 zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceSettingRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceSettingRequest.php new file mode 100644 index 000000000000..af21a76b9218 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceSettingRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetInstanceSettingRequest + */ +class GetInstanceSettingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone for this request. + * + * @return \Google\Cloud\Compute\V1\GetInstanceSettingRequest + * + * @experimental + */ + public static function build(string $project, string $zone): self + { + return (new self()) + ->setProject($project) + ->setZone($zone); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $zone + * Name of the zone for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceTemplateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceTemplateRequest.php new file mode 100644 index 000000000000..dfa61412ce2b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstanceTemplateRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetInstanceTemplateRequest + */ +class GetInstanceTemplateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the instance template. + * + * Generated from protobuf field string instance_template = 309248228 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_template = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $instanceTemplate The name of the instance template. + * + * @return \Google\Cloud\Compute\V1\GetInstanceTemplateRequest + * + * @experimental + */ + public static function build(string $project, string $instanceTemplate): self + { + return (new self()) + ->setProject($project) + ->setInstanceTemplate($instanceTemplate); + } + + /** + * 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. + * } + */ + 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstantSnapshotRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstantSnapshotRequest.php new file mode 100644 index 000000000000..b40a8f86c11c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInstantSnapshotRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetInstantSnapshotRequest + */ +class GetInstantSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the InstantSnapshot resource to return. + * + * Generated from protobuf field string instant_snapshot = 391638626 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instant_snapshot = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instantSnapshot Name of the InstantSnapshot resource to return. + * + * @return \Google\Cloud\Compute\V1\GetInstantSnapshotRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instantSnapshot): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstantSnapshot($instantSnapshot); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instant_snapshot + * Name of the InstantSnapshot resource to return. + * @type string $project + * Project ID for 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); + } + + /** + * Name of the InstantSnapshot resource to return. + * + * Generated from protobuf field string instant_snapshot = 391638626 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstantSnapshot() + { + return $this->instant_snapshot; + } + + /** + * Name of the InstantSnapshot resource to return. + * + * Generated from protobuf field string instant_snapshot = 391638626 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstantSnapshot($var) + { + GPBUtil::checkString($var, True); + $this->instant_snapshot = $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 zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInterconnectAttachmentRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInterconnectAttachmentRequest.php new file mode 100644 index 000000000000..64e38e2fb8a2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInterconnectAttachmentRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetInterconnectAttachmentRequest + */ +class GetInterconnectAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the interconnect attachment to return. + * + * Generated from protobuf field string interconnect_attachment = 308135284 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $interconnect_attachment = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $interconnectAttachment Name of the interconnect attachment to return. + * + * @return \Google\Cloud\Compute\V1\GetInterconnectAttachmentRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $interconnectAttachment): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInterconnectAttachment($interconnectAttachment); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $interconnect_attachment + * Name of the interconnect attachment to return. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the interconnect attachment to return. + * + * Generated from protobuf field string interconnect_attachment = 308135284 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInterconnectAttachment() + { + return $this->interconnect_attachment; + } + + /** + * Name of the interconnect attachment to return. + * + * Generated from protobuf field string interconnect_attachment = 308135284 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInterconnectAttachment($var) + { + GPBUtil::checkString($var, True); + $this->interconnect_attachment = $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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInterconnectLocationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInterconnectLocationRequest.php new file mode 100644 index 000000000000..8a7b83eede63 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInterconnectLocationRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetInterconnectLocationRequest + */ +class GetInterconnectLocationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the interconnect location to return. + * + * Generated from protobuf field string interconnect_location = 492235846 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $interconnect_location = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $interconnectLocation Name of the interconnect location to return. + * + * @return \Google\Cloud\Compute\V1\GetInterconnectLocationRequest + * + * @experimental + */ + public static function build(string $project, string $interconnectLocation): self + { + return (new self()) + ->setProject($project) + ->setInterconnectLocation($interconnectLocation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $interconnect_location + * Name of the interconnect location to return. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the interconnect location to return. + * + * Generated from protobuf field string interconnect_location = 492235846 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInterconnectLocation() + { + return $this->interconnect_location; + } + + /** + * Name of the interconnect location to return. + * + * Generated from protobuf field string interconnect_location = 492235846 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInterconnectLocation($var) + { + GPBUtil::checkString($var, True); + $this->interconnect_location = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInterconnectRemoteLocationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInterconnectRemoteLocationRequest.php new file mode 100644 index 000000000000..793336c9bccd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInterconnectRemoteLocationRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetInterconnectRemoteLocationRequest + */ +class GetInterconnectRemoteLocationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the interconnect remote location to return. + * + * Generated from protobuf field string interconnect_remote_location = 290153949 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $interconnect_remote_location = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $interconnectRemoteLocation Name of the interconnect remote location to return. + * + * @return \Google\Cloud\Compute\V1\GetInterconnectRemoteLocationRequest + * + * @experimental + */ + public static function build(string $project, string $interconnectRemoteLocation): self + { + return (new self()) + ->setProject($project) + ->setInterconnectRemoteLocation($interconnectRemoteLocation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $interconnect_remote_location + * Name of the interconnect remote location to return. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the interconnect remote location to return. + * + * Generated from protobuf field string interconnect_remote_location = 290153949 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInterconnectRemoteLocation() + { + return $this->interconnect_remote_location; + } + + /** + * Name of the interconnect remote location to return. + * + * Generated from protobuf field string interconnect_remote_location = 290153949 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInterconnectRemoteLocation($var) + { + GPBUtil::checkString($var, True); + $this->interconnect_remote_location = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInterconnectRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInterconnectRequest.php new file mode 100644 index 000000000000..6e966d5d5c56 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetInterconnectRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetInterconnectRequest + */ +class GetInterconnectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the interconnect to return. + * + * Generated from protobuf field string interconnect = 224601230 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $interconnect = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $interconnect Name of the interconnect to return. + * + * @return \Google\Cloud\Compute\V1\GetInterconnectRequest + * + * @experimental + */ + public static function build(string $project, string $interconnect): self + { + return (new self()) + ->setProject($project) + ->setInterconnect($interconnect); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $interconnect + * Name of the interconnect to return. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the interconnect to return. + * + * Generated from protobuf field string interconnect = 224601230 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInterconnect() + { + return $this->interconnect; + } + + /** + * Name of the interconnect to return. + * + * Generated from protobuf field string interconnect = 224601230 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInterconnect($var) + { + GPBUtil::checkString($var, True); + $this->interconnect = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetLicenseCodeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetLicenseCodeRequest.php new file mode 100644 index 000000000000..4e641f4ce531 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetLicenseCodeRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetLicenseCodeRequest + */ +class GetLicenseCodeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Number corresponding to the License code resource to return. + * + * Generated from protobuf field string license_code = 1467179 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $license_code = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $licenseCode Number corresponding to the License code resource to return. + * + * @return \Google\Cloud\Compute\V1\GetLicenseCodeRequest + * + * @experimental + */ + public static function build(string $project, string $licenseCode): self + { + return (new self()) + ->setProject($project) + ->setLicenseCode($licenseCode); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $license_code + * Number corresponding to the License code resource to return. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Number corresponding to the License code resource to return. + * + * Generated from protobuf field string license_code = 1467179 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLicenseCode() + { + return $this->license_code; + } + + /** + * Number corresponding to the License code resource to return. + * + * Generated from protobuf field string license_code = 1467179 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLicenseCode($var) + { + GPBUtil::checkString($var, True); + $this->license_code = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetLicenseRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetLicenseRequest.php new file mode 100644 index 000000000000..bdc31ef1e7ca --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetLicenseRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetLicenseRequest + */ +class GetLicenseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the License resource to return. + * + * Generated from protobuf field string license = 166757441 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $license = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $license Name of the License resource to return. + * + * @return \Google\Cloud\Compute\V1\GetLicenseRequest + * + * @experimental + */ + public static function build(string $project, string $license): self + { + return (new self()) + ->setProject($project) + ->setLicense($license); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $license + * Name of the License resource to return. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the License resource to return. + * + * Generated from protobuf field string license = 166757441 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLicense() + { + return $this->license; + } + + /** + * Name of the License resource to return. + * + * Generated from protobuf field string license = 166757441 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLicense($var) + { + GPBUtil::checkString($var, True); + $this->license = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetMachineImageRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetMachineImageRequest.php new file mode 100644 index 000000000000..53a504f2de67 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetMachineImageRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetMachineImageRequest + */ +class GetMachineImageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the machine image. + * + * Generated from protobuf field string machine_image = 69189475 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $machine_image = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $machineImage The name of the machine image. + * + * @return \Google\Cloud\Compute\V1\GetMachineImageRequest + * + * @experimental + */ + public static function build(string $project, string $machineImage): self + { + return (new self()) + ->setProject($project) + ->setMachineImage($machineImage); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $machine_image + * The name of the machine image. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the machine image. + * + * Generated from protobuf field string machine_image = 69189475 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getMachineImage() + { + return $this->machine_image; + } + + /** + * The name of the machine image. + * + * Generated from protobuf field string machine_image = 69189475 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setMachineImage($var) + { + GPBUtil::checkString($var, True); + $this->machine_image = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetMachineTypeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetMachineTypeRequest.php new file mode 100644 index 000000000000..f16dcc7cb835 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetMachineTypeRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetMachineTypeRequest + */ +class GetMachineTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the machine type to return. + * + * Generated from protobuf field string machine_type = 227711026 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $machine_type = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $machineType Name of the machine type to return. + * + * @return \Google\Cloud\Compute\V1\GetMachineTypeRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $machineType): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setMachineType($machineType); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $machine_type + * Name of the machine type to return. + * @type string $project + * Project ID for 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); + } + + /** + * Name of the machine type to return. + * + * Generated from protobuf field string machine_type = 227711026 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getMachineType() + { + return $this->machine_type; + } + + /** + * Name of the machine type to return. + * + * Generated from protobuf field string machine_type = 227711026 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $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 zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetMacsecConfigInterconnectRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetMacsecConfigInterconnectRequest.php new file mode 100644 index 000000000000..30cb87cae7b8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetMacsecConfigInterconnectRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetMacsecConfigInterconnectRequest + */ +class GetMacsecConfigInterconnectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the interconnect resource to query. + * + * Generated from protobuf field string interconnect = 224601230 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $interconnect = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $interconnect Name of the interconnect resource to query. + * + * @return \Google\Cloud\Compute\V1\GetMacsecConfigInterconnectRequest + * + * @experimental + */ + public static function build(string $project, string $interconnect): self + { + return (new self()) + ->setProject($project) + ->setInterconnect($interconnect); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $interconnect + * Name of the interconnect resource to query. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the interconnect resource to query. + * + * Generated from protobuf field string interconnect = 224601230 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInterconnect() + { + return $this->interconnect; + } + + /** + * Name of the interconnect resource to query. + * + * Generated from protobuf field string interconnect = 224601230 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInterconnect($var) + { + GPBUtil::checkString($var, True); + $this->interconnect = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNatIpInfoRouterRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNatIpInfoRouterRequest.php new file mode 100644 index 000000000000..abd2653c6bd0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNatIpInfoRouterRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.GetNatIpInfoRouterRequest + */ +class GetNatIpInfoRouterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the nat service to filter the NAT IP information. If it is omitted, all nats for this router will be returned. Name should conform to RFC1035. + * + * Generated from protobuf field optional string nat_name = 425596649; + */ + protected $nat_name = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name of the Router resource to query for Nat IP information. The name should conform to RFC1035. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $router = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $router Name of the Router resource to query for Nat IP information. The name should conform to RFC1035. + * + * @return \Google\Cloud\Compute\V1\GetNatIpInfoRouterRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $router): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $nat_name + * Name of the nat service to filter the NAT IP information. If it is omitted, all nats for this router will be returned. Name should conform to RFC1035. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region for this request. + * @type string $router + * Name of the Router resource to query for Nat IP information. The name should conform to RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the nat service to filter the NAT IP information. If it is omitted, all nats for this router will be returned. Name should conform to RFC1035. + * + * Generated from protobuf field optional string nat_name = 425596649; + * @return string + */ + public function getNatName() + { + return isset($this->nat_name) ? $this->nat_name : ''; + } + + public function hasNatName() + { + return isset($this->nat_name); + } + + public function clearNatName() + { + unset($this->nat_name); + } + + /** + * Name of the nat service to filter the NAT IP information. If it is omitted, all nats for this router will be returned. Name should conform to RFC1035. + * + * Generated from protobuf field optional string nat_name = 425596649; + * @param string $var + * @return $this + */ + public function setNatName($var) + { + GPBUtil::checkString($var, True); + $this->nat_name = $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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Name of the Router resource to query for Nat IP information. The name should conform to RFC1035. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRouter() + { + return $this->router; + } + + /** + * Name of the Router resource to query for Nat IP information. The name should conform to RFC1035. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRouter($var) + { + GPBUtil::checkString($var, True); + $this->router = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNatMappingInfoRoutersRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNatMappingInfoRoutersRequest.php new file mode 100644 index 000000000000..3418cc0a5fef --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNatMappingInfoRoutersRequest.php @@ -0,0 +1,416 @@ +google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + */ +class GetNatMappingInfoRoutersRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $max_results = null; + /** + * Name of the nat service to filter the Nat Mapping information. If it is omitted, all nats for this router will be returned. Name should conform to RFC1035. + * + * Generated from protobuf field optional string nat_name = 425596649; + */ + protected $nat_name = 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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * Name of the Router resource to query for Nat Mapping information of VM endpoints. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $router = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $router Name of the Router resource to query for Nat Mapping information of VM endpoints. + * + * @return \Google\Cloud\Compute\V1\GetNatMappingInfoRoutersRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $router): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 $nat_name + * Name of the nat service to filter the Nat Mapping information. If it is omitted, all nats for this router will be returned. Name should conform to RFC1035. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type string $router + * Name of the Router resource to query for Nat Mapping information of VM endpoints. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the nat service to filter the Nat Mapping information. If it is omitted, all nats for this router will be returned. Name should conform to RFC1035. + * + * Generated from protobuf field optional string nat_name = 425596649; + * @return string + */ + public function getNatName() + { + return isset($this->nat_name) ? $this->nat_name : ''; + } + + public function hasNatName() + { + return isset($this->nat_name); + } + + public function clearNatName() + { + unset($this->nat_name); + } + + /** + * Name of the nat service to filter the Nat Mapping information. If it is omitted, all nats for this router will be returned. Name should conform to RFC1035. + * + * Generated from protobuf field optional string nat_name = 425596649; + * @param string $var + * @return $this + */ + public function setNatName($var) + { + GPBUtil::checkString($var, True); + $this->nat_name = $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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * Name of the Router resource to query for Nat Mapping information of VM endpoints. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRouter() + { + return $this->router; + } + + /** + * Name of the Router resource to query for Nat Mapping information of VM endpoints. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRouter($var) + { + GPBUtil::checkString($var, True); + $this->router = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNetworkAttachmentRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNetworkAttachmentRequest.php new file mode 100644 index 000000000000..6722bf1f9231 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNetworkAttachmentRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetNetworkAttachmentRequest + */ +class GetNetworkAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the NetworkAttachment resource to return. + * + * Generated from protobuf field string network_attachment = 224644052 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_attachment = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region of this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region of this request. + * @param string $networkAttachment Name of the NetworkAttachment resource to return. + * + * @return \Google\Cloud\Compute\V1\GetNetworkAttachmentRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $networkAttachment): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setNetworkAttachment($networkAttachment); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network_attachment + * Name of the NetworkAttachment resource to return. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region of this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the NetworkAttachment resource to return. + * + * Generated from protobuf field string network_attachment = 224644052 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkAttachment() + { + return $this->network_attachment; + } + + /** + * Name of the NetworkAttachment resource to return. + * + * Generated from protobuf field string network_attachment = 224644052 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkAttachment($var) + { + GPBUtil::checkString($var, True); + $this->network_attachment = $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; + } + + /** + * Name of the region of this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region of 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNetworkEdgeSecurityServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNetworkEdgeSecurityServiceRequest.php new file mode 100644 index 000000000000..5982ce0f16d2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNetworkEdgeSecurityServiceRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetNetworkEdgeSecurityServiceRequest + */ +class GetNetworkEdgeSecurityServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the network edge security service to get. + * + * Generated from protobuf field string network_edge_security_service = 157011879 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_edge_security_service = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $networkEdgeSecurityService Name of the network edge security service to get. + * + * @return \Google\Cloud\Compute\V1\GetNetworkEdgeSecurityServiceRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $networkEdgeSecurityService): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setNetworkEdgeSecurityService($networkEdgeSecurityService); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network_edge_security_service + * Name of the network edge security service to get. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the network edge security service to get. + * + * Generated from protobuf field string network_edge_security_service = 157011879 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkEdgeSecurityService() + { + return $this->network_edge_security_service; + } + + /** + * Name of the network edge security service to get. + * + * Generated from protobuf field string network_edge_security_service = 157011879 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkEdgeSecurityService($var) + { + GPBUtil::checkString($var, True); + $this->network_edge_security_service = $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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNetworkEndpointGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNetworkEndpointGroupRequest.php new file mode 100644 index 000000000000..455a9b4d439e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNetworkEndpointGroupRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetNetworkEndpointGroupRequest + */ +class GetNetworkEndpointGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the network endpoint group. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_endpoint_group = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @param string $networkEndpointGroup The name of the network endpoint group. It should comply with RFC1035. + * + * @return \Google\Cloud\Compute\V1\GetNetworkEndpointGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $networkEndpointGroup): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setNetworkEndpointGroup($networkEndpointGroup); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network_endpoint_group + * The name of the network endpoint group. It should comply with RFC1035. + * @type string $project + * Project ID for this request. + * @type string $zone + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the network endpoint group. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkEndpointGroup() + { + return $this->network_endpoint_group; + } + + /** + * The name of the network endpoint group. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkEndpointGroup($var) + { + GPBUtil::checkString($var, True); + $this->network_endpoint_group = $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 zone where the network endpoint group is located. It should comply with RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..284ac2647509 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNetworkFirewallPolicyRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetNetworkFirewallPolicyRequest + */ +class GetNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to get. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $firewallPolicy Name of the firewall policy to get. + * + * @return \Google\Cloud\Compute\V1\GetNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $firewallPolicy): self + { + return (new self()) + ->setProject($project) + ->setFirewallPolicy($firewallPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to get. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall policy to get. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to get. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNetworkRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNetworkRequest.php new file mode 100644 index 000000000000..9c193d039c0c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNetworkRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetNetworkRequest + */ +class GetNetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the network to return. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $network Name of the network to return. + * + * @return \Google\Cloud\Compute\V1\GetNetworkRequest + * + * @experimental + */ + public static function build(string $project, string $network): self + { + return (new self()) + ->setProject($project) + ->setNetwork($network); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Name of the network to return. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the network to return. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Name of the network to return. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNodeGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNodeGroupRequest.php new file mode 100644 index 000000000000..dd30ffa76d4b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNodeGroupRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetNodeGroupRequest + */ +class GetNodeGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the node group to return. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $node_group = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $nodeGroup Name of the node group to return. + * + * @return \Google\Cloud\Compute\V1\GetNodeGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $nodeGroup): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setNodeGroup($nodeGroup); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $node_group + * Name of the node group to return. + * @type string $project + * Project ID for 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); + } + + /** + * Name of the node group to return. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNodeGroup() + { + return $this->node_group; + } + + /** + * Name of the node group to return. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNodeGroup($var) + { + GPBUtil::checkString($var, True); + $this->node_group = $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 zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNodeTemplateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNodeTemplateRequest.php new file mode 100644 index 000000000000..60e992583cc9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNodeTemplateRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetNodeTemplateRequest + */ +class GetNodeTemplateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the node template to return. + * + * Generated from protobuf field string node_template = 323154455 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $node_template = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $nodeTemplate Name of the node template to return. + * + * @return \Google\Cloud\Compute\V1\GetNodeTemplateRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $nodeTemplate): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setNodeTemplate($nodeTemplate); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $node_template + * Name of the node template to return. + * @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); + } + + /** + * Name of the node template to return. + * + * Generated from protobuf field string node_template = 323154455 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNodeTemplate() + { + return $this->node_template; + } + + /** + * Name of the node template to return. + * + * Generated from protobuf field string node_template = 323154455 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNodeTemplate($var) + { + GPBUtil::checkString($var, True); + $this->node_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNodeTypeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNodeTypeRequest.php new file mode 100644 index 000000000000..dca3e88c158c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNodeTypeRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetNodeTypeRequest + */ +class GetNodeTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the node type to return. + * + * Generated from protobuf field string node_type = 465832791 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $node_type = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $nodeType Name of the node type to return. + * + * @return \Google\Cloud\Compute\V1\GetNodeTypeRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $nodeType): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setNodeType($nodeType); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $node_type + * Name of the node type to return. + * @type string $project + * Project ID for 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); + } + + /** + * Name of the node type to return. + * + * Generated from protobuf field string node_type = 465832791 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNodeType() + { + return $this->node_type; + } + + /** + * Name of the node type to return. + * + * Generated from protobuf field string node_type = 465832791 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNodeType($var) + { + GPBUtil::checkString($var, True); + $this->node_type = $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 zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetPacketMirroringRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetPacketMirroringRequest.php new file mode 100644 index 000000000000..569f59cc4d53 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetPacketMirroringRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetPacketMirroringRequest + */ +class GetPacketMirroringRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the PacketMirroring resource to return. + * + * Generated from protobuf field string packet_mirroring = 22305996 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $packet_mirroring = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $packetMirroring Name of the PacketMirroring resource to return. + * + * @return \Google\Cloud\Compute\V1\GetPacketMirroringRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $packetMirroring): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setPacketMirroring($packetMirroring); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $packet_mirroring + * Name of the PacketMirroring resource to return. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the PacketMirroring resource to return. + * + * Generated from protobuf field string packet_mirroring = 22305996 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPacketMirroring() + { + return $this->packet_mirroring; + } + + /** + * Name of the PacketMirroring resource to return. + * + * Generated from protobuf field string packet_mirroring = 22305996 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPacketMirroring($var) + { + GPBUtil::checkString($var, True); + $this->packet_mirroring = $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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetProjectRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetProjectRequest.php new file mode 100644 index 000000000000..9229ee9985e8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetProjectRequest.php @@ -0,0 +1,80 @@ +google.cloud.compute.v1.GetProjectRequest + */ +class GetProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\GetProjectRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetPublicAdvertisedPrefixeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetPublicAdvertisedPrefixeRequest.php new file mode 100644 index 000000000000..1700ff0bae63 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetPublicAdvertisedPrefixeRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest + */ +class GetPublicAdvertisedPrefixeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the PublicAdvertisedPrefix resource to return. + * + * Generated from protobuf field string public_advertised_prefix = 101874590 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $public_advertised_prefix = ''; + + /** + * @param string $project Project ID for this request. + * @param string $publicAdvertisedPrefix Name of the PublicAdvertisedPrefix resource to return. + * + * @return \Google\Cloud\Compute\V1\GetPublicAdvertisedPrefixeRequest + * + * @experimental + */ + public static function build(string $project, string $publicAdvertisedPrefix): self + { + return (new self()) + ->setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $public_advertised_prefix + * Name of the PublicAdvertisedPrefix resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the PublicAdvertisedPrefix resource to return. + * + * Generated from protobuf field string public_advertised_prefix = 101874590 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPublicAdvertisedPrefix() + { + return $this->public_advertised_prefix; + } + + /** + * Name of the PublicAdvertisedPrefix resource to return. + * + * Generated from protobuf field string public_advertised_prefix = 101874590 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPublicAdvertisedPrefix($var) + { + GPBUtil::checkString($var, True); + $this->public_advertised_prefix = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetPublicDelegatedPrefixeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetPublicDelegatedPrefixeRequest.php new file mode 100644 index 000000000000..553c1fe5f4b2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetPublicDelegatedPrefixeRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest + */ +class GetPublicDelegatedPrefixeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the PublicDelegatedPrefix resource to return. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $public_delegated_prefix = ''; + /** + * Name of the region of this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region of this request. + * @param string $publicDelegatedPrefix Name of the PublicDelegatedPrefix resource to return. + * + * @return \Google\Cloud\Compute\V1\GetPublicDelegatedPrefixeRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $publicDelegatedPrefix): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setPublicDelegatedPrefix($publicDelegatedPrefix); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $public_delegated_prefix + * Name of the PublicDelegatedPrefix resource to return. + * @type string $region + * Name of the region of this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the PublicDelegatedPrefix resource to return. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPublicDelegatedPrefix() + { + return $this->public_delegated_prefix; + } + + /** + * Name of the PublicDelegatedPrefix resource to return. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPublicDelegatedPrefix($var) + { + GPBUtil::checkString($var, True); + $this->public_delegated_prefix = $var; + + return $this; + } + + /** + * Name of the region of this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region of 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionAutoscalerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionAutoscalerRequest.php new file mode 100644 index 000000000000..e2c0a635f4ec --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionAutoscalerRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRegionAutoscalerRequest + */ +class GetRegionAutoscalerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the autoscaler to return. + * + * Generated from protobuf field string autoscaler = 517258967 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $autoscaler = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $autoscaler Name of the autoscaler to return. + * + * @return \Google\Cloud\Compute\V1\GetRegionAutoscalerRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $autoscaler): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setAutoscaler($autoscaler); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $autoscaler + * Name of the autoscaler to return. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the autoscaler to return. + * + * Generated from protobuf field string autoscaler = 517258967 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAutoscaler() + { + return $this->autoscaler; + } + + /** + * Name of the autoscaler to return. + * + * Generated from protobuf field string autoscaler = 517258967 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAutoscaler($var) + { + GPBUtil::checkString($var, True); + $this->autoscaler = $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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionBackendServiceRequest.php new file mode 100644 index 000000000000..f4513a72cd01 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionBackendServiceRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRegionBackendServiceRequest + */ +class GetRegionBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the BackendService resource to return. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_service = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $backendService Name of the BackendService resource to return. + * + * @return \Google\Cloud\Compute\V1\GetRegionBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $backendService): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setBackendService($backendService); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_service + * Name of the BackendService resource to return. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the BackendService resource to return. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackendService() + { + return $this->backend_service; + } + + /** + * Name of the BackendService resource to return. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackendService($var) + { + GPBUtil::checkString($var, True); + $this->backend_service = $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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionCommitmentRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionCommitmentRequest.php new file mode 100644 index 000000000000..82e2b9578043 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionCommitmentRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRegionCommitmentRequest + */ +class GetRegionCommitmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the commitment to return. + * + * Generated from protobuf field string commitment = 482134805 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $commitment = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $commitment Name of the commitment to return. + * + * @return \Google\Cloud\Compute\V1\GetRegionCommitmentRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $commitment): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setCommitment($commitment); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $commitment + * Name of the commitment to return. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the commitment to return. + * + * Generated from protobuf field string commitment = 482134805 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCommitment() + { + return $this->commitment; + } + + /** + * Name of the commitment to return. + * + * Generated from protobuf field string commitment = 482134805 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCommitment($var) + { + GPBUtil::checkString($var, True); + $this->commitment = $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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionDiskRequest.php new file mode 100644 index 000000000000..d576ee374777 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionDiskRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRegionDiskRequest + */ +class GetRegionDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the regional persistent disk to return. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $disk Name of the regional persistent disk to return. + * + * @return \Google\Cloud\Compute\V1\GetRegionDiskRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $disk): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setDisk($disk); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $disk + * Name of the regional persistent disk to return. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the regional persistent disk to return. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisk() + { + return $this->disk; + } + + /** + * Name of the regional persistent disk to return. + * + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionDiskTypeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionDiskTypeRequest.php new file mode 100644 index 000000000000..794669f3501e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionDiskTypeRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRegionDiskTypeRequest + */ +class GetRegionDiskTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the disk type to return. + * + * Generated from protobuf field string disk_type = 93009052 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk_type = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $diskType Name of the disk type to return. + * + * @return \Google\Cloud\Compute\V1\GetRegionDiskTypeRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $diskType): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setDiskType($diskType); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $disk_type + * Name of the disk type to return. + * @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); + } + + /** + * Name of the disk type to return. + * + * Generated from protobuf field string disk_type = 93009052 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDiskType() + { + return $this->disk_type; + } + + /** + * Name of the disk type to return. + * + * Generated from protobuf field string disk_type = 93009052 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDiskType($var) + { + GPBUtil::checkString($var, True); + $this->disk_type = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionHealthCheckRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionHealthCheckRequest.php new file mode 100644 index 000000000000..29d6d2186301 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionHealthCheckRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRegionHealthCheckRequest + */ +class GetRegionHealthCheckRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the HealthCheck resource to return. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $health_check = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $healthCheck Name of the HealthCheck resource to return. + * + * @return \Google\Cloud\Compute\V1\GetRegionHealthCheckRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $healthCheck): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setHealthCheck($healthCheck); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $health_check + * Name of the HealthCheck resource to return. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the HealthCheck resource to return. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getHealthCheck() + { + return $this->health_check; + } + + /** + * Name of the HealthCheck resource to return. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setHealthCheck($var) + { + GPBUtil::checkString($var, True); + $this->health_check = $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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionHealthCheckServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionHealthCheckServiceRequest.php new file mode 100644 index 000000000000..8b609a02cb6b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionHealthCheckServiceRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRegionHealthCheckServiceRequest + */ +class GetRegionHealthCheckServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string health_check_service = 408374747 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $health_check_service = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $healthCheckService Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035. + * + * @return \Google\Cloud\Compute\V1\GetRegionHealthCheckServiceRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $healthCheckService): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setHealthCheckService($healthCheckService); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $health_check_service + * Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string health_check_service = 408374747 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getHealthCheckService() + { + return $this->health_check_service; + } + + /** + * Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string health_check_service = 408374747 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setHealthCheckService($var) + { + GPBUtil::checkString($var, True); + $this->health_check_service = $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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..e08449a6d936 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionInstanceGroupManagerRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest + */ +class GetRegionInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the managed instance group to return. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $instanceGroupManager Name of the managed instance group to return. + * + * @return \Google\Cloud\Compute\V1\GetRegionInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroupManager): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroupManager($instanceGroupManager); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * Name of the managed instance group to return. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the managed instance group to return. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * Name of the managed instance group to return. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionInstanceGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionInstanceGroupRequest.php new file mode 100644 index 000000000000..49389538a153 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionInstanceGroupRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRegionInstanceGroupRequest + */ +class GetRegionInstanceGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the instance group resource to return. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $instanceGroup Name of the instance group resource to return. + * + * @return \Google\Cloud\Compute\V1\GetRegionInstanceGroupRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroup): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroup($instanceGroup); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group + * Name of the instance group resource to return. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the instance group resource to return. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroup() + { + return $this->instance_group; + } + + /** + * Name of the instance group resource to return. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroup($var) + { + GPBUtil::checkString($var, True); + $this->instance_group = $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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionInstanceTemplateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionInstanceTemplateRequest.php new file mode 100644 index 000000000000..0145f3a5b06c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionInstanceTemplateRequest.php @@ -0,0 +1,152 @@ +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]; + */ + protected $instance_template = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $instanceTemplate The name of the instance template. + * + * @return \Google\Cloud\Compute\V1\GetRegionInstanceTemplateRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceTemplate): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceTemplate($instanceTemplate); + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionInstantSnapshotRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionInstantSnapshotRequest.php new file mode 100644 index 000000000000..2d8654ac12ed --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionInstantSnapshotRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRegionInstantSnapshotRequest + */ +class GetRegionInstantSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the InstantSnapshot resource to return. + * + * Generated from protobuf field string instant_snapshot = 391638626 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instant_snapshot = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $instantSnapshot Name of the InstantSnapshot resource to return. + * + * @return \Google\Cloud\Compute\V1\GetRegionInstantSnapshotRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instantSnapshot): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstantSnapshot($instantSnapshot); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instant_snapshot + * Name of the InstantSnapshot resource to return. + * @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); + } + + /** + * Name of the InstantSnapshot resource to return. + * + * Generated from protobuf field string instant_snapshot = 391638626 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstantSnapshot() + { + return $this->instant_snapshot; + } + + /** + * Name of the InstantSnapshot resource to return. + * + * Generated from protobuf field string instant_snapshot = 391638626 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstantSnapshot($var) + { + GPBUtil::checkString($var, True); + $this->instant_snapshot = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionNetworkEndpointGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionNetworkEndpointGroupRequest.php new file mode 100644 index 000000000000..3f9512e26800 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionNetworkEndpointGroupRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest + */ +class GetRegionNetworkEndpointGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the network endpoint group. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_endpoint_group = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region where the network endpoint group is located. It should comply with RFC1035. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region where the network endpoint group is located. It should comply with RFC1035. + * @param string $networkEndpointGroup The name of the network endpoint group. It should comply with RFC1035. + * + * @return \Google\Cloud\Compute\V1\GetRegionNetworkEndpointGroupRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $networkEndpointGroup): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setNetworkEndpointGroup($networkEndpointGroup); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network_endpoint_group + * The name of the network endpoint group. It should comply with RFC1035. + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region where the network endpoint group is located. It should comply with RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the network endpoint group. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkEndpointGroup() + { + return $this->network_endpoint_group; + } + + /** + * The name of the network endpoint group. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkEndpointGroup($var) + { + GPBUtil::checkString($var, True); + $this->network_endpoint_group = $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 where the network endpoint group is located. It should comply with RFC1035. + * + * 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 where the network endpoint group is located. It should comply with RFC1035. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..fb579c7b1930 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionNetworkFirewallPolicyRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRegionNetworkFirewallPolicyRequest + */ +class GetRegionNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to get. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $firewallPolicy Name of the firewall policy to get. + * + * @return \Google\Cloud\Compute\V1\GetRegionNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $firewallPolicy): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setFirewallPolicy($firewallPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to get. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall policy to get. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to get. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionNotificationEndpointRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionNotificationEndpointRequest.php new file mode 100644 index 000000000000..1a3f0ef13386 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionNotificationEndpointRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRegionNotificationEndpointRequest + */ +class GetRegionNotificationEndpointRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the NotificationEndpoint resource to return. + * + * Generated from protobuf field string notification_endpoint = 376807017 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $notification_endpoint = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $notificationEndpoint Name of the NotificationEndpoint resource to return. + * + * @return \Google\Cloud\Compute\V1\GetRegionNotificationEndpointRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $notificationEndpoint): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setNotificationEndpoint($notificationEndpoint); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $notification_endpoint + * Name of the NotificationEndpoint resource to return. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the NotificationEndpoint resource to return. + * + * Generated from protobuf field string notification_endpoint = 376807017 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNotificationEndpoint() + { + return $this->notification_endpoint; + } + + /** + * Name of the NotificationEndpoint resource to return. + * + * Generated from protobuf field string notification_endpoint = 376807017 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNotificationEndpoint($var) + { + GPBUtil::checkString($var, True); + $this->notification_endpoint = $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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionOperationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionOperationRequest.php new file mode 100644 index 000000000000..c90f22b27cee --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionOperationRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRegionOperationRequest + */ +class GetRegionOperationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the Operations resource to return. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_response_field) = "name"]; + */ + protected $operation = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $operation Name of the Operations resource to return. + * + * @return \Google\Cloud\Compute\V1\GetRegionOperationRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $operation): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setOperation($operation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $operation + * Name of the Operations resource to return. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the Operations resource to return. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_response_field) = "name"]; + * @return string + */ + public function getOperation() + { + return $this->operation; + } + + /** + * Name of the Operations resource to return. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_response_field) = "name"]; + * @param string $var + * @return $this + */ + public function setOperation($var) + { + GPBUtil::checkString($var, True); + $this->operation = $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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionRequest.php new file mode 100644 index 000000000000..4ff9ef934a74 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetRegionRequest + */ +class GetRegionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region resource to return. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region resource to return. + * + * @return \Google\Cloud\Compute\V1\GetRegionRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region resource to return. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region resource to return. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionSecurityPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionSecurityPolicyRequest.php new file mode 100644 index 000000000000..cd327e14d39f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionSecurityPolicyRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRegionSecurityPolicyRequest + */ +class GetRegionSecurityPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name of the security policy to get. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $securityPolicy Name of the security policy to get. + * + * @return \Google\Cloud\Compute\V1\GetRegionSecurityPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $securityPolicy): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type string $security_policy + * Name of the security policy to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the security policy to get. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSecurityPolicy() + { + return $this->security_policy; + } + + /** + * Name of the security policy to get. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->security_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionSslCertificateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionSslCertificateRequest.php new file mode 100644 index 000000000000..b6898361454e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionSslCertificateRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRegionSslCertificateRequest + */ +class GetRegionSslCertificateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name of the SslCertificate resource to return. + * + * Generated from protobuf field string ssl_certificate = 46443492 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ssl_certificate = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $sslCertificate Name of the SslCertificate resource to return. + * + * @return \Google\Cloud\Compute\V1\GetRegionSslCertificateRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $sslCertificate): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setSslCertificate($sslCertificate); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type string $ssl_certificate + * Name of the SslCertificate resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the SslCertificate resource to return. + * + * Generated from protobuf field string ssl_certificate = 46443492 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSslCertificate() + { + return $this->ssl_certificate; + } + + /** + * Name of the SslCertificate resource to return. + * + * Generated from protobuf field string ssl_certificate = 46443492 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSslCertificate($var) + { + GPBUtil::checkString($var, True); + $this->ssl_certificate = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionSslPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionSslPolicyRequest.php new file mode 100644 index 000000000000..060ec6ef24de --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionSslPolicyRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRegionSslPolicyRequest + */ +class GetRegionSslPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string ssl_policy = 295190213 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ssl_policy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * + * @return \Google\Cloud\Compute\V1\GetRegionSslPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $sslPolicy): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setSslPolicy($sslPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type string $ssl_policy + * Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string ssl_policy = 295190213 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSslPolicy() + { + return $this->ssl_policy; + } + + /** + * Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string ssl_policy = 295190213 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSslPolicy($var) + { + GPBUtil::checkString($var, True); + $this->ssl_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionTargetHttpProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionTargetHttpProxyRequest.php new file mode 100644 index 000000000000..d94300d1ba2b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionTargetHttpProxyRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRegionTargetHttpProxyRequest + */ +class GetRegionTargetHttpProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name of the TargetHttpProxy resource to return. + * + * Generated from protobuf field string target_http_proxy = 206872421 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_http_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetHttpProxy Name of the TargetHttpProxy resource to return. + * + * @return \Google\Cloud\Compute\V1\GetRegionTargetHttpProxyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $targetHttpProxy): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpProxy($targetHttpProxy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type string $target_http_proxy + * Name of the TargetHttpProxy resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the TargetHttpProxy resource to return. + * + * Generated from protobuf field string target_http_proxy = 206872421 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetHttpProxy() + { + return $this->target_http_proxy; + } + + /** + * Name of the TargetHttpProxy resource to return. + * + * Generated from protobuf field string target_http_proxy = 206872421 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetHttpProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_http_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionTargetHttpsProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionTargetHttpsProxyRequest.php new file mode 100644 index 000000000000..37342d7f5063 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionTargetHttpsProxyRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest + */ +class GetRegionTargetHttpsProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name of the TargetHttpsProxy resource to return. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_https_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource to return. + * + * @return \Google\Cloud\Compute\V1\GetRegionTargetHttpsProxyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $targetHttpsProxy): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpsProxy($targetHttpsProxy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type string $target_https_proxy + * Name of the TargetHttpsProxy resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the TargetHttpsProxy resource to return. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetHttpsProxy() + { + return $this->target_https_proxy; + } + + /** + * Name of the TargetHttpsProxy resource to return. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetHttpsProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_https_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionTargetTcpProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionTargetTcpProxyRequest.php new file mode 100644 index 000000000000..0008cb5edfd5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionTargetTcpProxyRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRegionTargetTcpProxyRequest + */ +class GetRegionTargetTcpProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name of the TargetTcpProxy resource to return. + * + * Generated from protobuf field string target_tcp_proxy = 503065442 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_tcp_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetTcpProxy Name of the TargetTcpProxy resource to return. + * + * @return \Google\Cloud\Compute\V1\GetRegionTargetTcpProxyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $targetTcpProxy): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetTcpProxy($targetTcpProxy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type string $target_tcp_proxy + * Name of the TargetTcpProxy resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the TargetTcpProxy resource to return. + * + * Generated from protobuf field string target_tcp_proxy = 503065442 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetTcpProxy() + { + return $this->target_tcp_proxy; + } + + /** + * Name of the TargetTcpProxy resource to return. + * + * Generated from protobuf field string target_tcp_proxy = 503065442 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetTcpProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_tcp_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionUrlMapRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionUrlMapRequest.php new file mode 100644 index 000000000000..867db900706f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRegionUrlMapRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRegionUrlMapRequest + */ +class GetRegionUrlMapRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name of the UrlMap resource to return. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url_map = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $urlMap Name of the UrlMap resource to return. + * + * @return \Google\Cloud\Compute\V1\GetRegionUrlMapRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $urlMap): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setUrlMap($urlMap); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type string $url_map + * Name of the UrlMap resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the UrlMap resource to return. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUrlMap() + { + return $this->url_map; + } + + /** + * Name of the UrlMap resource to return. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUrlMap($var) + { + GPBUtil::checkString($var, True); + $this->url_map = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetReservationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetReservationRequest.php new file mode 100644 index 000000000000..eaf85d485fc5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetReservationRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetReservationRequest + */ +class GetReservationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the reservation to retrieve. + * + * Generated from protobuf field string reservation = 47530956 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $reservation = ''; + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone for this request. + * @param string $reservation Name of the reservation to retrieve. + * + * @return \Google\Cloud\Compute\V1\GetReservationRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $reservation): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setReservation($reservation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $reservation + * Name of the reservation to retrieve. + * @type string $zone + * Name of the zone for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the reservation to retrieve. + * + * Generated from protobuf field string reservation = 47530956 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getReservation() + { + return $this->reservation; + } + + /** + * Name of the reservation to retrieve. + * + * Generated from protobuf field string reservation = 47530956 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setReservation($var) + { + GPBUtil::checkString($var, True); + $this->reservation = $var; + + return $this; + } + + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetResourcePolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetResourcePolicyRequest.php new file mode 100644 index 000000000000..d079e9ad904f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetResourcePolicyRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetResourcePolicyRequest + */ +class GetResourcePolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name of the resource policy to retrieve. + * + * Generated from protobuf field string resource_policy = 159240835 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource_policy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $resourcePolicy Name of the resource policy to retrieve. + * + * @return \Google\Cloud\Compute\V1\GetResourcePolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resourcePolicy): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResourcePolicy($resourcePolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region for this request. + * @type string $resource_policy + * Name of the resource policy to retrieve. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Name of the resource policy to retrieve. + * + * Generated from protobuf field string resource_policy = 159240835 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResourcePolicy() + { + return $this->resource_policy; + } + + /** + * Name of the resource policy to retrieve. + * + * Generated from protobuf field string resource_policy = 159240835 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResourcePolicy($var) + { + GPBUtil::checkString($var, True); + $this->resource_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRouteRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRouteRequest.php new file mode 100644 index 000000000000..19796d9da47f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRouteRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetRouteRequest + */ +class GetRouteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the Route resource to return. + * + * Generated from protobuf field string route = 108704329 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $route = ''; + + /** + * @param string $project Project ID for this request. + * @param string $route Name of the Route resource to return. + * + * @return \Google\Cloud\Compute\V1\GetRouteRequest + * + * @experimental + */ + public static function build(string $project, string $route): self + { + return (new self()) + ->setProject($project) + ->setRoute($route); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $route + * Name of the Route resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the Route resource to return. + * + * Generated from protobuf field string route = 108704329 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRoute() + { + return $this->route; + } + + /** + * Name of the Route resource to return. + * + * Generated from protobuf field string route = 108704329 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRoute($var) + { + GPBUtil::checkString($var, True); + $this->route = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRouterRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRouterRequest.php new file mode 100644 index 000000000000..fe7f936f1b1b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRouterRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRouterRequest + */ +class GetRouterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name of the Router resource to return. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $router = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $router Name of the Router resource to return. + * + * @return \Google\Cloud\Compute\V1\GetRouterRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $router): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region for this request. + * @type string $router + * Name of the Router resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Name of the Router resource to return. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRouter() + { + return $this->router; + } + + /** + * Name of the Router resource to return. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRouter($var) + { + GPBUtil::checkString($var, True); + $this->router = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRouterStatusRouterRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRouterStatusRouterRequest.php new file mode 100644 index 000000000000..71fae5a57770 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRouterStatusRouterRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetRouterStatusRouterRequest + */ +class GetRouterStatusRouterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name of the Router resource to query. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $router = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $router Name of the Router resource to query. + * + * @return \Google\Cloud\Compute\V1\GetRouterStatusRouterRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $router): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region for this request. + * @type string $router + * Name of the Router resource to query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Name of the Router resource to query. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRouter() + { + return $this->router; + } + + /** + * Name of the Router resource to query. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRouter($var) + { + GPBUtil::checkString($var, True); + $this->router = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRuleFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRuleFirewallPolicyRequest.php new file mode 100644 index 000000000000..b90e3f4a7caa --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRuleFirewallPolicyRequest.php @@ -0,0 +1,124 @@ +google.cloud.compute.v1.GetRuleFirewallPolicyRequest + */ +class GetRuleFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to which the queried rule belongs. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * The priority of the rule to get from the firewall policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + */ + protected $priority = null; + + /** + * @param string $firewallPolicy Name of the firewall policy to which the queried rule belongs. + * + * @return \Google\Cloud\Compute\V1\GetRuleFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $firewallPolicy): self + { + return (new self()) + ->setFirewallPolicy($firewallPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to which the queried rule belongs. + * @type int $priority + * The priority of the rule to get from the firewall policy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall policy to which the queried rule belongs. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to which the queried rule belongs. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * The priority of the rule to get from the firewall policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @return int + */ + public function getPriority() + { + return isset($this->priority) ? $this->priority : 0; + } + + public function hasPriority() + { + return isset($this->priority); + } + + public function clearPriority() + { + unset($this->priority); + } + + /** + * The priority of the rule to get from the firewall policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt32($var); + $this->priority = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRuleNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRuleNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..08511f3f0425 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRuleNetworkFirewallPolicyRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.GetRuleNetworkFirewallPolicyRequest + */ +class GetRuleNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to which the queried rule belongs. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * The priority of the rule to get from the firewall policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + */ + protected $priority = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $firewallPolicy Name of the firewall policy to which the queried rule belongs. + * + * @return \Google\Cloud\Compute\V1\GetRuleNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $firewallPolicy): self + { + return (new self()) + ->setProject($project) + ->setFirewallPolicy($firewallPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to which the queried rule belongs. + * @type int $priority + * The priority of the rule to get from the firewall policy. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall policy to which the queried rule belongs. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to which the queried rule belongs. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * The priority of the rule to get from the firewall policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @return int + */ + public function getPriority() + { + return isset($this->priority) ? $this->priority : 0; + } + + public function hasPriority() + { + return isset($this->priority); + } + + public function clearPriority() + { + unset($this->priority); + } + + /** + * The priority of the rule to get from the firewall policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt32($var); + $this->priority = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRuleRegionNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRuleRegionNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..5b3cab560ff7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRuleRegionNetworkFirewallPolicyRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.GetRuleRegionNetworkFirewallPolicyRequest + */ +class GetRuleRegionNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to which the queried rule belongs. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * The priority of the rule to get from the firewall policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + */ + protected $priority = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $firewallPolicy Name of the firewall policy to which the queried rule belongs. + * + * @return \Google\Cloud\Compute\V1\GetRuleRegionNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $firewallPolicy): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setFirewallPolicy($firewallPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to which the queried rule belongs. + * @type int $priority + * The priority of the rule to get from the firewall policy. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall policy to which the queried rule belongs. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to which the queried rule belongs. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * The priority of the rule to get from the firewall policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @return int + */ + public function getPriority() + { + return isset($this->priority) ? $this->priority : 0; + } + + public function hasPriority() + { + return isset($this->priority); + } + + public function clearPriority() + { + unset($this->priority); + } + + /** + * The priority of the rule to get from the firewall policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt32($var); + $this->priority = $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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRuleRegionSecurityPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRuleRegionSecurityPolicyRequest.php new file mode 100644 index 000000000000..c4685f05bd2e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRuleRegionSecurityPolicyRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.GetRuleRegionSecurityPolicyRequest + */ +class GetRuleRegionSecurityPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The priority of the rule to get from the security policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + */ + protected $priority = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name of the security policy to which the queried rule belongs. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $securityPolicy Name of the security policy to which the queried rule belongs. + * + * @return \Google\Cloud\Compute\V1\GetRuleRegionSecurityPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $securityPolicy): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $priority + * The priority of the rule to get from the security policy. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type string $security_policy + * Name of the security policy to which the queried rule belongs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The priority of the rule to get from the security policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @return int + */ + public function getPriority() + { + return isset($this->priority) ? $this->priority : 0; + } + + public function hasPriority() + { + return isset($this->priority); + } + + public function clearPriority() + { + unset($this->priority); + } + + /** + * The priority of the rule to get from the security policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt32($var); + $this->priority = $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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the security policy to which the queried rule belongs. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSecurityPolicy() + { + return $this->security_policy; + } + + /** + * Name of the security policy to which the queried rule belongs. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->security_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRuleSecurityPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRuleSecurityPolicyRequest.php new file mode 100644 index 000000000000..a1b2745feaf9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetRuleSecurityPolicyRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.GetRuleSecurityPolicyRequest + */ +class GetRuleSecurityPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The priority of the rule to get from the security policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + */ + protected $priority = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the security policy to which the queried rule belongs. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $securityPolicy Name of the security policy to which the queried rule belongs. + * + * @return \Google\Cloud\Compute\V1\GetRuleSecurityPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $securityPolicy): self + { + return (new self()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $priority + * The priority of the rule to get from the security policy. + * @type string $project + * Project ID for this request. + * @type string $security_policy + * Name of the security policy to which the queried rule belongs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The priority of the rule to get from the security policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @return int + */ + public function getPriority() + { + return isset($this->priority) ? $this->priority : 0; + } + + public function hasPriority() + { + return isset($this->priority); + } + + public function clearPriority() + { + unset($this->priority); + } + + /** + * The priority of the rule to get from the security policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt32($var); + $this->priority = $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; + } + + /** + * Name of the security policy to which the queried rule belongs. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSecurityPolicy() + { + return $this->security_policy; + } + + /** + * Name of the security policy to which the queried rule belongs. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->security_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetScreenshotInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetScreenshotInstanceRequest.php new file mode 100644 index 000000000000..0b7d7a739484 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetScreenshotInstanceRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetScreenshotInstanceRequest + */ +class GetScreenshotInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance scoping this request. + * + * @return \Google\Cloud\Compute\V1\GetScreenshotInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name of the instance scoping this request. + * @type string $project + * Project ID for 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); + } + + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance scoping 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; + } + + /** + * 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 zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSecurityPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSecurityPolicyRequest.php new file mode 100644 index 000000000000..6bafd7803e55 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSecurityPolicyRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetSecurityPolicyRequest + */ +class GetSecurityPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the security policy to get. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $securityPolicy Name of the security policy to get. + * + * @return \Google\Cloud\Compute\V1\GetSecurityPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $securityPolicy): self + { + return (new self()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $security_policy + * Name of the security policy to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the security policy to get. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSecurityPolicy() + { + return $this->security_policy; + } + + /** + * Name of the security policy to get. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->security_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSerialPortOutputInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSerialPortOutputInstanceRequest.php new file mode 100644 index 000000000000..4b61b0002d94 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSerialPortOutputInstanceRequest.php @@ -0,0 +1,240 @@ +google.cloud.compute.v1.GetSerialPortOutputInstanceRequest + */ +class GetSerialPortOutputInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the instance for this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * Specifies which COM or serial port to retrieve data from. + * + * Generated from protobuf field optional int32 port = 3446913; + */ + protected $port = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Specifies the starting byte position of the output to return. To start with the first byte of output to the specified port, omit this field or set it to `0`. If the output for that byte position is available, this field matches the `start` parameter sent with the request. If the amount of serial console output exceeds the size of the buffer (1 MB), the oldest output is discarded and is no longer available. If the requested start position refers to discarded output, the start position is adjusted to the oldest output still available, and the adjusted start position is returned as the `start` property value. You can also provide a negative start position, which translates to the most recent number of bytes written to the serial port. For example, -3 is interpreted as the most recent 3 bytes written to the serial console. + * + * Generated from protobuf field optional int64 start = 109757538; + */ + protected $start = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance for this request. + * + * @return \Google\Cloud\Compute\V1\GetSerialPortOutputInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name of the instance for this request. + * @type int $port + * Specifies which COM or serial port to retrieve data from. + * @type string $project + * Project ID for this request. + * @type int|string $start + * Specifies the starting byte position of the output to return. To start with the first byte of output to the specified port, omit this field or set it to `0`. If the output for that byte position is available, this field matches the `start` parameter sent with the request. If the amount of serial console output exceeds the size of the buffer (1 MB), the oldest output is discarded and is no longer available. If the requested start position refers to discarded output, the start position is adjusted to the oldest output still available, and the adjusted start position is returned as the `start` property value. You can also provide a negative start position, which translates to the most recent number of bytes written to the serial port. For example, -3 is interpreted as the most recent 3 bytes written to the serial console. + * @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); + } + + /** + * Name of the instance for this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance 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; + } + + /** + * Specifies which COM or serial port to retrieve data from. + * + * Generated from protobuf field optional int32 port = 3446913; + * @return int + */ + public function getPort() + { + return isset($this->port) ? $this->port : 0; + } + + public function hasPort() + { + return isset($this->port); + } + + public function clearPort() + { + unset($this->port); + } + + /** + * Specifies which COM or serial port to retrieve data from. + * + * Generated from protobuf field optional int32 port = 3446913; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $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; + } + + /** + * Specifies the starting byte position of the output to return. To start with the first byte of output to the specified port, omit this field or set it to `0`. If the output for that byte position is available, this field matches the `start` parameter sent with the request. If the amount of serial console output exceeds the size of the buffer (1 MB), the oldest output is discarded and is no longer available. If the requested start position refers to discarded output, the start position is adjusted to the oldest output still available, and the adjusted start position is returned as the `start` property value. You can also provide a negative start position, which translates to the most recent number of bytes written to the serial port. For example, -3 is interpreted as the most recent 3 bytes written to the serial console. + * + * Generated from protobuf field optional int64 start = 109757538; + * @return int|string + */ + public function getStart() + { + return isset($this->start) ? $this->start : 0; + } + + public function hasStart() + { + return isset($this->start); + } + + public function clearStart() + { + unset($this->start); + } + + /** + * Specifies the starting byte position of the output to return. To start with the first byte of output to the specified port, omit this field or set it to `0`. If the output for that byte position is available, this field matches the `start` parameter sent with the request. If the amount of serial console output exceeds the size of the buffer (1 MB), the oldest output is discarded and is no longer available. If the requested start position refers to discarded output, the start position is adjusted to the oldest output still available, and the adjusted start position is returned as the `start` property value. You can also provide a negative start position, which translates to the most recent number of bytes written to the serial port. For example, -3 is interpreted as the most recent 3 bytes written to the serial console. + * + * Generated from protobuf field optional int64 start = 109757538; + * @param int|string $var + * @return $this + */ + public function setStart($var) + { + GPBUtil::checkInt64($var); + $this->start = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetServiceAttachmentRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetServiceAttachmentRequest.php new file mode 100644 index 000000000000..fe62bd3391e1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetServiceAttachmentRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetServiceAttachmentRequest + */ +class GetServiceAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region of this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name of the ServiceAttachment resource to return. + * + * Generated from protobuf field string service_attachment = 338957549 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service_attachment = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region of this request. + * @param string $serviceAttachment Name of the ServiceAttachment resource to return. + * + * @return \Google\Cloud\Compute\V1\GetServiceAttachmentRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $serviceAttachment): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setServiceAttachment($serviceAttachment); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region of this request. + * @type string $service_attachment + * Name of the ServiceAttachment resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region of this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region of 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; + } + + /** + * Name of the ServiceAttachment resource to return. + * + * Generated from protobuf field string service_attachment = 338957549 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getServiceAttachment() + { + return $this->service_attachment; + } + + /** + * Name of the ServiceAttachment resource to return. + * + * Generated from protobuf field string service_attachment = 338957549 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setServiceAttachment($var) + { + GPBUtil::checkString($var, True); + $this->service_attachment = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetShieldedInstanceIdentityInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetShieldedInstanceIdentityInstanceRequest.php new file mode 100644 index 000000000000..b97990d777c0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetShieldedInstanceIdentityInstanceRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest + */ +class GetShieldedInstanceIdentityInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name or id of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name or id of the instance scoping this request. + * + * @return \Google\Cloud\Compute\V1\GetShieldedInstanceIdentityInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name or id of the instance scoping this request. + * @type string $project + * Project ID for 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); + } + + /** + * Name or id of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name or id of the instance scoping 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; + } + + /** + * 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 zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSnapshotRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSnapshotRequest.php new file mode 100644 index 000000000000..19e874a19ff9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSnapshotRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetSnapshotRequest + */ +class GetSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the Snapshot resource to return. + * + * Generated from protobuf field string snapshot = 284874180 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $snapshot = ''; + + /** + * @param string $project Project ID for this request. + * @param string $snapshot Name of the Snapshot resource to return. + * + * @return \Google\Cloud\Compute\V1\GetSnapshotRequest + * + * @experimental + */ + public static function build(string $project, string $snapshot): self + { + return (new self()) + ->setProject($project) + ->setSnapshot($snapshot); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $snapshot + * Name of the Snapshot resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the Snapshot resource to return. + * + * Generated from protobuf field string snapshot = 284874180 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSnapshot() + { + return $this->snapshot; + } + + /** + * Name of the Snapshot resource to return. + * + * Generated from protobuf field string snapshot = 284874180 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSnapshot($var) + { + GPBUtil::checkString($var, True); + $this->snapshot = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSnapshotSettingRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSnapshotSettingRequest.php new file mode 100644 index 000000000000..2edb770109fe --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSnapshotSettingRequest.php @@ -0,0 +1,80 @@ +google.cloud.compute.v1.GetSnapshotSettingRequest + */ +class GetSnapshotSettingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\GetSnapshotSettingRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSslCertificateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSslCertificateRequest.php new file mode 100644 index 000000000000..9391fee48ea0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSslCertificateRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetSslCertificateRequest + */ +class GetSslCertificateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the SslCertificate resource to return. + * + * Generated from protobuf field string ssl_certificate = 46443492 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ssl_certificate = ''; + + /** + * @param string $project Project ID for this request. + * @param string $sslCertificate Name of the SslCertificate resource to return. + * + * @return \Google\Cloud\Compute\V1\GetSslCertificateRequest + * + * @experimental + */ + public static function build(string $project, string $sslCertificate): self + { + return (new self()) + ->setProject($project) + ->setSslCertificate($sslCertificate); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $ssl_certificate + * Name of the SslCertificate resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the SslCertificate resource to return. + * + * Generated from protobuf field string ssl_certificate = 46443492 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSslCertificate() + { + return $this->ssl_certificate; + } + + /** + * Name of the SslCertificate resource to return. + * + * Generated from protobuf field string ssl_certificate = 46443492 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSslCertificate($var) + { + GPBUtil::checkString($var, True); + $this->ssl_certificate = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSslPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSslPolicyRequest.php new file mode 100644 index 000000000000..7f0899561862 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSslPolicyRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetSslPolicyRequest + */ +class GetSslPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string ssl_policy = 295190213 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ssl_policy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * + * @return \Google\Cloud\Compute\V1\GetSslPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $sslPolicy): self + { + return (new self()) + ->setProject($project) + ->setSslPolicy($sslPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $ssl_policy + * Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string ssl_policy = 295190213 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSslPolicy() + { + return $this->ssl_policy; + } + + /** + * Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string ssl_policy = 295190213 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSslPolicy($var) + { + GPBUtil::checkString($var, True); + $this->ssl_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetStatusVpnGatewayRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetStatusVpnGatewayRequest.php new file mode 100644 index 000000000000..3d38b85b27e2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetStatusVpnGatewayRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetStatusVpnGatewayRequest + */ +class GetStatusVpnGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name of the VPN gateway to return. + * + * Generated from protobuf field string vpn_gateway = 406684153 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $vpn_gateway = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $vpnGateway Name of the VPN gateway to return. + * + * @return \Google\Cloud\Compute\V1\GetStatusVpnGatewayRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $vpnGateway): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setVpnGateway($vpnGateway); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region for this request. + * @type string $vpn_gateway + * Name of the VPN gateway to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Name of the VPN gateway to return. + * + * Generated from protobuf field string vpn_gateway = 406684153 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getVpnGateway() + { + return $this->vpn_gateway; + } + + /** + * Name of the VPN gateway to return. + * + * Generated from protobuf field string vpn_gateway = 406684153 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setVpnGateway($var) + { + GPBUtil::checkString($var, True); + $this->vpn_gateway = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetStoragePoolRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetStoragePoolRequest.php new file mode 100644 index 000000000000..7e5f00ac663f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetStoragePoolRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetStoragePoolRequest + */ +class GetStoragePoolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the storage pool to return. + * + * Generated from protobuf field string storage_pool = 360473440 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $storage_pool = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $storagePool Name of the storage pool to return. + * + * @return \Google\Cloud\Compute\V1\GetStoragePoolRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $storagePool): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setStoragePool($storagePool); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $storage_pool + * Name of the storage pool to return. + * @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); + } + + /** + * 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; + } + + /** + * Name of the storage pool to return. + * + * Generated from protobuf field string storage_pool = 360473440 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getStoragePool() + { + return $this->storage_pool; + } + + /** + * Name of the storage pool to return. + * + * Generated from protobuf field string storage_pool = 360473440 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setStoragePool($var) + { + GPBUtil::checkString($var, True); + $this->storage_pool = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetStoragePoolTypeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetStoragePoolTypeRequest.php new file mode 100644 index 000000000000..26cb488a7c3b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetStoragePoolTypeRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetStoragePoolTypeRequest + */ +class GetStoragePoolTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the storage pool type to return. + * + * Generated from protobuf field string storage_pool_type = 285999289 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $storage_pool_type = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $storagePoolType Name of the storage pool type to return. + * + * @return \Google\Cloud\Compute\V1\GetStoragePoolTypeRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $storagePoolType): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setStoragePoolType($storagePoolType); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $storage_pool_type + * Name of the storage pool type to return. + * @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); + } + + /** + * 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; + } + + /** + * Name of the storage pool type to return. + * + * Generated from protobuf field string storage_pool_type = 285999289 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getStoragePoolType() + { + return $this->storage_pool_type; + } + + /** + * Name of the storage pool type to return. + * + * Generated from protobuf field string storage_pool_type = 285999289 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setStoragePoolType($var) + { + GPBUtil::checkString($var, True); + $this->storage_pool_type = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSubnetworkRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSubnetworkRequest.php new file mode 100644 index 000000000000..249f61468a60 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetSubnetworkRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetSubnetworkRequest + */ +class GetSubnetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name of the Subnetwork resource to return. + * + * Generated from protobuf field string subnetwork = 307827694 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $subnetwork = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $subnetwork Name of the Subnetwork resource to return. + * + * @return \Google\Cloud\Compute\V1\GetSubnetworkRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $subnetwork): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type string $subnetwork + * Name of the Subnetwork resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the Subnetwork resource to return. + * + * Generated from protobuf field string subnetwork = 307827694 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSubnetwork() + { + return $this->subnetwork; + } + + /** + * Name of the Subnetwork resource to return. + * + * Generated from protobuf field string subnetwork = 307827694 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetGrpcProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetGrpcProxyRequest.php new file mode 100644 index 000000000000..33f0ac1238ef --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetGrpcProxyRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetTargetGrpcProxyRequest + */ +class GetTargetGrpcProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the TargetGrpcProxy resource to return. + * + * Generated from protobuf field string target_grpc_proxy = 5020283 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_grpc_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $targetGrpcProxy Name of the TargetGrpcProxy resource to return. + * + * @return \Google\Cloud\Compute\V1\GetTargetGrpcProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetGrpcProxy): self + { + return (new self()) + ->setProject($project) + ->setTargetGrpcProxy($targetGrpcProxy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $target_grpc_proxy + * Name of the TargetGrpcProxy resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the TargetGrpcProxy resource to return. + * + * Generated from protobuf field string target_grpc_proxy = 5020283 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetGrpcProxy() + { + return $this->target_grpc_proxy; + } + + /** + * Name of the TargetGrpcProxy resource to return. + * + * Generated from protobuf field string target_grpc_proxy = 5020283 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetGrpcProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_grpc_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetHttpProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetHttpProxyRequest.php new file mode 100644 index 000000000000..d6a0b1ab365f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetHttpProxyRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetTargetHttpProxyRequest + */ +class GetTargetHttpProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the TargetHttpProxy resource to return. + * + * Generated from protobuf field string target_http_proxy = 206872421 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_http_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $targetHttpProxy Name of the TargetHttpProxy resource to return. + * + * @return \Google\Cloud\Compute\V1\GetTargetHttpProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetHttpProxy): self + { + return (new self()) + ->setProject($project) + ->setTargetHttpProxy($targetHttpProxy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $target_http_proxy + * Name of the TargetHttpProxy resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the TargetHttpProxy resource to return. + * + * Generated from protobuf field string target_http_proxy = 206872421 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetHttpProxy() + { + return $this->target_http_proxy; + } + + /** + * Name of the TargetHttpProxy resource to return. + * + * Generated from protobuf field string target_http_proxy = 206872421 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetHttpProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_http_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetHttpsProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetHttpsProxyRequest.php new file mode 100644 index 000000000000..a8e615ad0eed --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetHttpsProxyRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetTargetHttpsProxyRequest + */ +class GetTargetHttpsProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the TargetHttpsProxy resource to return. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_https_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource to return. + * + * @return \Google\Cloud\Compute\V1\GetTargetHttpsProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetHttpsProxy): self + { + return (new self()) + ->setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $target_https_proxy + * Name of the TargetHttpsProxy resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the TargetHttpsProxy resource to return. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetHttpsProxy() + { + return $this->target_https_proxy; + } + + /** + * Name of the TargetHttpsProxy resource to return. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetHttpsProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_https_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetInstanceRequest.php new file mode 100644 index 000000000000..644a817125a2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetInstanceRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetTargetInstanceRequest + */ +class GetTargetInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the TargetInstance resource to return. + * + * Generated from protobuf field string target_instance = 289769347 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_instance = ''; + /** + * Name of the zone scoping this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone scoping this request. + * @param string $targetInstance Name of the TargetInstance resource to return. + * + * @return \Google\Cloud\Compute\V1\GetTargetInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $targetInstance): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setTargetInstance($targetInstance); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $target_instance + * Name of the TargetInstance resource to return. + * @type string $zone + * Name of the zone scoping this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the TargetInstance resource to return. + * + * Generated from protobuf field string target_instance = 289769347 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetInstance() + { + return $this->target_instance; + } + + /** + * Name of the TargetInstance resource to return. + * + * Generated from protobuf field string target_instance = 289769347 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetInstance($var) + { + GPBUtil::checkString($var, True); + $this->target_instance = $var; + + return $this; + } + + /** + * Name of the zone scoping this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Name of the zone scoping this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetPoolRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetPoolRequest.php new file mode 100644 index 000000000000..2a332b3809c9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetPoolRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetTargetPoolRequest + */ +class GetTargetPoolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name of the TargetPool resource to return. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_pool = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetPool Name of the TargetPool resource to return. + * + * @return \Google\Cloud\Compute\V1\GetTargetPoolRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $targetPool): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type string $target_pool + * Name of the TargetPool resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the TargetPool resource to return. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetPool() + { + return $this->target_pool; + } + + /** + * Name of the TargetPool resource to return. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetPool($var) + { + GPBUtil::checkString($var, True); + $this->target_pool = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetSslProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetSslProxyRequest.php new file mode 100644 index 000000000000..3d9ae145ee4e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetSslProxyRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetTargetSslProxyRequest + */ +class GetTargetSslProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the TargetSslProxy resource to return. + * + * Generated from protobuf field string target_ssl_proxy = 338795853 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_ssl_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $targetSslProxy Name of the TargetSslProxy resource to return. + * + * @return \Google\Cloud\Compute\V1\GetTargetSslProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetSslProxy): self + { + return (new self()) + ->setProject($project) + ->setTargetSslProxy($targetSslProxy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $target_ssl_proxy + * Name of the TargetSslProxy resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the TargetSslProxy resource to return. + * + * Generated from protobuf field string target_ssl_proxy = 338795853 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetSslProxy() + { + return $this->target_ssl_proxy; + } + + /** + * Name of the TargetSslProxy resource to return. + * + * Generated from protobuf field string target_ssl_proxy = 338795853 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetSslProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_ssl_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetTcpProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetTcpProxyRequest.php new file mode 100644 index 000000000000..1e6f8525d0f7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetTcpProxyRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetTargetTcpProxyRequest + */ +class GetTargetTcpProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the TargetTcpProxy resource to return. + * + * Generated from protobuf field string target_tcp_proxy = 503065442 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_tcp_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $targetTcpProxy Name of the TargetTcpProxy resource to return. + * + * @return \Google\Cloud\Compute\V1\GetTargetTcpProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetTcpProxy): self + { + return (new self()) + ->setProject($project) + ->setTargetTcpProxy($targetTcpProxy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $target_tcp_proxy + * Name of the TargetTcpProxy resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the TargetTcpProxy resource to return. + * + * Generated from protobuf field string target_tcp_proxy = 503065442 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetTcpProxy() + { + return $this->target_tcp_proxy; + } + + /** + * Name of the TargetTcpProxy resource to return. + * + * Generated from protobuf field string target_tcp_proxy = 503065442 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetTcpProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_tcp_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetVpnGatewayRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetVpnGatewayRequest.php new file mode 100644 index 000000000000..a27bfe1925f8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetTargetVpnGatewayRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetTargetVpnGatewayRequest + */ +class GetTargetVpnGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name of the target VPN gateway to return. + * + * Generated from protobuf field string target_vpn_gateway = 532512843 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_vpn_gateway = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $targetVpnGateway Name of the target VPN gateway to return. + * + * @return \Google\Cloud\Compute\V1\GetTargetVpnGatewayRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $targetVpnGateway): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetVpnGateway($targetVpnGateway); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region for this request. + * @type string $target_vpn_gateway + * Name of the target VPN gateway to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Name of the target VPN gateway to return. + * + * Generated from protobuf field string target_vpn_gateway = 532512843 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetVpnGateway() + { + return $this->target_vpn_gateway; + } + + /** + * Name of the target VPN gateway to return. + * + * Generated from protobuf field string target_vpn_gateway = 532512843 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetVpnGateway($var) + { + GPBUtil::checkString($var, True); + $this->target_vpn_gateway = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetUrlMapRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetUrlMapRequest.php new file mode 100644 index 000000000000..d678b2e1a7f2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetUrlMapRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetUrlMapRequest + */ +class GetUrlMapRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the UrlMap resource to return. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url_map = ''; + + /** + * @param string $project Project ID for this request. + * @param string $urlMap Name of the UrlMap resource to return. + * + * @return \Google\Cloud\Compute\V1\GetUrlMapRequest + * + * @experimental + */ + public static function build(string $project, string $urlMap): self + { + return (new self()) + ->setProject($project) + ->setUrlMap($urlMap); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $url_map + * Name of the UrlMap resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the UrlMap resource to return. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUrlMap() + { + return $this->url_map; + } + + /** + * Name of the UrlMap resource to return. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUrlMap($var) + { + GPBUtil::checkString($var, True); + $this->url_map = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetVpnGatewayRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetVpnGatewayRequest.php new file mode 100644 index 000000000000..df0084c5b273 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetVpnGatewayRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetVpnGatewayRequest + */ +class GetVpnGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name of the VPN gateway to return. + * + * Generated from protobuf field string vpn_gateway = 406684153 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $vpn_gateway = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $vpnGateway Name of the VPN gateway to return. + * + * @return \Google\Cloud\Compute\V1\GetVpnGatewayRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $vpnGateway): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setVpnGateway($vpnGateway); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region for this request. + * @type string $vpn_gateway + * Name of the VPN gateway to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Name of the VPN gateway to return. + * + * Generated from protobuf field string vpn_gateway = 406684153 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getVpnGateway() + { + return $this->vpn_gateway; + } + + /** + * Name of the VPN gateway to return. + * + * Generated from protobuf field string vpn_gateway = 406684153 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setVpnGateway($var) + { + GPBUtil::checkString($var, True); + $this->vpn_gateway = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetVpnTunnelRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetVpnTunnelRequest.php new file mode 100644 index 000000000000..fe5671303a1d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetVpnTunnelRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetVpnTunnelRequest + */ +class GetVpnTunnelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name of the VpnTunnel resource to return. + * + * Generated from protobuf field string vpn_tunnel = 143821331 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $vpn_tunnel = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $vpnTunnel Name of the VpnTunnel resource to return. + * + * @return \Google\Cloud\Compute\V1\GetVpnTunnelRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $vpnTunnel): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setVpnTunnel($vpnTunnel); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region for this request. + * @type string $vpn_tunnel + * Name of the VpnTunnel resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Name of the VpnTunnel resource to return. + * + * Generated from protobuf field string vpn_tunnel = 143821331 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getVpnTunnel() + { + return $this->vpn_tunnel; + } + + /** + * Name of the VpnTunnel resource to return. + * + * Generated from protobuf field string vpn_tunnel = 143821331 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setVpnTunnel($var) + { + GPBUtil::checkString($var, True); + $this->vpn_tunnel = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetXpnHostProjectRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetXpnHostProjectRequest.php new file mode 100644 index 000000000000..1d57ff9c84bb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetXpnHostProjectRequest.php @@ -0,0 +1,80 @@ +google.cloud.compute.v1.GetXpnHostProjectRequest + */ +class GetXpnHostProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\GetXpnHostProjectRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetXpnResourcesProjectsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetXpnResourcesProjectsRequest.php new file mode 100644 index 000000000000..7e6ce84fc0c2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetXpnResourcesProjectsRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.GetXpnResourcesProjectsRequest + */ +class GetXpnResourcesProjectsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\GetXpnResourcesProjectsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetZoneOperationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetZoneOperationRequest.php new file mode 100644 index 000000000000..d602de5ded35 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetZoneOperationRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.GetZoneOperationRequest + */ +class GetZoneOperationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the Operations resource to return. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_response_field) = "name"]; + */ + protected $operation = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone for this request. + * @param string $operation Name of the Operations resource to return. + * + * @return \Google\Cloud\Compute\V1\GetZoneOperationRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $operation): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setOperation($operation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $operation + * Name of the Operations resource to return. + * @type string $project + * Project ID for this request. + * @type string $zone + * Name of the zone for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the Operations resource to return. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_response_field) = "name"]; + * @return string + */ + public function getOperation() + { + return $this->operation; + } + + /** + * Name of the Operations resource to return. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_response_field) = "name"]; + * @param string $var + * @return $this + */ + public function setOperation($var) + { + GPBUtil::checkString($var, True); + $this->operation = $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; + } + + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetZoneRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetZoneRequest.php new file mode 100644 index 000000000000..3dcdecb6e814 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetZoneRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetZoneRequest + */ +class GetZoneRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the zone resource to return. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone resource to return. + * + * @return \Google\Cloud\Compute\V1\GetZoneRequest + * + * @experimental + */ + public static function build(string $project, string $zone): self + { + return (new self()) + ->setProject($project) + ->setZone($zone); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $zone + * Name of the zone resource to return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the zone resource to return. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Name of the zone resource to return. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalAddressesMoveRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalAddressesMoveRequest.php new file mode 100644 index 000000000000..fef58ac5ffb1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalAddressesMoveRequest.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.GlobalAddressesMoveRequest + */ +class GlobalAddressesMoveRequest extends \Google\Protobuf\Internal\Message +{ + /** + * An optional destination address description if intended to be different from the source. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * The URL of the destination address to move to. This can be a full or partial URL. For example, the following are all valid URLs to a address: - https://www.googleapis.com/compute/v1/projects/project /global/addresses/address - projects/project/global/addresses/address Note that destination project must be different from the source project. So /global/addresses/address is not valid partial url. + * + * Generated from protobuf field optional string destination_address = 371693763; + */ + protected $destination_address = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $description + * An optional destination address description if intended to be different from the source. + * @type string $destination_address + * The URL of the destination address to move to. This can be a full or partial URL. For example, the following are all valid URLs to a address: - https://www.googleapis.com/compute/v1/projects/project /global/addresses/address - projects/project/global/addresses/address Note that destination project must be different from the source project. So /global/addresses/address is not valid partial url. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * An optional destination address description if intended to be different from the source. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional destination address description if intended to be different from the source. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The URL of the destination address to move to. This can be a full or partial URL. For example, the following are all valid URLs to a address: - https://www.googleapis.com/compute/v1/projects/project /global/addresses/address - projects/project/global/addresses/address Note that destination project must be different from the source project. So /global/addresses/address is not valid partial url. + * + * Generated from protobuf field optional string destination_address = 371693763; + * @return string + */ + public function getDestinationAddress() + { + return isset($this->destination_address) ? $this->destination_address : ''; + } + + public function hasDestinationAddress() + { + return isset($this->destination_address); + } + + public function clearDestinationAddress() + { + unset($this->destination_address); + } + + /** + * The URL of the destination address to move to. This can be a full or partial URL. For example, the following are all valid URLs to a address: - https://www.googleapis.com/compute/v1/projects/project /global/addresses/address - projects/project/global/addresses/address Note that destination project must be different from the source project. So /global/addresses/address is not valid partial url. + * + * Generated from protobuf field optional string destination_address = 371693763; + * @param string $var + * @return $this + */ + public function setDestinationAddress($var) + { + GPBUtil::checkString($var, True); + $this->destination_address = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalNetworkEndpointGroupsAttachEndpointsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalNetworkEndpointGroupsAttachEndpointsRequest.php new file mode 100644 index 000000000000..ae1e9848eb99 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalNetworkEndpointGroupsAttachEndpointsRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest + */ +class GlobalNetworkEndpointGroupsAttachEndpointsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The list of network endpoints to be attached. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpoint network_endpoints = 149850285; + */ + private $network_endpoints; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\NetworkEndpoint>|\Google\Protobuf\Internal\RepeatedField $network_endpoints + * The list of network endpoints to be attached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The list of network endpoints to be attached. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpoint network_endpoints = 149850285; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkEndpoints() + { + return $this->network_endpoints; + } + + /** + * The list of network endpoints to be attached. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpoint network_endpoints = 149850285; + * @param array<\Google\Cloud\Compute\V1\NetworkEndpoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkEndpoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NetworkEndpoint::class); + $this->network_endpoints = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalNetworkEndpointGroupsDetachEndpointsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalNetworkEndpointGroupsDetachEndpointsRequest.php new file mode 100644 index 000000000000..69291c67018c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalNetworkEndpointGroupsDetachEndpointsRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest + */ +class GlobalNetworkEndpointGroupsDetachEndpointsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The list of network endpoints to be detached. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpoint network_endpoints = 149850285; + */ + private $network_endpoints; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\NetworkEndpoint>|\Google\Protobuf\Internal\RepeatedField $network_endpoints + * The list of network endpoints to be detached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The list of network endpoints to be detached. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpoint network_endpoints = 149850285; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkEndpoints() + { + return $this->network_endpoints; + } + + /** + * The list of network endpoints to be detached. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpoint network_endpoints = 149850285; + * @param array<\Google\Cloud\Compute\V1\NetworkEndpoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkEndpoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NetworkEndpoint::class); + $this->network_endpoints = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalOrganizationSetPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalOrganizationSetPolicyRequest.php new file mode 100644 index 000000000000..1ce725e4c9e8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalOrganizationSetPolicyRequest.php @@ -0,0 +1,154 @@ +google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest + */ +class GlobalOrganizationSetPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify bindings. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Binding bindings = 403251854; + */ + private $bindings; + /** + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + * + * Generated from protobuf field optional string etag = 3123477; + */ + protected $etag = null; + /** + * REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Policy policy = 91071794; + */ + protected $policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\Binding>|\Google\Protobuf\Internal\RepeatedField $bindings + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify bindings. + * @type string $etag + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + * @type \Google\Cloud\Compute\V1\Policy $policy + * REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify bindings. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Binding bindings = 403251854; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBindings() + { + return $this->bindings; + } + + /** + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify bindings. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Binding bindings = 403251854; + * @param array<\Google\Cloud\Compute\V1\Binding>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBindings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Binding::class); + $this->bindings = $arr; + + return $this; + } + + /** + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + * + * Generated from protobuf field optional string etag = 3123477; + * @return string + */ + public function getEtag() + { + return isset($this->etag) ? $this->etag : ''; + } + + public function hasEtag() + { + return isset($this->etag); + } + + public function clearEtag() + { + unset($this->etag); + } + + /** + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + * + * Generated from protobuf field optional string etag = 3123477; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Policy policy = 91071794; + * @return \Google\Cloud\Compute\V1\Policy|null + */ + public function getPolicy() + { + return $this->policy; + } + + public function hasPolicy() + { + return isset($this->policy); + } + + public function clearPolicy() + { + unset($this->policy); + } + + /** + * REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Policy policy = 91071794; + * @param \Google\Cloud\Compute\V1\Policy $var + * @return $this + */ + public function setPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Policy::class); + $this->policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalSetLabelsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalSetLabelsRequest.php new file mode 100644 index 000000000000..ee825fd62951 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalSetLabelsRequest.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.GlobalSetLabelsRequest + */ +class GlobalSetLabelsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The fingerprint of the previous set of labels for this resource, used to detect conflicts. 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 when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + */ + protected $label_fingerprint = null; + /** + * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": ""). + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $label_fingerprint + * The fingerprint of the previous set of labels for this resource, used to detect conflicts. 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 when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint. + * @type array|\Google\Protobuf\Internal\MapField $labels + * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": ""). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The fingerprint of the previous set of labels for this resource, used to detect conflicts. 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 when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @return string + */ + public function getLabelFingerprint() + { + return isset($this->label_fingerprint) ? $this->label_fingerprint : ''; + } + + public function hasLabelFingerprint() + { + return isset($this->label_fingerprint); + } + + public function clearLabelFingerprint() + { + unset($this->label_fingerprint); + } + + /** + * The fingerprint of the previous set of labels for this resource, used to detect conflicts. 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 when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @param string $var + * @return $this + */ + public function setLabelFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->label_fingerprint = $var; + + return $this; + } + + /** + * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": ""). + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": ""). + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalSetPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalSetPolicyRequest.php new file mode 100644 index 000000000000..6d97cffa2636 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GlobalSetPolicyRequest.php @@ -0,0 +1,154 @@ +google.cloud.compute.v1.GlobalSetPolicyRequest + */ +class GlobalSetPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify bindings. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Binding bindings = 403251854; + */ + private $bindings; + /** + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + * + * Generated from protobuf field optional string etag = 3123477; + */ + protected $etag = null; + /** + * REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Policy policy = 91071794; + */ + protected $policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\Binding>|\Google\Protobuf\Internal\RepeatedField $bindings + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify bindings. + * @type string $etag + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + * @type \Google\Cloud\Compute\V1\Policy $policy + * REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify bindings. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Binding bindings = 403251854; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBindings() + { + return $this->bindings; + } + + /** + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify bindings. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Binding bindings = 403251854; + * @param array<\Google\Cloud\Compute\V1\Binding>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBindings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Binding::class); + $this->bindings = $arr; + + return $this; + } + + /** + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + * + * Generated from protobuf field optional string etag = 3123477; + * @return string + */ + public function getEtag() + { + return isset($this->etag) ? $this->etag : ''; + } + + public function hasEtag() + { + return isset($this->etag); + } + + public function clearEtag() + { + unset($this->etag); + } + + /** + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + * + * Generated from protobuf field optional string etag = 3123477; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Policy policy = 91071794; + * @return \Google\Cloud\Compute\V1\Policy|null + */ + public function getPolicy() + { + return $this->policy; + } + + public function hasPolicy() + { + return isset($this->policy); + } + + public function clearPolicy() + { + unset($this->policy); + } + + /** + * REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Policy policy = 91071794; + * @param \Google\Cloud\Compute\V1\Policy $var + * @return $this + */ + public function setPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Policy::class); + $this->policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GuestAttributes.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GuestAttributes.php new file mode 100644 index 000000000000..c348e89137ba --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GuestAttributes.php @@ -0,0 +1,297 @@ +google.cloud.compute.v1.GuestAttributes + */ +class GuestAttributes extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Type of the resource. Always compute#guestAttributes for guest attributes entry. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * The path to be queried. This can be the default namespace ('') or a nested namespace ('\/') or a specified key ('\/\'). + * + * Generated from protobuf field optional string query_path = 368591164; + */ + protected $query_path = null; + /** + * [Output Only] The value of the requested queried path. + * + * Generated from protobuf field optional .google.cloud.compute.v1.GuestAttributesValue query_value = 157570874; + */ + protected $query_value = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * The key to search for. + * + * Generated from protobuf field optional string variable_key = 164364828; + */ + protected $variable_key = null; + /** + * [Output Only] The value found for the requested key. + * + * Generated from protobuf field optional string variable_value = 124582382; + */ + protected $variable_value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $kind + * [Output Only] Type of the resource. Always compute#guestAttributes for guest attributes entry. + * @type string $query_path + * The path to be queried. This can be the default namespace ('') or a nested namespace ('\/') or a specified key ('\/\'). + * @type \Google\Cloud\Compute\V1\GuestAttributesValue $query_value + * [Output Only] The value of the requested queried path. + * @type string $self_link + * [Output Only] Server-defined URL for this resource. + * @type string $variable_key + * The key to search for. + * @type string $variable_value + * [Output Only] The value found for the requested key. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Type of the resource. Always compute#guestAttributes for guest attributes entry. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#guestAttributes for guest attributes entry. + * + * 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; + } + + /** + * The path to be queried. This can be the default namespace ('') or a nested namespace ('\/') or a specified key ('\/\'). + * + * Generated from protobuf field optional string query_path = 368591164; + * @return string + */ + public function getQueryPath() + { + return isset($this->query_path) ? $this->query_path : ''; + } + + public function hasQueryPath() + { + return isset($this->query_path); + } + + public function clearQueryPath() + { + unset($this->query_path); + } + + /** + * The path to be queried. This can be the default namespace ('') or a nested namespace ('\/') or a specified key ('\/\'). + * + * Generated from protobuf field optional string query_path = 368591164; + * @param string $var + * @return $this + */ + public function setQueryPath($var) + { + GPBUtil::checkString($var, True); + $this->query_path = $var; + + return $this; + } + + /** + * [Output Only] The value of the requested queried path. + * + * Generated from protobuf field optional .google.cloud.compute.v1.GuestAttributesValue query_value = 157570874; + * @return \Google\Cloud\Compute\V1\GuestAttributesValue|null + */ + public function getQueryValue() + { + return $this->query_value; + } + + public function hasQueryValue() + { + return isset($this->query_value); + } + + public function clearQueryValue() + { + unset($this->query_value); + } + + /** + * [Output Only] The value of the requested queried path. + * + * Generated from protobuf field optional .google.cloud.compute.v1.GuestAttributesValue query_value = 157570874; + * @param \Google\Cloud\Compute\V1\GuestAttributesValue $var + * @return $this + */ + public function setQueryValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\GuestAttributesValue::class); + $this->query_value = $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; + } + + /** + * The key to search for. + * + * Generated from protobuf field optional string variable_key = 164364828; + * @return string + */ + public function getVariableKey() + { + return isset($this->variable_key) ? $this->variable_key : ''; + } + + public function hasVariableKey() + { + return isset($this->variable_key); + } + + public function clearVariableKey() + { + unset($this->variable_key); + } + + /** + * The key to search for. + * + * Generated from protobuf field optional string variable_key = 164364828; + * @param string $var + * @return $this + */ + public function setVariableKey($var) + { + GPBUtil::checkString($var, True); + $this->variable_key = $var; + + return $this; + } + + /** + * [Output Only] The value found for the requested key. + * + * Generated from protobuf field optional string variable_value = 124582382; + * @return string + */ + public function getVariableValue() + { + return isset($this->variable_value) ? $this->variable_value : ''; + } + + public function hasVariableValue() + { + return isset($this->variable_value); + } + + public function clearVariableValue() + { + unset($this->variable_value); + } + + /** + * [Output Only] The value found for the requested key. + * + * Generated from protobuf field optional string variable_value = 124582382; + * @param string $var + * @return $this + */ + public function setVariableValue($var) + { + GPBUtil::checkString($var, True); + $this->variable_value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GuestAttributesEntry.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GuestAttributesEntry.php new file mode 100644 index 000000000000..6a0e33dc33f0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GuestAttributesEntry.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.GuestAttributesEntry + */ +class GuestAttributesEntry extends \Google\Protobuf\Internal\Message +{ + /** + * Key for the guest attribute entry. + * + * Generated from protobuf field optional string key = 106079; + */ + protected $key = null; + /** + * Namespace for the guest attribute entry. + * + * Generated from protobuf field optional string namespace = 178476379; + */ + protected $namespace = null; + /** + * Value for the guest attribute entry. + * + * Generated from protobuf field optional string value = 111972721; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * Key for the guest attribute entry. + * @type string $namespace + * Namespace for the guest attribute entry. + * @type string $value + * Value for the guest attribute entry. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Key for the guest attribute entry. + * + * Generated from protobuf field optional string key = 106079; + * @return string + */ + public function getKey() + { + return isset($this->key) ? $this->key : ''; + } + + public function hasKey() + { + return isset($this->key); + } + + public function clearKey() + { + unset($this->key); + } + + /** + * Key for the guest attribute entry. + * + * Generated from protobuf field optional string key = 106079; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Namespace for the guest attribute entry. + * + * Generated from protobuf field optional string namespace = 178476379; + * @return string + */ + public function getNamespace() + { + return isset($this->namespace) ? $this->namespace : ''; + } + + public function hasNamespace() + { + return isset($this->namespace); + } + + public function clearNamespace() + { + unset($this->namespace); + } + + /** + * Namespace for the guest attribute entry. + * + * Generated from protobuf field optional string namespace = 178476379; + * @param string $var + * @return $this + */ + public function setNamespace($var) + { + GPBUtil::checkString($var, True); + $this->namespace = $var; + + return $this; + } + + /** + * Value for the guest attribute entry. + * + * Generated from protobuf field optional string value = 111972721; + * @return string + */ + public function getValue() + { + return isset($this->value) ? $this->value : ''; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * Value for the guest attribute entry. + * + * Generated from protobuf field optional string value = 111972721; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GuestAttributesValue.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GuestAttributesValue.php new file mode 100644 index 000000000000..387ad8102969 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GuestAttributesValue.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.GuestAttributesValue + */ +class GuestAttributesValue extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.GuestAttributesEntry items = 100526016; + */ + private $items; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\GuestAttributesEntry>|\Google\Protobuf\Internal\RepeatedField $items + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.GuestAttributesEntry items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.GuestAttributesEntry items = 100526016; + * @param array<\Google\Cloud\Compute\V1\GuestAttributesEntry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\GuestAttributesEntry::class); + $this->items = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GuestOsFeature.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GuestOsFeature.php new file mode 100644 index 000000000000..71ba8a4fef55 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GuestOsFeature.php @@ -0,0 +1,81 @@ +google.cloud.compute.v1.GuestOsFeature + */ +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_LIVE_MIGRATABLE_V2 - SEV_SNP_CAPABLE - TDX_CAPABLE - IDPF 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; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * 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_LIVE_MIGRATABLE_V2 - SEV_SNP_CAPABLE - TDX_CAPABLE - IDPF For more information, see Enabling guest operating system features. + * Check the Type enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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_LIVE_MIGRATABLE_V2 - SEV_SNP_CAPABLE - TDX_CAPABLE - IDPF 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; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->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_LIVE_MIGRATABLE_V2 - SEV_SNP_CAPABLE - TDX_CAPABLE - IDPF 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; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GuestOsFeature/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GuestOsFeature/Type.php new file mode 100644 index 000000000000..474a3f941805 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GuestOsFeature/Type.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.GuestOsFeature.Type + */ +class Type +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TYPE = 0; + */ + const UNDEFINED_TYPE = 0; + /** + * Generated from protobuf enum FEATURE_TYPE_UNSPECIFIED = 531767259; + */ + const FEATURE_TYPE_UNSPECIFIED = 531767259; + /** + * Generated from protobuf enum GVNIC = 68209305; + */ + const GVNIC = 68209305; + /** + * Generated from protobuf enum IDPF = 2242641; + */ + const IDPF = 2242641; + /** + * Generated from protobuf enum MULTI_IP_SUBNET = 151776719; + */ + const MULTI_IP_SUBNET = 151776719; + /** + * Generated from protobuf enum SECURE_BOOT = 376811194; + */ + const SECURE_BOOT = 376811194; + /** + * Generated from protobuf enum SEV_CAPABLE = 87083793; + */ + const SEV_CAPABLE = 87083793; + /** + * Generated from protobuf enum SEV_LIVE_MIGRATABLE = 392039820; + */ + const SEV_LIVE_MIGRATABLE = 392039820; + /** + * Generated from protobuf enum SEV_LIVE_MIGRATABLE_V2 = 168551983; + */ + const SEV_LIVE_MIGRATABLE_V2 = 168551983; + /** + * Generated from protobuf enum SEV_SNP_CAPABLE = 426919; + */ + const SEV_SNP_CAPABLE = 426919; + /** + * Generated from protobuf enum UEFI_COMPATIBLE = 195865408; + */ + const UEFI_COMPATIBLE = 195865408; + /** + * Generated from protobuf enum VIRTIO_SCSI_MULTIQUEUE = 201597069; + */ + const VIRTIO_SCSI_MULTIQUEUE = 201597069; + /** + * Generated from protobuf enum WINDOWS = 456863331; + */ + const WINDOWS = 456863331; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::FEATURE_TYPE_UNSPECIFIED => 'FEATURE_TYPE_UNSPECIFIED', + self::GVNIC => 'GVNIC', + self::IDPF => 'IDPF', + self::MULTI_IP_SUBNET => 'MULTI_IP_SUBNET', + self::SECURE_BOOT => 'SECURE_BOOT', + self::SEV_CAPABLE => 'SEV_CAPABLE', + self::SEV_LIVE_MIGRATABLE => 'SEV_LIVE_MIGRATABLE', + self::SEV_LIVE_MIGRATABLE_V2 => 'SEV_LIVE_MIGRATABLE_V2', + self::SEV_SNP_CAPABLE => 'SEV_SNP_CAPABLE', + self::UEFI_COMPATIBLE => 'UEFI_COMPATIBLE', + self::VIRTIO_SCSI_MULTIQUEUE => 'VIRTIO_SCSI_MULTIQUEUE', + self::WINDOWS => 'WINDOWS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Compute\V1\GuestOsFeature_Type::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTP2HealthCheck.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTP2HealthCheck.php new file mode 100644 index 000000000000..76e9b4be552a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTP2HealthCheck.php @@ -0,0 +1,348 @@ +google.cloud.compute.v1.HTTP2HealthCheck + */ +class HTTP2HealthCheck extends \Google\Protobuf\Internal\Message +{ + /** + * The value of the host header in the HTTP/2 health check request. If left empty (default value), the host header is set to the destination IP address to which health check packets are sent. The destination IP address depends on the type of load balancer. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#hc-packet-dest + * + * Generated from protobuf field optional string host = 3208616; + */ + protected $host = null; + /** + * The TCP port number to which the health check prober sends packets. The default value is 443. Valid values are 1 through 65535. + * + * Generated from protobuf field optional int32 port = 3446913; + */ + protected $port = null; + /** + * Not supported. + * + * Generated from protobuf field optional string port_name = 41534345; + */ + protected $port_name = null; + /** + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * + * Generated from protobuf field optional string port_specification = 51590597; + */ + protected $port_specification = null; + /** + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + */ + protected $proxy_header = null; + /** + * The request path of the HTTP/2 health check request. The default value is /. + * + * Generated from protobuf field optional string request_path = 229403605; + */ + protected $request_path = null; + /** + * Creates a content-based HTTP/2 health check. In addition to the required HTTP 200 (OK) status code, you can configure the health check to pass only when the backend sends this specific ASCII response string within the first 1024 bytes of the HTTP response body. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-http + * + * Generated from protobuf field optional string response = 196547649; + */ + protected $response = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $host + * The value of the host header in the HTTP/2 health check request. If left empty (default value), the host header is set to the destination IP address to which health check packets are sent. The destination IP address depends on the type of load balancer. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#hc-packet-dest + * @type int $port + * The TCP port number to which the health check prober sends packets. The default value is 443. Valid values are 1 through 65535. + * @type string $port_name + * Not supported. + * @type string $port_specification + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * @type string $proxy_header + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * @type string $request_path + * The request path of the HTTP/2 health check request. The default value is /. + * @type string $response + * Creates a content-based HTTP/2 health check. In addition to the required HTTP 200 (OK) status code, you can configure the health check to pass only when the backend sends this specific ASCII response string within the first 1024 bytes of the HTTP response body. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-http + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The value of the host header in the HTTP/2 health check request. If left empty (default value), the host header is set to the destination IP address to which health check packets are sent. The destination IP address depends on the type of load balancer. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#hc-packet-dest + * + * Generated from protobuf field optional string host = 3208616; + * @return string + */ + public function getHost() + { + return isset($this->host) ? $this->host : ''; + } + + public function hasHost() + { + return isset($this->host); + } + + public function clearHost() + { + unset($this->host); + } + + /** + * The value of the host header in the HTTP/2 health check request. If left empty (default value), the host header is set to the destination IP address to which health check packets are sent. The destination IP address depends on the type of load balancer. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#hc-packet-dest + * + * Generated from protobuf field optional string host = 3208616; + * @param string $var + * @return $this + */ + public function setHost($var) + { + GPBUtil::checkString($var, True); + $this->host = $var; + + return $this; + } + + /** + * The TCP port number to which the health check prober sends packets. The default value is 443. Valid values are 1 through 65535. + * + * Generated from protobuf field optional int32 port = 3446913; + * @return int + */ + public function getPort() + { + return isset($this->port) ? $this->port : 0; + } + + public function hasPort() + { + return isset($this->port); + } + + public function clearPort() + { + unset($this->port); + } + + /** + * The TCP port number to which the health check prober sends packets. The default value is 443. Valid values are 1 through 65535. + * + * Generated from protobuf field optional int32 port = 3446913; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + + /** + * Not supported. + * + * Generated from protobuf field optional string port_name = 41534345; + * @return string + */ + public function getPortName() + { + return isset($this->port_name) ? $this->port_name : ''; + } + + public function hasPortName() + { + return isset($this->port_name); + } + + public function clearPortName() + { + unset($this->port_name); + } + + /** + * Not supported. + * + * Generated from protobuf field optional string port_name = 41534345; + * @param string $var + * @return $this + */ + public function setPortName($var) + { + GPBUtil::checkString($var, True); + $this->port_name = $var; + + return $this; + } + + /** + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * + * Generated from protobuf field optional string port_specification = 51590597; + * @return string + */ + public function getPortSpecification() + { + return isset($this->port_specification) ? $this->port_specification : ''; + } + + public function hasPortSpecification() + { + return isset($this->port_specification); + } + + public function clearPortSpecification() + { + unset($this->port_specification); + } + + /** + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * + * Generated from protobuf field optional string port_specification = 51590597; + * @param string $var + * @return $this + */ + public function setPortSpecification($var) + { + GPBUtil::checkString($var, True); + $this->port_specification = $var; + + return $this; + } + + /** + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + * @return string + */ + public function getProxyHeader() + { + return isset($this->proxy_header) ? $this->proxy_header : ''; + } + + public function hasProxyHeader() + { + return isset($this->proxy_header); + } + + public function clearProxyHeader() + { + unset($this->proxy_header); + } + + /** + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + * @param string $var + * @return $this + */ + public function setProxyHeader($var) + { + GPBUtil::checkString($var, True); + $this->proxy_header = $var; + + return $this; + } + + /** + * The request path of the HTTP/2 health check request. The default value is /. + * + * Generated from protobuf field optional string request_path = 229403605; + * @return string + */ + public function getRequestPath() + { + return isset($this->request_path) ? $this->request_path : ''; + } + + public function hasRequestPath() + { + return isset($this->request_path); + } + + public function clearRequestPath() + { + unset($this->request_path); + } + + /** + * The request path of the HTTP/2 health check request. The default value is /. + * + * Generated from protobuf field optional string request_path = 229403605; + * @param string $var + * @return $this + */ + public function setRequestPath($var) + { + GPBUtil::checkString($var, True); + $this->request_path = $var; + + return $this; + } + + /** + * Creates a content-based HTTP/2 health check. In addition to the required HTTP 200 (OK) status code, you can configure the health check to pass only when the backend sends this specific ASCII response string within the first 1024 bytes of the HTTP response body. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-http + * + * Generated from protobuf field optional string response = 196547649; + * @return string + */ + public function getResponse() + { + return isset($this->response) ? $this->response : ''; + } + + public function hasResponse() + { + return isset($this->response); + } + + public function clearResponse() + { + unset($this->response); + } + + /** + * Creates a content-based HTTP/2 health check. In addition to the required HTTP 200 (OK) status code, you can configure the health check to pass only when the backend sends this specific ASCII response string within the first 1024 bytes of the HTTP response body. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-http + * + * Generated from protobuf field optional string response = 196547649; + * @param string $var + * @return $this + */ + public function setResponse($var) + { + GPBUtil::checkString($var, True); + $this->response = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTP2HealthCheck/PortSpecification.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTP2HealthCheck/PortSpecification.php new file mode 100644 index 000000000000..eccbe1cf62d1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTP2HealthCheck/PortSpecification.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.HTTP2HealthCheck.PortSpecification + */ +class PortSpecification +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PORT_SPECIFICATION = 0; + */ + const UNDEFINED_PORT_SPECIFICATION = 0; + /** + * The port number in the health check's port is used for health checking. Applies to network endpoint group and instance group backends. + * + * Generated from protobuf enum USE_FIXED_PORT = 190235748; + */ + const USE_FIXED_PORT = 190235748; + /** + * Not supported. + * + * Generated from protobuf enum USE_NAMED_PORT = 349300671; + */ + const USE_NAMED_PORT = 349300671; + /** + * For network endpoint group backends, the health check uses the port number specified on each endpoint in the network endpoint group. For instance group backends, the health check uses the port number specified for the backend service's named port defined in the instance group's named ports. + * + * Generated from protobuf enum USE_SERVING_PORT = 362637516; + */ + const USE_SERVING_PORT = 362637516; + + private static $valueToName = [ + self::UNDEFINED_PORT_SPECIFICATION => 'UNDEFINED_PORT_SPECIFICATION', + self::USE_FIXED_PORT => 'USE_FIXED_PORT', + self::USE_NAMED_PORT => 'USE_NAMED_PORT', + self::USE_SERVING_PORT => 'USE_SERVING_PORT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PortSpecification::class, \Google\Cloud\Compute\V1\HTTP2HealthCheck_PortSpecification::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTP2HealthCheck/ProxyHeader.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTP2HealthCheck/ProxyHeader.php new file mode 100644 index 000000000000..7b46a71a69dc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTP2HealthCheck/ProxyHeader.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.HTTP2HealthCheck.ProxyHeader + */ +class ProxyHeader +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PROXY_HEADER = 0; + */ + const UNDEFINED_PROXY_HEADER = 0; + /** + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + /** + * Generated from protobuf enum PROXY_V1 = 334352940; + */ + const PROXY_V1 = 334352940; + + private static $valueToName = [ + self::UNDEFINED_PROXY_HEADER => 'UNDEFINED_PROXY_HEADER', + self::NONE => 'NONE', + self::PROXY_V1 => 'PROXY_V1', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ProxyHeader::class, \Google\Cloud\Compute\V1\HTTP2HealthCheck_ProxyHeader::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPHealthCheck.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPHealthCheck.php new file mode 100644 index 000000000000..bd4f3f16464b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPHealthCheck.php @@ -0,0 +1,348 @@ +google.cloud.compute.v1.HTTPHealthCheck + */ +class HTTPHealthCheck extends \Google\Protobuf\Internal\Message +{ + /** + * The value of the host header in the HTTP health check request. If left empty (default value), the host header is set to the destination IP address to which health check packets are sent. The destination IP address depends on the type of load balancer. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#hc-packet-dest + * + * Generated from protobuf field optional string host = 3208616; + */ + protected $host = null; + /** + * The TCP port number to which the health check prober sends packets. The default value is 80. Valid values are 1 through 65535. + * + * Generated from protobuf field optional int32 port = 3446913; + */ + protected $port = null; + /** + * Not supported. + * + * Generated from protobuf field optional string port_name = 41534345; + */ + protected $port_name = null; + /** + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Also supported in legacy HTTP health checks for target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for pass-through load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * + * Generated from protobuf field optional string port_specification = 51590597; + */ + protected $port_specification = null; + /** + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + */ + protected $proxy_header = null; + /** + * The request path of the HTTP health check request. The default value is /. + * + * Generated from protobuf field optional string request_path = 229403605; + */ + protected $request_path = null; + /** + * Creates a content-based HTTP health check. In addition to the required HTTP 200 (OK) status code, you can configure the health check to pass only when the backend sends this specific ASCII response string within the first 1024 bytes of the HTTP response body. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-http + * + * Generated from protobuf field optional string response = 196547649; + */ + protected $response = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $host + * The value of the host header in the HTTP health check request. If left empty (default value), the host header is set to the destination IP address to which health check packets are sent. The destination IP address depends on the type of load balancer. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#hc-packet-dest + * @type int $port + * The TCP port number to which the health check prober sends packets. The default value is 80. Valid values are 1 through 65535. + * @type string $port_name + * Not supported. + * @type string $port_specification + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Also supported in legacy HTTP health checks for target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for pass-through load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * @type string $proxy_header + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * @type string $request_path + * The request path of the HTTP health check request. The default value is /. + * @type string $response + * Creates a content-based HTTP health check. In addition to the required HTTP 200 (OK) status code, you can configure the health check to pass only when the backend sends this specific ASCII response string within the first 1024 bytes of the HTTP response body. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-http + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The value of the host header in the HTTP health check request. If left empty (default value), the host header is set to the destination IP address to which health check packets are sent. The destination IP address depends on the type of load balancer. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#hc-packet-dest + * + * Generated from protobuf field optional string host = 3208616; + * @return string + */ + public function getHost() + { + return isset($this->host) ? $this->host : ''; + } + + public function hasHost() + { + return isset($this->host); + } + + public function clearHost() + { + unset($this->host); + } + + /** + * The value of the host header in the HTTP health check request. If left empty (default value), the host header is set to the destination IP address to which health check packets are sent. The destination IP address depends on the type of load balancer. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#hc-packet-dest + * + * Generated from protobuf field optional string host = 3208616; + * @param string $var + * @return $this + */ + public function setHost($var) + { + GPBUtil::checkString($var, True); + $this->host = $var; + + return $this; + } + + /** + * The TCP port number to which the health check prober sends packets. The default value is 80. Valid values are 1 through 65535. + * + * Generated from protobuf field optional int32 port = 3446913; + * @return int + */ + public function getPort() + { + return isset($this->port) ? $this->port : 0; + } + + public function hasPort() + { + return isset($this->port); + } + + public function clearPort() + { + unset($this->port); + } + + /** + * The TCP port number to which the health check prober sends packets. The default value is 80. Valid values are 1 through 65535. + * + * Generated from protobuf field optional int32 port = 3446913; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + + /** + * Not supported. + * + * Generated from protobuf field optional string port_name = 41534345; + * @return string + */ + public function getPortName() + { + return isset($this->port_name) ? $this->port_name : ''; + } + + public function hasPortName() + { + return isset($this->port_name); + } + + public function clearPortName() + { + unset($this->port_name); + } + + /** + * Not supported. + * + * Generated from protobuf field optional string port_name = 41534345; + * @param string $var + * @return $this + */ + public function setPortName($var) + { + GPBUtil::checkString($var, True); + $this->port_name = $var; + + return $this; + } + + /** + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Also supported in legacy HTTP health checks for target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for pass-through load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * + * Generated from protobuf field optional string port_specification = 51590597; + * @return string + */ + public function getPortSpecification() + { + return isset($this->port_specification) ? $this->port_specification : ''; + } + + public function hasPortSpecification() + { + return isset($this->port_specification); + } + + public function clearPortSpecification() + { + unset($this->port_specification); + } + + /** + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Also supported in legacy HTTP health checks for target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for pass-through load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * + * Generated from protobuf field optional string port_specification = 51590597; + * @param string $var + * @return $this + */ + public function setPortSpecification($var) + { + GPBUtil::checkString($var, True); + $this->port_specification = $var; + + return $this; + } + + /** + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + * @return string + */ + public function getProxyHeader() + { + return isset($this->proxy_header) ? $this->proxy_header : ''; + } + + public function hasProxyHeader() + { + return isset($this->proxy_header); + } + + public function clearProxyHeader() + { + unset($this->proxy_header); + } + + /** + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + * @param string $var + * @return $this + */ + public function setProxyHeader($var) + { + GPBUtil::checkString($var, True); + $this->proxy_header = $var; + + return $this; + } + + /** + * The request path of the HTTP health check request. The default value is /. + * + * Generated from protobuf field optional string request_path = 229403605; + * @return string + */ + public function getRequestPath() + { + return isset($this->request_path) ? $this->request_path : ''; + } + + public function hasRequestPath() + { + return isset($this->request_path); + } + + public function clearRequestPath() + { + unset($this->request_path); + } + + /** + * The request path of the HTTP health check request. The default value is /. + * + * Generated from protobuf field optional string request_path = 229403605; + * @param string $var + * @return $this + */ + public function setRequestPath($var) + { + GPBUtil::checkString($var, True); + $this->request_path = $var; + + return $this; + } + + /** + * Creates a content-based HTTP health check. In addition to the required HTTP 200 (OK) status code, you can configure the health check to pass only when the backend sends this specific ASCII response string within the first 1024 bytes of the HTTP response body. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-http + * + * Generated from protobuf field optional string response = 196547649; + * @return string + */ + public function getResponse() + { + return isset($this->response) ? $this->response : ''; + } + + public function hasResponse() + { + return isset($this->response); + } + + public function clearResponse() + { + unset($this->response); + } + + /** + * Creates a content-based HTTP health check. In addition to the required HTTP 200 (OK) status code, you can configure the health check to pass only when the backend sends this specific ASCII response string within the first 1024 bytes of the HTTP response body. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-http + * + * Generated from protobuf field optional string response = 196547649; + * @param string $var + * @return $this + */ + public function setResponse($var) + { + GPBUtil::checkString($var, True); + $this->response = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPHealthCheck/PortSpecification.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPHealthCheck/PortSpecification.php new file mode 100644 index 000000000000..6fe3327374f6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPHealthCheck/PortSpecification.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.HTTPHealthCheck.PortSpecification + */ +class PortSpecification +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PORT_SPECIFICATION = 0; + */ + const UNDEFINED_PORT_SPECIFICATION = 0; + /** + * The port number in the health check's port is used for health checking. Applies to network endpoint group and instance group backends. + * + * Generated from protobuf enum USE_FIXED_PORT = 190235748; + */ + const USE_FIXED_PORT = 190235748; + /** + * Not supported. + * + * Generated from protobuf enum USE_NAMED_PORT = 349300671; + */ + const USE_NAMED_PORT = 349300671; + /** + * For network endpoint group backends, the health check uses the port number specified on each endpoint in the network endpoint group. For instance group backends, the health check uses the port number specified for the backend service's named port defined in the instance group's named ports. + * + * Generated from protobuf enum USE_SERVING_PORT = 362637516; + */ + const USE_SERVING_PORT = 362637516; + + private static $valueToName = [ + self::UNDEFINED_PORT_SPECIFICATION => 'UNDEFINED_PORT_SPECIFICATION', + self::USE_FIXED_PORT => 'USE_FIXED_PORT', + self::USE_NAMED_PORT => 'USE_NAMED_PORT', + self::USE_SERVING_PORT => 'USE_SERVING_PORT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PortSpecification::class, \Google\Cloud\Compute\V1\HTTPHealthCheck_PortSpecification::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPHealthCheck/ProxyHeader.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPHealthCheck/ProxyHeader.php new file mode 100644 index 000000000000..1c6b17f2b25b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPHealthCheck/ProxyHeader.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.HTTPHealthCheck.ProxyHeader + */ +class ProxyHeader +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PROXY_HEADER = 0; + */ + const UNDEFINED_PROXY_HEADER = 0; + /** + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + /** + * Generated from protobuf enum PROXY_V1 = 334352940; + */ + const PROXY_V1 = 334352940; + + private static $valueToName = [ + self::UNDEFINED_PROXY_HEADER => 'UNDEFINED_PROXY_HEADER', + self::NONE => 'NONE', + self::PROXY_V1 => 'PROXY_V1', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ProxyHeader::class, \Google\Cloud\Compute\V1\HTTPHealthCheck_ProxyHeader::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPSHealthCheck.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPSHealthCheck.php new file mode 100644 index 000000000000..41ee202ee96b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPSHealthCheck.php @@ -0,0 +1,348 @@ +google.cloud.compute.v1.HTTPSHealthCheck + */ +class HTTPSHealthCheck extends \Google\Protobuf\Internal\Message +{ + /** + * The value of the host header in the HTTPS health check request. If left empty (default value), the host header is set to the destination IP address to which health check packets are sent. The destination IP address depends on the type of load balancer. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#hc-packet-dest + * + * Generated from protobuf field optional string host = 3208616; + */ + protected $host = null; + /** + * The TCP port number to which the health check prober sends packets. The default value is 443. Valid values are 1 through 65535. + * + * Generated from protobuf field optional int32 port = 3446913; + */ + protected $port = null; + /** + * Not supported. + * + * Generated from protobuf field optional string port_name = 41534345; + */ + protected $port_name = null; + /** + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * + * Generated from protobuf field optional string port_specification = 51590597; + */ + protected $port_specification = null; + /** + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + */ + protected $proxy_header = null; + /** + * The request path of the HTTPS health check request. The default value is /. + * + * Generated from protobuf field optional string request_path = 229403605; + */ + protected $request_path = null; + /** + * Creates a content-based HTTPS health check. In addition to the required HTTP 200 (OK) status code, you can configure the health check to pass only when the backend sends this specific ASCII response string within the first 1024 bytes of the HTTP response body. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-http + * + * Generated from protobuf field optional string response = 196547649; + */ + protected $response = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $host + * The value of the host header in the HTTPS health check request. If left empty (default value), the host header is set to the destination IP address to which health check packets are sent. The destination IP address depends on the type of load balancer. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#hc-packet-dest + * @type int $port + * The TCP port number to which the health check prober sends packets. The default value is 443. Valid values are 1 through 65535. + * @type string $port_name + * Not supported. + * @type string $port_specification + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * @type string $proxy_header + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * @type string $request_path + * The request path of the HTTPS health check request. The default value is /. + * @type string $response + * Creates a content-based HTTPS health check. In addition to the required HTTP 200 (OK) status code, you can configure the health check to pass only when the backend sends this specific ASCII response string within the first 1024 bytes of the HTTP response body. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-http + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The value of the host header in the HTTPS health check request. If left empty (default value), the host header is set to the destination IP address to which health check packets are sent. The destination IP address depends on the type of load balancer. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#hc-packet-dest + * + * Generated from protobuf field optional string host = 3208616; + * @return string + */ + public function getHost() + { + return isset($this->host) ? $this->host : ''; + } + + public function hasHost() + { + return isset($this->host); + } + + public function clearHost() + { + unset($this->host); + } + + /** + * The value of the host header in the HTTPS health check request. If left empty (default value), the host header is set to the destination IP address to which health check packets are sent. The destination IP address depends on the type of load balancer. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#hc-packet-dest + * + * Generated from protobuf field optional string host = 3208616; + * @param string $var + * @return $this + */ + public function setHost($var) + { + GPBUtil::checkString($var, True); + $this->host = $var; + + return $this; + } + + /** + * The TCP port number to which the health check prober sends packets. The default value is 443. Valid values are 1 through 65535. + * + * Generated from protobuf field optional int32 port = 3446913; + * @return int + */ + public function getPort() + { + return isset($this->port) ? $this->port : 0; + } + + public function hasPort() + { + return isset($this->port); + } + + public function clearPort() + { + unset($this->port); + } + + /** + * The TCP port number to which the health check prober sends packets. The default value is 443. Valid values are 1 through 65535. + * + * Generated from protobuf field optional int32 port = 3446913; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + + /** + * Not supported. + * + * Generated from protobuf field optional string port_name = 41534345; + * @return string + */ + public function getPortName() + { + return isset($this->port_name) ? $this->port_name : ''; + } + + public function hasPortName() + { + return isset($this->port_name); + } + + public function clearPortName() + { + unset($this->port_name); + } + + /** + * Not supported. + * + * Generated from protobuf field optional string port_name = 41534345; + * @param string $var + * @return $this + */ + public function setPortName($var) + { + GPBUtil::checkString($var, True); + $this->port_name = $var; + + return $this; + } + + /** + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * + * Generated from protobuf field optional string port_specification = 51590597; + * @return string + */ + public function getPortSpecification() + { + return isset($this->port_specification) ? $this->port_specification : ''; + } + + public function hasPortSpecification() + { + return isset($this->port_specification); + } + + public function clearPortSpecification() + { + unset($this->port_specification); + } + + /** + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * + * Generated from protobuf field optional string port_specification = 51590597; + * @param string $var + * @return $this + */ + public function setPortSpecification($var) + { + GPBUtil::checkString($var, True); + $this->port_specification = $var; + + return $this; + } + + /** + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + * @return string + */ + public function getProxyHeader() + { + return isset($this->proxy_header) ? $this->proxy_header : ''; + } + + public function hasProxyHeader() + { + return isset($this->proxy_header); + } + + public function clearProxyHeader() + { + unset($this->proxy_header); + } + + /** + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + * @param string $var + * @return $this + */ + public function setProxyHeader($var) + { + GPBUtil::checkString($var, True); + $this->proxy_header = $var; + + return $this; + } + + /** + * The request path of the HTTPS health check request. The default value is /. + * + * Generated from protobuf field optional string request_path = 229403605; + * @return string + */ + public function getRequestPath() + { + return isset($this->request_path) ? $this->request_path : ''; + } + + public function hasRequestPath() + { + return isset($this->request_path); + } + + public function clearRequestPath() + { + unset($this->request_path); + } + + /** + * The request path of the HTTPS health check request. The default value is /. + * + * Generated from protobuf field optional string request_path = 229403605; + * @param string $var + * @return $this + */ + public function setRequestPath($var) + { + GPBUtil::checkString($var, True); + $this->request_path = $var; + + return $this; + } + + /** + * Creates a content-based HTTPS health check. In addition to the required HTTP 200 (OK) status code, you can configure the health check to pass only when the backend sends this specific ASCII response string within the first 1024 bytes of the HTTP response body. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-http + * + * Generated from protobuf field optional string response = 196547649; + * @return string + */ + public function getResponse() + { + return isset($this->response) ? $this->response : ''; + } + + public function hasResponse() + { + return isset($this->response); + } + + public function clearResponse() + { + unset($this->response); + } + + /** + * Creates a content-based HTTPS health check. In addition to the required HTTP 200 (OK) status code, you can configure the health check to pass only when the backend sends this specific ASCII response string within the first 1024 bytes of the HTTP response body. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-http + * + * Generated from protobuf field optional string response = 196547649; + * @param string $var + * @return $this + */ + public function setResponse($var) + { + GPBUtil::checkString($var, True); + $this->response = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPSHealthCheck/PortSpecification.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPSHealthCheck/PortSpecification.php new file mode 100644 index 000000000000..ab43d27173a3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPSHealthCheck/PortSpecification.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.HTTPSHealthCheck.PortSpecification + */ +class PortSpecification +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PORT_SPECIFICATION = 0; + */ + const UNDEFINED_PORT_SPECIFICATION = 0; + /** + * The port number in the health check's port is used for health checking. Applies to network endpoint group and instance group backends. + * + * Generated from protobuf enum USE_FIXED_PORT = 190235748; + */ + const USE_FIXED_PORT = 190235748; + /** + * Not supported. + * + * Generated from protobuf enum USE_NAMED_PORT = 349300671; + */ + const USE_NAMED_PORT = 349300671; + /** + * For network endpoint group backends, the health check uses the port number specified on each endpoint in the network endpoint group. For instance group backends, the health check uses the port number specified for the backend service's named port defined in the instance group's named ports. + * + * Generated from protobuf enum USE_SERVING_PORT = 362637516; + */ + const USE_SERVING_PORT = 362637516; + + private static $valueToName = [ + self::UNDEFINED_PORT_SPECIFICATION => 'UNDEFINED_PORT_SPECIFICATION', + self::USE_FIXED_PORT => 'USE_FIXED_PORT', + self::USE_NAMED_PORT => 'USE_NAMED_PORT', + self::USE_SERVING_PORT => 'USE_SERVING_PORT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PortSpecification::class, \Google\Cloud\Compute\V1\HTTPSHealthCheck_PortSpecification::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPSHealthCheck/ProxyHeader.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPSHealthCheck/ProxyHeader.php new file mode 100644 index 000000000000..d7a492f40db4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HTTPSHealthCheck/ProxyHeader.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.HTTPSHealthCheck.ProxyHeader + */ +class ProxyHeader +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PROXY_HEADER = 0; + */ + const UNDEFINED_PROXY_HEADER = 0; + /** + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + /** + * Generated from protobuf enum PROXY_V1 = 334352940; + */ + const PROXY_V1 = 334352940; + + private static $valueToName = [ + self::UNDEFINED_PROXY_HEADER => 'UNDEFINED_PROXY_HEADER', + self::NONE => 'NONE', + self::PROXY_V1 => 'PROXY_V1', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ProxyHeader::class, \Google\Cloud\Compute\V1\HTTPSHealthCheck_ProxyHeader::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheck.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheck.php new file mode 100644 index 000000000000..c4c6326b8d0e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheck.php @@ -0,0 +1,831 @@ +google.cloud.compute.v1.HealthCheck + */ +class HealthCheck extends \Google\Protobuf\Internal\Message +{ + /** + * How often (in seconds) to send a health check. The default value is 5 seconds. + * + * Generated from protobuf field optional int32 check_interval_sec = 345561006; + */ + protected $check_interval_sec = null; + /** + * [Output Only] Creation timestamp in 3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.GRPCHealthCheck grpc_health_check = 85529574; + */ + protected $grpc_health_check = null; + /** + * A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2. + * + * Generated from protobuf field optional int32 healthy_threshold = 403212361; + */ + protected $healthy_threshold = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.HTTP2HealthCheck http2_health_check = 11360986; + */ + protected $http2_health_check = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.HTTPHealthCheck http_health_check = 412586940; + */ + protected $http_health_check = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.HTTPSHealthCheck https_health_check = 436046905; + */ + protected $https_health_check = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * Type of the resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * Configure logging on this health check. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HealthCheckLogConfig log_config = 351299741; + */ + protected $log_config = null; + /** + * 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. For example, a name that is 1-63 characters long, matches the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`, and otherwise complies with RFC1035. This regular expression describes a name where the first character is a lowercase letter, and all following characters are a dash, lowercase letter, or digit, except the last character, which isn't a dash. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] Region where the health check resides. Not applicable to global health checks. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.SSLHealthCheck ssl_health_check = 280032440; + */ + protected $ssl_health_check = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.TCPHealthCheck tcp_health_check = 469980419; + */ + protected $tcp_health_check = null; + /** + * How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec. + * + * Generated from protobuf field optional int32 timeout_sec = 79994995; + */ + protected $timeout_sec = null; + /** + * Specifies the type of the healthCheck, either TCP, SSL, HTTP, HTTPS, HTTP2 or GRPC. Exactly one of the protocol-specific health check fields must be specified, which must match type field. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + /** + * A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2. + * + * Generated from protobuf field optional int32 unhealthy_threshold = 227958480; + */ + protected $unhealthy_threshold = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $check_interval_sec + * How often (in seconds) to send a health check. The default value is 5 seconds. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in 3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type \Google\Cloud\Compute\V1\GRPCHealthCheck $grpc_health_check + * @type int $healthy_threshold + * A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2. + * @type \Google\Cloud\Compute\V1\HTTP2HealthCheck $http2_health_check + * @type \Google\Cloud\Compute\V1\HTTPHealthCheck $http_health_check + * @type \Google\Cloud\Compute\V1\HTTPSHealthCheck $https_health_check + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * Type of the resource. + * @type \Google\Cloud\Compute\V1\HealthCheckLogConfig $log_config + * Configure logging on this health check. + * @type string $name + * 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. For example, a name that is 1-63 characters long, matches the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`, and otherwise complies with RFC1035. This regular expression describes a name where the first character is a lowercase letter, and all following characters are a dash, lowercase letter, or digit, except the last character, which isn't a dash. + * @type string $region + * [Output Only] Region where the health check resides. Not applicable to global health checks. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type \Google\Cloud\Compute\V1\SSLHealthCheck $ssl_health_check + * @type \Google\Cloud\Compute\V1\TCPHealthCheck $tcp_health_check + * @type int $timeout_sec + * How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec. + * @type string $type + * Specifies the type of the healthCheck, either TCP, SSL, HTTP, HTTPS, HTTP2 or GRPC. Exactly one of the protocol-specific health check fields must be specified, which must match type field. + * Check the Type enum for the list of possible values. + * @type int $unhealthy_threshold + * A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * How often (in seconds) to send a health check. The default value is 5 seconds. + * + * Generated from protobuf field optional int32 check_interval_sec = 345561006; + * @return int + */ + public function getCheckIntervalSec() + { + return isset($this->check_interval_sec) ? $this->check_interval_sec : 0; + } + + public function hasCheckIntervalSec() + { + return isset($this->check_interval_sec); + } + + public function clearCheckIntervalSec() + { + unset($this->check_interval_sec); + } + + /** + * How often (in seconds) to send a health check. The default value is 5 seconds. + * + * Generated from protobuf field optional int32 check_interval_sec = 345561006; + * @param int $var + * @return $this + */ + public function setCheckIntervalSec($var) + { + GPBUtil::checkInt32($var); + $this->check_interval_sec = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in 3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in 3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.GRPCHealthCheck grpc_health_check = 85529574; + * @return \Google\Cloud\Compute\V1\GRPCHealthCheck|null + */ + public function getGrpcHealthCheck() + { + return $this->grpc_health_check; + } + + public function hasGrpcHealthCheck() + { + return isset($this->grpc_health_check); + } + + public function clearGrpcHealthCheck() + { + unset($this->grpc_health_check); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.GRPCHealthCheck grpc_health_check = 85529574; + * @param \Google\Cloud\Compute\V1\GRPCHealthCheck $var + * @return $this + */ + public function setGrpcHealthCheck($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\GRPCHealthCheck::class); + $this->grpc_health_check = $var; + + return $this; + } + + /** + * A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2. + * + * Generated from protobuf field optional int32 healthy_threshold = 403212361; + * @return int + */ + public function getHealthyThreshold() + { + return isset($this->healthy_threshold) ? $this->healthy_threshold : 0; + } + + public function hasHealthyThreshold() + { + return isset($this->healthy_threshold); + } + + public function clearHealthyThreshold() + { + unset($this->healthy_threshold); + } + + /** + * A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2. + * + * Generated from protobuf field optional int32 healthy_threshold = 403212361; + * @param int $var + * @return $this + */ + public function setHealthyThreshold($var) + { + GPBUtil::checkInt32($var); + $this->healthy_threshold = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.HTTP2HealthCheck http2_health_check = 11360986; + * @return \Google\Cloud\Compute\V1\HTTP2HealthCheck|null + */ + public function getHttp2HealthCheck() + { + return $this->http2_health_check; + } + + public function hasHttp2HealthCheck() + { + return isset($this->http2_health_check); + } + + public function clearHttp2HealthCheck() + { + unset($this->http2_health_check); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.HTTP2HealthCheck http2_health_check = 11360986; + * @param \Google\Cloud\Compute\V1\HTTP2HealthCheck $var + * @return $this + */ + public function setHttp2HealthCheck($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HTTP2HealthCheck::class); + $this->http2_health_check = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.HTTPHealthCheck http_health_check = 412586940; + * @return \Google\Cloud\Compute\V1\HTTPHealthCheck|null + */ + public function getHttpHealthCheck() + { + return $this->http_health_check; + } + + public function hasHttpHealthCheck() + { + return isset($this->http_health_check); + } + + public function clearHttpHealthCheck() + { + unset($this->http_health_check); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.HTTPHealthCheck http_health_check = 412586940; + * @param \Google\Cloud\Compute\V1\HTTPHealthCheck $var + * @return $this + */ + public function setHttpHealthCheck($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HTTPHealthCheck::class); + $this->http_health_check = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.HTTPSHealthCheck https_health_check = 436046905; + * @return \Google\Cloud\Compute\V1\HTTPSHealthCheck|null + */ + public function getHttpsHealthCheck() + { + return $this->https_health_check; + } + + public function hasHttpsHealthCheck() + { + return isset($this->https_health_check); + } + + public function clearHttpsHealthCheck() + { + unset($this->https_health_check); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.HTTPSHealthCheck https_health_check = 436046905; + * @param \Google\Cloud\Compute\V1\HTTPSHealthCheck $var + * @return $this + */ + public function setHttpsHealthCheck($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HTTPSHealthCheck::class); + $this->https_health_check = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * Type of the 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 the 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; + } + + /** + * Configure logging on this health check. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HealthCheckLogConfig log_config = 351299741; + * @return \Google\Cloud\Compute\V1\HealthCheckLogConfig|null + */ + public function getLogConfig() + { + return $this->log_config; + } + + public function hasLogConfig() + { + return isset($this->log_config); + } + + public function clearLogConfig() + { + unset($this->log_config); + } + + /** + * Configure logging on this health check. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HealthCheckLogConfig log_config = 351299741; + * @param \Google\Cloud\Compute\V1\HealthCheckLogConfig $var + * @return $this + */ + public function setLogConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HealthCheckLogConfig::class); + $this->log_config = $var; + + return $this; + } + + /** + * 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. For example, a name that is 1-63 characters long, matches the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`, and otherwise complies with RFC1035. This regular expression describes a name where the first character is a lowercase letter, and all following characters are a dash, lowercase letter, or digit, except the last character, which isn't a dash. + * + * 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); + } + + /** + * 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. For example, a name that is 1-63 characters long, matches the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`, and otherwise complies with RFC1035. This regular expression describes a name where the first character is a lowercase letter, and all following characters are a dash, lowercase letter, or digit, except the last character, which isn't a dash. + * + * 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; + } + + /** + * [Output Only] Region where the health check resides. Not applicable to global health checks. + * + * 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] Region where the health check resides. Not applicable to global health checks. + * + * 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] Server-defined URL for the 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 the 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; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.SSLHealthCheck ssl_health_check = 280032440; + * @return \Google\Cloud\Compute\V1\SSLHealthCheck|null + */ + public function getSslHealthCheck() + { + return $this->ssl_health_check; + } + + public function hasSslHealthCheck() + { + return isset($this->ssl_health_check); + } + + public function clearSslHealthCheck() + { + unset($this->ssl_health_check); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.SSLHealthCheck ssl_health_check = 280032440; + * @param \Google\Cloud\Compute\V1\SSLHealthCheck $var + * @return $this + */ + public function setSslHealthCheck($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SSLHealthCheck::class); + $this->ssl_health_check = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.TCPHealthCheck tcp_health_check = 469980419; + * @return \Google\Cloud\Compute\V1\TCPHealthCheck|null + */ + public function getTcpHealthCheck() + { + return $this->tcp_health_check; + } + + public function hasTcpHealthCheck() + { + return isset($this->tcp_health_check); + } + + public function clearTcpHealthCheck() + { + unset($this->tcp_health_check); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.TCPHealthCheck tcp_health_check = 469980419; + * @param \Google\Cloud\Compute\V1\TCPHealthCheck $var + * @return $this + */ + public function setTcpHealthCheck($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TCPHealthCheck::class); + $this->tcp_health_check = $var; + + return $this; + } + + /** + * How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec. + * + * Generated from protobuf field optional int32 timeout_sec = 79994995; + * @return int + */ + public function getTimeoutSec() + { + return isset($this->timeout_sec) ? $this->timeout_sec : 0; + } + + public function hasTimeoutSec() + { + return isset($this->timeout_sec); + } + + public function clearTimeoutSec() + { + unset($this->timeout_sec); + } + + /** + * How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec. + * + * Generated from protobuf field optional int32 timeout_sec = 79994995; + * @param int $var + * @return $this + */ + public function setTimeoutSec($var) + { + GPBUtil::checkInt32($var); + $this->timeout_sec = $var; + + return $this; + } + + /** + * Specifies the type of the healthCheck, either TCP, SSL, HTTP, HTTPS, HTTP2 or GRPC. Exactly one of the protocol-specific health check fields must be specified, which must match type field. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * Specifies the type of the healthCheck, either TCP, SSL, HTTP, HTTPS, HTTP2 or GRPC. Exactly one of the protocol-specific health check fields must be specified, which must match type field. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2. + * + * Generated from protobuf field optional int32 unhealthy_threshold = 227958480; + * @return int + */ + public function getUnhealthyThreshold() + { + return isset($this->unhealthy_threshold) ? $this->unhealthy_threshold : 0; + } + + public function hasUnhealthyThreshold() + { + return isset($this->unhealthy_threshold); + } + + public function clearUnhealthyThreshold() + { + unset($this->unhealthy_threshold); + } + + /** + * A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2. + * + * Generated from protobuf field optional int32 unhealthy_threshold = 227958480; + * @param int $var + * @return $this + */ + public function setUnhealthyThreshold($var) + { + GPBUtil::checkInt32($var); + $this->unhealthy_threshold = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheck/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheck/Type.php new file mode 100644 index 000000000000..903affce4845 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheck/Type.php @@ -0,0 +1,85 @@ +google.cloud.compute.v1.HealthCheck.Type + */ +class Type +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TYPE = 0; + */ + const UNDEFINED_TYPE = 0; + /** + * Generated from protobuf enum GRPC = 2196510; + */ + const GRPC = 2196510; + /** + * Generated from protobuf enum HTTP = 2228360; + */ + const HTTP = 2228360; + /** + * Generated from protobuf enum HTTP2 = 69079210; + */ + const HTTP2 = 69079210; + /** + * Generated from protobuf enum HTTPS = 69079243; + */ + const HTTPS = 69079243; + /** + * Generated from protobuf enum INVALID = 530283991; + */ + const INVALID = 530283991; + /** + * Generated from protobuf enum SSL = 82412; + */ + const SSL = 82412; + /** + * Generated from protobuf enum TCP = 82881; + */ + const TCP = 82881; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::GRPC => 'GRPC', + self::HTTP => 'HTTP', + self::HTTP2 => 'HTTP2', + self::HTTPS => 'HTTPS', + self::INVALID => 'INVALID', + self::SSL => 'SSL', + self::TCP => 'TCP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Compute\V1\HealthCheck_Type::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckList.php new file mode 100644 index 000000000000..d15ed900504b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.HealthCheckList + */ +class HealthCheckList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of HealthCheck resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthCheck items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\HealthCheck>|\Google\Protobuf\Internal\RepeatedField $items + * A list of HealthCheck 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 HealthCheck resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthCheck items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of HealthCheck resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthCheck items = 100526016; + * @param array<\Google\Cloud\Compute\V1\HealthCheck>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\HealthCheck::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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckLogConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckLogConfig.php new file mode 100644 index 000000000000..c41cac0345a3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckLogConfig.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.HealthCheckLogConfig + */ +class HealthCheckLogConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates whether or not to export logs. This is false by default, which means no health check logging will be done. + * + * Generated from protobuf field optional bool enable = 311764355; + */ + protected $enable = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable + * Indicates whether or not to export logs. This is false by default, which means no health check logging will be done. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Indicates whether or not to export logs. This is false by default, which means no health check logging will be done. + * + * Generated from protobuf field optional bool enable = 311764355; + * @return bool + */ + public function getEnable() + { + return isset($this->enable) ? $this->enable : false; + } + + public function hasEnable() + { + return isset($this->enable); + } + + public function clearEnable() + { + unset($this->enable); + } + + /** + * Indicates whether or not to export logs. This is false by default, which means no health check logging will be done. + * + * Generated from protobuf field optional bool enable = 311764355; + * @param bool $var + * @return $this + */ + public function setEnable($var) + { + GPBUtil::checkBool($var); + $this->enable = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckReference.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckReference.php new file mode 100644 index 000000000000..cfe94d47fac6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckReference.php @@ -0,0 +1,70 @@ +google.cloud.compute.v1.HealthCheckReference + */ +class HealthCheckReference extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string health_check = 308876645; + */ + protected $health_check = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $health_check + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string health_check = 308876645; + * @return string + */ + public function getHealthCheck() + { + return isset($this->health_check) ? $this->health_check : ''; + } + + public function hasHealthCheck() + { + return isset($this->health_check); + } + + public function clearHealthCheck() + { + unset($this->health_check); + } + + /** + * Generated from protobuf field optional string health_check = 308876645; + * @param string $var + * @return $this + */ + public function setHealthCheck($var) + { + GPBUtil::checkString($var, True); + $this->health_check = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckService.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckService.php new file mode 100644 index 000000000000..79749ee14ec7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckService.php @@ -0,0 +1,535 @@ +google.cloud.compute.v1.HealthCheckService + */ +class HealthCheckService extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a HealthCheckService. An up-to-date fingerprint must be provided in order to patch/update the HealthCheckService; Otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the HealthCheckService. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * A list of URLs to the HealthCheck resources. Must have at least one HealthCheck, and not more than 10 for regional HealthCheckService, and not more than 1 for global HealthCheckService. HealthCheck resources must have portSpecification=USE_SERVING_PORT or portSpecification=USE_FIXED_PORT. For regional HealthCheckService, the HealthCheck must be regional and in the same region. For global HealthCheckService, HealthCheck must be global. Mix of regional and global HealthChecks is not supported. Multiple regional HealthChecks must belong to the same region. Regional HealthChecks must belong to the same region as zones of NetworkEndpointGroups. For global HealthCheckService using global INTERNET_IP_PORT NetworkEndpointGroups, the global HealthChecks must specify sourceRegions, and HealthChecks that specify sourceRegions can only be used with global INTERNET_IP_PORT NetworkEndpointGroups. + * + * Generated from protobuf field repeated string health_checks = 448370606; + */ + private $health_checks; + /** + * Optional. Policy for how the results from multiple health checks for the same endpoint are aggregated. Defaults to NO_AGGREGATION if unspecified. - NO_AGGREGATION. An EndpointHealth message is returned for each pair in the health check service. - AND. If any health check of an endpoint reports UNHEALTHY, then UNHEALTHY is the HealthState of the endpoint. If all health checks report HEALTHY, the HealthState of the endpoint is HEALTHY. . This is only allowed with regional HealthCheckService. + * Check the HealthStatusAggregationPolicy enum for the list of possible values. + * + * Generated from protobuf field optional string health_status_aggregation_policy = 253163129; + */ + protected $health_status_aggregation_policy = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output only] Type of the resource. Always compute#healthCheckServicefor health check services. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * Name of the resource. 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * A list of URLs to the NetworkEndpointGroup resources. Must not have more than 100. For regional HealthCheckService, NEGs must be in zones in the region of the HealthCheckService. For global HealthCheckServices, the NetworkEndpointGroups must be global INTERNET_IP_PORT. + * + * Generated from protobuf field repeated string network_endpoint_groups = 29346733; + */ + private $network_endpoint_groups; + /** + * A list of URLs to the NotificationEndpoint resources. Must not have more than 10. A list of endpoints for receiving notifications of change in health status. For regional HealthCheckService, NotificationEndpoint must be regional and in the same region. For global HealthCheckService, NotificationEndpoint must be global. + * + * Generated from protobuf field repeated string notification_endpoints = 406728490; + */ + private $notification_endpoints; + /** + * [Output Only] URL of the region where the health check service resides. This field is not applicable to global health check services. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type string $fingerprint + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a HealthCheckService. An up-to-date fingerprint must be provided in order to patch/update the HealthCheckService; Otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the HealthCheckService. + * @type array|\Google\Protobuf\Internal\RepeatedField $health_checks + * A list of URLs to the HealthCheck resources. Must have at least one HealthCheck, and not more than 10 for regional HealthCheckService, and not more than 1 for global HealthCheckService. HealthCheck resources must have portSpecification=USE_SERVING_PORT or portSpecification=USE_FIXED_PORT. For regional HealthCheckService, the HealthCheck must be regional and in the same region. For global HealthCheckService, HealthCheck must be global. Mix of regional and global HealthChecks is not supported. Multiple regional HealthChecks must belong to the same region. Regional HealthChecks must belong to the same region as zones of NetworkEndpointGroups. For global HealthCheckService using global INTERNET_IP_PORT NetworkEndpointGroups, the global HealthChecks must specify sourceRegions, and HealthChecks that specify sourceRegions can only be used with global INTERNET_IP_PORT NetworkEndpointGroups. + * @type string $health_status_aggregation_policy + * Optional. Policy for how the results from multiple health checks for the same endpoint are aggregated. Defaults to NO_AGGREGATION if unspecified. - NO_AGGREGATION. An EndpointHealth message is returned for each pair in the health check service. - AND. If any health check of an endpoint reports UNHEALTHY, then UNHEALTHY is the HealthState of the endpoint. If all health checks report HEALTHY, the HealthState of the endpoint is HEALTHY. . This is only allowed with regional HealthCheckService. + * Check the HealthStatusAggregationPolicy enum for the list of possible values. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output only] Type of the resource. Always compute#healthCheckServicefor health check services. + * @type string $name + * Name of the resource. 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 array|\Google\Protobuf\Internal\RepeatedField $network_endpoint_groups + * A list of URLs to the NetworkEndpointGroup resources. Must not have more than 100. For regional HealthCheckService, NEGs must be in zones in the region of the HealthCheckService. For global HealthCheckServices, the NetworkEndpointGroups must be global INTERNET_IP_PORT. + * @type array|\Google\Protobuf\Internal\RepeatedField $notification_endpoints + * A list of URLs to the NotificationEndpoint resources. Must not have more than 10. A list of endpoints for receiving notifications of change in health status. For regional HealthCheckService, NotificationEndpoint must be regional and in the same region. For global HealthCheckService, NotificationEndpoint must be global. + * @type string $region + * [Output Only] URL of the region where the health check service resides. This field is not applicable to global health check services. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a HealthCheckService. An up-to-date fingerprint must be provided in order to patch/update the HealthCheckService; Otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the HealthCheckService. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a HealthCheckService. An up-to-date fingerprint must be provided in order to patch/update the HealthCheckService; Otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the HealthCheckService. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * A list of URLs to the HealthCheck resources. Must have at least one HealthCheck, and not more than 10 for regional HealthCheckService, and not more than 1 for global HealthCheckService. HealthCheck resources must have portSpecification=USE_SERVING_PORT or portSpecification=USE_FIXED_PORT. For regional HealthCheckService, the HealthCheck must be regional and in the same region. For global HealthCheckService, HealthCheck must be global. Mix of regional and global HealthChecks is not supported. Multiple regional HealthChecks must belong to the same region. Regional HealthChecks must belong to the same region as zones of NetworkEndpointGroups. For global HealthCheckService using global INTERNET_IP_PORT NetworkEndpointGroups, the global HealthChecks must specify sourceRegions, and HealthChecks that specify sourceRegions can only be used with global INTERNET_IP_PORT NetworkEndpointGroups. + * + * Generated from protobuf field repeated string health_checks = 448370606; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHealthChecks() + { + return $this->health_checks; + } + + /** + * A list of URLs to the HealthCheck resources. Must have at least one HealthCheck, and not more than 10 for regional HealthCheckService, and not more than 1 for global HealthCheckService. HealthCheck resources must have portSpecification=USE_SERVING_PORT or portSpecification=USE_FIXED_PORT. For regional HealthCheckService, the HealthCheck must be regional and in the same region. For global HealthCheckService, HealthCheck must be global. Mix of regional and global HealthChecks is not supported. Multiple regional HealthChecks must belong to the same region. Regional HealthChecks must belong to the same region as zones of NetworkEndpointGroups. For global HealthCheckService using global INTERNET_IP_PORT NetworkEndpointGroups, the global HealthChecks must specify sourceRegions, and HealthChecks that specify sourceRegions can only be used with global INTERNET_IP_PORT NetworkEndpointGroups. + * + * Generated from protobuf field repeated string health_checks = 448370606; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHealthChecks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->health_checks = $arr; + + return $this; + } + + /** + * Optional. Policy for how the results from multiple health checks for the same endpoint are aggregated. Defaults to NO_AGGREGATION if unspecified. - NO_AGGREGATION. An EndpointHealth message is returned for each pair in the health check service. - AND. If any health check of an endpoint reports UNHEALTHY, then UNHEALTHY is the HealthState of the endpoint. If all health checks report HEALTHY, the HealthState of the endpoint is HEALTHY. . This is only allowed with regional HealthCheckService. + * Check the HealthStatusAggregationPolicy enum for the list of possible values. + * + * Generated from protobuf field optional string health_status_aggregation_policy = 253163129; + * @return string + */ + public function getHealthStatusAggregationPolicy() + { + return isset($this->health_status_aggregation_policy) ? $this->health_status_aggregation_policy : ''; + } + + public function hasHealthStatusAggregationPolicy() + { + return isset($this->health_status_aggregation_policy); + } + + public function clearHealthStatusAggregationPolicy() + { + unset($this->health_status_aggregation_policy); + } + + /** + * Optional. Policy for how the results from multiple health checks for the same endpoint are aggregated. Defaults to NO_AGGREGATION if unspecified. - NO_AGGREGATION. An EndpointHealth message is returned for each pair in the health check service. - AND. If any health check of an endpoint reports UNHEALTHY, then UNHEALTHY is the HealthState of the endpoint. If all health checks report HEALTHY, the HealthState of the endpoint is HEALTHY. . This is only allowed with regional HealthCheckService. + * Check the HealthStatusAggregationPolicy enum for the list of possible values. + * + * Generated from protobuf field optional string health_status_aggregation_policy = 253163129; + * @param string $var + * @return $this + */ + public function setHealthStatusAggregationPolicy($var) + { + GPBUtil::checkString($var, True); + $this->health_status_aggregation_policy = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output only] Type of the resource. Always compute#healthCheckServicefor health check services. + * + * 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); + } + + /** + * [Output only] Type of the resource. Always compute#healthCheckServicefor health check services. + * + * 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; + } + + /** + * Name of the resource. 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. + * + * 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); + } + + /** + * Name of the resource. 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. + * + * 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; + } + + /** + * A list of URLs to the NetworkEndpointGroup resources. Must not have more than 100. For regional HealthCheckService, NEGs must be in zones in the region of the HealthCheckService. For global HealthCheckServices, the NetworkEndpointGroups must be global INTERNET_IP_PORT. + * + * Generated from protobuf field repeated string network_endpoint_groups = 29346733; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkEndpointGroups() + { + return $this->network_endpoint_groups; + } + + /** + * A list of URLs to the NetworkEndpointGroup resources. Must not have more than 100. For regional HealthCheckService, NEGs must be in zones in the region of the HealthCheckService. For global HealthCheckServices, the NetworkEndpointGroups must be global INTERNET_IP_PORT. + * + * Generated from protobuf field repeated string network_endpoint_groups = 29346733; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkEndpointGroups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->network_endpoint_groups = $arr; + + return $this; + } + + /** + * A list of URLs to the NotificationEndpoint resources. Must not have more than 10. A list of endpoints for receiving notifications of change in health status. For regional HealthCheckService, NotificationEndpoint must be regional and in the same region. For global HealthCheckService, NotificationEndpoint must be global. + * + * Generated from protobuf field repeated string notification_endpoints = 406728490; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNotificationEndpoints() + { + return $this->notification_endpoints; + } + + /** + * A list of URLs to the NotificationEndpoint resources. Must not have more than 10. A list of endpoints for receiving notifications of change in health status. For regional HealthCheckService, NotificationEndpoint must be regional and in the same region. For global HealthCheckService, NotificationEndpoint must be global. + * + * Generated from protobuf field repeated string notification_endpoints = 406728490; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNotificationEndpoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->notification_endpoints = $arr; + + return $this; + } + + /** + * [Output Only] URL of the region where the health check service resides. This field is not applicable to global health check services. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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 health check service resides. This field is not applicable to global health check services. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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] Server-defined URL for the 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 the 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckService/HealthStatusAggregationPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckService/HealthStatusAggregationPolicy.php new file mode 100644 index 000000000000..5ff42fed98c2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckService/HealthStatusAggregationPolicy.php @@ -0,0 +1,68 @@ +google.cloud.compute.v1.HealthCheckService.HealthStatusAggregationPolicy + */ +class HealthStatusAggregationPolicy +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_HEALTH_STATUS_AGGREGATION_POLICY = 0; + */ + const UNDEFINED_HEALTH_STATUS_AGGREGATION_POLICY = 0; + /** + * If any backend's health check reports UNHEALTHY, then UNHEALTHY is the HealthState of the entire health check service. If all backend's are healthy, the HealthState of the health check service is HEALTHY. + * + * Generated from protobuf enum AND = 64951; + */ + const PBAND = 64951; + /** + * An EndpointHealth message is returned for each backend in the health check service. + * + * Generated from protobuf enum NO_AGGREGATION = 426445124; + */ + const NO_AGGREGATION = 426445124; + + private static $valueToName = [ + self::UNDEFINED_HEALTH_STATUS_AGGREGATION_POLICY => 'UNDEFINED_HEALTH_STATUS_AGGREGATION_POLICY', + self::PBAND => 'AND', + self::NO_AGGREGATION => 'NO_AGGREGATION', + ]; + + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(HealthStatusAggregationPolicy::class, \Google\Cloud\Compute\V1\HealthCheckService_HealthStatusAggregationPolicy::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckServiceReference.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckServiceReference.php new file mode 100644 index 000000000000..40ddcb9d5981 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckServiceReference.php @@ -0,0 +1,70 @@ +google.cloud.compute.v1.HealthCheckServiceReference + */ +class HealthCheckServiceReference extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string health_check_service = 408374747; + */ + protected $health_check_service = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $health_check_service + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string health_check_service = 408374747; + * @return string + */ + public function getHealthCheckService() + { + return isset($this->health_check_service) ? $this->health_check_service : ''; + } + + public function hasHealthCheckService() + { + return isset($this->health_check_service); + } + + public function clearHealthCheckService() + { + unset($this->health_check_service); + } + + /** + * Generated from protobuf field optional string health_check_service = 408374747; + * @param string $var + * @return $this + */ + public function setHealthCheckService($var) + { + GPBUtil::checkString($var, True); + $this->health_check_service = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckServicesList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckServicesList.php new file mode 100644 index 000000000000..3efa5f339fa4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheckServicesList.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.HealthCheckServicesList + */ +class HealthCheckServicesList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of HealthCheckService resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthCheckService items = 100526016; + */ + private $items; + /** + * [Output Only] Type of the resource. Always compute#healthCheckServicesList for lists of HealthCheckServices. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\HealthCheckService>|\Google\Protobuf\Internal\RepeatedField $items + * A list of HealthCheckService resources. + * @type string $kind + * [Output Only] Type of the resource. Always compute#healthCheckServicesList for lists of HealthCheckServices. + * @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 HealthCheckService resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthCheckService items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of HealthCheckService resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthCheckService items = 100526016; + * @param array<\Google\Cloud\Compute\V1\HealthCheckService>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\HealthCheckService::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#healthCheckServicesList for lists of HealthCheckServices. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#healthCheckServicesList for lists of HealthCheckServices. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthChecksAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthChecksAggregatedList.php new file mode 100644 index 000000000000..c6aaa4012547 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthChecksAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.HealthChecksAggregatedList + */ +class HealthChecksAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of HealthChecksScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 HealthChecksScopedList 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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 HealthChecksScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of HealthChecksScopedList 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\HealthChecksScopedList::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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthChecksScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthChecksScopedList.php new file mode 100644 index 000000000000..c3754ab49234 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthChecksScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.HealthChecksScopedList + */ +class HealthChecksScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * A list of HealthChecks contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthCheck health_checks = 448370606; + */ + private $health_checks; + /** + * Informational warning which replaces the list of backend services when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\HealthCheck>|\Google\Protobuf\Internal\RepeatedField $health_checks + * A list of HealthChecks contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * Informational warning which replaces the list of backend services when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of HealthChecks contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthCheck health_checks = 448370606; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHealthChecks() + { + return $this->health_checks; + } + + /** + * A list of HealthChecks contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthCheck health_checks = 448370606; + * @param array<\Google\Cloud\Compute\V1\HealthCheck>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHealthChecks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\HealthCheck::class); + $this->health_checks = $arr; + + return $this; + } + + /** + * Informational warning which replaces the list of backend services 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); + } + + /** + * Informational warning which replaces the list of backend services 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatus.php new file mode 100644 index 000000000000..db1236be60d4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatus.php @@ -0,0 +1,419 @@ +google.cloud.compute.v1.HealthStatus + */ +class HealthStatus extends \Google\Protobuf\Internal\Message +{ + /** + * Metadata defined as annotations for network endpoint. + * + * Generated from protobuf field map annotations = 112032548; + */ + private $annotations; + /** + * URL of the forwarding rule associated with the health status of the instance. + * + * Generated from protobuf field optional string forwarding_rule = 269964030; + */ + protected $forwarding_rule = null; + /** + * A forwarding rule IP address assigned to this instance. + * + * Generated from protobuf field optional string forwarding_rule_ip = 172250632; + */ + protected $forwarding_rule_ip = null; + /** + * Health state of the IPv4 address of the instance. + * Check the HealthState enum for the list of possible values. + * + * Generated from protobuf field optional string health_state = 324007150; + */ + protected $health_state = null; + /** + * URL of the instance resource. + * + * Generated from protobuf field optional string instance = 18257045; + */ + protected $instance = null; + /** + * For target pool based Network Load Balancing, it indicates the forwarding rule's IP address assigned to this instance. For other types of load balancing, the field indicates VM internal ip. + * + * Generated from protobuf field optional string ip_address = 406272220; + */ + protected $ip_address = null; + /** + * The named port of the instance group, not necessarily the port that is health-checked. + * + * Generated from protobuf field optional int32 port = 3446913; + */ + protected $port = null; + /** + * Generated from protobuf field optional string weight = 282149496; + */ + protected $weight = null; + /** + * + * Check the WeightError enum for the list of possible values. + * + * Generated from protobuf field optional string weight_error = 522501505; + */ + protected $weight_error = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Metadata defined as annotations for network endpoint. + * @type string $forwarding_rule + * URL of the forwarding rule associated with the health status of the instance. + * @type string $forwarding_rule_ip + * A forwarding rule IP address assigned to this instance. + * @type string $health_state + * Health state of the IPv4 address of the instance. + * Check the HealthState enum for the list of possible values. + * @type string $instance + * URL of the instance resource. + * @type string $ip_address + * For target pool based Network Load Balancing, it indicates the forwarding rule's IP address assigned to this instance. For other types of load balancing, the field indicates VM internal ip. + * @type int $port + * The named port of the instance group, not necessarily the port that is health-checked. + * @type string $weight + * @type string $weight_error + * + * Check the WeightError enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Metadata defined as annotations for network endpoint. + * + * Generated from protobuf field map annotations = 112032548; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Metadata defined as annotations for network endpoint. + * + * Generated from protobuf field map annotations = 112032548; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * URL of the forwarding rule associated with the health status of the instance. + * + * Generated from protobuf field optional string forwarding_rule = 269964030; + * @return string + */ + public function getForwardingRule() + { + return isset($this->forwarding_rule) ? $this->forwarding_rule : ''; + } + + public function hasForwardingRule() + { + return isset($this->forwarding_rule); + } + + public function clearForwardingRule() + { + unset($this->forwarding_rule); + } + + /** + * URL of the forwarding rule associated with the health status of the instance. + * + * Generated from protobuf field optional string forwarding_rule = 269964030; + * @param string $var + * @return $this + */ + public function setForwardingRule($var) + { + GPBUtil::checkString($var, True); + $this->forwarding_rule = $var; + + return $this; + } + + /** + * A forwarding rule IP address assigned to this instance. + * + * Generated from protobuf field optional string forwarding_rule_ip = 172250632; + * @return string + */ + public function getForwardingRuleIp() + { + return isset($this->forwarding_rule_ip) ? $this->forwarding_rule_ip : ''; + } + + public function hasForwardingRuleIp() + { + return isset($this->forwarding_rule_ip); + } + + public function clearForwardingRuleIp() + { + unset($this->forwarding_rule_ip); + } + + /** + * A forwarding rule IP address assigned to this instance. + * + * Generated from protobuf field optional string forwarding_rule_ip = 172250632; + * @param string $var + * @return $this + */ + public function setForwardingRuleIp($var) + { + GPBUtil::checkString($var, True); + $this->forwarding_rule_ip = $var; + + return $this; + } + + /** + * Health state of the IPv4 address of the instance. + * Check the HealthState enum for the list of possible values. + * + * Generated from protobuf field optional string health_state = 324007150; + * @return string + */ + public function getHealthState() + { + return isset($this->health_state) ? $this->health_state : ''; + } + + public function hasHealthState() + { + return isset($this->health_state); + } + + public function clearHealthState() + { + unset($this->health_state); + } + + /** + * Health state of the IPv4 address of the instance. + * Check the HealthState enum for the list of possible values. + * + * Generated from protobuf field optional string health_state = 324007150; + * @param string $var + * @return $this + */ + public function setHealthState($var) + { + GPBUtil::checkString($var, True); + $this->health_state = $var; + + return $this; + } + + /** + * URL of the instance resource. + * + * Generated from protobuf field optional string instance = 18257045; + * @return string + */ + public function getInstance() + { + return isset($this->instance) ? $this->instance : ''; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * URL of the instance resource. + * + * Generated from protobuf field optional string instance = 18257045; + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + + /** + * For target pool based Network Load Balancing, it indicates the forwarding rule's IP address assigned to this instance. For other types of load balancing, the field indicates VM internal ip. + * + * Generated from protobuf field optional string ip_address = 406272220; + * @return string + */ + public function getIpAddress() + { + return isset($this->ip_address) ? $this->ip_address : ''; + } + + public function hasIpAddress() + { + return isset($this->ip_address); + } + + public function clearIpAddress() + { + unset($this->ip_address); + } + + /** + * For target pool based Network Load Balancing, it indicates the forwarding rule's IP address assigned to this instance. For other types of load balancing, the field indicates VM internal ip. + * + * Generated from protobuf field optional string ip_address = 406272220; + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + + /** + * The named port of the instance group, not necessarily the port that is health-checked. + * + * Generated from protobuf field optional int32 port = 3446913; + * @return int + */ + public function getPort() + { + return isset($this->port) ? $this->port : 0; + } + + public function hasPort() + { + return isset($this->port); + } + + public function clearPort() + { + unset($this->port); + } + + /** + * The named port of the instance group, not necessarily the port that is health-checked. + * + * Generated from protobuf field optional int32 port = 3446913; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + + /** + * Generated from protobuf field optional string weight = 282149496; + * @return string + */ + public function getWeight() + { + return isset($this->weight) ? $this->weight : ''; + } + + public function hasWeight() + { + return isset($this->weight); + } + + public function clearWeight() + { + unset($this->weight); + } + + /** + * Generated from protobuf field optional string weight = 282149496; + * @param string $var + * @return $this + */ + public function setWeight($var) + { + GPBUtil::checkString($var, True); + $this->weight = $var; + + return $this; + } + + /** + * + * Check the WeightError enum for the list of possible values. + * + * Generated from protobuf field optional string weight_error = 522501505; + * @return string + */ + public function getWeightError() + { + return isset($this->weight_error) ? $this->weight_error : ''; + } + + public function hasWeightError() + { + return isset($this->weight_error); + } + + public function clearWeightError() + { + unset($this->weight_error); + } + + /** + * + * Check the WeightError enum for the list of possible values. + * + * Generated from protobuf field optional string weight_error = 522501505; + * @param string $var + * @return $this + */ + public function setWeightError($var) + { + GPBUtil::checkString($var, True); + $this->weight_error = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatus/HealthState.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatus/HealthState.php new file mode 100644 index 000000000000..4fb6e2f3205e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatus/HealthState.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.HealthStatus.HealthState + */ +class HealthState +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_HEALTH_STATE = 0; + */ + const UNDEFINED_HEALTH_STATE = 0; + /** + * Generated from protobuf enum HEALTHY = 439801213; + */ + const HEALTHY = 439801213; + /** + * Generated from protobuf enum UNHEALTHY = 462118084; + */ + const UNHEALTHY = 462118084; + + private static $valueToName = [ + self::UNDEFINED_HEALTH_STATE => 'UNDEFINED_HEALTH_STATE', + self::HEALTHY => 'HEALTHY', + self::UNHEALTHY => 'UNHEALTHY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(HealthState::class, \Google\Cloud\Compute\V1\HealthStatus_HealthState::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatus/WeightError.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatus/WeightError.php new file mode 100644 index 000000000000..adfa3c9d50f2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatus/WeightError.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.HealthStatus.WeightError + */ +class WeightError +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_WEIGHT_ERROR = 0; + */ + const UNDEFINED_WEIGHT_ERROR = 0; + /** + * The response to a Health Check probe had the HTTP response header field X-Load-Balancing-Endpoint-Weight, but its content was invalid (i.e., not a non-negative single-precision floating-point number in decimal string representation). + * + * Generated from protobuf enum INVALID_WEIGHT = 383698400; + */ + const INVALID_WEIGHT = 383698400; + /** + * The response to a Health Check probe did not have the HTTP response header field X-Load-Balancing-Endpoint-Weight. + * + * Generated from protobuf enum MISSING_WEIGHT = 384027537; + */ + const MISSING_WEIGHT = 384027537; + /** + * This is the value when the accompanied health status is either TIMEOUT (i.e.,the Health Check probe was not able to get a response in time) or UNKNOWN. For the latter, it should be typically because there has not been sufficient time to parse and report the weight for a new backend (which is with 0.0.0.0 ip address). However, it can be also due to an outage case for which the health status is explicitly reset to UNKNOWN. + * + * Generated from protobuf enum UNAVAILABLE_WEIGHT = 439464295; + */ + const UNAVAILABLE_WEIGHT = 439464295; + /** + * This is the default value when WeightReportMode is DISABLE, and is also the initial value when WeightReportMode has just updated to ENABLE or DRY_RUN and there has not been sufficient time to parse and report the backend weight. + * + * Generated from protobuf enum WEIGHT_NONE = 502428831; + */ + const WEIGHT_NONE = 502428831; + + private static $valueToName = [ + self::UNDEFINED_WEIGHT_ERROR => 'UNDEFINED_WEIGHT_ERROR', + self::INVALID_WEIGHT => 'INVALID_WEIGHT', + self::MISSING_WEIGHT => 'MISSING_WEIGHT', + self::UNAVAILABLE_WEIGHT => 'UNAVAILABLE_WEIGHT', + self::WEIGHT_NONE => 'WEIGHT_NONE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(WeightError::class, \Google\Cloud\Compute\V1\HealthStatus_WeightError::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatusForNetworkEndpoint.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatusForNetworkEndpoint.php new file mode 100644 index 000000000000..4bae66826176 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatusForNetworkEndpoint.php @@ -0,0 +1,256 @@ +google.cloud.compute.v1.HealthStatusForNetworkEndpoint + */ +class HealthStatusForNetworkEndpoint extends \Google\Protobuf\Internal\Message +{ + /** + * URL of the backend service associated with the health state of the network endpoint. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceReference backend_service = 306946058; + */ + protected $backend_service = null; + /** + * URL of the forwarding rule associated with the health state of the network endpoint. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ForwardingRuleReference forwarding_rule = 269964030; + */ + protected $forwarding_rule = null; + /** + * URL of the health check associated with the health state of the network endpoint. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HealthCheckReference health_check = 308876645; + */ + protected $health_check = null; + /** + * URL of the health check service associated with the health state of the network endpoint. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HealthCheckServiceReference health_check_service = 408374747; + */ + protected $health_check_service = null; + /** + * Health state of the network endpoint determined based on the health checks configured. + * Check the HealthState enum for the list of possible values. + * + * Generated from protobuf field optional string health_state = 324007150; + */ + protected $health_state = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\BackendServiceReference $backend_service + * URL of the backend service associated with the health state of the network endpoint. + * @type \Google\Cloud\Compute\V1\ForwardingRuleReference $forwarding_rule + * URL of the forwarding rule associated with the health state of the network endpoint. + * @type \Google\Cloud\Compute\V1\HealthCheckReference $health_check + * URL of the health check associated with the health state of the network endpoint. + * @type \Google\Cloud\Compute\V1\HealthCheckServiceReference $health_check_service + * URL of the health check service associated with the health state of the network endpoint. + * @type string $health_state + * Health state of the network endpoint determined based on the health checks configured. + * Check the HealthState enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * URL of the backend service associated with the health state of the network endpoint. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceReference backend_service = 306946058; + * @return \Google\Cloud\Compute\V1\BackendServiceReference|null + */ + public function getBackendService() + { + return $this->backend_service; + } + + public function hasBackendService() + { + return isset($this->backend_service); + } + + public function clearBackendService() + { + unset($this->backend_service); + } + + /** + * URL of the backend service associated with the health state of the network endpoint. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceReference backend_service = 306946058; + * @param \Google\Cloud\Compute\V1\BackendServiceReference $var + * @return $this + */ + public function setBackendService($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BackendServiceReference::class); + $this->backend_service = $var; + + return $this; + } + + /** + * URL of the forwarding rule associated with the health state of the network endpoint. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ForwardingRuleReference forwarding_rule = 269964030; + * @return \Google\Cloud\Compute\V1\ForwardingRuleReference|null + */ + public function getForwardingRule() + { + return $this->forwarding_rule; + } + + public function hasForwardingRule() + { + return isset($this->forwarding_rule); + } + + public function clearForwardingRule() + { + unset($this->forwarding_rule); + } + + /** + * URL of the forwarding rule associated with the health state of the network endpoint. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ForwardingRuleReference forwarding_rule = 269964030; + * @param \Google\Cloud\Compute\V1\ForwardingRuleReference $var + * @return $this + */ + public function setForwardingRule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ForwardingRuleReference::class); + $this->forwarding_rule = $var; + + return $this; + } + + /** + * URL of the health check associated with the health state of the network endpoint. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HealthCheckReference health_check = 308876645; + * @return \Google\Cloud\Compute\V1\HealthCheckReference|null + */ + public function getHealthCheck() + { + return $this->health_check; + } + + public function hasHealthCheck() + { + return isset($this->health_check); + } + + public function clearHealthCheck() + { + unset($this->health_check); + } + + /** + * URL of the health check associated with the health state of the network endpoint. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HealthCheckReference health_check = 308876645; + * @param \Google\Cloud\Compute\V1\HealthCheckReference $var + * @return $this + */ + public function setHealthCheck($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HealthCheckReference::class); + $this->health_check = $var; + + return $this; + } + + /** + * URL of the health check service associated with the health state of the network endpoint. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HealthCheckServiceReference health_check_service = 408374747; + * @return \Google\Cloud\Compute\V1\HealthCheckServiceReference|null + */ + public function getHealthCheckService() + { + return $this->health_check_service; + } + + public function hasHealthCheckService() + { + return isset($this->health_check_service); + } + + public function clearHealthCheckService() + { + unset($this->health_check_service); + } + + /** + * URL of the health check service associated with the health state of the network endpoint. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HealthCheckServiceReference health_check_service = 408374747; + * @param \Google\Cloud\Compute\V1\HealthCheckServiceReference $var + * @return $this + */ + public function setHealthCheckService($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HealthCheckServiceReference::class); + $this->health_check_service = $var; + + return $this; + } + + /** + * Health state of the network endpoint determined based on the health checks configured. + * Check the HealthState enum for the list of possible values. + * + * Generated from protobuf field optional string health_state = 324007150; + * @return string + */ + public function getHealthState() + { + return isset($this->health_state) ? $this->health_state : ''; + } + + public function hasHealthState() + { + return isset($this->health_state); + } + + public function clearHealthState() + { + unset($this->health_state); + } + + /** + * Health state of the network endpoint determined based on the health checks configured. + * Check the HealthState enum for the list of possible values. + * + * Generated from protobuf field optional string health_state = 324007150; + * @param string $var + * @return $this + */ + public function setHealthState($var) + { + GPBUtil::checkString($var, True); + $this->health_state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatusForNetworkEndpoint/HealthState.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatusForNetworkEndpoint/HealthState.php new file mode 100644 index 000000000000..b3b2768dc8d9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatusForNetworkEndpoint/HealthState.php @@ -0,0 +1,78 @@ +google.cloud.compute.v1.HealthStatusForNetworkEndpoint.HealthState + */ +class HealthState +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_HEALTH_STATE = 0; + */ + const UNDEFINED_HEALTH_STATE = 0; + /** + * Endpoint is being drained. + * + * Generated from protobuf enum DRAINING = 480455402; + */ + const DRAINING = 480455402; + /** + * Endpoint is healthy. + * + * Generated from protobuf enum HEALTHY = 439801213; + */ + const HEALTHY = 439801213; + /** + * Endpoint is unhealthy. + * + * Generated from protobuf enum UNHEALTHY = 462118084; + */ + const UNHEALTHY = 462118084; + /** + * Health status of the endpoint is unknown. + * + * Generated from protobuf enum UNKNOWN = 433141802; + */ + const UNKNOWN = 433141802; + + private static $valueToName = [ + self::UNDEFINED_HEALTH_STATE => 'UNDEFINED_HEALTH_STATE', + self::DRAINING => 'DRAINING', + self::HEALTHY => 'HEALTHY', + self::UNHEALTHY => 'UNHEALTHY', + self::UNKNOWN => 'UNKNOWN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(HealthState::class, \Google\Cloud\Compute\V1\HealthStatusForNetworkEndpoint_HealthState::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Help.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Help.php new file mode 100644 index 000000000000..46ccdd08decd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Help.php @@ -0,0 +1,67 @@ +google.cloud.compute.v1.Help + */ +class Help extends \Google\Protobuf\Internal\Message +{ + /** + * URL(s) pointing to additional information on handling the current error. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HelpLink links = 102977465; + */ + private $links; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\HelpLink>|\Google\Protobuf\Internal\RepeatedField $links + * URL(s) pointing to additional information on handling the current error. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * URL(s) pointing to additional information on handling the current error. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HelpLink links = 102977465; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLinks() + { + return $this->links; + } + + /** + * URL(s) pointing to additional information on handling the current error. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HelpLink links = 102977465; + * @param array<\Google\Cloud\Compute\V1\HelpLink>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLinks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\HelpLink::class); + $this->links = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HelpLink.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HelpLink.php new file mode 100644 index 000000000000..f0b9c7868c69 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HelpLink.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.HelpLink + */ +class HelpLink extends \Google\Protobuf\Internal\Message +{ + /** + * Describes what the link offers. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * The URL of the link. + * + * Generated from protobuf field optional string url = 116079; + */ + protected $url = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $description + * Describes what the link offers. + * @type string $url + * The URL of the link. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Describes what the link offers. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * Describes what the link offers. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The URL of the link. + * + * Generated from protobuf field optional string url = 116079; + * @return string + */ + public function getUrl() + { + return isset($this->url) ? $this->url : ''; + } + + public function hasUrl() + { + return isset($this->url); + } + + public function clearUrl() + { + unset($this->url); + } + + /** + * The URL of the link. + * + * Generated from protobuf field optional string url = 116079; + * @param string $var + * @return $this + */ + public function setUrl($var) + { + GPBUtil::checkString($var, True); + $this->url = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HostRule.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HostRule.php new file mode 100644 index 000000000000..e0554748b364 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HostRule.php @@ -0,0 +1,155 @@ +google.cloud.compute.v1.HostRule + */ +class HostRule extends \Google\Protobuf\Internal\Message +{ + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character, and if followed by anything, the immediate following character must be either - or .. * based matching is not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * + * Generated from protobuf field repeated string hosts = 99467211; + */ + private $hosts; + /** + * The name of the PathMatcher to use to match the path portion of the URL if the hostRule matches the URL's host portion. + * + * Generated from protobuf field optional string path_matcher = 337813272; + */ + protected $path_matcher = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type array|\Google\Protobuf\Internal\RepeatedField $hosts + * The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character, and if followed by anything, the immediate following character must be either - or .. * based matching is not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * @type string $path_matcher + * The name of the PathMatcher to use to match the path portion of the URL if the hostRule matches the URL's host portion. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character, and if followed by anything, the immediate following character must be either - or .. * based matching is not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * + * Generated from protobuf field repeated string hosts = 99467211; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHosts() + { + return $this->hosts; + } + + /** + * The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character, and if followed by anything, the immediate following character must be either - or .. * based matching is not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * + * Generated from protobuf field repeated string hosts = 99467211; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHosts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->hosts = $arr; + + return $this; + } + + /** + * The name of the PathMatcher to use to match the path portion of the URL if the hostRule matches the URL's host portion. + * + * Generated from protobuf field optional string path_matcher = 337813272; + * @return string + */ + public function getPathMatcher() + { + return isset($this->path_matcher) ? $this->path_matcher : ''; + } + + public function hasPathMatcher() + { + return isset($this->path_matcher); + } + + public function clearPathMatcher() + { + unset($this->path_matcher); + } + + /** + * The name of the PathMatcher to use to match the path portion of the URL if the hostRule matches the URL's host portion. + * + * Generated from protobuf field optional string path_matcher = 337813272; + * @param string $var + * @return $this + */ + public function setPathMatcher($var) + { + GPBUtil::checkString($var, True); + $this->path_matcher = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpFaultAbort.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpFaultAbort.php new file mode 100644 index 000000000000..21e0dd19ac84 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpFaultAbort.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.HttpFaultAbort + */ +class HttpFaultAbort extends \Google\Protobuf\Internal\Message +{ + /** + * The HTTP status code used to abort the request. The value must be from 200 to 599 inclusive. For gRPC protocol, the gRPC status code is mapped to HTTP status code according to this mapping table. HTTP status 200 is mapped to gRPC status UNKNOWN. Injecting an OK status is currently not supported by Traffic Director. + * + * Generated from protobuf field optional uint32 http_status = 468949897; + */ + protected $http_status = null; + /** + * The percentage of traffic for connections, operations, or requests that is aborted as part of fault injection. The value must be from 0.0 to 100.0 inclusive. + * + * Generated from protobuf field optional double percentage = 151909018; + */ + protected $percentage = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $http_status + * The HTTP status code used to abort the request. The value must be from 200 to 599 inclusive. For gRPC protocol, the gRPC status code is mapped to HTTP status code according to this mapping table. HTTP status 200 is mapped to gRPC status UNKNOWN. Injecting an OK status is currently not supported by Traffic Director. + * @type float $percentage + * The percentage of traffic for connections, operations, or requests that is aborted as part of fault injection. The value must be from 0.0 to 100.0 inclusive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The HTTP status code used to abort the request. The value must be from 200 to 599 inclusive. For gRPC protocol, the gRPC status code is mapped to HTTP status code according to this mapping table. HTTP status 200 is mapped to gRPC status UNKNOWN. Injecting an OK status is currently not supported by Traffic Director. + * + * Generated from protobuf field optional uint32 http_status = 468949897; + * @return int + */ + public function getHttpStatus() + { + return isset($this->http_status) ? $this->http_status : 0; + } + + public function hasHttpStatus() + { + return isset($this->http_status); + } + + public function clearHttpStatus() + { + unset($this->http_status); + } + + /** + * The HTTP status code used to abort the request. The value must be from 200 to 599 inclusive. For gRPC protocol, the gRPC status code is mapped to HTTP status code according to this mapping table. HTTP status 200 is mapped to gRPC status UNKNOWN. Injecting an OK status is currently not supported by Traffic Director. + * + * Generated from protobuf field optional uint32 http_status = 468949897; + * @param int $var + * @return $this + */ + public function setHttpStatus($var) + { + GPBUtil::checkUint32($var); + $this->http_status = $var; + + return $this; + } + + /** + * The percentage of traffic for connections, operations, or requests that is aborted as part of fault injection. The value must be from 0.0 to 100.0 inclusive. + * + * Generated from protobuf field optional double percentage = 151909018; + * @return float + */ + public function getPercentage() + { + return isset($this->percentage) ? $this->percentage : 0.0; + } + + public function hasPercentage() + { + return isset($this->percentage); + } + + public function clearPercentage() + { + unset($this->percentage); + } + + /** + * The percentage of traffic for connections, operations, or requests that is aborted as part of fault injection. The value must be from 0.0 to 100.0 inclusive. + * + * Generated from protobuf field optional double percentage = 151909018; + * @param float $var + * @return $this + */ + public function setPercentage($var) + { + GPBUtil::checkDouble($var); + $this->percentage = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpFaultDelay.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpFaultDelay.php new file mode 100644 index 000000000000..eff29236d3f8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpFaultDelay.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.HttpFaultDelay + */ +class HttpFaultDelay extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies the value of the fixed delay interval. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration fixed_delay = 317037816; + */ + protected $fixed_delay = null; + /** + * The percentage of traffic for connections, operations, or requests for which a delay is introduced as part of fault injection. The value must be from 0.0 to 100.0 inclusive. + * + * Generated from protobuf field optional double percentage = 151909018; + */ + protected $percentage = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\Duration $fixed_delay + * Specifies the value of the fixed delay interval. + * @type float $percentage + * The percentage of traffic for connections, operations, or requests for which a delay is introduced as part of fault injection. The value must be from 0.0 to 100.0 inclusive. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies the value of the fixed delay interval. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration fixed_delay = 317037816; + * @return \Google\Cloud\Compute\V1\Duration|null + */ + public function getFixedDelay() + { + return $this->fixed_delay; + } + + public function hasFixedDelay() + { + return isset($this->fixed_delay); + } + + public function clearFixedDelay() + { + unset($this->fixed_delay); + } + + /** + * Specifies the value of the fixed delay interval. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration fixed_delay = 317037816; + * @param \Google\Cloud\Compute\V1\Duration $var + * @return $this + */ + public function setFixedDelay($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Duration::class); + $this->fixed_delay = $var; + + return $this; + } + + /** + * The percentage of traffic for connections, operations, or requests for which a delay is introduced as part of fault injection. The value must be from 0.0 to 100.0 inclusive. + * + * Generated from protobuf field optional double percentage = 151909018; + * @return float + */ + public function getPercentage() + { + return isset($this->percentage) ? $this->percentage : 0.0; + } + + public function hasPercentage() + { + return isset($this->percentage); + } + + public function clearPercentage() + { + unset($this->percentage); + } + + /** + * The percentage of traffic for connections, operations, or requests for which a delay is introduced as part of fault injection. The value must be from 0.0 to 100.0 inclusive. + * + * Generated from protobuf field optional double percentage = 151909018; + * @param float $var + * @return $this + */ + public function setPercentage($var) + { + GPBUtil::checkDouble($var); + $this->percentage = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpFaultInjection.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpFaultInjection.php new file mode 100644 index 000000000000..20f4eb1c2046 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpFaultInjection.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.HttpFaultInjection + */ +class HttpFaultInjection extends \Google\Protobuf\Internal\Message +{ + /** + * The specification for how client requests are aborted as part of fault injection. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpFaultAbort abort = 92611376; + */ + protected $abort = null; + /** + * The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpFaultDelay delay = 95467907; + */ + protected $delay = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\HttpFaultAbort $abort + * The specification for how client requests are aborted as part of fault injection. + * @type \Google\Cloud\Compute\V1\HttpFaultDelay $delay + * The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The specification for how client requests are aborted as part of fault injection. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpFaultAbort abort = 92611376; + * @return \Google\Cloud\Compute\V1\HttpFaultAbort|null + */ + public function getAbort() + { + return $this->abort; + } + + public function hasAbort() + { + return isset($this->abort); + } + + public function clearAbort() + { + unset($this->abort); + } + + /** + * The specification for how client requests are aborted as part of fault injection. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpFaultAbort abort = 92611376; + * @param \Google\Cloud\Compute\V1\HttpFaultAbort $var + * @return $this + */ + public function setAbort($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HttpFaultAbort::class); + $this->abort = $var; + + return $this; + } + + /** + * The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpFaultDelay delay = 95467907; + * @return \Google\Cloud\Compute\V1\HttpFaultDelay|null + */ + public function getDelay() + { + return $this->delay; + } + + public function hasDelay() + { + return isset($this->delay); + } + + public function clearDelay() + { + unset($this->delay); + } + + /** + * The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpFaultDelay delay = 95467907; + * @param \Google\Cloud\Compute\V1\HttpFaultDelay $var + * @return $this + */ + public function setDelay($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HttpFaultDelay::class); + $this->delay = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpHeaderAction.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpHeaderAction.php new file mode 100644 index 000000000000..476f01d24097 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpHeaderAction.php @@ -0,0 +1,169 @@ +google.cloud.compute.v1.HttpHeaderAction + */ +class HttpHeaderAction extends \Google\Protobuf\Internal\Message +{ + /** + * Headers to add to a matching request before forwarding the request to the backendService. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HttpHeaderOption request_headers_to_add = 72111974; + */ + private $request_headers_to_add; + /** + * A list of header names for headers that need to be removed from the request before forwarding the request to the backendService. + * + * Generated from protobuf field repeated string request_headers_to_remove = 218425247; + */ + private $request_headers_to_remove; + /** + * Headers to add the response before sending the response back to the client. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HttpHeaderOption response_headers_to_add = 32136052; + */ + private $response_headers_to_add; + /** + * A list of header names for headers that need to be removed from the response before sending the response back to the client. + * + * Generated from protobuf field repeated string response_headers_to_remove = 75415761; + */ + private $response_headers_to_remove; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\HttpHeaderOption>|\Google\Protobuf\Internal\RepeatedField $request_headers_to_add + * Headers to add to a matching request before forwarding the request to the backendService. + * @type array|\Google\Protobuf\Internal\RepeatedField $request_headers_to_remove + * A list of header names for headers that need to be removed from the request before forwarding the request to the backendService. + * @type array<\Google\Cloud\Compute\V1\HttpHeaderOption>|\Google\Protobuf\Internal\RepeatedField $response_headers_to_add + * Headers to add the response before sending the response back to the client. + * @type array|\Google\Protobuf\Internal\RepeatedField $response_headers_to_remove + * A list of header names for headers that need to be removed from the response before sending the response back to the client. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Headers to add to a matching request before forwarding the request to the backendService. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HttpHeaderOption request_headers_to_add = 72111974; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequestHeadersToAdd() + { + return $this->request_headers_to_add; + } + + /** + * Headers to add to a matching request before forwarding the request to the backendService. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HttpHeaderOption request_headers_to_add = 72111974; + * @param array<\Google\Cloud\Compute\V1\HttpHeaderOption>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequestHeadersToAdd($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\HttpHeaderOption::class); + $this->request_headers_to_add = $arr; + + return $this; + } + + /** + * A list of header names for headers that need to be removed from the request before forwarding the request to the backendService. + * + * Generated from protobuf field repeated string request_headers_to_remove = 218425247; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequestHeadersToRemove() + { + return $this->request_headers_to_remove; + } + + /** + * A list of header names for headers that need to be removed from the request before forwarding the request to the backendService. + * + * Generated from protobuf field repeated string request_headers_to_remove = 218425247; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequestHeadersToRemove($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->request_headers_to_remove = $arr; + + return $this; + } + + /** + * Headers to add the response before sending the response back to the client. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HttpHeaderOption response_headers_to_add = 32136052; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResponseHeadersToAdd() + { + return $this->response_headers_to_add; + } + + /** + * Headers to add the response before sending the response back to the client. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HttpHeaderOption response_headers_to_add = 32136052; + * @param array<\Google\Cloud\Compute\V1\HttpHeaderOption>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResponseHeadersToAdd($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\HttpHeaderOption::class); + $this->response_headers_to_add = $arr; + + return $this; + } + + /** + * A list of header names for headers that need to be removed from the response before sending the response back to the client. + * + * Generated from protobuf field repeated string response_headers_to_remove = 75415761; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResponseHeadersToRemove() + { + return $this->response_headers_to_remove; + } + + /** + * A list of header names for headers that need to be removed from the response before sending the response back to the client. + * + * Generated from protobuf field repeated string response_headers_to_remove = 75415761; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResponseHeadersToRemove($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->response_headers_to_remove = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpHeaderMatch.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpHeaderMatch.php new file mode 100644 index 000000000000..76137301c6a5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpHeaderMatch.php @@ -0,0 +1,385 @@ +google.cloud.compute.v1.HttpHeaderMatch + */ +class HttpHeaderMatch extends \Google\Protobuf\Internal\Message +{ + /** + * The value should exactly match contents of exactMatch. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + * + * Generated from protobuf field optional string exact_match = 457641093; + */ + protected $exact_match = null; + /** + * The name of the HTTP header to match. For matching against the HTTP request's authority, use a headerMatch with the header name ":authority". For matching a request's method, use the headerName ":method". When the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true, only non-binary user-specified custom metadata and the `content-type` header are supported. The following transport-level headers cannot be used in header matching rules: `:authority`, `:method`, `:path`, `:scheme`, `user-agent`, `accept-encoding`, `content-encoding`, `grpc-accept-encoding`, `grpc-encoding`, `grpc-previous-rpc-attempts`, `grpc-tags-bin`, `grpc-timeout` and `grpc-trace-bin`. + * + * Generated from protobuf field optional string header_name = 110223613; + */ + protected $header_name = null; + /** + * If set to false, the headerMatch is considered a match if the preceding match criteria are met. If set to true, the headerMatch is considered a match if the preceding match criteria are NOT met. The default setting is false. + * + * Generated from protobuf field optional bool invert_match = 501130268; + */ + protected $invert_match = null; + /** + * The value of the header must start with the contents of prefixMatch. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + * + * Generated from protobuf field optional string prefix_match = 257898968; + */ + protected $prefix_match = null; + /** + * A header with the contents of headerName must exist. The match takes place whether or not the request's header has a value. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + * + * Generated from protobuf field optional bool present_match = 67435841; + */ + protected $present_match = null; + /** + * The header value must be an integer and its value must be in the range specified in rangeMatch. If the header does not contain an integer, number or is empty, the match fails. For example for a range [-5, 0] - -3 will match. - 0 will not match. - 0.25 will not match. - -3someString will not match. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. rangeMatch is not supported for load balancers that have loadBalancingScheme set to EXTERNAL. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Int64RangeMatch range_match = 97244227; + */ + protected $range_match = null; + /** + * The value of the header must match the regular expression specified in regexMatch. For more information about regular expression syntax, see Syntax. For matching against a port specified in the HTTP request, use a headerMatch with headerName set to PORT and a regular expression that satisfies the RFC2616 Host header's port specifier. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field optional string regex_match = 107387853; + */ + protected $regex_match = null; + /** + * The value of the header must end with the contents of suffixMatch. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + * + * Generated from protobuf field optional string suffix_match = 426488663; + */ + protected $suffix_match = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $exact_match + * The value should exactly match contents of exactMatch. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + * @type string $header_name + * The name of the HTTP header to match. For matching against the HTTP request's authority, use a headerMatch with the header name ":authority". For matching a request's method, use the headerName ":method". When the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true, only non-binary user-specified custom metadata and the `content-type` header are supported. The following transport-level headers cannot be used in header matching rules: `:authority`, `:method`, `:path`, `:scheme`, `user-agent`, `accept-encoding`, `content-encoding`, `grpc-accept-encoding`, `grpc-encoding`, `grpc-previous-rpc-attempts`, `grpc-tags-bin`, `grpc-timeout` and `grpc-trace-bin`. + * @type bool $invert_match + * If set to false, the headerMatch is considered a match if the preceding match criteria are met. If set to true, the headerMatch is considered a match if the preceding match criteria are NOT met. The default setting is false. + * @type string $prefix_match + * The value of the header must start with the contents of prefixMatch. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + * @type bool $present_match + * A header with the contents of headerName must exist. The match takes place whether or not the request's header has a value. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + * @type \Google\Cloud\Compute\V1\Int64RangeMatch $range_match + * The header value must be an integer and its value must be in the range specified in rangeMatch. If the header does not contain an integer, number or is empty, the match fails. For example for a range [-5, 0] - -3 will match. - 0 will not match. - 0.25 will not match. - -3someString will not match. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. rangeMatch is not supported for load balancers that have loadBalancingScheme set to EXTERNAL. + * @type string $regex_match + * The value of the header must match the regular expression specified in regexMatch. For more information about regular expression syntax, see Syntax. For matching against a port specified in the HTTP request, use a headerMatch with headerName set to PORT and a regular expression that satisfies the RFC2616 Host header's port specifier. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED. + * @type string $suffix_match + * The value of the header must end with the contents of suffixMatch. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The value should exactly match contents of exactMatch. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + * + * Generated from protobuf field optional string exact_match = 457641093; + * @return string + */ + public function getExactMatch() + { + return isset($this->exact_match) ? $this->exact_match : ''; + } + + public function hasExactMatch() + { + return isset($this->exact_match); + } + + public function clearExactMatch() + { + unset($this->exact_match); + } + + /** + * The value should exactly match contents of exactMatch. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + * + * Generated from protobuf field optional string exact_match = 457641093; + * @param string $var + * @return $this + */ + public function setExactMatch($var) + { + GPBUtil::checkString($var, True); + $this->exact_match = $var; + + return $this; + } + + /** + * The name of the HTTP header to match. For matching against the HTTP request's authority, use a headerMatch with the header name ":authority". For matching a request's method, use the headerName ":method". When the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true, only non-binary user-specified custom metadata and the `content-type` header are supported. The following transport-level headers cannot be used in header matching rules: `:authority`, `:method`, `:path`, `:scheme`, `user-agent`, `accept-encoding`, `content-encoding`, `grpc-accept-encoding`, `grpc-encoding`, `grpc-previous-rpc-attempts`, `grpc-tags-bin`, `grpc-timeout` and `grpc-trace-bin`. + * + * Generated from protobuf field optional string header_name = 110223613; + * @return string + */ + public function getHeaderName() + { + return isset($this->header_name) ? $this->header_name : ''; + } + + public function hasHeaderName() + { + return isset($this->header_name); + } + + public function clearHeaderName() + { + unset($this->header_name); + } + + /** + * The name of the HTTP header to match. For matching against the HTTP request's authority, use a headerMatch with the header name ":authority". For matching a request's method, use the headerName ":method". When the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true, only non-binary user-specified custom metadata and the `content-type` header are supported. The following transport-level headers cannot be used in header matching rules: `:authority`, `:method`, `:path`, `:scheme`, `user-agent`, `accept-encoding`, `content-encoding`, `grpc-accept-encoding`, `grpc-encoding`, `grpc-previous-rpc-attempts`, `grpc-tags-bin`, `grpc-timeout` and `grpc-trace-bin`. + * + * Generated from protobuf field optional string header_name = 110223613; + * @param string $var + * @return $this + */ + public function setHeaderName($var) + { + GPBUtil::checkString($var, True); + $this->header_name = $var; + + return $this; + } + + /** + * If set to false, the headerMatch is considered a match if the preceding match criteria are met. If set to true, the headerMatch is considered a match if the preceding match criteria are NOT met. The default setting is false. + * + * Generated from protobuf field optional bool invert_match = 501130268; + * @return bool + */ + public function getInvertMatch() + { + return isset($this->invert_match) ? $this->invert_match : false; + } + + public function hasInvertMatch() + { + return isset($this->invert_match); + } + + public function clearInvertMatch() + { + unset($this->invert_match); + } + + /** + * If set to false, the headerMatch is considered a match if the preceding match criteria are met. If set to true, the headerMatch is considered a match if the preceding match criteria are NOT met. The default setting is false. + * + * Generated from protobuf field optional bool invert_match = 501130268; + * @param bool $var + * @return $this + */ + public function setInvertMatch($var) + { + GPBUtil::checkBool($var); + $this->invert_match = $var; + + return $this; + } + + /** + * The value of the header must start with the contents of prefixMatch. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + * + * Generated from protobuf field optional string prefix_match = 257898968; + * @return string + */ + public function getPrefixMatch() + { + return isset($this->prefix_match) ? $this->prefix_match : ''; + } + + public function hasPrefixMatch() + { + return isset($this->prefix_match); + } + + public function clearPrefixMatch() + { + unset($this->prefix_match); + } + + /** + * The value of the header must start with the contents of prefixMatch. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + * + * Generated from protobuf field optional string prefix_match = 257898968; + * @param string $var + * @return $this + */ + public function setPrefixMatch($var) + { + GPBUtil::checkString($var, True); + $this->prefix_match = $var; + + return $this; + } + + /** + * A header with the contents of headerName must exist. The match takes place whether or not the request's header has a value. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + * + * Generated from protobuf field optional bool present_match = 67435841; + * @return bool + */ + public function getPresentMatch() + { + return isset($this->present_match) ? $this->present_match : false; + } + + public function hasPresentMatch() + { + return isset($this->present_match); + } + + public function clearPresentMatch() + { + unset($this->present_match); + } + + /** + * A header with the contents of headerName must exist. The match takes place whether or not the request's header has a value. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + * + * Generated from protobuf field optional bool present_match = 67435841; + * @param bool $var + * @return $this + */ + public function setPresentMatch($var) + { + GPBUtil::checkBool($var); + $this->present_match = $var; + + return $this; + } + + /** + * The header value must be an integer and its value must be in the range specified in rangeMatch. If the header does not contain an integer, number or is empty, the match fails. For example for a range [-5, 0] - -3 will match. - 0 will not match. - 0.25 will not match. - -3someString will not match. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. rangeMatch is not supported for load balancers that have loadBalancingScheme set to EXTERNAL. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Int64RangeMatch range_match = 97244227; + * @return \Google\Cloud\Compute\V1\Int64RangeMatch|null + */ + public function getRangeMatch() + { + return $this->range_match; + } + + public function hasRangeMatch() + { + return isset($this->range_match); + } + + public function clearRangeMatch() + { + unset($this->range_match); + } + + /** + * The header value must be an integer and its value must be in the range specified in rangeMatch. If the header does not contain an integer, number or is empty, the match fails. For example for a range [-5, 0] - -3 will match. - 0 will not match. - 0.25 will not match. - -3someString will not match. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. rangeMatch is not supported for load balancers that have loadBalancingScheme set to EXTERNAL. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Int64RangeMatch range_match = 97244227; + * @param \Google\Cloud\Compute\V1\Int64RangeMatch $var + * @return $this + */ + public function setRangeMatch($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Int64RangeMatch::class); + $this->range_match = $var; + + return $this; + } + + /** + * The value of the header must match the regular expression specified in regexMatch. For more information about regular expression syntax, see Syntax. For matching against a port specified in the HTTP request, use a headerMatch with headerName set to PORT and a regular expression that satisfies the RFC2616 Host header's port specifier. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field optional string regex_match = 107387853; + * @return string + */ + public function getRegexMatch() + { + return isset($this->regex_match) ? $this->regex_match : ''; + } + + public function hasRegexMatch() + { + return isset($this->regex_match); + } + + public function clearRegexMatch() + { + unset($this->regex_match); + } + + /** + * The value of the header must match the regular expression specified in regexMatch. For more information about regular expression syntax, see Syntax. For matching against a port specified in the HTTP request, use a headerMatch with headerName set to PORT and a regular expression that satisfies the RFC2616 Host header's port specifier. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field optional string regex_match = 107387853; + * @param string $var + * @return $this + */ + public function setRegexMatch($var) + { + GPBUtil::checkString($var, True); + $this->regex_match = $var; + + return $this; + } + + /** + * The value of the header must end with the contents of suffixMatch. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + * + * Generated from protobuf field optional string suffix_match = 426488663; + * @return string + */ + public function getSuffixMatch() + { + return isset($this->suffix_match) ? $this->suffix_match : ''; + } + + public function hasSuffixMatch() + { + return isset($this->suffix_match); + } + + public function clearSuffixMatch() + { + unset($this->suffix_match); + } + + /** + * The value of the header must end with the contents of suffixMatch. Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + * + * Generated from protobuf field optional string suffix_match = 426488663; + * @param string $var + * @return $this + */ + public function setSuffixMatch($var) + { + GPBUtil::checkString($var, True); + $this->suffix_match = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpHeaderOption.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpHeaderOption.php new file mode 100644 index 000000000000..d8f3e1bbba90 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpHeaderOption.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.HttpHeaderOption + */ +class HttpHeaderOption extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the header. + * + * Generated from protobuf field optional string header_name = 110223613; + */ + protected $header_name = null; + /** + * The value of the header to add. + * + * Generated from protobuf field optional string header_value = 203094335; + */ + protected $header_value = null; + /** + * If false, headerValue is appended to any values that already exist for the header. If true, headerValue is set for the header, discarding any values that were set for that header. The default value is false. + * + * Generated from protobuf field optional bool replace = 20755124; + */ + protected $replace = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $header_name + * The name of the header. + * @type string $header_value + * The value of the header to add. + * @type bool $replace + * If false, headerValue is appended to any values that already exist for the header. If true, headerValue is set for the header, discarding any values that were set for that header. The default value is false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the header. + * + * Generated from protobuf field optional string header_name = 110223613; + * @return string + */ + public function getHeaderName() + { + return isset($this->header_name) ? $this->header_name : ''; + } + + public function hasHeaderName() + { + return isset($this->header_name); + } + + public function clearHeaderName() + { + unset($this->header_name); + } + + /** + * The name of the header. + * + * Generated from protobuf field optional string header_name = 110223613; + * @param string $var + * @return $this + */ + public function setHeaderName($var) + { + GPBUtil::checkString($var, True); + $this->header_name = $var; + + return $this; + } + + /** + * The value of the header to add. + * + * Generated from protobuf field optional string header_value = 203094335; + * @return string + */ + public function getHeaderValue() + { + return isset($this->header_value) ? $this->header_value : ''; + } + + public function hasHeaderValue() + { + return isset($this->header_value); + } + + public function clearHeaderValue() + { + unset($this->header_value); + } + + /** + * The value of the header to add. + * + * Generated from protobuf field optional string header_value = 203094335; + * @param string $var + * @return $this + */ + public function setHeaderValue($var) + { + GPBUtil::checkString($var, True); + $this->header_value = $var; + + return $this; + } + + /** + * If false, headerValue is appended to any values that already exist for the header. If true, headerValue is set for the header, discarding any values that were set for that header. The default value is false. + * + * Generated from protobuf field optional bool replace = 20755124; + * @return bool + */ + public function getReplace() + { + return isset($this->replace) ? $this->replace : false; + } + + public function hasReplace() + { + return isset($this->replace); + } + + public function clearReplace() + { + unset($this->replace); + } + + /** + * If false, headerValue is appended to any values that already exist for the header. If true, headerValue is set for the header, discarding any values that were set for that header. The default value is false. + * + * Generated from protobuf field optional bool replace = 20755124; + * @param bool $var + * @return $this + */ + public function setReplace($var) + { + GPBUtil::checkBool($var); + $this->replace = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpQueryParameterMatch.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpQueryParameterMatch.php new file mode 100644 index 000000000000..fceb57f346e3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpQueryParameterMatch.php @@ -0,0 +1,209 @@ +google.cloud.compute.v1.HttpQueryParameterMatch + */ +class HttpQueryParameterMatch extends \Google\Protobuf\Internal\Message +{ + /** + * The queryParameterMatch matches if the value of the parameter exactly matches the contents of exactMatch. Only one of presentMatch, exactMatch, or regexMatch must be set. + * + * Generated from protobuf field optional string exact_match = 457641093; + */ + protected $exact_match = null; + /** + * The name of the query parameter to match. The query parameter must exist in the request, in the absence of which the request match fails. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Specifies that the queryParameterMatch matches if the request contains the query parameter, irrespective of whether the parameter has a value or not. Only one of presentMatch, exactMatch, or regexMatch must be set. + * + * Generated from protobuf field optional bool present_match = 67435841; + */ + protected $present_match = null; + /** + * The queryParameterMatch matches if the value of the parameter matches the regular expression specified by regexMatch. For more information about regular expression syntax, see Syntax. Only one of presentMatch, exactMatch, or regexMatch must be set. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field optional string regex_match = 107387853; + */ + protected $regex_match = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $exact_match + * The queryParameterMatch matches if the value of the parameter exactly matches the contents of exactMatch. Only one of presentMatch, exactMatch, or regexMatch must be set. + * @type string $name + * The name of the query parameter to match. The query parameter must exist in the request, in the absence of which the request match fails. + * @type bool $present_match + * Specifies that the queryParameterMatch matches if the request contains the query parameter, irrespective of whether the parameter has a value or not. Only one of presentMatch, exactMatch, or regexMatch must be set. + * @type string $regex_match + * The queryParameterMatch matches if the value of the parameter matches the regular expression specified by regexMatch. For more information about regular expression syntax, see Syntax. Only one of presentMatch, exactMatch, or regexMatch must be set. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The queryParameterMatch matches if the value of the parameter exactly matches the contents of exactMatch. Only one of presentMatch, exactMatch, or regexMatch must be set. + * + * Generated from protobuf field optional string exact_match = 457641093; + * @return string + */ + public function getExactMatch() + { + return isset($this->exact_match) ? $this->exact_match : ''; + } + + public function hasExactMatch() + { + return isset($this->exact_match); + } + + public function clearExactMatch() + { + unset($this->exact_match); + } + + /** + * The queryParameterMatch matches if the value of the parameter exactly matches the contents of exactMatch. Only one of presentMatch, exactMatch, or regexMatch must be set. + * + * Generated from protobuf field optional string exact_match = 457641093; + * @param string $var + * @return $this + */ + public function setExactMatch($var) + { + GPBUtil::checkString($var, True); + $this->exact_match = $var; + + return $this; + } + + /** + * The name of the query parameter to match. The query parameter must exist in the request, in the absence of which the request match fails. + * + * 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 of the query parameter to match. The query parameter must exist in the request, in the absence of which the request match fails. + * + * 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; + } + + /** + * Specifies that the queryParameterMatch matches if the request contains the query parameter, irrespective of whether the parameter has a value or not. Only one of presentMatch, exactMatch, or regexMatch must be set. + * + * Generated from protobuf field optional bool present_match = 67435841; + * @return bool + */ + public function getPresentMatch() + { + return isset($this->present_match) ? $this->present_match : false; + } + + public function hasPresentMatch() + { + return isset($this->present_match); + } + + public function clearPresentMatch() + { + unset($this->present_match); + } + + /** + * Specifies that the queryParameterMatch matches if the request contains the query parameter, irrespective of whether the parameter has a value or not. Only one of presentMatch, exactMatch, or regexMatch must be set. + * + * Generated from protobuf field optional bool present_match = 67435841; + * @param bool $var + * @return $this + */ + public function setPresentMatch($var) + { + GPBUtil::checkBool($var); + $this->present_match = $var; + + return $this; + } + + /** + * The queryParameterMatch matches if the value of the parameter matches the regular expression specified by regexMatch. For more information about regular expression syntax, see Syntax. Only one of presentMatch, exactMatch, or regexMatch must be set. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field optional string regex_match = 107387853; + * @return string + */ + public function getRegexMatch() + { + return isset($this->regex_match) ? $this->regex_match : ''; + } + + public function hasRegexMatch() + { + return isset($this->regex_match); + } + + public function clearRegexMatch() + { + unset($this->regex_match); + } + + /** + * The queryParameterMatch matches if the value of the parameter matches the regular expression specified by regexMatch. For more information about regular expression syntax, see Syntax. Only one of presentMatch, exactMatch, or regexMatch must be set. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field optional string regex_match = 107387853; + * @param string $var + * @return $this + */ + public function setRegexMatch($var) + { + GPBUtil::checkString($var, True); + $this->regex_match = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRedirectAction.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRedirectAction.php new file mode 100644 index 000000000000..4f261e689719 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRedirectAction.php @@ -0,0 +1,301 @@ +google.cloud.compute.v1.HttpRedirectAction + */ +class HttpRedirectAction extends \Google\Protobuf\Internal\Message +{ + /** + * The host that is used in the redirect response instead of the one that was supplied in the request. The value must be from 1 to 255 characters. + * + * Generated from protobuf field optional string host_redirect = 107417747; + */ + protected $host_redirect = null; + /** + * If set to true, the URL scheme in the redirected request is set to HTTPS. If set to false, the URL scheme of the redirected request remains the same as that of the request. This must only be set for URL maps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. The default is set to false. + * + * Generated from protobuf field optional bool https_redirect = 170260656; + */ + protected $https_redirect = null; + /** + * The path that is used in the redirect response instead of the one that was supplied in the request. pathRedirect cannot be supplied together with prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the original request is used for the redirect. The value must be from 1 to 1024 characters. + * + * Generated from protobuf field optional string path_redirect = 272342710; + */ + protected $path_redirect = null; + /** + * The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or neither. If neither is supplied, the path of the original request is used for the redirect. The value must be from 1 to 1024 characters. + * + * Generated from protobuf field optional string prefix_redirect = 446184169; + */ + protected $prefix_redirect = null; + /** + * The HTTP Status code to use for this RedirectAction. Supported values are: - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds to 301. - FOUND, which corresponds to 302. - SEE_OTHER which corresponds to 303. - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request method is retained. - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method is retained. + * Check the RedirectResponseCode enum for the list of possible values. + * + * Generated from protobuf field optional string redirect_response_code = 436710408; + */ + protected $redirect_response_code = null; + /** + * If set to true, any accompanying query portion of the original URL is removed before redirecting the request. If set to false, the query portion of the original URL is retained. The default is set to false. + * + * Generated from protobuf field optional bool strip_query = 52284641; + */ + protected $strip_query = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $host_redirect + * The host that is used in the redirect response instead of the one that was supplied in the request. The value must be from 1 to 255 characters. + * @type bool $https_redirect + * If set to true, the URL scheme in the redirected request is set to HTTPS. If set to false, the URL scheme of the redirected request remains the same as that of the request. This must only be set for URL maps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. The default is set to false. + * @type string $path_redirect + * The path that is used in the redirect response instead of the one that was supplied in the request. pathRedirect cannot be supplied together with prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the original request is used for the redirect. The value must be from 1 to 1024 characters. + * @type string $prefix_redirect + * The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or neither. If neither is supplied, the path of the original request is used for the redirect. The value must be from 1 to 1024 characters. + * @type string $redirect_response_code + * The HTTP Status code to use for this RedirectAction. Supported values are: - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds to 301. - FOUND, which corresponds to 302. - SEE_OTHER which corresponds to 303. - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request method is retained. - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method is retained. + * Check the RedirectResponseCode enum for the list of possible values. + * @type bool $strip_query + * If set to true, any accompanying query portion of the original URL is removed before redirecting the request. If set to false, the query portion of the original URL is retained. The default is set to false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The host that is used in the redirect response instead of the one that was supplied in the request. The value must be from 1 to 255 characters. + * + * Generated from protobuf field optional string host_redirect = 107417747; + * @return string + */ + public function getHostRedirect() + { + return isset($this->host_redirect) ? $this->host_redirect : ''; + } + + public function hasHostRedirect() + { + return isset($this->host_redirect); + } + + public function clearHostRedirect() + { + unset($this->host_redirect); + } + + /** + * The host that is used in the redirect response instead of the one that was supplied in the request. The value must be from 1 to 255 characters. + * + * Generated from protobuf field optional string host_redirect = 107417747; + * @param string $var + * @return $this + */ + public function setHostRedirect($var) + { + GPBUtil::checkString($var, True); + $this->host_redirect = $var; + + return $this; + } + + /** + * If set to true, the URL scheme in the redirected request is set to HTTPS. If set to false, the URL scheme of the redirected request remains the same as that of the request. This must only be set for URL maps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. The default is set to false. + * + * Generated from protobuf field optional bool https_redirect = 170260656; + * @return bool + */ + public function getHttpsRedirect() + { + return isset($this->https_redirect) ? $this->https_redirect : false; + } + + public function hasHttpsRedirect() + { + return isset($this->https_redirect); + } + + public function clearHttpsRedirect() + { + unset($this->https_redirect); + } + + /** + * If set to true, the URL scheme in the redirected request is set to HTTPS. If set to false, the URL scheme of the redirected request remains the same as that of the request. This must only be set for URL maps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. The default is set to false. + * + * Generated from protobuf field optional bool https_redirect = 170260656; + * @param bool $var + * @return $this + */ + public function setHttpsRedirect($var) + { + GPBUtil::checkBool($var); + $this->https_redirect = $var; + + return $this; + } + + /** + * The path that is used in the redirect response instead of the one that was supplied in the request. pathRedirect cannot be supplied together with prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the original request is used for the redirect. The value must be from 1 to 1024 characters. + * + * Generated from protobuf field optional string path_redirect = 272342710; + * @return string + */ + public function getPathRedirect() + { + return isset($this->path_redirect) ? $this->path_redirect : ''; + } + + public function hasPathRedirect() + { + return isset($this->path_redirect); + } + + public function clearPathRedirect() + { + unset($this->path_redirect); + } + + /** + * The path that is used in the redirect response instead of the one that was supplied in the request. pathRedirect cannot be supplied together with prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the original request is used for the redirect. The value must be from 1 to 1024 characters. + * + * Generated from protobuf field optional string path_redirect = 272342710; + * @param string $var + * @return $this + */ + public function setPathRedirect($var) + { + GPBUtil::checkString($var, True); + $this->path_redirect = $var; + + return $this; + } + + /** + * The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or neither. If neither is supplied, the path of the original request is used for the redirect. The value must be from 1 to 1024 characters. + * + * Generated from protobuf field optional string prefix_redirect = 446184169; + * @return string + */ + public function getPrefixRedirect() + { + return isset($this->prefix_redirect) ? $this->prefix_redirect : ''; + } + + public function hasPrefixRedirect() + { + return isset($this->prefix_redirect); + } + + public function clearPrefixRedirect() + { + unset($this->prefix_redirect); + } + + /** + * The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or neither. If neither is supplied, the path of the original request is used for the redirect. The value must be from 1 to 1024 characters. + * + * Generated from protobuf field optional string prefix_redirect = 446184169; + * @param string $var + * @return $this + */ + public function setPrefixRedirect($var) + { + GPBUtil::checkString($var, True); + $this->prefix_redirect = $var; + + return $this; + } + + /** + * The HTTP Status code to use for this RedirectAction. Supported values are: - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds to 301. - FOUND, which corresponds to 302. - SEE_OTHER which corresponds to 303. - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request method is retained. - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method is retained. + * Check the RedirectResponseCode enum for the list of possible values. + * + * Generated from protobuf field optional string redirect_response_code = 436710408; + * @return string + */ + public function getRedirectResponseCode() + { + return isset($this->redirect_response_code) ? $this->redirect_response_code : ''; + } + + public function hasRedirectResponseCode() + { + return isset($this->redirect_response_code); + } + + public function clearRedirectResponseCode() + { + unset($this->redirect_response_code); + } + + /** + * The HTTP Status code to use for this RedirectAction. Supported values are: - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds to 301. - FOUND, which corresponds to 302. - SEE_OTHER which corresponds to 303. - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request method is retained. - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method is retained. + * Check the RedirectResponseCode enum for the list of possible values. + * + * Generated from protobuf field optional string redirect_response_code = 436710408; + * @param string $var + * @return $this + */ + public function setRedirectResponseCode($var) + { + GPBUtil::checkString($var, True); + $this->redirect_response_code = $var; + + return $this; + } + + /** + * If set to true, any accompanying query portion of the original URL is removed before redirecting the request. If set to false, the query portion of the original URL is retained. The default is set to false. + * + * Generated from protobuf field optional bool strip_query = 52284641; + * @return bool + */ + public function getStripQuery() + { + return isset($this->strip_query) ? $this->strip_query : false; + } + + public function hasStripQuery() + { + return isset($this->strip_query); + } + + public function clearStripQuery() + { + unset($this->strip_query); + } + + /** + * If set to true, any accompanying query portion of the original URL is removed before redirecting the request. If set to false, the query portion of the original URL is retained. The default is set to false. + * + * Generated from protobuf field optional bool strip_query = 52284641; + * @param bool $var + * @return $this + */ + public function setStripQuery($var) + { + GPBUtil::checkBool($var); + $this->strip_query = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRedirectAction/RedirectResponseCode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRedirectAction/RedirectResponseCode.php new file mode 100644 index 000000000000..b696a0fa6790 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRedirectAction/RedirectResponseCode.php @@ -0,0 +1,85 @@ +google.cloud.compute.v1.HttpRedirectAction.RedirectResponseCode + */ +class RedirectResponseCode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_REDIRECT_RESPONSE_CODE = 0; + */ + const UNDEFINED_REDIRECT_RESPONSE_CODE = 0; + /** + * Http Status Code 302 - Found. + * + * Generated from protobuf enum FOUND = 67084130; + */ + const FOUND = 67084130; + /** + * Http Status Code 301 - Moved Permanently. + * + * Generated from protobuf enum MOVED_PERMANENTLY_DEFAULT = 386698449; + */ + const MOVED_PERMANENTLY_DEFAULT = 386698449; + /** + * Http Status Code 308 - Permanent Redirect maintaining HTTP method. + * + * Generated from protobuf enum PERMANENT_REDIRECT = 382006381; + */ + const PERMANENT_REDIRECT = 382006381; + /** + * Http Status Code 303 - See Other. + * + * Generated from protobuf enum SEE_OTHER = 445380580; + */ + const SEE_OTHER = 445380580; + /** + * Http Status Code 307 - Temporary Redirect maintaining HTTP method. + * + * Generated from protobuf enum TEMPORARY_REDIRECT = 489550378; + */ + const TEMPORARY_REDIRECT = 489550378; + + private static $valueToName = [ + self::UNDEFINED_REDIRECT_RESPONSE_CODE => 'UNDEFINED_REDIRECT_RESPONSE_CODE', + self::FOUND => 'FOUND', + self::MOVED_PERMANENTLY_DEFAULT => 'MOVED_PERMANENTLY_DEFAULT', + self::PERMANENT_REDIRECT => 'PERMANENT_REDIRECT', + self::SEE_OTHER => 'SEE_OTHER', + self::TEMPORARY_REDIRECT => 'TEMPORARY_REDIRECT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RedirectResponseCode::class, \Google\Cloud\Compute\V1\HttpRedirectAction_RedirectResponseCode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRetryPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRetryPolicy.php new file mode 100644 index 000000000000..6123dfd10935 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRetryPolicy.php @@ -0,0 +1,155 @@ +google.cloud.compute.v1.HttpRetryPolicy + */ +class HttpRetryPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies the allowed number retries. This number must be > 0. If not specified, defaults to 1. + * + * Generated from protobuf field optional uint32 num_retries = 251680141; + */ + protected $num_retries = null; + /** + * Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147; + */ + protected $per_try_timeout = null; + /** + * Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable + * + * Generated from protobuf field repeated string retry_conditions = 28815535; + */ + private $retry_conditions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $num_retries + * Specifies the allowed number retries. This number must be > 0. If not specified, defaults to 1. + * @type \Google\Cloud\Compute\V1\Duration $per_try_timeout + * Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * @type array|\Google\Protobuf\Internal\RepeatedField $retry_conditions + * Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies the allowed number retries. This number must be > 0. If not specified, defaults to 1. + * + * Generated from protobuf field optional uint32 num_retries = 251680141; + * @return int + */ + public function getNumRetries() + { + return isset($this->num_retries) ? $this->num_retries : 0; + } + + public function hasNumRetries() + { + return isset($this->num_retries); + } + + public function clearNumRetries() + { + unset($this->num_retries); + } + + /** + * Specifies the allowed number retries. This number must be > 0. If not specified, defaults to 1. + * + * Generated from protobuf field optional uint32 num_retries = 251680141; + * @param int $var + * @return $this + */ + public function setNumRetries($var) + { + GPBUtil::checkUint32($var); + $this->num_retries = $var; + + return $this; + } + + /** + * Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147; + * @return \Google\Cloud\Compute\V1\Duration|null + */ + public function getPerTryTimeout() + { + return $this->per_try_timeout; + } + + public function hasPerTryTimeout() + { + return isset($this->per_try_timeout); + } + + public function clearPerTryTimeout() + { + unset($this->per_try_timeout); + } + + /** + * Specifies a non-zero timeout per retry attempt. If not specified, will use the timeout set in the HttpRouteAction field. If timeout in the HttpRouteAction field is not set, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration per_try_timeout = 280041147; + * @param \Google\Cloud\Compute\V1\Duration $var + * @return $this + */ + public function setPerTryTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Duration::class); + $this->per_try_timeout = $var; + + return $this; + } + + /** + * Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable + * + * Generated from protobuf field repeated string retry_conditions = 28815535; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRetryConditions() + { + return $this->retry_conditions; + } + + /** + * Specifies one or more conditions when this retry policy applies. Valid values are: - 5xx: retry is attempted if the instance or endpoint responds with any 5xx response code, or if the instance or endpoint does not respond at all. For example, disconnects, reset, read timeout, connection failure, and refused streams. - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. - connect-failure: a retry is attempted on failures connecting to the instance or endpoint. For example, connection timeouts. - retriable-4xx: a retry is attempted if the instance or endpoint responds with a 4xx response code. The only error that you can retry is error code 409. - refused-stream: a retry is attempted if the instance or endpoint resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. - cancelled: a retry is attempted if the gRPC status code in the response header is set to cancelled. - deadline-exceeded: a retry is attempted if the gRPC status code in the response header is set to deadline-exceeded. - internal: a retry is attempted if the gRPC status code in the response header is set to internal. - resource-exhausted: a retry is attempted if the gRPC status code in the response header is set to resource-exhausted. - unavailable: a retry is attempted if the gRPC status code in the response header is set to unavailable. Only the following codes are supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. - cancelled - deadline-exceeded - internal - resource-exhausted - unavailable + * + * Generated from protobuf field repeated string retry_conditions = 28815535; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRetryConditions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->retry_conditions = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRouteAction.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRouteAction.php new file mode 100644 index 000000000000..1ba66645ae76 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRouteAction.php @@ -0,0 +1,374 @@ +google.cloud.compute.v1.HttpRouteAction + */ +class HttpRouteAction extends \Google\Protobuf\Internal\Message +{ + /** + * The specification for allowing client-side cross-origin requests. For more information about the W3C recommendation for cross-origin resource sharing (CORS), see Fetch API Living Standard. Not supported when the URL map is bound to a target gRPC proxy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CorsPolicy cors_policy = 398943748; + */ + protected $cors_policy = null; + /** + * The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. As part of fault injection, when clients send requests to a backend service, delays can be introduced by a load balancer on a percentage of requests before sending those requests to the backend service. Similarly requests from clients can be aborted by the load balancer for a percentage of requests. timeout and retry_policy is ignored by clients that are configured with a fault_injection_policy if: 1. The traffic is generated by fault injection AND 2. The fault injection is not a delay fault injection. Fault injection is not supported with the classic Application Load Balancer . To see which load balancers support fault injection, see Load balancing: Routing and traffic management features. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpFaultInjection fault_injection_policy = 412781079; + */ + protected $fault_injection_policy = null; + /** + * Specifies the maximum duration (timeout) for streams on the selected route. Unlike the timeout field where the timeout duration starts from the time the request has been fully processed (known as *end-of-stream*), the duration in this field is computed from the beginning of the stream until the response has been processed, including all retries. A stream that does not complete in this duration is closed. If not specified, this field uses the maximum maxStreamDuration value among all backend services associated with the route. This field is only allowed if the Url map is used with backend services with loadBalancingScheme set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration max_stream_duration = 61428376; + */ + protected $max_stream_duration = null; + /** + * Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. The load balancer does not wait for responses from the shadow service. Before sending traffic to the shadow service, the host / authority header is suffixed with -shadow. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.RequestMirrorPolicy request_mirror_policy = 220196866; + */ + protected $request_mirror_policy = null; + /** + * Specifies the retry policy associated with this route. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRetryPolicy retry_policy = 56799913; + */ + protected $retry_policy = null; + /** + * Specifies the timeout for the selected route. Timeout is computed from the time the request has been fully processed (known as *end-of-stream*) up until the response has been processed. Timeout includes all retries. If not specified, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration timeout = 296701281; + */ + protected $timeout = null; + /** + * The spec to modify the URL of the request, before forwarding the request to the matched service. urlRewrite is the only action supported in UrlMaps for classic Application Load Balancers. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.UrlRewrite url_rewrite = 273333948; + */ + protected $url_rewrite = null; + /** + * A list of weighted backend services to send traffic to when a route match occurs. The weights determine the fraction of traffic that flows to their corresponding backend service. If all traffic needs to go to a single backend service, there must be one weightedBackendService with weight set to a non-zero number. After a backend service is identified and before forwarding the request to the backend service, advanced routing actions such as URL rewrites and header transformations are applied depending on additional settings specified in this HttpRouteAction. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.WeightedBackendService weighted_backend_services = 337028049; + */ + private $weighted_backend_services; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\CorsPolicy $cors_policy + * The specification for allowing client-side cross-origin requests. For more information about the W3C recommendation for cross-origin resource sharing (CORS), see Fetch API Living Standard. Not supported when the URL map is bound to a target gRPC proxy. + * @type \Google\Cloud\Compute\V1\HttpFaultInjection $fault_injection_policy + * The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. As part of fault injection, when clients send requests to a backend service, delays can be introduced by a load balancer on a percentage of requests before sending those requests to the backend service. Similarly requests from clients can be aborted by the load balancer for a percentage of requests. timeout and retry_policy is ignored by clients that are configured with a fault_injection_policy if: 1. The traffic is generated by fault injection AND 2. The fault injection is not a delay fault injection. Fault injection is not supported with the classic Application Load Balancer . To see which load balancers support fault injection, see Load balancing: Routing and traffic management features. + * @type \Google\Cloud\Compute\V1\Duration $max_stream_duration + * Specifies the maximum duration (timeout) for streams on the selected route. Unlike the timeout field where the timeout duration starts from the time the request has been fully processed (known as *end-of-stream*), the duration in this field is computed from the beginning of the stream until the response has been processed, including all retries. A stream that does not complete in this duration is closed. If not specified, this field uses the maximum maxStreamDuration value among all backend services associated with the route. This field is only allowed if the Url map is used with backend services with loadBalancingScheme set to INTERNAL_SELF_MANAGED. + * @type \Google\Cloud\Compute\V1\RequestMirrorPolicy $request_mirror_policy + * Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. The load balancer does not wait for responses from the shadow service. Before sending traffic to the shadow service, the host / authority header is suffixed with -shadow. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * @type \Google\Cloud\Compute\V1\HttpRetryPolicy $retry_policy + * Specifies the retry policy associated with this route. + * @type \Google\Cloud\Compute\V1\Duration $timeout + * Specifies the timeout for the selected route. Timeout is computed from the time the request has been fully processed (known as *end-of-stream*) up until the response has been processed. Timeout includes all retries. If not specified, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * @type \Google\Cloud\Compute\V1\UrlRewrite $url_rewrite + * The spec to modify the URL of the request, before forwarding the request to the matched service. urlRewrite is the only action supported in UrlMaps for classic Application Load Balancers. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * @type array<\Google\Cloud\Compute\V1\WeightedBackendService>|\Google\Protobuf\Internal\RepeatedField $weighted_backend_services + * A list of weighted backend services to send traffic to when a route match occurs. The weights determine the fraction of traffic that flows to their corresponding backend service. If all traffic needs to go to a single backend service, there must be one weightedBackendService with weight set to a non-zero number. After a backend service is identified and before forwarding the request to the backend service, advanced routing actions such as URL rewrites and header transformations are applied depending on additional settings specified in this HttpRouteAction. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The specification for allowing client-side cross-origin requests. For more information about the W3C recommendation for cross-origin resource sharing (CORS), see Fetch API Living Standard. Not supported when the URL map is bound to a target gRPC proxy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CorsPolicy cors_policy = 398943748; + * @return \Google\Cloud\Compute\V1\CorsPolicy|null + */ + public function getCorsPolicy() + { + return $this->cors_policy; + } + + public function hasCorsPolicy() + { + return isset($this->cors_policy); + } + + public function clearCorsPolicy() + { + unset($this->cors_policy); + } + + /** + * The specification for allowing client-side cross-origin requests. For more information about the W3C recommendation for cross-origin resource sharing (CORS), see Fetch API Living Standard. Not supported when the URL map is bound to a target gRPC proxy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CorsPolicy cors_policy = 398943748; + * @param \Google\Cloud\Compute\V1\CorsPolicy $var + * @return $this + */ + public function setCorsPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CorsPolicy::class); + $this->cors_policy = $var; + + return $this; + } + + /** + * The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. As part of fault injection, when clients send requests to a backend service, delays can be introduced by a load balancer on a percentage of requests before sending those requests to the backend service. Similarly requests from clients can be aborted by the load balancer for a percentage of requests. timeout and retry_policy is ignored by clients that are configured with a fault_injection_policy if: 1. The traffic is generated by fault injection AND 2. The fault injection is not a delay fault injection. Fault injection is not supported with the classic Application Load Balancer . To see which load balancers support fault injection, see Load balancing: Routing and traffic management features. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpFaultInjection fault_injection_policy = 412781079; + * @return \Google\Cloud\Compute\V1\HttpFaultInjection|null + */ + public function getFaultInjectionPolicy() + { + return $this->fault_injection_policy; + } + + public function hasFaultInjectionPolicy() + { + return isset($this->fault_injection_policy); + } + + public function clearFaultInjectionPolicy() + { + unset($this->fault_injection_policy); + } + + /** + * The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. As part of fault injection, when clients send requests to a backend service, delays can be introduced by a load balancer on a percentage of requests before sending those requests to the backend service. Similarly requests from clients can be aborted by the load balancer for a percentage of requests. timeout and retry_policy is ignored by clients that are configured with a fault_injection_policy if: 1. The traffic is generated by fault injection AND 2. The fault injection is not a delay fault injection. Fault injection is not supported with the classic Application Load Balancer . To see which load balancers support fault injection, see Load balancing: Routing and traffic management features. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpFaultInjection fault_injection_policy = 412781079; + * @param \Google\Cloud\Compute\V1\HttpFaultInjection $var + * @return $this + */ + public function setFaultInjectionPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HttpFaultInjection::class); + $this->fault_injection_policy = $var; + + return $this; + } + + /** + * Specifies the maximum duration (timeout) for streams on the selected route. Unlike the timeout field where the timeout duration starts from the time the request has been fully processed (known as *end-of-stream*), the duration in this field is computed from the beginning of the stream until the response has been processed, including all retries. A stream that does not complete in this duration is closed. If not specified, this field uses the maximum maxStreamDuration value among all backend services associated with the route. This field is only allowed if the Url map is used with backend services with loadBalancingScheme set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration max_stream_duration = 61428376; + * @return \Google\Cloud\Compute\V1\Duration|null + */ + public function getMaxStreamDuration() + { + return $this->max_stream_duration; + } + + public function hasMaxStreamDuration() + { + return isset($this->max_stream_duration); + } + + public function clearMaxStreamDuration() + { + unset($this->max_stream_duration); + } + + /** + * Specifies the maximum duration (timeout) for streams on the selected route. Unlike the timeout field where the timeout duration starts from the time the request has been fully processed (known as *end-of-stream*), the duration in this field is computed from the beginning of the stream until the response has been processed, including all retries. A stream that does not complete in this duration is closed. If not specified, this field uses the maximum maxStreamDuration value among all backend services associated with the route. This field is only allowed if the Url map is used with backend services with loadBalancingScheme set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration max_stream_duration = 61428376; + * @param \Google\Cloud\Compute\V1\Duration $var + * @return $this + */ + public function setMaxStreamDuration($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Duration::class); + $this->max_stream_duration = $var; + + return $this; + } + + /** + * Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. The load balancer does not wait for responses from the shadow service. Before sending traffic to the shadow service, the host / authority header is suffixed with -shadow. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.RequestMirrorPolicy request_mirror_policy = 220196866; + * @return \Google\Cloud\Compute\V1\RequestMirrorPolicy|null + */ + public function getRequestMirrorPolicy() + { + return $this->request_mirror_policy; + } + + public function hasRequestMirrorPolicy() + { + return isset($this->request_mirror_policy); + } + + public function clearRequestMirrorPolicy() + { + unset($this->request_mirror_policy); + } + + /** + * Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. The load balancer does not wait for responses from the shadow service. Before sending traffic to the shadow service, the host / authority header is suffixed with -shadow. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.RequestMirrorPolicy request_mirror_policy = 220196866; + * @param \Google\Cloud\Compute\V1\RequestMirrorPolicy $var + * @return $this + */ + public function setRequestMirrorPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RequestMirrorPolicy::class); + $this->request_mirror_policy = $var; + + return $this; + } + + /** + * Specifies the retry policy associated with this route. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRetryPolicy retry_policy = 56799913; + * @return \Google\Cloud\Compute\V1\HttpRetryPolicy|null + */ + public function getRetryPolicy() + { + return $this->retry_policy; + } + + public function hasRetryPolicy() + { + return isset($this->retry_policy); + } + + public function clearRetryPolicy() + { + unset($this->retry_policy); + } + + /** + * Specifies the retry policy associated with this route. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRetryPolicy retry_policy = 56799913; + * @param \Google\Cloud\Compute\V1\HttpRetryPolicy $var + * @return $this + */ + public function setRetryPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HttpRetryPolicy::class); + $this->retry_policy = $var; + + return $this; + } + + /** + * Specifies the timeout for the selected route. Timeout is computed from the time the request has been fully processed (known as *end-of-stream*) up until the response has been processed. Timeout includes all retries. If not specified, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration timeout = 296701281; + * @return \Google\Cloud\Compute\V1\Duration|null + */ + public function getTimeout() + { + return $this->timeout; + } + + public function hasTimeout() + { + return isset($this->timeout); + } + + public function clearTimeout() + { + unset($this->timeout); + } + + /** + * Specifies the timeout for the selected route. Timeout is computed from the time the request has been fully processed (known as *end-of-stream*) up until the response has been processed. Timeout includes all retries. If not specified, this field uses the largest timeout among all backend services associated with the route. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration timeout = 296701281; + * @param \Google\Cloud\Compute\V1\Duration $var + * @return $this + */ + public function setTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Duration::class); + $this->timeout = $var; + + return $this; + } + + /** + * The spec to modify the URL of the request, before forwarding the request to the matched service. urlRewrite is the only action supported in UrlMaps for classic Application Load Balancers. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.UrlRewrite url_rewrite = 273333948; + * @return \Google\Cloud\Compute\V1\UrlRewrite|null + */ + public function getUrlRewrite() + { + return $this->url_rewrite; + } + + public function hasUrlRewrite() + { + return isset($this->url_rewrite); + } + + public function clearUrlRewrite() + { + unset($this->url_rewrite); + } + + /** + * The spec to modify the URL of the request, before forwarding the request to the matched service. urlRewrite is the only action supported in UrlMaps for classic Application Load Balancers. Not supported when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.UrlRewrite url_rewrite = 273333948; + * @param \Google\Cloud\Compute\V1\UrlRewrite $var + * @return $this + */ + public function setUrlRewrite($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\UrlRewrite::class); + $this->url_rewrite = $var; + + return $this; + } + + /** + * A list of weighted backend services to send traffic to when a route match occurs. The weights determine the fraction of traffic that flows to their corresponding backend service. If all traffic needs to go to a single backend service, there must be one weightedBackendService with weight set to a non-zero number. After a backend service is identified and before forwarding the request to the backend service, advanced routing actions such as URL rewrites and header transformations are applied depending on additional settings specified in this HttpRouteAction. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.WeightedBackendService weighted_backend_services = 337028049; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWeightedBackendServices() + { + return $this->weighted_backend_services; + } + + /** + * A list of weighted backend services to send traffic to when a route match occurs. The weights determine the fraction of traffic that flows to their corresponding backend service. If all traffic needs to go to a single backend service, there must be one weightedBackendService with weight set to a non-zero number. After a backend service is identified and before forwarding the request to the backend service, advanced routing actions such as URL rewrites and header transformations are applied depending on additional settings specified in this HttpRouteAction. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.WeightedBackendService weighted_backend_services = 337028049; + * @param array<\Google\Cloud\Compute\V1\WeightedBackendService>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWeightedBackendServices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\WeightedBackendService::class); + $this->weighted_backend_services = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRouteRule.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRouteRule.php new file mode 100644 index 000000000000..a25747414e2d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRouteRule.php @@ -0,0 +1,331 @@ +google.cloud.compute.v1.HttpRouteRule + */ +class HttpRouteRule extends \Google\Protobuf\Internal\Message +{ + /** + * The short description conveying the intent of this routeRule. The description can have a maximum length of 1024 characters. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Specifies changes to request and response headers that need to take effect for the selected backendService. The headerAction value specified here is applied before the matching pathMatchers[].headerAction and after pathMatchers[].routeRules[].routeAction.weightedBackendService.backendServiceWeightAction[].headerAction HeaderAction is not supported for load balancers that have their loadBalancingScheme set to EXTERNAL. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352; + */ + protected $header_action = null; + /** + * The list of criteria for matching attributes of a request to this routeRule. This list has OR semantics: the request matches this routeRule when any of the matchRules are satisfied. However predicates within a given matchRule have AND semantics. All predicates within a matchRule must match for the request to match the rule. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HttpRouteRuleMatch match_rules = 376200701; + */ + private $match_rules; + /** + * For routeRules within a given pathMatcher, priority determines the order in which a load balancer interprets routeRules. RouteRules are evaluated in order of priority, from the lowest to highest number. The priority of a rule decreases as its number increases (1, 2, 3, N+1). The first rule that matches the request is applied. You cannot configure two or more routeRules with the same priority. Priority for each rule must be set to a number from 0 to 2147483647 inclusive. Priority numbers can have gaps, which enable you to add or remove rules in the future without affecting the rest of the rules. For example, 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers to which you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the future without any impact on existing rules. + * + * Generated from protobuf field optional int32 priority = 445151652; + */ + protected $priority = null; + /** + * In response to a matching matchRule, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of urlRedirect, service or routeAction.weightedBackendService must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within a route rule's routeAction. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948; + */ + protected $route_action = null; + /** + * The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set. + * + * Generated from protobuf field optional string service = 373540533; + */ + protected $service = null; + /** + * When this rule is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820; + */ + protected $url_redirect = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $description + * The short description conveying the intent of this routeRule. The description can have a maximum length of 1024 characters. + * @type \Google\Cloud\Compute\V1\HttpHeaderAction $header_action + * Specifies changes to request and response headers that need to take effect for the selected backendService. The headerAction value specified here is applied before the matching pathMatchers[].headerAction and after pathMatchers[].routeRules[].routeAction.weightedBackendService.backendServiceWeightAction[].headerAction HeaderAction is not supported for load balancers that have their loadBalancingScheme set to EXTERNAL. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * @type array<\Google\Cloud\Compute\V1\HttpRouteRuleMatch>|\Google\Protobuf\Internal\RepeatedField $match_rules + * The list of criteria for matching attributes of a request to this routeRule. This list has OR semantics: the request matches this routeRule when any of the matchRules are satisfied. However predicates within a given matchRule have AND semantics. All predicates within a matchRule must match for the request to match the rule. + * @type int $priority + * For routeRules within a given pathMatcher, priority determines the order in which a load balancer interprets routeRules. RouteRules are evaluated in order of priority, from the lowest to highest number. The priority of a rule decreases as its number increases (1, 2, 3, N+1). The first rule that matches the request is applied. You cannot configure two or more routeRules with the same priority. Priority for each rule must be set to a number from 0 to 2147483647 inclusive. Priority numbers can have gaps, which enable you to add or remove rules in the future without affecting the rest of the rules. For example, 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers to which you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the future without any impact on existing rules. + * @type \Google\Cloud\Compute\V1\HttpRouteAction $route_action + * In response to a matching matchRule, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of urlRedirect, service or routeAction.weightedBackendService must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within a route rule's routeAction. + * @type string $service + * The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set. + * @type \Google\Cloud\Compute\V1\HttpRedirectAction $url_redirect + * When this rule is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The short description conveying the intent of this routeRule. The description can have a maximum length of 1024 characters. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * The short description conveying the intent of this routeRule. The description can have a maximum length of 1024 characters. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Specifies changes to request and response headers that need to take effect for the selected backendService. The headerAction value specified here is applied before the matching pathMatchers[].headerAction and after pathMatchers[].routeRules[].routeAction.weightedBackendService.backendServiceWeightAction[].headerAction HeaderAction is not supported for load balancers that have their loadBalancingScheme set to EXTERNAL. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352; + * @return \Google\Cloud\Compute\V1\HttpHeaderAction|null + */ + public function getHeaderAction() + { + return $this->header_action; + } + + public function hasHeaderAction() + { + return isset($this->header_action); + } + + public function clearHeaderAction() + { + unset($this->header_action); + } + + /** + * Specifies changes to request and response headers that need to take effect for the selected backendService. The headerAction value specified here is applied before the matching pathMatchers[].headerAction and after pathMatchers[].routeRules[].routeAction.weightedBackendService.backendServiceWeightAction[].headerAction HeaderAction is not supported for load balancers that have their loadBalancingScheme set to EXTERNAL. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352; + * @param \Google\Cloud\Compute\V1\HttpHeaderAction $var + * @return $this + */ + public function setHeaderAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HttpHeaderAction::class); + $this->header_action = $var; + + return $this; + } + + /** + * The list of criteria for matching attributes of a request to this routeRule. This list has OR semantics: the request matches this routeRule when any of the matchRules are satisfied. However predicates within a given matchRule have AND semantics. All predicates within a matchRule must match for the request to match the rule. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HttpRouteRuleMatch match_rules = 376200701; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMatchRules() + { + return $this->match_rules; + } + + /** + * The list of criteria for matching attributes of a request to this routeRule. This list has OR semantics: the request matches this routeRule when any of the matchRules are satisfied. However predicates within a given matchRule have AND semantics. All predicates within a matchRule must match for the request to match the rule. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HttpRouteRuleMatch match_rules = 376200701; + * @param array<\Google\Cloud\Compute\V1\HttpRouteRuleMatch>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMatchRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\HttpRouteRuleMatch::class); + $this->match_rules = $arr; + + return $this; + } + + /** + * For routeRules within a given pathMatcher, priority determines the order in which a load balancer interprets routeRules. RouteRules are evaluated in order of priority, from the lowest to highest number. The priority of a rule decreases as its number increases (1, 2, 3, N+1). The first rule that matches the request is applied. You cannot configure two or more routeRules with the same priority. Priority for each rule must be set to a number from 0 to 2147483647 inclusive. Priority numbers can have gaps, which enable you to add or remove rules in the future without affecting the rest of the rules. For example, 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers to which you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the future without any impact on existing rules. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @return int + */ + public function getPriority() + { + return isset($this->priority) ? $this->priority : 0; + } + + public function hasPriority() + { + return isset($this->priority); + } + + public function clearPriority() + { + unset($this->priority); + } + + /** + * For routeRules within a given pathMatcher, priority determines the order in which a load balancer interprets routeRules. RouteRules are evaluated in order of priority, from the lowest to highest number. The priority of a rule decreases as its number increases (1, 2, 3, N+1). The first rule that matches the request is applied. You cannot configure two or more routeRules with the same priority. Priority for each rule must be set to a number from 0 to 2147483647 inclusive. Priority numbers can have gaps, which enable you to add or remove rules in the future without affecting the rest of the rules. For example, 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers to which you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the future without any impact on existing rules. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt32($var); + $this->priority = $var; + + return $this; + } + + /** + * In response to a matching matchRule, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of urlRedirect, service or routeAction.weightedBackendService must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within a route rule's routeAction. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948; + * @return \Google\Cloud\Compute\V1\HttpRouteAction|null + */ + public function getRouteAction() + { + return $this->route_action; + } + + public function hasRouteAction() + { + return isset($this->route_action); + } + + public function clearRouteAction() + { + unset($this->route_action); + } + + /** + * In response to a matching matchRule, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of urlRedirect, service or routeAction.weightedBackendService must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within a route rule's routeAction. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948; + * @param \Google\Cloud\Compute\V1\HttpRouteAction $var + * @return $this + */ + public function setRouteAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HttpRouteAction::class); + $this->route_action = $var; + + return $this; + } + + /** + * The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set. + * + * Generated from protobuf field optional string service = 373540533; + * @return string + */ + public function getService() + { + return isset($this->service) ? $this->service : ''; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set. + * + * Generated from protobuf field optional string service = 373540533; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * When this rule is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820; + * @return \Google\Cloud\Compute\V1\HttpRedirectAction|null + */ + public function getUrlRedirect() + { + return $this->url_redirect; + } + + public function hasUrlRedirect() + { + return isset($this->url_redirect); + } + + public function clearUrlRedirect() + { + unset($this->url_redirect); + } + + /** + * When this rule is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820; + * @param \Google\Cloud\Compute\V1\HttpRedirectAction $var + * @return $this + */ + public function setUrlRedirect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HttpRedirectAction::class); + $this->url_redirect = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRouteRuleMatch.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRouteRuleMatch.php new file mode 100644 index 000000000000..8d8edffb284f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRouteRuleMatch.php @@ -0,0 +1,355 @@ +google.cloud.compute.v1.HttpRouteRuleMatch + */ +class HttpRouteRuleMatch extends \Google\Protobuf\Internal\Message +{ + /** + * For satisfying the matchRule condition, the path of the request must exactly match the value specified in fullPathMatch after removing any query parameters and anchor that may be part of the original URL. fullPathMatch must be from 1 to 1024 characters. Only one of prefixMatch, fullPathMatch or regexMatch must be specified. + * + * Generated from protobuf field optional string full_path_match = 214598875; + */ + protected $full_path_match = null; + /** + * Specifies a list of header match criteria, all of which must match corresponding headers in the request. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HttpHeaderMatch header_matches = 361903489; + */ + private $header_matches; + /** + * Specifies that prefixMatch and fullPathMatch matches are case sensitive. The default value is false. ignoreCase must not be used with regexMatch. Not supported when the URL map is bound to a target gRPC proxy. + * + * Generated from protobuf field optional bool ignore_case = 464324989; + */ + protected $ignore_case = null; + /** + * Opaque filter criteria used by the load balancer to restrict routing configuration to a limited set of xDS compliant clients. In their xDS requests to the load balancer, xDS clients present node metadata. When there is a match, the relevant routing configuration is made available to those proxies. For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels must match the corresponding label provided in the metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match with corresponding labels provided in the metadata. If multiple metadata filters are specified, all of them need to be satisfied in order to be considered a match. metadataFilters specified here is applied after those specified in ForwardingRule that refers to the UrlMap this HttpRouteRuleMatch belongs to. metadataFilters only applies to load balancers that have loadBalancingScheme set to INTERNAL_SELF_MANAGED. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.MetadataFilter metadata_filters = 464725739; + */ + private $metadata_filters; + /** + * If specified, the route is a pattern match expression that must match the :path header once the query string is removed. A pattern match allows you to match - The value must be between 1 and 1024 characters - The pattern must start with a leading slash ("/") - There may be no more than 5 operators in pattern Precisely one of prefix_match, full_path_match, regex_match or path_template_match must be set. + * + * Generated from protobuf field optional string path_template_match = 292348186; + */ + protected $path_template_match = null; + /** + * For satisfying the matchRule condition, the request's path must begin with the specified prefixMatch. prefixMatch must begin with a /. The value must be from 1 to 1024 characters. Only one of prefixMatch, fullPathMatch or regexMatch must be specified. + * + * Generated from protobuf field optional string prefix_match = 257898968; + */ + protected $prefix_match = null; + /** + * Specifies a list of query parameter match criteria, all of which must match corresponding query parameters in the request. Not supported when the URL map is bound to a target gRPC proxy. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HttpQueryParameterMatch query_parameter_matches = 286231270; + */ + private $query_parameter_matches; + /** + * For satisfying the matchRule condition, the path of the request must satisfy the regular expression specified in regexMatch after removing any query parameters and anchor supplied with the original URL. For more information about regular expression syntax, see Syntax. Only one of prefixMatch, fullPathMatch or regexMatch must be specified. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field optional string regex_match = 107387853; + */ + protected $regex_match = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $full_path_match + * For satisfying the matchRule condition, the path of the request must exactly match the value specified in fullPathMatch after removing any query parameters and anchor that may be part of the original URL. fullPathMatch must be from 1 to 1024 characters. Only one of prefixMatch, fullPathMatch or regexMatch must be specified. + * @type array<\Google\Cloud\Compute\V1\HttpHeaderMatch>|\Google\Protobuf\Internal\RepeatedField $header_matches + * Specifies a list of header match criteria, all of which must match corresponding headers in the request. + * @type bool $ignore_case + * Specifies that prefixMatch and fullPathMatch matches are case sensitive. The default value is false. ignoreCase must not be used with regexMatch. Not supported when the URL map is bound to a target gRPC proxy. + * @type array<\Google\Cloud\Compute\V1\MetadataFilter>|\Google\Protobuf\Internal\RepeatedField $metadata_filters + * Opaque filter criteria used by the load balancer to restrict routing configuration to a limited set of xDS compliant clients. In their xDS requests to the load balancer, xDS clients present node metadata. When there is a match, the relevant routing configuration is made available to those proxies. For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels must match the corresponding label provided in the metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match with corresponding labels provided in the metadata. If multiple metadata filters are specified, all of them need to be satisfied in order to be considered a match. metadataFilters specified here is applied after those specified in ForwardingRule that refers to the UrlMap this HttpRouteRuleMatch belongs to. metadataFilters only applies to load balancers that have loadBalancingScheme set to INTERNAL_SELF_MANAGED. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * @type string $path_template_match + * If specified, the route is a pattern match expression that must match the :path header once the query string is removed. A pattern match allows you to match - The value must be between 1 and 1024 characters - The pattern must start with a leading slash ("/") - There may be no more than 5 operators in pattern Precisely one of prefix_match, full_path_match, regex_match or path_template_match must be set. + * @type string $prefix_match + * For satisfying the matchRule condition, the request's path must begin with the specified prefixMatch. prefixMatch must begin with a /. The value must be from 1 to 1024 characters. Only one of prefixMatch, fullPathMatch or regexMatch must be specified. + * @type array<\Google\Cloud\Compute\V1\HttpQueryParameterMatch>|\Google\Protobuf\Internal\RepeatedField $query_parameter_matches + * Specifies a list of query parameter match criteria, all of which must match corresponding query parameters in the request. Not supported when the URL map is bound to a target gRPC proxy. + * @type string $regex_match + * For satisfying the matchRule condition, the path of the request must satisfy the regular expression specified in regexMatch after removing any query parameters and anchor supplied with the original URL. For more information about regular expression syntax, see Syntax. Only one of prefixMatch, fullPathMatch or regexMatch must be specified. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * For satisfying the matchRule condition, the path of the request must exactly match the value specified in fullPathMatch after removing any query parameters and anchor that may be part of the original URL. fullPathMatch must be from 1 to 1024 characters. Only one of prefixMatch, fullPathMatch or regexMatch must be specified. + * + * Generated from protobuf field optional string full_path_match = 214598875; + * @return string + */ + public function getFullPathMatch() + { + return isset($this->full_path_match) ? $this->full_path_match : ''; + } + + public function hasFullPathMatch() + { + return isset($this->full_path_match); + } + + public function clearFullPathMatch() + { + unset($this->full_path_match); + } + + /** + * For satisfying the matchRule condition, the path of the request must exactly match the value specified in fullPathMatch after removing any query parameters and anchor that may be part of the original URL. fullPathMatch must be from 1 to 1024 characters. Only one of prefixMatch, fullPathMatch or regexMatch must be specified. + * + * Generated from protobuf field optional string full_path_match = 214598875; + * @param string $var + * @return $this + */ + public function setFullPathMatch($var) + { + GPBUtil::checkString($var, True); + $this->full_path_match = $var; + + return $this; + } + + /** + * Specifies a list of header match criteria, all of which must match corresponding headers in the request. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HttpHeaderMatch header_matches = 361903489; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHeaderMatches() + { + return $this->header_matches; + } + + /** + * Specifies a list of header match criteria, all of which must match corresponding headers in the request. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HttpHeaderMatch header_matches = 361903489; + * @param array<\Google\Cloud\Compute\V1\HttpHeaderMatch>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHeaderMatches($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\HttpHeaderMatch::class); + $this->header_matches = $arr; + + return $this; + } + + /** + * Specifies that prefixMatch and fullPathMatch matches are case sensitive. The default value is false. ignoreCase must not be used with regexMatch. Not supported when the URL map is bound to a target gRPC proxy. + * + * Generated from protobuf field optional bool ignore_case = 464324989; + * @return bool + */ + public function getIgnoreCase() + { + return isset($this->ignore_case) ? $this->ignore_case : false; + } + + public function hasIgnoreCase() + { + return isset($this->ignore_case); + } + + public function clearIgnoreCase() + { + unset($this->ignore_case); + } + + /** + * Specifies that prefixMatch and fullPathMatch matches are case sensitive. The default value is false. ignoreCase must not be used with regexMatch. Not supported when the URL map is bound to a target gRPC proxy. + * + * Generated from protobuf field optional bool ignore_case = 464324989; + * @param bool $var + * @return $this + */ + public function setIgnoreCase($var) + { + GPBUtil::checkBool($var); + $this->ignore_case = $var; + + return $this; + } + + /** + * Opaque filter criteria used by the load balancer to restrict routing configuration to a limited set of xDS compliant clients. In their xDS requests to the load balancer, xDS clients present node metadata. When there is a match, the relevant routing configuration is made available to those proxies. For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels must match the corresponding label provided in the metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match with corresponding labels provided in the metadata. If multiple metadata filters are specified, all of them need to be satisfied in order to be considered a match. metadataFilters specified here is applied after those specified in ForwardingRule that refers to the UrlMap this HttpRouteRuleMatch belongs to. metadataFilters only applies to load balancers that have loadBalancingScheme set to INTERNAL_SELF_MANAGED. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.MetadataFilter metadata_filters = 464725739; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMetadataFilters() + { + return $this->metadata_filters; + } + + /** + * Opaque filter criteria used by the load balancer to restrict routing configuration to a limited set of xDS compliant clients. In their xDS requests to the load balancer, xDS clients present node metadata. When there is a match, the relevant routing configuration is made available to those proxies. For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels must match the corresponding label provided in the metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match with corresponding labels provided in the metadata. If multiple metadata filters are specified, all of them need to be satisfied in order to be considered a match. metadataFilters specified here is applied after those specified in ForwardingRule that refers to the UrlMap this HttpRouteRuleMatch belongs to. metadataFilters only applies to load balancers that have loadBalancingScheme set to INTERNAL_SELF_MANAGED. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.MetadataFilter metadata_filters = 464725739; + * @param array<\Google\Cloud\Compute\V1\MetadataFilter>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMetadataFilters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\MetadataFilter::class); + $this->metadata_filters = $arr; + + return $this; + } + + /** + * If specified, the route is a pattern match expression that must match the :path header once the query string is removed. A pattern match allows you to match - The value must be between 1 and 1024 characters - The pattern must start with a leading slash ("/") - There may be no more than 5 operators in pattern Precisely one of prefix_match, full_path_match, regex_match or path_template_match must be set. + * + * Generated from protobuf field optional string path_template_match = 292348186; + * @return string + */ + public function getPathTemplateMatch() + { + return isset($this->path_template_match) ? $this->path_template_match : ''; + } + + public function hasPathTemplateMatch() + { + return isset($this->path_template_match); + } + + public function clearPathTemplateMatch() + { + unset($this->path_template_match); + } + + /** + * If specified, the route is a pattern match expression that must match the :path header once the query string is removed. A pattern match allows you to match - The value must be between 1 and 1024 characters - The pattern must start with a leading slash ("/") - There may be no more than 5 operators in pattern Precisely one of prefix_match, full_path_match, regex_match or path_template_match must be set. + * + * Generated from protobuf field optional string path_template_match = 292348186; + * @param string $var + * @return $this + */ + public function setPathTemplateMatch($var) + { + GPBUtil::checkString($var, True); + $this->path_template_match = $var; + + return $this; + } + + /** + * For satisfying the matchRule condition, the request's path must begin with the specified prefixMatch. prefixMatch must begin with a /. The value must be from 1 to 1024 characters. Only one of prefixMatch, fullPathMatch or regexMatch must be specified. + * + * Generated from protobuf field optional string prefix_match = 257898968; + * @return string + */ + public function getPrefixMatch() + { + return isset($this->prefix_match) ? $this->prefix_match : ''; + } + + public function hasPrefixMatch() + { + return isset($this->prefix_match); + } + + public function clearPrefixMatch() + { + unset($this->prefix_match); + } + + /** + * For satisfying the matchRule condition, the request's path must begin with the specified prefixMatch. prefixMatch must begin with a /. The value must be from 1 to 1024 characters. Only one of prefixMatch, fullPathMatch or regexMatch must be specified. + * + * Generated from protobuf field optional string prefix_match = 257898968; + * @param string $var + * @return $this + */ + public function setPrefixMatch($var) + { + GPBUtil::checkString($var, True); + $this->prefix_match = $var; + + return $this; + } + + /** + * Specifies a list of query parameter match criteria, all of which must match corresponding query parameters in the request. Not supported when the URL map is bound to a target gRPC proxy. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HttpQueryParameterMatch query_parameter_matches = 286231270; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQueryParameterMatches() + { + return $this->query_parameter_matches; + } + + /** + * Specifies a list of query parameter match criteria, all of which must match corresponding query parameters in the request. Not supported when the URL map is bound to a target gRPC proxy. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HttpQueryParameterMatch query_parameter_matches = 286231270; + * @param array<\Google\Cloud\Compute\V1\HttpQueryParameterMatch>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQueryParameterMatches($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\HttpQueryParameterMatch::class); + $this->query_parameter_matches = $arr; + + return $this; + } + + /** + * For satisfying the matchRule condition, the path of the request must satisfy the regular expression specified in regexMatch after removing any query parameters and anchor supplied with the original URL. For more information about regular expression syntax, see Syntax. Only one of prefixMatch, fullPathMatch or regexMatch must be specified. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field optional string regex_match = 107387853; + * @return string + */ + public function getRegexMatch() + { + return isset($this->regex_match) ? $this->regex_match : ''; + } + + public function hasRegexMatch() + { + return isset($this->regex_match); + } + + public function clearRegexMatch() + { + unset($this->regex_match); + } + + /** + * For satisfying the matchRule condition, the path of the request must satisfy the regular expression specified in regexMatch after removing any query parameters and anchor supplied with the original URL. For more information about regular expression syntax, see Syntax. Only one of prefixMatch, fullPathMatch or regexMatch must be specified. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field optional string regex_match = 107387853; + * @param string $var + * @return $this + */ + public function setRegexMatch($var) + { + GPBUtil::checkString($var, True); + $this->regex_match = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Image.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Image.php new file mode 100644 index 000000000000..5f6898cea800 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Image.php @@ -0,0 +1,1491 @@ +google.cloud.compute.v1.Image + */ +class Image extends \Google\Protobuf\Internal\Message +{ + /** + * The architecture of the image. Valid values are ARM64 or X86_64. + * Check the Architecture enum for the list of possible values. + * + * Generated from protobuf field optional string architecture = 302803283; + */ + protected $architecture = null; + /** + * Size of the image tar.gz archive stored in Google Cloud Storage (in bytes). + * + * Generated from protobuf field optional int64 archive_size_bytes = 381093450; + */ + protected $archive_size_bytes = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * The deprecation status associated with this image. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + */ + protected $deprecated = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Size of the image when restored onto a persistent disk (in GB). + * + * Generated from protobuf field optional int64 disk_size_gb = 316263735; + */ + protected $disk_size_gb = null; + /** + * Whether this image is created from a confidential compute mode disk. [Output Only]: This field is not set by user, but from source disk. + * + * Generated from protobuf field optional bool enable_confidential_compute = 102135228; + */ + protected $enable_confidential_compute = null; + /** + * 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; + */ + protected $family = null; + /** + * 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. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545; + */ + private $guest_os_features; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * Encrypts the image using a customer-supplied encryption key. After you encrypt an image with a customer-supplied key, you must provide the same key if you use the image later (e.g. to create a disk from the image). Customer-supplied encryption keys do not protect access to metadata of the disk. If you do not provide an encryption key when creating the image, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the image later. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey image_encryption_key = 379512583; + */ + protected $image_encryption_key = null; + /** + * [Output Only] Type of the resource. Always compute#image for images. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * A fingerprint for the labels being applied to this image, which is essentially a hash of the labels 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 image. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + */ + protected $label_fingerprint = null; + /** + * Labels to apply to this image. These can be later modified by the setLabels method. + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + /** + * Integer license codes indicating which licenses are attached to this image. + * + * Generated from protobuf field repeated int64 license_codes = 45482664; + */ + private $license_codes; + /** + * Any applicable license URI. + * + * Generated from protobuf field repeated string licenses = 337642578; + */ + private $licenses; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * The parameters of the raw disk image. + * + * Generated from protobuf field optional .google.cloud.compute.v1.RawDisk raw_disk = 503113556; + */ + protected $raw_disk = null; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzi = 480964257; + */ + protected $satisfies_pzi = null; + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + */ + protected $satisfies_pzs = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * Set the secure boot keys of shielded instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InitialStateConfig shielded_instance_initial_state = 192356867; + */ + protected $shielded_instance_initial_state = null; + /** + * URL of the source disk used to create this image. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk In order to create an image, you must provide the full or partial URL of one of the following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL + * + * Generated from protobuf field optional string source_disk = 451753793; + */ + protected $source_disk = null; + /** + * The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_disk_encryption_key = 531501153; + */ + protected $source_disk_encryption_key = null; + /** + * [Output Only] The ID value of the disk used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given disk name. + * + * Generated from protobuf field optional string source_disk_id = 454190809; + */ + protected $source_disk_id = null; + /** + * URL of the source image used to create this image. The following are valid formats for the URL: - https://www.googleapis.com/compute/v1/projects/project_id/global/ images/image_name - projects/project_id/global/images/image_name In order to create an image, you must provide the full or partial URL of one of the following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL + * + * Generated from protobuf field optional string source_image = 50443319; + */ + protected $source_image = null; + /** + * The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_image_encryption_key = 381503659; + */ + protected $source_image_encryption_key = null; + /** + * [Output Only] The ID value of the image used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given image name. + * + * Generated from protobuf field optional string source_image_id = 55328291; + */ + protected $source_image_id = null; + /** + * URL of the source snapshot used to create this image. The following are valid formats for the URL: - https://www.googleapis.com/compute/v1/projects/project_id/global/ snapshots/snapshot_name - projects/project_id/global/snapshots/snapshot_name In order to create an image, you must provide the full or partial URL of one of the following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL + * + * Generated from protobuf field optional string source_snapshot = 126061928; + */ + protected $source_snapshot = null; + /** + * The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_snapshot_encryption_key = 303679322; + */ + protected $source_snapshot_encryption_key = null; + /** + * [Output Only] The ID value of the snapshot used to create this image. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given snapshot name. + * + * Generated from protobuf field optional string source_snapshot_id = 98962258; + */ + protected $source_snapshot_id = null; + /** + * The type of the image used to create this disk. The default and only valid value is RAW. + * Check the SourceType enum for the list of possible values. + * + * Generated from protobuf field optional string source_type = 452245726; + */ + protected $source_type = null; + /** + * [Output Only] The status of the image. An image can be used to create other resources, such as instances, only after the image has been successfully created and the status is set to READY. Possible values are FAILED, PENDING, or READY. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + /** + * Cloud Storage bucket storage location of the image (regional or multi-regional). + * + * Generated from protobuf field repeated string storage_locations = 328005274; + */ + private $storage_locations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $architecture + * The architecture of the image. Valid values are ARM64 or X86_64. + * Check the Architecture enum for the list of possible values. + * @type int|string $archive_size_bytes + * Size of the image tar.gz archive stored in Google Cloud Storage (in bytes). + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type \Google\Cloud\Compute\V1\DeprecationStatus $deprecated + * The deprecation status associated with this image. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type int|string $disk_size_gb + * Size of the image when restored onto a persistent disk (in GB). + * @type bool $enable_confidential_compute + * Whether this image is created from a confidential compute mode disk. [Output Only]: This field is not set by user, but from source disk. + * @type string $family + * 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 + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type \Google\Cloud\Compute\V1\CustomerEncryptionKey $image_encryption_key + * Encrypts the image using a customer-supplied encryption key. After you encrypt an image with a customer-supplied key, you must provide the same key if you use the image later (e.g. to create a disk from the image). Customer-supplied encryption keys do not protect access to metadata of the disk. If you do not provide an encryption key when creating the image, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the image later. + * @type string $kind + * [Output Only] Type of the resource. Always compute#image for images. + * @type string $label_fingerprint + * A fingerprint for the labels being applied to this image, which is essentially a hash of the labels 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 image. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels to apply to this image. These can be later modified by the setLabels method. + * @type array|array|\Google\Protobuf\Internal\RepeatedField $license_codes + * Integer license codes indicating which licenses are attached to this image. + * @type array|\Google\Protobuf\Internal\RepeatedField $licenses + * Any applicable license URI. + * @type string $name + * 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\RawDisk $raw_disk + * The parameters of the raw disk image. + * @type bool $satisfies_pzi + * Output only. Reserved for future use. + * @type bool $satisfies_pzs + * [Output Only] Reserved for future use. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type \Google\Cloud\Compute\V1\InitialStateConfig $shielded_instance_initial_state + * Set the secure boot keys of shielded instance. + * @type string $source_disk + * URL of the source disk used to create this image. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk In order to create an image, you must provide the full or partial URL of one of the following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL + * @type \Google\Cloud\Compute\V1\CustomerEncryptionKey $source_disk_encryption_key + * The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. + * @type string $source_disk_id + * [Output Only] The ID value of the disk used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given disk name. + * @type string $source_image + * URL of the source image used to create this image. The following are valid formats for the URL: - https://www.googleapis.com/compute/v1/projects/project_id/global/ images/image_name - projects/project_id/global/images/image_name In order to create an image, you must provide the full or partial URL of one of the following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL + * @type \Google\Cloud\Compute\V1\CustomerEncryptionKey $source_image_encryption_key + * The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. + * @type string $source_image_id + * [Output Only] The ID value of the image used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given image name. + * @type string $source_snapshot + * URL of the source snapshot used to create this image. The following are valid formats for the URL: - https://www.googleapis.com/compute/v1/projects/project_id/global/ snapshots/snapshot_name - projects/project_id/global/snapshots/snapshot_name In order to create an image, you must provide the full or partial URL of one of the following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL + * @type \Google\Cloud\Compute\V1\CustomerEncryptionKey $source_snapshot_encryption_key + * The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. + * @type string $source_snapshot_id + * [Output Only] The ID value of the snapshot used to create this image. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given snapshot name. + * @type string $source_type + * The type of the image used to create this disk. The default and only valid value is RAW. + * Check the SourceType enum for the list of possible values. + * @type string $status + * [Output Only] The status of the image. An image can be used to create other resources, such as instances, only after the image has been successfully created and the status is set to READY. Possible values are FAILED, PENDING, or READY. + * Check the Status enum for the list of possible values. + * @type array|\Google\Protobuf\Internal\RepeatedField $storage_locations + * Cloud Storage bucket storage location of the image (regional or multi-regional). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The architecture of the image. Valid values are ARM64 or X86_64. + * Check the Architecture enum for the list of possible values. + * + * Generated from protobuf field optional string architecture = 302803283; + * @return string + */ + public function getArchitecture() + { + return isset($this->architecture) ? $this->architecture : ''; + } + + public function hasArchitecture() + { + return isset($this->architecture); + } + + public function clearArchitecture() + { + unset($this->architecture); + } + + /** + * The architecture of the image. Valid values are ARM64 or X86_64. + * Check the Architecture enum for the list of possible values. + * + * Generated from protobuf field optional string architecture = 302803283; + * @param string $var + * @return $this + */ + public function setArchitecture($var) + { + GPBUtil::checkString($var, True); + $this->architecture = $var; + + return $this; + } + + /** + * Size of the image tar.gz archive stored in Google Cloud Storage (in bytes). + * + * Generated from protobuf field optional int64 archive_size_bytes = 381093450; + * @return int|string + */ + public function getArchiveSizeBytes() + { + return isset($this->archive_size_bytes) ? $this->archive_size_bytes : 0; + } + + public function hasArchiveSizeBytes() + { + return isset($this->archive_size_bytes); + } + + public function clearArchiveSizeBytes() + { + unset($this->archive_size_bytes); + } + + /** + * Size of the image tar.gz archive stored in Google Cloud Storage (in bytes). + * + * Generated from protobuf field optional int64 archive_size_bytes = 381093450; + * @param int|string $var + * @return $this + */ + public function setArchiveSizeBytes($var) + { + GPBUtil::checkInt64($var); + $this->archive_size_bytes = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * The deprecation status associated with this image. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + * @return \Google\Cloud\Compute\V1\DeprecationStatus|null + */ + public function getDeprecated() + { + return $this->deprecated; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * The deprecation status associated with this image. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + * @param \Google\Cloud\Compute\V1\DeprecationStatus $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DeprecationStatus::class); + $this->deprecated = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Size of the image when restored onto a persistent disk (in GB). + * + * Generated from protobuf field optional int64 disk_size_gb = 316263735; + * @return int|string + */ + public function getDiskSizeGb() + { + return isset($this->disk_size_gb) ? $this->disk_size_gb : 0; + } + + public function hasDiskSizeGb() + { + return isset($this->disk_size_gb); + } + + public function clearDiskSizeGb() + { + unset($this->disk_size_gb); + } + + /** + * Size of the image when restored onto a persistent disk (in GB). + * + * Generated from protobuf field optional int64 disk_size_gb = 316263735; + * @param int|string $var + * @return $this + */ + public function setDiskSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->disk_size_gb = $var; + + return $this; + } + + /** + * Whether this image is created from a confidential compute mode disk. [Output Only]: This field is not set by user, but from source disk. + * + * Generated from protobuf field optional bool enable_confidential_compute = 102135228; + * @return bool + */ + public function getEnableConfidentialCompute() + { + return isset($this->enable_confidential_compute) ? $this->enable_confidential_compute : false; + } + + public function hasEnableConfidentialCompute() + { + return isset($this->enable_confidential_compute); + } + + public function clearEnableConfidentialCompute() + { + unset($this->enable_confidential_compute); + } + + /** + * Whether this image is created from a confidential compute mode disk. [Output Only]: This field is not set by user, but from source disk. + * + * Generated from protobuf field optional bool enable_confidential_compute = 102135228; + * @param bool $var + * @return $this + */ + public function setEnableConfidentialCompute($var) + { + GPBUtil::checkBool($var); + $this->enable_confidential_compute = $var; + + return $this; + } + + /** + * 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 + */ + public function getFamily() + { + return isset($this->family) ? $this->family : ''; + } + + public function hasFamily() + { + return isset($this->family); + } + + public function clearFamily() + { + unset($this->family); + } + + /** + * 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 + * @return $this + */ + public function setFamily($var) + { + GPBUtil::checkString($var, True); + $this->family = $var; + + return $this; + } + + /** + * 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. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGuestOsFeatures() + { + return $this->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. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545; + * @param array<\Google\Cloud\Compute\V1\GuestOsFeature>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGuestOsFeatures($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\GuestOsFeature::class); + $this->guest_os_features = $arr; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * Encrypts the image using a customer-supplied encryption key. After you encrypt an image with a customer-supplied key, you must provide the same key if you use the image later (e.g. to create a disk from the image). Customer-supplied encryption keys do not protect access to metadata of the disk. If you do not provide an encryption key when creating the image, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the image later. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey image_encryption_key = 379512583; + * @return \Google\Cloud\Compute\V1\CustomerEncryptionKey|null + */ + public function getImageEncryptionKey() + { + return $this->image_encryption_key; + } + + public function hasImageEncryptionKey() + { + return isset($this->image_encryption_key); + } + + public function clearImageEncryptionKey() + { + unset($this->image_encryption_key); + } + + /** + * Encrypts the image using a customer-supplied encryption key. After you encrypt an image with a customer-supplied key, you must provide the same key if you use the image later (e.g. to create a disk from the image). Customer-supplied encryption keys do not protect access to metadata of the disk. If you do not provide an encryption key when creating the image, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the image later. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey image_encryption_key = 379512583; + * @param \Google\Cloud\Compute\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setImageEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomerEncryptionKey::class); + $this->image_encryption_key = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#image for images. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#image for images. + * + * 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; + } + + /** + * A fingerprint for the labels being applied to this image, which is essentially a hash of the labels 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 image. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @return string + */ + public function getLabelFingerprint() + { + return isset($this->label_fingerprint) ? $this->label_fingerprint : ''; + } + + public function hasLabelFingerprint() + { + return isset($this->label_fingerprint); + } + + public function clearLabelFingerprint() + { + unset($this->label_fingerprint); + } + + /** + * A fingerprint for the labels being applied to this image, which is essentially a hash of the labels 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 image. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @param string $var + * @return $this + */ + public function setLabelFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->label_fingerprint = $var; + + return $this; + } + + /** + * Labels to apply to this image. These can be later modified by the setLabels method. + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels to apply to this image. These can be later modified by the setLabels method. + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Integer license codes indicating which licenses are attached to this image. + * + * Generated from protobuf field repeated int64 license_codes = 45482664; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLicenseCodes() + { + return $this->license_codes; + } + + /** + * Integer license codes indicating which licenses are attached to this image. + * + * Generated from protobuf field repeated int64 license_codes = 45482664; + * @param array|array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLicenseCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT64); + $this->license_codes = $arr; + + return $this; + } + + /** + * Any applicable license URI. + * + * Generated from protobuf field repeated string licenses = 337642578; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLicenses() + { + return $this->licenses; + } + + /** + * Any applicable license URI. + * + * Generated from protobuf field repeated string licenses = 337642578; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLicenses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->licenses = $arr; + + return $this; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * The parameters of the raw disk image. + * + * Generated from protobuf field optional .google.cloud.compute.v1.RawDisk raw_disk = 503113556; + * @return \Google\Cloud\Compute\V1\RawDisk|null + */ + public function getRawDisk() + { + return $this->raw_disk; + } + + public function hasRawDisk() + { + return isset($this->raw_disk); + } + + public function clearRawDisk() + { + unset($this->raw_disk); + } + + /** + * The parameters of the raw disk image. + * + * Generated from protobuf field optional .google.cloud.compute.v1.RawDisk raw_disk = 503113556; + * @param \Google\Cloud\Compute\V1\RawDisk $var + * @return $this + */ + public function setRawDisk($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RawDisk::class); + $this->raw_disk = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzi = 480964257; + * @return bool + */ + public function getSatisfiesPzi() + { + return isset($this->satisfies_pzi) ? $this->satisfies_pzi : false; + } + + public function hasSatisfiesPzi() + { + return isset($this->satisfies_pzi); + } + + public function clearSatisfiesPzi() + { + unset($this->satisfies_pzi); + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzi = 480964257; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + * @return bool + */ + public function getSatisfiesPzs() + { + return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; + } + + public function hasSatisfiesPzs() + { + return isset($this->satisfies_pzs); + } + + public function clearSatisfiesPzs() + { + unset($this->satisfies_pzs); + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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; + } + + /** + * Set the secure boot keys of shielded instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InitialStateConfig shielded_instance_initial_state = 192356867; + * @return \Google\Cloud\Compute\V1\InitialStateConfig|null + */ + public function getShieldedInstanceInitialState() + { + return $this->shielded_instance_initial_state; + } + + public function hasShieldedInstanceInitialState() + { + return isset($this->shielded_instance_initial_state); + } + + public function clearShieldedInstanceInitialState() + { + unset($this->shielded_instance_initial_state); + } + + /** + * Set the secure boot keys of shielded instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InitialStateConfig shielded_instance_initial_state = 192356867; + * @param \Google\Cloud\Compute\V1\InitialStateConfig $var + * @return $this + */ + public function setShieldedInstanceInitialState($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InitialStateConfig::class); + $this->shielded_instance_initial_state = $var; + + return $this; + } + + /** + * URL of the source disk used to create this image. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk In order to create an image, you must provide the full or partial URL of one of the following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL + * + * Generated from protobuf field optional string source_disk = 451753793; + * @return string + */ + public function getSourceDisk() + { + return isset($this->source_disk) ? $this->source_disk : ''; + } + + public function hasSourceDisk() + { + return isset($this->source_disk); + } + + public function clearSourceDisk() + { + unset($this->source_disk); + } + + /** + * URL of the source disk used to create this image. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk In order to create an image, you must provide the full or partial URL of one of the following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL + * + * Generated from protobuf field optional string source_disk = 451753793; + * @param string $var + * @return $this + */ + public function setSourceDisk($var) + { + GPBUtil::checkString($var, True); + $this->source_disk = $var; + + return $this; + } + + /** + * The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_disk_encryption_key = 531501153; + * @return \Google\Cloud\Compute\V1\CustomerEncryptionKey|null + */ + public function getSourceDiskEncryptionKey() + { + return $this->source_disk_encryption_key; + } + + public function hasSourceDiskEncryptionKey() + { + return isset($this->source_disk_encryption_key); + } + + public function clearSourceDiskEncryptionKey() + { + unset($this->source_disk_encryption_key); + } + + /** + * The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_disk_encryption_key = 531501153; + * @param \Google\Cloud\Compute\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setSourceDiskEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomerEncryptionKey::class); + $this->source_disk_encryption_key = $var; + + return $this; + } + + /** + * [Output Only] The ID value of the disk used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given disk name. + * + * Generated from protobuf field optional string source_disk_id = 454190809; + * @return string + */ + public function getSourceDiskId() + { + return isset($this->source_disk_id) ? $this->source_disk_id : ''; + } + + public function hasSourceDiskId() + { + return isset($this->source_disk_id); + } + + public function clearSourceDiskId() + { + unset($this->source_disk_id); + } + + /** + * [Output Only] The ID value of the disk used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given disk name. + * + * Generated from protobuf field optional string source_disk_id = 454190809; + * @param string $var + * @return $this + */ + public function setSourceDiskId($var) + { + GPBUtil::checkString($var, True); + $this->source_disk_id = $var; + + return $this; + } + + /** + * URL of the source image used to create this image. The following are valid formats for the URL: - https://www.googleapis.com/compute/v1/projects/project_id/global/ images/image_name - projects/project_id/global/images/image_name In order to create an image, you must provide the full or partial URL of one of the following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL + * + * Generated from protobuf field optional string source_image = 50443319; + * @return string + */ + public function getSourceImage() + { + return isset($this->source_image) ? $this->source_image : ''; + } + + public function hasSourceImage() + { + return isset($this->source_image); + } + + public function clearSourceImage() + { + unset($this->source_image); + } + + /** + * URL of the source image used to create this image. The following are valid formats for the URL: - https://www.googleapis.com/compute/v1/projects/project_id/global/ images/image_name - projects/project_id/global/images/image_name In order to create an image, you must provide the full or partial URL of one of the following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL + * + * Generated from protobuf field optional string source_image = 50443319; + * @param string $var + * @return $this + */ + public function setSourceImage($var) + { + GPBUtil::checkString($var, True); + $this->source_image = $var; + + return $this; + } + + /** + * The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_image_encryption_key = 381503659; + * @return \Google\Cloud\Compute\V1\CustomerEncryptionKey|null + */ + public function getSourceImageEncryptionKey() + { + return $this->source_image_encryption_key; + } + + public function hasSourceImageEncryptionKey() + { + return isset($this->source_image_encryption_key); + } + + public function clearSourceImageEncryptionKey() + { + unset($this->source_image_encryption_key); + } + + /** + * The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_image_encryption_key = 381503659; + * @param \Google\Cloud\Compute\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setSourceImageEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomerEncryptionKey::class); + $this->source_image_encryption_key = $var; + + return $this; + } + + /** + * [Output Only] The ID value of the image used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given image name. + * + * Generated from protobuf field optional string source_image_id = 55328291; + * @return string + */ + public function getSourceImageId() + { + return isset($this->source_image_id) ? $this->source_image_id : ''; + } + + public function hasSourceImageId() + { + return isset($this->source_image_id); + } + + public function clearSourceImageId() + { + unset($this->source_image_id); + } + + /** + * [Output Only] The ID value of the image used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given image name. + * + * Generated from protobuf field optional string source_image_id = 55328291; + * @param string $var + * @return $this + */ + public function setSourceImageId($var) + { + GPBUtil::checkString($var, True); + $this->source_image_id = $var; + + return $this; + } + + /** + * URL of the source snapshot used to create this image. The following are valid formats for the URL: - https://www.googleapis.com/compute/v1/projects/project_id/global/ snapshots/snapshot_name - projects/project_id/global/snapshots/snapshot_name In order to create an image, you must provide the full or partial URL of one of the following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL + * + * Generated from protobuf field optional string source_snapshot = 126061928; + * @return string + */ + public function getSourceSnapshot() + { + return isset($this->source_snapshot) ? $this->source_snapshot : ''; + } + + public function hasSourceSnapshot() + { + return isset($this->source_snapshot); + } + + public function clearSourceSnapshot() + { + unset($this->source_snapshot); + } + + /** + * URL of the source snapshot used to create this image. The following are valid formats for the URL: - https://www.googleapis.com/compute/v1/projects/project_id/global/ snapshots/snapshot_name - projects/project_id/global/snapshots/snapshot_name In order to create an image, you must provide the full or partial URL of one of the following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL + * + * Generated from protobuf field optional string source_snapshot = 126061928; + * @param string $var + * @return $this + */ + public function setSourceSnapshot($var) + { + GPBUtil::checkString($var, True); + $this->source_snapshot = $var; + + return $this; + } + + /** + * The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_snapshot_encryption_key = 303679322; + * @return \Google\Cloud\Compute\V1\CustomerEncryptionKey|null + */ + public function getSourceSnapshotEncryptionKey() + { + return $this->source_snapshot_encryption_key; + } + + public function hasSourceSnapshotEncryptionKey() + { + return isset($this->source_snapshot_encryption_key); + } + + public function clearSourceSnapshotEncryptionKey() + { + unset($this->source_snapshot_encryption_key); + } + + /** + * The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_snapshot_encryption_key = 303679322; + * @param \Google\Cloud\Compute\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setSourceSnapshotEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomerEncryptionKey::class); + $this->source_snapshot_encryption_key = $var; + + return $this; + } + + /** + * [Output Only] The ID value of the snapshot used to create this image. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given snapshot name. + * + * Generated from protobuf field optional string source_snapshot_id = 98962258; + * @return string + */ + public function getSourceSnapshotId() + { + return isset($this->source_snapshot_id) ? $this->source_snapshot_id : ''; + } + + public function hasSourceSnapshotId() + { + return isset($this->source_snapshot_id); + } + + public function clearSourceSnapshotId() + { + unset($this->source_snapshot_id); + } + + /** + * [Output Only] The ID value of the snapshot used to create this image. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given snapshot name. + * + * Generated from protobuf field optional string source_snapshot_id = 98962258; + * @param string $var + * @return $this + */ + public function setSourceSnapshotId($var) + { + GPBUtil::checkString($var, True); + $this->source_snapshot_id = $var; + + return $this; + } + + /** + * The type of the image used to create this disk. The default and only valid value is RAW. + * Check the SourceType enum for the list of possible values. + * + * Generated from protobuf field optional string source_type = 452245726; + * @return string + */ + public function getSourceType() + { + return isset($this->source_type) ? $this->source_type : ''; + } + + public function hasSourceType() + { + return isset($this->source_type); + } + + public function clearSourceType() + { + unset($this->source_type); + } + + /** + * The type of the image used to create this disk. The default and only valid value is RAW. + * Check the SourceType enum for the list of possible values. + * + * Generated from protobuf field optional string source_type = 452245726; + * @param string $var + * @return $this + */ + public function setSourceType($var) + { + GPBUtil::checkString($var, True); + $this->source_type = $var; + + return $this; + } + + /** + * [Output Only] The status of the image. An image can be used to create other resources, such as instances, only after the image has been successfully created and the status is set to READY. Possible values are FAILED, PENDING, or READY. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] The status of the image. An image can be used to create other resources, such as instances, only after the image has been successfully created and the status is set to READY. Possible values are FAILED, PENDING, or READY. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + + /** + * Cloud Storage bucket storage location of the image (regional or multi-regional). + * + * Generated from protobuf field repeated string storage_locations = 328005274; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStorageLocations() + { + return $this->storage_locations; + } + + /** + * Cloud Storage bucket storage location of the image (regional or multi-regional). + * + * Generated from protobuf field repeated string storage_locations = 328005274; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStorageLocations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->storage_locations = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Image/Architecture.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Image/Architecture.php new file mode 100644 index 000000000000..93adc0a7e14b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Image/Architecture.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.Image.Architecture + */ +class Architecture +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ARCHITECTURE = 0; + */ + const UNDEFINED_ARCHITECTURE = 0; + /** + * Default value indicating Architecture is not set. + * + * Generated from protobuf enum ARCHITECTURE_UNSPECIFIED = 394750507; + */ + const ARCHITECTURE_UNSPECIFIED = 394750507; + /** + * Machines with architecture ARM64 + * + * Generated from protobuf enum ARM64 = 62547450; + */ + const ARM64 = 62547450; + /** + * Machines with architecture X86_64 + * + * Generated from protobuf enum X86_64 = 425300551; + */ + const X86_64 = 425300551; + + private static $valueToName = [ + self::UNDEFINED_ARCHITECTURE => 'UNDEFINED_ARCHITECTURE', + self::ARCHITECTURE_UNSPECIFIED => 'ARCHITECTURE_UNSPECIFIED', + self::ARM64 => 'ARM64', + self::X86_64 => 'X86_64', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Architecture::class, \Google\Cloud\Compute\V1\Image_Architecture::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Image/SourceType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Image/SourceType.php new file mode 100644 index 000000000000..567aabe00d84 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Image/SourceType.php @@ -0,0 +1,55 @@ +google.cloud.compute.v1.Image.SourceType + */ +class SourceType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_SOURCE_TYPE = 0; + */ + const UNDEFINED_SOURCE_TYPE = 0; + /** + * Generated from protobuf enum RAW = 80904; + */ + const RAW = 80904; + + private static $valueToName = [ + self::UNDEFINED_SOURCE_TYPE => 'UNDEFINED_SOURCE_TYPE', + self::RAW => 'RAW', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SourceType::class, \Google\Cloud\Compute\V1\Image_SourceType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Image/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Image/Status.php new file mode 100644 index 000000000000..da34dc0b3333 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Image/Status.php @@ -0,0 +1,78 @@ +google.cloud.compute.v1.Image.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * Image is deleting. + * + * Generated from protobuf enum DELETING = 528602024; + */ + const DELETING = 528602024; + /** + * Image creation failed due to an error. + * + * Generated from protobuf enum FAILED = 455706685; + */ + const FAILED = 455706685; + /** + * Image hasn't been created as yet. + * + * Generated from protobuf enum PENDING = 35394935; + */ + const PENDING = 35394935; + /** + * Image has been successfully created. + * + * Generated from protobuf enum READY = 77848963; + */ + const READY = 77848963; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::DELETING => 'DELETING', + self::FAILED => 'FAILED', + self::PENDING => 'PENDING', + self::READY => 'READY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\Image_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ImageFamilyView.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ImageFamilyView.php new file mode 100644 index 000000000000..7f7c94e3eca3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ImageFamilyView.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.ImageFamilyView + */ +class ImageFamilyView extends \Google\Protobuf\Internal\Message +{ + /** + * The latest image that is part of the specified image family in the requested location, and that is not deprecated. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Image image = 100313435; + */ + protected $image = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\Image $image + * The latest image that is part of the specified image family in the requested location, and that is not deprecated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The latest image that is part of the specified image family in the requested location, and that is not deprecated. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Image image = 100313435; + * @return \Google\Cloud\Compute\V1\Image|null + */ + public function getImage() + { + return $this->image; + } + + public function hasImage() + { + return isset($this->image); + } + + public function clearImage() + { + unset($this->image); + } + + /** + * The latest image that is part of the specified image family in the requested location, and that is not deprecated. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Image image = 100313435; + * @param \Google\Cloud\Compute\V1\Image $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Image::class); + $this->image = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ImageList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ImageList.php new file mode 100644 index 000000000000..7540dc6812ef --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ImageList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.ImageList + */ +class ImageList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of Image resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Image items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\Image>|\Google\Protobuf\Internal\RepeatedField $items + * A list of Image 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 Image resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Image items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of Image resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Image items = 100526016; + * @param array<\Google\Cloud\Compute\V1\Image>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Image::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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InitialStateConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InitialStateConfig.php new file mode 100644 index 000000000000..96e400df7c5a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InitialStateConfig.php @@ -0,0 +1,179 @@ +google.cloud.compute.v1.InitialStateConfig + */ +class InitialStateConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The Key Database (db). + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FileContentBuffer dbs = 99253; + */ + private $dbs; + /** + * The forbidden key database (dbx). + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FileContentBuffer dbxs = 3077113; + */ + private $dbxs; + /** + * The Key Exchange Key (KEK). + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FileContentBuffer keks = 3288130; + */ + private $keks; + /** + * The Platform Key (PK). + * + * Generated from protobuf field optional .google.cloud.compute.v1.FileContentBuffer pk = 3579; + */ + protected $pk = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\FileContentBuffer>|\Google\Protobuf\Internal\RepeatedField $dbs + * The Key Database (db). + * @type array<\Google\Cloud\Compute\V1\FileContentBuffer>|\Google\Protobuf\Internal\RepeatedField $dbxs + * The forbidden key database (dbx). + * @type array<\Google\Cloud\Compute\V1\FileContentBuffer>|\Google\Protobuf\Internal\RepeatedField $keks + * The Key Exchange Key (KEK). + * @type \Google\Cloud\Compute\V1\FileContentBuffer $pk + * The Platform Key (PK). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The Key Database (db). + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FileContentBuffer dbs = 99253; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDbs() + { + return $this->dbs; + } + + /** + * The Key Database (db). + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FileContentBuffer dbs = 99253; + * @param array<\Google\Cloud\Compute\V1\FileContentBuffer>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDbs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\FileContentBuffer::class); + $this->dbs = $arr; + + return $this; + } + + /** + * The forbidden key database (dbx). + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FileContentBuffer dbxs = 3077113; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDbxs() + { + return $this->dbxs; + } + + /** + * The forbidden key database (dbx). + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FileContentBuffer dbxs = 3077113; + * @param array<\Google\Cloud\Compute\V1\FileContentBuffer>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDbxs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\FileContentBuffer::class); + $this->dbxs = $arr; + + return $this; + } + + /** + * The Key Exchange Key (KEK). + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FileContentBuffer keks = 3288130; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getKeks() + { + return $this->keks; + } + + /** + * The Key Exchange Key (KEK). + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FileContentBuffer keks = 3288130; + * @param array<\Google\Cloud\Compute\V1\FileContentBuffer>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKeks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\FileContentBuffer::class); + $this->keks = $arr; + + return $this; + } + + /** + * The Platform Key (PK). + * + * Generated from protobuf field optional .google.cloud.compute.v1.FileContentBuffer pk = 3579; + * @return \Google\Cloud\Compute\V1\FileContentBuffer|null + */ + public function getPk() + { + return $this->pk; + } + + public function hasPk() + { + return isset($this->pk); + } + + public function clearPk() + { + unset($this->pk); + } + + /** + * The Platform Key (PK). + * + * Generated from protobuf field optional .google.cloud.compute.v1.FileContentBuffer pk = 3579; + * @param \Google\Cloud\Compute\V1\FileContentBuffer $var + * @return $this + */ + public function setPk($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\FileContentBuffer::class); + $this->pk = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertAddressRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertAddressRequest.php new file mode 100644 index 000000000000..a61d4eaae2eb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertAddressRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertAddressRequest + */ +class InsertAddressRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Address address_resource = 483888121 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $address_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"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param \Google\Cloud\Compute\V1\Address $addressResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertAddressRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\Address $addressResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setAddressResource($addressResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\Address $address_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * 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.Address address_resource = 483888121 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Address|null + */ + public function getAddressResource() + { + return $this->address_resource; + } + + public function hasAddressResource() + { + return isset($this->address_resource); + } + + public function clearAddressResource() + { + unset($this->address_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Address address_resource = 483888121 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Address $var + * @return $this + */ + public function setAddressResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Address::class); + $this->address_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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertAutoscalerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertAutoscalerRequest.php new file mode 100644 index 000000000000..078d4794ee28 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertAutoscalerRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertAutoscalerRequest + */ +class InsertAutoscalerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Autoscaler autoscaler_resource = 207616118 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $autoscaler_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * 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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone for this request. + * @param \Google\Cloud\Compute\V1\Autoscaler $autoscalerResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertAutoscalerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, \Google\Cloud\Compute\V1\Autoscaler $autoscalerResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setAutoscalerResource($autoscalerResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\Autoscaler $autoscaler_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 + * Name of the zone for this request. + * } + */ + 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.Autoscaler autoscaler_resource = 207616118 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Autoscaler|null + */ + public function getAutoscalerResource() + { + return $this->autoscaler_resource; + } + + public function hasAutoscalerResource() + { + return isset($this->autoscaler_resource); + } + + public function clearAutoscalerResource() + { + unset($this->autoscaler_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Autoscaler autoscaler_resource = 207616118 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Autoscaler $var + * @return $this + */ + public function setAutoscalerResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Autoscaler::class); + $this->autoscaler_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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertBackendBucketRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertBackendBucketRequest.php new file mode 100644 index 000000000000..07e743f5cd88 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertBackendBucketRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertBackendBucketRequest + */ +class InsertBackendBucketRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendBucket backend_bucket_resource = 380757784 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_bucket_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\BackendBucket $backendBucketResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertBackendBucketRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\BackendBucket $backendBucketResource): self + { + return (new self()) + ->setProject($project) + ->setBackendBucketResource($backendBucketResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\BackendBucket $backend_bucket_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). + * } + */ + 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.BackendBucket backend_bucket_resource = 380757784 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\BackendBucket|null + */ + public function getBackendBucketResource() + { + return $this->backend_bucket_resource; + } + + public function hasBackendBucketResource() + { + return isset($this->backend_bucket_resource); + } + + public function clearBackendBucketResource() + { + unset($this->backend_bucket_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendBucket backend_bucket_resource = 380757784 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\BackendBucket $var + * @return $this + */ + public function setBackendBucketResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BackendBucket::class); + $this->backend_bucket_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertBackendServiceRequest.php new file mode 100644 index 000000000000..4a420dd594b1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertBackendServiceRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertBackendServiceRequest + */ +class InsertBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendService backend_service_resource = 347586723 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_service_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\BackendService $backendServiceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\BackendService $backendServiceResource): self + { + return (new self()) + ->setProject($project) + ->setBackendServiceResource($backendServiceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\BackendService $backend_service_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). + * } + */ + 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.BackendService backend_service_resource = 347586723 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\BackendService|null + */ + public function getBackendServiceResource() + { + return $this->backend_service_resource; + } + + public function hasBackendServiceResource() + { + return isset($this->backend_service_resource); + } + + public function clearBackendServiceResource() + { + unset($this->backend_service_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendService backend_service_resource = 347586723 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\BackendService $var + * @return $this + */ + public function setBackendServiceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BackendService::class); + $this->backend_service_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertDiskRequest.php new file mode 100644 index 000000000000..df0fae9c6e8b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertDiskRequest.php @@ -0,0 +1,250 @@ +google.cloud.compute.v1.InsertDiskRequest + */ +class InsertDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Disk disk_resource = 25880688 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Source image to restore onto a disk. This field is optional. + * + * Generated from protobuf field optional string source_image = 50443319; + */ + protected $source_image = 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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param \Google\Cloud\Compute\V1\Disk $diskResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertDiskRequest + * + * @experimental + */ + public static function build(string $project, string $zone, \Google\Cloud\Compute\V1\Disk $diskResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setDiskResource($diskResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\Disk $disk_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 $source_image + * Source image to restore onto a disk. This field is optional. + * @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 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; + } + + /** + * 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; + } + + /** + * Source image to restore onto a disk. This field is optional. + * + * Generated from protobuf field optional string source_image = 50443319; + * @return string + */ + public function getSourceImage() + { + return isset($this->source_image) ? $this->source_image : ''; + } + + public function hasSourceImage() + { + return isset($this->source_image); + } + + public function clearSourceImage() + { + unset($this->source_image); + } + + /** + * Source image to restore onto a disk. This field is optional. + * + * Generated from protobuf field optional string source_image = 50443319; + * @param string $var + * @return $this + */ + public function setSourceImage($var) + { + GPBUtil::checkString($var, True); + $this->source_image = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertExternalVpnGatewayRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertExternalVpnGatewayRequest.php new file mode 100644 index 000000000000..35dbce8dd374 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertExternalVpnGatewayRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertExternalVpnGatewayRequest + */ +class InsertExternalVpnGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ExternalVpnGateway external_vpn_gateway_resource = 486813576 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $external_vpn_gateway_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\ExternalVpnGateway $externalVpnGatewayResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertExternalVpnGatewayRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\ExternalVpnGateway $externalVpnGatewayResource): self + { + return (new self()) + ->setProject($project) + ->setExternalVpnGatewayResource($externalVpnGatewayResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\ExternalVpnGateway $external_vpn_gateway_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). + * } + */ + 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.ExternalVpnGateway external_vpn_gateway_resource = 486813576 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ExternalVpnGateway|null + */ + public function getExternalVpnGatewayResource() + { + return $this->external_vpn_gateway_resource; + } + + public function hasExternalVpnGatewayResource() + { + return isset($this->external_vpn_gateway_resource); + } + + public function clearExternalVpnGatewayResource() + { + unset($this->external_vpn_gateway_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ExternalVpnGateway external_vpn_gateway_resource = 486813576 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ExternalVpnGateway $var + * @return $this + */ + public function setExternalVpnGatewayResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ExternalVpnGateway::class); + $this->external_vpn_gateway_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertFirewallPolicyRequest.php new file mode 100644 index 000000000000..b44520fb1d5e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertFirewallPolicyRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertFirewallPolicyRequest + */ +class InsertFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicy firewall_policy_resource = 495049532 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy_resource = null; + /** + * 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 string parent_id = 459714768 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "parent_id"]; + */ + protected $parent_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; + */ + protected $request_id = null; + + /** + * @param string $parentId 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. + * @param \Google\Cloud\Compute\V1\FirewallPolicy $firewallPolicyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $parentId, \Google\Cloud\Compute\V1\FirewallPolicy $firewallPolicyResource): self + { + return (new self()) + ->setParentId($parentId) + ->setFirewallPolicyResource($firewallPolicyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\FirewallPolicy $firewall_policy_resource + * The body resource for this request + * @type string $parent_id + * 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 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.FirewallPolicy firewall_policy_resource = 495049532 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\FirewallPolicy|null + */ + public function getFirewallPolicyResource() + { + return $this->firewall_policy_resource; + } + + public function hasFirewallPolicyResource() + { + return isset($this->firewall_policy_resource); + } + + public function clearFirewallPolicyResource() + { + unset($this->firewall_policy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicy firewall_policy_resource = 495049532 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\FirewallPolicy $var + * @return $this + */ + public function setFirewallPolicyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\FirewallPolicy::class); + $this->firewall_policy_resource = $var; + + return $this; + } + + /** + * 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 string parent_id = 459714768 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "parent_id"]; + * @return string + */ + public function getParentId() + { + return $this->parent_id; + } + + /** + * 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 string parent_id = 459714768 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "parent_id"]; + * @param string $var + * @return $this + */ + public function setParentId($var) + { + GPBUtil::checkString($var, True); + $this->parent_id = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertFirewallRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertFirewallRequest.php new file mode 100644 index 000000000000..c5cbc7a29ecd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertFirewallRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertFirewallRequest + */ +class InsertFirewallRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Firewall firewall_resource = 41425005 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\Firewall $firewallResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertFirewallRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\Firewall $firewallResource): self + { + return (new self()) + ->setProject($project) + ->setFirewallResource($firewallResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\Firewall $firewall_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). + * } + */ + 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.Firewall firewall_resource = 41425005 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Firewall|null + */ + public function getFirewallResource() + { + return $this->firewall_resource; + } + + public function hasFirewallResource() + { + return isset($this->firewall_resource); + } + + public function clearFirewallResource() + { + unset($this->firewall_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Firewall firewall_resource = 41425005 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Firewall $var + * @return $this + */ + public function setFirewallResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Firewall::class); + $this->firewall_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertForwardingRuleRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertForwardingRuleRequest.php new file mode 100644 index 000000000000..6b7e59b61553 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertForwardingRuleRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertForwardingRuleRequest + */ +class InsertForwardingRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ForwardingRule forwarding_rule_resource = 301211695 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $forwarding_rule_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"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param \Google\Cloud\Compute\V1\ForwardingRule $forwardingRuleResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertForwardingRuleRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\ForwardingRule $forwardingRuleResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setForwardingRuleResource($forwardingRuleResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\ForwardingRule $forwarding_rule_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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.ForwardingRule forwarding_rule_resource = 301211695 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ForwardingRule|null + */ + public function getForwardingRuleResource() + { + return $this->forwarding_rule_resource; + } + + public function hasForwardingRuleResource() + { + return isset($this->forwarding_rule_resource); + } + + public function clearForwardingRuleResource() + { + unset($this->forwarding_rule_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ForwardingRule forwarding_rule_resource = 301211695 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ForwardingRule $var + * @return $this + */ + public function setForwardingRuleResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ForwardingRule::class); + $this->forwarding_rule_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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertGlobalAddressRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertGlobalAddressRequest.php new file mode 100644 index 000000000000..43e80fbd727a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertGlobalAddressRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertGlobalAddressRequest + */ +class InsertGlobalAddressRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Address address_resource = 483888121 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $address_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\Address $addressResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertGlobalAddressRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\Address $addressResource): self + { + return (new self()) + ->setProject($project) + ->setAddressResource($addressResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\Address $address_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). + * } + */ + 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.Address address_resource = 483888121 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Address|null + */ + public function getAddressResource() + { + return $this->address_resource; + } + + public function hasAddressResource() + { + return isset($this->address_resource); + } + + public function clearAddressResource() + { + unset($this->address_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Address address_resource = 483888121 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Address $var + * @return $this + */ + public function setAddressResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Address::class); + $this->address_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertGlobalForwardingRuleRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertGlobalForwardingRuleRequest.php new file mode 100644 index 000000000000..54d069c6a667 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertGlobalForwardingRuleRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertGlobalForwardingRuleRequest + */ +class InsertGlobalForwardingRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ForwardingRule forwarding_rule_resource = 301211695 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $forwarding_rule_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\ForwardingRule $forwardingRuleResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertGlobalForwardingRuleRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\ForwardingRule $forwardingRuleResource): self + { + return (new self()) + ->setProject($project) + ->setForwardingRuleResource($forwardingRuleResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\ForwardingRule $forwarding_rule_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). + * } + */ + 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.ForwardingRule forwarding_rule_resource = 301211695 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ForwardingRule|null + */ + public function getForwardingRuleResource() + { + return $this->forwarding_rule_resource; + } + + public function hasForwardingRuleResource() + { + return isset($this->forwarding_rule_resource); + } + + public function clearForwardingRuleResource() + { + unset($this->forwarding_rule_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ForwardingRule forwarding_rule_resource = 301211695 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ForwardingRule $var + * @return $this + */ + public function setForwardingRuleResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ForwardingRule::class); + $this->forwarding_rule_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertGlobalNetworkEndpointGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertGlobalNetworkEndpointGroupRequest.php new file mode 100644 index 000000000000..b11a7232b7cb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertGlobalNetworkEndpointGroupRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest + */ +class InsertGlobalNetworkEndpointGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkEndpointGroup network_endpoint_group_resource = 525788839 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_endpoint_group_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\NetworkEndpointGroup $networkEndpointGroupResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertGlobalNetworkEndpointGroupRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\NetworkEndpointGroup $networkEndpointGroupResource): self + { + return (new self()) + ->setProject($project) + ->setNetworkEndpointGroupResource($networkEndpointGroupResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\NetworkEndpointGroup $network_endpoint_group_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). + * } + */ + 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.NetworkEndpointGroup network_endpoint_group_resource = 525788839 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NetworkEndpointGroup|null + */ + public function getNetworkEndpointGroupResource() + { + return $this->network_endpoint_group_resource; + } + + public function hasNetworkEndpointGroupResource() + { + return isset($this->network_endpoint_group_resource); + } + + public function clearNetworkEndpointGroupResource() + { + unset($this->network_endpoint_group_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkEndpointGroup network_endpoint_group_resource = 525788839 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NetworkEndpointGroup $var + * @return $this + */ + public function setNetworkEndpointGroupResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkEndpointGroup::class); + $this->network_endpoint_group_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertGlobalPublicDelegatedPrefixeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertGlobalPublicDelegatedPrefixeRequest.php new file mode 100644 index 000000000000..775e80c19456 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertGlobalPublicDelegatedPrefixeRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest + */ +class InsertGlobalPublicDelegatedPrefixeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PublicDelegatedPrefix public_delegated_prefix_resource = 47594501 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $public_delegated_prefix_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\PublicDelegatedPrefix $publicDelegatedPrefixResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertGlobalPublicDelegatedPrefixeRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\PublicDelegatedPrefix $publicDelegatedPrefixResource): self + { + return (new self()) + ->setProject($project) + ->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type \Google\Cloud\Compute\V1\PublicDelegatedPrefix $public_delegated_prefix_resource + * The body resource 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); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PublicDelegatedPrefix public_delegated_prefix_resource = 47594501 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\PublicDelegatedPrefix|null + */ + public function getPublicDelegatedPrefixResource() + { + return $this->public_delegated_prefix_resource; + } + + public function hasPublicDelegatedPrefixResource() + { + return isset($this->public_delegated_prefix_resource); + } + + public function clearPublicDelegatedPrefixResource() + { + unset($this->public_delegated_prefix_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PublicDelegatedPrefix public_delegated_prefix_resource = 47594501 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\PublicDelegatedPrefix $var + * @return $this + */ + public function setPublicDelegatedPrefixResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\PublicDelegatedPrefix::class); + $this->public_delegated_prefix_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertHealthCheckRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertHealthCheckRequest.php new file mode 100644 index 000000000000..63460d8de2d9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertHealthCheckRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertHealthCheckRequest + */ +class InsertHealthCheckRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.HealthCheck health_check_resource = 201925032 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $health_check_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\HealthCheck $healthCheckResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertHealthCheckRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\HealthCheck $healthCheckResource): self + { + return (new self()) + ->setProject($project) + ->setHealthCheckResource($healthCheckResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\HealthCheck $health_check_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). + * } + */ + 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.HealthCheck health_check_resource = 201925032 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\HealthCheck|null + */ + public function getHealthCheckResource() + { + return $this->health_check_resource; + } + + public function hasHealthCheckResource() + { + return isset($this->health_check_resource); + } + + public function clearHealthCheckResource() + { + unset($this->health_check_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.HealthCheck health_check_resource = 201925032 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\HealthCheck $var + * @return $this + */ + public function setHealthCheckResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HealthCheck::class); + $this->health_check_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertImageRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertImageRequest.php new file mode 100644 index 000000000000..06bbf451eac3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertImageRequest.php @@ -0,0 +1,214 @@ +google.cloud.compute.v1.InsertImageRequest + */ +class InsertImageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Force image creation if true. + * + * Generated from protobuf field optional bool force_create = 197723344; + */ + protected $force_create = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Image image_resource = 371171954 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $image_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\Image $imageResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertImageRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\Image $imageResource): self + { + return (new self()) + ->setProject($project) + ->setImageResource($imageResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $force_create + * Force image creation if true. + * @type \Google\Cloud\Compute\V1\Image $image_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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Force image creation if true. + * + * Generated from protobuf field optional bool force_create = 197723344; + * @return bool + */ + public function getForceCreate() + { + return isset($this->force_create) ? $this->force_create : false; + } + + public function hasForceCreate() + { + return isset($this->force_create); + } + + public function clearForceCreate() + { + unset($this->force_create); + } + + /** + * Force image creation if true. + * + * Generated from protobuf field optional bool force_create = 197723344; + * @param bool $var + * @return $this + */ + public function setForceCreate($var) + { + GPBUtil::checkBool($var); + $this->force_create = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Image image_resource = 371171954 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Image|null + */ + public function getImageResource() + { + return $this->image_resource; + } + + public function hasImageResource() + { + return isset($this->image_resource); + } + + public function clearImageResource() + { + unset($this->image_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Image image_resource = 371171954 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Image $var + * @return $this + */ + public function setImageResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Image::class); + $this->image_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..1cfd97090283 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstanceGroupManagerRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertInstanceGroupManagerRequest + */ +class InsertInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManager instance_group_manager_resource = 261063946 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the zone where you want to create the managed instance group. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where you want to create the managed instance group. + * @param \Google\Cloud\Compute\V1\InstanceGroupManager $instanceGroupManagerResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, \Google\Cloud\Compute\V1\InstanceGroupManager $instanceGroupManagerResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManagerResource($instanceGroupManagerResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\InstanceGroupManager $instance_group_manager_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 where you want to create the managed instance group. + * } + */ + 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.InstanceGroupManager instance_group_manager_resource = 261063946 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupManager|null + */ + public function getInstanceGroupManagerResource() + { + return $this->instance_group_manager_resource; + } + + public function hasInstanceGroupManagerResource() + { + return isset($this->instance_group_manager_resource); + } + + public function clearInstanceGroupManagerResource() + { + unset($this->instance_group_manager_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManager instance_group_manager_resource = 261063946 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupManager $var + * @return $this + */ + public function setInstanceGroupManagerResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManager::class); + $this->instance_group_manager_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 where you want to create the managed instance group. + * + * 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 where you want to create the managed instance group. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstanceGroupManagerResizeRequestRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstanceGroupManagerResizeRequestRequest.php new file mode 100644 index 000000000000..705d3a8aad57 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstanceGroupManagerResizeRequestRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.InsertInstanceGroupManagerResizeRequestRequest + */ +class InsertInstanceGroupManagerResizeRequestRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group to which the resize request will be added. Name should conform to RFC1035 or be a resource ID. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagerResizeRequest instance_group_manager_resize_request_resource = 468541293 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager_resize_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the zone where the managed instance group is located and where the resize request will be created. Name should conform to RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located and where the resize request will be created. Name should conform to RFC1035. + * @param string $instanceGroupManager The name of the managed instance group to which the resize request will be added. Name should conform to RFC1035 or be a resource ID. + * @param \Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequest $instanceGroupManagerResizeRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertInstanceGroupManagerResizeRequestRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager, \Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequest $instanceGroupManagerResizeRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagerResizeRequestResource($instanceGroupManagerResizeRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group to which the resize request will be added. Name should conform to RFC1035 or be a resource ID. + * @type \Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequest $instance_group_manager_resize_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 where the managed instance group is located and where the resize request will be created. Name should conform to RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the managed instance group to which the resize request will be added. Name should conform to RFC1035 or be a resource ID. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group to which the resize request will be added. Name should conform to RFC1035 or be a resource ID. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagerResizeRequest instance_group_manager_resize_request_resource = 468541293 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequest|null + */ + public function getInstanceGroupManagerResizeRequestResource() + { + return $this->instance_group_manager_resize_request_resource; + } + + public function hasInstanceGroupManagerResizeRequestResource() + { + return isset($this->instance_group_manager_resize_request_resource); + } + + public function clearInstanceGroupManagerResizeRequestResource() + { + unset($this->instance_group_manager_resize_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagerResizeRequest instance_group_manager_resize_request_resource = 468541293 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequest $var + * @return $this + */ + public function setInstanceGroupManagerResizeRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequest::class); + $this->instance_group_manager_resize_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 where the managed instance group is located and where the resize request will be created. Name should conform to RFC1035. + * + * 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 where the managed instance group is located and where the resize request will be created. Name should conform to RFC1035. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstanceGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstanceGroupRequest.php new file mode 100644 index 000000000000..abec107d1cd0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstanceGroupRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertInstanceGroupRequest + */ +class InsertInstanceGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroup instance_group_resource = 286612152 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the zone where you want to create the instance group. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where you want to create the instance group. + * @param \Google\Cloud\Compute\V1\InstanceGroup $instanceGroupResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertInstanceGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, \Google\Cloud\Compute\V1\InstanceGroup $instanceGroupResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupResource($instanceGroupResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\InstanceGroup $instance_group_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 where you want to create the instance group. + * } + */ + 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.InstanceGroup instance_group_resource = 286612152 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroup|null + */ + public function getInstanceGroupResource() + { + return $this->instance_group_resource; + } + + public function hasInstanceGroupResource() + { + return isset($this->instance_group_resource); + } + + public function clearInstanceGroupResource() + { + unset($this->instance_group_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroup instance_group_resource = 286612152 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroup $var + * @return $this + */ + public function setInstanceGroupResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroup::class); + $this->instance_group_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 where you want to create the instance group. + * + * 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 where you want to create the instance group. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstanceRequest.php new file mode 100644 index 000000000000..267ea18e5f56 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstanceRequest.php @@ -0,0 +1,294 @@ +google.cloud.compute.v1.InsertInstanceRequest + */ +class InsertInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Instance instance_resource = 215988344 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Specifies instance template to create the instance. This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project /global/instanceTemplates/instanceTemplate - projects/project/global/instanceTemplates/instanceTemplate - global/instanceTemplates/instanceTemplate + * + * Generated from protobuf field optional string source_instance_template = 332423616; + */ + protected $source_instance_template = null; + /** + * Specifies the machine image to use to create the instance. This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to a machine image: - https://www.googleapis.com/compute/v1/projects/project/global/global /machineImages/machineImage - projects/project/global/global/machineImages/machineImage - global/machineImages/machineImage + * + * Generated from protobuf field optional string source_machine_image = 21769791; + */ + protected $source_machine_image = 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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param \Google\Cloud\Compute\V1\Instance $instanceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, \Google\Cloud\Compute\V1\Instance $instanceResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceResource($instanceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\Instance $instance_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 $source_instance_template + * Specifies instance template to create the instance. This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project /global/instanceTemplates/instanceTemplate - projects/project/global/instanceTemplates/instanceTemplate - global/instanceTemplates/instanceTemplate + * @type string $source_machine_image + * Specifies the machine image to use to create the instance. This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to a machine image: - https://www.googleapis.com/compute/v1/projects/project/global/global /machineImages/machineImage - projects/project/global/global/machineImages/machineImage - global/machineImages/machineImage + * @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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Instance instance_resource = 215988344 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Instance|null + */ + public function getInstanceResource() + { + return $this->instance_resource; + } + + public function hasInstanceResource() + { + return isset($this->instance_resource); + } + + public function clearInstanceResource() + { + unset($this->instance_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Instance instance_resource = 215988344 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Instance $var + * @return $this + */ + public function setInstanceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Instance::class); + $this->instance_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; + } + + /** + * Specifies instance template to create the instance. This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project /global/instanceTemplates/instanceTemplate - projects/project/global/instanceTemplates/instanceTemplate - global/instanceTemplates/instanceTemplate + * + * Generated from protobuf field optional string source_instance_template = 332423616; + * @return string + */ + public function getSourceInstanceTemplate() + { + return isset($this->source_instance_template) ? $this->source_instance_template : ''; + } + + public function hasSourceInstanceTemplate() + { + return isset($this->source_instance_template); + } + + public function clearSourceInstanceTemplate() + { + unset($this->source_instance_template); + } + + /** + * Specifies instance template to create the instance. This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project /global/instanceTemplates/instanceTemplate - projects/project/global/instanceTemplates/instanceTemplate - global/instanceTemplates/instanceTemplate + * + * Generated from protobuf field optional string source_instance_template = 332423616; + * @param string $var + * @return $this + */ + public function setSourceInstanceTemplate($var) + { + GPBUtil::checkString($var, True); + $this->source_instance_template = $var; + + return $this; + } + + /** + * Specifies the machine image to use to create the instance. This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to a machine image: - https://www.googleapis.com/compute/v1/projects/project/global/global /machineImages/machineImage - projects/project/global/global/machineImages/machineImage - global/machineImages/machineImage + * + * Generated from protobuf field optional string source_machine_image = 21769791; + * @return string + */ + public function getSourceMachineImage() + { + return isset($this->source_machine_image) ? $this->source_machine_image : ''; + } + + public function hasSourceMachineImage() + { + return isset($this->source_machine_image); + } + + public function clearSourceMachineImage() + { + unset($this->source_machine_image); + } + + /** + * Specifies the machine image to use to create the instance. This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to a machine image: - https://www.googleapis.com/compute/v1/projects/project/global/global /machineImages/machineImage - projects/project/global/global/machineImages/machineImage - global/machineImages/machineImage + * + * Generated from protobuf field optional string source_machine_image = 21769791; + * @param string $var + * @return $this + */ + public function setSourceMachineImage($var) + { + GPBUtil::checkString($var, True); + $this->source_machine_image = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstanceTemplateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstanceTemplateRequest.php new file mode 100644 index 000000000000..03b8e3a305a4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstanceTemplateRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertInstanceTemplateRequest + */ +class InsertInstanceTemplateRequest 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]; + */ + protected $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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\InstanceTemplate $instanceTemplateResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertInstanceTemplateRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\InstanceTemplate $instanceTemplateResource): self + { + return (new self()) + ->setProject($project) + ->setInstanceTemplateResource($instanceTemplateResource); + } + + /** + * 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 $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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstantSnapshotRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstantSnapshotRequest.php new file mode 100644 index 000000000000..e5a0ed6cf0c5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInstantSnapshotRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertInstantSnapshotRequest + */ +class InsertInstantSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstantSnapshot instant_snapshot_resource = 383915339 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instant_snapshot_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * 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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone for this request. + * @param \Google\Cloud\Compute\V1\InstantSnapshot $instantSnapshotResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertInstantSnapshotRequest + * + * @experimental + */ + public static function build(string $project, string $zone, \Google\Cloud\Compute\V1\InstantSnapshot $instantSnapshotResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstantSnapshotResource($instantSnapshotResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\InstantSnapshot $instant_snapshot_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 + * Name of the zone for this request. + * } + */ + 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.InstantSnapshot instant_snapshot_resource = 383915339 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstantSnapshot|null + */ + public function getInstantSnapshotResource() + { + return $this->instant_snapshot_resource; + } + + public function hasInstantSnapshotResource() + { + return isset($this->instant_snapshot_resource); + } + + public function clearInstantSnapshotResource() + { + unset($this->instant_snapshot_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstantSnapshot instant_snapshot_resource = 383915339 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstantSnapshot $var + * @return $this + */ + public function setInstantSnapshotResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstantSnapshot::class); + $this->instant_snapshot_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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInterconnectAttachmentRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInterconnectAttachmentRequest.php new file mode 100644 index 000000000000..dcadc810c437 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInterconnectAttachmentRequest.php @@ -0,0 +1,250 @@ +google.cloud.compute.v1.InsertInterconnectAttachmentRequest + */ +class InsertInterconnectAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InterconnectAttachment interconnect_attachment_resource = 212341369 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $interconnect_attachment_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"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + */ + protected $validate_only = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param \Google\Cloud\Compute\V1\InterconnectAttachment $interconnectAttachmentResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertInterconnectAttachmentRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\InterconnectAttachment $interconnectAttachmentResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInterconnectAttachmentResource($interconnectAttachmentResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\InterconnectAttachment $interconnect_attachment_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * 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 bool $validate_only + * If true, the request will not be committed. + * } + */ + 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.InterconnectAttachment interconnect_attachment_resource = 212341369 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InterconnectAttachment|null + */ + public function getInterconnectAttachmentResource() + { + return $this->interconnect_attachment_resource; + } + + public function hasInterconnectAttachmentResource() + { + return isset($this->interconnect_attachment_resource); + } + + public function clearInterconnectAttachmentResource() + { + unset($this->interconnect_attachment_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InterconnectAttachment interconnect_attachment_resource = 212341369 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InterconnectAttachment $var + * @return $this + */ + public function setInterconnectAttachmentResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InterconnectAttachment::class); + $this->interconnect_attachment_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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + * @return bool + */ + public function getValidateOnly() + { + return isset($this->validate_only) ? $this->validate_only : false; + } + + public function hasValidateOnly() + { + return isset($this->validate_only); + } + + public function clearValidateOnly() + { + unset($this->validate_only); + } + + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInterconnectRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInterconnectRequest.php new file mode 100644 index 000000000000..caed82906bd3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertInterconnectRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertInterconnectRequest + */ +class InsertInterconnectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Interconnect interconnect_resource = 397611167 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $interconnect_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\Interconnect $interconnectResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertInterconnectRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\Interconnect $interconnectResource): self + { + return (new self()) + ->setProject($project) + ->setInterconnectResource($interconnectResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\Interconnect $interconnect_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). + * } + */ + 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.Interconnect interconnect_resource = 397611167 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Interconnect|null + */ + public function getInterconnectResource() + { + return $this->interconnect_resource; + } + + public function hasInterconnectResource() + { + return isset($this->interconnect_resource); + } + + public function clearInterconnectResource() + { + unset($this->interconnect_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Interconnect interconnect_resource = 397611167 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Interconnect $var + * @return $this + */ + public function setInterconnectResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Interconnect::class); + $this->interconnect_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertLicenseRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertLicenseRequest.php new file mode 100644 index 000000000000..06b12220af8c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertLicenseRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertLicenseRequest + */ +class InsertLicenseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.License license_resource = 437955148 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $license_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\License $licenseResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertLicenseRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\License $licenseResource): self + { + return (new self()) + ->setProject($project) + ->setLicenseResource($licenseResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\License $license_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). + * } + */ + 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.License license_resource = 437955148 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\License|null + */ + public function getLicenseResource() + { + return $this->license_resource; + } + + public function hasLicenseResource() + { + return isset($this->license_resource); + } + + public function clearLicenseResource() + { + unset($this->license_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.License license_resource = 437955148 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\License $var + * @return $this + */ + public function setLicenseResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\License::class); + $this->license_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertMachineImageRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertMachineImageRequest.php new file mode 100644 index 000000000000..499f5a064dd6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertMachineImageRequest.php @@ -0,0 +1,214 @@ +google.cloud.compute.v1.InsertMachineImageRequest + */ +class InsertMachineImageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.MachineImage machine_image_resource = 60740970 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $machine_image_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Required. Source instance that is used to create the machine image from. + * + * Generated from protobuf field optional string source_instance = 396315705; + */ + protected $source_instance = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\MachineImage $machineImageResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertMachineImageRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\MachineImage $machineImageResource): self + { + return (new self()) + ->setProject($project) + ->setMachineImageResource($machineImageResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\MachineImage $machine_image_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 $source_instance + * Required. Source instance that is used to create the machine image from. + * } + */ + 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.MachineImage machine_image_resource = 60740970 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\MachineImage|null + */ + public function getMachineImageResource() + { + return $this->machine_image_resource; + } + + public function hasMachineImageResource() + { + return isset($this->machine_image_resource); + } + + public function clearMachineImageResource() + { + unset($this->machine_image_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.MachineImage machine_image_resource = 60740970 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\MachineImage $var + * @return $this + */ + public function setMachineImageResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\MachineImage::class); + $this->machine_image_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; + } + + /** + * Required. Source instance that is used to create the machine image from. + * + * Generated from protobuf field optional string source_instance = 396315705; + * @return string + */ + public function getSourceInstance() + { + return isset($this->source_instance) ? $this->source_instance : ''; + } + + public function hasSourceInstance() + { + return isset($this->source_instance); + } + + public function clearSourceInstance() + { + unset($this->source_instance); + } + + /** + * Required. Source instance that is used to create the machine image from. + * + * Generated from protobuf field optional string source_instance = 396315705; + * @param string $var + * @return $this + */ + public function setSourceInstance($var) + { + GPBUtil::checkString($var, True); + $this->source_instance = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNetworkAttachmentRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNetworkAttachmentRequest.php new file mode 100644 index 000000000000..89c87f2b5a5d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNetworkAttachmentRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertNetworkAttachmentRequest + */ +class InsertNetworkAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkAttachment network_attachment_resource = 210974745 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_attachment_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"]; + */ + protected $project = ''; + /** + * Name of the region of this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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). end_interface: MixerMutationRequestBuilder + * + * Generated from protobuf field optional string request_id = 37109963; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region of this request. + * @param \Google\Cloud\Compute\V1\NetworkAttachment $networkAttachmentResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertNetworkAttachmentRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\NetworkAttachment $networkAttachmentResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setNetworkAttachmentResource($networkAttachmentResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\NetworkAttachment $network_attachment_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region of 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). end_interface: MixerMutationRequestBuilder + * } + */ + 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.NetworkAttachment network_attachment_resource = 210974745 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NetworkAttachment|null + */ + public function getNetworkAttachmentResource() + { + return $this->network_attachment_resource; + } + + public function hasNetworkAttachmentResource() + { + return isset($this->network_attachment_resource); + } + + public function clearNetworkAttachmentResource() + { + unset($this->network_attachment_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkAttachment network_attachment_resource = 210974745 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NetworkAttachment $var + * @return $this + */ + public function setNetworkAttachmentResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkAttachment::class); + $this->network_attachment_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; + } + + /** + * Name of the region of 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; + } + + /** + * Name of the region of 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). end_interface: MixerMutationRequestBuilder + * + * 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). end_interface: MixerMutationRequestBuilder + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNetworkEdgeSecurityServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNetworkEdgeSecurityServiceRequest.php new file mode 100644 index 000000000000..679f6d7699c9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNetworkEdgeSecurityServiceRequest.php @@ -0,0 +1,250 @@ +google.cloud.compute.v1.InsertNetworkEdgeSecurityServiceRequest + */ +class InsertNetworkEdgeSecurityServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkEdgeSecurityService network_edge_security_service_resource = 477548966 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_edge_security_service_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"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + */ + protected $validate_only = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param \Google\Cloud\Compute\V1\NetworkEdgeSecurityService $networkEdgeSecurityServiceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertNetworkEdgeSecurityServiceRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\NetworkEdgeSecurityService $networkEdgeSecurityServiceResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setNetworkEdgeSecurityServiceResource($networkEdgeSecurityServiceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\NetworkEdgeSecurityService $network_edge_security_service_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 bool $validate_only + * If true, the request will not be committed. + * } + */ + 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.NetworkEdgeSecurityService network_edge_security_service_resource = 477548966 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NetworkEdgeSecurityService|null + */ + public function getNetworkEdgeSecurityServiceResource() + { + return $this->network_edge_security_service_resource; + } + + public function hasNetworkEdgeSecurityServiceResource() + { + return isset($this->network_edge_security_service_resource); + } + + public function clearNetworkEdgeSecurityServiceResource() + { + unset($this->network_edge_security_service_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkEdgeSecurityService network_edge_security_service_resource = 477548966 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NetworkEdgeSecurityService $var + * @return $this + */ + public function setNetworkEdgeSecurityServiceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkEdgeSecurityService::class); + $this->network_edge_security_service_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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + * @return bool + */ + public function getValidateOnly() + { + return isset($this->validate_only) ? $this->validate_only : false; + } + + public function hasValidateOnly() + { + return isset($this->validate_only); + } + + public function clearValidateOnly() + { + unset($this->validate_only); + } + + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNetworkEndpointGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNetworkEndpointGroupRequest.php new file mode 100644 index 000000000000..77187015afcd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNetworkEndpointGroupRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertNetworkEndpointGroupRequest + */ +class InsertNetworkEndpointGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkEndpointGroup network_endpoint_group_resource = 525788839 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_endpoint_group_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the zone where you want to create the network endpoint group. It should comply with RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where you want to create the network endpoint group. It should comply with RFC1035. + * @param \Google\Cloud\Compute\V1\NetworkEndpointGroup $networkEndpointGroupResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertNetworkEndpointGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, \Google\Cloud\Compute\V1\NetworkEndpointGroup $networkEndpointGroupResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setNetworkEndpointGroupResource($networkEndpointGroupResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\NetworkEndpointGroup $network_endpoint_group_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 where you want to create the network endpoint group. It should comply with RFC1035. + * } + */ + 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.NetworkEndpointGroup network_endpoint_group_resource = 525788839 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NetworkEndpointGroup|null + */ + public function getNetworkEndpointGroupResource() + { + return $this->network_endpoint_group_resource; + } + + public function hasNetworkEndpointGroupResource() + { + return isset($this->network_endpoint_group_resource); + } + + public function clearNetworkEndpointGroupResource() + { + unset($this->network_endpoint_group_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkEndpointGroup network_endpoint_group_resource = 525788839 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NetworkEndpointGroup $var + * @return $this + */ + public function setNetworkEndpointGroupResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkEndpointGroup::class); + $this->network_endpoint_group_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 where you want to create the network endpoint group. It should comply with RFC1035. + * + * 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 where you want to create the network endpoint group. It should comply with RFC1035. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..aeeab510c301 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNetworkFirewallPolicyRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertNetworkFirewallPolicyRequest + */ +class InsertNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicy firewall_policy_resource = 495049532 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\FirewallPolicy $firewallPolicyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\FirewallPolicy $firewallPolicyResource): self + { + return (new self()) + ->setProject($project) + ->setFirewallPolicyResource($firewallPolicyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\FirewallPolicy $firewall_policy_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). + * } + */ + 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.FirewallPolicy firewall_policy_resource = 495049532 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\FirewallPolicy|null + */ + public function getFirewallPolicyResource() + { + return $this->firewall_policy_resource; + } + + public function hasFirewallPolicyResource() + { + return isset($this->firewall_policy_resource); + } + + public function clearFirewallPolicyResource() + { + unset($this->firewall_policy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicy firewall_policy_resource = 495049532 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\FirewallPolicy $var + * @return $this + */ + public function setFirewallPolicyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\FirewallPolicy::class); + $this->firewall_policy_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNetworkRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNetworkRequest.php new file mode 100644 index 000000000000..7cbaeac71c04 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNetworkRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertNetworkRequest + */ +class InsertNetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Network network_resource = 122105599 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\Network $networkResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertNetworkRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\Network $networkResource): self + { + return (new self()) + ->setProject($project) + ->setNetworkResource($networkResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\Network $network_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). + * } + */ + 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.Network network_resource = 122105599 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Network|null + */ + public function getNetworkResource() + { + return $this->network_resource; + } + + public function hasNetworkResource() + { + return isset($this->network_resource); + } + + public function clearNetworkResource() + { + unset($this->network_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Network network_resource = 122105599 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Network $var + * @return $this + */ + public function setNetworkResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Network::class); + $this->network_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNodeGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNodeGroupRequest.php new file mode 100644 index 000000000000..378ed0221ae6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNodeGroupRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.InsertNodeGroupRequest + */ +class InsertNodeGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Initial count of nodes in the node group. + * + * Generated from protobuf field int32 initial_node_count = 71951469 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $initial_node_count = 0; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeGroup node_group_resource = 505321899 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $node_group_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param int $initialNodeCount Initial count of nodes in the node group. + * @param \Google\Cloud\Compute\V1\NodeGroup $nodeGroupResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertNodeGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, int $initialNodeCount, \Google\Cloud\Compute\V1\NodeGroup $nodeGroupResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInitialNodeCount($initialNodeCount) + ->setNodeGroupResource($nodeGroupResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $initial_node_count + * Initial count of nodes in the node group. + * @type \Google\Cloud\Compute\V1\NodeGroup $node_group_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); + } + + /** + * Initial count of nodes in the node group. + * + * Generated from protobuf field int32 initial_node_count = 71951469 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getInitialNodeCount() + { + return $this->initial_node_count; + } + + /** + * Initial count of nodes in the node group. + * + * Generated from protobuf field int32 initial_node_count = 71951469 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setInitialNodeCount($var) + { + GPBUtil::checkInt32($var); + $this->initial_node_count = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeGroup node_group_resource = 505321899 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NodeGroup|null + */ + public function getNodeGroupResource() + { + return $this->node_group_resource; + } + + public function hasNodeGroupResource() + { + return isset($this->node_group_resource); + } + + public function clearNodeGroupResource() + { + unset($this->node_group_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeGroup node_group_resource = 505321899 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NodeGroup $var + * @return $this + */ + public function setNodeGroupResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NodeGroup::class); + $this->node_group_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNodeTemplateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNodeTemplateRequest.php new file mode 100644 index 000000000000..d0c3de98bd27 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertNodeTemplateRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertNodeTemplateRequest + */ +class InsertNodeTemplateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeTemplate node_template_resource = 127364406 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $node_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"]; + */ + protected $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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param \Google\Cloud\Compute\V1\NodeTemplate $nodeTemplateResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertNodeTemplateRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\NodeTemplate $nodeTemplateResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setNodeTemplateResource($nodeTemplateResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\NodeTemplate $node_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.NodeTemplate node_template_resource = 127364406 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NodeTemplate|null + */ + public function getNodeTemplateResource() + { + return $this->node_template_resource; + } + + public function hasNodeTemplateResource() + { + return isset($this->node_template_resource); + } + + public function clearNodeTemplateResource() + { + unset($this->node_template_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeTemplate node_template_resource = 127364406 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NodeTemplate $var + * @return $this + */ + public function setNodeTemplateResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NodeTemplate::class); + $this->node_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertPacketMirroringRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertPacketMirroringRequest.php new file mode 100644 index 000000000000..5d2c24f8f5be --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertPacketMirroringRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertPacketMirroringRequest + */ +class InsertPacketMirroringRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PacketMirroring packet_mirroring_resource = 493501985 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $packet_mirroring_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"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param \Google\Cloud\Compute\V1\PacketMirroring $packetMirroringResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertPacketMirroringRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\PacketMirroring $packetMirroringResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setPacketMirroringResource($packetMirroringResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\PacketMirroring $packet_mirroring_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * 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.PacketMirroring packet_mirroring_resource = 493501985 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\PacketMirroring|null + */ + public function getPacketMirroringResource() + { + return $this->packet_mirroring_resource; + } + + public function hasPacketMirroringResource() + { + return isset($this->packet_mirroring_resource); + } + + public function clearPacketMirroringResource() + { + unset($this->packet_mirroring_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PacketMirroring packet_mirroring_resource = 493501985 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\PacketMirroring $var + * @return $this + */ + public function setPacketMirroringResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\PacketMirroring::class); + $this->packet_mirroring_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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertPublicAdvertisedPrefixeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertPublicAdvertisedPrefixeRequest.php new file mode 100644 index 000000000000..0ecf803fd676 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertPublicAdvertisedPrefixeRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest + */ +class InsertPublicAdvertisedPrefixeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PublicAdvertisedPrefix public_advertised_prefix_resource = 233614223 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $public_advertised_prefix_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\PublicAdvertisedPrefix $publicAdvertisedPrefixResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertPublicAdvertisedPrefixeRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\PublicAdvertisedPrefix $publicAdvertisedPrefixResource): self + { + return (new self()) + ->setProject($project) + ->setPublicAdvertisedPrefixResource($publicAdvertisedPrefixResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type \Google\Cloud\Compute\V1\PublicAdvertisedPrefix $public_advertised_prefix_resource + * The body resource 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); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PublicAdvertisedPrefix public_advertised_prefix_resource = 233614223 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\PublicAdvertisedPrefix|null + */ + public function getPublicAdvertisedPrefixResource() + { + return $this->public_advertised_prefix_resource; + } + + public function hasPublicAdvertisedPrefixResource() + { + return isset($this->public_advertised_prefix_resource); + } + + public function clearPublicAdvertisedPrefixResource() + { + unset($this->public_advertised_prefix_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PublicAdvertisedPrefix public_advertised_prefix_resource = 233614223 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\PublicAdvertisedPrefix $var + * @return $this + */ + public function setPublicAdvertisedPrefixResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\PublicAdvertisedPrefix::class); + $this->public_advertised_prefix_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertPublicDelegatedPrefixeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertPublicDelegatedPrefixeRequest.php new file mode 100644 index 000000000000..44d3d3f81daf --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertPublicDelegatedPrefixeRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest + */ +class InsertPublicDelegatedPrefixeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PublicDelegatedPrefix public_delegated_prefix_resource = 47594501 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $public_delegated_prefix_resource = null; + /** + * Name of the region of this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region of this request. + * @param \Google\Cloud\Compute\V1\PublicDelegatedPrefix $publicDelegatedPrefixResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertPublicDelegatedPrefixeRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\PublicDelegatedPrefix $publicDelegatedPrefixResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type \Google\Cloud\Compute\V1\PublicDelegatedPrefix $public_delegated_prefix_resource + * The body resource for this request + * @type string $region + * Name of the region of 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); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PublicDelegatedPrefix public_delegated_prefix_resource = 47594501 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\PublicDelegatedPrefix|null + */ + public function getPublicDelegatedPrefixResource() + { + return $this->public_delegated_prefix_resource; + } + + public function hasPublicDelegatedPrefixResource() + { + return isset($this->public_delegated_prefix_resource); + } + + public function clearPublicDelegatedPrefixResource() + { + unset($this->public_delegated_prefix_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PublicDelegatedPrefix public_delegated_prefix_resource = 47594501 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\PublicDelegatedPrefix $var + * @return $this + */ + public function setPublicDelegatedPrefixResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\PublicDelegatedPrefix::class); + $this->public_delegated_prefix_resource = $var; + + return $this; + } + + /** + * Name of the region of 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; + } + + /** + * Name of the region of 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionAutoscalerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionAutoscalerRequest.php new file mode 100644 index 000000000000..92e30278880c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionAutoscalerRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertRegionAutoscalerRequest + */ +class InsertRegionAutoscalerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Autoscaler autoscaler_resource = 207616118 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $autoscaler_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"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param \Google\Cloud\Compute\V1\Autoscaler $autoscalerResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertRegionAutoscalerRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\Autoscaler $autoscalerResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setAutoscalerResource($autoscalerResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\Autoscaler $autoscaler_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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.Autoscaler autoscaler_resource = 207616118 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Autoscaler|null + */ + public function getAutoscalerResource() + { + return $this->autoscaler_resource; + } + + public function hasAutoscalerResource() + { + return isset($this->autoscaler_resource); + } + + public function clearAutoscalerResource() + { + unset($this->autoscaler_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Autoscaler autoscaler_resource = 207616118 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Autoscaler $var + * @return $this + */ + public function setAutoscalerResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Autoscaler::class); + $this->autoscaler_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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionBackendServiceRequest.php new file mode 100644 index 000000000000..5ca25c1aefa3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionBackendServiceRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertRegionBackendServiceRequest + */ +class InsertRegionBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendService backend_service_resource = 347586723 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_service_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"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param \Google\Cloud\Compute\V1\BackendService $backendServiceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertRegionBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\BackendService $backendServiceResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setBackendServiceResource($backendServiceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\BackendService $backend_service_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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.BackendService backend_service_resource = 347586723 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\BackendService|null + */ + public function getBackendServiceResource() + { + return $this->backend_service_resource; + } + + public function hasBackendServiceResource() + { + return isset($this->backend_service_resource); + } + + public function clearBackendServiceResource() + { + unset($this->backend_service_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendService backend_service_resource = 347586723 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\BackendService $var + * @return $this + */ + public function setBackendServiceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BackendService::class); + $this->backend_service_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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionCommitmentRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionCommitmentRequest.php new file mode 100644 index 000000000000..6910998b31bd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionCommitmentRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertRegionCommitmentRequest + */ +class InsertRegionCommitmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Commitment commitment_resource = 244240888 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $commitment_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"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param \Google\Cloud\Compute\V1\Commitment $commitmentResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertRegionCommitmentRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\Commitment $commitmentResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setCommitmentResource($commitmentResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\Commitment $commitment_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * 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.Commitment commitment_resource = 244240888 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Commitment|null + */ + public function getCommitmentResource() + { + return $this->commitment_resource; + } + + public function hasCommitmentResource() + { + return isset($this->commitment_resource); + } + + public function clearCommitmentResource() + { + unset($this->commitment_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Commitment commitment_resource = 244240888 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Commitment $var + * @return $this + */ + public function setCommitmentResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Commitment::class); + $this->commitment_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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionDiskRequest.php new file mode 100644 index 000000000000..057a42a1598c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionDiskRequest.php @@ -0,0 +1,250 @@ +google.cloud.compute.v1.InsertRegionDiskRequest + */ +class InsertRegionDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Disk disk_resource = 25880688 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk_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"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Source image to restore onto a disk. This field is optional. + * + * Generated from protobuf field optional string source_image = 50443319; + */ + protected $source_image = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param \Google\Cloud\Compute\V1\Disk $diskResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertRegionDiskRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\Disk $diskResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setDiskResource($diskResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\Disk $disk_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * 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 $source_image + * Source image to restore onto a disk. This field is optional. + * } + */ + 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.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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Source image to restore onto a disk. This field is optional. + * + * Generated from protobuf field optional string source_image = 50443319; + * @return string + */ + public function getSourceImage() + { + return isset($this->source_image) ? $this->source_image : ''; + } + + public function hasSourceImage() + { + return isset($this->source_image); + } + + public function clearSourceImage() + { + unset($this->source_image); + } + + /** + * Source image to restore onto a disk. This field is optional. + * + * Generated from protobuf field optional string source_image = 50443319; + * @param string $var + * @return $this + */ + public function setSourceImage($var) + { + GPBUtil::checkString($var, True); + $this->source_image = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionHealthCheckRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionHealthCheckRequest.php new file mode 100644 index 000000000000..11667cdb33fc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionHealthCheckRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertRegionHealthCheckRequest + */ +class InsertRegionHealthCheckRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.HealthCheck health_check_resource = 201925032 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $health_check_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"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param \Google\Cloud\Compute\V1\HealthCheck $healthCheckResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertRegionHealthCheckRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\HealthCheck $healthCheckResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setHealthCheckResource($healthCheckResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\HealthCheck $health_check_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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.HealthCheck health_check_resource = 201925032 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\HealthCheck|null + */ + public function getHealthCheckResource() + { + return $this->health_check_resource; + } + + public function hasHealthCheckResource() + { + return isset($this->health_check_resource); + } + + public function clearHealthCheckResource() + { + unset($this->health_check_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.HealthCheck health_check_resource = 201925032 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\HealthCheck $var + * @return $this + */ + public function setHealthCheckResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HealthCheck::class); + $this->health_check_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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionHealthCheckServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionHealthCheckServiceRequest.php new file mode 100644 index 000000000000..bbdcd14c97e9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionHealthCheckServiceRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest + */ +class InsertRegionHealthCheckServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.HealthCheckService health_check_service_resource = 477367794 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $health_check_service_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"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param \Google\Cloud\Compute\V1\HealthCheckService $healthCheckServiceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertRegionHealthCheckServiceRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\HealthCheckService $healthCheckServiceResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setHealthCheckServiceResource($healthCheckServiceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\HealthCheckService $health_check_service_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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.HealthCheckService health_check_service_resource = 477367794 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\HealthCheckService|null + */ + public function getHealthCheckServiceResource() + { + return $this->health_check_service_resource; + } + + public function hasHealthCheckServiceResource() + { + return isset($this->health_check_service_resource); + } + + public function clearHealthCheckServiceResource() + { + unset($this->health_check_service_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.HealthCheckService health_check_service_resource = 477367794 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\HealthCheckService $var + * @return $this + */ + public function setHealthCheckServiceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HealthCheckService::class); + $this->health_check_service_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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..96d755e7777b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionInstanceGroupManagerRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest + */ +class InsertRegionInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManager instance_group_manager_resource = 261063946 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager_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"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param \Google\Cloud\Compute\V1\InstanceGroupManager $instanceGroupManagerResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertRegionInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\InstanceGroupManager $instanceGroupManagerResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroupManagerResource($instanceGroupManagerResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\InstanceGroupManager $instance_group_manager_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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.InstanceGroupManager instance_group_manager_resource = 261063946 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupManager|null + */ + public function getInstanceGroupManagerResource() + { + return $this->instance_group_manager_resource; + } + + public function hasInstanceGroupManagerResource() + { + return isset($this->instance_group_manager_resource); + } + + public function clearInstanceGroupManagerResource() + { + unset($this->instance_group_manager_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManager instance_group_manager_resource = 261063946 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupManager $var + * @return $this + */ + public function setInstanceGroupManagerResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManager::class); + $this->instance_group_manager_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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionInstanceTemplateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionInstanceTemplateRequest.php new file mode 100644 index 000000000000..8aa962c77777 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionInstanceTemplateRequest.php @@ -0,0 +1,206 @@ +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]; + */ + protected $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"]; + */ + protected $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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param \Google\Cloud\Compute\V1\InstanceTemplate $instanceTemplateResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertRegionInstanceTemplateRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\InstanceTemplate $instanceTemplateResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceTemplateResource($instanceTemplateResource); + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionInstantSnapshotRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionInstantSnapshotRequest.php new file mode 100644 index 000000000000..69727e472e1f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionInstantSnapshotRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertRegionInstantSnapshotRequest + */ +class InsertRegionInstantSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstantSnapshot instant_snapshot_resource = 383915339 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instant_snapshot_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"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param \Google\Cloud\Compute\V1\InstantSnapshot $instantSnapshotResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertRegionInstantSnapshotRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\InstantSnapshot $instantSnapshotResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstantSnapshotResource($instantSnapshotResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\InstantSnapshot $instant_snapshot_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * 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.InstantSnapshot instant_snapshot_resource = 383915339 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstantSnapshot|null + */ + public function getInstantSnapshotResource() + { + return $this->instant_snapshot_resource; + } + + public function hasInstantSnapshotResource() + { + return isset($this->instant_snapshot_resource); + } + + public function clearInstantSnapshotResource() + { + unset($this->instant_snapshot_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstantSnapshot instant_snapshot_resource = 383915339 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstantSnapshot $var + * @return $this + */ + public function setInstantSnapshotResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstantSnapshot::class); + $this->instant_snapshot_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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionNetworkEndpointGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionNetworkEndpointGroupRequest.php new file mode 100644 index 000000000000..c3fc459a8faa --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionNetworkEndpointGroupRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest + */ +class InsertRegionNetworkEndpointGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkEndpointGroup network_endpoint_group_resource = 525788839 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_endpoint_group_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"]; + */ + protected $project = ''; + /** + * The name of the region where you want to create the network endpoint group. It should comply with RFC1035. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region where you want to create the network endpoint group. It should comply with RFC1035. + * @param \Google\Cloud\Compute\V1\NetworkEndpointGroup $networkEndpointGroupResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertRegionNetworkEndpointGroupRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\NetworkEndpointGroup $networkEndpointGroupResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setNetworkEndpointGroupResource($networkEndpointGroupResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\NetworkEndpointGroup $network_endpoint_group_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region where you want to create the network endpoint group. It should comply with RFC1035. + * @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.NetworkEndpointGroup network_endpoint_group_resource = 525788839 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NetworkEndpointGroup|null + */ + public function getNetworkEndpointGroupResource() + { + return $this->network_endpoint_group_resource; + } + + public function hasNetworkEndpointGroupResource() + { + return isset($this->network_endpoint_group_resource); + } + + public function clearNetworkEndpointGroupResource() + { + unset($this->network_endpoint_group_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkEndpointGroup network_endpoint_group_resource = 525788839 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NetworkEndpointGroup $var + * @return $this + */ + public function setNetworkEndpointGroupResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkEndpointGroup::class); + $this->network_endpoint_group_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 where you want to create the network endpoint group. It should comply with RFC1035. + * + * 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 where you want to create the network endpoint group. It should comply with RFC1035. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..0a8515cf48ea --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionNetworkFirewallPolicyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertRegionNetworkFirewallPolicyRequest + */ +class InsertRegionNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicy firewall_policy_resource = 495049532 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy_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"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param \Google\Cloud\Compute\V1\FirewallPolicy $firewallPolicyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertRegionNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\FirewallPolicy $firewallPolicyResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setFirewallPolicyResource($firewallPolicyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\FirewallPolicy $firewall_policy_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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.FirewallPolicy firewall_policy_resource = 495049532 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\FirewallPolicy|null + */ + public function getFirewallPolicyResource() + { + return $this->firewall_policy_resource; + } + + public function hasFirewallPolicyResource() + { + return isset($this->firewall_policy_resource); + } + + public function clearFirewallPolicyResource() + { + unset($this->firewall_policy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicy firewall_policy_resource = 495049532 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\FirewallPolicy $var + * @return $this + */ + public function setFirewallPolicyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\FirewallPolicy::class); + $this->firewall_policy_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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionNotificationEndpointRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionNotificationEndpointRequest.php new file mode 100644 index 000000000000..054b32eba597 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionNotificationEndpointRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertRegionNotificationEndpointRequest + */ +class InsertRegionNotificationEndpointRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NotificationEndpoint notification_endpoint_resource = 338459940 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $notification_endpoint_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"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param \Google\Cloud\Compute\V1\NotificationEndpoint $notificationEndpointResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertRegionNotificationEndpointRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\NotificationEndpoint $notificationEndpointResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setNotificationEndpointResource($notificationEndpointResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\NotificationEndpoint $notification_endpoint_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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.NotificationEndpoint notification_endpoint_resource = 338459940 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NotificationEndpoint|null + */ + public function getNotificationEndpointResource() + { + return $this->notification_endpoint_resource; + } + + public function hasNotificationEndpointResource() + { + return isset($this->notification_endpoint_resource); + } + + public function clearNotificationEndpointResource() + { + unset($this->notification_endpoint_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NotificationEndpoint notification_endpoint_resource = 338459940 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NotificationEndpoint $var + * @return $this + */ + public function setNotificationEndpointResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NotificationEndpoint::class); + $this->notification_endpoint_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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionSecurityPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionSecurityPolicyRequest.php new file mode 100644 index 000000000000..3e2c4a5e7bde --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionSecurityPolicyRequest.php @@ -0,0 +1,250 @@ +google.cloud.compute.v1.InsertRegionSecurityPolicyRequest + */ +class InsertRegionSecurityPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicy security_policy_resource = 216159612 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy_resource = null; + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + */ + protected $validate_only = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param \Google\Cloud\Compute\V1\SecurityPolicy $securityPolicyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertRegionSecurityPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\SecurityPolicy $securityPolicyResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicyResource($securityPolicyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 \Google\Cloud\Compute\V1\SecurityPolicy $security_policy_resource + * The body resource for this request + * @type bool $validate_only + * If true, the request will not be committed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicy security_policy_resource = 216159612 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SecurityPolicy|null + */ + public function getSecurityPolicyResource() + { + return $this->security_policy_resource; + } + + public function hasSecurityPolicyResource() + { + return isset($this->security_policy_resource); + } + + public function clearSecurityPolicyResource() + { + unset($this->security_policy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicy security_policy_resource = 216159612 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SecurityPolicy $var + * @return $this + */ + public function setSecurityPolicyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicy::class); + $this->security_policy_resource = $var; + + return $this; + } + + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + * @return bool + */ + public function getValidateOnly() + { + return isset($this->validate_only) ? $this->validate_only : false; + } + + public function hasValidateOnly() + { + return isset($this->validate_only); + } + + public function clearValidateOnly() + { + unset($this->validate_only); + } + + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionSslCertificateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionSslCertificateRequest.php new file mode 100644 index 000000000000..e6669aff7ac3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionSslCertificateRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertRegionSslCertificateRequest + */ +class InsertRegionSslCertificateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslCertificate ssl_certificate_resource = 180709897 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ssl_certificate_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param \Google\Cloud\Compute\V1\SslCertificate $sslCertificateResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertRegionSslCertificateRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\SslCertificate $sslCertificateResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setSslCertificateResource($sslCertificateResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 \Google\Cloud\Compute\V1\SslCertificate $ssl_certificate_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslCertificate ssl_certificate_resource = 180709897 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SslCertificate|null + */ + public function getSslCertificateResource() + { + return $this->ssl_certificate_resource; + } + + public function hasSslCertificateResource() + { + return isset($this->ssl_certificate_resource); + } + + public function clearSslCertificateResource() + { + unset($this->ssl_certificate_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslCertificate ssl_certificate_resource = 180709897 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SslCertificate $var + * @return $this + */ + public function setSslCertificateResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SslCertificate::class); + $this->ssl_certificate_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionSslPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionSslPolicyRequest.php new file mode 100644 index 000000000000..132f4e359c18 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionSslPolicyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertRegionSslPolicyRequest + */ +class InsertRegionSslPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslPolicy ssl_policy_resource = 274891848 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ssl_policy_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param \Google\Cloud\Compute\V1\SslPolicy $sslPolicyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertRegionSslPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\SslPolicy $sslPolicyResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setSslPolicyResource($sslPolicyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 \Google\Cloud\Compute\V1\SslPolicy $ssl_policy_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslPolicy ssl_policy_resource = 274891848 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SslPolicy|null + */ + public function getSslPolicyResource() + { + return $this->ssl_policy_resource; + } + + public function hasSslPolicyResource() + { + return isset($this->ssl_policy_resource); + } + + public function clearSslPolicyResource() + { + unset($this->ssl_policy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslPolicy ssl_policy_resource = 274891848 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SslPolicy $var + * @return $this + */ + public function setSslPolicyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SslPolicy::class); + $this->ssl_policy_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionTargetHttpProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionTargetHttpProxyRequest.php new file mode 100644 index 000000000000..7d09efedc9fe --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionTargetHttpProxyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest + */ +class InsertRegionTargetHttpProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpProxy target_http_proxy_resource = 24696744 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_http_proxy_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param \Google\Cloud\Compute\V1\TargetHttpProxy $targetHttpProxyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertRegionTargetHttpProxyRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\TargetHttpProxy $targetHttpProxyResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpProxyResource($targetHttpProxyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 \Google\Cloud\Compute\V1\TargetHttpProxy $target_http_proxy_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpProxy target_http_proxy_resource = 24696744 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetHttpProxy|null + */ + public function getTargetHttpProxyResource() + { + return $this->target_http_proxy_resource; + } + + public function hasTargetHttpProxyResource() + { + return isset($this->target_http_proxy_resource); + } + + public function clearTargetHttpProxyResource() + { + unset($this->target_http_proxy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpProxy target_http_proxy_resource = 24696744 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetHttpProxy $var + * @return $this + */ + public function setTargetHttpProxyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetHttpProxy::class); + $this->target_http_proxy_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionTargetHttpsProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionTargetHttpsProxyRequest.php new file mode 100644 index 000000000000..85367f9a11c9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionTargetHttpsProxyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest + */ +class InsertRegionTargetHttpsProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpsProxy target_https_proxy_resource = 433657473 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_https_proxy_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param \Google\Cloud\Compute\V1\TargetHttpsProxy $targetHttpsProxyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertRegionTargetHttpsProxyRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\TargetHttpsProxy $targetHttpsProxyResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpsProxyResource($targetHttpsProxyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 \Google\Cloud\Compute\V1\TargetHttpsProxy $target_https_proxy_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpsProxy target_https_proxy_resource = 433657473 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetHttpsProxy|null + */ + public function getTargetHttpsProxyResource() + { + return $this->target_https_proxy_resource; + } + + public function hasTargetHttpsProxyResource() + { + return isset($this->target_https_proxy_resource); + } + + public function clearTargetHttpsProxyResource() + { + unset($this->target_https_proxy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpsProxy target_https_proxy_resource = 433657473 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetHttpsProxy $var + * @return $this + */ + public function setTargetHttpsProxyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetHttpsProxy::class); + $this->target_https_proxy_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionTargetTcpProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionTargetTcpProxyRequest.php new file mode 100644 index 000000000000..c2fa58592c58 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionTargetTcpProxyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertRegionTargetTcpProxyRequest + */ +class InsertRegionTargetTcpProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetTcpProxy target_tcp_proxy_resource = 145913931 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_tcp_proxy_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param \Google\Cloud\Compute\V1\TargetTcpProxy $targetTcpProxyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertRegionTargetTcpProxyRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\TargetTcpProxy $targetTcpProxyResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetTcpProxyResource($targetTcpProxyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 \Google\Cloud\Compute\V1\TargetTcpProxy $target_tcp_proxy_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetTcpProxy target_tcp_proxy_resource = 145913931 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetTcpProxy|null + */ + public function getTargetTcpProxyResource() + { + return $this->target_tcp_proxy_resource; + } + + public function hasTargetTcpProxyResource() + { + return isset($this->target_tcp_proxy_resource); + } + + public function clearTargetTcpProxyResource() + { + unset($this->target_tcp_proxy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetTcpProxy target_tcp_proxy_resource = 145913931 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetTcpProxy $var + * @return $this + */ + public function setTargetTcpProxyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetTcpProxy::class); + $this->target_tcp_proxy_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionUrlMapRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionUrlMapRequest.php new file mode 100644 index 000000000000..c499bbc3afc6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRegionUrlMapRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertRegionUrlMapRequest + */ +class InsertRegionUrlMapRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * + * Generated from protobuf field optional string request_id = 37109963; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMap url_map_resource = 168675425 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url_map_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param \Google\Cloud\Compute\V1\UrlMap $urlMapResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertRegionUrlMapRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\UrlMap $urlMapResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setUrlMapResource($urlMapResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type string $request_id + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * @type \Google\Cloud\Compute\V1\UrlMap $url_map_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * + * 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); + } + + /** + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMap url_map_resource = 168675425 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\UrlMap|null + */ + public function getUrlMapResource() + { + return $this->url_map_resource; + } + + public function hasUrlMapResource() + { + return isset($this->url_map_resource); + } + + public function clearUrlMapResource() + { + unset($this->url_map_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMap url_map_resource = 168675425 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\UrlMap $var + * @return $this + */ + public function setUrlMapResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\UrlMap::class); + $this->url_map_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertReservationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertReservationRequest.php new file mode 100644 index 000000000000..c92403f12dd0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertReservationRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertReservationRequest + */ +class InsertReservationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Reservation reservation_resource = 285030177 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $reservation_resource = null; + /** + * 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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone for this request. + * @param \Google\Cloud\Compute\V1\Reservation $reservationResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertReservationRequest + * + * @experimental + */ + public static function build(string $project, string $zone, \Google\Cloud\Compute\V1\Reservation $reservationResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setReservationResource($reservationResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\Reservation $reservation_resource + * The body resource for this request + * @type string $zone + * Name of the zone for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Reservation reservation_resource = 285030177 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Reservation|null + */ + public function getReservationResource() + { + return $this->reservation_resource; + } + + public function hasReservationResource() + { + return isset($this->reservation_resource); + } + + public function clearReservationResource() + { + unset($this->reservation_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Reservation reservation_resource = 285030177 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Reservation $var + * @return $this + */ + public function setReservationResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Reservation::class); + $this->reservation_resource = $var; + + return $this; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertResourcePolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertResourcePolicyRequest.php new file mode 100644 index 000000000000..aad8ec9ba28f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertResourcePolicyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertResourcePolicyRequest + */ +class InsertResourcePolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ResourcePolicy resource_policy_resource = 76826186 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource_policy_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param \Google\Cloud\Compute\V1\ResourcePolicy $resourcePolicyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertResourcePolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\ResourcePolicy $resourcePolicyResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResourcePolicyResource($resourcePolicyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * 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 \Google\Cloud\Compute\V1\ResourcePolicy $resource_policy_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ResourcePolicy resource_policy_resource = 76826186 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ResourcePolicy|null + */ + public function getResourcePolicyResource() + { + return $this->resource_policy_resource; + } + + public function hasResourcePolicyResource() + { + return isset($this->resource_policy_resource); + } + + public function clearResourcePolicyResource() + { + unset($this->resource_policy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ResourcePolicy resource_policy_resource = 76826186 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ResourcePolicy $var + * @return $this + */ + public function setResourcePolicyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ResourcePolicy::class); + $this->resource_policy_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRouteRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRouteRequest.php new file mode 100644 index 000000000000..cfdc5cee8ab2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRouteRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertRouteRequest + */ +class InsertRouteRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Route route_resource = 225428804 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $route_resource = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\Route $routeResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertRouteRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\Route $routeResource): self + { + return (new self()) + ->setProject($project) + ->setRouteResource($routeResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\Route $route_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Route route_resource = 225428804 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Route|null + */ + public function getRouteResource() + { + return $this->route_resource; + } + + public function hasRouteResource() + { + return isset($this->route_resource); + } + + public function clearRouteResource() + { + unset($this->route_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Route route_resource = 225428804 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Route $var + * @return $this + */ + public function setRouteResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Route::class); + $this->route_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRouterRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRouterRequest.php new file mode 100644 index 000000000000..0a5b41360187 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertRouterRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertRouterRequest + */ +class InsertRouterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Router router_resource = 155222084 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $router_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param \Google\Cloud\Compute\V1\Router $routerResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertRouterRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\Router $routerResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setRouterResource($routerResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * 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 \Google\Cloud\Compute\V1\Router $router_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Router router_resource = 155222084 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Router|null + */ + public function getRouterResource() + { + return $this->router_resource; + } + + public function hasRouterResource() + { + return isset($this->router_resource); + } + + public function clearRouterResource() + { + unset($this->router_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Router router_resource = 155222084 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Router $var + * @return $this + */ + public function setRouterResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Router::class); + $this->router_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertSecurityPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertSecurityPolicyRequest.php new file mode 100644 index 000000000000..93e7e0e4044a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertSecurityPolicyRequest.php @@ -0,0 +1,214 @@ +google.cloud.compute.v1.InsertSecurityPolicyRequest + */ +class InsertSecurityPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicy security_policy_resource = 216159612 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy_resource = null; + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + */ + protected $validate_only = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\SecurityPolicy $securityPolicyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertSecurityPolicyRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\SecurityPolicy $securityPolicyResource): self + { + return (new self()) + ->setProject($project) + ->setSecurityPolicyResource($securityPolicyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\SecurityPolicy $security_policy_resource + * The body resource for this request + * @type bool $validate_only + * If true, the request will not be committed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicy security_policy_resource = 216159612 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SecurityPolicy|null + */ + public function getSecurityPolicyResource() + { + return $this->security_policy_resource; + } + + public function hasSecurityPolicyResource() + { + return isset($this->security_policy_resource); + } + + public function clearSecurityPolicyResource() + { + unset($this->security_policy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicy security_policy_resource = 216159612 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SecurityPolicy $var + * @return $this + */ + public function setSecurityPolicyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicy::class); + $this->security_policy_resource = $var; + + return $this; + } + + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + * @return bool + */ + public function getValidateOnly() + { + return isset($this->validate_only) ? $this->validate_only : false; + } + + public function hasValidateOnly() + { + return isset($this->validate_only); + } + + public function clearValidateOnly() + { + unset($this->validate_only); + } + + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertServiceAttachmentRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertServiceAttachmentRequest.php new file mode 100644 index 000000000000..65bbdca288ae --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertServiceAttachmentRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertServiceAttachmentRequest + */ +class InsertServiceAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region of this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ServiceAttachment service_attachment_resource = 472980256 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service_attachment_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region of this request. + * @param \Google\Cloud\Compute\V1\ServiceAttachment $serviceAttachmentResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertServiceAttachmentRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\ServiceAttachment $serviceAttachmentResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setServiceAttachmentResource($serviceAttachmentResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region of 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 \Google\Cloud\Compute\V1\ServiceAttachment $service_attachment_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region of 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; + } + + /** + * Name of the region of 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ServiceAttachment service_attachment_resource = 472980256 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ServiceAttachment|null + */ + public function getServiceAttachmentResource() + { + return $this->service_attachment_resource; + } + + public function hasServiceAttachmentResource() + { + return isset($this->service_attachment_resource); + } + + public function clearServiceAttachmentResource() + { + unset($this->service_attachment_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ServiceAttachment service_attachment_resource = 472980256 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ServiceAttachment $var + * @return $this + */ + public function setServiceAttachmentResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ServiceAttachment::class); + $this->service_attachment_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertSnapshotRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertSnapshotRequest.php new file mode 100644 index 000000000000..ffa22aee82ae --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertSnapshotRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertSnapshotRequest + */ +class InsertSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Snapshot snapshot_resource = 481319977 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $snapshot_resource = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\Snapshot $snapshotResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertSnapshotRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\Snapshot $snapshotResource): self + { + return (new self()) + ->setProject($project) + ->setSnapshotResource($snapshotResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\Snapshot $snapshot_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Snapshot snapshot_resource = 481319977 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Snapshot|null + */ + public function getSnapshotResource() + { + return $this->snapshot_resource; + } + + public function hasSnapshotResource() + { + return isset($this->snapshot_resource); + } + + public function clearSnapshotResource() + { + unset($this->snapshot_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Snapshot snapshot_resource = 481319977 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Snapshot $var + * @return $this + */ + public function setSnapshotResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Snapshot::class); + $this->snapshot_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertSslCertificateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertSslCertificateRequest.php new file mode 100644 index 000000000000..c17c7816724f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertSslCertificateRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertSslCertificateRequest + */ +class InsertSslCertificateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslCertificate ssl_certificate_resource = 180709897 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ssl_certificate_resource = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\SslCertificate $sslCertificateResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertSslCertificateRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\SslCertificate $sslCertificateResource): self + { + return (new self()) + ->setProject($project) + ->setSslCertificateResource($sslCertificateResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\SslCertificate $ssl_certificate_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslCertificate ssl_certificate_resource = 180709897 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SslCertificate|null + */ + public function getSslCertificateResource() + { + return $this->ssl_certificate_resource; + } + + public function hasSslCertificateResource() + { + return isset($this->ssl_certificate_resource); + } + + public function clearSslCertificateResource() + { + unset($this->ssl_certificate_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslCertificate ssl_certificate_resource = 180709897 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SslCertificate $var + * @return $this + */ + public function setSslCertificateResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SslCertificate::class); + $this->ssl_certificate_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertSslPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertSslPolicyRequest.php new file mode 100644 index 000000000000..05227ed7cfab --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertSslPolicyRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertSslPolicyRequest + */ +class InsertSslPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslPolicy ssl_policy_resource = 274891848 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ssl_policy_resource = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\SslPolicy $sslPolicyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertSslPolicyRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\SslPolicy $sslPolicyResource): self + { + return (new self()) + ->setProject($project) + ->setSslPolicyResource($sslPolicyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\SslPolicy $ssl_policy_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslPolicy ssl_policy_resource = 274891848 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SslPolicy|null + */ + public function getSslPolicyResource() + { + return $this->ssl_policy_resource; + } + + public function hasSslPolicyResource() + { + return isset($this->ssl_policy_resource); + } + + public function clearSslPolicyResource() + { + unset($this->ssl_policy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslPolicy ssl_policy_resource = 274891848 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SslPolicy $var + * @return $this + */ + public function setSslPolicyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SslPolicy::class); + $this->ssl_policy_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertStoragePoolRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertStoragePoolRequest.php new file mode 100644 index 000000000000..566d4512dcc7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertStoragePoolRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertStoragePoolRequest + */ +class InsertStoragePoolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.StoragePool storage_pool_resource = 157179405 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $storage_pool_resource = 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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param \Google\Cloud\Compute\V1\StoragePool $storagePoolResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertStoragePoolRequest + * + * @experimental + */ + public static function build(string $project, string $zone, \Google\Cloud\Compute\V1\StoragePool $storagePoolResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setStoragePoolResource($storagePoolResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\StoragePool $storage_pool_resource + * The body resource for 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); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.StoragePool storage_pool_resource = 157179405 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\StoragePool|null + */ + public function getStoragePoolResource() + { + return $this->storage_pool_resource; + } + + public function hasStoragePoolResource() + { + return isset($this->storage_pool_resource); + } + + public function clearStoragePoolResource() + { + unset($this->storage_pool_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.StoragePool storage_pool_resource = 157179405 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\StoragePool $var + * @return $this + */ + public function setStoragePoolResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\StoragePool::class); + $this->storage_pool_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertSubnetworkRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertSubnetworkRequest.php new file mode 100644 index 000000000000..e5eb0d79460d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertSubnetworkRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertSubnetworkRequest + */ +class InsertSubnetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Subnetwork subnetwork_resource = 42233151 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $subnetwork_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param \Google\Cloud\Compute\V1\Subnetwork $subnetworkResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertSubnetworkRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\Subnetwork $subnetworkResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setSubnetworkResource($subnetworkResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 \Google\Cloud\Compute\V1\Subnetwork $subnetwork_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Subnetwork subnetwork_resource = 42233151 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Subnetwork|null + */ + public function getSubnetworkResource() + { + return $this->subnetwork_resource; + } + + public function hasSubnetworkResource() + { + return isset($this->subnetwork_resource); + } + + public function clearSubnetworkResource() + { + unset($this->subnetwork_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Subnetwork subnetwork_resource = 42233151 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Subnetwork $var + * @return $this + */ + public function setSubnetworkResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Subnetwork::class); + $this->subnetwork_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetGrpcProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetGrpcProxyRequest.php new file mode 100644 index 000000000000..cb5223d2f82e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetGrpcProxyRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertTargetGrpcProxyRequest + */ +class InsertTargetGrpcProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetGrpcProxy target_grpc_proxy_resource = 328922450 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_grpc_proxy_resource = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\TargetGrpcProxy $targetGrpcProxyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertTargetGrpcProxyRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\TargetGrpcProxy $targetGrpcProxyResource): self + { + return (new self()) + ->setProject($project) + ->setTargetGrpcProxyResource($targetGrpcProxyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\TargetGrpcProxy $target_grpc_proxy_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetGrpcProxy target_grpc_proxy_resource = 328922450 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetGrpcProxy|null + */ + public function getTargetGrpcProxyResource() + { + return $this->target_grpc_proxy_resource; + } + + public function hasTargetGrpcProxyResource() + { + return isset($this->target_grpc_proxy_resource); + } + + public function clearTargetGrpcProxyResource() + { + unset($this->target_grpc_proxy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetGrpcProxy target_grpc_proxy_resource = 328922450 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetGrpcProxy $var + * @return $this + */ + public function setTargetGrpcProxyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetGrpcProxy::class); + $this->target_grpc_proxy_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetHttpProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetHttpProxyRequest.php new file mode 100644 index 000000000000..a1ed3222aa5f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetHttpProxyRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertTargetHttpProxyRequest + */ +class InsertTargetHttpProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpProxy target_http_proxy_resource = 24696744 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_http_proxy_resource = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\TargetHttpProxy $targetHttpProxyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertTargetHttpProxyRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\TargetHttpProxy $targetHttpProxyResource): self + { + return (new self()) + ->setProject($project) + ->setTargetHttpProxyResource($targetHttpProxyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\TargetHttpProxy $target_http_proxy_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpProxy target_http_proxy_resource = 24696744 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetHttpProxy|null + */ + public function getTargetHttpProxyResource() + { + return $this->target_http_proxy_resource; + } + + public function hasTargetHttpProxyResource() + { + return isset($this->target_http_proxy_resource); + } + + public function clearTargetHttpProxyResource() + { + unset($this->target_http_proxy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpProxy target_http_proxy_resource = 24696744 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetHttpProxy $var + * @return $this + */ + public function setTargetHttpProxyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetHttpProxy::class); + $this->target_http_proxy_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetHttpsProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetHttpsProxyRequest.php new file mode 100644 index 000000000000..efc822a11f5b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetHttpsProxyRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertTargetHttpsProxyRequest + */ +class InsertTargetHttpsProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpsProxy target_https_proxy_resource = 433657473 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_https_proxy_resource = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\TargetHttpsProxy $targetHttpsProxyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertTargetHttpsProxyRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\TargetHttpsProxy $targetHttpsProxyResource): self + { + return (new self()) + ->setProject($project) + ->setTargetHttpsProxyResource($targetHttpsProxyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\TargetHttpsProxy $target_https_proxy_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpsProxy target_https_proxy_resource = 433657473 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetHttpsProxy|null + */ + public function getTargetHttpsProxyResource() + { + return $this->target_https_proxy_resource; + } + + public function hasTargetHttpsProxyResource() + { + return isset($this->target_https_proxy_resource); + } + + public function clearTargetHttpsProxyResource() + { + unset($this->target_https_proxy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpsProxy target_https_proxy_resource = 433657473 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetHttpsProxy $var + * @return $this + */ + public function setTargetHttpsProxyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetHttpsProxy::class); + $this->target_https_proxy_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetInstanceRequest.php new file mode 100644 index 000000000000..f01d136b3487 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetInstanceRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertTargetInstanceRequest + */ +class InsertTargetInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetInstance target_instance_resource = 430453066 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_instance_resource = null; + /** + * Name of the zone scoping this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone scoping this request. + * @param \Google\Cloud\Compute\V1\TargetInstance $targetInstanceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertTargetInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, \Google\Cloud\Compute\V1\TargetInstance $targetInstanceResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setTargetInstanceResource($targetInstanceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\TargetInstance $target_instance_resource + * The body resource for this request + * @type string $zone + * Name of the zone scoping this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetInstance target_instance_resource = 430453066 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetInstance|null + */ + public function getTargetInstanceResource() + { + return $this->target_instance_resource; + } + + public function hasTargetInstanceResource() + { + return isset($this->target_instance_resource); + } + + public function clearTargetInstanceResource() + { + unset($this->target_instance_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetInstance target_instance_resource = 430453066 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetInstance $var + * @return $this + */ + public function setTargetInstanceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetInstance::class); + $this->target_instance_resource = $var; + + return $this; + } + + /** + * Name of the zone scoping 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; + } + + /** + * Name of the zone scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetPoolRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetPoolRequest.php new file mode 100644 index 000000000000..f4f95bbcf8b3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetPoolRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertTargetPoolRequest + */ +class InsertTargetPoolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetPool target_pool_resource = 101281443 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_pool_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param \Google\Cloud\Compute\V1\TargetPool $targetPoolResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertTargetPoolRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\TargetPool $targetPoolResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetPoolResource($targetPoolResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 \Google\Cloud\Compute\V1\TargetPool $target_pool_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetPool target_pool_resource = 101281443 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetPool|null + */ + public function getTargetPoolResource() + { + return $this->target_pool_resource; + } + + public function hasTargetPoolResource() + { + return isset($this->target_pool_resource); + } + + public function clearTargetPoolResource() + { + unset($this->target_pool_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetPool target_pool_resource = 101281443 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetPool $var + * @return $this + */ + public function setTargetPoolResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetPool::class); + $this->target_pool_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetSslProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetSslProxyRequest.php new file mode 100644 index 000000000000..4e9df21fe6ec --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetSslProxyRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertTargetSslProxyRequest + */ +class InsertTargetSslProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetSslProxy target_ssl_proxy_resource = 142016192 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_ssl_proxy_resource = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\TargetSslProxy $targetSslProxyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertTargetSslProxyRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\TargetSslProxy $targetSslProxyResource): self + { + return (new self()) + ->setProject($project) + ->setTargetSslProxyResource($targetSslProxyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\TargetSslProxy $target_ssl_proxy_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetSslProxy target_ssl_proxy_resource = 142016192 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetSslProxy|null + */ + public function getTargetSslProxyResource() + { + return $this->target_ssl_proxy_resource; + } + + public function hasTargetSslProxyResource() + { + return isset($this->target_ssl_proxy_resource); + } + + public function clearTargetSslProxyResource() + { + unset($this->target_ssl_proxy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetSslProxy target_ssl_proxy_resource = 142016192 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetSslProxy $var + * @return $this + */ + public function setTargetSslProxyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetSslProxy::class); + $this->target_ssl_proxy_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetTcpProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetTcpProxyRequest.php new file mode 100644 index 000000000000..92809a5655f6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetTcpProxyRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertTargetTcpProxyRequest + */ +class InsertTargetTcpProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetTcpProxy target_tcp_proxy_resource = 145913931 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_tcp_proxy_resource = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\TargetTcpProxy $targetTcpProxyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertTargetTcpProxyRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\TargetTcpProxy $targetTcpProxyResource): self + { + return (new self()) + ->setProject($project) + ->setTargetTcpProxyResource($targetTcpProxyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\TargetTcpProxy $target_tcp_proxy_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetTcpProxy target_tcp_proxy_resource = 145913931 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetTcpProxy|null + */ + public function getTargetTcpProxyResource() + { + return $this->target_tcp_proxy_resource; + } + + public function hasTargetTcpProxyResource() + { + return isset($this->target_tcp_proxy_resource); + } + + public function clearTargetTcpProxyResource() + { + unset($this->target_tcp_proxy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetTcpProxy target_tcp_proxy_resource = 145913931 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetTcpProxy $var + * @return $this + */ + public function setTargetTcpProxyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetTcpProxy::class); + $this->target_tcp_proxy_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetVpnGatewayRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetVpnGatewayRequest.php new file mode 100644 index 000000000000..ab53a49457e1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertTargetVpnGatewayRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertTargetVpnGatewayRequest + */ +class InsertTargetVpnGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetVpnGateway target_vpn_gateway_resource = 498050 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_vpn_gateway_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param \Google\Cloud\Compute\V1\TargetVpnGateway $targetVpnGatewayResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertTargetVpnGatewayRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\TargetVpnGateway $targetVpnGatewayResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetVpnGatewayResource($targetVpnGatewayResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * 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 \Google\Cloud\Compute\V1\TargetVpnGateway $target_vpn_gateway_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetVpnGateway target_vpn_gateway_resource = 498050 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetVpnGateway|null + */ + public function getTargetVpnGatewayResource() + { + return $this->target_vpn_gateway_resource; + } + + public function hasTargetVpnGatewayResource() + { + return isset($this->target_vpn_gateway_resource); + } + + public function clearTargetVpnGatewayResource() + { + unset($this->target_vpn_gateway_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetVpnGateway target_vpn_gateway_resource = 498050 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetVpnGateway $var + * @return $this + */ + public function setTargetVpnGatewayResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetVpnGateway::class); + $this->target_vpn_gateway_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertUrlMapRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertUrlMapRequest.php new file mode 100644 index 000000000000..aceebe4b7233 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertUrlMapRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.InsertUrlMapRequest + */ +class InsertUrlMapRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMap url_map_resource = 168675425 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url_map_resource = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\UrlMap $urlMapResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertUrlMapRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\UrlMap $urlMapResource): self + { + return (new self()) + ->setProject($project) + ->setUrlMapResource($urlMapResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\UrlMap $url_map_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMap url_map_resource = 168675425 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\UrlMap|null + */ + public function getUrlMapResource() + { + return $this->url_map_resource; + } + + public function hasUrlMapResource() + { + return isset($this->url_map_resource); + } + + public function clearUrlMapResource() + { + unset($this->url_map_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMap url_map_resource = 168675425 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\UrlMap $var + * @return $this + */ + public function setUrlMapResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\UrlMap::class); + $this->url_map_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertVpnGatewayRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertVpnGatewayRequest.php new file mode 100644 index 000000000000..9dfd277f8f40 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertVpnGatewayRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertVpnGatewayRequest + */ +class InsertVpnGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.VpnGateway vpn_gateway_resource = 182688660 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $vpn_gateway_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param \Google\Cloud\Compute\V1\VpnGateway $vpnGatewayResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertVpnGatewayRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\VpnGateway $vpnGatewayResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setVpnGatewayResource($vpnGatewayResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * 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 \Google\Cloud\Compute\V1\VpnGateway $vpn_gateway_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.VpnGateway vpn_gateway_resource = 182688660 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\VpnGateway|null + */ + public function getVpnGatewayResource() + { + return $this->vpn_gateway_resource; + } + + public function hasVpnGatewayResource() + { + return isset($this->vpn_gateway_resource); + } + + public function clearVpnGatewayResource() + { + unset($this->vpn_gateway_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.VpnGateway vpn_gateway_resource = 182688660 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\VpnGateway $var + * @return $this + */ + public function setVpnGatewayResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\VpnGateway::class); + $this->vpn_gateway_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertVpnTunnelRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertVpnTunnelRequest.php new file mode 100644 index 000000000000..1c347aeee63f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InsertVpnTunnelRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InsertVpnTunnelRequest + */ +class InsertVpnTunnelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.VpnTunnel vpn_tunnel_resource = 86839482 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $vpn_tunnel_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param \Google\Cloud\Compute\V1\VpnTunnel $vpnTunnelResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InsertVpnTunnelRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\VpnTunnel $vpnTunnelResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setVpnTunnelResource($vpnTunnelResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * 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 \Google\Cloud\Compute\V1\VpnTunnel $vpn_tunnel_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.VpnTunnel vpn_tunnel_resource = 86839482 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\VpnTunnel|null + */ + public function getVpnTunnelResource() + { + return $this->vpn_tunnel_resource; + } + + public function hasVpnTunnelResource() + { + return isset($this->vpn_tunnel_resource); + } + + public function clearVpnTunnelResource() + { + unset($this->vpn_tunnel_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.VpnTunnel vpn_tunnel_resource = 86839482 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\VpnTunnel $var + * @return $this + */ + public function setVpnTunnelResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\VpnTunnel::class); + $this->vpn_tunnel_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Instance.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Instance.php new file mode 100644 index 000000000000..c0c89934acc7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Instance.php @@ -0,0 +1,1981 @@ +google.cloud.compute.v1.Instance + */ +class Instance extends \Google\Protobuf\Internal\Message +{ + /** + * Controls for advanced machine-related behavior features. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AdvancedMachineFeatures advanced_machine_features = 409646002; + */ + protected $advanced_machine_features = null; + /** + * Allows this instance to send and receive packets with non-matching destination or source IPs. This is required if you plan to use this instance to forward routes. For more information, see Enabling IP Forwarding . + * + * Generated from protobuf field optional bool can_ip_forward = 467731324; + */ + protected $can_ip_forward = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ConfidentialInstanceConfig confidential_instance_config = 490637685; + */ + protected $confidential_instance_config = null; + /** + * [Output Only] The CPU platform used by this instance. + * + * Generated from protobuf field optional string cpu_platform = 410285354; + */ + protected $cpu_platform = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * Whether the resource should be protected against deletion. + * + * Generated from protobuf field optional bool deletion_protection = 458014698; + */ + protected $deletion_protection = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Array of disks associated with this instance. Persistent disks must be created before you can assign them. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AttachedDisk disks = 95594102; + */ + private $disks; + /** + * Enables display device for the instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DisplayDevice display_device = 258933875; + */ + protected $display_device = null; + /** + * Specifies a fingerprint for this resource, which is essentially a hash of the instance's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update the instance. You must always provide an up-to-date fingerprint hash in order to update the instance. To see the latest fingerprint, make get() request to the instance. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * A list of the type and count of accelerator cards attached to the instance. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig guest_accelerators = 463595119; + */ + private $guest_accelerators; + /** + * Specifies the hostname of the instance. The specified hostname must be RFC1035 compliant. If hostname is not specified, the default hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal DNS. + * + * Generated from protobuf field optional string hostname = 237067315; + */ + protected $hostname = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * Encrypts suspended data for an instance with a customer-managed encryption key. If you are creating a new instance, this field will encrypt the local SSD and in-memory contents of the instance during the suspend operation. If you do not provide an encryption key when creating the instance, then the local SSD and in-memory contents will be encrypted using an automatically generated key during the suspend operation. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey instance_encryption_key = 64741517; + */ + protected $instance_encryption_key = null; + /** + * KeyRevocationActionType of the instance. Supported options are "STOP" and "NONE". The default value is "NONE" if it is not specified. + * Check the KeyRevocationActionType enum for the list of possible values. + * + * Generated from protobuf field optional string key_revocation_action_type = 235941474; + */ + protected $key_revocation_action_type = null; + /** + * [Output Only] Type of the resource. Always compute#instance for instances. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * A fingerprint for this request, which is essentially a hash of the label's contents and 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. To see the latest fingerprint, make get() request to the instance. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + */ + protected $label_fingerprint = null; + /** + * Labels to apply to this instance. These can be later modified by the setLabels method. + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + /** + * [Output Only] Last start timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string last_start_timestamp = 443830736; + */ + protected $last_start_timestamp = null; + /** + * [Output Only] Last stop timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string last_stop_timestamp = 412823010; + */ + protected $last_stop_timestamp = null; + /** + * [Output Only] Last suspended timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string last_suspended_timestamp = 356275337; + */ + protected $last_suspended_timestamp = null; + /** + * Full or partial URL of the machine type resource to use for this instance, in the format: zones/zone/machineTypes/machine-type. This is provided by the client when the instance is created. For example, the following is a valid partial url to a predefined machine type: zones/us-central1-f/machineTypes/n1-standard-1 To create a custom machine type, provide a URL to a machine type in the following format, where CPUS is 1 or an even number up to 32 (2, 4, 6, ... 24, etc), and MEMORY is the total memory for this instance. Memory must be a multiple of 256 MB and must be supplied in MB (e.g. 5 GB of memory is 5120 MB): zones/zone/machineTypes/custom-CPUS-MEMORY For example: zones/us-central1-f/machineTypes/custom-4-5120 For a full list of restrictions, read the Specifications for custom machine types. + * + * Generated from protobuf field optional string machine_type = 227711026; + */ + protected $machine_type = null; + /** + * The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Metadata metadata = 86866735; + */ + protected $metadata = null; + /** + * Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". + * + * Generated from protobuf field optional string min_cpu_platform = 242912759; + */ + protected $min_cpu_platform = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * An array of network configurations for this instance. These specify how interfaces are configured to interact with other network services, such as connecting to the internet. Multiple interfaces are supported per instance. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkInterface network_interfaces = 52735243; + */ + private $network_interfaces; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkPerformanceConfig network_performance_config = 398330850; + */ + protected $network_performance_config = null; + /** + * Input only. [Input Only] Additional params passed with the request, but not persisted as part of resource payload. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceParams params = 78313862; + */ + protected $params = null; + /** + * The private IPv6 google access type for the VM. If not specified, use INHERIT_FROM_SUBNETWORK as default. + * Check the PrivateIpv6GoogleAccess enum for the list of possible values. + * + * Generated from protobuf field optional string private_ipv6_google_access = 48277006; + */ + protected $private_ipv6_google_access = null; + /** + * Specifies the reservations that this instance can consume from. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ReservationAffinity reservation_affinity = 157850683; + */ + protected $reservation_affinity = null; + /** + * Resource policies applied to this instance. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + */ + private $resource_policies; + /** + * [Output Only] Specifies values set for instance attributes as compared to the values requested by user in the corresponding input only field. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourceStatus resource_status = 249429315; + */ + protected $resource_status = null; + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzi = 480964257; + */ + protected $satisfies_pzi = null; + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + */ + protected $satisfies_pzs = null; + /** + * Sets the scheduling options for this instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Scheduling scheduling = 386688404; + */ + protected $scheduling = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * A list of service accounts, with their specified scopes, authorized for this instance. Only one service account per VM instance is supported. Service accounts generate access tokens that can be accessed through the metadata server and used to authenticate applications on the instance. See Service Accounts for more information. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAccount service_accounts = 277537328; + */ + private $service_accounts; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ShieldedInstanceConfig shielded_instance_config = 12862901; + */ + protected $shielded_instance_config = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy shielded_instance_integrity_policy = 163696919; + */ + protected $shielded_instance_integrity_policy = null; + /** + * Source machine image + * + * Generated from protobuf field optional string source_machine_image = 21769791; + */ + protected $source_machine_image = null; + /** + * Source machine image encryption key when creating an instance from a machine image. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_machine_image_encryption_key = 192839075; + */ + protected $source_machine_image_encryption_key = null; + /** + * [Output Only] Whether a VM has been restricted for start because Compute Engine has detected suspicious activity. + * + * Generated from protobuf field optional bool start_restricted = 123693144; + */ + protected $start_restricted = null; + /** + * [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. For more information about the status of the instance, see Instance life cycle. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + /** + * [Output Only] An optional, human-readable explanation of the status. + * + * Generated from protobuf field optional string status_message = 297428154; + */ + protected $status_message = null; + /** + * Tags to apply to this instance. Tags are used to identify valid sources or targets for network firewalls and are specified by the client during instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035. Multiple tags can be specified via the 'tags.items' field. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Tags tags = 3552281; + */ + protected $tags = null; + /** + * [Output Only] URL of the zone where the instance resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + */ + protected $zone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\AdvancedMachineFeatures $advanced_machine_features + * Controls for advanced machine-related behavior features. + * @type bool $can_ip_forward + * Allows this instance to send and receive packets with non-matching destination or source IPs. This is required if you plan to use this instance to forward routes. For more information, see Enabling IP Forwarding . + * @type \Google\Cloud\Compute\V1\ConfidentialInstanceConfig $confidential_instance_config + * @type string $cpu_platform + * [Output Only] The CPU platform used by this instance. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type bool $deletion_protection + * Whether the resource should be protected against deletion. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type array<\Google\Cloud\Compute\V1\AttachedDisk>|\Google\Protobuf\Internal\RepeatedField $disks + * Array of disks associated with this instance. Persistent disks must be created before you can assign them. + * @type \Google\Cloud\Compute\V1\DisplayDevice $display_device + * Enables display device for the instance. + * @type string $fingerprint + * Specifies a fingerprint for this resource, which is essentially a hash of the instance's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update the instance. You must always provide an up-to-date fingerprint hash in order to update the instance. To see the latest fingerprint, make get() request to the instance. + * @type array<\Google\Cloud\Compute\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $guest_accelerators + * A list of the type and count of accelerator cards attached to the instance. + * @type string $hostname + * Specifies the hostname of the instance. The specified hostname must be RFC1035 compliant. If hostname is not specified, the default hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal DNS. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type \Google\Cloud\Compute\V1\CustomerEncryptionKey $instance_encryption_key + * Encrypts suspended data for an instance with a customer-managed encryption key. If you are creating a new instance, this field will encrypt the local SSD and in-memory contents of the instance during the suspend operation. If you do not provide an encryption key when creating the instance, then the local SSD and in-memory contents will be encrypted using an automatically generated key during the suspend operation. + * @type string $key_revocation_action_type + * KeyRevocationActionType of the instance. Supported options are "STOP" and "NONE". The default value is "NONE" if it is not specified. + * Check the KeyRevocationActionType enum for the list of possible values. + * @type string $kind + * [Output Only] Type of the resource. Always compute#instance for instances. + * @type string $label_fingerprint + * A fingerprint for this request, which is essentially a hash of the label's contents and 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. To see the latest fingerprint, make get() request to the instance. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels to apply to this instance. These can be later modified by the setLabels method. + * @type string $last_start_timestamp + * [Output Only] Last start timestamp in RFC3339 text format. + * @type string $last_stop_timestamp + * [Output Only] Last stop timestamp in RFC3339 text format. + * @type string $last_suspended_timestamp + * [Output Only] Last suspended timestamp in RFC3339 text format. + * @type string $machine_type + * Full or partial URL of the machine type resource to use for this instance, in the format: zones/zone/machineTypes/machine-type. This is provided by the client when the instance is created. For example, the following is a valid partial url to a predefined machine type: zones/us-central1-f/machineTypes/n1-standard-1 To create a custom machine type, provide a URL to a machine type in the following format, where CPUS is 1 or an even number up to 32 (2, 4, 6, ... 24, etc), and MEMORY is the total memory for this instance. Memory must be a multiple of 256 MB and must be supplied in MB (e.g. 5 GB of memory is 5120 MB): zones/zone/machineTypes/custom-CPUS-MEMORY For example: zones/us-central1-f/machineTypes/custom-4-5120 For a full list of restrictions, read the Specifications for custom machine types. + * @type \Google\Cloud\Compute\V1\Metadata $metadata + * The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys. + * @type string $min_cpu_platform + * Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". + * @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\Cloud\Compute\V1\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $network_interfaces + * An array of network configurations for this instance. These specify how interfaces are configured to interact with other network services, such as connecting to the internet. Multiple interfaces are supported per instance. + * @type \Google\Cloud\Compute\V1\NetworkPerformanceConfig $network_performance_config + * @type \Google\Cloud\Compute\V1\InstanceParams $params + * Input only. [Input Only] Additional params passed with the request, but not persisted as part of resource payload. + * @type string $private_ipv6_google_access + * The private IPv6 google access type for the VM. If not specified, use INHERIT_FROM_SUBNETWORK as default. + * Check the PrivateIpv6GoogleAccess enum for the list of possible values. + * @type \Google\Cloud\Compute\V1\ReservationAffinity $reservation_affinity + * Specifies the reservations that this instance can consume from. + * @type array|\Google\Protobuf\Internal\RepeatedField $resource_policies + * Resource policies applied to this instance. + * @type \Google\Cloud\Compute\V1\ResourceStatus $resource_status + * [Output Only] Specifies values set for instance attributes as compared to the values requested by user in the corresponding input only field. + * @type bool $satisfies_pzi + * [Output Only] Reserved for future use. + * @type bool $satisfies_pzs + * [Output Only] Reserved for future use. + * @type \Google\Cloud\Compute\V1\Scheduling $scheduling + * Sets the scheduling options for this instance. + * @type string $self_link + * [Output Only] Server-defined URL for this resource. + * @type array<\Google\Cloud\Compute\V1\ServiceAccount>|\Google\Protobuf\Internal\RepeatedField $service_accounts + * A list of service accounts, with their specified scopes, authorized for this instance. Only one service account per VM instance is supported. Service accounts generate access tokens that can be accessed through the metadata server and used to authenticate applications on the instance. See Service Accounts for more information. + * @type \Google\Cloud\Compute\V1\ShieldedInstanceConfig $shielded_instance_config + * @type \Google\Cloud\Compute\V1\ShieldedInstanceIntegrityPolicy $shielded_instance_integrity_policy + * @type string $source_machine_image + * Source machine image + * @type \Google\Cloud\Compute\V1\CustomerEncryptionKey $source_machine_image_encryption_key + * Source machine image encryption key when creating an instance from a machine image. + * @type bool $start_restricted + * [Output Only] Whether a VM has been restricted for start because Compute Engine has detected suspicious activity. + * @type string $status + * [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. For more information about the status of the instance, see Instance life cycle. + * Check the Status enum for the list of possible values. + * @type string $status_message + * [Output Only] An optional, human-readable explanation of the status. + * @type \Google\Cloud\Compute\V1\Tags $tags + * Tags to apply to this instance. Tags are used to identify valid sources or targets for network firewalls and are specified by the client during instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035. Multiple tags can be specified via the 'tags.items' field. + * @type string $zone + * [Output Only] URL of the zone where the instance resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Controls for advanced machine-related behavior features. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AdvancedMachineFeatures advanced_machine_features = 409646002; + * @return \Google\Cloud\Compute\V1\AdvancedMachineFeatures|null + */ + public function getAdvancedMachineFeatures() + { + return $this->advanced_machine_features; + } + + public function hasAdvancedMachineFeatures() + { + return isset($this->advanced_machine_features); + } + + public function clearAdvancedMachineFeatures() + { + unset($this->advanced_machine_features); + } + + /** + * Controls for advanced machine-related behavior features. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AdvancedMachineFeatures advanced_machine_features = 409646002; + * @param \Google\Cloud\Compute\V1\AdvancedMachineFeatures $var + * @return $this + */ + public function setAdvancedMachineFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\AdvancedMachineFeatures::class); + $this->advanced_machine_features = $var; + + return $this; + } + + /** + * Allows this instance to send and receive packets with non-matching destination or source IPs. This is required if you plan to use this instance to forward routes. For more information, see Enabling IP Forwarding . + * + * Generated from protobuf field optional bool can_ip_forward = 467731324; + * @return bool + */ + public function getCanIpForward() + { + return isset($this->can_ip_forward) ? $this->can_ip_forward : false; + } + + public function hasCanIpForward() + { + return isset($this->can_ip_forward); + } + + public function clearCanIpForward() + { + unset($this->can_ip_forward); + } + + /** + * Allows this instance to send and receive packets with non-matching destination or source IPs. This is required if you plan to use this instance to forward routes. For more information, see Enabling IP Forwarding . + * + * Generated from protobuf field optional bool can_ip_forward = 467731324; + * @param bool $var + * @return $this + */ + public function setCanIpForward($var) + { + GPBUtil::checkBool($var); + $this->can_ip_forward = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ConfidentialInstanceConfig confidential_instance_config = 490637685; + * @return \Google\Cloud\Compute\V1\ConfidentialInstanceConfig|null + */ + public function getConfidentialInstanceConfig() + { + return $this->confidential_instance_config; + } + + public function hasConfidentialInstanceConfig() + { + return isset($this->confidential_instance_config); + } + + public function clearConfidentialInstanceConfig() + { + unset($this->confidential_instance_config); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ConfidentialInstanceConfig confidential_instance_config = 490637685; + * @param \Google\Cloud\Compute\V1\ConfidentialInstanceConfig $var + * @return $this + */ + public function setConfidentialInstanceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ConfidentialInstanceConfig::class); + $this->confidential_instance_config = $var; + + return $this; + } + + /** + * [Output Only] The CPU platform used by this instance. + * + * Generated from protobuf field optional string cpu_platform = 410285354; + * @return string + */ + public function getCpuPlatform() + { + return isset($this->cpu_platform) ? $this->cpu_platform : ''; + } + + public function hasCpuPlatform() + { + return isset($this->cpu_platform); + } + + public function clearCpuPlatform() + { + unset($this->cpu_platform); + } + + /** + * [Output Only] The CPU platform used by this instance. + * + * Generated from protobuf field optional string cpu_platform = 410285354; + * @param string $var + * @return $this + */ + public function setCpuPlatform($var) + { + GPBUtil::checkString($var, True); + $this->cpu_platform = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * Whether the resource should be protected against deletion. + * + * Generated from protobuf field optional bool deletion_protection = 458014698; + * @return bool + */ + public function getDeletionProtection() + { + return isset($this->deletion_protection) ? $this->deletion_protection : false; + } + + public function hasDeletionProtection() + { + return isset($this->deletion_protection); + } + + public function clearDeletionProtection() + { + unset($this->deletion_protection); + } + + /** + * Whether the resource should be protected against deletion. + * + * Generated from protobuf field optional bool deletion_protection = 458014698; + * @param bool $var + * @return $this + */ + public function setDeletionProtection($var) + { + GPBUtil::checkBool($var); + $this->deletion_protection = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Array of disks associated with this instance. Persistent disks must be created before you can assign them. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AttachedDisk disks = 95594102; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisks() + { + return $this->disks; + } + + /** + * Array of disks associated with this instance. Persistent disks must be created before you can assign them. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AttachedDisk disks = 95594102; + * @param array<\Google\Cloud\Compute\V1\AttachedDisk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AttachedDisk::class); + $this->disks = $arr; + + return $this; + } + + /** + * Enables display device for the instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DisplayDevice display_device = 258933875; + * @return \Google\Cloud\Compute\V1\DisplayDevice|null + */ + public function getDisplayDevice() + { + return $this->display_device; + } + + public function hasDisplayDevice() + { + return isset($this->display_device); + } + + public function clearDisplayDevice() + { + unset($this->display_device); + } + + /** + * Enables display device for the instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DisplayDevice display_device = 258933875; + * @param \Google\Cloud\Compute\V1\DisplayDevice $var + * @return $this + */ + public function setDisplayDevice($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DisplayDevice::class); + $this->display_device = $var; + + return $this; + } + + /** + * Specifies a fingerprint for this resource, which is essentially a hash of the instance's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update the instance. You must always provide an up-to-date fingerprint hash in order to update the instance. To see the latest fingerprint, make get() request to the instance. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Specifies a fingerprint for this resource, which is essentially a hash of the instance's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update the instance. You must always provide an up-to-date fingerprint hash in order to update the instance. To see the latest fingerprint, make get() request to the instance. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * A list of the type and count of accelerator cards attached to the instance. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig guest_accelerators = 463595119; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGuestAccelerators() + { + return $this->guest_accelerators; + } + + /** + * A list of the type and count of accelerator cards attached to the instance. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig guest_accelerators = 463595119; + * @param array<\Google\Cloud\Compute\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGuestAccelerators($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AcceleratorConfig::class); + $this->guest_accelerators = $arr; + + return $this; + } + + /** + * Specifies the hostname of the instance. The specified hostname must be RFC1035 compliant. If hostname is not specified, the default hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal DNS. + * + * Generated from protobuf field optional string hostname = 237067315; + * @return string + */ + public function getHostname() + { + return isset($this->hostname) ? $this->hostname : ''; + } + + public function hasHostname() + { + return isset($this->hostname); + } + + public function clearHostname() + { + unset($this->hostname); + } + + /** + * Specifies the hostname of the instance. The specified hostname must be RFC1035 compliant. If hostname is not specified, the default hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal DNS. + * + * Generated from protobuf field optional string hostname = 237067315; + * @param string $var + * @return $this + */ + public function setHostname($var) + { + GPBUtil::checkString($var, True); + $this->hostname = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * Encrypts suspended data for an instance with a customer-managed encryption key. If you are creating a new instance, this field will encrypt the local SSD and in-memory contents of the instance during the suspend operation. If you do not provide an encryption key when creating the instance, then the local SSD and in-memory contents will be encrypted using an automatically generated key during the suspend operation. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey instance_encryption_key = 64741517; + * @return \Google\Cloud\Compute\V1\CustomerEncryptionKey|null + */ + public function getInstanceEncryptionKey() + { + return $this->instance_encryption_key; + } + + public function hasInstanceEncryptionKey() + { + return isset($this->instance_encryption_key); + } + + public function clearInstanceEncryptionKey() + { + unset($this->instance_encryption_key); + } + + /** + * Encrypts suspended data for an instance with a customer-managed encryption key. If you are creating a new instance, this field will encrypt the local SSD and in-memory contents of the instance during the suspend operation. If you do not provide an encryption key when creating the instance, then the local SSD and in-memory contents will be encrypted using an automatically generated key during the suspend operation. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey instance_encryption_key = 64741517; + * @param \Google\Cloud\Compute\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setInstanceEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomerEncryptionKey::class); + $this->instance_encryption_key = $var; + + return $this; + } + + /** + * KeyRevocationActionType of the instance. Supported options are "STOP" and "NONE". The default value is "NONE" if it is not specified. + * Check the KeyRevocationActionType enum for the list of possible values. + * + * Generated from protobuf field optional string key_revocation_action_type = 235941474; + * @return string + */ + public function getKeyRevocationActionType() + { + return isset($this->key_revocation_action_type) ? $this->key_revocation_action_type : ''; + } + + public function hasKeyRevocationActionType() + { + return isset($this->key_revocation_action_type); + } + + public function clearKeyRevocationActionType() + { + unset($this->key_revocation_action_type); + } + + /** + * KeyRevocationActionType of the instance. Supported options are "STOP" and "NONE". The default value is "NONE" if it is not specified. + * Check the KeyRevocationActionType enum for the list of possible values. + * + * Generated from protobuf field optional string key_revocation_action_type = 235941474; + * @param string $var + * @return $this + */ + public function setKeyRevocationActionType($var) + { + GPBUtil::checkString($var, True); + $this->key_revocation_action_type = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#instance for instances. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#instance for instances. + * + * 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; + } + + /** + * A fingerprint for this request, which is essentially a hash of the label's contents and 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. To see the latest fingerprint, make get() request to the instance. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @return string + */ + public function getLabelFingerprint() + { + return isset($this->label_fingerprint) ? $this->label_fingerprint : ''; + } + + public function hasLabelFingerprint() + { + return isset($this->label_fingerprint); + } + + public function clearLabelFingerprint() + { + unset($this->label_fingerprint); + } + + /** + * A fingerprint for this request, which is essentially a hash of the label's contents and 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. To see the latest fingerprint, make get() request to the instance. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @param string $var + * @return $this + */ + public function setLabelFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->label_fingerprint = $var; + + return $this; + } + + /** + * Labels to apply to this instance. These can be later modified by the setLabels method. + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels to apply to this instance. These can be later modified by the setLabels method. + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * [Output Only] Last start timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string last_start_timestamp = 443830736; + * @return string + */ + public function getLastStartTimestamp() + { + return isset($this->last_start_timestamp) ? $this->last_start_timestamp : ''; + } + + public function hasLastStartTimestamp() + { + return isset($this->last_start_timestamp); + } + + public function clearLastStartTimestamp() + { + unset($this->last_start_timestamp); + } + + /** + * [Output Only] Last start timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string last_start_timestamp = 443830736; + * @param string $var + * @return $this + */ + public function setLastStartTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->last_start_timestamp = $var; + + return $this; + } + + /** + * [Output Only] Last stop timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string last_stop_timestamp = 412823010; + * @return string + */ + public function getLastStopTimestamp() + { + return isset($this->last_stop_timestamp) ? $this->last_stop_timestamp : ''; + } + + public function hasLastStopTimestamp() + { + return isset($this->last_stop_timestamp); + } + + public function clearLastStopTimestamp() + { + unset($this->last_stop_timestamp); + } + + /** + * [Output Only] Last stop timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string last_stop_timestamp = 412823010; + * @param string $var + * @return $this + */ + public function setLastStopTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->last_stop_timestamp = $var; + + return $this; + } + + /** + * [Output Only] Last suspended timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string last_suspended_timestamp = 356275337; + * @return string + */ + public function getLastSuspendedTimestamp() + { + return isset($this->last_suspended_timestamp) ? $this->last_suspended_timestamp : ''; + } + + public function hasLastSuspendedTimestamp() + { + return isset($this->last_suspended_timestamp); + } + + public function clearLastSuspendedTimestamp() + { + unset($this->last_suspended_timestamp); + } + + /** + * [Output Only] Last suspended timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string last_suspended_timestamp = 356275337; + * @param string $var + * @return $this + */ + public function setLastSuspendedTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->last_suspended_timestamp = $var; + + return $this; + } + + /** + * Full or partial URL of the machine type resource to use for this instance, in the format: zones/zone/machineTypes/machine-type. This is provided by the client when the instance is created. For example, the following is a valid partial url to a predefined machine type: zones/us-central1-f/machineTypes/n1-standard-1 To create a custom machine type, provide a URL to a machine type in the following format, where CPUS is 1 or an even number up to 32 (2, 4, 6, ... 24, etc), and MEMORY is the total memory for this instance. Memory must be a multiple of 256 MB and must be supplied in MB (e.g. 5 GB of memory is 5120 MB): zones/zone/machineTypes/custom-CPUS-MEMORY For example: zones/us-central1-f/machineTypes/custom-4-5120 For a full list of restrictions, read the Specifications for custom machine types. + * + * Generated from protobuf field optional string machine_type = 227711026; + * @return string + */ + public function getMachineType() + { + return isset($this->machine_type) ? $this->machine_type : ''; + } + + public function hasMachineType() + { + return isset($this->machine_type); + } + + public function clearMachineType() + { + unset($this->machine_type); + } + + /** + * Full or partial URL of the machine type resource to use for this instance, in the format: zones/zone/machineTypes/machine-type. This is provided by the client when the instance is created. For example, the following is a valid partial url to a predefined machine type: zones/us-central1-f/machineTypes/n1-standard-1 To create a custom machine type, provide a URL to a machine type in the following format, where CPUS is 1 or an even number up to 32 (2, 4, 6, ... 24, etc), and MEMORY is the total memory for this instance. Memory must be a multiple of 256 MB and must be supplied in MB (e.g. 5 GB of memory is 5120 MB): zones/zone/machineTypes/custom-CPUS-MEMORY For example: zones/us-central1-f/machineTypes/custom-4-5120 For a full list of restrictions, read the Specifications for custom machine types. + * + * Generated from protobuf field optional string machine_type = 227711026; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $var; + + return $this; + } + + /** + * The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Metadata metadata = 86866735; + * @return \Google\Cloud\Compute\V1\Metadata|null + */ + public function getMetadata() + { + return $this->metadata; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Metadata metadata = 86866735; + * @param \Google\Cloud\Compute\V1\Metadata $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Metadata::class); + $this->metadata = $var; + + return $this; + } + + /** + * Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". + * + * Generated from protobuf field optional string min_cpu_platform = 242912759; + * @return string + */ + public function getMinCpuPlatform() + { + return isset($this->min_cpu_platform) ? $this->min_cpu_platform : ''; + } + + public function hasMinCpuPlatform() + { + return isset($this->min_cpu_platform); + } + + public function clearMinCpuPlatform() + { + unset($this->min_cpu_platform); + } + + /** + * Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". + * + * Generated from protobuf field optional string min_cpu_platform = 242912759; + * @param string $var + * @return $this + */ + public function setMinCpuPlatform($var) + { + GPBUtil::checkString($var, True); + $this->min_cpu_platform = $var; + + return $this; + } + + /** + * 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. + * + * 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 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. + * + * 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; + } + + /** + * An array of network configurations for this instance. These specify how interfaces are configured to interact with other network services, such as connecting to the internet. Multiple interfaces are supported per instance. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkInterface network_interfaces = 52735243; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkInterfaces() + { + return $this->network_interfaces; + } + + /** + * An array of network configurations for this instance. These specify how interfaces are configured to interact with other network services, such as connecting to the internet. Multiple interfaces are supported per instance. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkInterface network_interfaces = 52735243; + * @param array<\Google\Cloud\Compute\V1\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkInterfaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NetworkInterface::class); + $this->network_interfaces = $arr; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkPerformanceConfig network_performance_config = 398330850; + * @return \Google\Cloud\Compute\V1\NetworkPerformanceConfig|null + */ + public function getNetworkPerformanceConfig() + { + return $this->network_performance_config; + } + + public function hasNetworkPerformanceConfig() + { + return isset($this->network_performance_config); + } + + public function clearNetworkPerformanceConfig() + { + unset($this->network_performance_config); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkPerformanceConfig network_performance_config = 398330850; + * @param \Google\Cloud\Compute\V1\NetworkPerformanceConfig $var + * @return $this + */ + public function setNetworkPerformanceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkPerformanceConfig::class); + $this->network_performance_config = $var; + + return $this; + } + + /** + * Input only. [Input Only] Additional params passed with the request, but not persisted as part of resource payload. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceParams params = 78313862; + * @return \Google\Cloud\Compute\V1\InstanceParams|null + */ + public function getParams() + { + return $this->params; + } + + public function hasParams() + { + return isset($this->params); + } + + public function clearParams() + { + unset($this->params); + } + + /** + * Input only. [Input Only] Additional params passed with the request, but not persisted as part of resource payload. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceParams params = 78313862; + * @param \Google\Cloud\Compute\V1\InstanceParams $var + * @return $this + */ + public function setParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceParams::class); + $this->params = $var; + + return $this; + } + + /** + * The private IPv6 google access type for the VM. If not specified, use INHERIT_FROM_SUBNETWORK as default. + * Check the PrivateIpv6GoogleAccess enum for the list of possible values. + * + * Generated from protobuf field optional string private_ipv6_google_access = 48277006; + * @return string + */ + public function getPrivateIpv6GoogleAccess() + { + return isset($this->private_ipv6_google_access) ? $this->private_ipv6_google_access : ''; + } + + public function hasPrivateIpv6GoogleAccess() + { + return isset($this->private_ipv6_google_access); + } + + public function clearPrivateIpv6GoogleAccess() + { + unset($this->private_ipv6_google_access); + } + + /** + * The private IPv6 google access type for the VM. If not specified, use INHERIT_FROM_SUBNETWORK as default. + * Check the PrivateIpv6GoogleAccess enum for the list of possible values. + * + * Generated from protobuf field optional string private_ipv6_google_access = 48277006; + * @param string $var + * @return $this + */ + public function setPrivateIpv6GoogleAccess($var) + { + GPBUtil::checkString($var, True); + $this->private_ipv6_google_access = $var; + + return $this; + } + + /** + * Specifies the reservations that this instance can consume from. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ReservationAffinity reservation_affinity = 157850683; + * @return \Google\Cloud\Compute\V1\ReservationAffinity|null + */ + public function getReservationAffinity() + { + return $this->reservation_affinity; + } + + public function hasReservationAffinity() + { + return isset($this->reservation_affinity); + } + + public function clearReservationAffinity() + { + unset($this->reservation_affinity); + } + + /** + * Specifies the reservations that this instance can consume from. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ReservationAffinity reservation_affinity = 157850683; + * @param \Google\Cloud\Compute\V1\ReservationAffinity $var + * @return $this + */ + public function setReservationAffinity($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ReservationAffinity::class); + $this->reservation_affinity = $var; + + return $this; + } + + /** + * Resource policies applied to this instance. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourcePolicies() + { + return $this->resource_policies; + } + + /** + * Resource policies applied to this instance. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourcePolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_policies = $arr; + + return $this; + } + + /** + * [Output Only] Specifies values set for instance attributes as compared to the values requested by user in the corresponding input only field. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourceStatus resource_status = 249429315; + * @return \Google\Cloud\Compute\V1\ResourceStatus|null + */ + public function getResourceStatus() + { + return $this->resource_status; + } + + public function hasResourceStatus() + { + return isset($this->resource_status); + } + + public function clearResourceStatus() + { + unset($this->resource_status); + } + + /** + * [Output Only] Specifies values set for instance attributes as compared to the values requested by user in the corresponding input only field. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourceStatus resource_status = 249429315; + * @param \Google\Cloud\Compute\V1\ResourceStatus $var + * @return $this + */ + public function setResourceStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ResourceStatus::class); + $this->resource_status = $var; + + return $this; + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzi = 480964257; + * @return bool + */ + public function getSatisfiesPzi() + { + return isset($this->satisfies_pzi) ? $this->satisfies_pzi : false; + } + + public function hasSatisfiesPzi() + { + return isset($this->satisfies_pzi); + } + + public function clearSatisfiesPzi() + { + unset($this->satisfies_pzi); + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzi = 480964257; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + * @return bool + */ + public function getSatisfiesPzs() + { + return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; + } + + public function hasSatisfiesPzs() + { + return isset($this->satisfies_pzs); + } + + public function clearSatisfiesPzs() + { + unset($this->satisfies_pzs); + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Sets the scheduling options for this instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Scheduling scheduling = 386688404; + * @return \Google\Cloud\Compute\V1\Scheduling|null + */ + public function getScheduling() + { + return $this->scheduling; + } + + public function hasScheduling() + { + return isset($this->scheduling); + } + + public function clearScheduling() + { + unset($this->scheduling); + } + + /** + * Sets the scheduling options for this instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Scheduling scheduling = 386688404; + * @param \Google\Cloud\Compute\V1\Scheduling $var + * @return $this + */ + public function setScheduling($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Scheduling::class); + $this->scheduling = $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; + } + + /** + * A list of service accounts, with their specified scopes, authorized for this instance. Only one service account per VM instance is supported. Service accounts generate access tokens that can be accessed through the metadata server and used to authenticate applications on the instance. See Service Accounts for more information. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAccount service_accounts = 277537328; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServiceAccounts() + { + return $this->service_accounts; + } + + /** + * A list of service accounts, with their specified scopes, authorized for this instance. Only one service account per VM instance is supported. Service accounts generate access tokens that can be accessed through the metadata server and used to authenticate applications on the instance. See Service Accounts for more information. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAccount service_accounts = 277537328; + * @param array<\Google\Cloud\Compute\V1\ServiceAccount>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServiceAccounts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ServiceAccount::class); + $this->service_accounts = $arr; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ShieldedInstanceConfig shielded_instance_config = 12862901; + * @return \Google\Cloud\Compute\V1\ShieldedInstanceConfig|null + */ + public function getShieldedInstanceConfig() + { + return $this->shielded_instance_config; + } + + public function hasShieldedInstanceConfig() + { + return isset($this->shielded_instance_config); + } + + public function clearShieldedInstanceConfig() + { + unset($this->shielded_instance_config); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ShieldedInstanceConfig shielded_instance_config = 12862901; + * @param \Google\Cloud\Compute\V1\ShieldedInstanceConfig $var + * @return $this + */ + public function setShieldedInstanceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ShieldedInstanceConfig::class); + $this->shielded_instance_config = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy shielded_instance_integrity_policy = 163696919; + * @return \Google\Cloud\Compute\V1\ShieldedInstanceIntegrityPolicy|null + */ + public function getShieldedInstanceIntegrityPolicy() + { + return $this->shielded_instance_integrity_policy; + } + + public function hasShieldedInstanceIntegrityPolicy() + { + return isset($this->shielded_instance_integrity_policy); + } + + public function clearShieldedInstanceIntegrityPolicy() + { + unset($this->shielded_instance_integrity_policy); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy shielded_instance_integrity_policy = 163696919; + * @param \Google\Cloud\Compute\V1\ShieldedInstanceIntegrityPolicy $var + * @return $this + */ + public function setShieldedInstanceIntegrityPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ShieldedInstanceIntegrityPolicy::class); + $this->shielded_instance_integrity_policy = $var; + + return $this; + } + + /** + * Source machine image + * + * Generated from protobuf field optional string source_machine_image = 21769791; + * @return string + */ + public function getSourceMachineImage() + { + return isset($this->source_machine_image) ? $this->source_machine_image : ''; + } + + public function hasSourceMachineImage() + { + return isset($this->source_machine_image); + } + + public function clearSourceMachineImage() + { + unset($this->source_machine_image); + } + + /** + * Source machine image + * + * Generated from protobuf field optional string source_machine_image = 21769791; + * @param string $var + * @return $this + */ + public function setSourceMachineImage($var) + { + GPBUtil::checkString($var, True); + $this->source_machine_image = $var; + + return $this; + } + + /** + * Source machine image encryption key when creating an instance from a machine image. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_machine_image_encryption_key = 192839075; + * @return \Google\Cloud\Compute\V1\CustomerEncryptionKey|null + */ + public function getSourceMachineImageEncryptionKey() + { + return $this->source_machine_image_encryption_key; + } + + public function hasSourceMachineImageEncryptionKey() + { + return isset($this->source_machine_image_encryption_key); + } + + public function clearSourceMachineImageEncryptionKey() + { + unset($this->source_machine_image_encryption_key); + } + + /** + * Source machine image encryption key when creating an instance from a machine image. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_machine_image_encryption_key = 192839075; + * @param \Google\Cloud\Compute\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setSourceMachineImageEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomerEncryptionKey::class); + $this->source_machine_image_encryption_key = $var; + + return $this; + } + + /** + * [Output Only] Whether a VM has been restricted for start because Compute Engine has detected suspicious activity. + * + * Generated from protobuf field optional bool start_restricted = 123693144; + * @return bool + */ + public function getStartRestricted() + { + return isset($this->start_restricted) ? $this->start_restricted : false; + } + + public function hasStartRestricted() + { + return isset($this->start_restricted); + } + + public function clearStartRestricted() + { + unset($this->start_restricted); + } + + /** + * [Output Only] Whether a VM has been restricted for start because Compute Engine has detected suspicious activity. + * + * Generated from protobuf field optional bool start_restricted = 123693144; + * @param bool $var + * @return $this + */ + public function setStartRestricted($var) + { + GPBUtil::checkBool($var); + $this->start_restricted = $var; + + return $this; + } + + /** + * [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. For more information about the status of the instance, see Instance life cycle. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. For more information about the status of the instance, see Instance life cycle. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + + /** + * [Output Only] An optional, human-readable explanation of the status. + * + * Generated from protobuf field optional string status_message = 297428154; + * @return string + */ + public function getStatusMessage() + { + return isset($this->status_message) ? $this->status_message : ''; + } + + public function hasStatusMessage() + { + return isset($this->status_message); + } + + public function clearStatusMessage() + { + unset($this->status_message); + } + + /** + * [Output Only] An optional, human-readable explanation of the status. + * + * Generated from protobuf field optional string status_message = 297428154; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Tags to apply to this instance. Tags are used to identify valid sources or targets for network firewalls and are specified by the client during instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035. Multiple tags can be specified via the 'tags.items' field. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Tags tags = 3552281; + * @return \Google\Cloud\Compute\V1\Tags|null + */ + public function getTags() + { + return $this->tags; + } + + public function hasTags() + { + return isset($this->tags); + } + + public function clearTags() + { + unset($this->tags); + } + + /** + * Tags to apply to this instance. Tags are used to identify valid sources or targets for network firewalls and are specified by the client during instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035. Multiple tags can be specified via the 'tags.items' field. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Tags tags = 3552281; + * @param \Google\Cloud\Compute\V1\Tags $var + * @return $this + */ + public function setTags($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Tags::class); + $this->tags = $var; + + return $this; + } + + /** + * [Output Only] URL of the zone where the instance resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + * @return string + */ + public function getZone() + { + return isset($this->zone) ? $this->zone : ''; + } + + public function hasZone() + { + return isset($this->zone); + } + + public function clearZone() + { + unset($this->zone); + } + + /** + * [Output Only] URL of the zone where the instance resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Instance/KeyRevocationActionType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Instance/KeyRevocationActionType.php new file mode 100644 index 000000000000..7624e57b35b5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Instance/KeyRevocationActionType.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.Instance.KeyRevocationActionType + */ +class KeyRevocationActionType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_KEY_REVOCATION_ACTION_TYPE = 0; + */ + const UNDEFINED_KEY_REVOCATION_ACTION_TYPE = 0; + /** + * Default value. This value is unused. + * + * Generated from protobuf enum KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 467110106; + */ + const KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 467110106; + /** + * Indicates user chose no operation. + * + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + /** + * Indicates user chose to opt for VM shutdown on key revocation. + * + * Generated from protobuf enum STOP = 2555906; + */ + const STOP = 2555906; + + private static $valueToName = [ + self::UNDEFINED_KEY_REVOCATION_ACTION_TYPE => 'UNDEFINED_KEY_REVOCATION_ACTION_TYPE', + self::KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED => 'KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED', + self::NONE => 'NONE', + self::STOP => 'STOP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(KeyRevocationActionType::class, \Google\Cloud\Compute\V1\Instance_KeyRevocationActionType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Instance/PrivateIpv6GoogleAccess.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Instance/PrivateIpv6GoogleAccess.php new file mode 100644 index 000000000000..ffd14931e551 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Instance/PrivateIpv6GoogleAccess.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.Instance.PrivateIpv6GoogleAccess + */ +class PrivateIpv6GoogleAccess +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS = 0; + */ + const UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS = 0; + /** + * Bidirectional private IPv6 access to/from Google services. If specified, the subnetwork who is attached to the instance's default network interface will be assigned an internal IPv6 prefix if it doesn't have before. + * + * Generated from protobuf enum ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 427975994; + */ + const ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 427975994; + /** + * Outbound private IPv6 access from VMs in this subnet to Google services. If specified, the subnetwork who is attached to the instance's default network interface will be assigned an internal IPv6 prefix if it doesn't have before. + * + * Generated from protobuf enum ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 288210263; + */ + const ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 288210263; + /** + * Each network interface inherits PrivateIpv6GoogleAccess from its subnetwork. + * + * Generated from protobuf enum INHERIT_FROM_SUBNETWORK = 530256959; + */ + const INHERIT_FROM_SUBNETWORK = 530256959; + + private static $valueToName = [ + self::UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS => 'UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS', + self::ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE => 'ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE', + self::ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE => 'ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE', + self::INHERIT_FROM_SUBNETWORK => 'INHERIT_FROM_SUBNETWORK', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PrivateIpv6GoogleAccess::class, \Google\Cloud\Compute\V1\Instance_PrivateIpv6GoogleAccess::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Instance/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Instance/Status.php new file mode 100644 index 000000000000..b4e95e4072b0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Instance/Status.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.Instance.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * The instance is halted and we are performing tear down tasks like network deprogramming, releasing quota, IP, tearing down disks etc. + * + * Generated from protobuf enum DEPROVISIONING = 428935662; + */ + const DEPROVISIONING = 428935662; + /** + * Resources are being allocated for the instance. + * + * Generated from protobuf enum PROVISIONING = 290896621; + */ + const PROVISIONING = 290896621; + /** + * The instance is in repair. + * + * Generated from protobuf enum REPAIRING = 413483285; + */ + const REPAIRING = 413483285; + /** + * The instance is running. + * + * Generated from protobuf enum RUNNING = 121282975; + */ + const RUNNING = 121282975; + /** + * All required resources have been allocated and the instance is being started. + * + * Generated from protobuf enum STAGING = 431072283; + */ + const STAGING = 431072283; + /** + * The instance has stopped successfully. + * + * Generated from protobuf enum STOPPED = 444276141; + */ + const STOPPED = 444276141; + /** + * The instance is currently stopping (either being deleted or killed). + * + * Generated from protobuf enum STOPPING = 350791796; + */ + const STOPPING = 350791796; + /** + * The instance has suspended. + * + * Generated from protobuf enum SUSPENDED = 51223995; + */ + const SUSPENDED = 51223995; + /** + * The instance is suspending. + * + * Generated from protobuf enum SUSPENDING = 514206246; + */ + const SUSPENDING = 514206246; + /** + * The instance has stopped (either by explicit action or underlying failure). + * + * Generated from protobuf enum TERMINATED = 250018339; + */ + const TERMINATED = 250018339; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::DEPROVISIONING => 'DEPROVISIONING', + self::PROVISIONING => 'PROVISIONING', + self::REPAIRING => 'REPAIRING', + self::RUNNING => 'RUNNING', + self::STAGING => 'STAGING', + self::STOPPED => 'STOPPED', + self::STOPPING => 'STOPPING', + self::SUSPENDED => 'SUSPENDED', + self::SUSPENDING => 'SUSPENDING', + self::TERMINATED => 'TERMINATED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\Instance_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceAggregatedList.php new file mode 100644 index 000000000000..0f9edeb50bcb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.InstanceAggregatedList + */ +class InstanceAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * An object that contains a list of instances scoped by zone. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#instanceAggregatedList for aggregated lists of Instance resources. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 + * An object that contains a list of instances scoped by zone. + * @type string $kind + * [Output Only] Type of resource. Always compute#instanceAggregatedList for aggregated lists of Instance resources. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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; + } + + /** + * An object that contains a list of instances scoped by zone. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * An object that contains a list of instances scoped by zone. + * + * 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\InstancesScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#instanceAggregatedList for aggregated lists of Instance resources. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#instanceAggregatedList for aggregated lists of Instance resources. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceConsumptionData.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceConsumptionData.php new file mode 100644 index 000000000000..5d908d8d2ec5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceConsumptionData.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.InstanceConsumptionData + */ +class InstanceConsumptionData extends \Google\Protobuf\Internal\Message +{ + /** + * Resources consumed by the instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceConsumptionInfo consumption_info = 146354898; + */ + protected $consumption_info = null; + /** + * Server-defined URL for the instance. + * + * Generated from protobuf field optional string instance = 18257045; + */ + protected $instance = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\InstanceConsumptionInfo $consumption_info + * Resources consumed by the instance. + * @type string $instance + * Server-defined URL for the instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Resources consumed by the instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceConsumptionInfo consumption_info = 146354898; + * @return \Google\Cloud\Compute\V1\InstanceConsumptionInfo|null + */ + public function getConsumptionInfo() + { + return $this->consumption_info; + } + + public function hasConsumptionInfo() + { + return isset($this->consumption_info); + } + + public function clearConsumptionInfo() + { + unset($this->consumption_info); + } + + /** + * Resources consumed by the instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceConsumptionInfo consumption_info = 146354898; + * @param \Google\Cloud\Compute\V1\InstanceConsumptionInfo $var + * @return $this + */ + public function setConsumptionInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceConsumptionInfo::class); + $this->consumption_info = $var; + + return $this; + } + + /** + * Server-defined URL for the instance. + * + * Generated from protobuf field optional string instance = 18257045; + * @return string + */ + public function getInstance() + { + return isset($this->instance) ? $this->instance : ''; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * Server-defined URL for the instance. + * + * Generated from protobuf field optional string instance = 18257045; + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceConsumptionInfo.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceConsumptionInfo.php new file mode 100644 index 000000000000..dfa8432f165d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceConsumptionInfo.php @@ -0,0 +1,208 @@ +google.cloud.compute.v1.InstanceConsumptionInfo + */ +class InstanceConsumptionInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The number of virtual CPUs that are available to the instance. + * + * Generated from protobuf field optional int32 guest_cpus = 393356754; + */ + protected $guest_cpus = null; + /** + * The amount of local SSD storage available to the instance, defined in GiB. + * + * Generated from protobuf field optional int32 local_ssd_gb = 329237578; + */ + protected $local_ssd_gb = null; + /** + * The amount of physical memory available to the instance, defined in MiB. + * + * Generated from protobuf field optional int32 memory_mb = 116001171; + */ + protected $memory_mb = null; + /** + * The minimal guaranteed number of virtual CPUs that are reserved. + * + * Generated from protobuf field optional int32 min_node_cpus = 317231675; + */ + protected $min_node_cpus = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $guest_cpus + * The number of virtual CPUs that are available to the instance. + * @type int $local_ssd_gb + * The amount of local SSD storage available to the instance, defined in GiB. + * @type int $memory_mb + * The amount of physical memory available to the instance, defined in MiB. + * @type int $min_node_cpus + * The minimal guaranteed number of virtual CPUs that are reserved. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The number of virtual CPUs that are available to the instance. + * + * Generated from protobuf field optional int32 guest_cpus = 393356754; + * @return int + */ + public function getGuestCpus() + { + return isset($this->guest_cpus) ? $this->guest_cpus : 0; + } + + public function hasGuestCpus() + { + return isset($this->guest_cpus); + } + + public function clearGuestCpus() + { + unset($this->guest_cpus); + } + + /** + * The number of virtual CPUs that are available to the instance. + * + * Generated from protobuf field optional int32 guest_cpus = 393356754; + * @param int $var + * @return $this + */ + public function setGuestCpus($var) + { + GPBUtil::checkInt32($var); + $this->guest_cpus = $var; + + return $this; + } + + /** + * The amount of local SSD storage available to the instance, defined in GiB. + * + * Generated from protobuf field optional int32 local_ssd_gb = 329237578; + * @return int + */ + public function getLocalSsdGb() + { + return isset($this->local_ssd_gb) ? $this->local_ssd_gb : 0; + } + + public function hasLocalSsdGb() + { + return isset($this->local_ssd_gb); + } + + public function clearLocalSsdGb() + { + unset($this->local_ssd_gb); + } + + /** + * The amount of local SSD storage available to the instance, defined in GiB. + * + * Generated from protobuf field optional int32 local_ssd_gb = 329237578; + * @param int $var + * @return $this + */ + public function setLocalSsdGb($var) + { + GPBUtil::checkInt32($var); + $this->local_ssd_gb = $var; + + return $this; + } + + /** + * The amount of physical memory available to the instance, defined in MiB. + * + * Generated from protobuf field optional int32 memory_mb = 116001171; + * @return int + */ + public function getMemoryMb() + { + return isset($this->memory_mb) ? $this->memory_mb : 0; + } + + public function hasMemoryMb() + { + return isset($this->memory_mb); + } + + public function clearMemoryMb() + { + unset($this->memory_mb); + } + + /** + * The amount of physical memory available to the instance, defined in MiB. + * + * Generated from protobuf field optional int32 memory_mb = 116001171; + * @param int $var + * @return $this + */ + public function setMemoryMb($var) + { + GPBUtil::checkInt32($var); + $this->memory_mb = $var; + + return $this; + } + + /** + * The minimal guaranteed number of virtual CPUs that are reserved. + * + * Generated from protobuf field optional int32 min_node_cpus = 317231675; + * @return int + */ + public function getMinNodeCpus() + { + return isset($this->min_node_cpus) ? $this->min_node_cpus : 0; + } + + public function hasMinNodeCpus() + { + return isset($this->min_node_cpus); + } + + public function clearMinNodeCpus() + { + unset($this->min_node_cpus); + } + + /** + * The minimal guaranteed number of virtual CPUs that are reserved. + * + * Generated from protobuf field optional int32 min_node_cpus = 317231675; + * @param int $var + * @return $this + */ + public function setMinNodeCpus($var) + { + GPBUtil::checkInt32($var); + $this->min_node_cpus = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroup.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroup.php new file mode 100644 index 000000000000..68d88b8ce547 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroup.php @@ -0,0 +1,595 @@ +google.cloud.compute.v1.InstanceGroup + */ +class InstanceGroup extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The creation timestamp for this instance group in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The fingerprint of the named ports. The system uses this fingerprint to detect conflicts when multiple users change the named ports concurrently. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * [Output Only] A unique identifier for this instance group, generated by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] The resource type, which is always compute#instanceGroup for instance groups. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Assigns a name to a port number. For example: {name: "http", port: 80} This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: "app1", port: 8080}, {name: "app1", port: 8081}, {name: "app2", port: 8082}] Named ports apply to all instances in this instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NamedPort named_ports = 427598732; + */ + private $named_ports; + /** + * [Output Only] The URL of the network to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0). + * + * Generated from protobuf field optional string network = 232872494; + */ + protected $network = null; + /** + * [Output Only] The URL of the region where the instance group is located (for regional resources). + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] The URL for this instance group. The server generates this URL. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] The total number of instances in the instance group. + * + * Generated from protobuf field optional int32 size = 3530753; + */ + protected $size = null; + /** + * [Output Only] The URL of the subnetwork to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0). + * + * Generated from protobuf field optional string subnetwork = 307827694; + */ + protected $subnetwork = null; + /** + * [Output Only] The URL of the zone where the instance group is located (for zonal resources). + * + * Generated from protobuf field optional string zone = 3744684; + */ + protected $zone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] The creation timestamp for this instance group in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type string $fingerprint + * [Output Only] The fingerprint of the named ports. The system uses this fingerprint to detect conflicts when multiple users change the named ports concurrently. + * @type int|string $id + * [Output Only] A unique identifier for this instance group, generated by the server. + * @type string $kind + * [Output Only] The resource type, which is always compute#instanceGroup for instance groups. + * @type string $name + * The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035. + * @type array<\Google\Cloud\Compute\V1\NamedPort>|\Google\Protobuf\Internal\RepeatedField $named_ports + * Assigns a name to a port number. For example: {name: "http", port: 80} This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: "app1", port: 8080}, {name: "app1", port: 8081}, {name: "app2", port: 8082}] Named ports apply to all instances in this instance group. + * @type string $network + * [Output Only] The URL of the network to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0). + * @type string $region + * [Output Only] The URL of the region where the instance group is located (for regional resources). + * @type string $self_link + * [Output Only] The URL for this instance group. The server generates this URL. + * @type int $size + * [Output Only] The total number of instances in the instance group. + * @type string $subnetwork + * [Output Only] The URL of the subnetwork to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0). + * @type string $zone + * [Output Only] The URL of the zone where the instance group is located (for zonal resources). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The creation timestamp for this instance group in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] The creation timestamp for this instance group in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The fingerprint of the named ports. The system uses this fingerprint to detect conflicts when multiple users change the named ports concurrently. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * [Output Only] The fingerprint of the named ports. The system uses this fingerprint to detect conflicts when multiple users change the named ports concurrently. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * [Output Only] A unique identifier for this instance group, generated by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] A unique identifier for this instance group, generated by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] The resource type, which is always compute#instanceGroup for instance groups. + * + * 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); + } + + /** + * [Output Only] The resource type, which is always compute#instanceGroup for instance groups. + * + * 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; + } + + /** + * The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035. + * + * 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 of the instance group. The name must be 1-63 characters long, and comply with RFC1035. + * + * 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; + } + + /** + * Assigns a name to a port number. For example: {name: "http", port: 80} This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: "app1", port: 8080}, {name: "app1", port: 8081}, {name: "app2", port: 8082}] Named ports apply to all instances in this instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NamedPort named_ports = 427598732; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNamedPorts() + { + return $this->named_ports; + } + + /** + * Assigns a name to a port number. For example: {name: "http", port: 80} This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: "app1", port: 8080}, {name: "app1", port: 8081}, {name: "app2", port: 8082}] Named ports apply to all instances in this instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NamedPort named_ports = 427598732; + * @param array<\Google\Cloud\Compute\V1\NamedPort>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNamedPorts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NamedPort::class); + $this->named_ports = $arr; + + return $this; + } + + /** + * [Output Only] The URL of the network to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0). + * + * Generated from protobuf field optional string network = 232872494; + * @return string + */ + public function getNetwork() + { + return isset($this->network) ? $this->network : ''; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * [Output Only] The URL of the network to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0). + * + * Generated from protobuf field optional string network = 232872494; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * [Output Only] The URL of the region where the instance group is located (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] The URL of the region where the instance group is located (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 group. The server generates this URL. + * + * 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] The URL for this instance group. The server generates this URL. + * + * 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] The total number of instances in the instance group. + * + * Generated from protobuf field optional int32 size = 3530753; + * @return int + */ + public function getSize() + { + return isset($this->size) ? $this->size : 0; + } + + public function hasSize() + { + return isset($this->size); + } + + public function clearSize() + { + unset($this->size); + } + + /** + * [Output Only] The total number of instances in the instance group. + * + * Generated from protobuf field optional int32 size = 3530753; + * @param int $var + * @return $this + */ + public function setSize($var) + { + GPBUtil::checkInt32($var); + $this->size = $var; + + return $this; + } + + /** + * [Output Only] The URL of the subnetwork to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0). + * + * Generated from protobuf field optional string subnetwork = 307827694; + * @return string + */ + public function getSubnetwork() + { + return isset($this->subnetwork) ? $this->subnetwork : ''; + } + + public function hasSubnetwork() + { + return isset($this->subnetwork); + } + + public function clearSubnetwork() + { + unset($this->subnetwork); + } + + /** + * [Output Only] The URL of the subnetwork to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0). + * + * Generated from protobuf field optional string subnetwork = 307827694; + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork = $var; + + return $this; + } + + /** + * [Output Only] The URL of the zone where the instance group is located (for zonal resources). + * + * Generated from protobuf field optional string zone = 3744684; + * @return string + */ + public function getZone() + { + return isset($this->zone) ? $this->zone : ''; + } + + public function hasZone() + { + return isset($this->zone); + } + + public function clearZone() + { + unset($this->zone); + } + + /** + * [Output Only] The URL of the zone where the instance group is located (for zonal resources). + * + * Generated from protobuf field optional string zone = 3744684; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupAggregatedList.php new file mode 100644 index 000000000000..9533de598444 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.InstanceGroupAggregatedList + */ +class InstanceGroupAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of InstanceGroupsScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] The resource type, which is always compute#instanceGroupAggregatedList for aggregated lists of instance groups. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 InstanceGroupsScopedList resources. + * @type string $kind + * [Output Only] The resource type, which is always compute#instanceGroupAggregatedList for aggregated lists of instance groups. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 InstanceGroupsScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of InstanceGroupsScopedList 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\InstanceGroupsScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] The resource type, which is always compute#instanceGroupAggregatedList for aggregated lists of instance groups. + * + * 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); + } + + /** + * [Output Only] The resource type, which is always compute#instanceGroupAggregatedList for aggregated lists of instance groups. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupList.php new file mode 100644 index 000000000000..79f574ffccc7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.InstanceGroupList + */ +class InstanceGroupList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of InstanceGroup resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroup items = 100526016; + */ + private $items; + /** + * [Output Only] The resource type, which is always compute#instanceGroupList for instance group lists. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\InstanceGroup>|\Google\Protobuf\Internal\RepeatedField $items + * A list of InstanceGroup resources. + * @type string $kind + * [Output Only] The resource type, which is always compute#instanceGroupList for instance group lists. + * @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 InstanceGroup resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroup items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of InstanceGroup resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroup items = 100526016; + * @param array<\Google\Cloud\Compute\V1\InstanceGroup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstanceGroup::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] The resource type, which is always compute#instanceGroupList for instance group lists. + * + * 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); + } + + /** + * [Output Only] The resource type, which is always compute#instanceGroupList for instance group lists. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManager.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManager.php new file mode 100644 index 000000000000..09a7f81289bb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManager.php @@ -0,0 +1,1097 @@ +google.cloud.compute.v1.InstanceGroupManager + */ +class InstanceGroupManager extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies configuration that overrides the instance template configuration for the group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerAllInstancesConfig all_instances_config = 112596737; + */ + protected $all_instances_config = null; + /** + * The autohealing policy for this managed instance group. You can specify only one value. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy auto_healing_policies = 456799109; + */ + private $auto_healing_policies; + /** + * The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a random four-character string to the base instance name. The base instance name must comply with RFC1035. + * + * Generated from protobuf field optional string base_instance_name = 389106439; + */ + protected $base_instance_name = null; + /** + * [Output Only] The creation timestamp for this managed instance group in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * [Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for each of those actions. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerActionsSummary current_actions = 164045879; + */ + protected $current_actions = null; + /** + * An optional description of this resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Policy specifying the intended distribution of managed instances across zones in a regional managed instance group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DistributionPolicy distribution_policy = 534558541; + */ + protected $distribution_policy = null; + /** + * Fingerprint of this resource. This field may be used in optimistic locking. It will be ignored when inserting an InstanceGroupManager. An up-to-date fingerprint must be provided in order to update the InstanceGroupManager, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * [Output Only] A unique identifier for this resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] The URL of the Instance Group resource. + * + * Generated from protobuf field optional string instance_group = 81095253; + */ + protected $instance_group = null; + /** + * The repair policy for this managed instance group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerInstanceLifecyclePolicy instance_lifecycle_policy = 447961617; + */ + protected $instance_lifecycle_policy = null; + /** + * The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE. + * + * Generated from protobuf field optional string instance_template = 309248228; + */ + protected $instance_template = null; + /** + * [Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * Pagination behavior of the listManagedInstances API method for this managed instance group. + * Check the ListManagedInstancesResults enum for the list of possible values. + * + * Generated from protobuf field optional string list_managed_instances_results = 296047156; + */ + protected $list_managed_instances_results = null; + /** + * The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Named ports configured for the Instance Groups complementary to this Instance Group Manager. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NamedPort named_ports = 427598732; + */ + private $named_ports; + /** + * [Output Only] The URL of the region where the managed instance group resides (for regional resources). + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] The URL for this managed instance group. The server defines this URL. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * Stateful configuration for this Instanced Group Manager + * + * Generated from protobuf field optional .google.cloud.compute.v1.StatefulPolicy stateful_policy = 47538565; + */ + protected $stateful_policy = null; + /** + * [Output Only] The status of this managed instance group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerStatus status = 181260274; + */ + protected $status = null; + /** + * The URLs for all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group. + * + * Generated from protobuf field repeated string target_pools = 336072617; + */ + private $target_pools; + /** + * The target number of running instances for this managed instance group. You can reduce this number by using the instanceGroupManager deleteInstances or abandonInstances methods. Resizing the group also changes this number. + * + * Generated from protobuf field optional int32 target_size = 62880239; + */ + protected $target_size = null; + /** + * The update policy for this managed instance group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy update_policy = 175809896; + */ + protected $update_policy = null; + /** + * Specifies the instance templates used by this managed instance group to create instances. Each version is defined by an instanceTemplate and a name. Every version can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about the relationships between these fields. Exactly one version must leave the targetSize field unset. That version will be applied to all remaining instances. For more information, read about canary updates. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroupManagerVersion versions = 162430619; + */ + private $versions; + /** + * [Output Only] The URL of a zone where the managed instance group is located (for zonal resources). + * + * Generated from protobuf field optional string zone = 3744684; + */ + protected $zone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\InstanceGroupManagerAllInstancesConfig $all_instances_config + * Specifies configuration that overrides the instance template configuration for the group. + * @type array<\Google\Cloud\Compute\V1\InstanceGroupManagerAutoHealingPolicy>|\Google\Protobuf\Internal\RepeatedField $auto_healing_policies + * The autohealing policy for this managed instance group. You can specify only one value. + * @type string $base_instance_name + * The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a random four-character string to the base instance name. The base instance name must comply with RFC1035. + * @type string $creation_timestamp + * [Output Only] The creation timestamp for this managed instance group in RFC3339 text format. + * @type \Google\Cloud\Compute\V1\InstanceGroupManagerActionsSummary $current_actions + * [Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for each of those actions. + * @type string $description + * An optional description of this resource. + * @type \Google\Cloud\Compute\V1\DistributionPolicy $distribution_policy + * Policy specifying the intended distribution of managed instances across zones in a regional managed instance group. + * @type string $fingerprint + * Fingerprint of this resource. This field may be used in optimistic locking. It will be ignored when inserting an InstanceGroupManager. An up-to-date fingerprint must be provided in order to update the InstanceGroupManager, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager. + * @type int|string $id + * [Output Only] A unique identifier for this resource type. The server generates this identifier. + * @type string $instance_group + * [Output Only] The URL of the Instance Group resource. + * @type \Google\Cloud\Compute\V1\InstanceGroupManagerInstanceLifecyclePolicy $instance_lifecycle_policy + * The repair policy for this managed instance group. + * @type string $instance_template + * The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE. + * @type string $kind + * [Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups. + * @type string $list_managed_instances_results + * Pagination behavior of the listManagedInstances API method for this managed instance group. + * Check the ListManagedInstancesResults enum for the list of possible values. + * @type string $name + * The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035. + * @type array<\Google\Cloud\Compute\V1\NamedPort>|\Google\Protobuf\Internal\RepeatedField $named_ports + * Named ports configured for the Instance Groups complementary to this Instance Group Manager. + * @type string $region + * [Output Only] The URL of the region where the managed instance group resides (for regional resources). + * @type string $self_link + * [Output Only] The URL for this managed instance group. The server defines this URL. + * @type \Google\Cloud\Compute\V1\StatefulPolicy $stateful_policy + * Stateful configuration for this Instanced Group Manager + * @type \Google\Cloud\Compute\V1\InstanceGroupManagerStatus $status + * [Output Only] The status of this managed instance group. + * @type array|\Google\Protobuf\Internal\RepeatedField $target_pools + * The URLs for all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group. + * @type int $target_size + * The target number of running instances for this managed instance group. You can reduce this number by using the instanceGroupManager deleteInstances or abandonInstances methods. Resizing the group also changes this number. + * @type \Google\Cloud\Compute\V1\InstanceGroupManagerUpdatePolicy $update_policy + * The update policy for this managed instance group. + * @type array<\Google\Cloud\Compute\V1\InstanceGroupManagerVersion>|\Google\Protobuf\Internal\RepeatedField $versions + * Specifies the instance templates used by this managed instance group to create instances. Each version is defined by an instanceTemplate and a name. Every version can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about the relationships between these fields. Exactly one version must leave the targetSize field unset. That version will be applied to all remaining instances. For more information, read about canary updates. + * @type string $zone + * [Output Only] The URL of a zone where the managed instance group is located (for zonal resources). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies configuration that overrides the instance template configuration for the group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerAllInstancesConfig all_instances_config = 112596737; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagerAllInstancesConfig|null + */ + public function getAllInstancesConfig() + { + return $this->all_instances_config; + } + + public function hasAllInstancesConfig() + { + return isset($this->all_instances_config); + } + + public function clearAllInstancesConfig() + { + unset($this->all_instances_config); + } + + /** + * Specifies configuration that overrides the instance template configuration for the group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerAllInstancesConfig all_instances_config = 112596737; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagerAllInstancesConfig $var + * @return $this + */ + public function setAllInstancesConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagerAllInstancesConfig::class); + $this->all_instances_config = $var; + + return $this; + } + + /** + * The autohealing policy for this managed instance group. You can specify only one value. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy auto_healing_policies = 456799109; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAutoHealingPolicies() + { + return $this->auto_healing_policies; + } + + /** + * The autohealing policy for this managed instance group. You can specify only one value. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy auto_healing_policies = 456799109; + * @param array<\Google\Cloud\Compute\V1\InstanceGroupManagerAutoHealingPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAutoHealingPolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstanceGroupManagerAutoHealingPolicy::class); + $this->auto_healing_policies = $arr; + + return $this; + } + + /** + * The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a random four-character string to the base instance name. The base instance name must comply with RFC1035. + * + * Generated from protobuf field optional string base_instance_name = 389106439; + * @return string + */ + public function getBaseInstanceName() + { + return isset($this->base_instance_name) ? $this->base_instance_name : ''; + } + + public function hasBaseInstanceName() + { + return isset($this->base_instance_name); + } + + public function clearBaseInstanceName() + { + unset($this->base_instance_name); + } + + /** + * The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a random four-character string to the base instance name. The base instance name must comply with RFC1035. + * + * Generated from protobuf field optional string base_instance_name = 389106439; + * @param string $var + * @return $this + */ + public function setBaseInstanceName($var) + { + GPBUtil::checkString($var, True); + $this->base_instance_name = $var; + + return $this; + } + + /** + * [Output Only] The creation timestamp for this managed instance group in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] The creation timestamp for this managed instance group in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * [Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for each of those actions. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerActionsSummary current_actions = 164045879; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagerActionsSummary|null + */ + public function getCurrentActions() + { + return $this->current_actions; + } + + public function hasCurrentActions() + { + return isset($this->current_actions); + } + + public function clearCurrentActions() + { + unset($this->current_actions); + } + + /** + * [Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for each of those actions. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerActionsSummary current_actions = 164045879; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagerActionsSummary $var + * @return $this + */ + public function setCurrentActions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagerActionsSummary::class); + $this->current_actions = $var; + + return $this; + } + + /** + * An optional description of this resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Policy specifying the intended distribution of managed instances across zones in a regional managed instance group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DistributionPolicy distribution_policy = 534558541; + * @return \Google\Cloud\Compute\V1\DistributionPolicy|null + */ + public function getDistributionPolicy() + { + return $this->distribution_policy; + } + + public function hasDistributionPolicy() + { + return isset($this->distribution_policy); + } + + public function clearDistributionPolicy() + { + unset($this->distribution_policy); + } + + /** + * Policy specifying the intended distribution of managed instances across zones in a regional managed instance group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DistributionPolicy distribution_policy = 534558541; + * @param \Google\Cloud\Compute\V1\DistributionPolicy $var + * @return $this + */ + public function setDistributionPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DistributionPolicy::class); + $this->distribution_policy = $var; + + return $this; + } + + /** + * Fingerprint of this resource. This field may be used in optimistic locking. It will be ignored when inserting an InstanceGroupManager. An up-to-date fingerprint must be provided in order to update the InstanceGroupManager, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Fingerprint of this resource. This field may be used in optimistic locking. It will be ignored when inserting an InstanceGroupManager. An up-to-date fingerprint must be provided in order to update the InstanceGroupManager, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * [Output Only] A unique identifier for this resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] A unique identifier for this resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] The URL of the Instance Group resource. + * + * Generated from protobuf field optional string instance_group = 81095253; + * @return string + */ + public function getInstanceGroup() + { + return isset($this->instance_group) ? $this->instance_group : ''; + } + + public function hasInstanceGroup() + { + return isset($this->instance_group); + } + + public function clearInstanceGroup() + { + unset($this->instance_group); + } + + /** + * [Output Only] The URL of the Instance Group resource. + * + * Generated from protobuf field optional string instance_group = 81095253; + * @param string $var + * @return $this + */ + public function setInstanceGroup($var) + { + GPBUtil::checkString($var, True); + $this->instance_group = $var; + + return $this; + } + + /** + * The repair policy for this managed instance group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerInstanceLifecyclePolicy instance_lifecycle_policy = 447961617; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagerInstanceLifecyclePolicy|null + */ + public function getInstanceLifecyclePolicy() + { + return $this->instance_lifecycle_policy; + } + + public function hasInstanceLifecyclePolicy() + { + return isset($this->instance_lifecycle_policy); + } + + public function clearInstanceLifecyclePolicy() + { + unset($this->instance_lifecycle_policy); + } + + /** + * The repair policy for this managed instance group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerInstanceLifecyclePolicy instance_lifecycle_policy = 447961617; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagerInstanceLifecyclePolicy $var + * @return $this + */ + public function setInstanceLifecyclePolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagerInstanceLifecyclePolicy::class); + $this->instance_lifecycle_policy = $var; + + return $this; + } + + /** + * The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE. + * + * Generated from protobuf field optional string instance_template = 309248228; + * @return string + */ + public function getInstanceTemplate() + { + return isset($this->instance_template) ? $this->instance_template : ''; + } + + public function hasInstanceTemplate() + { + return isset($this->instance_template); + } + + public function clearInstanceTemplate() + { + unset($this->instance_template); + } + + /** + * The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE. + * + * Generated from protobuf field optional string instance_template = 309248228; + * @param string $var + * @return $this + */ + public function setInstanceTemplate($var) + { + GPBUtil::checkString($var, True); + $this->instance_template = $var; + + return $this; + } + + /** + * [Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups. + * + * 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); + } + + /** + * [Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups. + * + * 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; + } + + /** + * Pagination behavior of the listManagedInstances API method for this managed instance group. + * Check the ListManagedInstancesResults enum for the list of possible values. + * + * Generated from protobuf field optional string list_managed_instances_results = 296047156; + * @return string + */ + public function getListManagedInstancesResults() + { + return isset($this->list_managed_instances_results) ? $this->list_managed_instances_results : ''; + } + + public function hasListManagedInstancesResults() + { + return isset($this->list_managed_instances_results); + } + + public function clearListManagedInstancesResults() + { + unset($this->list_managed_instances_results); + } + + /** + * Pagination behavior of the listManagedInstances API method for this managed instance group. + * Check the ListManagedInstancesResults enum for the list of possible values. + * + * Generated from protobuf field optional string list_managed_instances_results = 296047156; + * @param string $var + * @return $this + */ + public function setListManagedInstancesResults($var) + { + GPBUtil::checkString($var, True); + $this->list_managed_instances_results = $var; + + return $this; + } + + /** + * The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035. + * + * 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 of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035. + * + * 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; + } + + /** + * Named ports configured for the Instance Groups complementary to this Instance Group Manager. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NamedPort named_ports = 427598732; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNamedPorts() + { + return $this->named_ports; + } + + /** + * Named ports configured for the Instance Groups complementary to this Instance Group Manager. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NamedPort named_ports = 427598732; + * @param array<\Google\Cloud\Compute\V1\NamedPort>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNamedPorts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NamedPort::class); + $this->named_ports = $arr; + + return $this; + } + + /** + * [Output Only] The URL of the region where the managed instance group resides (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] The URL of the region where the managed instance group resides (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 managed instance group. The server defines this URL. + * + * 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] The URL for this managed instance group. The server defines this URL. + * + * 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; + } + + /** + * Stateful configuration for this Instanced Group Manager + * + * Generated from protobuf field optional .google.cloud.compute.v1.StatefulPolicy stateful_policy = 47538565; + * @return \Google\Cloud\Compute\V1\StatefulPolicy|null + */ + public function getStatefulPolicy() + { + return $this->stateful_policy; + } + + public function hasStatefulPolicy() + { + return isset($this->stateful_policy); + } + + public function clearStatefulPolicy() + { + unset($this->stateful_policy); + } + + /** + * Stateful configuration for this Instanced Group Manager + * + * Generated from protobuf field optional .google.cloud.compute.v1.StatefulPolicy stateful_policy = 47538565; + * @param \Google\Cloud\Compute\V1\StatefulPolicy $var + * @return $this + */ + public function setStatefulPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\StatefulPolicy::class); + $this->stateful_policy = $var; + + return $this; + } + + /** + * [Output Only] The status of this managed instance group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerStatus status = 181260274; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagerStatus|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] The status of this managed instance group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerStatus status = 181260274; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagerStatus $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagerStatus::class); + $this->status = $var; + + return $this; + } + + /** + * The URLs for all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group. + * + * Generated from protobuf field repeated string target_pools = 336072617; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetPools() + { + return $this->target_pools; + } + + /** + * The URLs for all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group. + * + * Generated from protobuf field repeated string target_pools = 336072617; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetPools($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->target_pools = $arr; + + return $this; + } + + /** + * The target number of running instances for this managed instance group. You can reduce this number by using the instanceGroupManager deleteInstances or abandonInstances methods. Resizing the group also changes this number. + * + * Generated from protobuf field optional int32 target_size = 62880239; + * @return int + */ + public function getTargetSize() + { + return isset($this->target_size) ? $this->target_size : 0; + } + + public function hasTargetSize() + { + return isset($this->target_size); + } + + public function clearTargetSize() + { + unset($this->target_size); + } + + /** + * The target number of running instances for this managed instance group. You can reduce this number by using the instanceGroupManager deleteInstances or abandonInstances methods. Resizing the group also changes this number. + * + * Generated from protobuf field optional int32 target_size = 62880239; + * @param int $var + * @return $this + */ + public function setTargetSize($var) + { + GPBUtil::checkInt32($var); + $this->target_size = $var; + + return $this; + } + + /** + * The update policy for this managed instance group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy update_policy = 175809896; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagerUpdatePolicy|null + */ + public function getUpdatePolicy() + { + return $this->update_policy; + } + + public function hasUpdatePolicy() + { + return isset($this->update_policy); + } + + public function clearUpdatePolicy() + { + unset($this->update_policy); + } + + /** + * The update policy for this managed instance group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy update_policy = 175809896; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagerUpdatePolicy $var + * @return $this + */ + public function setUpdatePolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagerUpdatePolicy::class); + $this->update_policy = $var; + + return $this; + } + + /** + * Specifies the instance templates used by this managed instance group to create instances. Each version is defined by an instanceTemplate and a name. Every version can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about the relationships between these fields. Exactly one version must leave the targetSize field unset. That version will be applied to all remaining instances. For more information, read about canary updates. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroupManagerVersion versions = 162430619; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVersions() + { + return $this->versions; + } + + /** + * Specifies the instance templates used by this managed instance group to create instances. Each version is defined by an instanceTemplate and a name. Every version can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about the relationships between these fields. Exactly one version must leave the targetSize field unset. That version will be applied to all remaining instances. For more information, read about canary updates. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroupManagerVersion versions = 162430619; + * @param array<\Google\Cloud\Compute\V1\InstanceGroupManagerVersion>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVersions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstanceGroupManagerVersion::class); + $this->versions = $arr; + + return $this; + } + + /** + * [Output Only] The URL of a zone where the managed instance group is located (for zonal resources). + * + * Generated from protobuf field optional string zone = 3744684; + * @return string + */ + public function getZone() + { + return isset($this->zone) ? $this->zone : ''; + } + + public function hasZone() + { + return isset($this->zone); + } + + public function clearZone() + { + unset($this->zone); + } + + /** + * [Output Only] The URL of a zone where the managed instance group is located (for zonal resources). + * + * Generated from protobuf field optional string zone = 3744684; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManager/ListManagedInstancesResults.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManager/ListManagedInstancesResults.php new file mode 100644 index 000000000000..992b176c22dc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManager/ListManagedInstancesResults.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.InstanceGroupManager.ListManagedInstancesResults + */ +class ListManagedInstancesResults +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_LIST_MANAGED_INSTANCES_RESULTS = 0; + */ + const UNDEFINED_LIST_MANAGED_INSTANCES_RESULTS = 0; + /** + * (Default) Pagination is disabled for the group's listManagedInstances API method. maxResults and pageToken query parameters are ignored and all instances are returned in a single response. + * + * Generated from protobuf enum PAGELESS = 32183464; + */ + const PAGELESS = 32183464; + /** + * Pagination is enabled for the group's listManagedInstances API method. maxResults and pageToken query parameters are respected. + * + * Generated from protobuf enum PAGINATED = 40190637; + */ + const PAGINATED = 40190637; + + private static $valueToName = [ + self::UNDEFINED_LIST_MANAGED_INSTANCES_RESULTS => 'UNDEFINED_LIST_MANAGED_INSTANCES_RESULTS', + self::PAGELESS => 'PAGELESS', + self::PAGINATED => 'PAGINATED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ListManagedInstancesResults::class, \Google\Cloud\Compute\V1\InstanceGroupManager_ListManagedInstancesResults::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerActionsSummary.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerActionsSummary.php new file mode 100644 index 000000000000..941dcf658fec --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerActionsSummary.php @@ -0,0 +1,604 @@ +google.cloud.compute.v1.InstanceGroupManagerActionsSummary + */ +class InstanceGroupManagerActionsSummary extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The total number of instances in the managed instance group that are scheduled to be abandoned. Abandoning an instance removes it from the managed instance group without deleting it. + * + * Generated from protobuf field optional int32 abandoning = 440023373; + */ + protected $abandoning = null; + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be created or are currently being created. If the group fails to create any of these instances, it tries again until it creates the instance successfully. If you have disabled creation retries, this field will not be populated; instead, the creatingWithoutRetries field will be populated. + * + * Generated from protobuf field optional int32 creating = 209809081; + */ + protected $creating = null; + /** + * [Output Only] The number of instances that the managed instance group will attempt to create. The group attempts to create each instance only once. If the group fails to create any of these instances, it decreases the group's targetSize value accordingly. + * + * Generated from protobuf field optional int32 creating_without_retries = 369916745; + */ + protected $creating_without_retries = null; + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted. + * + * Generated from protobuf field optional int32 deleting = 282846120; + */ + protected $deleting = null; + /** + * [Output Only] The number of instances in the managed instance group that are running and have no scheduled actions. + * + * Generated from protobuf field optional int32 none = 3387192; + */ + protected $none = null; + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be recreated or are currently being being recreated. Recreating an instance deletes the existing root persistent disk and creates a new disk from the image that is defined in the instance template. + * + * Generated from protobuf field optional int32 recreating = 339057132; + */ + protected $recreating = null; + /** + * [Output Only] The number of instances in the managed instance group that are being reconfigured with properties that do not require a restart or a recreate action. For example, setting or removing target pools for the instance. + * + * Generated from protobuf field optional int32 refreshing = 215044903; + */ + protected $refreshing = null; + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted. + * + * Generated from protobuf field optional int32 restarting = 372312947; + */ + protected $restarting = null; + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be resumed or are currently being resumed. + * + * Generated from protobuf field optional int32 resuming = 201100714; + */ + protected $resuming = null; + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be started or are currently being started. + * + * Generated from protobuf field optional int32 starting = 243064896; + */ + protected $starting = null; + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be stopped or are currently being stopped. + * + * Generated from protobuf field optional int32 stopping = 105035892; + */ + protected $stopping = null; + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be suspended or are currently being suspended. + * + * Generated from protobuf field optional int32 suspending = 29113894; + */ + protected $suspending = null; + /** + * [Output Only] The number of instances in the managed instance group that are being verified. See the managedInstances[].currentAction property in the listManagedInstances method documentation. + * + * Generated from protobuf field optional int32 verifying = 451612873; + */ + protected $verifying = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $abandoning + * [Output Only] The total number of instances in the managed instance group that are scheduled to be abandoned. Abandoning an instance removes it from the managed instance group without deleting it. + * @type int $creating + * [Output Only] The number of instances in the managed instance group that are scheduled to be created or are currently being created. If the group fails to create any of these instances, it tries again until it creates the instance successfully. If you have disabled creation retries, this field will not be populated; instead, the creatingWithoutRetries field will be populated. + * @type int $creating_without_retries + * [Output Only] The number of instances that the managed instance group will attempt to create. The group attempts to create each instance only once. If the group fails to create any of these instances, it decreases the group's targetSize value accordingly. + * @type int $deleting + * [Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted. + * @type int $none + * [Output Only] The number of instances in the managed instance group that are running and have no scheduled actions. + * @type int $recreating + * [Output Only] The number of instances in the managed instance group that are scheduled to be recreated or are currently being being recreated. Recreating an instance deletes the existing root persistent disk and creates a new disk from the image that is defined in the instance template. + * @type int $refreshing + * [Output Only] The number of instances in the managed instance group that are being reconfigured with properties that do not require a restart or a recreate action. For example, setting or removing target pools for the instance. + * @type int $restarting + * [Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted. + * @type int $resuming + * [Output Only] The number of instances in the managed instance group that are scheduled to be resumed or are currently being resumed. + * @type int $starting + * [Output Only] The number of instances in the managed instance group that are scheduled to be started or are currently being started. + * @type int $stopping + * [Output Only] The number of instances in the managed instance group that are scheduled to be stopped or are currently being stopped. + * @type int $suspending + * [Output Only] The number of instances in the managed instance group that are scheduled to be suspended or are currently being suspended. + * @type int $verifying + * [Output Only] The number of instances in the managed instance group that are being verified. See the managedInstances[].currentAction property in the listManagedInstances method documentation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The total number of instances in the managed instance group that are scheduled to be abandoned. Abandoning an instance removes it from the managed instance group without deleting it. + * + * Generated from protobuf field optional int32 abandoning = 440023373; + * @return int + */ + public function getAbandoning() + { + return isset($this->abandoning) ? $this->abandoning : 0; + } + + public function hasAbandoning() + { + return isset($this->abandoning); + } + + public function clearAbandoning() + { + unset($this->abandoning); + } + + /** + * [Output Only] The total number of instances in the managed instance group that are scheduled to be abandoned. Abandoning an instance removes it from the managed instance group without deleting it. + * + * Generated from protobuf field optional int32 abandoning = 440023373; + * @param int $var + * @return $this + */ + public function setAbandoning($var) + { + GPBUtil::checkInt32($var); + $this->abandoning = $var; + + return $this; + } + + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be created or are currently being created. If the group fails to create any of these instances, it tries again until it creates the instance successfully. If you have disabled creation retries, this field will not be populated; instead, the creatingWithoutRetries field will be populated. + * + * Generated from protobuf field optional int32 creating = 209809081; + * @return int + */ + public function getCreating() + { + return isset($this->creating) ? $this->creating : 0; + } + + public function hasCreating() + { + return isset($this->creating); + } + + public function clearCreating() + { + unset($this->creating); + } + + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be created or are currently being created. If the group fails to create any of these instances, it tries again until it creates the instance successfully. If you have disabled creation retries, this field will not be populated; instead, the creatingWithoutRetries field will be populated. + * + * Generated from protobuf field optional int32 creating = 209809081; + * @param int $var + * @return $this + */ + public function setCreating($var) + { + GPBUtil::checkInt32($var); + $this->creating = $var; + + return $this; + } + + /** + * [Output Only] The number of instances that the managed instance group will attempt to create. The group attempts to create each instance only once. If the group fails to create any of these instances, it decreases the group's targetSize value accordingly. + * + * Generated from protobuf field optional int32 creating_without_retries = 369916745; + * @return int + */ + public function getCreatingWithoutRetries() + { + return isset($this->creating_without_retries) ? $this->creating_without_retries : 0; + } + + public function hasCreatingWithoutRetries() + { + return isset($this->creating_without_retries); + } + + public function clearCreatingWithoutRetries() + { + unset($this->creating_without_retries); + } + + /** + * [Output Only] The number of instances that the managed instance group will attempt to create. The group attempts to create each instance only once. If the group fails to create any of these instances, it decreases the group's targetSize value accordingly. + * + * Generated from protobuf field optional int32 creating_without_retries = 369916745; + * @param int $var + * @return $this + */ + public function setCreatingWithoutRetries($var) + { + GPBUtil::checkInt32($var); + $this->creating_without_retries = $var; + + return $this; + } + + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted. + * + * Generated from protobuf field optional int32 deleting = 282846120; + * @return int + */ + public function getDeleting() + { + return isset($this->deleting) ? $this->deleting : 0; + } + + public function hasDeleting() + { + return isset($this->deleting); + } + + public function clearDeleting() + { + unset($this->deleting); + } + + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted. + * + * Generated from protobuf field optional int32 deleting = 282846120; + * @param int $var + * @return $this + */ + public function setDeleting($var) + { + GPBUtil::checkInt32($var); + $this->deleting = $var; + + return $this; + } + + /** + * [Output Only] The number of instances in the managed instance group that are running and have no scheduled actions. + * + * Generated from protobuf field optional int32 none = 3387192; + * @return int + */ + public function getNone() + { + return isset($this->none) ? $this->none : 0; + } + + public function hasNone() + { + return isset($this->none); + } + + public function clearNone() + { + unset($this->none); + } + + /** + * [Output Only] The number of instances in the managed instance group that are running and have no scheduled actions. + * + * Generated from protobuf field optional int32 none = 3387192; + * @param int $var + * @return $this + */ + public function setNone($var) + { + GPBUtil::checkInt32($var); + $this->none = $var; + + return $this; + } + + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be recreated or are currently being being recreated. Recreating an instance deletes the existing root persistent disk and creates a new disk from the image that is defined in the instance template. + * + * Generated from protobuf field optional int32 recreating = 339057132; + * @return int + */ + public function getRecreating() + { + return isset($this->recreating) ? $this->recreating : 0; + } + + public function hasRecreating() + { + return isset($this->recreating); + } + + public function clearRecreating() + { + unset($this->recreating); + } + + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be recreated or are currently being being recreated. Recreating an instance deletes the existing root persistent disk and creates a new disk from the image that is defined in the instance template. + * + * Generated from protobuf field optional int32 recreating = 339057132; + * @param int $var + * @return $this + */ + public function setRecreating($var) + { + GPBUtil::checkInt32($var); + $this->recreating = $var; + + return $this; + } + + /** + * [Output Only] The number of instances in the managed instance group that are being reconfigured with properties that do not require a restart or a recreate action. For example, setting or removing target pools for the instance. + * + * Generated from protobuf field optional int32 refreshing = 215044903; + * @return int + */ + public function getRefreshing() + { + return isset($this->refreshing) ? $this->refreshing : 0; + } + + public function hasRefreshing() + { + return isset($this->refreshing); + } + + public function clearRefreshing() + { + unset($this->refreshing); + } + + /** + * [Output Only] The number of instances in the managed instance group that are being reconfigured with properties that do not require a restart or a recreate action. For example, setting or removing target pools for the instance. + * + * Generated from protobuf field optional int32 refreshing = 215044903; + * @param int $var + * @return $this + */ + public function setRefreshing($var) + { + GPBUtil::checkInt32($var); + $this->refreshing = $var; + + return $this; + } + + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted. + * + * Generated from protobuf field optional int32 restarting = 372312947; + * @return int + */ + public function getRestarting() + { + return isset($this->restarting) ? $this->restarting : 0; + } + + public function hasRestarting() + { + return isset($this->restarting); + } + + public function clearRestarting() + { + unset($this->restarting); + } + + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted. + * + * Generated from protobuf field optional int32 restarting = 372312947; + * @param int $var + * @return $this + */ + public function setRestarting($var) + { + GPBUtil::checkInt32($var); + $this->restarting = $var; + + return $this; + } + + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be resumed or are currently being resumed. + * + * Generated from protobuf field optional int32 resuming = 201100714; + * @return int + */ + public function getResuming() + { + return isset($this->resuming) ? $this->resuming : 0; + } + + public function hasResuming() + { + return isset($this->resuming); + } + + public function clearResuming() + { + unset($this->resuming); + } + + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be resumed or are currently being resumed. + * + * Generated from protobuf field optional int32 resuming = 201100714; + * @param int $var + * @return $this + */ + public function setResuming($var) + { + GPBUtil::checkInt32($var); + $this->resuming = $var; + + return $this; + } + + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be started or are currently being started. + * + * Generated from protobuf field optional int32 starting = 243064896; + * @return int + */ + public function getStarting() + { + return isset($this->starting) ? $this->starting : 0; + } + + public function hasStarting() + { + return isset($this->starting); + } + + public function clearStarting() + { + unset($this->starting); + } + + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be started or are currently being started. + * + * Generated from protobuf field optional int32 starting = 243064896; + * @param int $var + * @return $this + */ + public function setStarting($var) + { + GPBUtil::checkInt32($var); + $this->starting = $var; + + return $this; + } + + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be stopped or are currently being stopped. + * + * Generated from protobuf field optional int32 stopping = 105035892; + * @return int + */ + public function getStopping() + { + return isset($this->stopping) ? $this->stopping : 0; + } + + public function hasStopping() + { + return isset($this->stopping); + } + + public function clearStopping() + { + unset($this->stopping); + } + + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be stopped or are currently being stopped. + * + * Generated from protobuf field optional int32 stopping = 105035892; + * @param int $var + * @return $this + */ + public function setStopping($var) + { + GPBUtil::checkInt32($var); + $this->stopping = $var; + + return $this; + } + + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be suspended or are currently being suspended. + * + * Generated from protobuf field optional int32 suspending = 29113894; + * @return int + */ + public function getSuspending() + { + return isset($this->suspending) ? $this->suspending : 0; + } + + public function hasSuspending() + { + return isset($this->suspending); + } + + public function clearSuspending() + { + unset($this->suspending); + } + + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be suspended or are currently being suspended. + * + * Generated from protobuf field optional int32 suspending = 29113894; + * @param int $var + * @return $this + */ + public function setSuspending($var) + { + GPBUtil::checkInt32($var); + $this->suspending = $var; + + return $this; + } + + /** + * [Output Only] The number of instances in the managed instance group that are being verified. See the managedInstances[].currentAction property in the listManagedInstances method documentation. + * + * Generated from protobuf field optional int32 verifying = 451612873; + * @return int + */ + public function getVerifying() + { + return isset($this->verifying) ? $this->verifying : 0; + } + + public function hasVerifying() + { + return isset($this->verifying); + } + + public function clearVerifying() + { + unset($this->verifying); + } + + /** + * [Output Only] The number of instances in the managed instance group that are being verified. See the managedInstances[].currentAction property in the listManagedInstances method documentation. + * + * Generated from protobuf field optional int32 verifying = 451612873; + * @param int $var + * @return $this + */ + public function setVerifying($var) + { + GPBUtil::checkInt32($var); + $this->verifying = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerAggregatedList.php new file mode 100644 index 000000000000..09eacd31b050 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.InstanceGroupManagerAggregatedList + */ +class InstanceGroupManagerAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of InstanceGroupManagersScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] The resource type, which is always compute#instanceGroupManagerAggregatedList for an aggregated list of managed instance groups. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 InstanceGroupManagersScopedList resources. + * @type string $kind + * [Output Only] The resource type, which is always compute#instanceGroupManagerAggregatedList for an aggregated list of managed instance groups. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 InstanceGroupManagersScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of InstanceGroupManagersScopedList 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\InstanceGroupManagersScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] The resource type, which is always compute#instanceGroupManagerAggregatedList for an aggregated list of managed instance groups. + * + * 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); + } + + /** + * [Output Only] The resource type, which is always compute#instanceGroupManagerAggregatedList for an aggregated list of managed instance groups. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerAllInstancesConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerAllInstancesConfig.php new file mode 100644 index 000000000000..dd647de1728d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerAllInstancesConfig.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.InstanceGroupManagerAllInstancesConfig + */ +class InstanceGroupManagerAllInstancesConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Properties to set on all instances in the group. You can add or modify properties using the instanceGroupManagers.patch or regionInstanceGroupManagers.patch. After setting allInstancesConfig on the group, you must update the group's instances to apply the configuration. To apply the configuration, set the group's updatePolicy.type field to use proactive updates or use the applyUpdatesToInstances method. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstancePropertiesPatch properties = 147688755; + */ + protected $properties = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\InstancePropertiesPatch $properties + * Properties to set on all instances in the group. You can add or modify properties using the instanceGroupManagers.patch or regionInstanceGroupManagers.patch. After setting allInstancesConfig on the group, you must update the group's instances to apply the configuration. To apply the configuration, set the group's updatePolicy.type field to use proactive updates or use the applyUpdatesToInstances method. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Properties to set on all instances in the group. You can add or modify properties using the instanceGroupManagers.patch or regionInstanceGroupManagers.patch. After setting allInstancesConfig on the group, you must update the group's instances to apply the configuration. To apply the configuration, set the group's updatePolicy.type field to use proactive updates or use the applyUpdatesToInstances method. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstancePropertiesPatch properties = 147688755; + * @return \Google\Cloud\Compute\V1\InstancePropertiesPatch|null + */ + public function getProperties() + { + return $this->properties; + } + + public function hasProperties() + { + return isset($this->properties); + } + + public function clearProperties() + { + unset($this->properties); + } + + /** + * Properties to set on all instances in the group. You can add or modify properties using the instanceGroupManagers.patch or regionInstanceGroupManagers.patch. After setting allInstancesConfig on the group, you must update the group's instances to apply the configuration. To apply the configuration, set the group's updatePolicy.type field to use proactive updates or use the applyUpdatesToInstances method. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstancePropertiesPatch properties = 147688755; + * @param \Google\Cloud\Compute\V1\InstancePropertiesPatch $var + * @return $this + */ + public function setProperties($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstancePropertiesPatch::class); + $this->properties = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerAutoHealingPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerAutoHealingPolicy.php new file mode 100644 index 000000000000..d9edfdc49506 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerAutoHealingPolicy.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy + */ +class InstanceGroupManagerAutoHealingPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * The URL for the health check that signals autohealing. + * + * Generated from protobuf field optional string health_check = 308876645; + */ + protected $health_check = null; + /** + * The initial delay is the number of seconds that a new VM takes to initialize and run its startup script. During a VM's initial delay period, the MIG ignores unsuccessful health checks because the VM might be in the startup process. This prevents the MIG from prematurely recreating a VM. If the health check receives a healthy response during the initial delay, it indicates that the startup process is complete and the VM is ready. The value of initial delay must be between 0 and 3600 seconds. The default value is 0. + * + * Generated from protobuf field optional int32 initial_delay_sec = 263207002; + */ + protected $initial_delay_sec = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $health_check + * The URL for the health check that signals autohealing. + * @type int $initial_delay_sec + * The initial delay is the number of seconds that a new VM takes to initialize and run its startup script. During a VM's initial delay period, the MIG ignores unsuccessful health checks because the VM might be in the startup process. This prevents the MIG from prematurely recreating a VM. If the health check receives a healthy response during the initial delay, it indicates that the startup process is complete and the VM is ready. The value of initial delay must be between 0 and 3600 seconds. The default value is 0. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The URL for the health check that signals autohealing. + * + * Generated from protobuf field optional string health_check = 308876645; + * @return string + */ + public function getHealthCheck() + { + return isset($this->health_check) ? $this->health_check : ''; + } + + public function hasHealthCheck() + { + return isset($this->health_check); + } + + public function clearHealthCheck() + { + unset($this->health_check); + } + + /** + * The URL for the health check that signals autohealing. + * + * Generated from protobuf field optional string health_check = 308876645; + * @param string $var + * @return $this + */ + public function setHealthCheck($var) + { + GPBUtil::checkString($var, True); + $this->health_check = $var; + + return $this; + } + + /** + * The initial delay is the number of seconds that a new VM takes to initialize and run its startup script. During a VM's initial delay period, the MIG ignores unsuccessful health checks because the VM might be in the startup process. This prevents the MIG from prematurely recreating a VM. If the health check receives a healthy response during the initial delay, it indicates that the startup process is complete and the VM is ready. The value of initial delay must be between 0 and 3600 seconds. The default value is 0. + * + * Generated from protobuf field optional int32 initial_delay_sec = 263207002; + * @return int + */ + public function getInitialDelaySec() + { + return isset($this->initial_delay_sec) ? $this->initial_delay_sec : 0; + } + + public function hasInitialDelaySec() + { + return isset($this->initial_delay_sec); + } + + public function clearInitialDelaySec() + { + unset($this->initial_delay_sec); + } + + /** + * The initial delay is the number of seconds that a new VM takes to initialize and run its startup script. During a VM's initial delay period, the MIG ignores unsuccessful health checks because the VM might be in the startup process. This prevents the MIG from prematurely recreating a VM. If the health check receives a healthy response during the initial delay, it indicates that the startup process is complete and the VM is ready. The value of initial delay must be between 0 and 3600 seconds. The default value is 0. + * + * Generated from protobuf field optional int32 initial_delay_sec = 263207002; + * @param int $var + * @return $this + */ + public function setInitialDelaySec($var) + { + GPBUtil::checkInt32($var); + $this->initial_delay_sec = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerInstanceLifecyclePolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerInstanceLifecyclePolicy.php new file mode 100644 index 000000000000..1c91044fe5fd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerInstanceLifecyclePolicy.php @@ -0,0 +1,128 @@ +google.cloud.compute.v1.InstanceGroupManagerInstanceLifecyclePolicy + */ +class InstanceGroupManagerInstanceLifecyclePolicy extends \Google\Protobuf\Internal\Message +{ + /** + * The action that a MIG performs on a failed or an unhealthy VM. A VM is marked as unhealthy when the application running on that VM fails a health check. Valid values are - REPAIR (default): MIG automatically repairs a failed or an unhealthy VM by recreating it. For more information, see About repairing VMs in a MIG. - DO_NOTHING: MIG does not repair a failed or an unhealthy VM. + * Check the DefaultActionOnFailure enum for the list of possible values. + * + * Generated from protobuf field optional string default_action_on_failure = 61383253; + */ + protected $default_action_on_failure = null; + /** + * A bit indicating whether to forcefully apply the group's latest configuration when repairing a VM. Valid options are: - NO (default): If configuration updates are available, they are not forcefully applied during repair. Instead, configuration updates are applied according to the group's update policy. - YES: If configuration updates are available, they are applied during repair. + * Check the ForceUpdateOnRepair enum for the list of possible values. + * + * Generated from protobuf field optional string force_update_on_repair = 356302027; + */ + protected $force_update_on_repair = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $default_action_on_failure + * The action that a MIG performs on a failed or an unhealthy VM. A VM is marked as unhealthy when the application running on that VM fails a health check. Valid values are - REPAIR (default): MIG automatically repairs a failed or an unhealthy VM by recreating it. For more information, see About repairing VMs in a MIG. - DO_NOTHING: MIG does not repair a failed or an unhealthy VM. + * Check the DefaultActionOnFailure enum for the list of possible values. + * @type string $force_update_on_repair + * A bit indicating whether to forcefully apply the group's latest configuration when repairing a VM. Valid options are: - NO (default): If configuration updates are available, they are not forcefully applied during repair. Instead, configuration updates are applied according to the group's update policy. - YES: If configuration updates are available, they are applied during repair. + * Check the ForceUpdateOnRepair enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The action that a MIG performs on a failed or an unhealthy VM. A VM is marked as unhealthy when the application running on that VM fails a health check. Valid values are - REPAIR (default): MIG automatically repairs a failed or an unhealthy VM by recreating it. For more information, see About repairing VMs in a MIG. - DO_NOTHING: MIG does not repair a failed or an unhealthy VM. + * Check the DefaultActionOnFailure enum for the list of possible values. + * + * Generated from protobuf field optional string default_action_on_failure = 61383253; + * @return string + */ + public function getDefaultActionOnFailure() + { + return isset($this->default_action_on_failure) ? $this->default_action_on_failure : ''; + } + + public function hasDefaultActionOnFailure() + { + return isset($this->default_action_on_failure); + } + + public function clearDefaultActionOnFailure() + { + unset($this->default_action_on_failure); + } + + /** + * The action that a MIG performs on a failed or an unhealthy VM. A VM is marked as unhealthy when the application running on that VM fails a health check. Valid values are - REPAIR (default): MIG automatically repairs a failed or an unhealthy VM by recreating it. For more information, see About repairing VMs in a MIG. - DO_NOTHING: MIG does not repair a failed or an unhealthy VM. + * Check the DefaultActionOnFailure enum for the list of possible values. + * + * Generated from protobuf field optional string default_action_on_failure = 61383253; + * @param string $var + * @return $this + */ + public function setDefaultActionOnFailure($var) + { + GPBUtil::checkString($var, True); + $this->default_action_on_failure = $var; + + return $this; + } + + /** + * A bit indicating whether to forcefully apply the group's latest configuration when repairing a VM. Valid options are: - NO (default): If configuration updates are available, they are not forcefully applied during repair. Instead, configuration updates are applied according to the group's update policy. - YES: If configuration updates are available, they are applied during repair. + * Check the ForceUpdateOnRepair enum for the list of possible values. + * + * Generated from protobuf field optional string force_update_on_repair = 356302027; + * @return string + */ + public function getForceUpdateOnRepair() + { + return isset($this->force_update_on_repair) ? $this->force_update_on_repair : ''; + } + + public function hasForceUpdateOnRepair() + { + return isset($this->force_update_on_repair); + } + + public function clearForceUpdateOnRepair() + { + unset($this->force_update_on_repair); + } + + /** + * A bit indicating whether to forcefully apply the group's latest configuration when repairing a VM. Valid options are: - NO (default): If configuration updates are available, they are not forcefully applied during repair. Instead, configuration updates are applied according to the group's update policy. - YES: If configuration updates are available, they are applied during repair. + * Check the ForceUpdateOnRepair enum for the list of possible values. + * + * Generated from protobuf field optional string force_update_on_repair = 356302027; + * @param string $var + * @return $this + */ + public function setForceUpdateOnRepair($var) + { + GPBUtil::checkString($var, True); + $this->force_update_on_repair = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerInstanceLifecyclePolicy/DefaultActionOnFailure.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerInstanceLifecyclePolicy/DefaultActionOnFailure.php new file mode 100644 index 000000000000..559db82f4b81 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerInstanceLifecyclePolicy/DefaultActionOnFailure.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.InstanceGroupManagerInstanceLifecyclePolicy.DefaultActionOnFailure + */ +class DefaultActionOnFailure +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_DEFAULT_ACTION_ON_FAILURE = 0; + */ + const UNDEFINED_DEFAULT_ACTION_ON_FAILURE = 0; + /** + * MIG does not repair a failed or an unhealthy VM. + * + * Generated from protobuf enum DO_NOTHING = 451307513; + */ + const DO_NOTHING = 451307513; + /** + * (Default) MIG automatically repairs a failed or an unhealthy VM by recreating it. For more information, see About repairing VMs in a MIG. + * + * Generated from protobuf enum REPAIR = 266277773; + */ + const REPAIR = 266277773; + + private static $valueToName = [ + self::UNDEFINED_DEFAULT_ACTION_ON_FAILURE => 'UNDEFINED_DEFAULT_ACTION_ON_FAILURE', + self::DO_NOTHING => 'DO_NOTHING', + self::REPAIR => 'REPAIR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DefaultActionOnFailure::class, \Google\Cloud\Compute\V1\InstanceGroupManagerInstanceLifecyclePolicy_DefaultActionOnFailure::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerInstanceLifecyclePolicy/ForceUpdateOnRepair.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerInstanceLifecyclePolicy/ForceUpdateOnRepair.php new file mode 100644 index 000000000000..82cbe3ea7d84 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerInstanceLifecyclePolicy/ForceUpdateOnRepair.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.InstanceGroupManagerInstanceLifecyclePolicy.ForceUpdateOnRepair + */ +class ForceUpdateOnRepair +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_FORCE_UPDATE_ON_REPAIR = 0; + */ + const UNDEFINED_FORCE_UPDATE_ON_REPAIR = 0; + /** + * Generated from protobuf enum NO = 2497; + */ + const NO = 2497; + /** + * Generated from protobuf enum YES = 87751; + */ + const YES = 87751; + + private static $valueToName = [ + self::UNDEFINED_FORCE_UPDATE_ON_REPAIR => 'UNDEFINED_FORCE_UPDATE_ON_REPAIR', + self::NO => 'NO', + self::YES => 'YES', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ForceUpdateOnRepair::class, \Google\Cloud\Compute\V1\InstanceGroupManagerInstanceLifecyclePolicy_ForceUpdateOnRepair::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerList.php new file mode 100644 index 000000000000..37e06b7a8f1b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.InstanceGroupManagerList + */ +class InstanceGroupManagerList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of InstanceGroupManager resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroupManager items = 100526016; + */ + private $items; + /** + * [Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\InstanceGroupManager>|\Google\Protobuf\Internal\RepeatedField $items + * A list of InstanceGroupManager resources. + * @type string $kind + * [Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups. + * @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 InstanceGroupManager resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroupManager items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of InstanceGroupManager resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroupManager items = 100526016; + * @param array<\Google\Cloud\Compute\V1\InstanceGroupManager>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstanceGroupManager::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups. + * + * 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); + } + + /** + * [Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerResizeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerResizeRequest.php new file mode 100644 index 000000000000..8362a90a9de0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerResizeRequest.php @@ -0,0 +1,565 @@ +google.cloud.compute.v1.InstanceGroupManagerResizeRequest + */ +class InstanceGroupManagerResizeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The creation timestamp for this resize request in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] A unique identifier for this resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] The resource type, which is always compute#instanceGroupManagerResizeRequest for resize requests. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * The name of this resize request. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Requested run duration for instances that will be created by this request. At the end of the run duration instance will be deleted. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration requested_run_duration = 232146425; + */ + protected $requested_run_duration = null; + /** + * The number of instances to be created by this resize request. The group's target size will be increased by this number. + * + * Generated from protobuf field optional int32 resize_by = 533735362; + */ + protected $resize_by = null; + /** + * [Output Only] The URL for this resize request. The server defines this URL. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Server-defined URL for this resource with the resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + */ + protected $self_link_with_id = null; + /** + * [Output only] Current state of the request. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + */ + protected $state = null; + /** + * [Output only] Status of the request. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerResizeRequestStatus status = 181260274; + */ + protected $status = null; + /** + * [Output Only] The URL of a zone where the resize request is located. Populated only for zonal resize requests. + * + * Generated from protobuf field optional string zone = 3744684; + */ + protected $zone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] The creation timestamp for this resize request in RFC3339 text format. + * @type string $description + * An optional description of this resource. + * @type int|string $id + * [Output Only] A unique identifier for this resource type. The server generates this identifier. + * @type string $kind + * [Output Only] The resource type, which is always compute#instanceGroupManagerResizeRequest for resize requests. + * @type string $name + * The name of this resize request. The name must be 1-63 characters long, and comply with RFC1035. + * @type \Google\Cloud\Compute\V1\Duration $requested_run_duration + * Requested run duration for instances that will be created by this request. At the end of the run duration instance will be deleted. + * @type int $resize_by + * The number of instances to be created by this resize request. The group's target size will be increased by this number. + * @type string $self_link + * [Output Only] The URL for this resize request. The server defines this URL. + * @type string $self_link_with_id + * [Output Only] Server-defined URL for this resource with the resource id. + * @type string $state + * [Output only] Current state of the request. + * Check the State enum for the list of possible values. + * @type \Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequestStatus $status + * [Output only] Status of the request. + * @type string $zone + * [Output Only] The URL of a zone where the resize request is located. Populated only for zonal resize requests. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The creation timestamp for this resize request in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] The creation timestamp for this resize request in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] A unique identifier for this resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] A unique identifier for this resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] The resource type, which is always compute#instanceGroupManagerResizeRequest for resize requests. + * + * 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); + } + + /** + * [Output Only] The resource type, which is always compute#instanceGroupManagerResizeRequest for resize requests. + * + * 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; + } + + /** + * The name of this resize request. The name must be 1-63 characters long, and comply with RFC1035. + * + * 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 of this resize request. The name must be 1-63 characters long, and comply with RFC1035. + * + * 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; + } + + /** + * Requested run duration for instances that will be created by this request. At the end of the run duration instance will be deleted. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration requested_run_duration = 232146425; + * @return \Google\Cloud\Compute\V1\Duration|null + */ + public function getRequestedRunDuration() + { + return $this->requested_run_duration; + } + + public function hasRequestedRunDuration() + { + return isset($this->requested_run_duration); + } + + public function clearRequestedRunDuration() + { + unset($this->requested_run_duration); + } + + /** + * Requested run duration for instances that will be created by this request. At the end of the run duration instance will be deleted. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration requested_run_duration = 232146425; + * @param \Google\Cloud\Compute\V1\Duration $var + * @return $this + */ + public function setRequestedRunDuration($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Duration::class); + $this->requested_run_duration = $var; + + return $this; + } + + /** + * The number of instances to be created by this resize request. The group's target size will be increased by this number. + * + * Generated from protobuf field optional int32 resize_by = 533735362; + * @return int + */ + public function getResizeBy() + { + return isset($this->resize_by) ? $this->resize_by : 0; + } + + public function hasResizeBy() + { + return isset($this->resize_by); + } + + public function clearResizeBy() + { + unset($this->resize_by); + } + + /** + * The number of instances to be created by this resize request. The group's target size will be increased by this number. + * + * Generated from protobuf field optional int32 resize_by = 533735362; + * @param int $var + * @return $this + */ + public function setResizeBy($var) + { + GPBUtil::checkInt32($var); + $this->resize_by = $var; + + return $this; + } + + /** + * [Output Only] The URL for this resize request. The server defines this URL. + * + * 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] The URL for this resize request. The server defines this URL. + * + * 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] Server-defined URL for this resource with the resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + * @return string + */ + public function getSelfLinkWithId() + { + return isset($this->self_link_with_id) ? $this->self_link_with_id : ''; + } + + public function hasSelfLinkWithId() + { + return isset($this->self_link_with_id); + } + + public function clearSelfLinkWithId() + { + unset($this->self_link_with_id); + } + + /** + * [Output Only] Server-defined URL for this resource with the resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + * @param string $var + * @return $this + */ + public function setSelfLinkWithId($var) + { + GPBUtil::checkString($var, True); + $this->self_link_with_id = $var; + + return $this; + } + + /** + * [Output only] Current state of the request. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @return string + */ + public function getState() + { + return isset($this->state) ? $this->state : ''; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * [Output only] Current state of the request. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + + /** + * [Output only] Status of the request. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerResizeRequestStatus status = 181260274; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequestStatus|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output only] Status of the request. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerResizeRequestStatus status = 181260274; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequestStatus $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequestStatus::class); + $this->status = $var; + + return $this; + } + + /** + * [Output Only] The URL of a zone where the resize request is located. Populated only for zonal resize requests. + * + * Generated from protobuf field optional string zone = 3744684; + * @return string + */ + public function getZone() + { + return isset($this->zone) ? $this->zone : ''; + } + + public function hasZone() + { + return isset($this->zone); + } + + public function clearZone() + { + unset($this->zone); + } + + /** + * [Output Only] The URL of a zone where the resize request is located. Populated only for zonal resize requests. + * + * Generated from protobuf field optional string zone = 3744684; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerResizeRequest/State.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerResizeRequest/State.php new file mode 100644 index 000000000000..2fa81e4b540e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerResizeRequest/State.php @@ -0,0 +1,92 @@ +google.cloud.compute.v1.InstanceGroupManagerResizeRequest.State + */ +class State +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATE = 0; + */ + const UNDEFINED_STATE = 0; + /** + * The request was created successfully and was accepted for provisioning when the capacity becomes available. + * + * Generated from protobuf enum ACCEPTED = 246714279; + */ + const ACCEPTED = 246714279; + /** + * The request is cancelled. + * + * Generated from protobuf enum CANCELLED = 41957681; + */ + const CANCELLED = 41957681; + /** + * Resize request is being created and may still fail creation. + * + * Generated from protobuf enum CREATING = 455564985; + */ + const CREATING = 455564985; + /** + * The request failed before or during provisioning. If the request fails during provisioning, any VMs that were created during provisioning are rolled back and removed from the MIG. + * + * Generated from protobuf enum FAILED = 455706685; + */ + const FAILED = 455706685; + /** + * Default value. This value should never be returned. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 470755401; + */ + const STATE_UNSPECIFIED = 470755401; + /** + * The request succeeded. + * + * Generated from protobuf enum SUCCEEDED = 511103553; + */ + const SUCCEEDED = 511103553; + + private static $valueToName = [ + self::UNDEFINED_STATE => 'UNDEFINED_STATE', + self::ACCEPTED => 'ACCEPTED', + self::CANCELLED => 'CANCELLED', + self::CREATING => 'CREATING', + self::FAILED => 'FAILED', + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::SUCCEEDED => 'SUCCEEDED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequest_State::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerResizeRequestStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerResizeRequestStatus.php new file mode 100644 index 000000000000..85eed299cc2e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerResizeRequestStatus.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.InstanceGroupManagerResizeRequestStatus + */ +class InstanceGroupManagerResizeRequestStatus extends \Google\Protobuf\Internal\Message +{ + /** + * [Output only] Fatal errors encountered during the queueing or provisioning phases of the ResizeRequest that caused the transition to the FAILED state. Contrary to the last_attempt errors, this field is final and errors are never removed from here, as the ResizeRequest is not going to retry. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Error error = 96784904; + */ + protected $error = null; + /** + * [Output only] Information about the last attempt to fulfill the request. The value is temporary since the ResizeRequest can retry, as long as it's still active and the last attempt value can either be cleared or replaced with a different error. Since ResizeRequest retries infrequently, the value may be stale and no longer show an active problem. The value is cleared when ResizeRequest transitions to the final state (becomes inactive). If the final state is FAILED the error describing it will be storred in the "error" field only. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerResizeRequestStatusLastAttempt last_attempt = 434771492; + */ + protected $last_attempt = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\Error $error + * [Output only] Fatal errors encountered during the queueing or provisioning phases of the ResizeRequest that caused the transition to the FAILED state. Contrary to the last_attempt errors, this field is final and errors are never removed from here, as the ResizeRequest is not going to retry. + * @type \Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequestStatusLastAttempt $last_attempt + * [Output only] Information about the last attempt to fulfill the request. The value is temporary since the ResizeRequest can retry, as long as it's still active and the last attempt value can either be cleared or replaced with a different error. Since ResizeRequest retries infrequently, the value may be stale and no longer show an active problem. The value is cleared when ResizeRequest transitions to the final state (becomes inactive). If the final state is FAILED the error describing it will be storred in the "error" field only. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output only] Fatal errors encountered during the queueing or provisioning phases of the ResizeRequest that caused the transition to the FAILED state. Contrary to the last_attempt errors, this field is final and errors are never removed from here, as the ResizeRequest is not going to retry. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Error error = 96784904; + * @return \Google\Cloud\Compute\V1\Error|null + */ + public function getError() + { + return $this->error; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * [Output only] Fatal errors encountered during the queueing or provisioning phases of the ResizeRequest that caused the transition to the FAILED state. Contrary to the last_attempt errors, this field is final and errors are never removed from here, as the ResizeRequest is not going to retry. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Error error = 96784904; + * @param \Google\Cloud\Compute\V1\Error $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Error::class); + $this->error = $var; + + return $this; + } + + /** + * [Output only] Information about the last attempt to fulfill the request. The value is temporary since the ResizeRequest can retry, as long as it's still active and the last attempt value can either be cleared or replaced with a different error. Since ResizeRequest retries infrequently, the value may be stale and no longer show an active problem. The value is cleared when ResizeRequest transitions to the final state (becomes inactive). If the final state is FAILED the error describing it will be storred in the "error" field only. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerResizeRequestStatusLastAttempt last_attempt = 434771492; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequestStatusLastAttempt|null + */ + public function getLastAttempt() + { + return $this->last_attempt; + } + + public function hasLastAttempt() + { + return isset($this->last_attempt); + } + + public function clearLastAttempt() + { + unset($this->last_attempt); + } + + /** + * [Output only] Information about the last attempt to fulfill the request. The value is temporary since the ResizeRequest can retry, as long as it's still active and the last attempt value can either be cleared or replaced with a different error. Since ResizeRequest retries infrequently, the value may be stale and no longer show an active problem. The value is cleared when ResizeRequest transitions to the final state (becomes inactive). If the final state is FAILED the error describing it will be storred in the "error" field only. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerResizeRequestStatusLastAttempt last_attempt = 434771492; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequestStatusLastAttempt $var + * @return $this + */ + public function setLastAttempt($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequestStatusLastAttempt::class); + $this->last_attempt = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerResizeRequestStatusLastAttempt.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerResizeRequestStatusLastAttempt.php new file mode 100644 index 000000000000..ad551432886f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerResizeRequestStatusLastAttempt.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.InstanceGroupManagerResizeRequestStatusLastAttempt + */ +class InstanceGroupManagerResizeRequestStatusLastAttempt extends \Google\Protobuf\Internal\Message +{ + /** + * Errors that prevented the ResizeRequest to be fulfilled. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Error error = 96784904; + */ + protected $error = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\Error $error + * Errors that prevented the ResizeRequest to be fulfilled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Errors that prevented the ResizeRequest to be fulfilled. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Error error = 96784904; + * @return \Google\Cloud\Compute\V1\Error|null + */ + public function getError() + { + return $this->error; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * Errors that prevented the ResizeRequest to be fulfilled. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Error error = 96784904; + * @param \Google\Cloud\Compute\V1\Error $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Error::class); + $this->error = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerResizeRequestsListResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerResizeRequestsListResponse.php new file mode 100644 index 000000000000..26fa14ab7208 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerResizeRequestsListResponse.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.InstanceGroupManagerResizeRequestsListResponse + */ +class InstanceGroupManagerResizeRequestsListResponse extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of resize request resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroupManagerResizeRequest items = 100526016; + */ + private $items; + /** + * [Output Only] Type of the resource. Always compute#instanceGroupManagerResizeRequestList for a list of resize requests. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\InstanceGroupManagerResizeRequest>|\Google\Protobuf\Internal\RepeatedField $items + * A list of resize request resources. + * @type string $kind + * [Output Only] Type of the resource. Always compute#instanceGroupManagerResizeRequestList for a list of resize requests. + * @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 resize request resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroupManagerResizeRequest items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of resize request resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroupManagerResizeRequest items = 100526016; + * @param array<\Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequest>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequest::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#instanceGroupManagerResizeRequestList for a list of resize requests. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#instanceGroupManagerResizeRequestList for a list of resize requests. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStatus.php new file mode 100644 index 000000000000..feebda7817b6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStatus.php @@ -0,0 +1,252 @@ +google.cloud.compute.v1.InstanceGroupManagerStatus + */ +class InstanceGroupManagerStatus extends \Google\Protobuf\Internal\Message +{ + /** + * [Output only] Status of all-instances configuration on the group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerStatusAllInstancesConfig all_instances_config = 112596737; + */ + protected $all_instances_config = null; + /** + * [Output Only] The URL of the Autoscaler that targets this instance group manager. + * + * Generated from protobuf field optional string autoscaler = 517258967; + */ + protected $autoscaler = null; + /** + * [Output Only] A bit indicating whether the managed instance group is in a stable state. A stable state means that: none of the instances in the managed instance group is currently undergoing any type of change (for example, creation, restart, or deletion); no future changes are scheduled for instances in the managed instance group; and the managed instance group itself is not being modified. + * + * Generated from protobuf field optional bool is_stable = 108410864; + */ + protected $is_stable = null; + /** + * [Output Only] Stateful status of the given Instance Group Manager. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerStatusStateful stateful = 244462412; + */ + protected $stateful = null; + /** + * [Output Only] A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget version_target = 289386200; + */ + protected $version_target = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\InstanceGroupManagerStatusAllInstancesConfig $all_instances_config + * [Output only] Status of all-instances configuration on the group. + * @type string $autoscaler + * [Output Only] The URL of the Autoscaler that targets this instance group manager. + * @type bool $is_stable + * [Output Only] A bit indicating whether the managed instance group is in a stable state. A stable state means that: none of the instances in the managed instance group is currently undergoing any type of change (for example, creation, restart, or deletion); no future changes are scheduled for instances in the managed instance group; and the managed instance group itself is not being modified. + * @type \Google\Cloud\Compute\V1\InstanceGroupManagerStatusStateful $stateful + * [Output Only] Stateful status of the given Instance Group Manager. + * @type \Google\Cloud\Compute\V1\InstanceGroupManagerStatusVersionTarget $version_target + * [Output Only] A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output only] Status of all-instances configuration on the group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerStatusAllInstancesConfig all_instances_config = 112596737; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagerStatusAllInstancesConfig|null + */ + public function getAllInstancesConfig() + { + return $this->all_instances_config; + } + + public function hasAllInstancesConfig() + { + return isset($this->all_instances_config); + } + + public function clearAllInstancesConfig() + { + unset($this->all_instances_config); + } + + /** + * [Output only] Status of all-instances configuration on the group. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerStatusAllInstancesConfig all_instances_config = 112596737; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagerStatusAllInstancesConfig $var + * @return $this + */ + public function setAllInstancesConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagerStatusAllInstancesConfig::class); + $this->all_instances_config = $var; + + return $this; + } + + /** + * [Output Only] The URL of the Autoscaler that targets this instance group manager. + * + * Generated from protobuf field optional string autoscaler = 517258967; + * @return string + */ + public function getAutoscaler() + { + return isset($this->autoscaler) ? $this->autoscaler : ''; + } + + public function hasAutoscaler() + { + return isset($this->autoscaler); + } + + public function clearAutoscaler() + { + unset($this->autoscaler); + } + + /** + * [Output Only] The URL of the Autoscaler that targets this instance group manager. + * + * Generated from protobuf field optional string autoscaler = 517258967; + * @param string $var + * @return $this + */ + public function setAutoscaler($var) + { + GPBUtil::checkString($var, True); + $this->autoscaler = $var; + + return $this; + } + + /** + * [Output Only] A bit indicating whether the managed instance group is in a stable state. A stable state means that: none of the instances in the managed instance group is currently undergoing any type of change (for example, creation, restart, or deletion); no future changes are scheduled for instances in the managed instance group; and the managed instance group itself is not being modified. + * + * Generated from protobuf field optional bool is_stable = 108410864; + * @return bool + */ + public function getIsStable() + { + return isset($this->is_stable) ? $this->is_stable : false; + } + + public function hasIsStable() + { + return isset($this->is_stable); + } + + public function clearIsStable() + { + unset($this->is_stable); + } + + /** + * [Output Only] A bit indicating whether the managed instance group is in a stable state. A stable state means that: none of the instances in the managed instance group is currently undergoing any type of change (for example, creation, restart, or deletion); no future changes are scheduled for instances in the managed instance group; and the managed instance group itself is not being modified. + * + * Generated from protobuf field optional bool is_stable = 108410864; + * @param bool $var + * @return $this + */ + public function setIsStable($var) + { + GPBUtil::checkBool($var); + $this->is_stable = $var; + + return $this; + } + + /** + * [Output Only] Stateful status of the given Instance Group Manager. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerStatusStateful stateful = 244462412; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagerStatusStateful|null + */ + public function getStateful() + { + return $this->stateful; + } + + public function hasStateful() + { + return isset($this->stateful); + } + + public function clearStateful() + { + unset($this->stateful); + } + + /** + * [Output Only] Stateful status of the given Instance Group Manager. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerStatusStateful stateful = 244462412; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagerStatusStateful $var + * @return $this + */ + public function setStateful($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagerStatusStateful::class); + $this->stateful = $var; + + return $this; + } + + /** + * [Output Only] A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget version_target = 289386200; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagerStatusVersionTarget|null + */ + public function getVersionTarget() + { + return $this->version_target; + } + + public function hasVersionTarget() + { + return isset($this->version_target); + } + + public function clearVersionTarget() + { + unset($this->version_target); + } + + /** + * [Output Only] A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget version_target = 289386200; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagerStatusVersionTarget $var + * @return $this + */ + public function setVersionTarget($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagerStatusVersionTarget::class); + $this->version_target = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStatusAllInstancesConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStatusAllInstancesConfig.php new file mode 100644 index 000000000000..5fe8105edfa9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStatusAllInstancesConfig.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.InstanceGroupManagerStatusAllInstancesConfig + */ +class InstanceGroupManagerStatusAllInstancesConfig extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Current all-instances configuration revision. This value is in RFC3339 text format. + * + * Generated from protobuf field optional string current_revision = 38355937; + */ + protected $current_revision = null; + /** + * [Output Only] A bit indicating whether this configuration has been applied to all managed instances in the group. + * + * Generated from protobuf field optional bool effective = 141961639; + */ + protected $effective = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $current_revision + * [Output Only] Current all-instances configuration revision. This value is in RFC3339 text format. + * @type bool $effective + * [Output Only] A bit indicating whether this configuration has been applied to all managed instances in the group. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Current all-instances configuration revision. This value is in RFC3339 text format. + * + * Generated from protobuf field optional string current_revision = 38355937; + * @return string + */ + public function getCurrentRevision() + { + return isset($this->current_revision) ? $this->current_revision : ''; + } + + public function hasCurrentRevision() + { + return isset($this->current_revision); + } + + public function clearCurrentRevision() + { + unset($this->current_revision); + } + + /** + * [Output Only] Current all-instances configuration revision. This value is in RFC3339 text format. + * + * Generated from protobuf field optional string current_revision = 38355937; + * @param string $var + * @return $this + */ + public function setCurrentRevision($var) + { + GPBUtil::checkString($var, True); + $this->current_revision = $var; + + return $this; + } + + /** + * [Output Only] A bit indicating whether this configuration has been applied to all managed instances in the group. + * + * Generated from protobuf field optional bool effective = 141961639; + * @return bool + */ + public function getEffective() + { + return isset($this->effective) ? $this->effective : false; + } + + public function hasEffective() + { + return isset($this->effective); + } + + public function clearEffective() + { + unset($this->effective); + } + + /** + * [Output Only] A bit indicating whether this configuration has been applied to all managed instances in the group. + * + * Generated from protobuf field optional bool effective = 141961639; + * @param bool $var + * @return $this + */ + public function setEffective($var) + { + GPBUtil::checkBool($var); + $this->effective = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStatusStateful.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStatusStateful.php new file mode 100644 index 000000000000..3b052f173d82 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStatusStateful.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.InstanceGroupManagerStatusStateful + */ +class InstanceGroupManagerStatusStateful extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful configuration even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions. + * + * Generated from protobuf field optional bool has_stateful_config = 110474224; + */ + protected $has_stateful_config = null; + /** + * [Output Only] Status of per-instance configurations on the instances. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs per_instance_configs = 526265001; + */ + protected $per_instance_configs = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $has_stateful_config + * [Output Only] A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful configuration even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions. + * @type \Google\Cloud\Compute\V1\InstanceGroupManagerStatusStatefulPerInstanceConfigs $per_instance_configs + * [Output Only] Status of per-instance configurations on the instances. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful configuration even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions. + * + * Generated from protobuf field optional bool has_stateful_config = 110474224; + * @return bool + */ + public function getHasStatefulConfig() + { + return isset($this->has_stateful_config) ? $this->has_stateful_config : false; + } + + public function hasHasStatefulConfig() + { + return isset($this->has_stateful_config); + } + + public function clearHasStatefulConfig() + { + unset($this->has_stateful_config); + } + + /** + * [Output Only] A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful configuration even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions. + * + * Generated from protobuf field optional bool has_stateful_config = 110474224; + * @param bool $var + * @return $this + */ + public function setHasStatefulConfig($var) + { + GPBUtil::checkBool($var); + $this->has_stateful_config = $var; + + return $this; + } + + /** + * [Output Only] Status of per-instance configurations on the instances. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs per_instance_configs = 526265001; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagerStatusStatefulPerInstanceConfigs|null + */ + public function getPerInstanceConfigs() + { + return $this->per_instance_configs; + } + + public function hasPerInstanceConfigs() + { + return isset($this->per_instance_configs); + } + + public function clearPerInstanceConfigs() + { + unset($this->per_instance_configs); + } + + /** + * [Output Only] Status of per-instance configurations on the instances. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs per_instance_configs = 526265001; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagerStatusStatefulPerInstanceConfigs $var + * @return $this + */ + public function setPerInstanceConfigs($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagerStatusStatefulPerInstanceConfigs::class); + $this->per_instance_configs = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStatusStatefulPerInstanceConfigs.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStatusStatefulPerInstanceConfigs.php new file mode 100644 index 000000000000..b68e4dc5655e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStatusStatefulPerInstanceConfigs.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs + */ +class InstanceGroupManagerStatusStatefulPerInstanceConfigs extends \Google\Protobuf\Internal\Message +{ + /** + * A bit indicating if all of the group's per-instance configurations (listed in the output of a listPerInstanceConfigs API call) have status EFFECTIVE or there are no per-instance-configs. + * + * Generated from protobuf field optional bool all_effective = 516540553; + */ + protected $all_effective = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $all_effective + * A bit indicating if all of the group's per-instance configurations (listed in the output of a listPerInstanceConfigs API call) have status EFFECTIVE or there are no per-instance-configs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A bit indicating if all of the group's per-instance configurations (listed in the output of a listPerInstanceConfigs API call) have status EFFECTIVE or there are no per-instance-configs. + * + * Generated from protobuf field optional bool all_effective = 516540553; + * @return bool + */ + public function getAllEffective() + { + return isset($this->all_effective) ? $this->all_effective : false; + } + + public function hasAllEffective() + { + return isset($this->all_effective); + } + + public function clearAllEffective() + { + unset($this->all_effective); + } + + /** + * A bit indicating if all of the group's per-instance configurations (listed in the output of a listPerInstanceConfigs API call) have status EFFECTIVE or there are no per-instance-configs. + * + * Generated from protobuf field optional bool all_effective = 516540553; + * @param bool $var + * @return $this + */ + public function setAllEffective($var) + { + GPBUtil::checkBool($var); + $this->all_effective = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStatusVersionTarget.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStatusVersionTarget.php new file mode 100644 index 000000000000..3cb8e8efacdb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStatusVersionTarget.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget + */ +class InstanceGroupManagerStatusVersionTarget extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A bit indicating whether version target has been reached in this managed instance group, i.e. all instances are in their target version. Instances' target version are specified by version field on Instance Group Manager. + * + * Generated from protobuf field optional bool is_reached = 433209149; + */ + protected $is_reached = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $is_reached + * [Output Only] A bit indicating whether version target has been reached in this managed instance group, i.e. all instances are in their target version. Instances' target version are specified by version field on Instance Group Manager. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] A bit indicating whether version target has been reached in this managed instance group, i.e. all instances are in their target version. Instances' target version are specified by version field on Instance Group Manager. + * + * Generated from protobuf field optional bool is_reached = 433209149; + * @return bool + */ + public function getIsReached() + { + return isset($this->is_reached) ? $this->is_reached : false; + } + + public function hasIsReached() + { + return isset($this->is_reached); + } + + public function clearIsReached() + { + unset($this->is_reached); + } + + /** + * [Output Only] A bit indicating whether version target has been reached in this managed instance group, i.e. all instances are in their target version. Instances' target version are specified by version field on Instance Group Manager. + * + * Generated from protobuf field optional bool is_reached = 433209149; + * @param bool $var + * @return $this + */ + public function setIsReached($var) + { + GPBUtil::checkBool($var); + $this->is_reached = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy.php new file mode 100644 index 000000000000..d50ab874da0c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy.php @@ -0,0 +1,360 @@ +google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy + */ +class InstanceGroupManagerUpdatePolicy extends \Google\Protobuf\Internal\Message +{ + /** + * The instance redistribution policy for regional managed instance groups. Valid values are: - PROACTIVE (default): The group attempts to maintain an even distribution of VM instances across zones in the region. - NONE: For non-autoscaled groups, proactive redistribution is disabled. + * Check the InstanceRedistributionType enum for the list of possible values. + * + * Generated from protobuf field optional string instance_redistribution_type = 292630424; + */ + protected $instance_redistribution_type = null; + /** + * The maximum number of instances that can be created above the specified targetSize during the update process. This value can be either a fixed number or, if the group has 10 or more instances, a percentage. If you set a percentage, the number of instances is rounded if necessary. The default value for maxSurge is a fixed value equal to the number of zones in which the managed instance group operates. At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxSurge. + * + * Generated from protobuf field optional .google.cloud.compute.v1.FixedOrPercent max_surge = 302572691; + */ + protected $max_surge = null; + /** + * The maximum number of instances that can be unavailable during the update process. An instance is considered available if all of the following conditions are satisfied: - The instance's status is RUNNING. - If there is a health check on the instance group, the instance's health check status must be HEALTHY at least once. If there is no health check on the group, then the instance only needs to have a status of RUNNING to be considered available. This value can be either a fixed number or, if the group has 10 or more instances, a percentage. If you set a percentage, the number of instances is rounded if necessary. The default value for maxUnavailable is a fixed value equal to the number of zones in which the managed instance group operates. At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxUnavailable. + * + * Generated from protobuf field optional .google.cloud.compute.v1.FixedOrPercent max_unavailable = 404940277; + */ + protected $max_unavailable = null; + /** + * Minimal action to be taken on an instance. Use this option to minimize disruption as much as possible or to apply a more disruptive action than is necessary. - To limit disruption as much as possible, set the minimal action to REFRESH. If your update requires a more disruptive action, Compute Engine performs the necessary action to execute the update. - To apply a more disruptive action than is strictly necessary, set the minimal action to RESTART or REPLACE. For example, Compute Engine does not need to restart a VM to change its metadata. But if your application reads instance metadata only when a VM is restarted, you can set the minimal action to RESTART in order to pick up metadata changes. + * Check the MinimalAction enum for the list of possible values. + * + * Generated from protobuf field optional string minimal_action = 270567060; + */ + protected $minimal_action = null; + /** + * Most disruptive action that is allowed to be taken on an instance. You can specify either NONE to forbid any actions, REFRESH to avoid restarting the VM and to limit disruption as much as possible. RESTART to allow actions that can be applied without instance replacing or REPLACE to allow all possible actions. If the Updater determines that the minimal update action needed is more disruptive than most disruptive allowed action you specify it will not perform the update at all. + * Check the MostDisruptiveAllowedAction enum for the list of possible values. + * + * Generated from protobuf field optional string most_disruptive_allowed_action = 66103053; + */ + protected $most_disruptive_allowed_action = null; + /** + * What action should be used to replace instances. See minimal_action.REPLACE + * Check the ReplacementMethod enum for the list of possible values. + * + * Generated from protobuf field optional string replacement_method = 505931694; + */ + protected $replacement_method = null; + /** + * The type of update process. You can specify either PROACTIVE so that the MIG automatically updates VMs to the latest configurations or OPPORTUNISTIC so that you can select the VMs that you want to update. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_redistribution_type + * The instance redistribution policy for regional managed instance groups. Valid values are: - PROACTIVE (default): The group attempts to maintain an even distribution of VM instances across zones in the region. - NONE: For non-autoscaled groups, proactive redistribution is disabled. + * Check the InstanceRedistributionType enum for the list of possible values. + * @type \Google\Cloud\Compute\V1\FixedOrPercent $max_surge + * The maximum number of instances that can be created above the specified targetSize during the update process. This value can be either a fixed number or, if the group has 10 or more instances, a percentage. If you set a percentage, the number of instances is rounded if necessary. The default value for maxSurge is a fixed value equal to the number of zones in which the managed instance group operates. At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxSurge. + * @type \Google\Cloud\Compute\V1\FixedOrPercent $max_unavailable + * The maximum number of instances that can be unavailable during the update process. An instance is considered available if all of the following conditions are satisfied: - The instance's status is RUNNING. - If there is a health check on the instance group, the instance's health check status must be HEALTHY at least once. If there is no health check on the group, then the instance only needs to have a status of RUNNING to be considered available. This value can be either a fixed number or, if the group has 10 or more instances, a percentage. If you set a percentage, the number of instances is rounded if necessary. The default value for maxUnavailable is a fixed value equal to the number of zones in which the managed instance group operates. At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxUnavailable. + * @type string $minimal_action + * Minimal action to be taken on an instance. Use this option to minimize disruption as much as possible or to apply a more disruptive action than is necessary. - To limit disruption as much as possible, set the minimal action to REFRESH. If your update requires a more disruptive action, Compute Engine performs the necessary action to execute the update. - To apply a more disruptive action than is strictly necessary, set the minimal action to RESTART or REPLACE. For example, Compute Engine does not need to restart a VM to change its metadata. But if your application reads instance metadata only when a VM is restarted, you can set the minimal action to RESTART in order to pick up metadata changes. + * Check the MinimalAction enum for the list of possible values. + * @type string $most_disruptive_allowed_action + * Most disruptive action that is allowed to be taken on an instance. You can specify either NONE to forbid any actions, REFRESH to avoid restarting the VM and to limit disruption as much as possible. RESTART to allow actions that can be applied without instance replacing or REPLACE to allow all possible actions. If the Updater determines that the minimal update action needed is more disruptive than most disruptive allowed action you specify it will not perform the update at all. + * Check the MostDisruptiveAllowedAction enum for the list of possible values. + * @type string $replacement_method + * What action should be used to replace instances. See minimal_action.REPLACE + * Check the ReplacementMethod enum for the list of possible values. + * @type string $type + * The type of update process. You can specify either PROACTIVE so that the MIG automatically updates VMs to the latest configurations or OPPORTUNISTIC so that you can select the VMs that you want to update. + * Check the Type enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The instance redistribution policy for regional managed instance groups. Valid values are: - PROACTIVE (default): The group attempts to maintain an even distribution of VM instances across zones in the region. - NONE: For non-autoscaled groups, proactive redistribution is disabled. + * Check the InstanceRedistributionType enum for the list of possible values. + * + * Generated from protobuf field optional string instance_redistribution_type = 292630424; + * @return string + */ + public function getInstanceRedistributionType() + { + return isset($this->instance_redistribution_type) ? $this->instance_redistribution_type : ''; + } + + public function hasInstanceRedistributionType() + { + return isset($this->instance_redistribution_type); + } + + public function clearInstanceRedistributionType() + { + unset($this->instance_redistribution_type); + } + + /** + * The instance redistribution policy for regional managed instance groups. Valid values are: - PROACTIVE (default): The group attempts to maintain an even distribution of VM instances across zones in the region. - NONE: For non-autoscaled groups, proactive redistribution is disabled. + * Check the InstanceRedistributionType enum for the list of possible values. + * + * Generated from protobuf field optional string instance_redistribution_type = 292630424; + * @param string $var + * @return $this + */ + public function setInstanceRedistributionType($var) + { + GPBUtil::checkString($var, True); + $this->instance_redistribution_type = $var; + + return $this; + } + + /** + * The maximum number of instances that can be created above the specified targetSize during the update process. This value can be either a fixed number or, if the group has 10 or more instances, a percentage. If you set a percentage, the number of instances is rounded if necessary. The default value for maxSurge is a fixed value equal to the number of zones in which the managed instance group operates. At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxSurge. + * + * Generated from protobuf field optional .google.cloud.compute.v1.FixedOrPercent max_surge = 302572691; + * @return \Google\Cloud\Compute\V1\FixedOrPercent|null + */ + public function getMaxSurge() + { + return $this->max_surge; + } + + public function hasMaxSurge() + { + return isset($this->max_surge); + } + + public function clearMaxSurge() + { + unset($this->max_surge); + } + + /** + * The maximum number of instances that can be created above the specified targetSize during the update process. This value can be either a fixed number or, if the group has 10 or more instances, a percentage. If you set a percentage, the number of instances is rounded if necessary. The default value for maxSurge is a fixed value equal to the number of zones in which the managed instance group operates. At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxSurge. + * + * Generated from protobuf field optional .google.cloud.compute.v1.FixedOrPercent max_surge = 302572691; + * @param \Google\Cloud\Compute\V1\FixedOrPercent $var + * @return $this + */ + public function setMaxSurge($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\FixedOrPercent::class); + $this->max_surge = $var; + + return $this; + } + + /** + * The maximum number of instances that can be unavailable during the update process. An instance is considered available if all of the following conditions are satisfied: - The instance's status is RUNNING. - If there is a health check on the instance group, the instance's health check status must be HEALTHY at least once. If there is no health check on the group, then the instance only needs to have a status of RUNNING to be considered available. This value can be either a fixed number or, if the group has 10 or more instances, a percentage. If you set a percentage, the number of instances is rounded if necessary. The default value for maxUnavailable is a fixed value equal to the number of zones in which the managed instance group operates. At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxUnavailable. + * + * Generated from protobuf field optional .google.cloud.compute.v1.FixedOrPercent max_unavailable = 404940277; + * @return \Google\Cloud\Compute\V1\FixedOrPercent|null + */ + public function getMaxUnavailable() + { + return $this->max_unavailable; + } + + public function hasMaxUnavailable() + { + return isset($this->max_unavailable); + } + + public function clearMaxUnavailable() + { + unset($this->max_unavailable); + } + + /** + * The maximum number of instances that can be unavailable during the update process. An instance is considered available if all of the following conditions are satisfied: - The instance's status is RUNNING. - If there is a health check on the instance group, the instance's health check status must be HEALTHY at least once. If there is no health check on the group, then the instance only needs to have a status of RUNNING to be considered available. This value can be either a fixed number or, if the group has 10 or more instances, a percentage. If you set a percentage, the number of instances is rounded if necessary. The default value for maxUnavailable is a fixed value equal to the number of zones in which the managed instance group operates. At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxUnavailable. + * + * Generated from protobuf field optional .google.cloud.compute.v1.FixedOrPercent max_unavailable = 404940277; + * @param \Google\Cloud\Compute\V1\FixedOrPercent $var + * @return $this + */ + public function setMaxUnavailable($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\FixedOrPercent::class); + $this->max_unavailable = $var; + + return $this; + } + + /** + * Minimal action to be taken on an instance. Use this option to minimize disruption as much as possible or to apply a more disruptive action than is necessary. - To limit disruption as much as possible, set the minimal action to REFRESH. If your update requires a more disruptive action, Compute Engine performs the necessary action to execute the update. - To apply a more disruptive action than is strictly necessary, set the minimal action to RESTART or REPLACE. For example, Compute Engine does not need to restart a VM to change its metadata. But if your application reads instance metadata only when a VM is restarted, you can set the minimal action to RESTART in order to pick up metadata changes. + * Check the MinimalAction enum for the list of possible values. + * + * Generated from protobuf field optional string minimal_action = 270567060; + * @return string + */ + public function getMinimalAction() + { + return isset($this->minimal_action) ? $this->minimal_action : ''; + } + + public function hasMinimalAction() + { + return isset($this->minimal_action); + } + + public function clearMinimalAction() + { + unset($this->minimal_action); + } + + /** + * Minimal action to be taken on an instance. Use this option to minimize disruption as much as possible or to apply a more disruptive action than is necessary. - To limit disruption as much as possible, set the minimal action to REFRESH. If your update requires a more disruptive action, Compute Engine performs the necessary action to execute the update. - To apply a more disruptive action than is strictly necessary, set the minimal action to RESTART or REPLACE. For example, Compute Engine does not need to restart a VM to change its metadata. But if your application reads instance metadata only when a VM is restarted, you can set the minimal action to RESTART in order to pick up metadata changes. + * Check the MinimalAction enum for the list of possible values. + * + * Generated from protobuf field optional string minimal_action = 270567060; + * @param string $var + * @return $this + */ + public function setMinimalAction($var) + { + GPBUtil::checkString($var, True); + $this->minimal_action = $var; + + return $this; + } + + /** + * Most disruptive action that is allowed to be taken on an instance. You can specify either NONE to forbid any actions, REFRESH to avoid restarting the VM and to limit disruption as much as possible. RESTART to allow actions that can be applied without instance replacing or REPLACE to allow all possible actions. If the Updater determines that the minimal update action needed is more disruptive than most disruptive allowed action you specify it will not perform the update at all. + * Check the MostDisruptiveAllowedAction enum for the list of possible values. + * + * Generated from protobuf field optional string most_disruptive_allowed_action = 66103053; + * @return string + */ + public function getMostDisruptiveAllowedAction() + { + return isset($this->most_disruptive_allowed_action) ? $this->most_disruptive_allowed_action : ''; + } + + public function hasMostDisruptiveAllowedAction() + { + return isset($this->most_disruptive_allowed_action); + } + + public function clearMostDisruptiveAllowedAction() + { + unset($this->most_disruptive_allowed_action); + } + + /** + * Most disruptive action that is allowed to be taken on an instance. You can specify either NONE to forbid any actions, REFRESH to avoid restarting the VM and to limit disruption as much as possible. RESTART to allow actions that can be applied without instance replacing or REPLACE to allow all possible actions. If the Updater determines that the minimal update action needed is more disruptive than most disruptive allowed action you specify it will not perform the update at all. + * Check the MostDisruptiveAllowedAction enum for the list of possible values. + * + * Generated from protobuf field optional string most_disruptive_allowed_action = 66103053; + * @param string $var + * @return $this + */ + public function setMostDisruptiveAllowedAction($var) + { + GPBUtil::checkString($var, True); + $this->most_disruptive_allowed_action = $var; + + return $this; + } + + /** + * What action should be used to replace instances. See minimal_action.REPLACE + * Check the ReplacementMethod enum for the list of possible values. + * + * Generated from protobuf field optional string replacement_method = 505931694; + * @return string + */ + public function getReplacementMethod() + { + return isset($this->replacement_method) ? $this->replacement_method : ''; + } + + public function hasReplacementMethod() + { + return isset($this->replacement_method); + } + + public function clearReplacementMethod() + { + unset($this->replacement_method); + } + + /** + * What action should be used to replace instances. See minimal_action.REPLACE + * Check the ReplacementMethod enum for the list of possible values. + * + * Generated from protobuf field optional string replacement_method = 505931694; + * @param string $var + * @return $this + */ + public function setReplacementMethod($var) + { + GPBUtil::checkString($var, True); + $this->replacement_method = $var; + + return $this; + } + + /** + * The type of update process. You can specify either PROACTIVE so that the MIG automatically updates VMs to the latest configurations or OPPORTUNISTIC so that you can select the VMs that you want to update. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * The type of update process. You can specify either PROACTIVE so that the MIG automatically updates VMs to the latest configurations or OPPORTUNISTIC so that you can select the VMs that you want to update. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy/InstanceRedistributionType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy/InstanceRedistributionType.php new file mode 100644 index 000000000000..3998a4051290 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy/InstanceRedistributionType.php @@ -0,0 +1,53 @@ +google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy.InstanceRedistributionType + */ +class InstanceRedistributionType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_INSTANCE_REDISTRIBUTION_TYPE = 0; + */ + const UNDEFINED_INSTANCE_REDISTRIBUTION_TYPE = 0; + + private static $valueToName = [ + self::UNDEFINED_INSTANCE_REDISTRIBUTION_TYPE => 'UNDEFINED_INSTANCE_REDISTRIBUTION_TYPE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(InstanceRedistributionType::class, \Google\Cloud\Compute\V1\InstanceGroupManagerUpdatePolicy_InstanceRedistributionType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy/MinimalAction.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy/MinimalAction.php new file mode 100644 index 000000000000..dee904f54b94 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy/MinimalAction.php @@ -0,0 +1,55 @@ +google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy.MinimalAction + */ +class MinimalAction +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MINIMAL_ACTION = 0; + */ + const UNDEFINED_MINIMAL_ACTION = 0; + + private static $valueToName = [ + self::UNDEFINED_MINIMAL_ACTION => 'UNDEFINED_MINIMAL_ACTION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MinimalAction::class, \Google\Cloud\Compute\V1\InstanceGroupManagerUpdatePolicy_MinimalAction::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy/MostDisruptiveAllowedAction.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy/MostDisruptiveAllowedAction.php new file mode 100644 index 000000000000..4d31da2e0082 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy/MostDisruptiveAllowedAction.php @@ -0,0 +1,55 @@ +google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy.MostDisruptiveAllowedAction + */ +class MostDisruptiveAllowedAction +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MOST_DISRUPTIVE_ALLOWED_ACTION = 0; + */ + const UNDEFINED_MOST_DISRUPTIVE_ALLOWED_ACTION = 0; + + private static $valueToName = [ + self::UNDEFINED_MOST_DISRUPTIVE_ALLOWED_ACTION => 'UNDEFINED_MOST_DISRUPTIVE_ALLOWED_ACTION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MostDisruptiveAllowedAction::class, \Google\Cloud\Compute\V1\InstanceGroupManagerUpdatePolicy_MostDisruptiveAllowedAction::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy/ReplacementMethod.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy/ReplacementMethod.php new file mode 100644 index 000000000000..232522ab2954 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy/ReplacementMethod.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy.ReplacementMethod + */ +class ReplacementMethod +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_REPLACEMENT_METHOD = 0; + */ + const UNDEFINED_REPLACEMENT_METHOD = 0; + /** + * Instances will be recreated (with the same name) + * + * Generated from protobuf enum RECREATE = 522644719; + */ + const RECREATE = 522644719; + /** + * Default option: instances will be deleted and created (with a new name) + * + * Generated from protobuf enum SUBSTITUTE = 280924314; + */ + const SUBSTITUTE = 280924314; + + private static $valueToName = [ + self::UNDEFINED_REPLACEMENT_METHOD => 'UNDEFINED_REPLACEMENT_METHOD', + self::RECREATE => 'RECREATE', + self::SUBSTITUTE => 'SUBSTITUTE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ReplacementMethod::class, \Google\Cloud\Compute\V1\InstanceGroupManagerUpdatePolicy_ReplacementMethod::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy/Type.php new file mode 100644 index 000000000000..1e547b47a113 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerUpdatePolicy/Type.php @@ -0,0 +1,59 @@ +google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy.Type + */ +class Type +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TYPE = 0; + */ + const UNDEFINED_TYPE = 0; + /** + * MIG will apply new configurations to existing VMs only when you selectively target specific or all VMs to be updated. + * + * Generated from protobuf enum OPPORTUNISTIC = 429530089; + */ + const OPPORTUNISTIC = 429530089; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::OPPORTUNISTIC => 'OPPORTUNISTIC', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Compute\V1\InstanceGroupManagerUpdatePolicy_Type::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerVersion.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerVersion.php new file mode 100644 index 000000000000..0493b216e222 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerVersion.php @@ -0,0 +1,164 @@ +google.cloud.compute.v1.InstanceGroupManagerVersion + */ +class InstanceGroupManagerVersion extends \Google\Protobuf\Internal\Message +{ + /** + * The URL of the instance template that is specified for this managed instance group. The group uses this template to create new instances in the managed instance group until the `targetSize` for this version is reached. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE; in those cases, existing instances are updated until the `targetSize` for this version is reached. + * + * Generated from protobuf field optional string instance_template = 309248228; + */ + protected $instance_template = null; + /** + * Name of the version. Unique among all versions in the scope of this managed instance group. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Specifies the intended number of instances to be created from the instanceTemplate. The final number of instances created from the template will be equal to: - If expressed as a fixed number, the minimum of either targetSize.fixed or instanceGroupManager.targetSize is used. - if expressed as a percent, the targetSize would be (targetSize.percent/100 * InstanceGroupManager.targetSize) If there is a remainder, the number is rounded. If unset, this version will update any remaining instances not updated by another version. Read Starting a canary update for more information. + * + * Generated from protobuf field optional .google.cloud.compute.v1.FixedOrPercent target_size = 62880239; + */ + protected $target_size = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_template + * The URL of the instance template that is specified for this managed instance group. The group uses this template to create new instances in the managed instance group until the `targetSize` for this version is reached. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE; in those cases, existing instances are updated until the `targetSize` for this version is reached. + * @type string $name + * Name of the version. Unique among all versions in the scope of this managed instance group. + * @type \Google\Cloud\Compute\V1\FixedOrPercent $target_size + * Specifies the intended number of instances to be created from the instanceTemplate. The final number of instances created from the template will be equal to: - If expressed as a fixed number, the minimum of either targetSize.fixed or instanceGroupManager.targetSize is used. - if expressed as a percent, the targetSize would be (targetSize.percent/100 * InstanceGroupManager.targetSize) If there is a remainder, the number is rounded. If unset, this version will update any remaining instances not updated by another version. Read Starting a canary update for more information. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The URL of the instance template that is specified for this managed instance group. The group uses this template to create new instances in the managed instance group until the `targetSize` for this version is reached. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE; in those cases, existing instances are updated until the `targetSize` for this version is reached. + * + * Generated from protobuf field optional string instance_template = 309248228; + * @return string + */ + public function getInstanceTemplate() + { + return isset($this->instance_template) ? $this->instance_template : ''; + } + + public function hasInstanceTemplate() + { + return isset($this->instance_template); + } + + public function clearInstanceTemplate() + { + unset($this->instance_template); + } + + /** + * The URL of the instance template that is specified for this managed instance group. The group uses this template to create new instances in the managed instance group until the `targetSize` for this version is reached. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE; in those cases, existing instances are updated until the `targetSize` for this version is reached. + * + * Generated from protobuf field optional string instance_template = 309248228; + * @param string $var + * @return $this + */ + public function setInstanceTemplate($var) + { + GPBUtil::checkString($var, True); + $this->instance_template = $var; + + return $this; + } + + /** + * Name of the version. Unique among all versions in the scope of this managed instance group. + * + * 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); + } + + /** + * Name of the version. Unique among all versions in the scope of this managed instance group. + * + * 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; + } + + /** + * Specifies the intended number of instances to be created from the instanceTemplate. The final number of instances created from the template will be equal to: - If expressed as a fixed number, the minimum of either targetSize.fixed or instanceGroupManager.targetSize is used. - if expressed as a percent, the targetSize would be (targetSize.percent/100 * InstanceGroupManager.targetSize) If there is a remainder, the number is rounded. If unset, this version will update any remaining instances not updated by another version. Read Starting a canary update for more information. + * + * Generated from protobuf field optional .google.cloud.compute.v1.FixedOrPercent target_size = 62880239; + * @return \Google\Cloud\Compute\V1\FixedOrPercent|null + */ + public function getTargetSize() + { + return $this->target_size; + } + + public function hasTargetSize() + { + return isset($this->target_size); + } + + public function clearTargetSize() + { + unset($this->target_size); + } + + /** + * Specifies the intended number of instances to be created from the instanceTemplate. The final number of instances created from the template will be equal to: - If expressed as a fixed number, the minimum of either targetSize.fixed or instanceGroupManager.targetSize is used. - if expressed as a percent, the targetSize would be (targetSize.percent/100 * InstanceGroupManager.targetSize) If there is a remainder, the number is rounded. If unset, this version will update any remaining instances not updated by another version. Read Starting a canary update for more information. + * + * Generated from protobuf field optional .google.cloud.compute.v1.FixedOrPercent target_size = 62880239; + * @param \Google\Cloud\Compute\V1\FixedOrPercent $var + * @return $this + */ + public function setTargetSize($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\FixedOrPercent::class); + $this->target_size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersAbandonInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersAbandonInstancesRequest.php new file mode 100644 index 000000000000..8f693f3e0eb6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersAbandonInstancesRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest + */ +class InstanceGroupManagersAbandonInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The URLs of one or more instances to abandon. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + * + * Generated from protobuf field repeated string instances = 29097598; + */ + private $instances; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $instances + * The URLs of one or more instances to abandon. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The URLs of one or more instances to abandon. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + * + * Generated from protobuf field repeated string instances = 29097598; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * The URLs of one or more instances to abandon. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + * + * Generated from protobuf field repeated string instances = 29097598; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->instances = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersApplyUpdatesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersApplyUpdatesRequest.php new file mode 100644 index 000000000000..008b9a78bf18 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersApplyUpdatesRequest.php @@ -0,0 +1,207 @@ +google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest + */ +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. + * + * Generated from protobuf field optional bool all_instances = 403676512; + */ + protected $all_instances = null; + /** + * 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]. + * + * Generated from protobuf field repeated string instances = 29097598; + */ + private $instances; + /** + * The minimal action that you want to perform on each instance during the update: - REPLACE: At minimum, delete the instance and create it again. - RESTART: Stop the instance and start it again. - REFRESH: Do not stop the instance and limit disruption as much as possible. - NONE: Do not disrupt the instance at all. By default, the minimum action is NONE. If your update requires a more disruptive action than you set with this flag, the necessary action is performed to execute the update. + * Check the MinimalAction enum for the list of possible values. + * + * Generated from protobuf field optional string minimal_action = 270567060; + */ + protected $minimal_action = null; + /** + * The most disruptive action that you want to perform on each instance during the update: - REPLACE: Delete the instance and create it again. - RESTART: Stop the instance and start it again. - REFRESH: Do not stop the instance and limit disruption as much as possible. - NONE: Do not disrupt the instance at all. By default, the most disruptive allowed action is REPLACE. If your update requires a more disruptive action than you set with this flag, the update request will fail. + * Check the MostDisruptiveAllowedAction enum for the list of possible values. + * + * Generated from protobuf field optional string most_disruptive_allowed_action = 66103053; + */ + protected $most_disruptive_allowed_action = null; + + /** + * Constructor. + * + * @param array $data { + * 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. + * @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 + * The minimal action that you want to perform on each instance during the update: - REPLACE: At minimum, delete the instance and create it again. - RESTART: Stop the instance and start it again. - REFRESH: Do not stop the instance and limit disruption as much as possible. - NONE: Do not disrupt the instance at all. By default, the minimum action is NONE. If your update requires a more disruptive action than you set with this flag, the necessary action is performed to execute the update. + * Check the MinimalAction enum for the list of possible values. + * @type string $most_disruptive_allowed_action + * The most disruptive action that you want to perform on each instance during the update: - REPLACE: Delete the instance and create it again. - RESTART: Stop the instance and start it again. - REFRESH: Do not stop the instance and limit disruption as much as possible. - NONE: Do not disrupt the instance at all. By default, the most disruptive allowed action is REPLACE. If your update requires a more disruptive action than you set with this flag, the update request will fail. + * Check the MostDisruptiveAllowedAction enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 + */ + public function getAllInstances() + { + return isset($this->all_instances) ? $this->all_instances : false; + } + + public function hasAllInstances() + { + return isset($this->all_instances); + } + + public function clearAllInstances() + { + unset($this->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. + * + * Generated from protobuf field optional bool all_instances = 403676512; + * @param bool $var + * @return $this + */ + public function setAllInstances($var) + { + GPBUtil::checkBool($var); + $this->all_instances = $var; + + return $this; + } + + /** + * 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]. + * + * Generated from protobuf field repeated string instances = 29097598; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->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]. + * + * Generated from protobuf field repeated string instances = 29097598; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->instances = $arr; + + return $this; + } + + /** + * The minimal action that you want to perform on each instance during the update: - REPLACE: At minimum, delete the instance and create it again. - RESTART: Stop the instance and start it again. - REFRESH: Do not stop the instance and limit disruption as much as possible. - NONE: Do not disrupt the instance at all. By default, the minimum action is NONE. If your update requires a more disruptive action than you set with this flag, the necessary action is performed to execute the update. + * Check the MinimalAction enum for the list of possible values. + * + * Generated from protobuf field optional string minimal_action = 270567060; + * @return string + */ + public function getMinimalAction() + { + return isset($this->minimal_action) ? $this->minimal_action : ''; + } + + public function hasMinimalAction() + { + return isset($this->minimal_action); + } + + public function clearMinimalAction() + { + unset($this->minimal_action); + } + + /** + * The minimal action that you want to perform on each instance during the update: - REPLACE: At minimum, delete the instance and create it again. - RESTART: Stop the instance and start it again. - REFRESH: Do not stop the instance and limit disruption as much as possible. - NONE: Do not disrupt the instance at all. By default, the minimum action is NONE. If your update requires a more disruptive action than you set with this flag, the necessary action is performed to execute the update. + * Check the MinimalAction enum for the list of possible values. + * + * Generated from protobuf field optional string minimal_action = 270567060; + * @param string $var + * @return $this + */ + public function setMinimalAction($var) + { + GPBUtil::checkString($var, True); + $this->minimal_action = $var; + + return $this; + } + + /** + * The most disruptive action that you want to perform on each instance during the update: - REPLACE: Delete the instance and create it again. - RESTART: Stop the instance and start it again. - REFRESH: Do not stop the instance and limit disruption as much as possible. - NONE: Do not disrupt the instance at all. By default, the most disruptive allowed action is REPLACE. If your update requires a more disruptive action than you set with this flag, the update request will fail. + * Check the MostDisruptiveAllowedAction enum for the list of possible values. + * + * Generated from protobuf field optional string most_disruptive_allowed_action = 66103053; + * @return string + */ + public function getMostDisruptiveAllowedAction() + { + return isset($this->most_disruptive_allowed_action) ? $this->most_disruptive_allowed_action : ''; + } + + public function hasMostDisruptiveAllowedAction() + { + return isset($this->most_disruptive_allowed_action); + } + + public function clearMostDisruptiveAllowedAction() + { + unset($this->most_disruptive_allowed_action); + } + + /** + * The most disruptive action that you want to perform on each instance during the update: - REPLACE: Delete the instance and create it again. - RESTART: Stop the instance and start it again. - REFRESH: Do not stop the instance and limit disruption as much as possible. - NONE: Do not disrupt the instance at all. By default, the most disruptive allowed action is REPLACE. If your update requires a more disruptive action than you set with this flag, the update request will fail. + * Check the MostDisruptiveAllowedAction enum for the list of possible values. + * + * Generated from protobuf field optional string most_disruptive_allowed_action = 66103053; + * @param string $var + * @return $this + */ + public function setMostDisruptiveAllowedAction($var) + { + GPBUtil::checkString($var, True); + $this->most_disruptive_allowed_action = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersApplyUpdatesRequest/MinimalAction.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersApplyUpdatesRequest/MinimalAction.php new file mode 100644 index 000000000000..524792d7e6d1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersApplyUpdatesRequest/MinimalAction.php @@ -0,0 +1,55 @@ +google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest.MinimalAction + */ +class MinimalAction +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MINIMAL_ACTION = 0; + */ + const UNDEFINED_MINIMAL_ACTION = 0; + + private static $valueToName = [ + self::UNDEFINED_MINIMAL_ACTION => 'UNDEFINED_MINIMAL_ACTION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MinimalAction::class, \Google\Cloud\Compute\V1\InstanceGroupManagersApplyUpdatesRequest_MinimalAction::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersApplyUpdatesRequest/MostDisruptiveAllowedAction.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersApplyUpdatesRequest/MostDisruptiveAllowedAction.php new file mode 100644 index 000000000000..a54070540cf3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersApplyUpdatesRequest/MostDisruptiveAllowedAction.php @@ -0,0 +1,55 @@ +google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest.MostDisruptiveAllowedAction + */ +class MostDisruptiveAllowedAction +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MOST_DISRUPTIVE_ALLOWED_ACTION = 0; + */ + const UNDEFINED_MOST_DISRUPTIVE_ALLOWED_ACTION = 0; + + private static $valueToName = [ + self::UNDEFINED_MOST_DISRUPTIVE_ALLOWED_ACTION => 'UNDEFINED_MOST_DISRUPTIVE_ALLOWED_ACTION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MostDisruptiveAllowedAction::class, \Google\Cloud\Compute\V1\InstanceGroupManagersApplyUpdatesRequest_MostDisruptiveAllowedAction::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersCreateInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersCreateInstancesRequest.php new file mode 100644 index 000000000000..e9891bb22b1e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersCreateInstancesRequest.php @@ -0,0 +1,67 @@ +google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest + */ +class InstanceGroupManagersCreateInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * [Required] List of specifications of per-instance configs. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig instances = 29097598; + */ + private $instances; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\PerInstanceConfig>|\Google\Protobuf\Internal\RepeatedField $instances + * [Required] List of specifications of per-instance configs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Required] List of specifications of per-instance configs. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig instances = 29097598; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * [Required] List of specifications of per-instance configs. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig instances = 29097598; + * @param array<\Google\Cloud\Compute\V1\PerInstanceConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PerInstanceConfig::class); + $this->instances = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersDeleteInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersDeleteInstancesRequest.php new file mode 100644 index 000000000000..976084089b58 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersDeleteInstancesRequest.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest + */ +class InstanceGroupManagersDeleteInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The URLs of one or more instances to delete. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. Queued instances do not have URL and can be deleted only by name. One cannot specify both URLs and names in a single request. + * + * Generated from protobuf field repeated string instances = 29097598; + */ + private $instances; + /** + * Specifies whether the request should proceed despite the inclusion of instances that are not members of the group or that are already in the process of being deleted or abandoned. If this field is set to `false` and such an instance is specified in the request, the operation fails. The operation always fails if the request contains a malformed instance URL or a reference to an instance that exists in a zone or region other than the group's zone or region. + * + * Generated from protobuf field optional bool skip_instances_on_validation_error = 40631073; + */ + protected $skip_instances_on_validation_error = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $instances + * The URLs of one or more instances to delete. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. Queued instances do not have URL and can be deleted only by name. One cannot specify both URLs and names in a single request. + * @type bool $skip_instances_on_validation_error + * Specifies whether the request should proceed despite the inclusion of instances that are not members of the group or that are already in the process of being deleted or abandoned. If this field is set to `false` and such an instance is specified in the request, the operation fails. The operation always fails if the request contains a malformed instance URL or a reference to an instance that exists in a zone or region other than the group's zone or region. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The URLs of one or more instances to delete. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. Queued instances do not have URL and can be deleted only by name. One cannot specify both URLs and names in a single request. + * + * Generated from protobuf field repeated string instances = 29097598; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * The URLs of one or more instances to delete. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. Queued instances do not have URL and can be deleted only by name. One cannot specify both URLs and names in a single request. + * + * Generated from protobuf field repeated string instances = 29097598; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->instances = $arr; + + return $this; + } + + /** + * Specifies whether the request should proceed despite the inclusion of instances that are not members of the group or that are already in the process of being deleted or abandoned. If this field is set to `false` and such an instance is specified in the request, the operation fails. The operation always fails if the request contains a malformed instance URL or a reference to an instance that exists in a zone or region other than the group's zone or region. + * + * Generated from protobuf field optional bool skip_instances_on_validation_error = 40631073; + * @return bool + */ + public function getSkipInstancesOnValidationError() + { + return isset($this->skip_instances_on_validation_error) ? $this->skip_instances_on_validation_error : false; + } + + public function hasSkipInstancesOnValidationError() + { + return isset($this->skip_instances_on_validation_error); + } + + public function clearSkipInstancesOnValidationError() + { + unset($this->skip_instances_on_validation_error); + } + + /** + * Specifies whether the request should proceed despite the inclusion of instances that are not members of the group or that are already in the process of being deleted or abandoned. If this field is set to `false` and such an instance is specified in the request, the operation fails. The operation always fails if the request contains a malformed instance URL or a reference to an instance that exists in a zone or region other than the group's zone or region. + * + * Generated from protobuf field optional bool skip_instances_on_validation_error = 40631073; + * @param bool $var + * @return $this + */ + public function setSkipInstancesOnValidationError($var) + { + GPBUtil::checkBool($var); + $this->skip_instances_on_validation_error = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersDeletePerInstanceConfigsReq.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersDeletePerInstanceConfigsReq.php new file mode 100644 index 000000000000..6de7987fc49b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersDeletePerInstanceConfigsReq.php @@ -0,0 +1,67 @@ +google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq + */ +class InstanceGroupManagersDeletePerInstanceConfigsReq extends \Google\Protobuf\Internal\Message +{ + /** + * The list of instance names for which we want to delete per-instance configs on this managed instance group. + * + * Generated from protobuf field repeated string names = 104585032; + */ + private $names; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $names + * The list of instance names for which we want to delete per-instance configs on this managed instance group. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The list of instance names for which we want to delete per-instance configs on this managed instance group. + * + * Generated from protobuf field repeated string names = 104585032; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNames() + { + return $this->names; + } + + /** + * The list of instance names for which we want to delete per-instance configs on this managed instance group. + * + * Generated from protobuf field repeated string names = 104585032; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->names = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersListErrorsResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersListErrorsResponse.php new file mode 100644 index 000000000000..175c9a81944a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersListErrorsResponse.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse + */ +class InstanceGroupManagersListErrorsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The list of errors of the managed instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceManagedByIgmError items = 100526016; + */ + private $items; + /** + * [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; + */ + protected $next_page_token = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\InstanceManagedByIgmError>|\Google\Protobuf\Internal\RepeatedField $items + * [Output Only] The list of errors of the managed instance group. + * @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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The list of errors of the managed instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceManagedByIgmError items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * [Output Only] The list of errors of the managed instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceManagedByIgmError items = 100526016; + * @param array<\Google\Cloud\Compute\V1\InstanceManagedByIgmError>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstanceManagedByIgmError::class); + $this->items = $arr; + + 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersListManagedInstancesResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersListManagedInstancesResponse.php new file mode 100644 index 000000000000..02dac0019a8f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersListManagedInstancesResponse.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse + */ +class InstanceGroupManagersListManagedInstancesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The list of instances in the managed instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ManagedInstance managed_instances = 336219614; + */ + private $managed_instances; + /** + * [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; + */ + protected $next_page_token = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\ManagedInstance>|\Google\Protobuf\Internal\RepeatedField $managed_instances + * [Output Only] The list of instances in the managed instance group. + * @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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The list of instances in the managed instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ManagedInstance managed_instances = 336219614; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getManagedInstances() + { + return $this->managed_instances; + } + + /** + * [Output Only] The list of instances in the managed instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ManagedInstance managed_instances = 336219614; + * @param array<\Google\Cloud\Compute\V1\ManagedInstance>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setManagedInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ManagedInstance::class); + $this->managed_instances = $arr; + + 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersListPerInstanceConfigsResp.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersListPerInstanceConfigsResp.php new file mode 100644 index 000000000000..dc960ae2c068 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersListPerInstanceConfigsResp.php @@ -0,0 +1,154 @@ +google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp + */ +class InstanceGroupManagersListPerInstanceConfigsResp extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The list of PerInstanceConfig. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig items = 100526016; + */ + private $items; + /** + * [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; + */ + protected $next_page_token = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\PerInstanceConfig>|\Google\Protobuf\Internal\RepeatedField $items + * [Output Only] The list of PerInstanceConfig. + * @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 \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] The list of PerInstanceConfig. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * [Output Only] The list of PerInstanceConfig. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig items = 100526016; + * @param array<\Google\Cloud\Compute\V1\PerInstanceConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PerInstanceConfig::class); + $this->items = $arr; + + 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] 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersPatchPerInstanceConfigsReq.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersPatchPerInstanceConfigsReq.php new file mode 100644 index 000000000000..9daed3fbb2de --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersPatchPerInstanceConfigsReq.php @@ -0,0 +1,67 @@ +google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq + */ +class InstanceGroupManagersPatchPerInstanceConfigsReq extends \Google\Protobuf\Internal\Message +{ + /** + * The list of per-instance configurations to insert or patch on this managed instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig per_instance_configs = 526265001; + */ + private $per_instance_configs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\PerInstanceConfig>|\Google\Protobuf\Internal\RepeatedField $per_instance_configs + * The list of per-instance configurations to insert or patch on this managed instance group. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The list of per-instance configurations to insert or patch on this managed instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig per_instance_configs = 526265001; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPerInstanceConfigs() + { + return $this->per_instance_configs; + } + + /** + * The list of per-instance configurations to insert or patch on this managed instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig per_instance_configs = 526265001; + * @param array<\Google\Cloud\Compute\V1\PerInstanceConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPerInstanceConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PerInstanceConfig::class); + $this->per_instance_configs = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersRecreateInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersRecreateInstancesRequest.php new file mode 100644 index 000000000000..4506198d1408 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersRecreateInstancesRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest + */ +class InstanceGroupManagersRecreateInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The URLs of one or more instances to recreate. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + * + * Generated from protobuf field repeated string instances = 29097598; + */ + private $instances; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $instances + * The URLs of one or more instances to recreate. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The URLs of one or more instances to recreate. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + * + * Generated from protobuf field repeated string instances = 29097598; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * The URLs of one or more instances to recreate. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + * + * Generated from protobuf field repeated string instances = 29097598; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->instances = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersScopedList.php new file mode 100644 index 000000000000..6c6428ca677d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.InstanceGroupManagersScopedList + */ +class InstanceGroupManagersScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The list of managed instance groups that are contained in the specified project and zone. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroupManager instance_group_managers = 214072592; + */ + private $instance_group_managers; + /** + * [Output Only] The warning that replaces the list of managed instance groups when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\InstanceGroupManager>|\Google\Protobuf\Internal\RepeatedField $instance_group_managers + * [Output Only] The list of managed instance groups that are contained in the specified project and zone. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] The warning that replaces the list of managed instance groups when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The list of managed instance groups that are contained in the specified project and zone. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroupManager instance_group_managers = 214072592; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstanceGroupManagers() + { + return $this->instance_group_managers; + } + + /** + * [Output Only] The list of managed instance groups that are contained in the specified project and zone. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroupManager instance_group_managers = 214072592; + * @param array<\Google\Cloud\Compute\V1\InstanceGroupManager>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstanceGroupManagers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstanceGroupManager::class); + $this->instance_group_managers = $arr; + + return $this; + } + + /** + * [Output Only] The warning that replaces the list of managed instance groups 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] The warning that replaces the list of managed instance groups 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersSetInstanceTemplateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersSetInstanceTemplateRequest.php new file mode 100644 index 000000000000..f68c28b853f8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersSetInstanceTemplateRequest.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest + */ +class InstanceGroupManagersSetInstanceTemplateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE. + * + * Generated from protobuf field optional string instance_template = 309248228; + */ + protected $instance_template = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_template + * The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE. + * + * Generated from protobuf field optional string instance_template = 309248228; + * @return string + */ + public function getInstanceTemplate() + { + return isset($this->instance_template) ? $this->instance_template : ''; + } + + public function hasInstanceTemplate() + { + return isset($this->instance_template); + } + + public function clearInstanceTemplate() + { + unset($this->instance_template); + } + + /** + * The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE. + * + * Generated from protobuf field optional string instance_template = 309248228; + * @param string $var + * @return $this + */ + public function setInstanceTemplate($var) + { + GPBUtil::checkString($var, True); + $this->instance_template = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersSetTargetPoolsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersSetTargetPoolsRequest.php new file mode 100644 index 000000000000..a89d62c5613d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersSetTargetPoolsRequest.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest + */ +class InstanceGroupManagersSetTargetPoolsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The fingerprint of the target pools information. Use this optional property to prevent conflicts when multiple users change the target pools settings concurrently. Obtain the fingerprint with the instanceGroupManagers.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * The list of target pool URLs that instances in this managed instance group belong to. The managed instance group applies these target pools to all of the instances in the group. Existing instances and new instances in the group all receive these target pool settings. + * + * Generated from protobuf field repeated string target_pools = 336072617; + */ + private $target_pools; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $fingerprint + * The fingerprint of the target pools information. Use this optional property to prevent conflicts when multiple users change the target pools settings concurrently. Obtain the fingerprint with the instanceGroupManagers.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request. + * @type array|\Google\Protobuf\Internal\RepeatedField $target_pools + * The list of target pool URLs that instances in this managed instance group belong to. The managed instance group applies these target pools to all of the instances in the group. Existing instances and new instances in the group all receive these target pool settings. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The fingerprint of the target pools information. Use this optional property to prevent conflicts when multiple users change the target pools settings concurrently. Obtain the fingerprint with the instanceGroupManagers.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * The fingerprint of the target pools information. Use this optional property to prevent conflicts when multiple users change the target pools settings concurrently. Obtain the fingerprint with the instanceGroupManagers.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * The list of target pool URLs that instances in this managed instance group belong to. The managed instance group applies these target pools to all of the instances in the group. Existing instances and new instances in the group all receive these target pool settings. + * + * Generated from protobuf field repeated string target_pools = 336072617; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetPools() + { + return $this->target_pools; + } + + /** + * The list of target pool URLs that instances in this managed instance group belong to. The managed instance group applies these target pools to all of the instances in the group. Existing instances and new instances in the group all receive these target pool settings. + * + * Generated from protobuf field repeated string target_pools = 336072617; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetPools($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->target_pools = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersUpdatePerInstanceConfigsReq.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersUpdatePerInstanceConfigsReq.php new file mode 100644 index 000000000000..62ca03bb95b0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersUpdatePerInstanceConfigsReq.php @@ -0,0 +1,67 @@ +google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq + */ +class InstanceGroupManagersUpdatePerInstanceConfigsReq extends \Google\Protobuf\Internal\Message +{ + /** + * The list of per-instance configurations to insert or patch on this managed instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig per_instance_configs = 526265001; + */ + private $per_instance_configs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\PerInstanceConfig>|\Google\Protobuf\Internal\RepeatedField $per_instance_configs + * The list of per-instance configurations to insert or patch on this managed instance group. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The list of per-instance configurations to insert or patch on this managed instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig per_instance_configs = 526265001; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPerInstanceConfigs() + { + return $this->per_instance_configs; + } + + /** + * The list of per-instance configurations to insert or patch on this managed instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig per_instance_configs = 526265001; + * @param array<\Google\Cloud\Compute\V1\PerInstanceConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPerInstanceConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PerInstanceConfig::class); + $this->per_instance_configs = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsAddInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsAddInstancesRequest.php new file mode 100644 index 000000000000..dc36329892d4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsAddInstancesRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.InstanceGroupsAddInstancesRequest + */ +class InstanceGroupsAddInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The list of instances to add to the instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceReference instances = 29097598; + */ + private $instances; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\InstanceReference>|\Google\Protobuf\Internal\RepeatedField $instances + * The list of instances to add to the instance group. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The list of instances to add to the instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceReference instances = 29097598; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * The list of instances to add to the instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceReference instances = 29097598; + * @param array<\Google\Cloud\Compute\V1\InstanceReference>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstanceReference::class); + $this->instances = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsListInstances.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsListInstances.php new file mode 100644 index 000000000000..4f32ed9dd812 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsListInstances.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.InstanceGroupsListInstances + */ +class InstanceGroupsListInstances extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of InstanceWithNamedPorts resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceWithNamedPorts items = 100526016; + */ + private $items; + /** + * [Output Only] The resource type, which is always compute#instanceGroupsListInstances for the list of instances in the specified instance group. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\InstanceWithNamedPorts>|\Google\Protobuf\Internal\RepeatedField $items + * A list of InstanceWithNamedPorts resources. + * @type string $kind + * [Output Only] The resource type, which is always compute#instanceGroupsListInstances for the list of instances in the specified instance group. + * @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 InstanceWithNamedPorts resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceWithNamedPorts items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of InstanceWithNamedPorts resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceWithNamedPorts items = 100526016; + * @param array<\Google\Cloud\Compute\V1\InstanceWithNamedPorts>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstanceWithNamedPorts::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] The resource type, which is always compute#instanceGroupsListInstances for the list of instances in the specified instance group. + * + * 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); + } + + /** + * [Output Only] The resource type, which is always compute#instanceGroupsListInstances for the list of instances in the specified instance group. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsListInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsListInstancesRequest.php new file mode 100644 index 000000000000..c9c5cf194e1b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsListInstancesRequest.php @@ -0,0 +1,80 @@ +google.cloud.compute.v1.InstanceGroupsListInstancesRequest + */ +class InstanceGroupsListInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * A filter for the state of the instances in the instance group. Valid options are ALL or RUNNING. If you do not specify this parameter the list includes all instances regardless of their state. + * Check the InstanceState enum for the list of possible values. + * + * Generated from protobuf field optional string instance_state = 92223591; + */ + protected $instance_state = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_state + * A filter for the state of the instances in the instance group. Valid options are ALL or RUNNING. If you do not specify this parameter the list includes all instances regardless of their state. + * Check the InstanceState enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A filter for the state of the instances in the instance group. Valid options are ALL or RUNNING. If you do not specify this parameter the list includes all instances regardless of their state. + * Check the InstanceState enum for the list of possible values. + * + * Generated from protobuf field optional string instance_state = 92223591; + * @return string + */ + public function getInstanceState() + { + return isset($this->instance_state) ? $this->instance_state : ''; + } + + public function hasInstanceState() + { + return isset($this->instance_state); + } + + public function clearInstanceState() + { + unset($this->instance_state); + } + + /** + * A filter for the state of the instances in the instance group. Valid options are ALL or RUNNING. If you do not specify this parameter the list includes all instances regardless of their state. + * Check the InstanceState enum for the list of possible values. + * + * Generated from protobuf field optional string instance_state = 92223591; + * @param string $var + * @return $this + */ + public function setInstanceState($var) + { + GPBUtil::checkString($var, True); + $this->instance_state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsListInstancesRequest/InstanceState.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsListInstancesRequest/InstanceState.php new file mode 100644 index 000000000000..343c38074c8a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsListInstancesRequest/InstanceState.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.InstanceGroupsListInstancesRequest.InstanceState + */ +class InstanceState +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_INSTANCE_STATE = 0; + */ + const UNDEFINED_INSTANCE_STATE = 0; + /** + * Includes all instances in the generated list regardless of their state. + * + * Generated from protobuf enum ALL = 64897; + */ + const ALL = 64897; + /** + * Includes instances in the generated list only if they have a RUNNING state. + * + * Generated from protobuf enum RUNNING = 121282975; + */ + const RUNNING = 121282975; + + private static $valueToName = [ + self::UNDEFINED_INSTANCE_STATE => 'UNDEFINED_INSTANCE_STATE', + self::ALL => 'ALL', + self::RUNNING => 'RUNNING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(InstanceState::class, \Google\Cloud\Compute\V1\InstanceGroupsListInstancesRequest_InstanceState::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsRemoveInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsRemoveInstancesRequest.php new file mode 100644 index 000000000000..4efb8df81531 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsRemoveInstancesRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest + */ +class InstanceGroupsRemoveInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The list of instances to remove from the instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceReference instances = 29097598; + */ + private $instances; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\InstanceReference>|\Google\Protobuf\Internal\RepeatedField $instances + * The list of instances to remove from the instance group. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The list of instances to remove from the instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceReference instances = 29097598; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * The list of instances to remove from the instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceReference instances = 29097598; + * @param array<\Google\Cloud\Compute\V1\InstanceReference>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstanceReference::class); + $this->instances = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsScopedList.php new file mode 100644 index 000000000000..96308c03a27e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.InstanceGroupsScopedList + */ +class InstanceGroupsScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The list of instance groups that are contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroup instance_groups = 366469310; + */ + private $instance_groups; + /** + * [Output Only] An informational warning that replaces the list of instance groups when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\InstanceGroup>|\Google\Protobuf\Internal\RepeatedField $instance_groups + * [Output Only] The list of instance groups that are contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] An informational warning that replaces the list of instance groups when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The list of instance groups that are contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroup instance_groups = 366469310; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstanceGroups() + { + return $this->instance_groups; + } + + /** + * [Output Only] The list of instance groups that are contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroup instance_groups = 366469310; + * @param array<\Google\Cloud\Compute\V1\InstanceGroup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstanceGroups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstanceGroup::class); + $this->instance_groups = $arr; + + return $this; + } + + /** + * [Output Only] An informational warning that replaces the list of instance groups 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 groups 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsSetNamedPortsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsSetNamedPortsRequest.php new file mode 100644 index 000000000000..ca1013cbc87b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupsSetNamedPortsRequest.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest + */ +class InstanceGroupsSetNamedPortsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The fingerprint of the named ports information for this instance group. Use this optional property to prevent conflicts when multiple users change the named ports settings concurrently. Obtain the fingerprint with the instanceGroups.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request. A request with an incorrect fingerprint will fail with error 412 conditionNotMet. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * The list of named ports to set for this instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NamedPort named_ports = 427598732; + */ + private $named_ports; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $fingerprint + * The fingerprint of the named ports information for this instance group. Use this optional property to prevent conflicts when multiple users change the named ports settings concurrently. Obtain the fingerprint with the instanceGroups.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request. A request with an incorrect fingerprint will fail with error 412 conditionNotMet. + * @type array<\Google\Cloud\Compute\V1\NamedPort>|\Google\Protobuf\Internal\RepeatedField $named_ports + * The list of named ports to set for this instance group. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The fingerprint of the named ports information for this instance group. Use this optional property to prevent conflicts when multiple users change the named ports settings concurrently. Obtain the fingerprint with the instanceGroups.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request. A request with an incorrect fingerprint will fail with error 412 conditionNotMet. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * The fingerprint of the named ports information for this instance group. Use this optional property to prevent conflicts when multiple users change the named ports settings concurrently. Obtain the fingerprint with the instanceGroups.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request. A request with an incorrect fingerprint will fail with error 412 conditionNotMet. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * The list of named ports to set for this instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NamedPort named_ports = 427598732; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNamedPorts() + { + return $this->named_ports; + } + + /** + * The list of named ports to set for this instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NamedPort named_ports = 427598732; + * @param array<\Google\Cloud\Compute\V1\NamedPort>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNamedPorts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NamedPort::class); + $this->named_ports = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceList.php new file mode 100644 index 000000000000..771276ead510 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.InstanceList + */ +class InstanceList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of Instance resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Instance items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#instanceList for lists of Instance resources. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\Instance>|\Google\Protobuf\Internal\RepeatedField $items + * A list of Instance resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#instanceList for lists of Instance resources. + * @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 Instance resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Instance items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of Instance resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Instance items = 100526016; + * @param array<\Google\Cloud\Compute\V1\Instance>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Instance::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#instanceList for lists of Instance resources. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#instanceList for lists of Instance resources. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceListReferrers.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceListReferrers.php new file mode 100644 index 000000000000..28577dd44f37 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceListReferrers.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.InstanceListReferrers + */ +class InstanceListReferrers extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of Reference resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Reference items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#instanceListReferrers for lists of Instance referrers. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\Reference>|\Google\Protobuf\Internal\RepeatedField $items + * A list of Reference resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#instanceListReferrers for lists of Instance referrers. + * @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 Reference resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Reference items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of Reference resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Reference items = 100526016; + * @param array<\Google\Cloud\Compute\V1\Reference>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Reference::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#instanceListReferrers for lists of Instance referrers. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#instanceListReferrers for lists of Instance referrers. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceManagedByIgmError.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceManagedByIgmError.php new file mode 100644 index 000000000000..0ad355990fcd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceManagedByIgmError.php @@ -0,0 +1,164 @@ +google.cloud.compute.v1.InstanceManagedByIgmError + */ +class InstanceManagedByIgmError extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Contents of the error. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError error = 96784904; + */ + protected $error = null; + /** + * [Output Only] Details of the instance action that triggered this error. May be null, if the error was not caused by an action on an instance. This field is optional. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails instance_action_details = 292224547; + */ + protected $instance_action_details = null; + /** + * [Output Only] The time that this error occurred. This value is in RFC3339 text format. + * + * Generated from protobuf field optional string timestamp = 55126294; + */ + protected $timestamp = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\InstanceManagedByIgmErrorManagedInstanceError $error + * [Output Only] Contents of the error. + * @type \Google\Cloud\Compute\V1\InstanceManagedByIgmErrorInstanceActionDetails $instance_action_details + * [Output Only] Details of the instance action that triggered this error. May be null, if the error was not caused by an action on an instance. This field is optional. + * @type string $timestamp + * [Output Only] The time that this error occurred. This value is in RFC3339 text format. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Contents of the error. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError error = 96784904; + * @return \Google\Cloud\Compute\V1\InstanceManagedByIgmErrorManagedInstanceError|null + */ + public function getError() + { + return $this->error; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * [Output Only] Contents of the error. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError error = 96784904; + * @param \Google\Cloud\Compute\V1\InstanceManagedByIgmErrorManagedInstanceError $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceManagedByIgmErrorManagedInstanceError::class); + $this->error = $var; + + return $this; + } + + /** + * [Output Only] Details of the instance action that triggered this error. May be null, if the error was not caused by an action on an instance. This field is optional. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails instance_action_details = 292224547; + * @return \Google\Cloud\Compute\V1\InstanceManagedByIgmErrorInstanceActionDetails|null + */ + public function getInstanceActionDetails() + { + return $this->instance_action_details; + } + + public function hasInstanceActionDetails() + { + return isset($this->instance_action_details); + } + + public function clearInstanceActionDetails() + { + unset($this->instance_action_details); + } + + /** + * [Output Only] Details of the instance action that triggered this error. May be null, if the error was not caused by an action on an instance. This field is optional. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails instance_action_details = 292224547; + * @param \Google\Cloud\Compute\V1\InstanceManagedByIgmErrorInstanceActionDetails $var + * @return $this + */ + public function setInstanceActionDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceManagedByIgmErrorInstanceActionDetails::class); + $this->instance_action_details = $var; + + return $this; + } + + /** + * [Output Only] The time that this error occurred. This value is in RFC3339 text format. + * + * Generated from protobuf field optional string timestamp = 55126294; + * @return string + */ + public function getTimestamp() + { + return isset($this->timestamp) ? $this->timestamp : ''; + } + + public function hasTimestamp() + { + return isset($this->timestamp); + } + + public function clearTimestamp() + { + unset($this->timestamp); + } + + /** + * [Output Only] The time that this error occurred. This value is in RFC3339 text format. + * + * Generated from protobuf field optional string timestamp = 55126294; + * @param string $var + * @return $this + */ + public function setTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->timestamp = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceManagedByIgmErrorInstanceActionDetails.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceManagedByIgmErrorInstanceActionDetails.php new file mode 100644 index 000000000000..f08eb09ac5dc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceManagedByIgmErrorInstanceActionDetails.php @@ -0,0 +1,168 @@ +google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails + */ +class InstanceManagedByIgmErrorInstanceActionDetails extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Action that managed instance group was executing on the instance when the error occurred. Possible values: + * Check the Action enum for the list of possible values. + * + * Generated from protobuf field optional string action = 187661878; + */ + protected $action = null; + /** + * [Output Only] The URL of the instance. The URL can be set even if the instance has not yet been created. + * + * Generated from protobuf field optional string instance = 18257045; + */ + protected $instance = null; + /** + * [Output Only] Version this instance was created from, or was being created from, but the creation failed. Corresponds to one of the versions that were set on the Instance Group Manager resource at the time this instance was being created. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ManagedInstanceVersion version = 351608024; + */ + protected $version = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $action + * [Output Only] Action that managed instance group was executing on the instance when the error occurred. Possible values: + * Check the Action enum for the list of possible values. + * @type string $instance + * [Output Only] The URL of the instance. The URL can be set even if the instance has not yet been created. + * @type \Google\Cloud\Compute\V1\ManagedInstanceVersion $version + * [Output Only] Version this instance was created from, or was being created from, but the creation failed. Corresponds to one of the versions that were set on the Instance Group Manager resource at the time this instance was being created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Action that managed instance group was executing on the instance when the error occurred. Possible values: + * Check the Action enum for the list of possible values. + * + * Generated from protobuf field optional string action = 187661878; + * @return string + */ + public function getAction() + { + return isset($this->action) ? $this->action : ''; + } + + public function hasAction() + { + return isset($this->action); + } + + public function clearAction() + { + unset($this->action); + } + + /** + * [Output Only] Action that managed instance group was executing on the instance when the error occurred. Possible values: + * Check the Action enum for the list of possible values. + * + * Generated from protobuf field optional string action = 187661878; + * @param string $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkString($var, True); + $this->action = $var; + + return $this; + } + + /** + * [Output Only] The URL of the instance. The URL can be set even if the instance has not yet been created. + * + * Generated from protobuf field optional string instance = 18257045; + * @return string + */ + public function getInstance() + { + return isset($this->instance) ? $this->instance : ''; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * [Output Only] The URL of the instance. The URL can be set even if the instance has not yet been created. + * + * Generated from protobuf field optional string instance = 18257045; + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + + /** + * [Output Only] Version this instance was created from, or was being created from, but the creation failed. Corresponds to one of the versions that were set on the Instance Group Manager resource at the time this instance was being created. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ManagedInstanceVersion version = 351608024; + * @return \Google\Cloud\Compute\V1\ManagedInstanceVersion|null + */ + public function getVersion() + { + return $this->version; + } + + public function hasVersion() + { + return isset($this->version); + } + + public function clearVersion() + { + unset($this->version); + } + + /** + * [Output Only] Version this instance was created from, or was being created from, but the creation failed. Corresponds to one of the versions that were set on the Instance Group Manager resource at the time this instance was being created. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ManagedInstanceVersion version = 351608024; + * @param \Google\Cloud\Compute\V1\ManagedInstanceVersion $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ManagedInstanceVersion::class); + $this->version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceManagedByIgmErrorInstanceActionDetails/Action.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceManagedByIgmErrorInstanceActionDetails/Action.php new file mode 100644 index 000000000000..16b955cac90f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceManagedByIgmErrorInstanceActionDetails/Action.php @@ -0,0 +1,141 @@ +google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails.Action + */ +class Action +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ACTION = 0; + */ + const UNDEFINED_ACTION = 0; + /** + * The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group. + * + * Generated from protobuf enum ABANDONING = 388244813; + */ + const ABANDONING = 388244813; + /** + * The managed instance group is creating this instance. If the group fails to create this instance, it will try again until it is successful. + * + * Generated from protobuf enum CREATING = 455564985; + */ + const CREATING = 455564985; + /** + * The managed instance group is attempting to create this instance only once. If the group fails to create this instance, it does not try again and the group's targetSize value is decreased. + * + * Generated from protobuf enum CREATING_WITHOUT_RETRIES = 428843785; + */ + const CREATING_WITHOUT_RETRIES = 428843785; + /** + * The managed instance group is permanently deleting this instance. + * + * Generated from protobuf enum DELETING = 528602024; + */ + const DELETING = 528602024; + /** + * The managed instance group has not scheduled any actions for this instance. + * + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + /** + * The managed instance group is recreating this instance. + * + * Generated from protobuf enum RECREATING = 287278572; + */ + const RECREATING = 287278572; + /** + * The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance. + * + * Generated from protobuf enum REFRESHING = 163266343; + */ + const REFRESHING = 163266343; + /** + * The managed instance group is restarting this instance. + * + * Generated from protobuf enum RESTARTING = 320534387; + */ + const RESTARTING = 320534387; + /** + * The managed instance group is resuming this instance. + * + * Generated from protobuf enum RESUMING = 446856618; + */ + const RESUMING = 446856618; + /** + * The managed instance group is starting this instance. + * + * Generated from protobuf enum STARTING = 488820800; + */ + const STARTING = 488820800; + /** + * The managed instance group is stopping this instance. + * + * Generated from protobuf enum STOPPING = 350791796; + */ + const STOPPING = 350791796; + /** + * The managed instance group is suspending this instance. + * + * Generated from protobuf enum SUSPENDING = 514206246; + */ + const SUSPENDING = 514206246; + /** + * The managed instance group is verifying this already created instance. Verification happens every time the instance is (re)created or restarted and consists of: 1. Waiting until health check specified as part of this managed instance group's autohealing policy reports HEALTHY. Note: Applies only if autohealing policy has a health check specified 2. Waiting for addition verification steps performed as post-instance creation (subject to future extensions). + * + * Generated from protobuf enum VERIFYING = 16982185; + */ + const VERIFYING = 16982185; + + private static $valueToName = [ + self::UNDEFINED_ACTION => 'UNDEFINED_ACTION', + self::ABANDONING => 'ABANDONING', + self::CREATING => 'CREATING', + self::CREATING_WITHOUT_RETRIES => 'CREATING_WITHOUT_RETRIES', + self::DELETING => 'DELETING', + self::NONE => 'NONE', + self::RECREATING => 'RECREATING', + self::REFRESHING => 'REFRESHING', + self::RESTARTING => 'RESTARTING', + self::RESUMING => 'RESUMING', + self::STARTING => 'STARTING', + self::STOPPING => 'STOPPING', + self::SUSPENDING => 'SUSPENDING', + self::VERIFYING => 'VERIFYING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Action::class, \Google\Cloud\Compute\V1\InstanceManagedByIgmErrorInstanceActionDetails_Action::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceManagedByIgmErrorManagedInstanceError.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceManagedByIgmErrorManagedInstanceError.php new file mode 100644 index 000000000000..8eef6d1f8a67 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceManagedByIgmErrorManagedInstanceError.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError + */ +class InstanceManagedByIgmErrorManagedInstanceError extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Error code. + * + * Generated from protobuf field optional string code = 3059181; + */ + protected $code = null; + /** + * [Output Only] Error message. + * + * Generated from protobuf field optional string message = 418054151; + */ + protected $message = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $code + * [Output Only] Error code. + * @type string $message + * [Output Only] Error message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Error code. + * + * Generated from protobuf field optional string code = 3059181; + * @return string + */ + public function getCode() + { + return isset($this->code) ? $this->code : ''; + } + + public function hasCode() + { + return isset($this->code); + } + + public function clearCode() + { + unset($this->code); + } + + /** + * [Output Only] Error code. + * + * Generated from protobuf field optional string code = 3059181; + * @param string $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkString($var, True); + $this->code = $var; + + return $this; + } + + /** + * [Output Only] Error message. + * + * Generated from protobuf field optional string message = 418054151; + * @return string + */ + public function getMessage() + { + return isset($this->message) ? $this->message : ''; + } + + public function hasMessage() + { + return isset($this->message); + } + + public function clearMessage() + { + unset($this->message); + } + + /** + * [Output Only] Error message. + * + * Generated from protobuf field optional string message = 418054151; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceMoveRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceMoveRequest.php new file mode 100644 index 000000000000..38673a8d0201 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceMoveRequest.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.InstanceMoveRequest + */ +class InstanceMoveRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The URL of the destination zone to move the instance. This can be a full or partial URL. For example, the following are all valid URLs to a zone: - https://www.googleapis.com/compute/v1/projects/project/zones/zone - projects/project/zones/zone - zones/zone + * + * Generated from protobuf field optional string destination_zone = 131854653; + */ + protected $destination_zone = null; + /** + * The URL of the target instance to move. This can be a full or partial URL. For example, the following are all valid URLs to an instance: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instances/instance - projects/project/zones/zone/instances/instance - zones/zone/instances/instance + * + * Generated from protobuf field optional string target_instance = 289769347; + */ + protected $target_instance = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $destination_zone + * The URL of the destination zone to move the instance. This can be a full or partial URL. For example, the following are all valid URLs to a zone: - https://www.googleapis.com/compute/v1/projects/project/zones/zone - projects/project/zones/zone - zones/zone + * @type string $target_instance + * The URL of the target instance to move. This can be a full or partial URL. For example, the following are all valid URLs to an instance: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instances/instance - projects/project/zones/zone/instances/instance - zones/zone/instances/instance + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The URL of the destination zone to move the instance. This can be a full or partial URL. For example, the following are all valid URLs to a zone: - https://www.googleapis.com/compute/v1/projects/project/zones/zone - projects/project/zones/zone - zones/zone + * + * Generated from protobuf field optional string destination_zone = 131854653; + * @return string + */ + public function getDestinationZone() + { + return isset($this->destination_zone) ? $this->destination_zone : ''; + } + + public function hasDestinationZone() + { + return isset($this->destination_zone); + } + + public function clearDestinationZone() + { + unset($this->destination_zone); + } + + /** + * The URL of the destination zone to move the instance. This can be a full or partial URL. For example, the following are all valid URLs to a zone: - https://www.googleapis.com/compute/v1/projects/project/zones/zone - projects/project/zones/zone - zones/zone + * + * Generated from protobuf field optional string destination_zone = 131854653; + * @param string $var + * @return $this + */ + public function setDestinationZone($var) + { + GPBUtil::checkString($var, True); + $this->destination_zone = $var; + + return $this; + } + + /** + * The URL of the target instance to move. This can be a full or partial URL. For example, the following are all valid URLs to an instance: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instances/instance - projects/project/zones/zone/instances/instance - zones/zone/instances/instance + * + * Generated from protobuf field optional string target_instance = 289769347; + * @return string + */ + public function getTargetInstance() + { + return isset($this->target_instance) ? $this->target_instance : ''; + } + + public function hasTargetInstance() + { + return isset($this->target_instance); + } + + public function clearTargetInstance() + { + unset($this->target_instance); + } + + /** + * The URL of the target instance to move. This can be a full or partial URL. For example, the following are all valid URLs to an instance: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instances/instance - projects/project/zones/zone/instances/instance - zones/zone/instances/instance + * + * Generated from protobuf field optional string target_instance = 289769347; + * @param string $var + * @return $this + */ + public function setTargetInstance($var) + { + GPBUtil::checkString($var, True); + $this->target_instance = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceParams.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceParams.php new file mode 100644 index 000000000000..c9fa812401da --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceParams.php @@ -0,0 +1,67 @@ +google.cloud.compute.v1.InstanceParams + */ +class InstanceParams extends \Google\Protobuf\Internal\Message +{ + /** + * Resource manager tags to be bound to the instance. Tag keys and values have the same definition as resource manager tags. Keys must be in the format `tagKeys/{tag_key_id}`, and values are in the format `tagValues/456`. The field is ignored (both PUT & PATCH) when empty. + * + * Generated from protobuf field map resource_manager_tags = 377671164; + */ + private $resource_manager_tags; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $resource_manager_tags + * Resource manager tags to be bound to the instance. Tag keys and values have the same definition as resource manager tags. Keys must be in the format `tagKeys/{tag_key_id}`, and values are in the format `tagValues/456`. The field is ignored (both PUT & PATCH) when empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Resource manager tags to be bound to the instance. Tag keys and values have the same definition as resource manager tags. Keys must be in the format `tagKeys/{tag_key_id}`, and values are in the format `tagValues/456`. The field is ignored (both PUT & PATCH) when empty. + * + * Generated from protobuf field map resource_manager_tags = 377671164; + * @return \Google\Protobuf\Internal\MapField + */ + public function getResourceManagerTags() + { + return $this->resource_manager_tags; + } + + /** + * Resource manager tags to be bound to the instance. Tag keys and values have the same definition as resource manager tags. Keys must be in the format `tagKeys/{tag_key_id}`, and values are in the format `tagValues/456`. The field is ignored (both PUT & PATCH) when empty. + * + * Generated from protobuf field map resource_manager_tags = 377671164; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setResourceManagerTags($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_manager_tags = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceProperties.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceProperties.php new file mode 100644 index 000000000000..8ec4ec60d4d8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceProperties.php @@ -0,0 +1,894 @@ +google.cloud.compute.v1.InstanceProperties + */ +class InstanceProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Controls for advanced machine-related behavior features. Note that for MachineImage, this is not supported yet. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AdvancedMachineFeatures advanced_machine_features = 409646002; + */ + protected $advanced_machine_features = null; + /** + * Enables instances created based on these properties to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set to false. See the Enable IP forwarding documentation for more information. + * + * Generated from protobuf field optional bool can_ip_forward = 467731324; + */ + protected $can_ip_forward = null; + /** + * Specifies the Confidential Instance options. Note that for MachineImage, this is not supported yet. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ConfidentialInstanceConfig confidential_instance_config = 490637685; + */ + protected $confidential_instance_config = null; + /** + * An optional text description for the instances that are created from these properties. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * An array of disks that are associated with the instances that are created from these properties. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AttachedDisk disks = 95594102; + */ + private $disks; + /** + * A list of guest accelerator cards' type and count to use for instances created from these properties. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig guest_accelerators = 463595119; + */ + private $guest_accelerators; + /** + * KeyRevocationActionType of the instance. Supported options are "STOP" and "NONE". The default value is "NONE" if it is not specified. + * Check the KeyRevocationActionType enum for the list of possible values. + * + * Generated from protobuf field optional string key_revocation_action_type = 235941474; + */ + protected $key_revocation_action_type = null; + /** + * Labels to apply to instances that are created from these properties. + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + /** + * The machine type to use for instances that are created from these properties. + * + * Generated from protobuf field optional string machine_type = 227711026; + */ + protected $machine_type = null; + /** + * The metadata key/value pairs to assign to instances that are created from these properties. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Metadata metadata = 86866735; + */ + protected $metadata = null; + /** + * Minimum cpu/platform to be used by instances. The instance may be scheduled on the specified or newer cpu/platform. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more information, read Specifying a Minimum CPU Platform. + * + * Generated from protobuf field optional string min_cpu_platform = 242912759; + */ + protected $min_cpu_platform = null; + /** + * An array of network access configurations for this interface. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkInterface network_interfaces = 52735243; + */ + private $network_interfaces; + /** + * Note that for MachineImage, this is not supported yet. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkPerformanceConfig network_performance_config = 398330850; + */ + protected $network_performance_config = null; + /** + * The private IPv6 google access type for VMs. If not specified, use INHERIT_FROM_SUBNETWORK as default. Note that for MachineImage, this is not supported yet. + * Check the PrivateIpv6GoogleAccess enum for the list of possible values. + * + * Generated from protobuf field optional string private_ipv6_google_access = 48277006; + */ + protected $private_ipv6_google_access = null; + /** + * Specifies the reservations that instances can consume from. Note that for MachineImage, this is not supported yet. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ReservationAffinity reservation_affinity = 157850683; + */ + protected $reservation_affinity = null; + /** + * Resource manager tags to be bound to the instance. Tag keys and values have the same definition as resource manager tags. Keys must be in the format `tagKeys/{tag_key_id}`, and values are in the format `tagValues/456`. The field is ignored (both PUT & PATCH) when empty. + * + * Generated from protobuf field map resource_manager_tags = 377671164; + */ + private $resource_manager_tags; + /** + * Resource policies (names, not URLs) applied to instances created from these properties. Note that for MachineImage, this is not supported yet. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + */ + private $resource_policies; + /** + * Specifies the scheduling options for the instances that are created from these properties. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Scheduling scheduling = 386688404; + */ + protected $scheduling = null; + /** + * A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from these properties. Use metadata queries to obtain the access tokens for these instances. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAccount service_accounts = 277537328; + */ + private $service_accounts; + /** + * Note that for MachineImage, this is not supported yet. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ShieldedInstanceConfig shielded_instance_config = 12862901; + */ + protected $shielded_instance_config = null; + /** + * A list of tags to apply to the instances that are created from these properties. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Tags tags = 3552281; + */ + protected $tags = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\AdvancedMachineFeatures $advanced_machine_features + * Controls for advanced machine-related behavior features. Note that for MachineImage, this is not supported yet. + * @type bool $can_ip_forward + * Enables instances created based on these properties to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set to false. See the Enable IP forwarding documentation for more information. + * @type \Google\Cloud\Compute\V1\ConfidentialInstanceConfig $confidential_instance_config + * Specifies the Confidential Instance options. Note that for MachineImage, this is not supported yet. + * @type string $description + * An optional text description for the instances that are created from these properties. + * @type array<\Google\Cloud\Compute\V1\AttachedDisk>|\Google\Protobuf\Internal\RepeatedField $disks + * An array of disks that are associated with the instances that are created from these properties. + * @type array<\Google\Cloud\Compute\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $guest_accelerators + * A list of guest accelerator cards' type and count to use for instances created from these properties. + * @type string $key_revocation_action_type + * KeyRevocationActionType of the instance. Supported options are "STOP" and "NONE". The default value is "NONE" if it is not specified. + * Check the KeyRevocationActionType enum for the list of possible values. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels to apply to instances that are created from these properties. + * @type string $machine_type + * The machine type to use for instances that are created from these properties. + * @type \Google\Cloud\Compute\V1\Metadata $metadata + * The metadata key/value pairs to assign to instances that are created from these properties. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information. + * @type string $min_cpu_platform + * Minimum cpu/platform to be used by instances. The instance may be scheduled on the specified or newer cpu/platform. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more information, read Specifying a Minimum CPU Platform. + * @type array<\Google\Cloud\Compute\V1\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $network_interfaces + * An array of network access configurations for this interface. + * @type \Google\Cloud\Compute\V1\NetworkPerformanceConfig $network_performance_config + * Note that for MachineImage, this is not supported yet. + * @type string $private_ipv6_google_access + * The private IPv6 google access type for VMs. If not specified, use INHERIT_FROM_SUBNETWORK as default. Note that for MachineImage, this is not supported yet. + * Check the PrivateIpv6GoogleAccess enum for the list of possible values. + * @type \Google\Cloud\Compute\V1\ReservationAffinity $reservation_affinity + * Specifies the reservations that instances can consume from. Note that for MachineImage, this is not supported yet. + * @type array|\Google\Protobuf\Internal\MapField $resource_manager_tags + * Resource manager tags to be bound to the instance. Tag keys and values have the same definition as resource manager tags. Keys must be in the format `tagKeys/{tag_key_id}`, and values are in the format `tagValues/456`. The field is ignored (both PUT & PATCH) when empty. + * @type array|\Google\Protobuf\Internal\RepeatedField $resource_policies + * Resource policies (names, not URLs) applied to instances created from these properties. Note that for MachineImage, this is not supported yet. + * @type \Google\Cloud\Compute\V1\Scheduling $scheduling + * Specifies the scheduling options for the instances that are created from these properties. + * @type array<\Google\Cloud\Compute\V1\ServiceAccount>|\Google\Protobuf\Internal\RepeatedField $service_accounts + * A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from these properties. Use metadata queries to obtain the access tokens for these instances. + * @type \Google\Cloud\Compute\V1\ShieldedInstanceConfig $shielded_instance_config + * Note that for MachineImage, this is not supported yet. + * @type \Google\Cloud\Compute\V1\Tags $tags + * A list of tags to apply to the instances that are created from these properties. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Controls for advanced machine-related behavior features. Note that for MachineImage, this is not supported yet. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AdvancedMachineFeatures advanced_machine_features = 409646002; + * @return \Google\Cloud\Compute\V1\AdvancedMachineFeatures|null + */ + public function getAdvancedMachineFeatures() + { + return $this->advanced_machine_features; + } + + public function hasAdvancedMachineFeatures() + { + return isset($this->advanced_machine_features); + } + + public function clearAdvancedMachineFeatures() + { + unset($this->advanced_machine_features); + } + + /** + * Controls for advanced machine-related behavior features. Note that for MachineImage, this is not supported yet. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AdvancedMachineFeatures advanced_machine_features = 409646002; + * @param \Google\Cloud\Compute\V1\AdvancedMachineFeatures $var + * @return $this + */ + public function setAdvancedMachineFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\AdvancedMachineFeatures::class); + $this->advanced_machine_features = $var; + + return $this; + } + + /** + * Enables instances created based on these properties to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set to false. See the Enable IP forwarding documentation for more information. + * + * Generated from protobuf field optional bool can_ip_forward = 467731324; + * @return bool + */ + public function getCanIpForward() + { + return isset($this->can_ip_forward) ? $this->can_ip_forward : false; + } + + public function hasCanIpForward() + { + return isset($this->can_ip_forward); + } + + public function clearCanIpForward() + { + unset($this->can_ip_forward); + } + + /** + * Enables instances created based on these properties to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set to false. See the Enable IP forwarding documentation for more information. + * + * Generated from protobuf field optional bool can_ip_forward = 467731324; + * @param bool $var + * @return $this + */ + public function setCanIpForward($var) + { + GPBUtil::checkBool($var); + $this->can_ip_forward = $var; + + return $this; + } + + /** + * Specifies the Confidential Instance options. Note that for MachineImage, this is not supported yet. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ConfidentialInstanceConfig confidential_instance_config = 490637685; + * @return \Google\Cloud\Compute\V1\ConfidentialInstanceConfig|null + */ + public function getConfidentialInstanceConfig() + { + return $this->confidential_instance_config; + } + + public function hasConfidentialInstanceConfig() + { + return isset($this->confidential_instance_config); + } + + public function clearConfidentialInstanceConfig() + { + unset($this->confidential_instance_config); + } + + /** + * Specifies the Confidential Instance options. Note that for MachineImage, this is not supported yet. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ConfidentialInstanceConfig confidential_instance_config = 490637685; + * @param \Google\Cloud\Compute\V1\ConfidentialInstanceConfig $var + * @return $this + */ + public function setConfidentialInstanceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ConfidentialInstanceConfig::class); + $this->confidential_instance_config = $var; + + return $this; + } + + /** + * An optional text description for the instances that are created from these properties. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional text description for the instances that are created from these properties. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * An array of disks that are associated with the instances that are created from these properties. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AttachedDisk disks = 95594102; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisks() + { + return $this->disks; + } + + /** + * An array of disks that are associated with the instances that are created from these properties. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AttachedDisk disks = 95594102; + * @param array<\Google\Cloud\Compute\V1\AttachedDisk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AttachedDisk::class); + $this->disks = $arr; + + return $this; + } + + /** + * A list of guest accelerator cards' type and count to use for instances created from these properties. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig guest_accelerators = 463595119; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGuestAccelerators() + { + return $this->guest_accelerators; + } + + /** + * A list of guest accelerator cards' type and count to use for instances created from these properties. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig guest_accelerators = 463595119; + * @param array<\Google\Cloud\Compute\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGuestAccelerators($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AcceleratorConfig::class); + $this->guest_accelerators = $arr; + + return $this; + } + + /** + * KeyRevocationActionType of the instance. Supported options are "STOP" and "NONE". The default value is "NONE" if it is not specified. + * Check the KeyRevocationActionType enum for the list of possible values. + * + * Generated from protobuf field optional string key_revocation_action_type = 235941474; + * @return string + */ + public function getKeyRevocationActionType() + { + return isset($this->key_revocation_action_type) ? $this->key_revocation_action_type : ''; + } + + public function hasKeyRevocationActionType() + { + return isset($this->key_revocation_action_type); + } + + public function clearKeyRevocationActionType() + { + unset($this->key_revocation_action_type); + } + + /** + * KeyRevocationActionType of the instance. Supported options are "STOP" and "NONE". The default value is "NONE" if it is not specified. + * Check the KeyRevocationActionType enum for the list of possible values. + * + * Generated from protobuf field optional string key_revocation_action_type = 235941474; + * @param string $var + * @return $this + */ + public function setKeyRevocationActionType($var) + { + GPBUtil::checkString($var, True); + $this->key_revocation_action_type = $var; + + return $this; + } + + /** + * Labels to apply to instances that are created from these properties. + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels to apply to instances that are created from these properties. + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * The machine type to use for instances that are created from these properties. + * + * Generated from protobuf field optional string machine_type = 227711026; + * @return string + */ + public function getMachineType() + { + return isset($this->machine_type) ? $this->machine_type : ''; + } + + public function hasMachineType() + { + return isset($this->machine_type); + } + + public function clearMachineType() + { + unset($this->machine_type); + } + + /** + * The machine type to use for instances that are created from these properties. + * + * Generated from protobuf field optional string machine_type = 227711026; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $var; + + return $this; + } + + /** + * The metadata key/value pairs to assign to instances that are created from these properties. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Metadata metadata = 86866735; + * @return \Google\Cloud\Compute\V1\Metadata|null + */ + public function getMetadata() + { + return $this->metadata; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * The metadata key/value pairs to assign to instances that are created from these properties. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Metadata metadata = 86866735; + * @param \Google\Cloud\Compute\V1\Metadata $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Metadata::class); + $this->metadata = $var; + + return $this; + } + + /** + * Minimum cpu/platform to be used by instances. The instance may be scheduled on the specified or newer cpu/platform. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more information, read Specifying a Minimum CPU Platform. + * + * Generated from protobuf field optional string min_cpu_platform = 242912759; + * @return string + */ + public function getMinCpuPlatform() + { + return isset($this->min_cpu_platform) ? $this->min_cpu_platform : ''; + } + + public function hasMinCpuPlatform() + { + return isset($this->min_cpu_platform); + } + + public function clearMinCpuPlatform() + { + unset($this->min_cpu_platform); + } + + /** + * Minimum cpu/platform to be used by instances. The instance may be scheduled on the specified or newer cpu/platform. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more information, read Specifying a Minimum CPU Platform. + * + * Generated from protobuf field optional string min_cpu_platform = 242912759; + * @param string $var + * @return $this + */ + public function setMinCpuPlatform($var) + { + GPBUtil::checkString($var, True); + $this->min_cpu_platform = $var; + + return $this; + } + + /** + * An array of network access configurations for this interface. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkInterface network_interfaces = 52735243; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkInterfaces() + { + return $this->network_interfaces; + } + + /** + * An array of network access configurations for this interface. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkInterface network_interfaces = 52735243; + * @param array<\Google\Cloud\Compute\V1\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkInterfaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NetworkInterface::class); + $this->network_interfaces = $arr; + + return $this; + } + + /** + * Note that for MachineImage, this is not supported yet. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkPerformanceConfig network_performance_config = 398330850; + * @return \Google\Cloud\Compute\V1\NetworkPerformanceConfig|null + */ + public function getNetworkPerformanceConfig() + { + return $this->network_performance_config; + } + + public function hasNetworkPerformanceConfig() + { + return isset($this->network_performance_config); + } + + public function clearNetworkPerformanceConfig() + { + unset($this->network_performance_config); + } + + /** + * Note that for MachineImage, this is not supported yet. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkPerformanceConfig network_performance_config = 398330850; + * @param \Google\Cloud\Compute\V1\NetworkPerformanceConfig $var + * @return $this + */ + public function setNetworkPerformanceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkPerformanceConfig::class); + $this->network_performance_config = $var; + + return $this; + } + + /** + * The private IPv6 google access type for VMs. If not specified, use INHERIT_FROM_SUBNETWORK as default. Note that for MachineImage, this is not supported yet. + * Check the PrivateIpv6GoogleAccess enum for the list of possible values. + * + * Generated from protobuf field optional string private_ipv6_google_access = 48277006; + * @return string + */ + public function getPrivateIpv6GoogleAccess() + { + return isset($this->private_ipv6_google_access) ? $this->private_ipv6_google_access : ''; + } + + public function hasPrivateIpv6GoogleAccess() + { + return isset($this->private_ipv6_google_access); + } + + public function clearPrivateIpv6GoogleAccess() + { + unset($this->private_ipv6_google_access); + } + + /** + * The private IPv6 google access type for VMs. If not specified, use INHERIT_FROM_SUBNETWORK as default. Note that for MachineImage, this is not supported yet. + * Check the PrivateIpv6GoogleAccess enum for the list of possible values. + * + * Generated from protobuf field optional string private_ipv6_google_access = 48277006; + * @param string $var + * @return $this + */ + public function setPrivateIpv6GoogleAccess($var) + { + GPBUtil::checkString($var, True); + $this->private_ipv6_google_access = $var; + + return $this; + } + + /** + * Specifies the reservations that instances can consume from. Note that for MachineImage, this is not supported yet. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ReservationAffinity reservation_affinity = 157850683; + * @return \Google\Cloud\Compute\V1\ReservationAffinity|null + */ + public function getReservationAffinity() + { + return $this->reservation_affinity; + } + + public function hasReservationAffinity() + { + return isset($this->reservation_affinity); + } + + public function clearReservationAffinity() + { + unset($this->reservation_affinity); + } + + /** + * Specifies the reservations that instances can consume from. Note that for MachineImage, this is not supported yet. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ReservationAffinity reservation_affinity = 157850683; + * @param \Google\Cloud\Compute\V1\ReservationAffinity $var + * @return $this + */ + public function setReservationAffinity($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ReservationAffinity::class); + $this->reservation_affinity = $var; + + return $this; + } + + /** + * Resource manager tags to be bound to the instance. Tag keys and values have the same definition as resource manager tags. Keys must be in the format `tagKeys/{tag_key_id}`, and values are in the format `tagValues/456`. The field is ignored (both PUT & PATCH) when empty. + * + * Generated from protobuf field map resource_manager_tags = 377671164; + * @return \Google\Protobuf\Internal\MapField + */ + public function getResourceManagerTags() + { + return $this->resource_manager_tags; + } + + /** + * Resource manager tags to be bound to the instance. Tag keys and values have the same definition as resource manager tags. Keys must be in the format `tagKeys/{tag_key_id}`, and values are in the format `tagValues/456`. The field is ignored (both PUT & PATCH) when empty. + * + * Generated from protobuf field map resource_manager_tags = 377671164; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setResourceManagerTags($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_manager_tags = $arr; + + return $this; + } + + /** + * Resource policies (names, not URLs) applied to instances created from these properties. Note that for MachineImage, this is not supported yet. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourcePolicies() + { + return $this->resource_policies; + } + + /** + * Resource policies (names, not URLs) applied to instances created from these properties. Note that for MachineImage, this is not supported yet. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourcePolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_policies = $arr; + + return $this; + } + + /** + * Specifies the scheduling options for the instances that are created from these properties. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Scheduling scheduling = 386688404; + * @return \Google\Cloud\Compute\V1\Scheduling|null + */ + public function getScheduling() + { + return $this->scheduling; + } + + public function hasScheduling() + { + return isset($this->scheduling); + } + + public function clearScheduling() + { + unset($this->scheduling); + } + + /** + * Specifies the scheduling options for the instances that are created from these properties. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Scheduling scheduling = 386688404; + * @param \Google\Cloud\Compute\V1\Scheduling $var + * @return $this + */ + public function setScheduling($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Scheduling::class); + $this->scheduling = $var; + + return $this; + } + + /** + * A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from these properties. Use metadata queries to obtain the access tokens for these instances. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAccount service_accounts = 277537328; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServiceAccounts() + { + return $this->service_accounts; + } + + /** + * A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from these properties. Use metadata queries to obtain the access tokens for these instances. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAccount service_accounts = 277537328; + * @param array<\Google\Cloud\Compute\V1\ServiceAccount>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServiceAccounts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ServiceAccount::class); + $this->service_accounts = $arr; + + return $this; + } + + /** + * Note that for MachineImage, this is not supported yet. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ShieldedInstanceConfig shielded_instance_config = 12862901; + * @return \Google\Cloud\Compute\V1\ShieldedInstanceConfig|null + */ + public function getShieldedInstanceConfig() + { + return $this->shielded_instance_config; + } + + public function hasShieldedInstanceConfig() + { + return isset($this->shielded_instance_config); + } + + public function clearShieldedInstanceConfig() + { + unset($this->shielded_instance_config); + } + + /** + * Note that for MachineImage, this is not supported yet. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ShieldedInstanceConfig shielded_instance_config = 12862901; + * @param \Google\Cloud\Compute\V1\ShieldedInstanceConfig $var + * @return $this + */ + public function setShieldedInstanceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ShieldedInstanceConfig::class); + $this->shielded_instance_config = $var; + + return $this; + } + + /** + * A list of tags to apply to the instances that are created from these properties. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Tags tags = 3552281; + * @return \Google\Cloud\Compute\V1\Tags|null + */ + public function getTags() + { + return $this->tags; + } + + public function hasTags() + { + return isset($this->tags); + } + + public function clearTags() + { + unset($this->tags); + } + + /** + * A list of tags to apply to the instances that are created from these properties. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Tags tags = 3552281; + * @param \Google\Cloud\Compute\V1\Tags $var + * @return $this + */ + public function setTags($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Tags::class); + $this->tags = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceProperties/KeyRevocationActionType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceProperties/KeyRevocationActionType.php new file mode 100644 index 000000000000..1bfda15061e9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceProperties/KeyRevocationActionType.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.InstanceProperties.KeyRevocationActionType + */ +class KeyRevocationActionType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_KEY_REVOCATION_ACTION_TYPE = 0; + */ + const UNDEFINED_KEY_REVOCATION_ACTION_TYPE = 0; + /** + * Default value. This value is unused. + * + * Generated from protobuf enum KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 467110106; + */ + const KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 467110106; + /** + * Indicates user chose no operation. + * + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + /** + * Indicates user chose to opt for VM shutdown on key revocation. + * + * Generated from protobuf enum STOP = 2555906; + */ + const STOP = 2555906; + + private static $valueToName = [ + self::UNDEFINED_KEY_REVOCATION_ACTION_TYPE => 'UNDEFINED_KEY_REVOCATION_ACTION_TYPE', + self::KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED => 'KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED', + self::NONE => 'NONE', + self::STOP => 'STOP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(KeyRevocationActionType::class, \Google\Cloud\Compute\V1\InstanceProperties_KeyRevocationActionType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceProperties/PrivateIpv6GoogleAccess.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceProperties/PrivateIpv6GoogleAccess.php new file mode 100644 index 000000000000..9463a1849d78 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceProperties/PrivateIpv6GoogleAccess.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.InstanceProperties.PrivateIpv6GoogleAccess + */ +class PrivateIpv6GoogleAccess +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS = 0; + */ + const UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS = 0; + /** + * Bidirectional private IPv6 access to/from Google services. If specified, the subnetwork who is attached to the instance's default network interface will be assigned an internal IPv6 prefix if it doesn't have before. + * + * Generated from protobuf enum ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 427975994; + */ + const ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 427975994; + /** + * Outbound private IPv6 access from VMs in this subnet to Google services. If specified, the subnetwork who is attached to the instance's default network interface will be assigned an internal IPv6 prefix if it doesn't have before. + * + * Generated from protobuf enum ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 288210263; + */ + const ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 288210263; + /** + * Each network interface inherits PrivateIpv6GoogleAccess from its subnetwork. + * + * Generated from protobuf enum INHERIT_FROM_SUBNETWORK = 530256959; + */ + const INHERIT_FROM_SUBNETWORK = 530256959; + + private static $valueToName = [ + self::UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS => 'UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS', + self::ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE => 'ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE', + self::ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE => 'ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE', + self::INHERIT_FROM_SUBNETWORK => 'INHERIT_FROM_SUBNETWORK', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PrivateIpv6GoogleAccess::class, \Google\Cloud\Compute\V1\InstanceProperties_PrivateIpv6GoogleAccess::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancePropertiesPatch.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancePropertiesPatch.php new file mode 100644 index 000000000000..639f7314e112 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancePropertiesPatch.php @@ -0,0 +1,101 @@ +google.cloud.compute.v1.InstancePropertiesPatch + */ +class InstancePropertiesPatch extends \Google\Protobuf\Internal\Message +{ + /** + * The label key-value pairs that you want to patch onto the instance. + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + /** + * The metadata key-value pairs that you want to patch onto the instance. For more information, see Project and instance metadata. + * + * Generated from protobuf field map metadata = 86866735; + */ + private $metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $labels + * The label key-value pairs that you want to patch onto the instance. + * @type array|\Google\Protobuf\Internal\MapField $metadata + * The metadata key-value pairs that you want to patch onto the instance. For more information, see Project and instance metadata. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The label key-value pairs that you want to patch onto the instance. + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * The label key-value pairs that you want to patch onto the instance. + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * The metadata key-value pairs that you want to patch onto the instance. For more information, see Project and instance metadata. + * + * Generated from protobuf field map metadata = 86866735; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * The metadata key-value pairs that you want to patch onto the instance. For more information, see Project and instance metadata. + * + * Generated from protobuf field map metadata = 86866735; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadata = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceReference.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceReference.php new file mode 100644 index 000000000000..e8194ae5c5f2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceReference.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.InstanceReference + */ +class InstanceReference extends \Google\Protobuf\Internal\Message +{ + /** + * The URL for a specific instance. @required compute.instancegroups.addInstances/removeInstances + * + * Generated from protobuf field optional string instance = 18257045; + */ + protected $instance = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * The URL for a specific instance. @required compute.instancegroups.addInstances/removeInstances + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The URL for a specific instance. @required compute.instancegroups.addInstances/removeInstances + * + * Generated from protobuf field optional string instance = 18257045; + * @return string + */ + public function getInstance() + { + return isset($this->instance) ? $this->instance : ''; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * The URL for a specific instance. @required compute.instancegroups.addInstances/removeInstances + * + * Generated from protobuf field optional string instance = 18257045; + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceSettings.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceSettings.php new file mode 100644 index 000000000000..040ab50fe4f4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceSettings.php @@ -0,0 +1,209 @@ +google.cloud.compute.v1.InstanceSettings + */ +class InstanceSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies a fingerprint for instance settings, which is essentially a hash of the instance settings resource's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update the instance settings resource. You must always provide an up-to-date fingerprint hash in order to update or change the resource, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the resource. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * [Output Only] Type of the resource. Always compute#instance_settings for instance settings. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * The metadata key/value pairs assigned to all the instances in the corresponding scope. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceSettingsMetadata metadata = 86866735; + */ + protected $metadata = null; + /** + * [Output Only] URL of the zone where the resource resides You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + */ + protected $zone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $fingerprint + * Specifies a fingerprint for instance settings, which is essentially a hash of the instance settings resource's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update the instance settings resource. You must always provide an up-to-date fingerprint hash in order to update or change the resource, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the resource. + * @type string $kind + * [Output Only] Type of the resource. Always compute#instance_settings for instance settings. + * @type \Google\Cloud\Compute\V1\InstanceSettingsMetadata $metadata + * The metadata key/value pairs assigned to all the instances in the corresponding scope. + * @type string $zone + * [Output Only] URL of the zone where the resource resides You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies a fingerprint for instance settings, which is essentially a hash of the instance settings resource's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update the instance settings resource. You must always provide an up-to-date fingerprint hash in order to update or change the resource, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the resource. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Specifies a fingerprint for instance settings, which is essentially a hash of the instance settings resource's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update the instance settings resource. You must always provide an up-to-date fingerprint hash in order to update or change the resource, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the resource. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#instance_settings for instance settings. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#instance_settings for instance settings. + * + * 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; + } + + /** + * The metadata key/value pairs assigned to all the instances in the corresponding scope. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceSettingsMetadata metadata = 86866735; + * @return \Google\Cloud\Compute\V1\InstanceSettingsMetadata|null + */ + public function getMetadata() + { + return $this->metadata; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * The metadata key/value pairs assigned to all the instances in the corresponding scope. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceSettingsMetadata metadata = 86866735; + * @param \Google\Cloud\Compute\V1\InstanceSettingsMetadata $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceSettingsMetadata::class); + $this->metadata = $var; + + return $this; + } + + /** + * [Output Only] URL of the zone where the resource resides You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + * @return string + */ + public function getZone() + { + return isset($this->zone) ? $this->zone : ''; + } + + public function hasZone() + { + return isset($this->zone); + } + + public function clearZone() + { + unset($this->zone); + } + + /** + * [Output Only] URL of the zone where the resource resides You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceSettingsMetadata.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceSettingsMetadata.php new file mode 100644 index 000000000000..cf49587f9d4a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceSettingsMetadata.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.InstanceSettingsMetadata + */ +class InstanceSettingsMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * A metadata key/value items map. The total size of all keys and values must be less than 512KB. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of the resource. Always compute#metadata for metadata. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $items + * A metadata key/value items map. The total size of all keys and values must be less than 512KB. + * @type string $kind + * [Output Only] Type of the resource. Always compute#metadata for metadata. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A metadata key/value items map. The total size of all keys and values must be less than 512KB. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A metadata key/value items map. The total size of all keys and values must be less than 512KB. + * + * 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::STRING); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#metadata for metadata. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#metadata for metadata. + * + * 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceTemplate.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceTemplate.php new file mode 100644 index 000000000000..217d68629d11 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceTemplate.php @@ -0,0 +1,473 @@ +google.cloud.compute.v1.InstanceTemplate + */ +class InstanceTemplate extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The creation timestamp for this instance template in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] A unique identifier for this instance template. The server defines this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] The resource type, which is always compute#instanceTemplate for instance templates. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * The instance properties for this instance template. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceProperties properties = 147688755; + */ + protected $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; + */ + protected $region = null; + /** + * [Output Only] The URL for this instance template. The server defines this URL. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * The source instance used to create the template. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instances/instance - projects/project/zones/zone/instances/instance + * + * Generated from protobuf field optional string source_instance = 396315705; + */ + protected $source_instance = null; + /** + * The source instance params to use to create this instance template. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SourceInstanceParams source_instance_params = 135342156; + */ + protected $source_instance_params = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] The creation timestamp for this instance template in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type int|string $id + * [Output Only] A unique identifier for this instance template. The server defines this identifier. + * @type string $kind + * [Output Only] The resource type, which is always compute#instanceTemplate for instance templates. + * @type string $name + * 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 + * The source instance used to create the template. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instances/instance - projects/project/zones/zone/instances/instance + * @type \Google\Cloud\Compute\V1\SourceInstanceParams $source_instance_params + * The source instance params to use to create this instance template. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The creation timestamp for this instance template in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] The creation timestamp for this instance template in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] A unique identifier for this instance template. The server defines this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] A unique identifier for this instance template. The server defines this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] The resource type, which is always compute#instanceTemplate for instance templates. + * + * 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); + } + + /** + * [Output Only] The resource type, which is always compute#instanceTemplate for instance templates. + * + * 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; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * The instance properties for this instance template. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceProperties properties = 147688755; + * @return \Google\Cloud\Compute\V1\InstanceProperties|null + */ + public function getProperties() + { + return $this->properties; + } + + public function hasProperties() + { + return isset($this->properties); + } + + public function clearProperties() + { + unset($this->properties); + } + + /** + * The instance properties for this instance template. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceProperties properties = 147688755; + * @param \Google\Cloud\Compute\V1\InstanceProperties $var + * @return $this + */ + public function setProperties($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceProperties::class); + $this->properties = $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. + * + * 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] The URL for this instance template. The server defines this URL. + * + * 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; + } + + /** + * The source instance used to create the template. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instances/instance - projects/project/zones/zone/instances/instance + * + * Generated from protobuf field optional string source_instance = 396315705; + * @return string + */ + public function getSourceInstance() + { + return isset($this->source_instance) ? $this->source_instance : ''; + } + + public function hasSourceInstance() + { + return isset($this->source_instance); + } + + public function clearSourceInstance() + { + unset($this->source_instance); + } + + /** + * The source instance used to create the template. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instances/instance - projects/project/zones/zone/instances/instance + * + * Generated from protobuf field optional string source_instance = 396315705; + * @param string $var + * @return $this + */ + public function setSourceInstance($var) + { + GPBUtil::checkString($var, True); + $this->source_instance = $var; + + return $this; + } + + /** + * The source instance params to use to create this instance template. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SourceInstanceParams source_instance_params = 135342156; + * @return \Google\Cloud\Compute\V1\SourceInstanceParams|null + */ + public function getSourceInstanceParams() + { + return $this->source_instance_params; + } + + public function hasSourceInstanceParams() + { + return isset($this->source_instance_params); + } + + public function clearSourceInstanceParams() + { + unset($this->source_instance_params); + } + + /** + * The source instance params to use to create this instance template. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SourceInstanceParams source_instance_params = 135342156; + * @param \Google\Cloud\Compute\V1\SourceInstanceParams $var + * @return $this + */ + public function setSourceInstanceParams($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SourceInstanceParams::class); + $this->source_instance_params = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceTemplateAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceTemplateAggregatedList.php new file mode 100644 index 000000000000..bbbfb5b50cd6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/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; + */ + protected $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; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceTemplateList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceTemplateList.php new file mode 100644 index 000000000000..1a3a3290d408 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceTemplateList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.InstanceTemplateList + */ +class InstanceTemplateList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of InstanceTemplate resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceTemplate items = 100526016; + */ + private $items; + /** + * [Output Only] The resource type, which is always compute#instanceTemplatesListResponse for instance template lists. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\InstanceTemplate>|\Google\Protobuf\Internal\RepeatedField $items + * A list of InstanceTemplate resources. + * @type string $kind + * [Output Only] The resource type, which is always compute#instanceTemplatesListResponse for instance template lists. + * @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 InstanceTemplate resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceTemplate items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of InstanceTemplate resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceTemplate items = 100526016; + * @param array<\Google\Cloud\Compute\V1\InstanceTemplate>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstanceTemplate::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] The resource type, which is always compute#instanceTemplatesListResponse for instance template lists. + * + * 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); + } + + /** + * [Output Only] The resource type, which is always compute#instanceTemplatesListResponse for instance template lists. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceTemplatesScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceTemplatesScopedList.php new file mode 100644 index 000000000000..9132fac57213 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/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; + */ + protected $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceWithNamedPorts.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceWithNamedPorts.php new file mode 100644 index 000000000000..11f0b3b92626 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceWithNamedPorts.php @@ -0,0 +1,158 @@ +google.cloud.compute.v1.InstanceWithNamedPorts + */ +class InstanceWithNamedPorts extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The URL of the instance. + * + * Generated from protobuf field optional string instance = 18257045; + */ + protected $instance = null; + /** + * [Output Only] The named ports that belong to this instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NamedPort named_ports = 427598732; + */ + private $named_ports; + /** + * [Output Only] The status of the instance. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * [Output Only] The URL of the instance. + * @type array<\Google\Cloud\Compute\V1\NamedPort>|\Google\Protobuf\Internal\RepeatedField $named_ports + * [Output Only] The named ports that belong to this instance group. + * @type string $status + * [Output Only] The status of the instance. + * Check the Status enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The URL of the instance. + * + * Generated from protobuf field optional string instance = 18257045; + * @return string + */ + public function getInstance() + { + return isset($this->instance) ? $this->instance : ''; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * [Output Only] The URL of the instance. + * + * Generated from protobuf field optional string instance = 18257045; + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + + /** + * [Output Only] The named ports that belong to this instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NamedPort named_ports = 427598732; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNamedPorts() + { + return $this->named_ports; + } + + /** + * [Output Only] The named ports that belong to this instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NamedPort named_ports = 427598732; + * @param array<\Google\Cloud\Compute\V1\NamedPort>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNamedPorts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NamedPort::class); + $this->named_ports = $arr; + + return $this; + } + + /** + * [Output Only] The status of the instance. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] The status of the instance. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceWithNamedPorts/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceWithNamedPorts/Status.php new file mode 100644 index 000000000000..15a0b586e799 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceWithNamedPorts/Status.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.InstanceWithNamedPorts.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * The instance is halted and we are performing tear down tasks like network deprogramming, releasing quota, IP, tearing down disks etc. + * + * Generated from protobuf enum DEPROVISIONING = 428935662; + */ + const DEPROVISIONING = 428935662; + /** + * Resources are being allocated for the instance. + * + * Generated from protobuf enum PROVISIONING = 290896621; + */ + const PROVISIONING = 290896621; + /** + * The instance is in repair. + * + * Generated from protobuf enum REPAIRING = 413483285; + */ + const REPAIRING = 413483285; + /** + * The instance is running. + * + * Generated from protobuf enum RUNNING = 121282975; + */ + const RUNNING = 121282975; + /** + * All required resources have been allocated and the instance is being started. + * + * Generated from protobuf enum STAGING = 431072283; + */ + const STAGING = 431072283; + /** + * The instance has stopped successfully. + * + * Generated from protobuf enum STOPPED = 444276141; + */ + const STOPPED = 444276141; + /** + * The instance is currently stopping (either being deleted or killed). + * + * Generated from protobuf enum STOPPING = 350791796; + */ + const STOPPING = 350791796; + /** + * The instance has suspended. + * + * Generated from protobuf enum SUSPENDED = 51223995; + */ + const SUSPENDED = 51223995; + /** + * The instance is suspending. + * + * Generated from protobuf enum SUSPENDING = 514206246; + */ + const SUSPENDING = 514206246; + /** + * The instance has stopped (either by explicit action or underlying failure). + * + * Generated from protobuf enum TERMINATED = 250018339; + */ + const TERMINATED = 250018339; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::DEPROVISIONING => 'DEPROVISIONING', + self::PROVISIONING => 'PROVISIONING', + self::REPAIRING => 'REPAIRING', + self::RUNNING => 'RUNNING', + self::STAGING => 'STAGING', + self::STOPPED => 'STOPPED', + self::STOPPING => 'STOPPING', + self::SUSPENDED => 'SUSPENDED', + self::SUSPENDING => 'SUSPENDING', + self::TERMINATED => 'TERMINATED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\InstanceWithNamedPorts_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesAddResourcePoliciesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesAddResourcePoliciesRequest.php new file mode 100644 index 000000000000..dbab597c0535 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesAddResourcePoliciesRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.InstancesAddResourcePoliciesRequest + */ +class InstancesAddResourcePoliciesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Resource policies to be added to this instance. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + */ + private $resource_policies; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $resource_policies + * Resource policies to be added to this instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Resource policies to be added to this instance. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourcePolicies() + { + return $this->resource_policies; + } + + /** + * Resource policies to be added to this instance. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourcePolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_policies = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesBulkInsertOperationMetadata.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesBulkInsertOperationMetadata.php new file mode 100644 index 000000000000..9a6ed6446704 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesBulkInsertOperationMetadata.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.InstancesBulkInsertOperationMetadata + */ +class InstancesBulkInsertOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Status information per location (location name is key). Example key: zones/us-central1-a + * + * Generated from protobuf field map per_location_status = 167851162; + */ + private $per_location_status; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $per_location_status + * Status information per location (location name is key). Example key: zones/us-central1-a + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Status information per location (location name is key). Example key: zones/us-central1-a + * + * Generated from protobuf field map per_location_status = 167851162; + * @return \Google\Protobuf\Internal\MapField + */ + public function getPerLocationStatus() + { + return $this->per_location_status; + } + + /** + * Status information per location (location name is key). Example key: zones/us-central1-a + * + * Generated from protobuf field map per_location_status = 167851162; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setPerLocationStatus($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\BulkInsertOperationStatus::class); + $this->per_location_status = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesGetEffectiveFirewallsResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesGetEffectiveFirewallsResponse.php new file mode 100644 index 000000000000..b564751eab7a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesGetEffectiveFirewallsResponse.php @@ -0,0 +1,100 @@ +google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse + */ +class InstancesGetEffectiveFirewallsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Effective firewalls from firewall policies. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy firewall_policys = 410985794; + */ + private $firewall_policys; + /** + * Effective firewalls on the instance. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Firewall firewalls = 272245619; + */ + private $firewalls; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy>|\Google\Protobuf\Internal\RepeatedField $firewall_policys + * Effective firewalls from firewall policies. + * @type array<\Google\Cloud\Compute\V1\Firewall>|\Google\Protobuf\Internal\RepeatedField $firewalls + * Effective firewalls on the instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Effective firewalls from firewall policies. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy firewall_policys = 410985794; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFirewallPolicys() + { + return $this->firewall_policys; + } + + /** + * Effective firewalls from firewall policies. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy firewall_policys = 410985794; + * @param array<\Google\Cloud\Compute\V1\InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFirewallPolicys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy::class); + $this->firewall_policys = $arr; + + return $this; + } + + /** + * Effective firewalls on the instance. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Firewall firewalls = 272245619; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFirewalls() + { + return $this->firewalls; + } + + /** + * Effective firewalls on the instance. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Firewall firewalls = 272245619; + * @param array<\Google\Cloud\Compute\V1\Firewall>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFirewalls($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Firewall::class); + $this->firewalls = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.php new file mode 100644 index 000000000000..23bcbf177925 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.php @@ -0,0 +1,246 @@ +google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + */ +class InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Deprecated, please use short name instead. The display name of the firewall policy. + * + * Generated from protobuf field optional string display_name = 4473832; + */ + protected $display_name = null; + /** + * [Output Only] The name of the firewall policy. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * The rules that apply to the network. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyRule rules = 108873975; + */ + private $rules; + /** + * [Output Only] The short name of the firewall policy. + * + * Generated from protobuf field optional string short_name = 492051566; + */ + protected $short_name = null; + /** + * [Output Only] The type of the firewall policy. Can be one of HIERARCHY, NETWORK, NETWORK_REGIONAL, SYSTEM_GLOBAL, SYSTEM_REGIONAL. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * [Output Only] Deprecated, please use short name instead. The display name of the firewall policy. + * @type string $name + * [Output Only] The name of the firewall policy. + * @type array<\Google\Cloud\Compute\V1\FirewallPolicyRule>|\Google\Protobuf\Internal\RepeatedField $rules + * The rules that apply to the network. + * @type string $short_name + * [Output Only] The short name of the firewall policy. + * @type string $type + * [Output Only] The type of the firewall policy. Can be one of HIERARCHY, NETWORK, NETWORK_REGIONAL, SYSTEM_GLOBAL, SYSTEM_REGIONAL. + * Check the Type enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Deprecated, please use short name instead. The display name of the firewall policy. + * + * Generated from protobuf field optional string display_name = 4473832; + * @return string + */ + public function getDisplayName() + { + return isset($this->display_name) ? $this->display_name : ''; + } + + public function hasDisplayName() + { + return isset($this->display_name); + } + + public function clearDisplayName() + { + unset($this->display_name); + } + + /** + * [Output Only] Deprecated, please use short name instead. The display name of the firewall policy. + * + * Generated from protobuf field optional string display_name = 4473832; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * [Output Only] The name of the firewall policy. + * + * 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); + } + + /** + * [Output Only] The name of the firewall policy. + * + * 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; + } + + /** + * The rules that apply to the network. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyRule rules = 108873975; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * The rules that apply to the network. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyRule rules = 108873975; + * @param array<\Google\Cloud\Compute\V1\FirewallPolicyRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\FirewallPolicyRule::class); + $this->rules = $arr; + + return $this; + } + + /** + * [Output Only] The short name of the firewall policy. + * + * Generated from protobuf field optional string short_name = 492051566; + * @return string + */ + public function getShortName() + { + return isset($this->short_name) ? $this->short_name : ''; + } + + public function hasShortName() + { + return isset($this->short_name); + } + + public function clearShortName() + { + unset($this->short_name); + } + + /** + * [Output Only] The short name of the firewall policy. + * + * Generated from protobuf field optional string short_name = 492051566; + * @param string $var + * @return $this + */ + public function setShortName($var) + { + GPBUtil::checkString($var, True); + $this->short_name = $var; + + return $this; + } + + /** + * [Output Only] The type of the firewall policy. Can be one of HIERARCHY, NETWORK, NETWORK_REGIONAL, SYSTEM_GLOBAL, SYSTEM_REGIONAL. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * [Output Only] The type of the firewall policy. Can be one of HIERARCHY, NETWORK, NETWORK_REGIONAL, SYSTEM_GLOBAL, SYSTEM_REGIONAL. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy/Type.php new file mode 100644 index 000000000000..ef99b2c489d1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy/Type.php @@ -0,0 +1,70 @@ +google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.Type + */ +class Type +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TYPE = 0; + */ + const UNDEFINED_TYPE = 0; + /** + * Generated from protobuf enum HIERARCHY = 69902869; + */ + const HIERARCHY = 69902869; + /** + * Generated from protobuf enum NETWORK = 413984270; + */ + const NETWORK = 413984270; + /** + * Generated from protobuf enum NETWORK_REGIONAL = 190804272; + */ + const NETWORK_REGIONAL = 190804272; + /** + * Generated from protobuf enum UNSPECIFIED = 526786327; + */ + const UNSPECIFIED = 526786327; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::HIERARCHY => 'HIERARCHY', + self::NETWORK => 'NETWORK', + self::NETWORK_REGIONAL => 'NETWORK_REGIONAL', + self::UNSPECIFIED => 'UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Compute\V1\InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy_Type::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesRemoveResourcePoliciesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesRemoveResourcePoliciesRequest.php new file mode 100644 index 000000000000..c223d8fb8495 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesRemoveResourcePoliciesRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest + */ +class InstancesRemoveResourcePoliciesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Resource policies to be removed from this instance. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + */ + private $resource_policies; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $resource_policies + * Resource policies to be removed from this instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Resource policies to be removed from this instance. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourcePolicies() + { + return $this->resource_policies; + } + + /** + * Resource policies to be removed from this instance. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourcePolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_policies = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesScopedList.php new file mode 100644 index 000000000000..a2f5a40b3883 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.InstancesScopedList + */ +class InstancesScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A list of instances contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Instance instances = 29097598; + */ + private $instances; + /** + * [Output Only] Informational warning which replaces the list of instances when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\Instance>|\Google\Protobuf\Internal\RepeatedField $instances + * [Output Only] A list of instances contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] Informational warning which replaces the list of instances 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 instances contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Instance instances = 29097598; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * [Output Only] A list of instances contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Instance instances = 29097598; + * @param array<\Google\Cloud\Compute\V1\Instance>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Instance::class); + $this->instances = $arr; + + return $this; + } + + /** + * [Output Only] Informational warning which replaces the list of instances 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] Informational warning which replaces the list of instances 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetLabelsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetLabelsRequest.php new file mode 100644 index 000000000000..a5234e76d34c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetLabelsRequest.php @@ -0,0 +1,103 @@ +google.cloud.compute.v1.InstancesSetLabelsRequest + */ +class InstancesSetLabelsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Fingerprint of the previous set of labels for this resource, used to prevent conflicts. Provide the latest fingerprint value when making a request to add or change labels. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + */ + protected $label_fingerprint = null; + /** + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $label_fingerprint + * Fingerprint of the previous set of labels for this resource, used to prevent conflicts. Provide the latest fingerprint value when making a request to add or change labels. + * @type array|\Google\Protobuf\Internal\MapField $labels + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Fingerprint of the previous set of labels for this resource, used to prevent conflicts. Provide the latest fingerprint value when making a request to add or change labels. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @return string + */ + public function getLabelFingerprint() + { + return isset($this->label_fingerprint) ? $this->label_fingerprint : ''; + } + + public function hasLabelFingerprint() + { + return isset($this->label_fingerprint); + } + + public function clearLabelFingerprint() + { + unset($this->label_fingerprint); + } + + /** + * Fingerprint of the previous set of labels for this resource, used to prevent conflicts. Provide the latest fingerprint value when making a request to add or change labels. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @param string $var + * @return $this + */ + public function setLabelFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->label_fingerprint = $var; + + return $this; + } + + /** + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetMachineResourcesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetMachineResourcesRequest.php new file mode 100644 index 000000000000..5a232374b252 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetMachineResourcesRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.InstancesSetMachineResourcesRequest + */ +class InstancesSetMachineResourcesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * A list of the type and count of accelerator cards attached to the instance. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig guest_accelerators = 463595119; + */ + private $guest_accelerators; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $guest_accelerators + * A list of the type and count of accelerator cards attached to the instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of the type and count of accelerator cards attached to the instance. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig guest_accelerators = 463595119; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGuestAccelerators() + { + return $this->guest_accelerators; + } + + /** + * A list of the type and count of accelerator cards attached to the instance. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig guest_accelerators = 463595119; + * @param array<\Google\Cloud\Compute\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGuestAccelerators($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AcceleratorConfig::class); + $this->guest_accelerators = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetMachineTypeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetMachineTypeRequest.php new file mode 100644 index 000000000000..2822a3c93e1a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetMachineTypeRequest.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.InstancesSetMachineTypeRequest + */ +class InstancesSetMachineTypeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Full or partial URL of the machine type resource. See Machine Types for a full list of machine types. For example: zones/us-central1-f/machineTypes/n1-standard-1 + * + * Generated from protobuf field optional string machine_type = 227711026; + */ + protected $machine_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $machine_type + * Full or partial URL of the machine type resource. See Machine Types for a full list of machine types. For example: zones/us-central1-f/machineTypes/n1-standard-1 + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Full or partial URL of the machine type resource. See Machine Types for a full list of machine types. For example: zones/us-central1-f/machineTypes/n1-standard-1 + * + * Generated from protobuf field optional string machine_type = 227711026; + * @return string + */ + public function getMachineType() + { + return isset($this->machine_type) ? $this->machine_type : ''; + } + + public function hasMachineType() + { + return isset($this->machine_type); + } + + public function clearMachineType() + { + unset($this->machine_type); + } + + /** + * Full or partial URL of the machine type resource. See Machine Types for a full list of machine types. For example: zones/us-central1-f/machineTypes/n1-standard-1 + * + * Generated from protobuf field optional string machine_type = 227711026; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetMinCpuPlatformRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetMinCpuPlatformRequest.php new file mode 100644 index 000000000000..d77cdb457a32 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetMinCpuPlatformRequest.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest + */ +class InstancesSetMinCpuPlatformRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Minimum cpu/platform this instance should be started at. + * + * Generated from protobuf field optional string min_cpu_platform = 242912759; + */ + protected $min_cpu_platform = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $min_cpu_platform + * Minimum cpu/platform this instance should be started at. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Minimum cpu/platform this instance should be started at. + * + * Generated from protobuf field optional string min_cpu_platform = 242912759; + * @return string + */ + public function getMinCpuPlatform() + { + return isset($this->min_cpu_platform) ? $this->min_cpu_platform : ''; + } + + public function hasMinCpuPlatform() + { + return isset($this->min_cpu_platform); + } + + public function clearMinCpuPlatform() + { + unset($this->min_cpu_platform); + } + + /** + * Minimum cpu/platform this instance should be started at. + * + * Generated from protobuf field optional string min_cpu_platform = 242912759; + * @param string $var + * @return $this + */ + public function setMinCpuPlatform($var) + { + GPBUtil::checkString($var, True); + $this->min_cpu_platform = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetNameRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetNameRequest.php new file mode 100644 index 000000000000..01ab2162aac7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/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; + */ + protected $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; + */ + protected $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetSecurityPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetSecurityPolicyRequest.php new file mode 100644 index 000000000000..0b5d5059a2cd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetSecurityPolicyRequest.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.InstancesSetSecurityPolicyRequest + */ +class InstancesSetSecurityPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The network interfaces that the security policy will be applied to. Network interfaces use the nicN naming format. You can only set a security policy for network interfaces with an access config. + * + * Generated from protobuf field repeated string network_interfaces = 52735243; + */ + private $network_interfaces; + /** + * A full or partial URL to a security policy to add to this instance. If this field is set to an empty string it will remove the associated security policy. + * + * Generated from protobuf field optional string security_policy = 171082513; + */ + protected $security_policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $network_interfaces + * The network interfaces that the security policy will be applied to. Network interfaces use the nicN naming format. You can only set a security policy for network interfaces with an access config. + * @type string $security_policy + * A full or partial URL to a security policy to add to this instance. If this field is set to an empty string it will remove the associated security policy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The network interfaces that the security policy will be applied to. Network interfaces use the nicN naming format. You can only set a security policy for network interfaces with an access config. + * + * Generated from protobuf field repeated string network_interfaces = 52735243; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkInterfaces() + { + return $this->network_interfaces; + } + + /** + * The network interfaces that the security policy will be applied to. Network interfaces use the nicN naming format. You can only set a security policy for network interfaces with an access config. + * + * Generated from protobuf field repeated string network_interfaces = 52735243; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkInterfaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->network_interfaces = $arr; + + return $this; + } + + /** + * A full or partial URL to a security policy to add to this instance. If this field is set to an empty string it will remove the associated security policy. + * + * Generated from protobuf field optional string security_policy = 171082513; + * @return string + */ + public function getSecurityPolicy() + { + return isset($this->security_policy) ? $this->security_policy : ''; + } + + public function hasSecurityPolicy() + { + return isset($this->security_policy); + } + + public function clearSecurityPolicy() + { + unset($this->security_policy); + } + + /** + * A full or partial URL to a security policy to add to this instance. If this field is set to an empty string it will remove the associated security policy. + * + * Generated from protobuf field optional string security_policy = 171082513; + * @param string $var + * @return $this + */ + public function setSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->security_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetServiceAccountRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetServiceAccountRequest.php new file mode 100644 index 000000000000..eebe32ac0adc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesSetServiceAccountRequest.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.InstancesSetServiceAccountRequest + */ +class InstancesSetServiceAccountRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Email address of the service account. + * + * Generated from protobuf field optional string email = 96619420; + */ + protected $email = null; + /** + * The list of scopes to be made available for this service account. + * + * Generated from protobuf field repeated string scopes = 165973151; + */ + private $scopes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $email + * Email address of the service account. + * @type array|\Google\Protobuf\Internal\RepeatedField $scopes + * The list of scopes to be made available for this service account. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Email address of the service account. + * + * Generated from protobuf field optional string email = 96619420; + * @return string + */ + public function getEmail() + { + return isset($this->email) ? $this->email : ''; + } + + public function hasEmail() + { + return isset($this->email); + } + + public function clearEmail() + { + unset($this->email); + } + + /** + * Email address of the service account. + * + * Generated from protobuf field optional string email = 96619420; + * @param string $var + * @return $this + */ + public function setEmail($var) + { + GPBUtil::checkString($var, True); + $this->email = $var; + + return $this; + } + + /** + * The list of scopes to be made available for this service account. + * + * Generated from protobuf field repeated string scopes = 165973151; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getScopes() + { + return $this->scopes; + } + + /** + * The list of scopes to be made available for this service account. + * + * Generated from protobuf field repeated string scopes = 165973151; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScopes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->scopes = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesStartWithEncryptionKeyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesStartWithEncryptionKeyRequest.php new file mode 100644 index 000000000000..c4d11b251c8e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesStartWithEncryptionKeyRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest + */ +class InstancesStartWithEncryptionKeyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Array of disks associated with this instance that are protected with a customer-supplied encryption key. In order to start the instance, the disk url and its corresponding key must be provided. If the disk is not protected with a customer-supplied encryption key it should not be specified. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk disks = 95594102; + */ + private $disks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\CustomerEncryptionKeyProtectedDisk>|\Google\Protobuf\Internal\RepeatedField $disks + * Array of disks associated with this instance that are protected with a customer-supplied encryption key. In order to start the instance, the disk url and its corresponding key must be provided. If the disk is not protected with a customer-supplied encryption key it should not be specified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Array of disks associated with this instance that are protected with a customer-supplied encryption key. In order to start the instance, the disk url and its corresponding key must be provided. If the disk is not protected with a customer-supplied encryption key it should not be specified. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk disks = 95594102; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisks() + { + return $this->disks; + } + + /** + * Array of disks associated with this instance that are protected with a customer-supplied encryption key. In order to start the instance, the disk url and its corresponding key must be provided. If the disk is not protected with a customer-supplied encryption key it should not be specified. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk disks = 95594102; + * @param array<\Google\Cloud\Compute\V1\CustomerEncryptionKeyProtectedDisk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\CustomerEncryptionKeyProtectedDisk::class); + $this->disks = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshot.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshot.php new file mode 100644 index 000000000000..97f6d89a6024 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshot.php @@ -0,0 +1,867 @@ +google.cloud.compute.v1.InstantSnapshot + */ +class InstantSnapshot extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The architecture of the instant snapshot. Valid values are ARM64 or X86_64. + * Check the Architecture enum for the list of possible values. + * + * Generated from protobuf field optional string architecture = 302803283; + */ + protected $architecture = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] Size of the source disk, specified in GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 316263735; + */ + protected $disk_size_gb = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#instantSnapshot for InstantSnapshot resources. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * A fingerprint for the labels being applied to this InstantSnapshot, 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 InstantSnapshot. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + */ + protected $label_fingerprint = null; + /** + * Labels to apply to this InstantSnapshot. These can be later modified by the setLabels method. Label values may be empty. + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] URL of the region where the instant snapshot resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Status information for the instant snapshot resource. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstantSnapshotResourceStatus resource_status = 249429315; + */ + protected $resource_status = null; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzi = 480964257; + */ + protected $satisfies_pzi = null; + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + */ + protected $satisfies_pzs = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Server-defined URL for this resource's resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + */ + protected $self_link_with_id = null; + /** + * URL of the source disk used to create this instant snapshot. Note that the source disk must be in the same zone/region as the instant snapshot to be created. This can be a full or valid partial URL. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - https://www.googleapis.com/compute/v1/projects/project/regions/region /disks/disk - projects/project/zones/zone/disks/disk - projects/project/regions/region/disks/disk - zones/zone/disks/disk - regions/region/disks/disk + * + * Generated from protobuf field optional string source_disk = 451753793; + */ + protected $source_disk = null; + /** + * [Output Only] The ID value of the disk used to create this InstantSnapshot. This value may be used to determine whether the InstantSnapshot was taken from the current or a previous instance of a given disk name. + * + * Generated from protobuf field optional string source_disk_id = 454190809; + */ + protected $source_disk_id = null; + /** + * [Output Only] The status of the instantSnapshot. This can be CREATING, DELETING, FAILED, or READY. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + /** + * [Output Only] URL of the zone where the instant snapshot resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + */ + protected $zone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $architecture + * [Output Only] The architecture of the instant snapshot. Valid values are ARM64 or X86_64. + * Check the Architecture enum for the list of possible values. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type int|string $disk_size_gb + * [Output Only] Size of the source disk, specified in GB. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of the resource. Always compute#instantSnapshot for InstantSnapshot resources. + * @type string $label_fingerprint + * A fingerprint for the labels being applied to this InstantSnapshot, 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 InstantSnapshot. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels to apply to this InstantSnapshot. These can be later modified by the setLabels method. Label values may be empty. + * @type string $name + * 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 string $region + * [Output Only] URL of the region where the instant snapshot resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * @type \Google\Cloud\Compute\V1\InstantSnapshotResourceStatus $resource_status + * [Output Only] Status information for the instant snapshot resource. + * @type bool $satisfies_pzi + * Output only. Reserved for future use. + * @type bool $satisfies_pzs + * [Output Only] Reserved for future use. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $self_link_with_id + * [Output Only] Server-defined URL for this resource's resource id. + * @type string $source_disk + * URL of the source disk used to create this instant snapshot. Note that the source disk must be in the same zone/region as the instant snapshot to be created. This can be a full or valid partial URL. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - https://www.googleapis.com/compute/v1/projects/project/regions/region /disks/disk - projects/project/zones/zone/disks/disk - projects/project/regions/region/disks/disk - zones/zone/disks/disk - regions/region/disks/disk + * @type string $source_disk_id + * [Output Only] The ID value of the disk used to create this InstantSnapshot. This value may be used to determine whether the InstantSnapshot was taken from the current or a previous instance of a given disk name. + * @type string $status + * [Output Only] The status of the instantSnapshot. This can be CREATING, DELETING, FAILED, or READY. + * Check the Status enum for the list of possible values. + * @type string $zone + * [Output Only] URL of the zone where the instant snapshot resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The architecture of the instant snapshot. Valid values are ARM64 or X86_64. + * Check the Architecture enum for the list of possible values. + * + * Generated from protobuf field optional string architecture = 302803283; + * @return string + */ + public function getArchitecture() + { + return isset($this->architecture) ? $this->architecture : ''; + } + + public function hasArchitecture() + { + return isset($this->architecture); + } + + public function clearArchitecture() + { + unset($this->architecture); + } + + /** + * [Output Only] The architecture of the instant snapshot. Valid values are ARM64 or X86_64. + * Check the Architecture enum for the list of possible values. + * + * Generated from protobuf field optional string architecture = 302803283; + * @param string $var + * @return $this + */ + public function setArchitecture($var) + { + GPBUtil::checkString($var, True); + $this->architecture = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] Size of the source disk, specified in GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 316263735; + * @return int|string + */ + public function getDiskSizeGb() + { + return isset($this->disk_size_gb) ? $this->disk_size_gb : 0; + } + + public function hasDiskSizeGb() + { + return isset($this->disk_size_gb); + } + + public function clearDiskSizeGb() + { + unset($this->disk_size_gb); + } + + /** + * [Output Only] Size of the source disk, specified in GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 316263735; + * @param int|string $var + * @return $this + */ + public function setDiskSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->disk_size_gb = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#instantSnapshot for InstantSnapshot resources. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#instantSnapshot for InstantSnapshot resources. + * + * 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; + } + + /** + * A fingerprint for the labels being applied to this InstantSnapshot, 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 InstantSnapshot. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @return string + */ + public function getLabelFingerprint() + { + return isset($this->label_fingerprint) ? $this->label_fingerprint : ''; + } + + public function hasLabelFingerprint() + { + return isset($this->label_fingerprint); + } + + public function clearLabelFingerprint() + { + unset($this->label_fingerprint); + } + + /** + * A fingerprint for the labels being applied to this InstantSnapshot, 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 InstantSnapshot. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @param string $var + * @return $this + */ + public function setLabelFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->label_fingerprint = $var; + + return $this; + } + + /** + * Labels to apply to this InstantSnapshot. These can be later modified by the setLabels method. Label values may be empty. + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels to apply to this InstantSnapshot. These can be later modified by the setLabels method. Label values may be empty. + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * [Output Only] URL of the region where the instant snapshot resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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 instant snapshot resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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] Status information for the instant snapshot resource. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstantSnapshotResourceStatus resource_status = 249429315; + * @return \Google\Cloud\Compute\V1\InstantSnapshotResourceStatus|null + */ + public function getResourceStatus() + { + return $this->resource_status; + } + + public function hasResourceStatus() + { + return isset($this->resource_status); + } + + public function clearResourceStatus() + { + unset($this->resource_status); + } + + /** + * [Output Only] Status information for the instant snapshot resource. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstantSnapshotResourceStatus resource_status = 249429315; + * @param \Google\Cloud\Compute\V1\InstantSnapshotResourceStatus $var + * @return $this + */ + public function setResourceStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstantSnapshotResourceStatus::class); + $this->resource_status = $var; + + return $this; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzi = 480964257; + * @return bool + */ + public function getSatisfiesPzi() + { + return isset($this->satisfies_pzi) ? $this->satisfies_pzi : false; + } + + public function hasSatisfiesPzi() + { + return isset($this->satisfies_pzi); + } + + public function clearSatisfiesPzi() + { + unset($this->satisfies_pzi); + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzi = 480964257; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + * @return bool + */ + public function getSatisfiesPzs() + { + return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; + } + + public function hasSatisfiesPzs() + { + return isset($this->satisfies_pzs); + } + + public function clearSatisfiesPzs() + { + unset($this->satisfies_pzs); + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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] Server-defined URL for this resource's resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + * @return string + */ + public function getSelfLinkWithId() + { + return isset($this->self_link_with_id) ? $this->self_link_with_id : ''; + } + + public function hasSelfLinkWithId() + { + return isset($this->self_link_with_id); + } + + public function clearSelfLinkWithId() + { + unset($this->self_link_with_id); + } + + /** + * [Output Only] Server-defined URL for this resource's resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + * @param string $var + * @return $this + */ + public function setSelfLinkWithId($var) + { + GPBUtil::checkString($var, True); + $this->self_link_with_id = $var; + + return $this; + } + + /** + * URL of the source disk used to create this instant snapshot. Note that the source disk must be in the same zone/region as the instant snapshot to be created. This can be a full or valid partial URL. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - https://www.googleapis.com/compute/v1/projects/project/regions/region /disks/disk - projects/project/zones/zone/disks/disk - projects/project/regions/region/disks/disk - zones/zone/disks/disk - regions/region/disks/disk + * + * Generated from protobuf field optional string source_disk = 451753793; + * @return string + */ + public function getSourceDisk() + { + return isset($this->source_disk) ? $this->source_disk : ''; + } + + public function hasSourceDisk() + { + return isset($this->source_disk); + } + + public function clearSourceDisk() + { + unset($this->source_disk); + } + + /** + * URL of the source disk used to create this instant snapshot. Note that the source disk must be in the same zone/region as the instant snapshot to be created. This can be a full or valid partial URL. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - https://www.googleapis.com/compute/v1/projects/project/regions/region /disks/disk - projects/project/zones/zone/disks/disk - projects/project/regions/region/disks/disk - zones/zone/disks/disk - regions/region/disks/disk + * + * Generated from protobuf field optional string source_disk = 451753793; + * @param string $var + * @return $this + */ + public function setSourceDisk($var) + { + GPBUtil::checkString($var, True); + $this->source_disk = $var; + + return $this; + } + + /** + * [Output Only] The ID value of the disk used to create this InstantSnapshot. This value may be used to determine whether the InstantSnapshot was taken from the current or a previous instance of a given disk name. + * + * Generated from protobuf field optional string source_disk_id = 454190809; + * @return string + */ + public function getSourceDiskId() + { + return isset($this->source_disk_id) ? $this->source_disk_id : ''; + } + + public function hasSourceDiskId() + { + return isset($this->source_disk_id); + } + + public function clearSourceDiskId() + { + unset($this->source_disk_id); + } + + /** + * [Output Only] The ID value of the disk used to create this InstantSnapshot. This value may be used to determine whether the InstantSnapshot was taken from the current or a previous instance of a given disk name. + * + * Generated from protobuf field optional string source_disk_id = 454190809; + * @param string $var + * @return $this + */ + public function setSourceDiskId($var) + { + GPBUtil::checkString($var, True); + $this->source_disk_id = $var; + + return $this; + } + + /** + * [Output Only] The status of the instantSnapshot. This can be CREATING, DELETING, FAILED, or READY. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] The status of the instantSnapshot. This can be CREATING, DELETING, FAILED, or READY. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + + /** + * [Output Only] URL of the zone where the instant snapshot resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + * @return string + */ + public function getZone() + { + return isset($this->zone) ? $this->zone : ''; + } + + public function hasZone() + { + return isset($this->zone); + } + + public function clearZone() + { + unset($this->zone); + } + + /** + * [Output Only] URL of the zone where the instant snapshot resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshot/Architecture.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshot/Architecture.php new file mode 100644 index 000000000000..1c1870ee51ea --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshot/Architecture.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.InstantSnapshot.Architecture + */ +class Architecture +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ARCHITECTURE = 0; + */ + const UNDEFINED_ARCHITECTURE = 0; + /** + * Default value indicating Architecture is not set. + * + * Generated from protobuf enum ARCHITECTURE_UNSPECIFIED = 394750507; + */ + const ARCHITECTURE_UNSPECIFIED = 394750507; + /** + * Machines with architecture ARM64 + * + * Generated from protobuf enum ARM64 = 62547450; + */ + const ARM64 = 62547450; + /** + * Machines with architecture X86_64 + * + * Generated from protobuf enum X86_64 = 425300551; + */ + const X86_64 = 425300551; + + private static $valueToName = [ + self::UNDEFINED_ARCHITECTURE => 'UNDEFINED_ARCHITECTURE', + self::ARCHITECTURE_UNSPECIFIED => 'ARCHITECTURE_UNSPECIFIED', + self::ARM64 => 'ARM64', + self::X86_64 => 'X86_64', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Architecture::class, \Google\Cloud\Compute\V1\InstantSnapshot_Architecture::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshot/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshot/Status.php new file mode 100644 index 000000000000..1500951ff62d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshot/Status.php @@ -0,0 +1,85 @@ +google.cloud.compute.v1.InstantSnapshot.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * InstantSnapshot creation is in progress. + * + * Generated from protobuf enum CREATING = 455564985; + */ + const CREATING = 455564985; + /** + * InstantSnapshot is currently being deleted. + * + * Generated from protobuf enum DELETING = 528602024; + */ + const DELETING = 528602024; + /** + * InstantSnapshot creation failed. + * + * Generated from protobuf enum FAILED = 455706685; + */ + const FAILED = 455706685; + /** + * InstantSnapshot has been created successfully. + * + * Generated from protobuf enum READY = 77848963; + */ + const READY = 77848963; + /** + * InstantSnapshot is currently unavailable and cannot be used for Disk restoration + * + * Generated from protobuf enum UNAVAILABLE = 413756464; + */ + const UNAVAILABLE = 413756464; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::CREATING => 'CREATING', + self::DELETING => 'DELETING', + self::FAILED => 'FAILED', + self::READY => 'READY', + self::UNAVAILABLE => 'UNAVAILABLE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\InstantSnapshot_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshotAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshotAggregatedList.php new file mode 100644 index 000000000000..db61a03a105f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshotAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.InstantSnapshotAggregatedList + */ +class InstantSnapshotAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of InstantSnapshotsScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#instantSnapshotAggregatedList for aggregated lists of instantSnapshots. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 InstantSnapshotsScopedList resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#instantSnapshotAggregatedList for aggregated lists of instantSnapshots. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 InstantSnapshotsScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of InstantSnapshotsScopedList 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\InstantSnapshotsScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#instantSnapshotAggregatedList for aggregated lists of instantSnapshots. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#instantSnapshotAggregatedList for aggregated lists of instantSnapshots. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshotList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshotList.php new file mode 100644 index 000000000000..ad722c584591 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshotList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.InstantSnapshotList + */ +class InstantSnapshotList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of InstantSnapshot resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstantSnapshot items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\InstantSnapshot>|\Google\Protobuf\Internal\RepeatedField $items + * A list of InstantSnapshot 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 InstantSnapshot resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstantSnapshot items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of InstantSnapshot resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstantSnapshot items = 100526016; + * @param array<\Google\Cloud\Compute\V1\InstantSnapshot>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstantSnapshot::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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshotResourceStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshotResourceStatus.php new file mode 100644 index 000000000000..8b65d2602f27 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshotResourceStatus.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.InstantSnapshotResourceStatus + */ +class InstantSnapshotResourceStatus extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The storage size of this instant snapshot. + * + * Generated from protobuf field optional int64 storage_size_bytes = 387548913; + */ + protected $storage_size_bytes = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $storage_size_bytes + * [Output Only] The storage size of this instant snapshot. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The storage size of this instant snapshot. + * + * Generated from protobuf field optional int64 storage_size_bytes = 387548913; + * @return int|string + */ + public function getStorageSizeBytes() + { + return isset($this->storage_size_bytes) ? $this->storage_size_bytes : 0; + } + + public function hasStorageSizeBytes() + { + return isset($this->storage_size_bytes); + } + + public function clearStorageSizeBytes() + { + unset($this->storage_size_bytes); + } + + /** + * [Output Only] The storage size of this instant snapshot. + * + * Generated from protobuf field optional int64 storage_size_bytes = 387548913; + * @param int|string $var + * @return $this + */ + public function setStorageSizeBytes($var) + { + GPBUtil::checkInt64($var); + $this->storage_size_bytes = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshotsScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshotsScopedList.php new file mode 100644 index 000000000000..439d419892aa --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstantSnapshotsScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.InstantSnapshotsScopedList + */ +class InstantSnapshotsScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A list of instantSnapshots contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstantSnapshot instant_snapshots = 329637457; + */ + private $instant_snapshots; + /** + * [Output Only] Informational warning which replaces the list of instantSnapshots when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\InstantSnapshot>|\Google\Protobuf\Internal\RepeatedField $instant_snapshots + * [Output Only] A list of instantSnapshots contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] Informational warning which replaces the list of instantSnapshots 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 instantSnapshots contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstantSnapshot instant_snapshots = 329637457; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstantSnapshots() + { + return $this->instant_snapshots; + } + + /** + * [Output Only] A list of instantSnapshots contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstantSnapshot instant_snapshots = 329637457; + * @param array<\Google\Cloud\Compute\V1\InstantSnapshot>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstantSnapshots($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstantSnapshot::class); + $this->instant_snapshots = $arr; + + return $this; + } + + /** + * [Output Only] Informational warning which replaces the list of instantSnapshots 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] Informational warning which replaces the list of instantSnapshots 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Int64RangeMatch.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Int64RangeMatch.php new file mode 100644 index 000000000000..49448f2700c4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Int64RangeMatch.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.Int64RangeMatch + */ +class Int64RangeMatch extends \Google\Protobuf\Internal\Message +{ + /** + * The end of the range (exclusive) in signed long integer format. + * + * Generated from protobuf field optional int64 range_end = 322439897; + */ + protected $range_end = null; + /** + * The start of the range (inclusive) in signed long integer format. + * + * Generated from protobuf field optional int64 range_start = 103333600; + */ + protected $range_start = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $range_end + * The end of the range (exclusive) in signed long integer format. + * @type int|string $range_start + * The start of the range (inclusive) in signed long integer format. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The end of the range (exclusive) in signed long integer format. + * + * Generated from protobuf field optional int64 range_end = 322439897; + * @return int|string + */ + public function getRangeEnd() + { + return isset($this->range_end) ? $this->range_end : 0; + } + + public function hasRangeEnd() + { + return isset($this->range_end); + } + + public function clearRangeEnd() + { + unset($this->range_end); + } + + /** + * The end of the range (exclusive) in signed long integer format. + * + * Generated from protobuf field optional int64 range_end = 322439897; + * @param int|string $var + * @return $this + */ + public function setRangeEnd($var) + { + GPBUtil::checkInt64($var); + $this->range_end = $var; + + return $this; + } + + /** + * The start of the range (inclusive) in signed long integer format. + * + * Generated from protobuf field optional int64 range_start = 103333600; + * @return int|string + */ + public function getRangeStart() + { + return isset($this->range_start) ? $this->range_start : 0; + } + + public function hasRangeStart() + { + return isset($this->range_start); + } + + public function clearRangeStart() + { + unset($this->range_start); + } + + /** + * The start of the range (inclusive) in signed long integer format. + * + * Generated from protobuf field optional int64 range_start = 103333600; + * @param int|string $var + * @return $this + */ + public function setRangeStart($var) + { + GPBUtil::checkInt64($var); + $this->range_start = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect.php new file mode 100644 index 000000000000..7e4d0cfbae23 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect.php @@ -0,0 +1,1317 @@ +google.cloud.compute.v1.Interconnect + */ +class Interconnect extends \Google\Protobuf\Internal\Message +{ + /** + * Administrative status of the interconnect. When this is set to true, the Interconnect is functional and can carry traffic. When set to false, no packets can be carried over the interconnect and no BGP routes are exchanged over it. By default, the status is set to true. + * + * Generated from protobuf field optional bool admin_enabled = 445675089; + */ + protected $admin_enabled = null; + /** + * [Output only] List of features available for this Interconnect connection, which can take one of the following values: - MACSEC If present then the Interconnect connection is provisioned on MACsec capable hardware ports. If not present then the Interconnect connection is provisioned on non-MACsec capable ports and MACsec isn't supported and enabling MACsec fails. + * Check the AvailableFeatures enum for the list of possible values. + * + * Generated from protobuf field repeated string available_features = 496344307; + */ + private $available_features; + /** + * [Output Only] A list of CircuitInfo objects, that describe the individual circuits in this LAG. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectCircuitInfo circuit_infos = 164839855; + */ + private $circuit_infos; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * Customer name, to put in the Letter of Authorization as the party authorized to request a crossconnect. + * + * Generated from protobuf field optional string customer_name = 3665484; + */ + protected $customer_name = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] A list of outages expected for this Interconnect. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectOutageNotification expected_outages = 264484123; + */ + private $expected_outages; + /** + * [Output Only] IP address configured on the Google side of the Interconnect link. This can be used only for ping tests. + * + * Generated from protobuf field optional string google_ip_address = 443105954; + */ + protected $google_ip_address = null; + /** + * [Output Only] Google reference ID to be used when raising support tickets with Google or otherwise to debug backend connectivity issues. + * + * Generated from protobuf field optional string google_reference_id = 534944469; + */ + protected $google_reference_id = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] A list of the URLs of all InterconnectAttachments configured to use this Interconnect. + * + * Generated from protobuf field repeated string interconnect_attachments = 425388415; + */ + private $interconnect_attachments; + /** + * Type of interconnect, which can take one of the following values: - PARTNER: A partner-managed interconnection shared between customers though a partner. - DEDICATED: A dedicated physical interconnection with the customer. Note that a value IT_PRIVATE has been deprecated in favor of DEDICATED. + * Check the InterconnectType enum for the list of possible values. + * + * Generated from protobuf field optional string interconnect_type = 515165259; + */ + protected $interconnect_type = null; + /** + * [Output Only] Type of the resource. Always compute#interconnect for interconnects. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * A fingerprint for the labels being applied to this Interconnect, 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 Interconnect. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + */ + protected $label_fingerprint = null; + /** + * 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. + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + /** + * Type of link requested, which can take one of the following values: - LINK_TYPE_ETHERNET_10G_LR: A 10G Ethernet with LR optics - LINK_TYPE_ETHERNET_100G_LR: A 100G Ethernet with LR optics. Note that this field indicates the speed of each of the links in the bundle, not the speed of the entire bundle. + * Check the LinkType enum for the list of possible values. + * + * Generated from protobuf field optional string link_type = 523207775; + */ + protected $link_type = null; + /** + * URL of the InterconnectLocation object that represents where this connection is to be provisioned. + * + * Generated from protobuf field optional string location = 290430901; + */ + protected $location = null; + /** + * Configuration that enables Media Access Control security (MACsec) on the Cloud Interconnect connection between Google and your on-premises router. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectMacsec macsec = 528867490; + */ + protected $macsec = null; + /** + * Enable or disable MACsec on this Interconnect connection. MACsec enablement fails if the MACsec object is not specified. + * + * Generated from protobuf field optional bool macsec_enabled = 194203812; + */ + protected $macsec_enabled = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Email address to contact the customer NOC for operations and maintenance notifications regarding this Interconnect. If specified, this will be used for notifications in addition to all other forms described, such as Cloud Monitoring logs alerting and Cloud Notifications. This field is required for users who sign up for Cloud Interconnect using workforce identity federation. + * + * Generated from protobuf field optional string noc_contact_email = 14072832; + */ + protected $noc_contact_email = null; + /** + * [Output Only] The current status of this Interconnect's functionality, which can take one of the following values: - OS_ACTIVE: A valid Interconnect, which is turned up and is ready to use. Attachments may be provisioned on this Interconnect. - OS_UNPROVISIONED: An Interconnect that has not completed turnup. No attachments may be provisioned on this Interconnect. - OS_UNDER_MAINTENANCE: An Interconnect that is undergoing internal maintenance. No attachments may be provisioned or updated on this Interconnect. + * Check the OperationalStatus enum for the list of possible values. + * + * Generated from protobuf field optional string operational_status = 201070847; + */ + protected $operational_status = null; + /** + * [Output Only] IP address configured on the customer side of the Interconnect link. The customer should configure this IP address during turnup when prompted by Google NOC. This can be used only for ping tests. + * + * Generated from protobuf field optional string peer_ip_address = 207735769; + */ + protected $peer_ip_address = null; + /** + * [Output Only] Number of links actually provisioned in this interconnect. + * + * Generated from protobuf field optional int32 provisioned_link_count = 410888565; + */ + protected $provisioned_link_count = null; + /** + * Indicates that this is a Cross-Cloud Interconnect. This field specifies the location outside of Google's network that the interconnect is connected to. + * + * Generated from protobuf field optional string remote_location = 324388750; + */ + protected $remote_location = null; + /** + * Optional. List of features requested for this Interconnect connection, which can take one of the following values: - MACSEC If specified then the connection is created on MACsec capable hardware ports. If not specified, the default value is false, which allocates non-MACsec capable ports first if available. This parameter can be provided only with Interconnect INSERT. It isn't valid for Interconnect PATCH. + * Check the RequestedFeatures enum for the list of possible values. + * + * Generated from protobuf field repeated string requested_features = 461240814; + */ + private $requested_features; + /** + * Target number of physical links in the link bundle, as requested by the customer. + * + * Generated from protobuf field optional int32 requested_link_count = 45051387; + */ + protected $requested_link_count = null; + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + */ + protected $satisfies_pzs = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] The current state of Interconnect functionality, which can take one of the following values: - ACTIVE: The Interconnect is valid, turned up and ready to use. Attachments may be provisioned on this Interconnect. - UNPROVISIONED: The Interconnect has not completed turnup. No attachments may be provisioned on this Interconnect. - UNDER_MAINTENANCE: The Interconnect is undergoing internal maintenance. No attachments may be provisioned or updated on this Interconnect. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + */ + protected $state = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $admin_enabled + * Administrative status of the interconnect. When this is set to true, the Interconnect is functional and can carry traffic. When set to false, no packets can be carried over the interconnect and no BGP routes are exchanged over it. By default, the status is set to true. + * @type array|\Google\Protobuf\Internal\RepeatedField $available_features + * [Output only] List of features available for this Interconnect connection, which can take one of the following values: - MACSEC If present then the Interconnect connection is provisioned on MACsec capable hardware ports. If not present then the Interconnect connection is provisioned on non-MACsec capable ports and MACsec isn't supported and enabling MACsec fails. + * Check the AvailableFeatures enum for the list of possible values. + * @type array<\Google\Cloud\Compute\V1\InterconnectCircuitInfo>|\Google\Protobuf\Internal\RepeatedField $circuit_infos + * [Output Only] A list of CircuitInfo objects, that describe the individual circuits in this LAG. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $customer_name + * Customer name, to put in the Letter of Authorization as the party authorized to request a crossconnect. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type array<\Google\Cloud\Compute\V1\InterconnectOutageNotification>|\Google\Protobuf\Internal\RepeatedField $expected_outages + * [Output Only] A list of outages expected for this Interconnect. + * @type string $google_ip_address + * [Output Only] IP address configured on the Google side of the Interconnect link. This can be used only for ping tests. + * @type string $google_reference_id + * [Output Only] Google reference ID to be used when raising support tickets with Google or otherwise to debug backend connectivity issues. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type array|\Google\Protobuf\Internal\RepeatedField $interconnect_attachments + * [Output Only] A list of the URLs of all InterconnectAttachments configured to use this Interconnect. + * @type string $interconnect_type + * Type of interconnect, which can take one of the following values: - PARTNER: A partner-managed interconnection shared between customers though a partner. - DEDICATED: A dedicated physical interconnection with the customer. Note that a value IT_PRIVATE has been deprecated in favor of DEDICATED. + * Check the InterconnectType enum for the list of possible values. + * @type string $kind + * [Output Only] Type of the resource. Always compute#interconnect for interconnects. + * @type string $label_fingerprint + * A fingerprint for the labels being applied to this Interconnect, 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 Interconnect. + * @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 $link_type + * Type of link requested, which can take one of the following values: - LINK_TYPE_ETHERNET_10G_LR: A 10G Ethernet with LR optics - LINK_TYPE_ETHERNET_100G_LR: A 100G Ethernet with LR optics. Note that this field indicates the speed of each of the links in the bundle, not the speed of the entire bundle. + * Check the LinkType enum for the list of possible values. + * @type string $location + * URL of the InterconnectLocation object that represents where this connection is to be provisioned. + * @type \Google\Cloud\Compute\V1\InterconnectMacsec $macsec + * Configuration that enables Media Access Control security (MACsec) on the Cloud Interconnect connection between Google and your on-premises router. + * @type bool $macsec_enabled + * Enable or disable MACsec on this Interconnect connection. MACsec enablement fails if the MACsec object is not specified. + * @type string $name + * 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 string $noc_contact_email + * Email address to contact the customer NOC for operations and maintenance notifications regarding this Interconnect. If specified, this will be used for notifications in addition to all other forms described, such as Cloud Monitoring logs alerting and Cloud Notifications. This field is required for users who sign up for Cloud Interconnect using workforce identity federation. + * @type string $operational_status + * [Output Only] The current status of this Interconnect's functionality, which can take one of the following values: - OS_ACTIVE: A valid Interconnect, which is turned up and is ready to use. Attachments may be provisioned on this Interconnect. - OS_UNPROVISIONED: An Interconnect that has not completed turnup. No attachments may be provisioned on this Interconnect. - OS_UNDER_MAINTENANCE: An Interconnect that is undergoing internal maintenance. No attachments may be provisioned or updated on this Interconnect. + * Check the OperationalStatus enum for the list of possible values. + * @type string $peer_ip_address + * [Output Only] IP address configured on the customer side of the Interconnect link. The customer should configure this IP address during turnup when prompted by Google NOC. This can be used only for ping tests. + * @type int $provisioned_link_count + * [Output Only] Number of links actually provisioned in this interconnect. + * @type string $remote_location + * Indicates that this is a Cross-Cloud Interconnect. This field specifies the location outside of Google's network that the interconnect is connected to. + * @type array|\Google\Protobuf\Internal\RepeatedField $requested_features + * Optional. List of features requested for this Interconnect connection, which can take one of the following values: - MACSEC If specified then the connection is created on MACsec capable hardware ports. If not specified, the default value is false, which allocates non-MACsec capable ports first if available. This parameter can be provided only with Interconnect INSERT. It isn't valid for Interconnect PATCH. + * Check the RequestedFeatures enum for the list of possible values. + * @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] Reserved for future use. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $state + * [Output Only] The current state of Interconnect functionality, which can take one of the following values: - ACTIVE: The Interconnect is valid, turned up and ready to use. Attachments may be provisioned on this Interconnect. - UNPROVISIONED: The Interconnect has not completed turnup. No attachments may be provisioned on this Interconnect. - UNDER_MAINTENANCE: The Interconnect is undergoing internal maintenance. No attachments may be provisioned or updated on this Interconnect. + * Check the State enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Administrative status of the interconnect. When this is set to true, the Interconnect is functional and can carry traffic. When set to false, no packets can be carried over the interconnect and no BGP routes are exchanged over it. By default, the status is set to true. + * + * Generated from protobuf field optional bool admin_enabled = 445675089; + * @return bool + */ + public function getAdminEnabled() + { + return isset($this->admin_enabled) ? $this->admin_enabled : false; + } + + public function hasAdminEnabled() + { + return isset($this->admin_enabled); + } + + public function clearAdminEnabled() + { + unset($this->admin_enabled); + } + + /** + * Administrative status of the interconnect. When this is set to true, the Interconnect is functional and can carry traffic. When set to false, no packets can be carried over the interconnect and no BGP routes are exchanged over it. By default, the status is set to true. + * + * Generated from protobuf field optional bool admin_enabled = 445675089; + * @param bool $var + * @return $this + */ + public function setAdminEnabled($var) + { + GPBUtil::checkBool($var); + $this->admin_enabled = $var; + + return $this; + } + + /** + * [Output only] List of features available for this Interconnect connection, which can take one of the following values: - MACSEC If present then the Interconnect connection is provisioned on MACsec capable hardware ports. If not present then the Interconnect connection is provisioned on non-MACsec capable ports and MACsec isn't supported and enabling MACsec fails. + * Check the AvailableFeatures enum for the list of possible values. + * + * Generated from protobuf field repeated string available_features = 496344307; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAvailableFeatures() + { + return $this->available_features; + } + + /** + * [Output only] List of features available for this Interconnect connection, which can take one of the following values: - MACSEC If present then the Interconnect connection is provisioned on MACsec capable hardware ports. If not present then the Interconnect connection is provisioned on non-MACsec capable ports and MACsec isn't supported and enabling MACsec fails. + * Check the AvailableFeatures enum for the list of possible values. + * + * Generated from protobuf field repeated string available_features = 496344307; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAvailableFeatures($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->available_features = $arr; + + return $this; + } + + /** + * [Output Only] A list of CircuitInfo objects, that describe the individual circuits in this LAG. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectCircuitInfo circuit_infos = 164839855; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCircuitInfos() + { + return $this->circuit_infos; + } + + /** + * [Output Only] A list of CircuitInfo objects, that describe the individual circuits in this LAG. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectCircuitInfo circuit_infos = 164839855; + * @param array<\Google\Cloud\Compute\V1\InterconnectCircuitInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCircuitInfos($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InterconnectCircuitInfo::class); + $this->circuit_infos = $arr; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * Customer name, to put in the Letter of Authorization as the party authorized to request a crossconnect. + * + * Generated from protobuf field optional string customer_name = 3665484; + * @return string + */ + public function getCustomerName() + { + return isset($this->customer_name) ? $this->customer_name : ''; + } + + public function hasCustomerName() + { + return isset($this->customer_name); + } + + public function clearCustomerName() + { + unset($this->customer_name); + } + + /** + * Customer name, to put in the Letter of Authorization as the party authorized to request a crossconnect. + * + * Generated from protobuf field optional string customer_name = 3665484; + * @param string $var + * @return $this + */ + public function setCustomerName($var) + { + GPBUtil::checkString($var, True); + $this->customer_name = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] A list of outages expected for this Interconnect. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectOutageNotification expected_outages = 264484123; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExpectedOutages() + { + return $this->expected_outages; + } + + /** + * [Output Only] A list of outages expected for this Interconnect. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectOutageNotification expected_outages = 264484123; + * @param array<\Google\Cloud\Compute\V1\InterconnectOutageNotification>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExpectedOutages($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InterconnectOutageNotification::class); + $this->expected_outages = $arr; + + return $this; + } + + /** + * [Output Only] IP address configured on the Google side of the Interconnect link. This can be used only for ping tests. + * + * Generated from protobuf field optional string google_ip_address = 443105954; + * @return string + */ + public function getGoogleIpAddress() + { + return isset($this->google_ip_address) ? $this->google_ip_address : ''; + } + + public function hasGoogleIpAddress() + { + return isset($this->google_ip_address); + } + + public function clearGoogleIpAddress() + { + unset($this->google_ip_address); + } + + /** + * [Output Only] IP address configured on the Google side of the Interconnect link. This can be used only for ping tests. + * + * Generated from protobuf field optional string google_ip_address = 443105954; + * @param string $var + * @return $this + */ + public function setGoogleIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->google_ip_address = $var; + + return $this; + } + + /** + * [Output Only] Google reference ID to be used when raising support tickets with Google or otherwise to debug backend connectivity issues. + * + * Generated from protobuf field optional string google_reference_id = 534944469; + * @return string + */ + public function getGoogleReferenceId() + { + return isset($this->google_reference_id) ? $this->google_reference_id : ''; + } + + public function hasGoogleReferenceId() + { + return isset($this->google_reference_id); + } + + public function clearGoogleReferenceId() + { + unset($this->google_reference_id); + } + + /** + * [Output Only] Google reference ID to be used when raising support tickets with Google or otherwise to debug backend connectivity issues. + * + * Generated from protobuf field optional string google_reference_id = 534944469; + * @param string $var + * @return $this + */ + public function setGoogleReferenceId($var) + { + GPBUtil::checkString($var, True); + $this->google_reference_id = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] A list of the URLs of all InterconnectAttachments configured to use this Interconnect. + * + * Generated from protobuf field repeated string interconnect_attachments = 425388415; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInterconnectAttachments() + { + return $this->interconnect_attachments; + } + + /** + * [Output Only] A list of the URLs of all InterconnectAttachments configured to use this Interconnect. + * + * Generated from protobuf field repeated string interconnect_attachments = 425388415; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInterconnectAttachments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->interconnect_attachments = $arr; + + return $this; + } + + /** + * Type of interconnect, which can take one of the following values: - PARTNER: A partner-managed interconnection shared between customers though a partner. - DEDICATED: A dedicated physical interconnection with the customer. Note that a value IT_PRIVATE has been deprecated in favor of DEDICATED. + * Check the InterconnectType enum for the list of possible values. + * + * Generated from protobuf field optional string interconnect_type = 515165259; + * @return string + */ + public function getInterconnectType() + { + return isset($this->interconnect_type) ? $this->interconnect_type : ''; + } + + public function hasInterconnectType() + { + return isset($this->interconnect_type); + } + + public function clearInterconnectType() + { + unset($this->interconnect_type); + } + + /** + * Type of interconnect, which can take one of the following values: - PARTNER: A partner-managed interconnection shared between customers though a partner. - DEDICATED: A dedicated physical interconnection with the customer. Note that a value IT_PRIVATE has been deprecated in favor of DEDICATED. + * Check the InterconnectType enum for the list of possible values. + * + * Generated from protobuf field optional string interconnect_type = 515165259; + * @param string $var + * @return $this + */ + public function setInterconnectType($var) + { + GPBUtil::checkString($var, True); + $this->interconnect_type = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#interconnect for interconnects. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#interconnect for interconnects. + * + * 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; + } + + /** + * A fingerprint for the labels being applied to this Interconnect, 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 Interconnect. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @return string + */ + public function getLabelFingerprint() + { + return isset($this->label_fingerprint) ? $this->label_fingerprint : ''; + } + + public function hasLabelFingerprint() + { + return isset($this->label_fingerprint); + } + + public function clearLabelFingerprint() + { + unset($this->label_fingerprint); + } + + /** + * A fingerprint for the labels being applied to this Interconnect, 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 Interconnect. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @param string $var + * @return $this + */ + public function setLabelFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->label_fingerprint = $var; + + return $this; + } + + /** + * 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. + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->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. + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Type of link requested, which can take one of the following values: - LINK_TYPE_ETHERNET_10G_LR: A 10G Ethernet with LR optics - LINK_TYPE_ETHERNET_100G_LR: A 100G Ethernet with LR optics. Note that this field indicates the speed of each of the links in the bundle, not the speed of the entire bundle. + * Check the LinkType enum for the list of possible values. + * + * Generated from protobuf field optional string link_type = 523207775; + * @return string + */ + public function getLinkType() + { + return isset($this->link_type) ? $this->link_type : ''; + } + + public function hasLinkType() + { + return isset($this->link_type); + } + + public function clearLinkType() + { + unset($this->link_type); + } + + /** + * Type of link requested, which can take one of the following values: - LINK_TYPE_ETHERNET_10G_LR: A 10G Ethernet with LR optics - LINK_TYPE_ETHERNET_100G_LR: A 100G Ethernet with LR optics. Note that this field indicates the speed of each of the links in the bundle, not the speed of the entire bundle. + * Check the LinkType enum for the list of possible values. + * + * Generated from protobuf field optional string link_type = 523207775; + * @param string $var + * @return $this + */ + public function setLinkType($var) + { + GPBUtil::checkString($var, True); + $this->link_type = $var; + + return $this; + } + + /** + * URL of the InterconnectLocation object that represents where this connection is to be provisioned. + * + * Generated from protobuf field optional string location = 290430901; + * @return string + */ + public function getLocation() + { + return isset($this->location) ? $this->location : ''; + } + + public function hasLocation() + { + return isset($this->location); + } + + public function clearLocation() + { + unset($this->location); + } + + /** + * URL of the InterconnectLocation object that represents where this connection is to be provisioned. + * + * Generated from protobuf field optional string location = 290430901; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * Configuration that enables Media Access Control security (MACsec) on the Cloud Interconnect connection between Google and your on-premises router. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectMacsec macsec = 528867490; + * @return \Google\Cloud\Compute\V1\InterconnectMacsec|null + */ + public function getMacsec() + { + return $this->macsec; + } + + public function hasMacsec() + { + return isset($this->macsec); + } + + public function clearMacsec() + { + unset($this->macsec); + } + + /** + * Configuration that enables Media Access Control security (MACsec) on the Cloud Interconnect connection between Google and your on-premises router. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectMacsec macsec = 528867490; + * @param \Google\Cloud\Compute\V1\InterconnectMacsec $var + * @return $this + */ + public function setMacsec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InterconnectMacsec::class); + $this->macsec = $var; + + return $this; + } + + /** + * Enable or disable MACsec on this Interconnect connection. MACsec enablement fails if the MACsec object is not specified. + * + * Generated from protobuf field optional bool macsec_enabled = 194203812; + * @return bool + */ + public function getMacsecEnabled() + { + return isset($this->macsec_enabled) ? $this->macsec_enabled : false; + } + + public function hasMacsecEnabled() + { + return isset($this->macsec_enabled); + } + + public function clearMacsecEnabled() + { + unset($this->macsec_enabled); + } + + /** + * Enable or disable MACsec on this Interconnect connection. MACsec enablement fails if the MACsec object is not specified. + * + * Generated from protobuf field optional bool macsec_enabled = 194203812; + * @param bool $var + * @return $this + */ + public function setMacsecEnabled($var) + { + GPBUtil::checkBool($var); + $this->macsec_enabled = $var; + + return $this; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * Email address to contact the customer NOC for operations and maintenance notifications regarding this Interconnect. If specified, this will be used for notifications in addition to all other forms described, such as Cloud Monitoring logs alerting and Cloud Notifications. This field is required for users who sign up for Cloud Interconnect using workforce identity federation. + * + * Generated from protobuf field optional string noc_contact_email = 14072832; + * @return string + */ + public function getNocContactEmail() + { + return isset($this->noc_contact_email) ? $this->noc_contact_email : ''; + } + + public function hasNocContactEmail() + { + return isset($this->noc_contact_email); + } + + public function clearNocContactEmail() + { + unset($this->noc_contact_email); + } + + /** + * Email address to contact the customer NOC for operations and maintenance notifications regarding this Interconnect. If specified, this will be used for notifications in addition to all other forms described, such as Cloud Monitoring logs alerting and Cloud Notifications. This field is required for users who sign up for Cloud Interconnect using workforce identity federation. + * + * Generated from protobuf field optional string noc_contact_email = 14072832; + * @param string $var + * @return $this + */ + public function setNocContactEmail($var) + { + GPBUtil::checkString($var, True); + $this->noc_contact_email = $var; + + return $this; + } + + /** + * [Output Only] The current status of this Interconnect's functionality, which can take one of the following values: - OS_ACTIVE: A valid Interconnect, which is turned up and is ready to use. Attachments may be provisioned on this Interconnect. - OS_UNPROVISIONED: An Interconnect that has not completed turnup. No attachments may be provisioned on this Interconnect. - OS_UNDER_MAINTENANCE: An Interconnect that is undergoing internal maintenance. No attachments may be provisioned or updated on this Interconnect. + * Check the OperationalStatus enum for the list of possible values. + * + * Generated from protobuf field optional string operational_status = 201070847; + * @return string + */ + public function getOperationalStatus() + { + return isset($this->operational_status) ? $this->operational_status : ''; + } + + public function hasOperationalStatus() + { + return isset($this->operational_status); + } + + public function clearOperationalStatus() + { + unset($this->operational_status); + } + + /** + * [Output Only] The current status of this Interconnect's functionality, which can take one of the following values: - OS_ACTIVE: A valid Interconnect, which is turned up and is ready to use. Attachments may be provisioned on this Interconnect. - OS_UNPROVISIONED: An Interconnect that has not completed turnup. No attachments may be provisioned on this Interconnect. - OS_UNDER_MAINTENANCE: An Interconnect that is undergoing internal maintenance. No attachments may be provisioned or updated on this Interconnect. + * Check the OperationalStatus enum for the list of possible values. + * + * Generated from protobuf field optional string operational_status = 201070847; + * @param string $var + * @return $this + */ + public function setOperationalStatus($var) + { + GPBUtil::checkString($var, True); + $this->operational_status = $var; + + return $this; + } + + /** + * [Output Only] IP address configured on the customer side of the Interconnect link. The customer should configure this IP address during turnup when prompted by Google NOC. This can be used only for ping tests. + * + * Generated from protobuf field optional string peer_ip_address = 207735769; + * @return string + */ + public function getPeerIpAddress() + { + return isset($this->peer_ip_address) ? $this->peer_ip_address : ''; + } + + public function hasPeerIpAddress() + { + return isset($this->peer_ip_address); + } + + public function clearPeerIpAddress() + { + unset($this->peer_ip_address); + } + + /** + * [Output Only] IP address configured on the customer side of the Interconnect link. The customer should configure this IP address during turnup when prompted by Google NOC. This can be used only for ping tests. + * + * Generated from protobuf field optional string peer_ip_address = 207735769; + * @param string $var + * @return $this + */ + public function setPeerIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->peer_ip_address = $var; + + return $this; + } + + /** + * [Output Only] Number of links actually provisioned in this interconnect. + * + * Generated from protobuf field optional int32 provisioned_link_count = 410888565; + * @return int + */ + public function getProvisionedLinkCount() + { + return isset($this->provisioned_link_count) ? $this->provisioned_link_count : 0; + } + + public function hasProvisionedLinkCount() + { + return isset($this->provisioned_link_count); + } + + public function clearProvisionedLinkCount() + { + unset($this->provisioned_link_count); + } + + /** + * [Output Only] Number of links actually provisioned in this interconnect. + * + * Generated from protobuf field optional int32 provisioned_link_count = 410888565; + * @param int $var + * @return $this + */ + public function setProvisionedLinkCount($var) + { + GPBUtil::checkInt32($var); + $this->provisioned_link_count = $var; + + return $this; + } + + /** + * Indicates that this is a Cross-Cloud Interconnect. This field specifies the location outside of Google's network that the interconnect is connected to. + * + * Generated from protobuf field optional string remote_location = 324388750; + * @return string + */ + public function getRemoteLocation() + { + return isset($this->remote_location) ? $this->remote_location : ''; + } + + public function hasRemoteLocation() + { + return isset($this->remote_location); + } + + public function clearRemoteLocation() + { + unset($this->remote_location); + } + + /** + * Indicates that this is a Cross-Cloud Interconnect. This field specifies the location outside of Google's network that the interconnect is connected to. + * + * Generated from protobuf field optional string remote_location = 324388750; + * @param string $var + * @return $this + */ + public function setRemoteLocation($var) + { + GPBUtil::checkString($var, True); + $this->remote_location = $var; + + return $this; + } + + /** + * Optional. List of features requested for this Interconnect connection, which can take one of the following values: - MACSEC If specified then the connection is created on MACsec capable hardware ports. If not specified, the default value is false, which allocates non-MACsec capable ports first if available. This parameter can be provided only with Interconnect INSERT. It isn't valid for Interconnect PATCH. + * Check the RequestedFeatures enum for the list of possible values. + * + * Generated from protobuf field repeated string requested_features = 461240814; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequestedFeatures() + { + return $this->requested_features; + } + + /** + * Optional. List of features requested for this Interconnect connection, which can take one of the following values: - MACSEC If specified then the connection is created on MACsec capable hardware ports. If not specified, the default value is false, which allocates non-MACsec capable ports first if available. This parameter can be provided only with Interconnect INSERT. It isn't valid for Interconnect PATCH. + * Check the RequestedFeatures enum for the list of possible values. + * + * Generated from protobuf field repeated string requested_features = 461240814; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequestedFeatures($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->requested_features = $arr; + + return $this; + } + + /** + * Target number of physical links in the link bundle, as requested by the customer. + * + * Generated from protobuf field optional int32 requested_link_count = 45051387; + * @return int + */ + public function getRequestedLinkCount() + { + return isset($this->requested_link_count) ? $this->requested_link_count : 0; + } + + public function hasRequestedLinkCount() + { + return isset($this->requested_link_count); + } + + public function clearRequestedLinkCount() + { + unset($this->requested_link_count); + } + + /** + * Target number of physical links in the link bundle, as requested by the customer. + * + * Generated from protobuf field optional int32 requested_link_count = 45051387; + * @param int $var + * @return $this + */ + public function setRequestedLinkCount($var) + { + GPBUtil::checkInt32($var); + $this->requested_link_count = $var; + + return $this; + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + * @return bool + */ + public function getSatisfiesPzs() + { + return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; + } + + public function hasSatisfiesPzs() + { + return isset($this->satisfies_pzs); + } + + public function clearSatisfiesPzs() + { + unset($this->satisfies_pzs); + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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] The current state of Interconnect functionality, which can take one of the following values: - ACTIVE: The Interconnect is valid, turned up and ready to use. Attachments may be provisioned on this Interconnect. - UNPROVISIONED: The Interconnect has not completed turnup. No attachments may be provisioned on this Interconnect. - UNDER_MAINTENANCE: The Interconnect is undergoing internal maintenance. No attachments may be provisioned or updated on this Interconnect. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @return string + */ + public function getState() + { + return isset($this->state) ? $this->state : ''; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * [Output Only] The current state of Interconnect functionality, which can take one of the following values: - ACTIVE: The Interconnect is valid, turned up and ready to use. Attachments may be provisioned on this Interconnect. - UNPROVISIONED: The Interconnect has not completed turnup. No attachments may be provisioned on this Interconnect. - UNDER_MAINTENANCE: The Interconnect is undergoing internal maintenance. No attachments may be provisioned or updated on this Interconnect. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/AvailableFeatures.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/AvailableFeatures.php new file mode 100644 index 000000000000..049da96bcbdc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/AvailableFeatures.php @@ -0,0 +1,52 @@ +google.cloud.compute.v1.Interconnect.AvailableFeatures + */ +class AvailableFeatures +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_AVAILABLE_FEATURES = 0; + */ + const UNDEFINED_AVAILABLE_FEATURES = 0; + + private static $valueToName = [ + self::UNDEFINED_AVAILABLE_FEATURES => 'UNDEFINED_AVAILABLE_FEATURES', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AvailableFeatures::class, \Google\Cloud\Compute\V1\Interconnect_AvailableFeatures::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/InterconnectType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/InterconnectType.php new file mode 100644 index 000000000000..d16ddc7447be --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/InterconnectType.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.Interconnect.InterconnectType + */ +class InterconnectType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_INTERCONNECT_TYPE = 0; + */ + const UNDEFINED_INTERCONNECT_TYPE = 0; + /** + * A dedicated physical interconnection with the customer. + * + * Generated from protobuf enum DEDICATED = 258411983; + */ + const DEDICATED = 258411983; + /** + * [Deprecated] A private, physical interconnection with the customer. + * + * Generated from protobuf enum IT_PRIVATE = 335677007; + */ + const IT_PRIVATE = 335677007; + /** + * A partner-managed interconnection shared between customers via partner. + * + * Generated from protobuf enum PARTNER = 461924520; + */ + const PARTNER = 461924520; + + private static $valueToName = [ + self::UNDEFINED_INTERCONNECT_TYPE => 'UNDEFINED_INTERCONNECT_TYPE', + self::DEDICATED => 'DEDICATED', + self::IT_PRIVATE => 'IT_PRIVATE', + self::PARTNER => 'PARTNER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(InterconnectType::class, \Google\Cloud\Compute\V1\Interconnect_InterconnectType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/LinkType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/LinkType.php new file mode 100644 index 000000000000..3181ac94adc2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/LinkType.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.Interconnect.LinkType + */ +class LinkType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_LINK_TYPE = 0; + */ + const UNDEFINED_LINK_TYPE = 0; + /** + * 100G Ethernet, LR Optics. + * + * Generated from protobuf enum LINK_TYPE_ETHERNET_100G_LR = 337672551; + */ + const LINK_TYPE_ETHERNET_100G_LR = 337672551; + /** + * 10G Ethernet, LR Optics. [(rate_bps) = 10000000000]; + * + * Generated from protobuf enum LINK_TYPE_ETHERNET_10G_LR = 236739749; + */ + const LINK_TYPE_ETHERNET_10G_LR = 236739749; + + private static $valueToName = [ + self::UNDEFINED_LINK_TYPE => 'UNDEFINED_LINK_TYPE', + self::LINK_TYPE_ETHERNET_100G_LR => 'LINK_TYPE_ETHERNET_100G_LR', + self::LINK_TYPE_ETHERNET_10G_LR => 'LINK_TYPE_ETHERNET_10G_LR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LinkType::class, \Google\Cloud\Compute\V1\Interconnect_LinkType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/OperationalStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/OperationalStatus.php new file mode 100644 index 000000000000..282f65fbb79b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/OperationalStatus.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.Interconnect.OperationalStatus + */ +class OperationalStatus +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_OPERATIONAL_STATUS = 0; + */ + const UNDEFINED_OPERATIONAL_STATUS = 0; + /** + * The interconnect is valid, turned up, and ready to use. Attachments may be provisioned on this interconnect. + * + * Generated from protobuf enum OS_ACTIVE = 55721409; + */ + const OS_ACTIVE = 55721409; + /** + * The interconnect has not completed turnup. No attachments may be provisioned on this interconnect. + * + * Generated from protobuf enum OS_UNPROVISIONED = 239771840; + */ + const OS_UNPROVISIONED = 239771840; + + private static $valueToName = [ + self::UNDEFINED_OPERATIONAL_STATUS => 'UNDEFINED_OPERATIONAL_STATUS', + self::OS_ACTIVE => 'OS_ACTIVE', + self::OS_UNPROVISIONED => 'OS_UNPROVISIONED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(OperationalStatus::class, \Google\Cloud\Compute\V1\Interconnect_OperationalStatus::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/RequestedFeatures.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/RequestedFeatures.php new file mode 100644 index 000000000000..42e8f63d3d55 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/RequestedFeatures.php @@ -0,0 +1,52 @@ +google.cloud.compute.v1.Interconnect.RequestedFeatures + */ +class RequestedFeatures +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_REQUESTED_FEATURES = 0; + */ + const UNDEFINED_REQUESTED_FEATURES = 0; + + private static $valueToName = [ + self::UNDEFINED_REQUESTED_FEATURES => 'UNDEFINED_REQUESTED_FEATURES', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RequestedFeatures::class, \Google\Cloud\Compute\V1\Interconnect_RequestedFeatures::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/State.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/State.php new file mode 100644 index 000000000000..a3a4e24ad425 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Interconnect/State.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.Interconnect.State + */ +class State +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATE = 0; + */ + const UNDEFINED_STATE = 0; + /** + * The interconnect is valid, turned up, and ready to use. Attachments may be provisioned on this interconnect. + * + * Generated from protobuf enum ACTIVE = 314733318; + */ + const ACTIVE = 314733318; + /** + * The interconnect has not completed turnup. No attachments may be provisioned on this interconnect. + * + * Generated from protobuf enum UNPROVISIONED = 517333979; + */ + const UNPROVISIONED = 517333979; + + private static $valueToName = [ + self::UNDEFINED_STATE => 'UNDEFINED_STATE', + self::ACTIVE => 'ACTIVE', + self::UNPROVISIONED => 'UNPROVISIONED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Compute\V1\Interconnect_State::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment.php new file mode 100644 index 000000000000..3ad91bd00618 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment.php @@ -0,0 +1,1781 @@ +google.cloud.compute.v1.InterconnectAttachment + */ +class InterconnectAttachment extends \Google\Protobuf\Internal\Message +{ + /** + * Determines whether this Attachment will carry packets. Not present for PARTNER_PROVIDER. + * + * Generated from protobuf field optional bool admin_enabled = 445675089; + */ + protected $admin_enabled = null; + /** + * Provisioned bandwidth capacity for the interconnect attachment. For attachments of type DEDICATED, the user can set the bandwidth. For attachments of type PARTNER, the Google Partner that is operating the interconnect must set the bandwidth. Output only for PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, and can take one of the following values: - BPS_50M: 50 Mbit/s - BPS_100M: 100 Mbit/s - BPS_200M: 200 Mbit/s - BPS_300M: 300 Mbit/s - BPS_400M: 400 Mbit/s - BPS_500M: 500 Mbit/s - BPS_1G: 1 Gbit/s - BPS_2G: 2 Gbit/s - BPS_5G: 5 Gbit/s - BPS_10G: 10 Gbit/s - BPS_20G: 20 Gbit/s - BPS_50G: 50 Gbit/s + * Check the Bandwidth enum for the list of possible values. + * + * Generated from protobuf field optional string bandwidth = 181715121; + */ + protected $bandwidth = null; + /** + * This field is not available. + * + * Generated from protobuf field repeated string candidate_ipv6_subnets = 70682522; + */ + private $candidate_ipv6_subnets; + /** + * Up to 16 candidate prefixes that can be used to restrict the allocation of cloudRouterIpAddress and customerRouterIpAddress for this attachment. All prefixes must be within link-local address space (169.254.0.0/16) and must be /29 or shorter (/28, /27, etc). Google will attempt to select an unused /29 from the supplied candidate prefix(es). The request will fail if all possible /29s are in use on Google's edge. If not supplied, Google will randomly select an unused /29 from all of link-local space. + * + * Generated from protobuf field repeated string candidate_subnets = 237842938; + */ + private $candidate_subnets; + /** + * [Output Only] IPv4 address + prefix length to be configured on Cloud Router Interface for this interconnect attachment. + * + * Generated from protobuf field optional string cloud_router_ip_address = 287392776; + */ + protected $cloud_router_ip_address = null; + /** + * [Output Only] IPv6 address + prefix length to be configured on Cloud Router Interface for this interconnect attachment. + * + * Generated from protobuf field optional string cloud_router_ipv6_address = 451922376; + */ + protected $cloud_router_ipv6_address = null; + /** + * This field is not available. + * + * Generated from protobuf field optional string cloud_router_ipv6_interface_id = 521282701; + */ + protected $cloud_router_ipv6_interface_id = null; + /** + * [Output Only] Constraints for this attachment, if any. The attachment does not work if these constraints are not met. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectAttachmentConfigurationConstraints configuration_constraints = 179681389; + */ + protected $configuration_constraints = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * [Output Only] IPv4 address + prefix length to be configured on the customer router subinterface for this interconnect attachment. + * + * Generated from protobuf field optional string customer_router_ip_address = 332475761; + */ + protected $customer_router_ip_address = null; + /** + * [Output Only] IPv6 address + prefix length to be configured on the customer router subinterface for this interconnect attachment. + * + * Generated from protobuf field optional string customer_router_ipv6_address = 290127089; + */ + protected $customer_router_ipv6_address = null; + /** + * This field is not available. + * + * Generated from protobuf field optional string customer_router_ipv6_interface_id = 380994308; + */ + protected $customer_router_ipv6_interface_id = null; + /** + * [Output Only] Dataplane version for this InterconnectAttachment. This field is only present for Dataplane version 2 and higher. Absence of this field in the API output indicates that the Dataplane is version 1. + * + * Generated from protobuf field optional int32 dataplane_version = 34920075; + */ + protected $dataplane_version = null; + /** + * An optional description of this resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Desired availability domain for the attachment. Only available for type PARTNER, at creation time, and can take one of the following values: - AVAILABILITY_DOMAIN_ANY - AVAILABILITY_DOMAIN_1 - AVAILABILITY_DOMAIN_2 For improved reliability, customers should configure a pair of attachments, one per availability domain. The selected availability domain will be provided to the Partner via the pairing key, so that the provisioned circuit will lie in the specified domain. If not specified, the value will default to AVAILABILITY_DOMAIN_ANY. + * Check the EdgeAvailabilityDomain enum for the list of possible values. + * + * Generated from protobuf field optional string edge_availability_domain = 71289510; + */ + protected $edge_availability_domain = null; + /** + * Indicates the user-supplied encryption option of this VLAN attachment (interconnectAttachment). Can only be specified at attachment creation for PARTNER or DEDICATED attachments. Possible values are: - NONE - This is the default value, which means that the VLAN attachment carries unencrypted traffic. VMs are able to send traffic to, or receive traffic from, such a VLAN attachment. - IPSEC - The VLAN attachment carries only encrypted traffic that is encrypted by an IPsec device, such as an HA VPN gateway or third-party IPsec VPN. VMs cannot directly send traffic to, or receive traffic from, such a VLAN attachment. To use *HA VPN over Cloud Interconnect*, the VLAN attachment must be created with this option. + * Check the Encryption enum for the list of possible values. + * + * Generated from protobuf field optional string encryption = 97980291; + */ + protected $encryption = null; + /** + * [Output Only] Google reference ID, to be used when raising support tickets with Google or otherwise to debug backend connectivity issues. [Deprecated] This field is not used. + * + * Generated from protobuf field optional string google_reference_id = 534944469; + */ + protected $google_reference_id = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * URL of the underlying Interconnect object that this attachment's traffic will traverse through. + * + * Generated from protobuf field optional string interconnect = 224601230; + */ + protected $interconnect = null; + /** + * A list of URLs of addresses that have been reserved for the VLAN attachment. Used only for the VLAN attachment that has the encryption option as IPSEC. The addresses must be regional internal IP address ranges. When creating an HA VPN gateway over the VLAN attachment, if the attachment is configured to use a regional internal IP address, then the VPN gateway's IP address is allocated from the IP address range specified here. For example, if the HA VPN gateway's interface 0 is paired to this VLAN attachment, then a regional internal IP address for the VPN gateway interface 0 will be allocated from the IP address specified for this VLAN attachment. If this field is not specified when creating the VLAN attachment, then later on when creating an HA VPN gateway on this VLAN attachment, the HA VPN gateway's IP address is allocated from the regional external IP address pool. + * + * Generated from protobuf field repeated string ipsec_internal_addresses = 407648565; + */ + private $ipsec_internal_addresses; + /** + * [Output Only] Type of the resource. Always compute#interconnectAttachment for interconnect attachments. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * A fingerprint for the labels being applied to this InterconnectAttachment, 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 InterconnectAttachment. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + */ + protected $label_fingerprint = null; + /** + * 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. + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + /** + * Maximum Transmission Unit (MTU), in bytes, of packets passing through this interconnect attachment. Only 1440 and 1500 are allowed. If not specified, the value will default to 1440. + * + * Generated from protobuf field optional int32 mtu = 108462; + */ + protected $mtu = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] The current status of whether or not this interconnect attachment is functional, which can take one of the following values: - OS_ACTIVE: The attachment has been turned up and is ready to use. - OS_UNPROVISIONED: The attachment is not ready to use yet, because turnup is not complete. + * Check the OperationalStatus enum for the list of possible values. + * + * Generated from protobuf field optional string operational_status = 201070847; + */ + protected $operational_status = null; + /** + * [Output only for type PARTNER. Input only for PARTNER_PROVIDER. Not present for DEDICATED]. The opaque identifier of a PARTNER attachment used to initiate provisioning with a selected partner. Of the form "XXXXX/region/domain" + * + * Generated from protobuf field optional string pairing_key = 439695464; + */ + protected $pairing_key = null; + /** + * Optional BGP ASN for the router supplied by a Layer 3 Partner if they configured BGP on behalf of the customer. Output only for PARTNER type, input only for PARTNER_PROVIDER, not available for DEDICATED. + * + * Generated from protobuf field optional int64 partner_asn = 438166149; + */ + protected $partner_asn = null; + /** + * Informational metadata about Partner attachments from Partners to display to customers. Output only for PARTNER type, mutable for PARTNER_PROVIDER, not available for DEDICATED. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata partner_metadata = 65908934; + */ + protected $partner_metadata = null; + /** + * [Output Only] Information specific to an InterconnectAttachment. This property is populated if the interconnect that this is attached to is of type DEDICATED. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectAttachmentPrivateInfo private_interconnect_info = 237270531; + */ + protected $private_interconnect_info = null; + /** + * [Output Only] URL of the region where the regional interconnect attachment resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] If the attachment is on a Cross-Cloud Interconnect connection, this field contains the interconnect's remote location service provider. Example values: "Amazon Web Services" "Microsoft Azure". The field is set only for attachments on Cross-Cloud Interconnect connections. Its value is copied from the InterconnectRemoteLocation remoteService field. + * + * Generated from protobuf field optional string remote_service = 391954364; + */ + protected $remote_service = null; + /** + * 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. + * + * Generated from protobuf field optional string router = 148608841; + */ + protected $router = null; + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + */ + protected $satisfies_pzs = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * The stack type for this interconnect attachment to identify whether the IPv6 feature is enabled or not. If not specified, IPV4_ONLY will be used. This field can be both set at interconnect attachments creation and update interconnect attachment operations. + * Check the StackType enum for the list of possible values. + * + * Generated from protobuf field optional string stack_type = 425908881; + */ + protected $stack_type = null; + /** + * [Output Only] The current state of this attachment's functionality. Enum values ACTIVE and UNPROVISIONED are shared by DEDICATED/PRIVATE, PARTNER, and PARTNER_PROVIDER interconnect attachments, while enum values PENDING_PARTNER, PARTNER_REQUEST_RECEIVED, and PENDING_CUSTOMER are used for only PARTNER and PARTNER_PROVIDER interconnect attachments. This state can take one of the following values: - ACTIVE: The attachment has been turned up and is ready to use. - UNPROVISIONED: The attachment is not ready to use yet, because turnup is not complete. - PENDING_PARTNER: A newly-created PARTNER attachment that has not yet been configured on the Partner side. - PARTNER_REQUEST_RECEIVED: A PARTNER attachment is in the process of provisioning after a PARTNER_PROVIDER attachment was created that references it. - PENDING_CUSTOMER: A PARTNER or PARTNER_PROVIDER attachment that is waiting for a customer to activate it. - DEFUNCT: The attachment was deleted externally and is no longer functional. This could be because the associated Interconnect was removed, or because the other side of a Partner attachment was deleted. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + */ + protected $state = null; + /** + * Length of the IPv4 subnet mask. Allowed values: - 29 (default) - 30 The default value is 29, except for Cross-Cloud Interconnect connections that use an InterconnectRemoteLocation with a constraints.subnetLengthRange.min equal to 30. For example, connections that use an Azure remote location fall into this category. In these cases, the default value is 30, and requesting 29 returns an error. Where both 29 and 30 are allowed, 29 is preferred, because it gives Google Cloud Support more debugging visibility. + * + * Generated from protobuf field optional int32 subnet_length = 279831048; + */ + protected $subnet_length = null; + /** + * 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. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + /** + * 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; + */ + protected $vlan_tag8021q = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $admin_enabled + * Determines whether this Attachment will carry packets. Not present for PARTNER_PROVIDER. + * @type string $bandwidth + * Provisioned bandwidth capacity for the interconnect attachment. For attachments of type DEDICATED, the user can set the bandwidth. For attachments of type PARTNER, the Google Partner that is operating the interconnect must set the bandwidth. Output only for PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, and can take one of the following values: - BPS_50M: 50 Mbit/s - BPS_100M: 100 Mbit/s - BPS_200M: 200 Mbit/s - BPS_300M: 300 Mbit/s - BPS_400M: 400 Mbit/s - BPS_500M: 500 Mbit/s - BPS_1G: 1 Gbit/s - BPS_2G: 2 Gbit/s - BPS_5G: 5 Gbit/s - BPS_10G: 10 Gbit/s - BPS_20G: 20 Gbit/s - BPS_50G: 50 Gbit/s + * Check the Bandwidth enum for the list of possible values. + * @type array|\Google\Protobuf\Internal\RepeatedField $candidate_ipv6_subnets + * This field is not available. + * @type array|\Google\Protobuf\Internal\RepeatedField $candidate_subnets + * Up to 16 candidate prefixes that can be used to restrict the allocation of cloudRouterIpAddress and customerRouterIpAddress for this attachment. All prefixes must be within link-local address space (169.254.0.0/16) and must be /29 or shorter (/28, /27, etc). Google will attempt to select an unused /29 from the supplied candidate prefix(es). The request will fail if all possible /29s are in use on Google's edge. If not supplied, Google will randomly select an unused /29 from all of link-local space. + * @type string $cloud_router_ip_address + * [Output Only] IPv4 address + prefix length to be configured on Cloud Router Interface for this interconnect attachment. + * @type string $cloud_router_ipv6_address + * [Output Only] IPv6 address + prefix length to be configured on Cloud Router Interface for this interconnect attachment. + * @type string $cloud_router_ipv6_interface_id + * This field is not available. + * @type \Google\Cloud\Compute\V1\InterconnectAttachmentConfigurationConstraints $configuration_constraints + * [Output Only] Constraints for this attachment, if any. The attachment does not work if these constraints are not met. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $customer_router_ip_address + * [Output Only] IPv4 address + prefix length to be configured on the customer router subinterface for this interconnect attachment. + * @type string $customer_router_ipv6_address + * [Output Only] IPv6 address + prefix length to be configured on the customer router subinterface for this interconnect attachment. + * @type string $customer_router_ipv6_interface_id + * This field is not available. + * @type int $dataplane_version + * [Output Only] Dataplane version for this InterconnectAttachment. This field is only present for Dataplane version 2 and higher. Absence of this field in the API output indicates that the Dataplane is version 1. + * @type string $description + * An optional description of this resource. + * @type string $edge_availability_domain + * Desired availability domain for the attachment. Only available for type PARTNER, at creation time, and can take one of the following values: - AVAILABILITY_DOMAIN_ANY - AVAILABILITY_DOMAIN_1 - AVAILABILITY_DOMAIN_2 For improved reliability, customers should configure a pair of attachments, one per availability domain. The selected availability domain will be provided to the Partner via the pairing key, so that the provisioned circuit will lie in the specified domain. If not specified, the value will default to AVAILABILITY_DOMAIN_ANY. + * Check the EdgeAvailabilityDomain enum for the list of possible values. + * @type string $encryption + * Indicates the user-supplied encryption option of this VLAN attachment (interconnectAttachment). Can only be specified at attachment creation for PARTNER or DEDICATED attachments. Possible values are: - NONE - This is the default value, which means that the VLAN attachment carries unencrypted traffic. VMs are able to send traffic to, or receive traffic from, such a VLAN attachment. - IPSEC - The VLAN attachment carries only encrypted traffic that is encrypted by an IPsec device, such as an HA VPN gateway or third-party IPsec VPN. VMs cannot directly send traffic to, or receive traffic from, such a VLAN attachment. To use *HA VPN over Cloud Interconnect*, the VLAN attachment must be created with this option. + * Check the Encryption enum for the list of possible values. + * @type string $google_reference_id + * [Output Only] Google reference ID, to be used when raising support tickets with Google or otherwise to debug backend connectivity issues. [Deprecated] This field is not used. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $interconnect + * URL of the underlying Interconnect object that this attachment's traffic will traverse through. + * @type array|\Google\Protobuf\Internal\RepeatedField $ipsec_internal_addresses + * A list of URLs of addresses that have been reserved for the VLAN attachment. Used only for the VLAN attachment that has the encryption option as IPSEC. The addresses must be regional internal IP address ranges. When creating an HA VPN gateway over the VLAN attachment, if the attachment is configured to use a regional internal IP address, then the VPN gateway's IP address is allocated from the IP address range specified here. For example, if the HA VPN gateway's interface 0 is paired to this VLAN attachment, then a regional internal IP address for the VPN gateway interface 0 will be allocated from the IP address specified for this VLAN attachment. If this field is not specified when creating the VLAN attachment, then later on when creating an HA VPN gateway on this VLAN attachment, the HA VPN gateway's IP address is allocated from the regional external IP address pool. + * @type string $kind + * [Output Only] Type of the resource. Always compute#interconnectAttachment for interconnect attachments. + * @type string $label_fingerprint + * A fingerprint for the labels being applied to this InterconnectAttachment, 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 InterconnectAttachment. + * @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 int $mtu + * Maximum Transmission Unit (MTU), in bytes, of packets passing through this interconnect attachment. Only 1440 and 1500 are allowed. If not specified, the value will default to 1440. + * @type string $name + * 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 string $operational_status + * [Output Only] The current status of whether or not this interconnect attachment is functional, which can take one of the following values: - OS_ACTIVE: The attachment has been turned up and is ready to use. - OS_UNPROVISIONED: The attachment is not ready to use yet, because turnup is not complete. + * Check the OperationalStatus enum for the list of possible values. + * @type string $pairing_key + * [Output only for type PARTNER. Input only for PARTNER_PROVIDER. Not present for DEDICATED]. The opaque identifier of a PARTNER attachment used to initiate provisioning with a selected partner. Of the form "XXXXX/region/domain" + * @type int|string $partner_asn + * Optional BGP ASN for the router supplied by a Layer 3 Partner if they configured BGP on behalf of the customer. Output only for PARTNER type, input only for PARTNER_PROVIDER, not available for DEDICATED. + * @type \Google\Cloud\Compute\V1\InterconnectAttachmentPartnerMetadata $partner_metadata + * Informational metadata about Partner attachments from Partners to display to customers. Output only for PARTNER type, mutable for PARTNER_PROVIDER, not available for DEDICATED. + * @type \Google\Cloud\Compute\V1\InterconnectAttachmentPrivateInfo $private_interconnect_info + * [Output Only] Information specific to an InterconnectAttachment. This property is populated if the interconnect that this is attached to is of type DEDICATED. + * @type string $region + * [Output Only] URL of the region where the regional interconnect attachment resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * @type string $remote_service + * [Output Only] If the attachment is on a Cross-Cloud Interconnect connection, this field contains the interconnect's remote location service provider. Example values: "Amazon Web Services" "Microsoft Azure". The field is set only for attachments on Cross-Cloud Interconnect connections. Its value is copied from the InterconnectRemoteLocation remoteService field. + * @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] Reserved for future use. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $stack_type + * The stack type for this interconnect attachment to identify whether the IPv6 feature is enabled or not. If not specified, IPV4_ONLY will be used. This field can be both set at interconnect attachments creation and update interconnect attachment operations. + * Check the StackType enum for the list of possible values. + * @type string $state + * [Output Only] The current state of this attachment's functionality. Enum values ACTIVE and UNPROVISIONED are shared by DEDICATED/PRIVATE, PARTNER, and PARTNER_PROVIDER interconnect attachments, while enum values PENDING_PARTNER, PARTNER_REQUEST_RECEIVED, and PENDING_CUSTOMER are used for only PARTNER and PARTNER_PROVIDER interconnect attachments. This state can take one of the following values: - ACTIVE: The attachment has been turned up and is ready to use. - UNPROVISIONED: The attachment is not ready to use yet, because turnup is not complete. - PENDING_PARTNER: A newly-created PARTNER attachment that has not yet been configured on the Partner side. - PARTNER_REQUEST_RECEIVED: A PARTNER attachment is in the process of provisioning after a PARTNER_PROVIDER attachment was created that references it. - PENDING_CUSTOMER: A PARTNER or PARTNER_PROVIDER attachment that is waiting for a customer to activate it. - DEFUNCT: The attachment was deleted externally and is no longer functional. This could be because the associated Interconnect was removed, or because the other side of a Partner attachment was deleted. + * Check the State enum for the list of possible values. + * @type int $subnet_length + * Length of the IPv4 subnet mask. Allowed values: - 29 (default) - 30 The default value is 29, except for Cross-Cloud Interconnect connections that use an InterconnectRemoteLocation with a constraints.subnetLengthRange.min equal to 30. For example, connections that use an Azure remote location fall into this category. In these cases, the default value is 30, and requesting 29 returns an error. Where both 29 and 30 are allowed, 29 is preferred, because it gives Google Cloud Support more debugging visibility. + * @type string $type + * 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-4093. Only specified at creation time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Determines whether this Attachment will carry packets. Not present for PARTNER_PROVIDER. + * + * Generated from protobuf field optional bool admin_enabled = 445675089; + * @return bool + */ + public function getAdminEnabled() + { + return isset($this->admin_enabled) ? $this->admin_enabled : false; + } + + public function hasAdminEnabled() + { + return isset($this->admin_enabled); + } + + public function clearAdminEnabled() + { + unset($this->admin_enabled); + } + + /** + * Determines whether this Attachment will carry packets. Not present for PARTNER_PROVIDER. + * + * Generated from protobuf field optional bool admin_enabled = 445675089; + * @param bool $var + * @return $this + */ + public function setAdminEnabled($var) + { + GPBUtil::checkBool($var); + $this->admin_enabled = $var; + + return $this; + } + + /** + * Provisioned bandwidth capacity for the interconnect attachment. For attachments of type DEDICATED, the user can set the bandwidth. For attachments of type PARTNER, the Google Partner that is operating the interconnect must set the bandwidth. Output only for PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, and can take one of the following values: - BPS_50M: 50 Mbit/s - BPS_100M: 100 Mbit/s - BPS_200M: 200 Mbit/s - BPS_300M: 300 Mbit/s - BPS_400M: 400 Mbit/s - BPS_500M: 500 Mbit/s - BPS_1G: 1 Gbit/s - BPS_2G: 2 Gbit/s - BPS_5G: 5 Gbit/s - BPS_10G: 10 Gbit/s - BPS_20G: 20 Gbit/s - BPS_50G: 50 Gbit/s + * Check the Bandwidth enum for the list of possible values. + * + * Generated from protobuf field optional string bandwidth = 181715121; + * @return string + */ + public function getBandwidth() + { + return isset($this->bandwidth) ? $this->bandwidth : ''; + } + + public function hasBandwidth() + { + return isset($this->bandwidth); + } + + public function clearBandwidth() + { + unset($this->bandwidth); + } + + /** + * Provisioned bandwidth capacity for the interconnect attachment. For attachments of type DEDICATED, the user can set the bandwidth. For attachments of type PARTNER, the Google Partner that is operating the interconnect must set the bandwidth. Output only for PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, and can take one of the following values: - BPS_50M: 50 Mbit/s - BPS_100M: 100 Mbit/s - BPS_200M: 200 Mbit/s - BPS_300M: 300 Mbit/s - BPS_400M: 400 Mbit/s - BPS_500M: 500 Mbit/s - BPS_1G: 1 Gbit/s - BPS_2G: 2 Gbit/s - BPS_5G: 5 Gbit/s - BPS_10G: 10 Gbit/s - BPS_20G: 20 Gbit/s - BPS_50G: 50 Gbit/s + * Check the Bandwidth enum for the list of possible values. + * + * Generated from protobuf field optional string bandwidth = 181715121; + * @param string $var + * @return $this + */ + public function setBandwidth($var) + { + GPBUtil::checkString($var, True); + $this->bandwidth = $var; + + return $this; + } + + /** + * This field is not available. + * + * Generated from protobuf field repeated string candidate_ipv6_subnets = 70682522; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCandidateIpv6Subnets() + { + return $this->candidate_ipv6_subnets; + } + + /** + * This field is not available. + * + * Generated from protobuf field repeated string candidate_ipv6_subnets = 70682522; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCandidateIpv6Subnets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->candidate_ipv6_subnets = $arr; + + return $this; + } + + /** + * Up to 16 candidate prefixes that can be used to restrict the allocation of cloudRouterIpAddress and customerRouterIpAddress for this attachment. All prefixes must be within link-local address space (169.254.0.0/16) and must be /29 or shorter (/28, /27, etc). Google will attempt to select an unused /29 from the supplied candidate prefix(es). The request will fail if all possible /29s are in use on Google's edge. If not supplied, Google will randomly select an unused /29 from all of link-local space. + * + * Generated from protobuf field repeated string candidate_subnets = 237842938; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCandidateSubnets() + { + return $this->candidate_subnets; + } + + /** + * Up to 16 candidate prefixes that can be used to restrict the allocation of cloudRouterIpAddress and customerRouterIpAddress for this attachment. All prefixes must be within link-local address space (169.254.0.0/16) and must be /29 or shorter (/28, /27, etc). Google will attempt to select an unused /29 from the supplied candidate prefix(es). The request will fail if all possible /29s are in use on Google's edge. If not supplied, Google will randomly select an unused /29 from all of link-local space. + * + * Generated from protobuf field repeated string candidate_subnets = 237842938; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCandidateSubnets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->candidate_subnets = $arr; + + return $this; + } + + /** + * [Output Only] IPv4 address + prefix length to be configured on Cloud Router Interface for this interconnect attachment. + * + * Generated from protobuf field optional string cloud_router_ip_address = 287392776; + * @return string + */ + public function getCloudRouterIpAddress() + { + return isset($this->cloud_router_ip_address) ? $this->cloud_router_ip_address : ''; + } + + public function hasCloudRouterIpAddress() + { + return isset($this->cloud_router_ip_address); + } + + public function clearCloudRouterIpAddress() + { + unset($this->cloud_router_ip_address); + } + + /** + * [Output Only] IPv4 address + prefix length to be configured on Cloud Router Interface for this interconnect attachment. + * + * Generated from protobuf field optional string cloud_router_ip_address = 287392776; + * @param string $var + * @return $this + */ + public function setCloudRouterIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->cloud_router_ip_address = $var; + + return $this; + } + + /** + * [Output Only] IPv6 address + prefix length to be configured on Cloud Router Interface for this interconnect attachment. + * + * Generated from protobuf field optional string cloud_router_ipv6_address = 451922376; + * @return string + */ + public function getCloudRouterIpv6Address() + { + return isset($this->cloud_router_ipv6_address) ? $this->cloud_router_ipv6_address : ''; + } + + public function hasCloudRouterIpv6Address() + { + return isset($this->cloud_router_ipv6_address); + } + + public function clearCloudRouterIpv6Address() + { + unset($this->cloud_router_ipv6_address); + } + + /** + * [Output Only] IPv6 address + prefix length to be configured on Cloud Router Interface for this interconnect attachment. + * + * Generated from protobuf field optional string cloud_router_ipv6_address = 451922376; + * @param string $var + * @return $this + */ + public function setCloudRouterIpv6Address($var) + { + GPBUtil::checkString($var, True); + $this->cloud_router_ipv6_address = $var; + + return $this; + } + + /** + * This field is not available. + * + * Generated from protobuf field optional string cloud_router_ipv6_interface_id = 521282701; + * @return string + */ + public function getCloudRouterIpv6InterfaceId() + { + return isset($this->cloud_router_ipv6_interface_id) ? $this->cloud_router_ipv6_interface_id : ''; + } + + public function hasCloudRouterIpv6InterfaceId() + { + return isset($this->cloud_router_ipv6_interface_id); + } + + public function clearCloudRouterIpv6InterfaceId() + { + unset($this->cloud_router_ipv6_interface_id); + } + + /** + * This field is not available. + * + * Generated from protobuf field optional string cloud_router_ipv6_interface_id = 521282701; + * @param string $var + * @return $this + */ + public function setCloudRouterIpv6InterfaceId($var) + { + GPBUtil::checkString($var, True); + $this->cloud_router_ipv6_interface_id = $var; + + return $this; + } + + /** + * [Output Only] Constraints for this attachment, if any. The attachment does not work if these constraints are not met. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectAttachmentConfigurationConstraints configuration_constraints = 179681389; + * @return \Google\Cloud\Compute\V1\InterconnectAttachmentConfigurationConstraints|null + */ + public function getConfigurationConstraints() + { + return $this->configuration_constraints; + } + + public function hasConfigurationConstraints() + { + return isset($this->configuration_constraints); + } + + public function clearConfigurationConstraints() + { + unset($this->configuration_constraints); + } + + /** + * [Output Only] Constraints for this attachment, if any. The attachment does not work if these constraints are not met. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectAttachmentConfigurationConstraints configuration_constraints = 179681389; + * @param \Google\Cloud\Compute\V1\InterconnectAttachmentConfigurationConstraints $var + * @return $this + */ + public function setConfigurationConstraints($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InterconnectAttachmentConfigurationConstraints::class); + $this->configuration_constraints = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * [Output Only] IPv4 address + prefix length to be configured on the customer router subinterface for this interconnect attachment. + * + * Generated from protobuf field optional string customer_router_ip_address = 332475761; + * @return string + */ + public function getCustomerRouterIpAddress() + { + return isset($this->customer_router_ip_address) ? $this->customer_router_ip_address : ''; + } + + public function hasCustomerRouterIpAddress() + { + return isset($this->customer_router_ip_address); + } + + public function clearCustomerRouterIpAddress() + { + unset($this->customer_router_ip_address); + } + + /** + * [Output Only] IPv4 address + prefix length to be configured on the customer router subinterface for this interconnect attachment. + * + * Generated from protobuf field optional string customer_router_ip_address = 332475761; + * @param string $var + * @return $this + */ + public function setCustomerRouterIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->customer_router_ip_address = $var; + + return $this; + } + + /** + * [Output Only] IPv6 address + prefix length to be configured on the customer router subinterface for this interconnect attachment. + * + * Generated from protobuf field optional string customer_router_ipv6_address = 290127089; + * @return string + */ + public function getCustomerRouterIpv6Address() + { + return isset($this->customer_router_ipv6_address) ? $this->customer_router_ipv6_address : ''; + } + + public function hasCustomerRouterIpv6Address() + { + return isset($this->customer_router_ipv6_address); + } + + public function clearCustomerRouterIpv6Address() + { + unset($this->customer_router_ipv6_address); + } + + /** + * [Output Only] IPv6 address + prefix length to be configured on the customer router subinterface for this interconnect attachment. + * + * Generated from protobuf field optional string customer_router_ipv6_address = 290127089; + * @param string $var + * @return $this + */ + public function setCustomerRouterIpv6Address($var) + { + GPBUtil::checkString($var, True); + $this->customer_router_ipv6_address = $var; + + return $this; + } + + /** + * This field is not available. + * + * Generated from protobuf field optional string customer_router_ipv6_interface_id = 380994308; + * @return string + */ + public function getCustomerRouterIpv6InterfaceId() + { + return isset($this->customer_router_ipv6_interface_id) ? $this->customer_router_ipv6_interface_id : ''; + } + + public function hasCustomerRouterIpv6InterfaceId() + { + return isset($this->customer_router_ipv6_interface_id); + } + + public function clearCustomerRouterIpv6InterfaceId() + { + unset($this->customer_router_ipv6_interface_id); + } + + /** + * This field is not available. + * + * Generated from protobuf field optional string customer_router_ipv6_interface_id = 380994308; + * @param string $var + * @return $this + */ + public function setCustomerRouterIpv6InterfaceId($var) + { + GPBUtil::checkString($var, True); + $this->customer_router_ipv6_interface_id = $var; + + return $this; + } + + /** + * [Output Only] Dataplane version for this InterconnectAttachment. This field is only present for Dataplane version 2 and higher. Absence of this field in the API output indicates that the Dataplane is version 1. + * + * Generated from protobuf field optional int32 dataplane_version = 34920075; + * @return int + */ + public function getDataplaneVersion() + { + return isset($this->dataplane_version) ? $this->dataplane_version : 0; + } + + public function hasDataplaneVersion() + { + return isset($this->dataplane_version); + } + + public function clearDataplaneVersion() + { + unset($this->dataplane_version); + } + + /** + * [Output Only] Dataplane version for this InterconnectAttachment. This field is only present for Dataplane version 2 and higher. Absence of this field in the API output indicates that the Dataplane is version 1. + * + * Generated from protobuf field optional int32 dataplane_version = 34920075; + * @param int $var + * @return $this + */ + public function setDataplaneVersion($var) + { + GPBUtil::checkInt32($var); + $this->dataplane_version = $var; + + return $this; + } + + /** + * An optional description of this resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Desired availability domain for the attachment. Only available for type PARTNER, at creation time, and can take one of the following values: - AVAILABILITY_DOMAIN_ANY - AVAILABILITY_DOMAIN_1 - AVAILABILITY_DOMAIN_2 For improved reliability, customers should configure a pair of attachments, one per availability domain. The selected availability domain will be provided to the Partner via the pairing key, so that the provisioned circuit will lie in the specified domain. If not specified, the value will default to AVAILABILITY_DOMAIN_ANY. + * Check the EdgeAvailabilityDomain enum for the list of possible values. + * + * Generated from protobuf field optional string edge_availability_domain = 71289510; + * @return string + */ + public function getEdgeAvailabilityDomain() + { + return isset($this->edge_availability_domain) ? $this->edge_availability_domain : ''; + } + + public function hasEdgeAvailabilityDomain() + { + return isset($this->edge_availability_domain); + } + + public function clearEdgeAvailabilityDomain() + { + unset($this->edge_availability_domain); + } + + /** + * Desired availability domain for the attachment. Only available for type PARTNER, at creation time, and can take one of the following values: - AVAILABILITY_DOMAIN_ANY - AVAILABILITY_DOMAIN_1 - AVAILABILITY_DOMAIN_2 For improved reliability, customers should configure a pair of attachments, one per availability domain. The selected availability domain will be provided to the Partner via the pairing key, so that the provisioned circuit will lie in the specified domain. If not specified, the value will default to AVAILABILITY_DOMAIN_ANY. + * Check the EdgeAvailabilityDomain enum for the list of possible values. + * + * Generated from protobuf field optional string edge_availability_domain = 71289510; + * @param string $var + * @return $this + */ + public function setEdgeAvailabilityDomain($var) + { + GPBUtil::checkString($var, True); + $this->edge_availability_domain = $var; + + return $this; + } + + /** + * Indicates the user-supplied encryption option of this VLAN attachment (interconnectAttachment). Can only be specified at attachment creation for PARTNER or DEDICATED attachments. Possible values are: - NONE - This is the default value, which means that the VLAN attachment carries unencrypted traffic. VMs are able to send traffic to, or receive traffic from, such a VLAN attachment. - IPSEC - The VLAN attachment carries only encrypted traffic that is encrypted by an IPsec device, such as an HA VPN gateway or third-party IPsec VPN. VMs cannot directly send traffic to, or receive traffic from, such a VLAN attachment. To use *HA VPN over Cloud Interconnect*, the VLAN attachment must be created with this option. + * Check the Encryption enum for the list of possible values. + * + * Generated from protobuf field optional string encryption = 97980291; + * @return string + */ + public function getEncryption() + { + return isset($this->encryption) ? $this->encryption : ''; + } + + public function hasEncryption() + { + return isset($this->encryption); + } + + public function clearEncryption() + { + unset($this->encryption); + } + + /** + * Indicates the user-supplied encryption option of this VLAN attachment (interconnectAttachment). Can only be specified at attachment creation for PARTNER or DEDICATED attachments. Possible values are: - NONE - This is the default value, which means that the VLAN attachment carries unencrypted traffic. VMs are able to send traffic to, or receive traffic from, such a VLAN attachment. - IPSEC - The VLAN attachment carries only encrypted traffic that is encrypted by an IPsec device, such as an HA VPN gateway or third-party IPsec VPN. VMs cannot directly send traffic to, or receive traffic from, such a VLAN attachment. To use *HA VPN over Cloud Interconnect*, the VLAN attachment must be created with this option. + * Check the Encryption enum for the list of possible values. + * + * Generated from protobuf field optional string encryption = 97980291; + * @param string $var + * @return $this + */ + public function setEncryption($var) + { + GPBUtil::checkString($var, True); + $this->encryption = $var; + + return $this; + } + + /** + * [Output Only] Google reference ID, to be used when raising support tickets with Google or otherwise to debug backend connectivity issues. [Deprecated] This field is not used. + * + * Generated from protobuf field optional string google_reference_id = 534944469; + * @return string + */ + public function getGoogleReferenceId() + { + return isset($this->google_reference_id) ? $this->google_reference_id : ''; + } + + public function hasGoogleReferenceId() + { + return isset($this->google_reference_id); + } + + public function clearGoogleReferenceId() + { + unset($this->google_reference_id); + } + + /** + * [Output Only] Google reference ID, to be used when raising support tickets with Google or otherwise to debug backend connectivity issues. [Deprecated] This field is not used. + * + * Generated from protobuf field optional string google_reference_id = 534944469; + * @param string $var + * @return $this + */ + public function setGoogleReferenceId($var) + { + GPBUtil::checkString($var, True); + $this->google_reference_id = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * URL of the underlying Interconnect object that this attachment's traffic will traverse through. + * + * Generated from protobuf field optional string interconnect = 224601230; + * @return string + */ + public function getInterconnect() + { + return isset($this->interconnect) ? $this->interconnect : ''; + } + + public function hasInterconnect() + { + return isset($this->interconnect); + } + + public function clearInterconnect() + { + unset($this->interconnect); + } + + /** + * URL of the underlying Interconnect object that this attachment's traffic will traverse through. + * + * Generated from protobuf field optional string interconnect = 224601230; + * @param string $var + * @return $this + */ + public function setInterconnect($var) + { + GPBUtil::checkString($var, True); + $this->interconnect = $var; + + return $this; + } + + /** + * A list of URLs of addresses that have been reserved for the VLAN attachment. Used only for the VLAN attachment that has the encryption option as IPSEC. The addresses must be regional internal IP address ranges. When creating an HA VPN gateway over the VLAN attachment, if the attachment is configured to use a regional internal IP address, then the VPN gateway's IP address is allocated from the IP address range specified here. For example, if the HA VPN gateway's interface 0 is paired to this VLAN attachment, then a regional internal IP address for the VPN gateway interface 0 will be allocated from the IP address specified for this VLAN attachment. If this field is not specified when creating the VLAN attachment, then later on when creating an HA VPN gateway on this VLAN attachment, the HA VPN gateway's IP address is allocated from the regional external IP address pool. + * + * Generated from protobuf field repeated string ipsec_internal_addresses = 407648565; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIpsecInternalAddresses() + { + return $this->ipsec_internal_addresses; + } + + /** + * A list of URLs of addresses that have been reserved for the VLAN attachment. Used only for the VLAN attachment that has the encryption option as IPSEC. The addresses must be regional internal IP address ranges. When creating an HA VPN gateway over the VLAN attachment, if the attachment is configured to use a regional internal IP address, then the VPN gateway's IP address is allocated from the IP address range specified here. For example, if the HA VPN gateway's interface 0 is paired to this VLAN attachment, then a regional internal IP address for the VPN gateway interface 0 will be allocated from the IP address specified for this VLAN attachment. If this field is not specified when creating the VLAN attachment, then later on when creating an HA VPN gateway on this VLAN attachment, the HA VPN gateway's IP address is allocated from the regional external IP address pool. + * + * Generated from protobuf field repeated string ipsec_internal_addresses = 407648565; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIpsecInternalAddresses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ipsec_internal_addresses = $arr; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#interconnectAttachment for interconnect attachments. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#interconnectAttachment for interconnect attachments. + * + * 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; + } + + /** + * A fingerprint for the labels being applied to this InterconnectAttachment, 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 InterconnectAttachment. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @return string + */ + public function getLabelFingerprint() + { + return isset($this->label_fingerprint) ? $this->label_fingerprint : ''; + } + + public function hasLabelFingerprint() + { + return isset($this->label_fingerprint); + } + + public function clearLabelFingerprint() + { + unset($this->label_fingerprint); + } + + /** + * A fingerprint for the labels being applied to this InterconnectAttachment, 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 InterconnectAttachment. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @param string $var + * @return $this + */ + public function setLabelFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->label_fingerprint = $var; + + return $this; + } + + /** + * 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. + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->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. + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Maximum Transmission Unit (MTU), in bytes, of packets passing through this interconnect attachment. Only 1440 and 1500 are allowed. If not specified, the value will default to 1440. + * + * Generated from protobuf field optional int32 mtu = 108462; + * @return int + */ + public function getMtu() + { + return isset($this->mtu) ? $this->mtu : 0; + } + + public function hasMtu() + { + return isset($this->mtu); + } + + public function clearMtu() + { + unset($this->mtu); + } + + /** + * Maximum Transmission Unit (MTU), in bytes, of packets passing through this interconnect attachment. Only 1440 and 1500 are allowed. If not specified, the value will default to 1440. + * + * Generated from protobuf field optional int32 mtu = 108462; + * @param int $var + * @return $this + */ + public function setMtu($var) + { + GPBUtil::checkInt32($var); + $this->mtu = $var; + + return $this; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * [Output Only] The current status of whether or not this interconnect attachment is functional, which can take one of the following values: - OS_ACTIVE: The attachment has been turned up and is ready to use. - OS_UNPROVISIONED: The attachment is not ready to use yet, because turnup is not complete. + * Check the OperationalStatus enum for the list of possible values. + * + * Generated from protobuf field optional string operational_status = 201070847; + * @return string + */ + public function getOperationalStatus() + { + return isset($this->operational_status) ? $this->operational_status : ''; + } + + public function hasOperationalStatus() + { + return isset($this->operational_status); + } + + public function clearOperationalStatus() + { + unset($this->operational_status); + } + + /** + * [Output Only] The current status of whether or not this interconnect attachment is functional, which can take one of the following values: - OS_ACTIVE: The attachment has been turned up and is ready to use. - OS_UNPROVISIONED: The attachment is not ready to use yet, because turnup is not complete. + * Check the OperationalStatus enum for the list of possible values. + * + * Generated from protobuf field optional string operational_status = 201070847; + * @param string $var + * @return $this + */ + public function setOperationalStatus($var) + { + GPBUtil::checkString($var, True); + $this->operational_status = $var; + + return $this; + } + + /** + * [Output only for type PARTNER. Input only for PARTNER_PROVIDER. Not present for DEDICATED]. The opaque identifier of a PARTNER attachment used to initiate provisioning with a selected partner. Of the form "XXXXX/region/domain" + * + * Generated from protobuf field optional string pairing_key = 439695464; + * @return string + */ + public function getPairingKey() + { + return isset($this->pairing_key) ? $this->pairing_key : ''; + } + + public function hasPairingKey() + { + return isset($this->pairing_key); + } + + public function clearPairingKey() + { + unset($this->pairing_key); + } + + /** + * [Output only for type PARTNER. Input only for PARTNER_PROVIDER. Not present for DEDICATED]. The opaque identifier of a PARTNER attachment used to initiate provisioning with a selected partner. Of the form "XXXXX/region/domain" + * + * Generated from protobuf field optional string pairing_key = 439695464; + * @param string $var + * @return $this + */ + public function setPairingKey($var) + { + GPBUtil::checkString($var, True); + $this->pairing_key = $var; + + return $this; + } + + /** + * Optional BGP ASN for the router supplied by a Layer 3 Partner if they configured BGP on behalf of the customer. Output only for PARTNER type, input only for PARTNER_PROVIDER, not available for DEDICATED. + * + * Generated from protobuf field optional int64 partner_asn = 438166149; + * @return int|string + */ + public function getPartnerAsn() + { + return isset($this->partner_asn) ? $this->partner_asn : 0; + } + + public function hasPartnerAsn() + { + return isset($this->partner_asn); + } + + public function clearPartnerAsn() + { + unset($this->partner_asn); + } + + /** + * Optional BGP ASN for the router supplied by a Layer 3 Partner if they configured BGP on behalf of the customer. Output only for PARTNER type, input only for PARTNER_PROVIDER, not available for DEDICATED. + * + * Generated from protobuf field optional int64 partner_asn = 438166149; + * @param int|string $var + * @return $this + */ + public function setPartnerAsn($var) + { + GPBUtil::checkInt64($var); + $this->partner_asn = $var; + + return $this; + } + + /** + * Informational metadata about Partner attachments from Partners to display to customers. Output only for PARTNER type, mutable for PARTNER_PROVIDER, not available for DEDICATED. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata partner_metadata = 65908934; + * @return \Google\Cloud\Compute\V1\InterconnectAttachmentPartnerMetadata|null + */ + public function getPartnerMetadata() + { + return $this->partner_metadata; + } + + public function hasPartnerMetadata() + { + return isset($this->partner_metadata); + } + + public function clearPartnerMetadata() + { + unset($this->partner_metadata); + } + + /** + * Informational metadata about Partner attachments from Partners to display to customers. Output only for PARTNER type, mutable for PARTNER_PROVIDER, not available for DEDICATED. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata partner_metadata = 65908934; + * @param \Google\Cloud\Compute\V1\InterconnectAttachmentPartnerMetadata $var + * @return $this + */ + public function setPartnerMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InterconnectAttachmentPartnerMetadata::class); + $this->partner_metadata = $var; + + return $this; + } + + /** + * [Output Only] Information specific to an InterconnectAttachment. This property is populated if the interconnect that this is attached to is of type DEDICATED. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectAttachmentPrivateInfo private_interconnect_info = 237270531; + * @return \Google\Cloud\Compute\V1\InterconnectAttachmentPrivateInfo|null + */ + public function getPrivateInterconnectInfo() + { + return $this->private_interconnect_info; + } + + public function hasPrivateInterconnectInfo() + { + return isset($this->private_interconnect_info); + } + + public function clearPrivateInterconnectInfo() + { + unset($this->private_interconnect_info); + } + + /** + * [Output Only] Information specific to an InterconnectAttachment. This property is populated if the interconnect that this is attached to is of type DEDICATED. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectAttachmentPrivateInfo private_interconnect_info = 237270531; + * @param \Google\Cloud\Compute\V1\InterconnectAttachmentPrivateInfo $var + * @return $this + */ + public function setPrivateInterconnectInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InterconnectAttachmentPrivateInfo::class); + $this->private_interconnect_info = $var; + + return $this; + } + + /** + * [Output Only] URL of the region where the regional interconnect attachment resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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 regional interconnect attachment resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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] If the attachment is on a Cross-Cloud Interconnect connection, this field contains the interconnect's remote location service provider. Example values: "Amazon Web Services" "Microsoft Azure". The field is set only for attachments on Cross-Cloud Interconnect connections. Its value is copied from the InterconnectRemoteLocation remoteService field. + * + * Generated from protobuf field optional string remote_service = 391954364; + * @return string + */ + public function getRemoteService() + { + return isset($this->remote_service) ? $this->remote_service : ''; + } + + public function hasRemoteService() + { + return isset($this->remote_service); + } + + public function clearRemoteService() + { + unset($this->remote_service); + } + + /** + * [Output Only] If the attachment is on a Cross-Cloud Interconnect connection, this field contains the interconnect's remote location service provider. Example values: "Amazon Web Services" "Microsoft Azure". The field is set only for attachments on Cross-Cloud Interconnect connections. Its value is copied from the InterconnectRemoteLocation remoteService field. + * + * Generated from protobuf field optional string remote_service = 391954364; + * @param string $var + * @return $this + */ + public function setRemoteService($var) + { + GPBUtil::checkString($var, True); + $this->remote_service = $var; + + return $this; + } + + /** + * 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. + * + * Generated from protobuf field optional string router = 148608841; + * @return string + */ + public function getRouter() + { + return isset($this->router) ? $this->router : ''; + } + + public function hasRouter() + { + return isset($this->router); + } + + public function clearRouter() + { + unset($this->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. + * + * Generated from protobuf field optional string router = 148608841; + * @param string $var + * @return $this + */ + public function setRouter($var) + { + GPBUtil::checkString($var, True); + $this->router = $var; + + return $this; + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + * @return bool + */ + public function getSatisfiesPzs() + { + return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; + } + + public function hasSatisfiesPzs() + { + return isset($this->satisfies_pzs); + } + + public function clearSatisfiesPzs() + { + unset($this->satisfies_pzs); + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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; + } + + /** + * The stack type for this interconnect attachment to identify whether the IPv6 feature is enabled or not. If not specified, IPV4_ONLY will be used. This field can be both set at interconnect attachments creation and update interconnect attachment operations. + * Check the StackType enum for the list of possible values. + * + * Generated from protobuf field optional string stack_type = 425908881; + * @return string + */ + public function getStackType() + { + return isset($this->stack_type) ? $this->stack_type : ''; + } + + public function hasStackType() + { + return isset($this->stack_type); + } + + public function clearStackType() + { + unset($this->stack_type); + } + + /** + * The stack type for this interconnect attachment to identify whether the IPv6 feature is enabled or not. If not specified, IPV4_ONLY will be used. This field can be both set at interconnect attachments creation and update interconnect attachment operations. + * Check the StackType enum for the list of possible values. + * + * Generated from protobuf field optional string stack_type = 425908881; + * @param string $var + * @return $this + */ + public function setStackType($var) + { + GPBUtil::checkString($var, True); + $this->stack_type = $var; + + return $this; + } + + /** + * [Output Only] The current state of this attachment's functionality. Enum values ACTIVE and UNPROVISIONED are shared by DEDICATED/PRIVATE, PARTNER, and PARTNER_PROVIDER interconnect attachments, while enum values PENDING_PARTNER, PARTNER_REQUEST_RECEIVED, and PENDING_CUSTOMER are used for only PARTNER and PARTNER_PROVIDER interconnect attachments. This state can take one of the following values: - ACTIVE: The attachment has been turned up and is ready to use. - UNPROVISIONED: The attachment is not ready to use yet, because turnup is not complete. - PENDING_PARTNER: A newly-created PARTNER attachment that has not yet been configured on the Partner side. - PARTNER_REQUEST_RECEIVED: A PARTNER attachment is in the process of provisioning after a PARTNER_PROVIDER attachment was created that references it. - PENDING_CUSTOMER: A PARTNER or PARTNER_PROVIDER attachment that is waiting for a customer to activate it. - DEFUNCT: The attachment was deleted externally and is no longer functional. This could be because the associated Interconnect was removed, or because the other side of a Partner attachment was deleted. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @return string + */ + public function getState() + { + return isset($this->state) ? $this->state : ''; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * [Output Only] The current state of this attachment's functionality. Enum values ACTIVE and UNPROVISIONED are shared by DEDICATED/PRIVATE, PARTNER, and PARTNER_PROVIDER interconnect attachments, while enum values PENDING_PARTNER, PARTNER_REQUEST_RECEIVED, and PENDING_CUSTOMER are used for only PARTNER and PARTNER_PROVIDER interconnect attachments. This state can take one of the following values: - ACTIVE: The attachment has been turned up and is ready to use. - UNPROVISIONED: The attachment is not ready to use yet, because turnup is not complete. - PENDING_PARTNER: A newly-created PARTNER attachment that has not yet been configured on the Partner side. - PARTNER_REQUEST_RECEIVED: A PARTNER attachment is in the process of provisioning after a PARTNER_PROVIDER attachment was created that references it. - PENDING_CUSTOMER: A PARTNER or PARTNER_PROVIDER attachment that is waiting for a customer to activate it. - DEFUNCT: The attachment was deleted externally and is no longer functional. This could be because the associated Interconnect was removed, or because the other side of a Partner attachment was deleted. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + + /** + * Length of the IPv4 subnet mask. Allowed values: - 29 (default) - 30 The default value is 29, except for Cross-Cloud Interconnect connections that use an InterconnectRemoteLocation with a constraints.subnetLengthRange.min equal to 30. For example, connections that use an Azure remote location fall into this category. In these cases, the default value is 30, and requesting 29 returns an error. Where both 29 and 30 are allowed, 29 is preferred, because it gives Google Cloud Support more debugging visibility. + * + * Generated from protobuf field optional int32 subnet_length = 279831048; + * @return int + */ + public function getSubnetLength() + { + return isset($this->subnet_length) ? $this->subnet_length : 0; + } + + public function hasSubnetLength() + { + return isset($this->subnet_length); + } + + public function clearSubnetLength() + { + unset($this->subnet_length); + } + + /** + * Length of the IPv4 subnet mask. Allowed values: - 29 (default) - 30 The default value is 29, except for Cross-Cloud Interconnect connections that use an InterconnectRemoteLocation with a constraints.subnetLengthRange.min equal to 30. For example, connections that use an Azure remote location fall into this category. In these cases, the default value is 30, and requesting 29 returns an error. Where both 29 and 30 are allowed, 29 is preferred, because it gives Google Cloud Support more debugging visibility. + * + * Generated from protobuf field optional int32 subnet_length = 279831048; + * @param int $var + * @return $this + */ + public function setSubnetLength($var) + { + GPBUtil::checkInt32($var); + $this->subnet_length = $var; + + return $this; + } + + /** + * 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. + * + * Generated from protobuf field optional string type = 3575610; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * 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. + * + * Generated from protobuf field optional string type = 3575610; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * 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 + */ + public function getVlanTag8021Q() + { + return isset($this->vlan_tag8021q) ? $this->vlan_tag8021q : 0; + } + + public function hasVlanTag8021Q() + { + return isset($this->vlan_tag8021q); + } + + public function clearVlanTag8021Q() + { + unset($this->vlan_tag8021q); + } + + /** + * 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 + * @return $this + */ + public function setVlanTag8021Q($var) + { + GPBUtil::checkInt32($var); + $this->vlan_tag8021q = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/Bandwidth.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/Bandwidth.php new file mode 100644 index 000000000000..479934e70b30 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/Bandwidth.php @@ -0,0 +1,134 @@ +google.cloud.compute.v1.InterconnectAttachment.Bandwidth + */ +class Bandwidth +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_BANDWIDTH = 0; + */ + const UNDEFINED_BANDWIDTH = 0; + /** + * 100 Mbit/s + * + * Generated from protobuf enum BPS_100M = 49547958; + */ + const BPS_100M = 49547958; + /** + * 10 Gbit/s + * + * Generated from protobuf enum BPS_10G = 278693006; + */ + const BPS_10G = 278693006; + /** + * 1 Gbit/s + * + * Generated from protobuf enum BPS_1G = 355358448; + */ + const BPS_1G = 355358448; + /** + * 200 Mbit/s + * + * Generated from protobuf enum BPS_200M = 49577749; + */ + const BPS_200M = 49577749; + /** + * 20 Gbit/s + * + * Generated from protobuf enum BPS_20G = 278693967; + */ + const BPS_20G = 278693967; + /** + * 2 Gbit/s + * + * Generated from protobuf enum BPS_2G = 355358479; + */ + const BPS_2G = 355358479; + /** + * 300 Mbit/s + * + * Generated from protobuf enum BPS_300M = 49607540; + */ + const BPS_300M = 49607540; + /** + * 400 Mbit/s + * + * Generated from protobuf enum BPS_400M = 49637331; + */ + const BPS_400M = 49637331; + /** + * 500 Mbit/s + * + * Generated from protobuf enum BPS_500M = 49667122; + */ + const BPS_500M = 49667122; + /** + * 50 Gbit/s + * + * Generated from protobuf enum BPS_50G = 278696850; + */ + const BPS_50G = 278696850; + /** + * 50 Mbit/s + * + * Generated from protobuf enum BPS_50M = 278696856; + */ + const BPS_50M = 278696856; + /** + * 5 Gbit/s + * + * Generated from protobuf enum BPS_5G = 355358572; + */ + const BPS_5G = 355358572; + + private static $valueToName = [ + self::UNDEFINED_BANDWIDTH => 'UNDEFINED_BANDWIDTH', + self::BPS_100M => 'BPS_100M', + self::BPS_10G => 'BPS_10G', + self::BPS_1G => 'BPS_1G', + self::BPS_200M => 'BPS_200M', + self::BPS_20G => 'BPS_20G', + self::BPS_2G => 'BPS_2G', + self::BPS_300M => 'BPS_300M', + self::BPS_400M => 'BPS_400M', + self::BPS_500M => 'BPS_500M', + self::BPS_50G => 'BPS_50G', + self::BPS_50M => 'BPS_50M', + self::BPS_5G => 'BPS_5G', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Bandwidth::class, \Google\Cloud\Compute\V1\InterconnectAttachment_Bandwidth::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/EdgeAvailabilityDomain.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/EdgeAvailabilityDomain.php new file mode 100644 index 000000000000..78f335034303 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/EdgeAvailabilityDomain.php @@ -0,0 +1,65 @@ +google.cloud.compute.v1.InterconnectAttachment.EdgeAvailabilityDomain + */ +class EdgeAvailabilityDomain +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_EDGE_AVAILABILITY_DOMAIN = 0; + */ + const UNDEFINED_EDGE_AVAILABILITY_DOMAIN = 0; + /** + * Generated from protobuf enum AVAILABILITY_DOMAIN_1 = 349552090; + */ + const AVAILABILITY_DOMAIN_1 = 349552090; + /** + * Generated from protobuf enum AVAILABILITY_DOMAIN_2 = 349552091; + */ + const AVAILABILITY_DOMAIN_2 = 349552091; + /** + * Generated from protobuf enum AVAILABILITY_DOMAIN_ANY = 375256373; + */ + const AVAILABILITY_DOMAIN_ANY = 375256373; + + private static $valueToName = [ + self::UNDEFINED_EDGE_AVAILABILITY_DOMAIN => 'UNDEFINED_EDGE_AVAILABILITY_DOMAIN', + self::AVAILABILITY_DOMAIN_1 => 'AVAILABILITY_DOMAIN_1', + self::AVAILABILITY_DOMAIN_2 => 'AVAILABILITY_DOMAIN_2', + self::AVAILABILITY_DOMAIN_ANY => 'AVAILABILITY_DOMAIN_ANY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(EdgeAvailabilityDomain::class, \Google\Cloud\Compute\V1\InterconnectAttachment_EdgeAvailabilityDomain::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/Encryption.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/Encryption.php new file mode 100644 index 000000000000..ab56fa663850 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/Encryption.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.InterconnectAttachment.Encryption + */ +class Encryption +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ENCRYPTION = 0; + */ + const UNDEFINED_ENCRYPTION = 0; + /** + * The interconnect attachment will carry only encrypted traffic that is encrypted by an IPsec device such as HA VPN gateway; VMs cannot directly send traffic to or receive traffic from such an interconnect attachment. To use HA VPN over Cloud Interconnect, the interconnect attachment must be created with this option. + * + * Generated from protobuf enum IPSEC = 69882282; + */ + const IPSEC = 69882282; + /** + * This is the default value, which means the Interconnect Attachment will carry unencrypted traffic. VMs will be able to send traffic to or receive traffic from such interconnect attachment. + * + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + + private static $valueToName = [ + self::UNDEFINED_ENCRYPTION => 'UNDEFINED_ENCRYPTION', + self::IPSEC => 'IPSEC', + self::NONE => 'NONE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Encryption::class, \Google\Cloud\Compute\V1\InterconnectAttachment_Encryption::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/OperationalStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/OperationalStatus.php new file mode 100644 index 000000000000..cfbfe1e7ecb7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/OperationalStatus.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.InterconnectAttachment.OperationalStatus + */ +class OperationalStatus +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_OPERATIONAL_STATUS = 0; + */ + const UNDEFINED_OPERATIONAL_STATUS = 0; + /** + * Indicates that attachment has been turned up and is ready to use. + * + * Generated from protobuf enum OS_ACTIVE = 55721409; + */ + const OS_ACTIVE = 55721409; + /** + * Indicates that attachment is not ready to use yet, because turnup is not complete. + * + * Generated from protobuf enum OS_UNPROVISIONED = 239771840; + */ + const OS_UNPROVISIONED = 239771840; + + private static $valueToName = [ + self::UNDEFINED_OPERATIONAL_STATUS => 'UNDEFINED_OPERATIONAL_STATUS', + self::OS_ACTIVE => 'OS_ACTIVE', + self::OS_UNPROVISIONED => 'OS_UNPROVISIONED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(OperationalStatus::class, \Google\Cloud\Compute\V1\InterconnectAttachment_OperationalStatus::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/StackType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/StackType.php new file mode 100644 index 000000000000..a076777d04da --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/StackType.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.InterconnectAttachment.StackType + */ +class StackType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STACK_TYPE = 0; + */ + const UNDEFINED_STACK_TYPE = 0; + /** + * The interconnect attachment can have both IPv4 and IPv6 addresses. + * + * Generated from protobuf enum IPV4_IPV6 = 22197249; + */ + const IPV4_IPV6 = 22197249; + /** + * The interconnect attachment will only be assigned IPv4 addresses. + * + * Generated from protobuf enum IPV4_ONLY = 22373798; + */ + const IPV4_ONLY = 22373798; + + private static $valueToName = [ + self::UNDEFINED_STACK_TYPE => 'UNDEFINED_STACK_TYPE', + self::IPV4_IPV6 => 'IPV4_IPV6', + self::IPV4_ONLY => 'IPV4_ONLY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StackType::class, \Google\Cloud\Compute\V1\InterconnectAttachment_StackType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/State.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/State.php new file mode 100644 index 000000000000..bfec0621fc86 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/State.php @@ -0,0 +1,97 @@ +google.cloud.compute.v1.InterconnectAttachment.State + */ +class State +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATE = 0; + */ + const UNDEFINED_STATE = 0; + /** + * Indicates that attachment has been turned up and is ready to use. + * + * Generated from protobuf enum ACTIVE = 314733318; + */ + const ACTIVE = 314733318; + /** + * The attachment was deleted externally and is no longer functional. This could be because the associated Interconnect was wiped out, or because the other side of a Partner attachment was deleted. + * + * Generated from protobuf enum DEFUNCT = 115891759; + */ + const DEFUNCT = 115891759; + /** + * A PARTNER attachment is in the process of provisioning after a PARTNER_PROVIDER attachment was created that references it. + * + * Generated from protobuf enum PARTNER_REQUEST_RECEIVED = 513587304; + */ + const PARTNER_REQUEST_RECEIVED = 513587304; + /** + * PARTNER or PARTNER_PROVIDER attachment that is waiting for the customer to activate. + * + * Generated from protobuf enum PENDING_CUSTOMER = 167494054; + */ + const PENDING_CUSTOMER = 167494054; + /** + * A newly created PARTNER attachment that has not yet been configured on the Partner side. + * + * Generated from protobuf enum PENDING_PARTNER = 387890656; + */ + const PENDING_PARTNER = 387890656; + /** + * Generated from protobuf enum STATE_UNSPECIFIED = 470755401; + */ + const STATE_UNSPECIFIED = 470755401; + /** + * Indicates that attachment is not ready to use yet, because turnup is not complete. + * + * Generated from protobuf enum UNPROVISIONED = 517333979; + */ + const UNPROVISIONED = 517333979; + + private static $valueToName = [ + self::UNDEFINED_STATE => 'UNDEFINED_STATE', + self::ACTIVE => 'ACTIVE', + self::DEFUNCT => 'DEFUNCT', + self::PARTNER_REQUEST_RECEIVED => 'PARTNER_REQUEST_RECEIVED', + self::PENDING_CUSTOMER => 'PENDING_CUSTOMER', + self::PENDING_PARTNER => 'PENDING_PARTNER', + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::UNPROVISIONED => 'UNPROVISIONED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Compute\V1\InterconnectAttachment_State::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/Type.php new file mode 100644 index 000000000000..0d76623188f5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachment/Type.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.InterconnectAttachment.Type + */ +class Type +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TYPE = 0; + */ + const UNDEFINED_TYPE = 0; + /** + * Attachment to a dedicated interconnect. + * + * Generated from protobuf enum DEDICATED = 258411983; + */ + const DEDICATED = 258411983; + /** + * Attachment to a partner interconnect, created by the customer. + * + * Generated from protobuf enum PARTNER = 461924520; + */ + const PARTNER = 461924520; + /** + * Attachment to a partner interconnect, created by the partner. + * + * Generated from protobuf enum PARTNER_PROVIDER = 483261352; + */ + const PARTNER_PROVIDER = 483261352; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::DEDICATED => 'DEDICATED', + self::PARTNER => 'PARTNER', + self::PARTNER_PROVIDER => 'PARTNER_PROVIDER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Compute\V1\InterconnectAttachment_Type::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentAggregatedList.php new file mode 100644 index 000000000000..83f05c11b261 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.InterconnectAttachmentAggregatedList + */ +class InterconnectAttachmentAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of InterconnectAttachmentsScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#interconnectAttachmentAggregatedList for aggregated lists of interconnect attachments. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 InterconnectAttachmentsScopedList resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#interconnectAttachmentAggregatedList for aggregated lists of interconnect attachments. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 InterconnectAttachmentsScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of InterconnectAttachmentsScopedList 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\InterconnectAttachmentsScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#interconnectAttachmentAggregatedList for aggregated lists of interconnect attachments. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#interconnectAttachmentAggregatedList for aggregated lists of interconnect attachments. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentConfigurationConstraints.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentConfigurationConstraints.php new file mode 100644 index 000000000000..86ec168818c2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentConfigurationConstraints.php @@ -0,0 +1,114 @@ +google.cloud.compute.v1.InterconnectAttachmentConfigurationConstraints + */ +class InterconnectAttachmentConfigurationConstraints extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Whether the attachment's BGP session requires/allows/disallows BGP MD5 authentication. This can take one of the following values: MD5_OPTIONAL, MD5_REQUIRED, MD5_UNSUPPORTED. For example, a Cross-Cloud Interconnect connection to a remote cloud provider that requires BGP MD5 authentication has the interconnectRemoteLocation attachment_configuration_constraints.bgp_md5 field set to MD5_REQUIRED, and that property is propagated to the attachment. Similarly, if BGP MD5 is MD5_UNSUPPORTED, an error is returned if MD5 is requested. + * Check the BgpMd5 enum for the list of possible values. + * + * Generated from protobuf field optional string bgp_md5 = 373093386; + */ + protected $bgp_md5 = null; + /** + * [Output Only] List of ASN ranges that the remote location is known to support. Formatted as an array of inclusive ranges {min: min-value, max: max-value}. For example, [{min: 123, max: 123}, {min: 64512, max: 65534}] allows the peer ASN to be 123 or anything in the range 64512-65534. This field is only advisory. Although the API accepts other ranges, these are the ranges that we recommend. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange bgp_peer_asn_ranges = 475946370; + */ + private $bgp_peer_asn_ranges; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $bgp_md5 + * [Output Only] Whether the attachment's BGP session requires/allows/disallows BGP MD5 authentication. This can take one of the following values: MD5_OPTIONAL, MD5_REQUIRED, MD5_UNSUPPORTED. For example, a Cross-Cloud Interconnect connection to a remote cloud provider that requires BGP MD5 authentication has the interconnectRemoteLocation attachment_configuration_constraints.bgp_md5 field set to MD5_REQUIRED, and that property is propagated to the attachment. Similarly, if BGP MD5 is MD5_UNSUPPORTED, an error is returned if MD5 is requested. + * Check the BgpMd5 enum for the list of possible values. + * @type array<\Google\Cloud\Compute\V1\InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange>|\Google\Protobuf\Internal\RepeatedField $bgp_peer_asn_ranges + * [Output Only] List of ASN ranges that the remote location is known to support. Formatted as an array of inclusive ranges {min: min-value, max: max-value}. For example, [{min: 123, max: 123}, {min: 64512, max: 65534}] allows the peer ASN to be 123 or anything in the range 64512-65534. This field is only advisory. Although the API accepts other ranges, these are the ranges that we recommend. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Whether the attachment's BGP session requires/allows/disallows BGP MD5 authentication. This can take one of the following values: MD5_OPTIONAL, MD5_REQUIRED, MD5_UNSUPPORTED. For example, a Cross-Cloud Interconnect connection to a remote cloud provider that requires BGP MD5 authentication has the interconnectRemoteLocation attachment_configuration_constraints.bgp_md5 field set to MD5_REQUIRED, and that property is propagated to the attachment. Similarly, if BGP MD5 is MD5_UNSUPPORTED, an error is returned if MD5 is requested. + * Check the BgpMd5 enum for the list of possible values. + * + * Generated from protobuf field optional string bgp_md5 = 373093386; + * @return string + */ + public function getBgpMd5() + { + return isset($this->bgp_md5) ? $this->bgp_md5 : ''; + } + + public function hasBgpMd5() + { + return isset($this->bgp_md5); + } + + public function clearBgpMd5() + { + unset($this->bgp_md5); + } + + /** + * [Output Only] Whether the attachment's BGP session requires/allows/disallows BGP MD5 authentication. This can take one of the following values: MD5_OPTIONAL, MD5_REQUIRED, MD5_UNSUPPORTED. For example, a Cross-Cloud Interconnect connection to a remote cloud provider that requires BGP MD5 authentication has the interconnectRemoteLocation attachment_configuration_constraints.bgp_md5 field set to MD5_REQUIRED, and that property is propagated to the attachment. Similarly, if BGP MD5 is MD5_UNSUPPORTED, an error is returned if MD5 is requested. + * Check the BgpMd5 enum for the list of possible values. + * + * Generated from protobuf field optional string bgp_md5 = 373093386; + * @param string $var + * @return $this + */ + public function setBgpMd5($var) + { + GPBUtil::checkString($var, True); + $this->bgp_md5 = $var; + + return $this; + } + + /** + * [Output Only] List of ASN ranges that the remote location is known to support. Formatted as an array of inclusive ranges {min: min-value, max: max-value}. For example, [{min: 123, max: 123}, {min: 64512, max: 65534}] allows the peer ASN to be 123 or anything in the range 64512-65534. This field is only advisory. Although the API accepts other ranges, these are the ranges that we recommend. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange bgp_peer_asn_ranges = 475946370; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBgpPeerAsnRanges() + { + return $this->bgp_peer_asn_ranges; + } + + /** + * [Output Only] List of ASN ranges that the remote location is known to support. Formatted as an array of inclusive ranges {min: min-value, max: max-value}. For example, [{min: 123, max: 123}, {min: 64512, max: 65534}] allows the peer ASN to be 123 or anything in the range 64512-65534. This field is only advisory. Although the API accepts other ranges, these are the ranges that we recommend. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange bgp_peer_asn_ranges = 475946370; + * @param array<\Google\Cloud\Compute\V1\InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBgpPeerAsnRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange::class); + $this->bgp_peer_asn_ranges = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentConfigurationConstraints/BgpMd5.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentConfigurationConstraints/BgpMd5.php new file mode 100644 index 000000000000..92d1f8140aba --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentConfigurationConstraints/BgpMd5.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.InterconnectAttachmentConfigurationConstraints.BgpMd5 + */ +class BgpMd5 +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_BGP_MD5 = 0; + */ + const UNDEFINED_BGP_MD5 = 0; + /** + * MD5_OPTIONAL: BGP MD5 authentication is supported and can optionally be configured. + * + * Generated from protobuf enum MD5_OPTIONAL = 532156673; + */ + const MD5_OPTIONAL = 532156673; + /** + * MD5_REQUIRED: BGP MD5 authentication must be configured. + * + * Generated from protobuf enum MD5_REQUIRED = 218034496; + */ + const MD5_REQUIRED = 218034496; + /** + * MD5_UNSUPPORTED: BGP MD5 authentication must not be configured + * + * Generated from protobuf enum MD5_UNSUPPORTED = 86962388; + */ + const MD5_UNSUPPORTED = 86962388; + + private static $valueToName = [ + self::UNDEFINED_BGP_MD5 => 'UNDEFINED_BGP_MD5', + self::MD5_OPTIONAL => 'MD5_OPTIONAL', + self::MD5_REQUIRED => 'MD5_REQUIRED', + self::MD5_UNSUPPORTED => 'MD5_UNSUPPORTED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BgpMd5::class, \Google\Cloud\Compute\V1\InterconnectAttachmentConfigurationConstraints_BgpMd5::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange.php new file mode 100644 index 000000000000..302380d501e1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange.php @@ -0,0 +1,106 @@ +google.cloud.compute.v1.InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange + */ +class InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional uint32 max = 107876; + */ + protected $max = null; + /** + * Generated from protobuf field optional uint32 min = 108114; + */ + protected $min = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $max + * @type int $min + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional uint32 max = 107876; + * @return int + */ + public function getMax() + { + return isset($this->max) ? $this->max : 0; + } + + public function hasMax() + { + return isset($this->max); + } + + public function clearMax() + { + unset($this->max); + } + + /** + * Generated from protobuf field optional uint32 max = 107876; + * @param int $var + * @return $this + */ + public function setMax($var) + { + GPBUtil::checkUint32($var); + $this->max = $var; + + return $this; + } + + /** + * Generated from protobuf field optional uint32 min = 108114; + * @return int + */ + public function getMin() + { + return isset($this->min) ? $this->min : 0; + } + + public function hasMin() + { + return isset($this->min); + } + + public function clearMin() + { + unset($this->min); + } + + /** + * Generated from protobuf field optional uint32 min = 108114; + * @param int $var + * @return $this + */ + public function setMin($var) + { + GPBUtil::checkUint32($var); + $this->min = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentList.php new file mode 100644 index 000000000000..103857c637e8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.InterconnectAttachmentList + */ +class InterconnectAttachmentList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of InterconnectAttachment resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectAttachment items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#interconnectAttachmentList for lists of interconnect attachments. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\InterconnectAttachment>|\Google\Protobuf\Internal\RepeatedField $items + * A list of InterconnectAttachment resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#interconnectAttachmentList for lists of interconnect attachments. + * @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 InterconnectAttachment resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectAttachment items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of InterconnectAttachment resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectAttachment items = 100526016; + * @param array<\Google\Cloud\Compute\V1\InterconnectAttachment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InterconnectAttachment::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#interconnectAttachmentList for lists of interconnect attachments. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#interconnectAttachmentList for lists of interconnect attachments. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentPartnerMetadata.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentPartnerMetadata.php new file mode 100644 index 000000000000..8c0578b49422 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentPartnerMetadata.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata + */ +class InterconnectAttachmentPartnerMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Plain text name of the Interconnect this attachment is connected to, as displayed in the Partner's portal. For instance "Chicago 1". This value may be validated to match approved Partner values. + * + * Generated from protobuf field optional string interconnect_name = 514963356; + */ + protected $interconnect_name = null; + /** + * Plain text name of the Partner providing this attachment. This value may be validated to match approved Partner values. + * + * Generated from protobuf field optional string partner_name = 161747874; + */ + protected $partner_name = null; + /** + * URL of the Partner's portal for this Attachment. Partners may customise this to be a deep link to the specific resource on the Partner portal. This value may be validated to match approved Partner values. + * + * Generated from protobuf field optional string portal_url = 269182748; + */ + protected $portal_url = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $interconnect_name + * Plain text name of the Interconnect this attachment is connected to, as displayed in the Partner's portal. For instance "Chicago 1". This value may be validated to match approved Partner values. + * @type string $partner_name + * Plain text name of the Partner providing this attachment. This value may be validated to match approved Partner values. + * @type string $portal_url + * URL of the Partner's portal for this Attachment. Partners may customise this to be a deep link to the specific resource on the Partner portal. This value may be validated to match approved Partner values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Plain text name of the Interconnect this attachment is connected to, as displayed in the Partner's portal. For instance "Chicago 1". This value may be validated to match approved Partner values. + * + * Generated from protobuf field optional string interconnect_name = 514963356; + * @return string + */ + public function getInterconnectName() + { + return isset($this->interconnect_name) ? $this->interconnect_name : ''; + } + + public function hasInterconnectName() + { + return isset($this->interconnect_name); + } + + public function clearInterconnectName() + { + unset($this->interconnect_name); + } + + /** + * Plain text name of the Interconnect this attachment is connected to, as displayed in the Partner's portal. For instance "Chicago 1". This value may be validated to match approved Partner values. + * + * Generated from protobuf field optional string interconnect_name = 514963356; + * @param string $var + * @return $this + */ + public function setInterconnectName($var) + { + GPBUtil::checkString($var, True); + $this->interconnect_name = $var; + + return $this; + } + + /** + * Plain text name of the Partner providing this attachment. This value may be validated to match approved Partner values. + * + * Generated from protobuf field optional string partner_name = 161747874; + * @return string + */ + public function getPartnerName() + { + return isset($this->partner_name) ? $this->partner_name : ''; + } + + public function hasPartnerName() + { + return isset($this->partner_name); + } + + public function clearPartnerName() + { + unset($this->partner_name); + } + + /** + * Plain text name of the Partner providing this attachment. This value may be validated to match approved Partner values. + * + * Generated from protobuf field optional string partner_name = 161747874; + * @param string $var + * @return $this + */ + public function setPartnerName($var) + { + GPBUtil::checkString($var, True); + $this->partner_name = $var; + + return $this; + } + + /** + * URL of the Partner's portal for this Attachment. Partners may customise this to be a deep link to the specific resource on the Partner portal. This value may be validated to match approved Partner values. + * + * Generated from protobuf field optional string portal_url = 269182748; + * @return string + */ + public function getPortalUrl() + { + return isset($this->portal_url) ? $this->portal_url : ''; + } + + public function hasPortalUrl() + { + return isset($this->portal_url); + } + + public function clearPortalUrl() + { + unset($this->portal_url); + } + + /** + * URL of the Partner's portal for this Attachment. Partners may customise this to be a deep link to the specific resource on the Partner portal. This value may be validated to match approved Partner values. + * + * Generated from protobuf field optional string portal_url = 269182748; + * @param string $var + * @return $this + */ + public function setPortalUrl($var) + { + GPBUtil::checkString($var, True); + $this->portal_url = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentPrivateInfo.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentPrivateInfo.php new file mode 100644 index 000000000000..0751858c9d0b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentPrivateInfo.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.InterconnectAttachmentPrivateInfo + */ +class InterconnectAttachmentPrivateInfo extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] 802.1q encapsulation tag to be used for traffic between Google and the customer, going to and from this network and region. + * + * Generated from protobuf field optional uint32 tag8021q = 271820992; + */ + protected $tag8021q = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $tag8021q + * [Output Only] 802.1q encapsulation tag to be used for traffic between Google and the customer, going to and from this network and region. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] 802.1q encapsulation tag to be used for traffic between Google and the customer, going to and from this network and region. + * + * Generated from protobuf field optional uint32 tag8021q = 271820992; + * @return int + */ + public function getTag8021Q() + { + return isset($this->tag8021q) ? $this->tag8021q : 0; + } + + public function hasTag8021Q() + { + return isset($this->tag8021q); + } + + public function clearTag8021Q() + { + unset($this->tag8021q); + } + + /** + * [Output Only] 802.1q encapsulation tag to be used for traffic between Google and the customer, going to and from this network and region. + * + * Generated from protobuf field optional uint32 tag8021q = 271820992; + * @param int $var + * @return $this + */ + public function setTag8021Q($var) + { + GPBUtil::checkUint32($var); + $this->tag8021q = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentsScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentsScopedList.php new file mode 100644 index 000000000000..f95d5ea0303a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectAttachmentsScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.InterconnectAttachmentsScopedList + */ +class InterconnectAttachmentsScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * A list of interconnect attachments contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectAttachment interconnect_attachments = 425388415; + */ + private $interconnect_attachments; + /** + * Informational warning which replaces the list of addresses when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\InterconnectAttachment>|\Google\Protobuf\Internal\RepeatedField $interconnect_attachments + * A list of interconnect attachments contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * Informational warning which replaces the list of addresses when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of interconnect attachments contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectAttachment interconnect_attachments = 425388415; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInterconnectAttachments() + { + return $this->interconnect_attachments; + } + + /** + * A list of interconnect attachments contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectAttachment interconnect_attachments = 425388415; + * @param array<\Google\Cloud\Compute\V1\InterconnectAttachment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInterconnectAttachments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InterconnectAttachment::class); + $this->interconnect_attachments = $arr; + + return $this; + } + + /** + * Informational warning which replaces the list of addresses 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); + } + + /** + * Informational warning which replaces the list of addresses 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectCircuitInfo.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectCircuitInfo.php new file mode 100644 index 000000000000..ca80412d8d92 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectCircuitInfo.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.InterconnectCircuitInfo + */ +class InterconnectCircuitInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Customer-side demarc ID for this circuit. + * + * Generated from protobuf field optional string customer_demarc_id = 28771859; + */ + protected $customer_demarc_id = null; + /** + * Google-assigned unique ID for this circuit. Assigned at circuit turn-up. + * + * Generated from protobuf field optional string google_circuit_id = 262014711; + */ + protected $google_circuit_id = null; + /** + * Google-side demarc ID for this circuit. Assigned at circuit turn-up and provided by Google to the customer in the LOA. + * + * Generated from protobuf field optional string google_demarc_id = 448196270; + */ + protected $google_demarc_id = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $customer_demarc_id + * Customer-side demarc ID for this circuit. + * @type string $google_circuit_id + * Google-assigned unique ID for this circuit. Assigned at circuit turn-up. + * @type string $google_demarc_id + * Google-side demarc ID for this circuit. Assigned at circuit turn-up and provided by Google to the customer in the LOA. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Customer-side demarc ID for this circuit. + * + * Generated from protobuf field optional string customer_demarc_id = 28771859; + * @return string + */ + public function getCustomerDemarcId() + { + return isset($this->customer_demarc_id) ? $this->customer_demarc_id : ''; + } + + public function hasCustomerDemarcId() + { + return isset($this->customer_demarc_id); + } + + public function clearCustomerDemarcId() + { + unset($this->customer_demarc_id); + } + + /** + * Customer-side demarc ID for this circuit. + * + * Generated from protobuf field optional string customer_demarc_id = 28771859; + * @param string $var + * @return $this + */ + public function setCustomerDemarcId($var) + { + GPBUtil::checkString($var, True); + $this->customer_demarc_id = $var; + + return $this; + } + + /** + * Google-assigned unique ID for this circuit. Assigned at circuit turn-up. + * + * Generated from protobuf field optional string google_circuit_id = 262014711; + * @return string + */ + public function getGoogleCircuitId() + { + return isset($this->google_circuit_id) ? $this->google_circuit_id : ''; + } + + public function hasGoogleCircuitId() + { + return isset($this->google_circuit_id); + } + + public function clearGoogleCircuitId() + { + unset($this->google_circuit_id); + } + + /** + * Google-assigned unique ID for this circuit. Assigned at circuit turn-up. + * + * Generated from protobuf field optional string google_circuit_id = 262014711; + * @param string $var + * @return $this + */ + public function setGoogleCircuitId($var) + { + GPBUtil::checkString($var, True); + $this->google_circuit_id = $var; + + return $this; + } + + /** + * Google-side demarc ID for this circuit. Assigned at circuit turn-up and provided by Google to the customer in the LOA. + * + * Generated from protobuf field optional string google_demarc_id = 448196270; + * @return string + */ + public function getGoogleDemarcId() + { + return isset($this->google_demarc_id) ? $this->google_demarc_id : ''; + } + + public function hasGoogleDemarcId() + { + return isset($this->google_demarc_id); + } + + public function clearGoogleDemarcId() + { + unset($this->google_demarc_id); + } + + /** + * Google-side demarc ID for this circuit. Assigned at circuit turn-up and provided by Google to the customer in the LOA. + * + * Generated from protobuf field optional string google_demarc_id = 448196270; + * @param string $var + * @return $this + */ + public function setGoogleDemarcId($var) + { + GPBUtil::checkString($var, True); + $this->google_demarc_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnostics.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnostics.php new file mode 100644 index 000000000000..24a5462ae6d7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnostics.php @@ -0,0 +1,241 @@ +google.cloud.compute.v1.InterconnectDiagnostics + */ +class InterconnectDiagnostics extends \Google\Protobuf\Internal\Message +{ + /** + * A list of InterconnectDiagnostics.ARPEntry objects, describing individual neighbors currently seen by the Google router in the ARP cache for the Interconnect. This will be empty when the Interconnect is not bundled. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectDiagnosticsARPEntry arp_caches = 414591761; + */ + private $arp_caches; + /** + * The aggregation type of the bundle interface. + * Check the BundleAggregationType enum for the list of possible values. + * + * Generated from protobuf field optional string bundle_aggregation_type = 434939028; + */ + protected $bundle_aggregation_type = null; + /** + * The operational status of the bundle interface. + * Check the BundleOperationalStatus enum for the list of possible values. + * + * Generated from protobuf field optional string bundle_operational_status = 106433500; + */ + protected $bundle_operational_status = null; + /** + * A list of InterconnectDiagnostics.LinkStatus objects, describing the status for each link on the Interconnect. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus links = 102977465; + */ + private $links; + /** + * The MAC address of the Interconnect's bundle interface. + * + * Generated from protobuf field optional string mac_address = 332540164; + */ + protected $mac_address = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\InterconnectDiagnosticsARPEntry>|\Google\Protobuf\Internal\RepeatedField $arp_caches + * A list of InterconnectDiagnostics.ARPEntry objects, describing individual neighbors currently seen by the Google router in the ARP cache for the Interconnect. This will be empty when the Interconnect is not bundled. + * @type string $bundle_aggregation_type + * The aggregation type of the bundle interface. + * Check the BundleAggregationType enum for the list of possible values. + * @type string $bundle_operational_status + * The operational status of the bundle interface. + * Check the BundleOperationalStatus enum for the list of possible values. + * @type array<\Google\Cloud\Compute\V1\InterconnectDiagnosticsLinkStatus>|\Google\Protobuf\Internal\RepeatedField $links + * A list of InterconnectDiagnostics.LinkStatus objects, describing the status for each link on the Interconnect. + * @type string $mac_address + * The MAC address of the Interconnect's bundle interface. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of InterconnectDiagnostics.ARPEntry objects, describing individual neighbors currently seen by the Google router in the ARP cache for the Interconnect. This will be empty when the Interconnect is not bundled. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectDiagnosticsARPEntry arp_caches = 414591761; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getArpCaches() + { + return $this->arp_caches; + } + + /** + * A list of InterconnectDiagnostics.ARPEntry objects, describing individual neighbors currently seen by the Google router in the ARP cache for the Interconnect. This will be empty when the Interconnect is not bundled. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectDiagnosticsARPEntry arp_caches = 414591761; + * @param array<\Google\Cloud\Compute\V1\InterconnectDiagnosticsARPEntry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setArpCaches($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InterconnectDiagnosticsARPEntry::class); + $this->arp_caches = $arr; + + return $this; + } + + /** + * The aggregation type of the bundle interface. + * Check the BundleAggregationType enum for the list of possible values. + * + * Generated from protobuf field optional string bundle_aggregation_type = 434939028; + * @return string + */ + public function getBundleAggregationType() + { + return isset($this->bundle_aggregation_type) ? $this->bundle_aggregation_type : ''; + } + + public function hasBundleAggregationType() + { + return isset($this->bundle_aggregation_type); + } + + public function clearBundleAggregationType() + { + unset($this->bundle_aggregation_type); + } + + /** + * The aggregation type of the bundle interface. + * Check the BundleAggregationType enum for the list of possible values. + * + * Generated from protobuf field optional string bundle_aggregation_type = 434939028; + * @param string $var + * @return $this + */ + public function setBundleAggregationType($var) + { + GPBUtil::checkString($var, True); + $this->bundle_aggregation_type = $var; + + return $this; + } + + /** + * The operational status of the bundle interface. + * Check the BundleOperationalStatus enum for the list of possible values. + * + * Generated from protobuf field optional string bundle_operational_status = 106433500; + * @return string + */ + public function getBundleOperationalStatus() + { + return isset($this->bundle_operational_status) ? $this->bundle_operational_status : ''; + } + + public function hasBundleOperationalStatus() + { + return isset($this->bundle_operational_status); + } + + public function clearBundleOperationalStatus() + { + unset($this->bundle_operational_status); + } + + /** + * The operational status of the bundle interface. + * Check the BundleOperationalStatus enum for the list of possible values. + * + * Generated from protobuf field optional string bundle_operational_status = 106433500; + * @param string $var + * @return $this + */ + public function setBundleOperationalStatus($var) + { + GPBUtil::checkString($var, True); + $this->bundle_operational_status = $var; + + return $this; + } + + /** + * A list of InterconnectDiagnostics.LinkStatus objects, describing the status for each link on the Interconnect. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus links = 102977465; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLinks() + { + return $this->links; + } + + /** + * A list of InterconnectDiagnostics.LinkStatus objects, describing the status for each link on the Interconnect. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus links = 102977465; + * @param array<\Google\Cloud\Compute\V1\InterconnectDiagnosticsLinkStatus>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLinks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InterconnectDiagnosticsLinkStatus::class); + $this->links = $arr; + + return $this; + } + + /** + * The MAC address of the Interconnect's bundle interface. + * + * Generated from protobuf field optional string mac_address = 332540164; + * @return string + */ + public function getMacAddress() + { + return isset($this->mac_address) ? $this->mac_address : ''; + } + + public function hasMacAddress() + { + return isset($this->mac_address); + } + + public function clearMacAddress() + { + unset($this->mac_address); + } + + /** + * The MAC address of the Interconnect's bundle interface. + * + * Generated from protobuf field optional string mac_address = 332540164; + * @param string $var + * @return $this + */ + public function setMacAddress($var) + { + GPBUtil::checkString($var, True); + $this->mac_address = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnostics/BundleAggregationType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnostics/BundleAggregationType.php new file mode 100644 index 000000000000..f59d67819f6b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnostics/BundleAggregationType.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.InterconnectDiagnostics.BundleAggregationType + */ +class BundleAggregationType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_BUNDLE_AGGREGATION_TYPE = 0; + */ + const UNDEFINED_BUNDLE_AGGREGATION_TYPE = 0; + /** + * LACP is enabled. + * + * Generated from protobuf enum BUNDLE_AGGREGATION_TYPE_LACP = 27758925; + */ + const BUNDLE_AGGREGATION_TYPE_LACP = 27758925; + /** + * LACP is disabled. + * + * Generated from protobuf enum BUNDLE_AGGREGATION_TYPE_STATIC = 50678873; + */ + const BUNDLE_AGGREGATION_TYPE_STATIC = 50678873; + + private static $valueToName = [ + self::UNDEFINED_BUNDLE_AGGREGATION_TYPE => 'UNDEFINED_BUNDLE_AGGREGATION_TYPE', + self::BUNDLE_AGGREGATION_TYPE_LACP => 'BUNDLE_AGGREGATION_TYPE_LACP', + self::BUNDLE_AGGREGATION_TYPE_STATIC => 'BUNDLE_AGGREGATION_TYPE_STATIC', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BundleAggregationType::class, \Google\Cloud\Compute\V1\InterconnectDiagnostics_BundleAggregationType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnostics/BundleOperationalStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnostics/BundleOperationalStatus.php new file mode 100644 index 000000000000..463d039916ef --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnostics/BundleOperationalStatus.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.InterconnectDiagnostics.BundleOperationalStatus + */ +class BundleOperationalStatus +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_BUNDLE_OPERATIONAL_STATUS = 0; + */ + const UNDEFINED_BUNDLE_OPERATIONAL_STATUS = 0; + /** + * If bundleAggregationType is LACP: LACP is not established and/or all links in the bundle have DOWN operational status. If bundleAggregationType is STATIC: one or more links in the bundle has DOWN operational status. + * + * Generated from protobuf enum BUNDLE_OPERATIONAL_STATUS_DOWN = 453842693; + */ + const BUNDLE_OPERATIONAL_STATUS_DOWN = 453842693; + /** + * If bundleAggregationType is LACP: LACP is established and at least one link in the bundle has UP operational status. If bundleAggregationType is STATIC: all links in the bundle (typically just one) have UP operational status. + * + * Generated from protobuf enum BUNDLE_OPERATIONAL_STATUS_UP = 161366462; + */ + const BUNDLE_OPERATIONAL_STATUS_UP = 161366462; + + private static $valueToName = [ + self::UNDEFINED_BUNDLE_OPERATIONAL_STATUS => 'UNDEFINED_BUNDLE_OPERATIONAL_STATUS', + self::BUNDLE_OPERATIONAL_STATUS_DOWN => 'BUNDLE_OPERATIONAL_STATUS_DOWN', + self::BUNDLE_OPERATIONAL_STATUS_UP => 'BUNDLE_OPERATIONAL_STATUS_UP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BundleOperationalStatus::class, \Google\Cloud\Compute\V1\InterconnectDiagnostics_BundleOperationalStatus::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsARPEntry.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsARPEntry.php new file mode 100644 index 000000000000..1602c4047192 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsARPEntry.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.InterconnectDiagnosticsARPEntry + */ +class InterconnectDiagnosticsARPEntry extends \Google\Protobuf\Internal\Message +{ + /** + * The IP address of this ARP neighbor. + * + * Generated from protobuf field optional string ip_address = 406272220; + */ + protected $ip_address = null; + /** + * The MAC address of this ARP neighbor. + * + * Generated from protobuf field optional string mac_address = 332540164; + */ + protected $mac_address = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ip_address + * The IP address of this ARP neighbor. + * @type string $mac_address + * The MAC address of this ARP neighbor. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The IP address of this ARP neighbor. + * + * Generated from protobuf field optional string ip_address = 406272220; + * @return string + */ + public function getIpAddress() + { + return isset($this->ip_address) ? $this->ip_address : ''; + } + + public function hasIpAddress() + { + return isset($this->ip_address); + } + + public function clearIpAddress() + { + unset($this->ip_address); + } + + /** + * The IP address of this ARP neighbor. + * + * Generated from protobuf field optional string ip_address = 406272220; + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + + /** + * The MAC address of this ARP neighbor. + * + * Generated from protobuf field optional string mac_address = 332540164; + * @return string + */ + public function getMacAddress() + { + return isset($this->mac_address) ? $this->mac_address : ''; + } + + public function hasMacAddress() + { + return isset($this->mac_address); + } + + public function clearMacAddress() + { + unset($this->mac_address); + } + + /** + * The MAC address of this ARP neighbor. + * + * Generated from protobuf field optional string mac_address = 332540164; + * @param string $var + * @return $this + */ + public function setMacAddress($var) + { + GPBUtil::checkString($var, True); + $this->mac_address = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkLACPStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkLACPStatus.php new file mode 100644 index 000000000000..46ff0e108ffb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkLACPStatus.php @@ -0,0 +1,168 @@ +google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus + */ +class InterconnectDiagnosticsLinkLACPStatus extends \Google\Protobuf\Internal\Message +{ + /** + * System ID of the port on Google's side of the LACP exchange. + * + * Generated from protobuf field optional string google_system_id = 91210405; + */ + protected $google_system_id = null; + /** + * System ID of the port on the neighbor's side of the LACP exchange. + * + * Generated from protobuf field optional string neighbor_system_id = 343821342; + */ + protected $neighbor_system_id = null; + /** + * The state of a LACP link, which can take one of the following values: - ACTIVE: The link is configured and active within the bundle. - DETACHED: The link is not configured within the bundle. This means that the rest of the object should be empty. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + */ + protected $state = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $google_system_id + * System ID of the port on Google's side of the LACP exchange. + * @type string $neighbor_system_id + * System ID of the port on the neighbor's side of the LACP exchange. + * @type string $state + * The state of a LACP link, which can take one of the following values: - ACTIVE: The link is configured and active within the bundle. - DETACHED: The link is not configured within the bundle. This means that the rest of the object should be empty. + * Check the State enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * System ID of the port on Google's side of the LACP exchange. + * + * Generated from protobuf field optional string google_system_id = 91210405; + * @return string + */ + public function getGoogleSystemId() + { + return isset($this->google_system_id) ? $this->google_system_id : ''; + } + + public function hasGoogleSystemId() + { + return isset($this->google_system_id); + } + + public function clearGoogleSystemId() + { + unset($this->google_system_id); + } + + /** + * System ID of the port on Google's side of the LACP exchange. + * + * Generated from protobuf field optional string google_system_id = 91210405; + * @param string $var + * @return $this + */ + public function setGoogleSystemId($var) + { + GPBUtil::checkString($var, True); + $this->google_system_id = $var; + + return $this; + } + + /** + * System ID of the port on the neighbor's side of the LACP exchange. + * + * Generated from protobuf field optional string neighbor_system_id = 343821342; + * @return string + */ + public function getNeighborSystemId() + { + return isset($this->neighbor_system_id) ? $this->neighbor_system_id : ''; + } + + public function hasNeighborSystemId() + { + return isset($this->neighbor_system_id); + } + + public function clearNeighborSystemId() + { + unset($this->neighbor_system_id); + } + + /** + * System ID of the port on the neighbor's side of the LACP exchange. + * + * Generated from protobuf field optional string neighbor_system_id = 343821342; + * @param string $var + * @return $this + */ + public function setNeighborSystemId($var) + { + GPBUtil::checkString($var, True); + $this->neighbor_system_id = $var; + + return $this; + } + + /** + * The state of a LACP link, which can take one of the following values: - ACTIVE: The link is configured and active within the bundle. - DETACHED: The link is not configured within the bundle. This means that the rest of the object should be empty. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @return string + */ + public function getState() + { + return isset($this->state) ? $this->state : ''; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * The state of a LACP link, which can take one of the following values: - ACTIVE: The link is configured and active within the bundle. - DETACHED: The link is not configured within the bundle. This means that the rest of the object should be empty. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkLACPStatus/State.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkLACPStatus/State.php new file mode 100644 index 000000000000..27cd304c4a44 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkLACPStatus/State.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus.State + */ +class State +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATE = 0; + */ + const UNDEFINED_STATE = 0; + /** + * The link is configured and active within the bundle. + * + * Generated from protobuf enum ACTIVE = 314733318; + */ + const ACTIVE = 314733318; + /** + * The link is not configured within the bundle, this means the rest of the object should be empty. + * + * Generated from protobuf enum DETACHED = 216562546; + */ + const DETACHED = 216562546; + + private static $valueToName = [ + self::UNDEFINED_STATE => 'UNDEFINED_STATE', + self::ACTIVE => 'ACTIVE', + self::DETACHED => 'DETACHED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Compute\V1\InterconnectDiagnosticsLinkLACPStatus_State::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkOpticalPower.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkOpticalPower.php new file mode 100644 index 000000000000..201ad6b86be7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkOpticalPower.php @@ -0,0 +1,124 @@ +google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower + */ +class InterconnectDiagnosticsLinkOpticalPower extends \Google\Protobuf\Internal\Message +{ + /** + * The status of the current value when compared to the warning and alarm levels for the receiving or transmitting transceiver. Possible states include: - OK: The value has not crossed a warning threshold. - LOW_WARNING: The value has crossed below the low warning threshold. - HIGH_WARNING: The value has crossed above the high warning threshold. - LOW_ALARM: The value has crossed below the low alarm threshold. - HIGH_ALARM: The value has crossed above the high alarm threshold. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + */ + protected $state = null; + /** + * Value of the current receiving or transmitting optical power, read in dBm. Take a known good optical value, give it a 10% margin and trigger warnings relative to that value. In general, a -7dBm warning and a -11dBm alarm are good optical value estimates for most links. + * + * Generated from protobuf field optional float value = 111972721; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $state + * The status of the current value when compared to the warning and alarm levels for the receiving or transmitting transceiver. Possible states include: - OK: The value has not crossed a warning threshold. - LOW_WARNING: The value has crossed below the low warning threshold. - HIGH_WARNING: The value has crossed above the high warning threshold. - LOW_ALARM: The value has crossed below the low alarm threshold. - HIGH_ALARM: The value has crossed above the high alarm threshold. + * Check the State enum for the list of possible values. + * @type float $value + * Value of the current receiving or transmitting optical power, read in dBm. Take a known good optical value, give it a 10% margin and trigger warnings relative to that value. In general, a -7dBm warning and a -11dBm alarm are good optical value estimates for most links. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The status of the current value when compared to the warning and alarm levels for the receiving or transmitting transceiver. Possible states include: - OK: The value has not crossed a warning threshold. - LOW_WARNING: The value has crossed below the low warning threshold. - HIGH_WARNING: The value has crossed above the high warning threshold. - LOW_ALARM: The value has crossed below the low alarm threshold. - HIGH_ALARM: The value has crossed above the high alarm threshold. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @return string + */ + public function getState() + { + return isset($this->state) ? $this->state : ''; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * The status of the current value when compared to the warning and alarm levels for the receiving or transmitting transceiver. Possible states include: - OK: The value has not crossed a warning threshold. - LOW_WARNING: The value has crossed below the low warning threshold. - HIGH_WARNING: The value has crossed above the high warning threshold. - LOW_ALARM: The value has crossed below the low alarm threshold. - HIGH_ALARM: The value has crossed above the high alarm threshold. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + + /** + * Value of the current receiving or transmitting optical power, read in dBm. Take a known good optical value, give it a 10% margin and trigger warnings relative to that value. In general, a -7dBm warning and a -11dBm alarm are good optical value estimates for most links. + * + * Generated from protobuf field optional float value = 111972721; + * @return float + */ + public function getValue() + { + return isset($this->value) ? $this->value : 0.0; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * Value of the current receiving or transmitting optical power, read in dBm. Take a known good optical value, give it a 10% margin and trigger warnings relative to that value. In general, a -7dBm warning and a -11dBm alarm are good optical value estimates for most links. + * + * Generated from protobuf field optional float value = 111972721; + * @param float $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkFloat($var); + $this->value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkOpticalPower/State.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkOpticalPower/State.php new file mode 100644 index 000000000000..591770e5e89d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkOpticalPower/State.php @@ -0,0 +1,85 @@ +google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.State + */ +class State +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATE = 0; + */ + const UNDEFINED_STATE = 0; + /** + * The value has crossed above the high alarm threshold. + * + * Generated from protobuf enum HIGH_ALARM = 305363284; + */ + const HIGH_ALARM = 305363284; + /** + * The value of the current optical power has crossed above the high warning threshold. + * + * Generated from protobuf enum HIGH_WARNING = 220984799; + */ + const HIGH_WARNING = 220984799; + /** + * The value of the current optical power has crossed below the low alarm threshold. + * + * Generated from protobuf enum LOW_ALARM = 316659046; + */ + const LOW_ALARM = 316659046; + /** + * The value of the current optical power has crossed below the low warning threshold. + * + * Generated from protobuf enum LOW_WARNING = 338793841; + */ + const LOW_WARNING = 338793841; + /** + * The value of the current optical power has not crossed a warning threshold. + * + * Generated from protobuf enum OK = 2524; + */ + const OK = 2524; + + private static $valueToName = [ + self::UNDEFINED_STATE => 'UNDEFINED_STATE', + self::HIGH_ALARM => 'HIGH_ALARM', + self::HIGH_WARNING => 'HIGH_WARNING', + self::LOW_ALARM => 'LOW_ALARM', + self::LOW_WARNING => 'LOW_WARNING', + self::OK => 'OK', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Compute\V1\InterconnectDiagnosticsLinkOpticalPower_State::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkStatus.php new file mode 100644 index 000000000000..7215831c8b02 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkStatus.php @@ -0,0 +1,371 @@ +google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus + */ +class InterconnectDiagnosticsLinkStatus extends \Google\Protobuf\Internal\Message +{ + /** + * A list of InterconnectDiagnostics.ARPEntry objects, describing the ARP neighbor entries seen on this link. This will be empty if the link is bundled + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectDiagnosticsARPEntry arp_caches = 414591761; + */ + private $arp_caches; + /** + * The unique ID for this link assigned during turn up by Google. + * + * Generated from protobuf field optional string circuit_id = 225180977; + */ + protected $circuit_id = null; + /** + * The Demarc address assigned by Google and provided in the LoA. + * + * Generated from protobuf field optional string google_demarc = 51084; + */ + protected $google_demarc = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus lacp_status = 361210415; + */ + protected $lacp_status = null; + /** + * Describes the status of MACsec encryption on this link. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectDiagnosticsMacsecStatus macsec = 528867490; + */ + protected $macsec = null; + /** + * The operational status of the link. + * Check the OperationalStatus enum for the list of possible values. + * + * Generated from protobuf field optional string operational_status = 201070847; + */ + protected $operational_status = null; + /** + * An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status of the received light level. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower receiving_optical_power = 244717279; + */ + protected $receiving_optical_power = null; + /** + * An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status of the transmitted light level. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower transmitting_optical_power = 459431197; + */ + protected $transmitting_optical_power = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\InterconnectDiagnosticsARPEntry>|\Google\Protobuf\Internal\RepeatedField $arp_caches + * A list of InterconnectDiagnostics.ARPEntry objects, describing the ARP neighbor entries seen on this link. This will be empty if the link is bundled + * @type string $circuit_id + * The unique ID for this link assigned during turn up by Google. + * @type string $google_demarc + * The Demarc address assigned by Google and provided in the LoA. + * @type \Google\Cloud\Compute\V1\InterconnectDiagnosticsLinkLACPStatus $lacp_status + * @type \Google\Cloud\Compute\V1\InterconnectDiagnosticsMacsecStatus $macsec + * Describes the status of MACsec encryption on this link. + * @type string $operational_status + * The operational status of the link. + * Check the OperationalStatus enum for the list of possible values. + * @type \Google\Cloud\Compute\V1\InterconnectDiagnosticsLinkOpticalPower $receiving_optical_power + * An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status of the received light level. + * @type \Google\Cloud\Compute\V1\InterconnectDiagnosticsLinkOpticalPower $transmitting_optical_power + * An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status of the transmitted light level. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of InterconnectDiagnostics.ARPEntry objects, describing the ARP neighbor entries seen on this link. This will be empty if the link is bundled + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectDiagnosticsARPEntry arp_caches = 414591761; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getArpCaches() + { + return $this->arp_caches; + } + + /** + * A list of InterconnectDiagnostics.ARPEntry objects, describing the ARP neighbor entries seen on this link. This will be empty if the link is bundled + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectDiagnosticsARPEntry arp_caches = 414591761; + * @param array<\Google\Cloud\Compute\V1\InterconnectDiagnosticsARPEntry>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setArpCaches($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InterconnectDiagnosticsARPEntry::class); + $this->arp_caches = $arr; + + return $this; + } + + /** + * The unique ID for this link assigned during turn up by Google. + * + * Generated from protobuf field optional string circuit_id = 225180977; + * @return string + */ + public function getCircuitId() + { + return isset($this->circuit_id) ? $this->circuit_id : ''; + } + + public function hasCircuitId() + { + return isset($this->circuit_id); + } + + public function clearCircuitId() + { + unset($this->circuit_id); + } + + /** + * The unique ID for this link assigned during turn up by Google. + * + * Generated from protobuf field optional string circuit_id = 225180977; + * @param string $var + * @return $this + */ + public function setCircuitId($var) + { + GPBUtil::checkString($var, True); + $this->circuit_id = $var; + + return $this; + } + + /** + * The Demarc address assigned by Google and provided in the LoA. + * + * Generated from protobuf field optional string google_demarc = 51084; + * @return string + */ + public function getGoogleDemarc() + { + return isset($this->google_demarc) ? $this->google_demarc : ''; + } + + public function hasGoogleDemarc() + { + return isset($this->google_demarc); + } + + public function clearGoogleDemarc() + { + unset($this->google_demarc); + } + + /** + * The Demarc address assigned by Google and provided in the LoA. + * + * Generated from protobuf field optional string google_demarc = 51084; + * @param string $var + * @return $this + */ + public function setGoogleDemarc($var) + { + GPBUtil::checkString($var, True); + $this->google_demarc = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus lacp_status = 361210415; + * @return \Google\Cloud\Compute\V1\InterconnectDiagnosticsLinkLACPStatus|null + */ + public function getLacpStatus() + { + return $this->lacp_status; + } + + public function hasLacpStatus() + { + return isset($this->lacp_status); + } + + public function clearLacpStatus() + { + unset($this->lacp_status); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus lacp_status = 361210415; + * @param \Google\Cloud\Compute\V1\InterconnectDiagnosticsLinkLACPStatus $var + * @return $this + */ + public function setLacpStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InterconnectDiagnosticsLinkLACPStatus::class); + $this->lacp_status = $var; + + return $this; + } + + /** + * Describes the status of MACsec encryption on this link. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectDiagnosticsMacsecStatus macsec = 528867490; + * @return \Google\Cloud\Compute\V1\InterconnectDiagnosticsMacsecStatus|null + */ + public function getMacsec() + { + return $this->macsec; + } + + public function hasMacsec() + { + return isset($this->macsec); + } + + public function clearMacsec() + { + unset($this->macsec); + } + + /** + * Describes the status of MACsec encryption on this link. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectDiagnosticsMacsecStatus macsec = 528867490; + * @param \Google\Cloud\Compute\V1\InterconnectDiagnosticsMacsecStatus $var + * @return $this + */ + public function setMacsec($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InterconnectDiagnosticsMacsecStatus::class); + $this->macsec = $var; + + return $this; + } + + /** + * The operational status of the link. + * Check the OperationalStatus enum for the list of possible values. + * + * Generated from protobuf field optional string operational_status = 201070847; + * @return string + */ + public function getOperationalStatus() + { + return isset($this->operational_status) ? $this->operational_status : ''; + } + + public function hasOperationalStatus() + { + return isset($this->operational_status); + } + + public function clearOperationalStatus() + { + unset($this->operational_status); + } + + /** + * The operational status of the link. + * Check the OperationalStatus enum for the list of possible values. + * + * Generated from protobuf field optional string operational_status = 201070847; + * @param string $var + * @return $this + */ + public function setOperationalStatus($var) + { + GPBUtil::checkString($var, True); + $this->operational_status = $var; + + return $this; + } + + /** + * An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status of the received light level. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower receiving_optical_power = 244717279; + * @return \Google\Cloud\Compute\V1\InterconnectDiagnosticsLinkOpticalPower|null + */ + public function getReceivingOpticalPower() + { + return $this->receiving_optical_power; + } + + public function hasReceivingOpticalPower() + { + return isset($this->receiving_optical_power); + } + + public function clearReceivingOpticalPower() + { + unset($this->receiving_optical_power); + } + + /** + * An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status of the received light level. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower receiving_optical_power = 244717279; + * @param \Google\Cloud\Compute\V1\InterconnectDiagnosticsLinkOpticalPower $var + * @return $this + */ + public function setReceivingOpticalPower($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InterconnectDiagnosticsLinkOpticalPower::class); + $this->receiving_optical_power = $var; + + return $this; + } + + /** + * An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status of the transmitted light level. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower transmitting_optical_power = 459431197; + * @return \Google\Cloud\Compute\V1\InterconnectDiagnosticsLinkOpticalPower|null + */ + public function getTransmittingOpticalPower() + { + return $this->transmitting_optical_power; + } + + public function hasTransmittingOpticalPower() + { + return isset($this->transmitting_optical_power); + } + + public function clearTransmittingOpticalPower() + { + unset($this->transmitting_optical_power); + } + + /** + * An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status of the transmitted light level. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower transmitting_optical_power = 459431197; + * @param \Google\Cloud\Compute\V1\InterconnectDiagnosticsLinkOpticalPower $var + * @return $this + */ + public function setTransmittingOpticalPower($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InterconnectDiagnosticsLinkOpticalPower::class); + $this->transmitting_optical_power = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkStatus/OperationalStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkStatus/OperationalStatus.php new file mode 100644 index 000000000000..a4f33fcdf9a0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsLinkStatus/OperationalStatus.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus.OperationalStatus + */ +class OperationalStatus +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_OPERATIONAL_STATUS = 0; + */ + const UNDEFINED_OPERATIONAL_STATUS = 0; + /** + * The interface is unable to communicate with the remote end. + * + * Generated from protobuf enum LINK_OPERATIONAL_STATUS_DOWN = 281653885; + */ + const LINK_OPERATIONAL_STATUS_DOWN = 281653885; + /** + * The interface has low level communication with the remote end. + * + * Generated from protobuf enum LINK_OPERATIONAL_STATUS_UP = 305879862; + */ + const LINK_OPERATIONAL_STATUS_UP = 305879862; + + private static $valueToName = [ + self::UNDEFINED_OPERATIONAL_STATUS => 'UNDEFINED_OPERATIONAL_STATUS', + self::LINK_OPERATIONAL_STATUS_DOWN => 'LINK_OPERATIONAL_STATUS_DOWN', + self::LINK_OPERATIONAL_STATUS_UP => 'LINK_OPERATIONAL_STATUS_UP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(OperationalStatus::class, \Google\Cloud\Compute\V1\InterconnectDiagnosticsLinkStatus_OperationalStatus::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsMacsecStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsMacsecStatus.php new file mode 100644 index 000000000000..54f204a0669f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectDiagnosticsMacsecStatus.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.InterconnectDiagnosticsMacsecStatus + */ +class InterconnectDiagnosticsMacsecStatus extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates the Connectivity Association Key Name (CKN) currently being used if MACsec is operational. + * + * Generated from protobuf field optional string ckn = 98566; + */ + protected $ckn = null; + /** + * Indicates whether or not MACsec is operational on this link. + * + * Generated from protobuf field optional bool operational = 129704914; + */ + protected $operational = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ckn + * Indicates the Connectivity Association Key Name (CKN) currently being used if MACsec is operational. + * @type bool $operational + * Indicates whether or not MACsec is operational on this link. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Indicates the Connectivity Association Key Name (CKN) currently being used if MACsec is operational. + * + * Generated from protobuf field optional string ckn = 98566; + * @return string + */ + public function getCkn() + { + return isset($this->ckn) ? $this->ckn : ''; + } + + public function hasCkn() + { + return isset($this->ckn); + } + + public function clearCkn() + { + unset($this->ckn); + } + + /** + * Indicates the Connectivity Association Key Name (CKN) currently being used if MACsec is operational. + * + * Generated from protobuf field optional string ckn = 98566; + * @param string $var + * @return $this + */ + public function setCkn($var) + { + GPBUtil::checkString($var, True); + $this->ckn = $var; + + return $this; + } + + /** + * Indicates whether or not MACsec is operational on this link. + * + * Generated from protobuf field optional bool operational = 129704914; + * @return bool + */ + public function getOperational() + { + return isset($this->operational) ? $this->operational : false; + } + + public function hasOperational() + { + return isset($this->operational); + } + + public function clearOperational() + { + unset($this->operational); + } + + /** + * Indicates whether or not MACsec is operational on this link. + * + * Generated from protobuf field optional bool operational = 129704914; + * @param bool $var + * @return $this + */ + public function setOperational($var) + { + GPBUtil::checkBool($var); + $this->operational = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectList.php new file mode 100644 index 000000000000..e3f1175c6e86 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.InterconnectList + */ +class InterconnectList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of Interconnect resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Interconnect items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#interconnectList for lists of interconnects. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\Interconnect>|\Google\Protobuf\Internal\RepeatedField $items + * A list of Interconnect resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#interconnectList for lists of interconnects. + * @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 Interconnect resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Interconnect items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of Interconnect resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Interconnect items = 100526016; + * @param array<\Google\Cloud\Compute\V1\Interconnect>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Interconnect::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#interconnectList for lists of interconnects. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#interconnectList for lists of interconnects. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocation.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocation.php new file mode 100644 index 000000000000..4b62d131d865 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocation.php @@ -0,0 +1,811 @@ +google.cloud.compute.v1.InterconnectLocation + */ +class InterconnectLocation extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The postal address of the Point of Presence, each line in the address is separated by a newline character. + * + * Generated from protobuf field optional string address = 462920692; + */ + protected $address = null; + /** + * [Output Only] Availability zone for this InterconnectLocation. Within a metropolitan area (metro), maintenance will not be simultaneously scheduled in more than one availability zone. Example: "zone1" or "zone2". + * + * Generated from protobuf field optional string availability_zone = 158459920; + */ + protected $availability_zone = null; + /** + * [Output only] List of features available at this InterconnectLocation, which can take one of the following values: - MACSEC + * Check the AvailableFeatures enum for the list of possible values. + * + * Generated from protobuf field repeated string available_features = 496344307; + */ + private $available_features; + /** + * [Output only] List of link types available at this InterconnectLocation, which can take one of the following values: - LINK_TYPE_ETHERNET_10G_LR - LINK_TYPE_ETHERNET_100G_LR + * Check the AvailableLinkTypes enum for the list of possible values. + * + * Generated from protobuf field repeated string available_link_types = 509504298; + */ + private $available_link_types; + /** + * [Output Only] Metropolitan area designator that indicates which city an interconnect is located. For example: "Chicago, IL", "Amsterdam, Netherlands". + * + * Generated from protobuf field optional string city = 3053931; + */ + protected $city = null; + /** + * [Output Only] Continent for this location, which can take one of the following values: - AFRICA - ASIA_PAC - EUROPE - NORTH_AMERICA - SOUTH_AMERICA + * Check the Continent enum for the list of possible values. + * + * Generated from protobuf field optional string continent = 133442996; + */ + protected $continent = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * [Output Only] An optional description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The name of the provider for this facility (e.g., EQUINIX). + * + * Generated from protobuf field optional string facility_provider = 533303309; + */ + protected $facility_provider = null; + /** + * [Output Only] A provider-assigned Identifier for this facility (e.g., Ashburn-DC1). + * + * Generated from protobuf field optional string facility_provider_facility_id = 87269125; + */ + protected $facility_provider_facility_id = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#interconnectLocation for interconnect locations. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * [Output Only] Name of the resource. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] The peeringdb identifier for this facility (corresponding with a netfac type in peeringdb). + * + * Generated from protobuf field optional string peeringdb_facility_id = 536567094; + */ + protected $peeringdb_facility_id = null; + /** + * [Output Only] A list of InterconnectLocation.RegionInfo objects, that describe parameters pertaining to the relation between this InterconnectLocation and various Google Cloud regions. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectLocationRegionInfo region_infos = 312194170; + */ + private $region_infos; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [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. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool supports_pzs = 83983214; + */ + protected $supports_pzs = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $address + * [Output Only] The postal address of the Point of Presence, each line in the address is separated by a newline character. + * @type string $availability_zone + * [Output Only] Availability zone for this InterconnectLocation. Within a metropolitan area (metro), maintenance will not be simultaneously scheduled in more than one availability zone. Example: "zone1" or "zone2". + * @type array|\Google\Protobuf\Internal\RepeatedField $available_features + * [Output only] List of features available at this InterconnectLocation, which can take one of the following values: - MACSEC + * Check the AvailableFeatures enum for the list of possible values. + * @type array|\Google\Protobuf\Internal\RepeatedField $available_link_types + * [Output only] List of link types available at this InterconnectLocation, which can take one of the following values: - LINK_TYPE_ETHERNET_10G_LR - LINK_TYPE_ETHERNET_100G_LR + * Check the AvailableLinkTypes enum for the list of possible values. + * @type string $city + * [Output Only] Metropolitan area designator that indicates which city an interconnect is located. For example: "Chicago, IL", "Amsterdam, Netherlands". + * @type string $continent + * [Output Only] Continent for this location, which can take one of the following values: - AFRICA - ASIA_PAC - EUROPE - NORTH_AMERICA - SOUTH_AMERICA + * Check the Continent enum for the list of possible values. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * [Output Only] An optional description of the resource. + * @type string $facility_provider + * [Output Only] The name of the provider for this facility (e.g., EQUINIX). + * @type string $facility_provider_facility_id + * [Output Only] A provider-assigned Identifier for this facility (e.g., Ashburn-DC1). + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of the resource. Always compute#interconnectLocation for interconnect locations. + * @type string $name + * [Output Only] Name of the resource. + * @type string $peeringdb_facility_id + * [Output Only] The peeringdb identifier for this facility (corresponding with a netfac type in peeringdb). + * @type array<\Google\Cloud\Compute\V1\InterconnectLocationRegionInfo>|\Google\Protobuf\Internal\RepeatedField $region_infos + * [Output Only] A list of InterconnectLocation.RegionInfo objects, that describe parameters pertaining to the relation between this InterconnectLocation and various Google Cloud regions. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $status + * [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] Reserved for future use. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The postal address of the Point of Presence, each line in the address is separated by a newline character. + * + * Generated from protobuf field optional string address = 462920692; + * @return string + */ + public function getAddress() + { + return isset($this->address) ? $this->address : ''; + } + + public function hasAddress() + { + return isset($this->address); + } + + public function clearAddress() + { + unset($this->address); + } + + /** + * [Output Only] The postal address of the Point of Presence, each line in the address is separated by a newline character. + * + * Generated from protobuf field optional string address = 462920692; + * @param string $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkString($var, True); + $this->address = $var; + + return $this; + } + + /** + * [Output Only] Availability zone for this InterconnectLocation. Within a metropolitan area (metro), maintenance will not be simultaneously scheduled in more than one availability zone. Example: "zone1" or "zone2". + * + * Generated from protobuf field optional string availability_zone = 158459920; + * @return string + */ + public function getAvailabilityZone() + { + return isset($this->availability_zone) ? $this->availability_zone : ''; + } + + public function hasAvailabilityZone() + { + return isset($this->availability_zone); + } + + public function clearAvailabilityZone() + { + unset($this->availability_zone); + } + + /** + * [Output Only] Availability zone for this InterconnectLocation. Within a metropolitan area (metro), maintenance will not be simultaneously scheduled in more than one availability zone. Example: "zone1" or "zone2". + * + * Generated from protobuf field optional string availability_zone = 158459920; + * @param string $var + * @return $this + */ + public function setAvailabilityZone($var) + { + GPBUtil::checkString($var, True); + $this->availability_zone = $var; + + return $this; + } + + /** + * [Output only] List of features available at this InterconnectLocation, which can take one of the following values: - MACSEC + * Check the AvailableFeatures enum for the list of possible values. + * + * Generated from protobuf field repeated string available_features = 496344307; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAvailableFeatures() + { + return $this->available_features; + } + + /** + * [Output only] List of features available at this InterconnectLocation, which can take one of the following values: - MACSEC + * Check the AvailableFeatures enum for the list of possible values. + * + * Generated from protobuf field repeated string available_features = 496344307; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAvailableFeatures($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->available_features = $arr; + + return $this; + } + + /** + * [Output only] List of link types available at this InterconnectLocation, which can take one of the following values: - LINK_TYPE_ETHERNET_10G_LR - LINK_TYPE_ETHERNET_100G_LR + * Check the AvailableLinkTypes enum for the list of possible values. + * + * Generated from protobuf field repeated string available_link_types = 509504298; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAvailableLinkTypes() + { + return $this->available_link_types; + } + + /** + * [Output only] List of link types available at this InterconnectLocation, which can take one of the following values: - LINK_TYPE_ETHERNET_10G_LR - LINK_TYPE_ETHERNET_100G_LR + * Check the AvailableLinkTypes enum for the list of possible values. + * + * Generated from protobuf field repeated string available_link_types = 509504298; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAvailableLinkTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->available_link_types = $arr; + + return $this; + } + + /** + * [Output Only] Metropolitan area designator that indicates which city an interconnect is located. For example: "Chicago, IL", "Amsterdam, Netherlands". + * + * Generated from protobuf field optional string city = 3053931; + * @return string + */ + public function getCity() + { + return isset($this->city) ? $this->city : ''; + } + + public function hasCity() + { + return isset($this->city); + } + + public function clearCity() + { + unset($this->city); + } + + /** + * [Output Only] Metropolitan area designator that indicates which city an interconnect is located. For example: "Chicago, IL", "Amsterdam, Netherlands". + * + * Generated from protobuf field optional string city = 3053931; + * @param string $var + * @return $this + */ + public function setCity($var) + { + GPBUtil::checkString($var, True); + $this->city = $var; + + return $this; + } + + /** + * [Output Only] Continent for this location, which can take one of the following values: - AFRICA - ASIA_PAC - EUROPE - NORTH_AMERICA - SOUTH_AMERICA + * Check the Continent enum for the list of possible values. + * + * Generated from protobuf field optional string continent = 133442996; + * @return string + */ + public function getContinent() + { + return isset($this->continent) ? $this->continent : ''; + } + + public function hasContinent() + { + return isset($this->continent); + } + + public function clearContinent() + { + unset($this->continent); + } + + /** + * [Output Only] Continent for this location, which can take one of the following values: - AFRICA - ASIA_PAC - EUROPE - NORTH_AMERICA - SOUTH_AMERICA + * Check the Continent enum for the list of possible values. + * + * Generated from protobuf field optional string continent = 133442996; + * @param string $var + * @return $this + */ + public function setContinent($var) + { + GPBUtil::checkString($var, True); + $this->continent = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * [Output Only] An optional description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * [Output Only] An optional description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The name of the provider for this facility (e.g., EQUINIX). + * + * Generated from protobuf field optional string facility_provider = 533303309; + * @return string + */ + public function getFacilityProvider() + { + return isset($this->facility_provider) ? $this->facility_provider : ''; + } + + public function hasFacilityProvider() + { + return isset($this->facility_provider); + } + + public function clearFacilityProvider() + { + unset($this->facility_provider); + } + + /** + * [Output Only] The name of the provider for this facility (e.g., EQUINIX). + * + * Generated from protobuf field optional string facility_provider = 533303309; + * @param string $var + * @return $this + */ + public function setFacilityProvider($var) + { + GPBUtil::checkString($var, True); + $this->facility_provider = $var; + + return $this; + } + + /** + * [Output Only] A provider-assigned Identifier for this facility (e.g., Ashburn-DC1). + * + * Generated from protobuf field optional string facility_provider_facility_id = 87269125; + * @return string + */ + public function getFacilityProviderFacilityId() + { + return isset($this->facility_provider_facility_id) ? $this->facility_provider_facility_id : ''; + } + + public function hasFacilityProviderFacilityId() + { + return isset($this->facility_provider_facility_id); + } + + public function clearFacilityProviderFacilityId() + { + unset($this->facility_provider_facility_id); + } + + /** + * [Output Only] A provider-assigned Identifier for this facility (e.g., Ashburn-DC1). + * + * Generated from protobuf field optional string facility_provider_facility_id = 87269125; + * @param string $var + * @return $this + */ + public function setFacilityProviderFacilityId($var) + { + GPBUtil::checkString($var, True); + $this->facility_provider_facility_id = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#interconnectLocation for interconnect locations. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#interconnectLocation for interconnect locations. + * + * 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] Name of the resource. + * + * 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); + } + + /** + * [Output Only] Name of the resource. + * + * 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; + } + + /** + * [Output Only] The peeringdb identifier for this facility (corresponding with a netfac type in peeringdb). + * + * Generated from protobuf field optional string peeringdb_facility_id = 536567094; + * @return string + */ + public function getPeeringdbFacilityId() + { + return isset($this->peeringdb_facility_id) ? $this->peeringdb_facility_id : ''; + } + + public function hasPeeringdbFacilityId() + { + return isset($this->peeringdb_facility_id); + } + + public function clearPeeringdbFacilityId() + { + unset($this->peeringdb_facility_id); + } + + /** + * [Output Only] The peeringdb identifier for this facility (corresponding with a netfac type in peeringdb). + * + * Generated from protobuf field optional string peeringdb_facility_id = 536567094; + * @param string $var + * @return $this + */ + public function setPeeringdbFacilityId($var) + { + GPBUtil::checkString($var, True); + $this->peeringdb_facility_id = $var; + + return $this; + } + + /** + * [Output Only] A list of InterconnectLocation.RegionInfo objects, that describe parameters pertaining to the relation between this InterconnectLocation and various Google Cloud regions. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectLocationRegionInfo region_infos = 312194170; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRegionInfos() + { + return $this->region_infos; + } + + /** + * [Output Only] A list of InterconnectLocation.RegionInfo objects, that describe parameters pertaining to the relation between this InterconnectLocation and various Google Cloud regions. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectLocationRegionInfo region_infos = 312194170; + * @param array<\Google\Cloud\Compute\V1\InterconnectLocationRegionInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRegionInfos($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InterconnectLocationRegionInfo::class); + $this->region_infos = $arr; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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] 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. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [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. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool supports_pzs = 83983214; + * @return bool + */ + public function getSupportsPzs() + { + return isset($this->supports_pzs) ? $this->supports_pzs : false; + } + + public function hasSupportsPzs() + { + return isset($this->supports_pzs); + } + + public function clearSupportsPzs() + { + unset($this->supports_pzs); + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool supports_pzs = 83983214; + * @param bool $var + * @return $this + */ + public function setSupportsPzs($var) + { + GPBUtil::checkBool($var); + $this->supports_pzs = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocation/AvailableFeatures.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocation/AvailableFeatures.php new file mode 100644 index 000000000000..66617e08daa9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocation/AvailableFeatures.php @@ -0,0 +1,56 @@ +google.cloud.compute.v1.InterconnectLocation.AvailableFeatures + */ +class AvailableFeatures +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_AVAILABLE_FEATURES = 0; + */ + const UNDEFINED_AVAILABLE_FEATURES = 0; + /** + * Media Access Control security (MACsec) + * + * Generated from protobuf enum IF_MACSEC = 396279300; + */ + const IF_MACSEC = 396279300; + + private static $valueToName = [ + self::UNDEFINED_AVAILABLE_FEATURES => 'UNDEFINED_AVAILABLE_FEATURES', + self::IF_MACSEC => 'IF_MACSEC', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AvailableFeatures::class, \Google\Cloud\Compute\V1\InterconnectLocation_AvailableFeatures::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocation/AvailableLinkTypes.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocation/AvailableLinkTypes.php new file mode 100644 index 000000000000..5e33eff95fc8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocation/AvailableLinkTypes.php @@ -0,0 +1,63 @@ +google.cloud.compute.v1.InterconnectLocation.AvailableLinkTypes + */ +class AvailableLinkTypes +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_AVAILABLE_LINK_TYPES = 0; + */ + const UNDEFINED_AVAILABLE_LINK_TYPES = 0; + /** + * 100G Ethernet, LR Optics. + * + * Generated from protobuf enum LINK_TYPE_ETHERNET_100G_LR = 337672551; + */ + const LINK_TYPE_ETHERNET_100G_LR = 337672551; + /** + * 10G Ethernet, LR Optics. [(rate_bps) = 10000000000]; + * + * Generated from protobuf enum LINK_TYPE_ETHERNET_10G_LR = 236739749; + */ + const LINK_TYPE_ETHERNET_10G_LR = 236739749; + + private static $valueToName = [ + self::UNDEFINED_AVAILABLE_LINK_TYPES => 'UNDEFINED_AVAILABLE_LINK_TYPES', + self::LINK_TYPE_ETHERNET_100G_LR => 'LINK_TYPE_ETHERNET_100G_LR', + self::LINK_TYPE_ETHERNET_10G_LR => 'LINK_TYPE_ETHERNET_10G_LR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AvailableLinkTypes::class, \Google\Cloud\Compute\V1\InterconnectLocation_AvailableLinkTypes::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocation/Continent.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocation/Continent.php new file mode 100644 index 000000000000..f77dfe10e33a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocation/Continent.php @@ -0,0 +1,100 @@ +google.cloud.compute.v1.InterconnectLocation.Continent + */ +class Continent +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_CONTINENT = 0; + */ + const UNDEFINED_CONTINENT = 0; + /** + * Generated from protobuf enum AFRICA = 317443706; + */ + const AFRICA = 317443706; + /** + * Generated from protobuf enum ASIA_PAC = 119782269; + */ + const ASIA_PAC = 119782269; + /** + * Generated from protobuf enum C_AFRICA = 71993846; + */ + const C_AFRICA = 71993846; + /** + * Generated from protobuf enum C_ASIA_PAC = 465668089; + */ + const C_ASIA_PAC = 465668089; + /** + * Generated from protobuf enum C_EUROPE = 200369438; + */ + const C_EUROPE = 200369438; + /** + * Generated from protobuf enum C_NORTH_AMERICA = 275697048; + */ + const C_NORTH_AMERICA = 275697048; + /** + * Generated from protobuf enum C_SOUTH_AMERICA = 397149792; + */ + const C_SOUTH_AMERICA = 397149792; + /** + * Generated from protobuf enum EUROPE = 445819298; + */ + const EUROPE = 445819298; + /** + * Generated from protobuf enum NORTH_AMERICA = 448015508; + */ + const NORTH_AMERICA = 448015508; + /** + * Generated from protobuf enum SOUTH_AMERICA = 32597340; + */ + const SOUTH_AMERICA = 32597340; + + private static $valueToName = [ + self::UNDEFINED_CONTINENT => 'UNDEFINED_CONTINENT', + self::AFRICA => 'AFRICA', + self::ASIA_PAC => 'ASIA_PAC', + self::C_AFRICA => 'C_AFRICA', + self::C_ASIA_PAC => 'C_ASIA_PAC', + self::C_EUROPE => 'C_EUROPE', + self::C_NORTH_AMERICA => 'C_NORTH_AMERICA', + self::C_SOUTH_AMERICA => 'C_SOUTH_AMERICA', + self::EUROPE => 'EUROPE', + self::NORTH_AMERICA => 'NORTH_AMERICA', + self::SOUTH_AMERICA => 'SOUTH_AMERICA', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Continent::class, \Google\Cloud\Compute\V1\InterconnectLocation_Continent::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocation/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocation/Status.php new file mode 100644 index 000000000000..a17a7f4e8860 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocation/Status.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.InterconnectLocation.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * The InterconnectLocation is available for provisioning new Interconnects. + * + * Generated from protobuf enum AVAILABLE = 442079913; + */ + const AVAILABLE = 442079913; + /** + * The InterconnectLocation is closed for provisioning new Interconnects. + * + * Generated from protobuf enum CLOSED = 380163436; + */ + const CLOSED = 380163436; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::AVAILABLE => 'AVAILABLE', + self::CLOSED => 'CLOSED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\InterconnectLocation_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocationList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocationList.php new file mode 100644 index 000000000000..d5c5543a0f81 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocationList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.InterconnectLocationList + */ +class InterconnectLocationList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of InterconnectLocation resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectLocation items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#interconnectLocationList for lists of interconnect locations. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\InterconnectLocation>|\Google\Protobuf\Internal\RepeatedField $items + * A list of InterconnectLocation resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#interconnectLocationList for lists of interconnect locations. + * @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 InterconnectLocation resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectLocation items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of InterconnectLocation resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectLocation items = 100526016; + * @param array<\Google\Cloud\Compute\V1\InterconnectLocation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InterconnectLocation::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#interconnectLocationList for lists of interconnect locations. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#interconnectLocationList for lists of interconnect locations. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocationRegionInfo.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocationRegionInfo.php new file mode 100644 index 000000000000..ce9bc70d6661 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocationRegionInfo.php @@ -0,0 +1,169 @@ +google.cloud.compute.v1.InterconnectLocationRegionInfo + */ +class InterconnectLocationRegionInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Expected round-trip time in milliseconds, from this InterconnectLocation to a VM in this region. + * + * Generated from protobuf field optional int64 expected_rtt_ms = 422543866; + */ + protected $expected_rtt_ms = null; + /** + * Identifies the network presence of this location. + * Check the LocationPresence enum for the list of possible values. + * + * Generated from protobuf field optional string location_presence = 101517893; + */ + protected $location_presence = null; + /** + * URL for the region of this location. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $expected_rtt_ms + * Expected round-trip time in milliseconds, from this InterconnectLocation to a VM in this region. + * @type string $location_presence + * Identifies the network presence of this location. + * Check the LocationPresence enum for the list of possible values. + * @type string $region + * URL for the region of this location. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Expected round-trip time in milliseconds, from this InterconnectLocation to a VM in this region. + * + * Generated from protobuf field optional int64 expected_rtt_ms = 422543866; + * @return int|string + */ + public function getExpectedRttMs() + { + return isset($this->expected_rtt_ms) ? $this->expected_rtt_ms : 0; + } + + public function hasExpectedRttMs() + { + return isset($this->expected_rtt_ms); + } + + public function clearExpectedRttMs() + { + unset($this->expected_rtt_ms); + } + + /** + * Expected round-trip time in milliseconds, from this InterconnectLocation to a VM in this region. + * + * Generated from protobuf field optional int64 expected_rtt_ms = 422543866; + * @param int|string $var + * @return $this + */ + public function setExpectedRttMs($var) + { + GPBUtil::checkInt64($var); + $this->expected_rtt_ms = $var; + + return $this; + } + + /** + * Identifies the network presence of this location. + * Check the LocationPresence enum for the list of possible values. + * + * Generated from protobuf field optional string location_presence = 101517893; + * @return string + */ + public function getLocationPresence() + { + return isset($this->location_presence) ? $this->location_presence : ''; + } + + public function hasLocationPresence() + { + return isset($this->location_presence); + } + + public function clearLocationPresence() + { + unset($this->location_presence); + } + + /** + * Identifies the network presence of this location. + * Check the LocationPresence enum for the list of possible values. + * + * Generated from protobuf field optional string location_presence = 101517893; + * @param string $var + * @return $this + */ + public function setLocationPresence($var) + { + GPBUtil::checkString($var, True); + $this->location_presence = $var; + + return $this; + } + + /** + * URL for the region of this location. + * + * 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); + } + + /** + * URL for the region of this location. + * + * 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocationRegionInfo/LocationPresence.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocationRegionInfo/LocationPresence.php new file mode 100644 index 000000000000..c80e237afbe0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectLocationRegionInfo/LocationPresence.php @@ -0,0 +1,82 @@ +google.cloud.compute.v1.InterconnectLocationRegionInfo.LocationPresence + */ +class LocationPresence +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_LOCATION_PRESENCE = 0; + */ + const UNDEFINED_LOCATION_PRESENCE = 0; + /** + * This region is not in any common network presence with this InterconnectLocation. + * + * Generated from protobuf enum GLOBAL = 494663587; + */ + const PBGLOBAL = 494663587; + /** + * This region shares the same regional network presence as this InterconnectLocation. + * + * Generated from protobuf enum LOCAL_REGION = 403535464; + */ + const LOCAL_REGION = 403535464; + /** + * [Deprecated] This region is not in any common network presence with this InterconnectLocation. + * + * Generated from protobuf enum LP_GLOBAL = 429584062; + */ + const LP_GLOBAL = 429584062; + /** + * [Deprecated] This region shares the same regional network presence as this InterconnectLocation. + * + * Generated from protobuf enum LP_LOCAL_REGION = 488598851; + */ + const LP_LOCAL_REGION = 488598851; + + private static $valueToName = [ + self::UNDEFINED_LOCATION_PRESENCE => 'UNDEFINED_LOCATION_PRESENCE', + self::PBGLOBAL => 'GLOBAL', + self::LOCAL_REGION => 'LOCAL_REGION', + self::LP_GLOBAL => 'LP_GLOBAL', + self::LP_LOCAL_REGION => 'LP_LOCAL_REGION', + ]; + + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LocationPresence::class, \Google\Cloud\Compute\V1\InterconnectLocationRegionInfo_LocationPresence::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectMacsec.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectMacsec.php new file mode 100644 index 000000000000..f05a3f88df37 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectMacsec.php @@ -0,0 +1,111 @@ +google.cloud.compute.v1.InterconnectMacsec + */ +class InterconnectMacsec extends \Google\Protobuf\Internal\Message +{ + /** + * If set to true, the Interconnect connection is configured with a should-secure MACsec security policy, that allows the Google router to fallback to cleartext traffic if the MKA session cannot be established. By default, the Interconnect connection is configured with a must-secure security policy that drops all traffic if the MKA session cannot be established with your router. + * + * Generated from protobuf field optional bool fail_open = 532597451; + */ + protected $fail_open = null; + /** + * Required. A keychain placeholder describing a set of named key objects along with their start times. A MACsec CKN/CAK is generated for each key in the key chain. Google router automatically picks the key with the most recent startTime when establishing or re-establishing a MACsec secure link. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectMacsecPreSharedKey pre_shared_keys = 420308466; + */ + private $pre_shared_keys; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $fail_open + * If set to true, the Interconnect connection is configured with a should-secure MACsec security policy, that allows the Google router to fallback to cleartext traffic if the MKA session cannot be established. By default, the Interconnect connection is configured with a must-secure security policy that drops all traffic if the MKA session cannot be established with your router. + * @type array<\Google\Cloud\Compute\V1\InterconnectMacsecPreSharedKey>|\Google\Protobuf\Internal\RepeatedField $pre_shared_keys + * Required. A keychain placeholder describing a set of named key objects along with their start times. A MACsec CKN/CAK is generated for each key in the key chain. Google router automatically picks the key with the most recent startTime when establishing or re-establishing a MACsec secure link. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * If set to true, the Interconnect connection is configured with a should-secure MACsec security policy, that allows the Google router to fallback to cleartext traffic if the MKA session cannot be established. By default, the Interconnect connection is configured with a must-secure security policy that drops all traffic if the MKA session cannot be established with your router. + * + * Generated from protobuf field optional bool fail_open = 532597451; + * @return bool + */ + public function getFailOpen() + { + return isset($this->fail_open) ? $this->fail_open : false; + } + + public function hasFailOpen() + { + return isset($this->fail_open); + } + + public function clearFailOpen() + { + unset($this->fail_open); + } + + /** + * If set to true, the Interconnect connection is configured with a should-secure MACsec security policy, that allows the Google router to fallback to cleartext traffic if the MKA session cannot be established. By default, the Interconnect connection is configured with a must-secure security policy that drops all traffic if the MKA session cannot be established with your router. + * + * Generated from protobuf field optional bool fail_open = 532597451; + * @param bool $var + * @return $this + */ + public function setFailOpen($var) + { + GPBUtil::checkBool($var); + $this->fail_open = $var; + + return $this; + } + + /** + * Required. A keychain placeholder describing a set of named key objects along with their start times. A MACsec CKN/CAK is generated for each key in the key chain. Google router automatically picks the key with the most recent startTime when establishing or re-establishing a MACsec secure link. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectMacsecPreSharedKey pre_shared_keys = 420308466; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPreSharedKeys() + { + return $this->pre_shared_keys; + } + + /** + * Required. A keychain placeholder describing a set of named key objects along with their start times. A MACsec CKN/CAK is generated for each key in the key chain. Google router automatically picks the key with the most recent startTime when establishing or re-establishing a MACsec secure link. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectMacsecPreSharedKey pre_shared_keys = 420308466; + * @param array<\Google\Cloud\Compute\V1\InterconnectMacsecPreSharedKey>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPreSharedKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InterconnectMacsecPreSharedKey::class); + $this->pre_shared_keys = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectMacsecConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectMacsecConfig.php new file mode 100644 index 000000000000..082eac26086f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectMacsecConfig.php @@ -0,0 +1,67 @@ +google.cloud.compute.v1.InterconnectMacsecConfig + */ +class InterconnectMacsecConfig extends \Google\Protobuf\Internal\Message +{ + /** + * A keychain placeholder describing a set of named key objects along with their start times. A MACsec CKN/CAK is generated for each key in the key chain. Google router automatically picks the key with the most recent startTime when establishing or re-establishing a MACsec secure link. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectMacsecConfigPreSharedKey pre_shared_keys = 420308466; + */ + private $pre_shared_keys; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\InterconnectMacsecConfigPreSharedKey>|\Google\Protobuf\Internal\RepeatedField $pre_shared_keys + * A keychain placeholder describing a set of named key objects along with their start times. A MACsec CKN/CAK is generated for each key in the key chain. Google router automatically picks the key with the most recent startTime when establishing or re-establishing a MACsec secure link. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A keychain placeholder describing a set of named key objects along with their start times. A MACsec CKN/CAK is generated for each key in the key chain. Google router automatically picks the key with the most recent startTime when establishing or re-establishing a MACsec secure link. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectMacsecConfigPreSharedKey pre_shared_keys = 420308466; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPreSharedKeys() + { + return $this->pre_shared_keys; + } + + /** + * A keychain placeholder describing a set of named key objects along with their start times. A MACsec CKN/CAK is generated for each key in the key chain. Google router automatically picks the key with the most recent startTime when establishing or re-establishing a MACsec secure link. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectMacsecConfigPreSharedKey pre_shared_keys = 420308466; + * @param array<\Google\Cloud\Compute\V1\InterconnectMacsecConfigPreSharedKey>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPreSharedKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InterconnectMacsecConfigPreSharedKey::class); + $this->pre_shared_keys = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectMacsecConfigPreSharedKey.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectMacsecConfigPreSharedKey.php new file mode 100644 index 000000000000..fe1ef37ab2b9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectMacsecConfigPreSharedKey.php @@ -0,0 +1,209 @@ +google.cloud.compute.v1.InterconnectMacsecConfigPreSharedKey + */ +class InterconnectMacsecConfigPreSharedKey extends \Google\Protobuf\Internal\Message +{ + /** + * An auto-generated Connectivity Association Key (CAK) for this key. + * + * Generated from protobuf field optional string cak = 98253; + */ + protected $cak = null; + /** + * An auto-generated Connectivity Association Key Name (CKN) for this key. + * + * Generated from protobuf field optional string ckn = 98566; + */ + protected $ckn = null; + /** + * User provided name for this pre-shared key. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * User provided timestamp on or after which this key is valid. + * + * Generated from protobuf field optional string start_time = 37467274; + */ + protected $start_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $cak + * An auto-generated Connectivity Association Key (CAK) for this key. + * @type string $ckn + * An auto-generated Connectivity Association Key Name (CKN) for this key. + * @type string $name + * User provided name for this pre-shared key. + * @type string $start_time + * User provided timestamp on or after which this key is valid. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * An auto-generated Connectivity Association Key (CAK) for this key. + * + * Generated from protobuf field optional string cak = 98253; + * @return string + */ + public function getCak() + { + return isset($this->cak) ? $this->cak : ''; + } + + public function hasCak() + { + return isset($this->cak); + } + + public function clearCak() + { + unset($this->cak); + } + + /** + * An auto-generated Connectivity Association Key (CAK) for this key. + * + * Generated from protobuf field optional string cak = 98253; + * @param string $var + * @return $this + */ + public function setCak($var) + { + GPBUtil::checkString($var, True); + $this->cak = $var; + + return $this; + } + + /** + * An auto-generated Connectivity Association Key Name (CKN) for this key. + * + * Generated from protobuf field optional string ckn = 98566; + * @return string + */ + public function getCkn() + { + return isset($this->ckn) ? $this->ckn : ''; + } + + public function hasCkn() + { + return isset($this->ckn); + } + + public function clearCkn() + { + unset($this->ckn); + } + + /** + * An auto-generated Connectivity Association Key Name (CKN) for this key. + * + * Generated from protobuf field optional string ckn = 98566; + * @param string $var + * @return $this + */ + public function setCkn($var) + { + GPBUtil::checkString($var, True); + $this->ckn = $var; + + return $this; + } + + /** + * User provided name for this pre-shared key. + * + * 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); + } + + /** + * User provided name for this pre-shared key. + * + * 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; + } + + /** + * User provided timestamp on or after which this key is valid. + * + * Generated from protobuf field optional string start_time = 37467274; + * @return string + */ + public function getStartTime() + { + return isset($this->start_time) ? $this->start_time : ''; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * User provided timestamp on or after which this key is valid. + * + * Generated from protobuf field optional string start_time = 37467274; + * @param string $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkString($var, True); + $this->start_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectMacsecPreSharedKey.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectMacsecPreSharedKey.php new file mode 100644 index 000000000000..9f68258b29ab --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectMacsecPreSharedKey.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.InterconnectMacsecPreSharedKey + */ +class InterconnectMacsecPreSharedKey extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A name for this pre-shared key. 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * A RFC3339 timestamp on or after which the key is valid. startTime can be in the future. If the keychain has a single key, startTime can be omitted. If the keychain has multiple keys, startTime is mandatory for each key. The start times of keys must be in increasing order. The start times of two consecutive keys must be at least 6 hours apart. + * + * Generated from protobuf field optional string start_time = 37467274; + */ + protected $start_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. A name for this pre-shared key. 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 string $start_time + * A RFC3339 timestamp on or after which the key is valid. startTime can be in the future. If the keychain has a single key, startTime can be omitted. If the keychain has multiple keys, startTime is mandatory for each key. The start times of keys must be in increasing order. The start times of two consecutive keys must be at least 6 hours apart. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Required. A name for this pre-shared key. 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. + * + * 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); + } + + /** + * Required. A name for this pre-shared key. 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. + * + * 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; + } + + /** + * A RFC3339 timestamp on or after which the key is valid. startTime can be in the future. If the keychain has a single key, startTime can be omitted. If the keychain has multiple keys, startTime is mandatory for each key. The start times of keys must be in increasing order. The start times of two consecutive keys must be at least 6 hours apart. + * + * Generated from protobuf field optional string start_time = 37467274; + * @return string + */ + public function getStartTime() + { + return isset($this->start_time) ? $this->start_time : ''; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * A RFC3339 timestamp on or after which the key is valid. startTime can be in the future. If the keychain has a single key, startTime can be omitted. If the keychain has multiple keys, startTime is mandatory for each key. The start times of keys must be in increasing order. The start times of two consecutive keys must be at least 6 hours apart. + * + * Generated from protobuf field optional string start_time = 37467274; + * @param string $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkString($var, True); + $this->start_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectOutageNotification.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectOutageNotification.php new file mode 100644 index 000000000000..74617f327513 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectOutageNotification.php @@ -0,0 +1,387 @@ +google.cloud.compute.v1.InterconnectOutageNotification + */ +class InterconnectOutageNotification extends \Google\Protobuf\Internal\Message +{ + /** + * If issue_type is IT_PARTIAL_OUTAGE, a list of the Google-side circuit IDs that will be affected. + * + * Generated from protobuf field repeated string affected_circuits = 177717013; + */ + private $affected_circuits; + /** + * A description about the purpose of the outage. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Scheduled end time for the outage (milliseconds since Unix epoch). + * + * Generated from protobuf field optional int64 end_time = 114938801; + */ + protected $end_time = null; + /** + * Form this outage is expected to take, which can take one of the following values: - OUTAGE: The Interconnect may be completely out of service for some or all of the specified window. - PARTIAL_OUTAGE: Some circuits comprising the Interconnect as a whole should remain up, but with reduced bandwidth. Note that the versions of this enum prefixed with "IT_" have been deprecated in favor of the unprefixed values. + * Check the IssueType enum for the list of possible values. + * + * Generated from protobuf field optional string issue_type = 369639136; + */ + protected $issue_type = null; + /** + * Unique identifier for this outage notification. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * The party that generated this notification, which can take the following value: - GOOGLE: this notification as generated by Google. Note that the value of NSRC_GOOGLE has been deprecated in favor of GOOGLE. + * Check the Source enum for the list of possible values. + * + * Generated from protobuf field optional string source = 177235995; + */ + protected $source = null; + /** + * Scheduled start time for the outage (milliseconds since Unix epoch). + * + * Generated from protobuf field optional int64 start_time = 37467274; + */ + protected $start_time = null; + /** + * State of this notification, which can take one of the following values: - ACTIVE: This outage notification is active. The event could be in the past, present, or future. See start_time and end_time for scheduling. - CANCELLED: The outage associated with this notification was cancelled before the outage was due to start. - COMPLETED: The outage associated with this notification is complete. Note that the versions of this enum prefixed with "NS_" have been deprecated in favor of the unprefixed values. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + */ + protected $state = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $affected_circuits + * If issue_type is IT_PARTIAL_OUTAGE, a list of the Google-side circuit IDs that will be affected. + * @type string $description + * A description about the purpose of the outage. + * @type int|string $end_time + * Scheduled end time for the outage (milliseconds since Unix epoch). + * @type string $issue_type + * Form this outage is expected to take, which can take one of the following values: - OUTAGE: The Interconnect may be completely out of service for some or all of the specified window. - PARTIAL_OUTAGE: Some circuits comprising the Interconnect as a whole should remain up, but with reduced bandwidth. Note that the versions of this enum prefixed with "IT_" have been deprecated in favor of the unprefixed values. + * Check the IssueType enum for the list of possible values. + * @type string $name + * Unique identifier for this outage notification. + * @type string $source + * The party that generated this notification, which can take the following value: - GOOGLE: this notification as generated by Google. Note that the value of NSRC_GOOGLE has been deprecated in favor of GOOGLE. + * Check the Source enum for the list of possible values. + * @type int|string $start_time + * Scheduled start time for the outage (milliseconds since Unix epoch). + * @type string $state + * State of this notification, which can take one of the following values: - ACTIVE: This outage notification is active. The event could be in the past, present, or future. See start_time and end_time for scheduling. - CANCELLED: The outage associated with this notification was cancelled before the outage was due to start. - COMPLETED: The outage associated with this notification is complete. Note that the versions of this enum prefixed with "NS_" have been deprecated in favor of the unprefixed values. + * Check the State enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * If issue_type is IT_PARTIAL_OUTAGE, a list of the Google-side circuit IDs that will be affected. + * + * Generated from protobuf field repeated string affected_circuits = 177717013; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAffectedCircuits() + { + return $this->affected_circuits; + } + + /** + * If issue_type is IT_PARTIAL_OUTAGE, a list of the Google-side circuit IDs that will be affected. + * + * Generated from protobuf field repeated string affected_circuits = 177717013; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAffectedCircuits($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->affected_circuits = $arr; + + return $this; + } + + /** + * A description about the purpose of the outage. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * A description about the purpose of the outage. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Scheduled end time for the outage (milliseconds since Unix epoch). + * + * Generated from protobuf field optional int64 end_time = 114938801; + * @return int|string + */ + public function getEndTime() + { + return isset($this->end_time) ? $this->end_time : 0; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Scheduled end time for the outage (milliseconds since Unix epoch). + * + * Generated from protobuf field optional int64 end_time = 114938801; + * @param int|string $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkInt64($var); + $this->end_time = $var; + + return $this; + } + + /** + * Form this outage is expected to take, which can take one of the following values: - OUTAGE: The Interconnect may be completely out of service for some or all of the specified window. - PARTIAL_OUTAGE: Some circuits comprising the Interconnect as a whole should remain up, but with reduced bandwidth. Note that the versions of this enum prefixed with "IT_" have been deprecated in favor of the unprefixed values. + * Check the IssueType enum for the list of possible values. + * + * Generated from protobuf field optional string issue_type = 369639136; + * @return string + */ + public function getIssueType() + { + return isset($this->issue_type) ? $this->issue_type : ''; + } + + public function hasIssueType() + { + return isset($this->issue_type); + } + + public function clearIssueType() + { + unset($this->issue_type); + } + + /** + * Form this outage is expected to take, which can take one of the following values: - OUTAGE: The Interconnect may be completely out of service for some or all of the specified window. - PARTIAL_OUTAGE: Some circuits comprising the Interconnect as a whole should remain up, but with reduced bandwidth. Note that the versions of this enum prefixed with "IT_" have been deprecated in favor of the unprefixed values. + * Check the IssueType enum for the list of possible values. + * + * Generated from protobuf field optional string issue_type = 369639136; + * @param string $var + * @return $this + */ + public function setIssueType($var) + { + GPBUtil::checkString($var, True); + $this->issue_type = $var; + + return $this; + } + + /** + * Unique identifier for this outage notification. + * + * 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); + } + + /** + * Unique identifier for this outage notification. + * + * 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; + } + + /** + * The party that generated this notification, which can take the following value: - GOOGLE: this notification as generated by Google. Note that the value of NSRC_GOOGLE has been deprecated in favor of GOOGLE. + * Check the Source enum for the list of possible values. + * + * Generated from protobuf field optional string source = 177235995; + * @return string + */ + public function getSource() + { + return isset($this->source) ? $this->source : ''; + } + + public function hasSource() + { + return isset($this->source); + } + + public function clearSource() + { + unset($this->source); + } + + /** + * The party that generated this notification, which can take the following value: - GOOGLE: this notification as generated by Google. Note that the value of NSRC_GOOGLE has been deprecated in favor of GOOGLE. + * Check the Source enum for the list of possible values. + * + * Generated from protobuf field optional string source = 177235995; + * @param string $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkString($var, True); + $this->source = $var; + + return $this; + } + + /** + * Scheduled start time for the outage (milliseconds since Unix epoch). + * + * Generated from protobuf field optional int64 start_time = 37467274; + * @return int|string + */ + public function getStartTime() + { + return isset($this->start_time) ? $this->start_time : 0; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Scheduled start time for the outage (milliseconds since Unix epoch). + * + * Generated from protobuf field optional int64 start_time = 37467274; + * @param int|string $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkInt64($var); + $this->start_time = $var; + + return $this; + } + + /** + * State of this notification, which can take one of the following values: - ACTIVE: This outage notification is active. The event could be in the past, present, or future. See start_time and end_time for scheduling. - CANCELLED: The outage associated with this notification was cancelled before the outage was due to start. - COMPLETED: The outage associated with this notification is complete. Note that the versions of this enum prefixed with "NS_" have been deprecated in favor of the unprefixed values. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @return string + */ + public function getState() + { + return isset($this->state) ? $this->state : ''; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * State of this notification, which can take one of the following values: - ACTIVE: This outage notification is active. The event could be in the past, present, or future. See start_time and end_time for scheduling. - CANCELLED: The outage associated with this notification was cancelled before the outage was due to start. - COMPLETED: The outage associated with this notification is complete. Note that the versions of this enum prefixed with "NS_" have been deprecated in favor of the unprefixed values. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectOutageNotification/IssueType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectOutageNotification/IssueType.php new file mode 100644 index 000000000000..9cede29dcca3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectOutageNotification/IssueType.php @@ -0,0 +1,78 @@ +google.cloud.compute.v1.InterconnectOutageNotification.IssueType + */ +class IssueType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ISSUE_TYPE = 0; + */ + const UNDEFINED_ISSUE_TYPE = 0; + /** + * [Deprecated] The Interconnect may be completely out of service for some or all of the specified window. + * + * Generated from protobuf enum IT_OUTAGE = 175779973; + */ + const IT_OUTAGE = 175779973; + /** + * [Deprecated] Some circuits comprising the Interconnect will be out of service during the expected window. The interconnect as a whole should remain up, albeit with reduced bandwidth. + * + * Generated from protobuf enum IT_PARTIAL_OUTAGE = 92103971; + */ + const IT_PARTIAL_OUTAGE = 92103971; + /** + * The Interconnect may be completely out of service for some or all of the specified window. + * + * Generated from protobuf enum OUTAGE = 195285745; + */ + const OUTAGE = 195285745; + /** + * Some circuits comprising the Interconnect will be out of service during the expected window. The interconnect as a whole should remain up, albeit with reduced bandwidth. + * + * Generated from protobuf enum PARTIAL_OUTAGE = 147053455; + */ + const PARTIAL_OUTAGE = 147053455; + + private static $valueToName = [ + self::UNDEFINED_ISSUE_TYPE => 'UNDEFINED_ISSUE_TYPE', + self::IT_OUTAGE => 'IT_OUTAGE', + self::IT_PARTIAL_OUTAGE => 'IT_PARTIAL_OUTAGE', + self::OUTAGE => 'OUTAGE', + self::PARTIAL_OUTAGE => 'PARTIAL_OUTAGE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IssueType::class, \Google\Cloud\Compute\V1\InterconnectOutageNotification_IssueType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectOutageNotification/Source.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectOutageNotification/Source.php new file mode 100644 index 000000000000..51cb146003a3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectOutageNotification/Source.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.InterconnectOutageNotification.Source + */ +class Source +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_SOURCE = 0; + */ + const UNDEFINED_SOURCE = 0; + /** + * This notification was generated by Google. + * + * Generated from protobuf enum GOOGLE = 497439289; + */ + const GOOGLE = 497439289; + /** + * [Deprecated] This notification was generated by Google. + * + * Generated from protobuf enum NSRC_GOOGLE = 510574562; + */ + const NSRC_GOOGLE = 510574562; + + private static $valueToName = [ + self::UNDEFINED_SOURCE => 'UNDEFINED_SOURCE', + self::GOOGLE => 'GOOGLE', + self::NSRC_GOOGLE => 'NSRC_GOOGLE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Source::class, \Google\Cloud\Compute\V1\InterconnectOutageNotification_Source::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectOutageNotification/State.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectOutageNotification/State.php new file mode 100644 index 000000000000..cbac9c2ba4ac --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectOutageNotification/State.php @@ -0,0 +1,85 @@ +google.cloud.compute.v1.InterconnectOutageNotification.State + */ +class State +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATE = 0; + */ + const UNDEFINED_STATE = 0; + /** + * This outage notification is active. The event could be in the future, present, or past. See start_time and end_time for scheduling. + * + * Generated from protobuf enum ACTIVE = 314733318; + */ + const ACTIVE = 314733318; + /** + * The outage associated with this notification was cancelled before the outage was due to start. + * + * Generated from protobuf enum CANCELLED = 41957681; + */ + const CANCELLED = 41957681; + /** + * The outage associated with this notification is complete. + * + * Generated from protobuf enum COMPLETED = 309921323; + */ + const COMPLETED = 309921323; + /** + * [Deprecated] This outage notification is active. The event could be in the future, present, or past. See start_time and end_time for scheduling. + * + * Generated from protobuf enum NS_ACTIVE = 252563136; + */ + const NS_ACTIVE = 252563136; + /** + * [Deprecated] The outage associated with this notification was canceled before the outage was due to start. + * + * Generated from protobuf enum NS_CANCELED = 506579411; + */ + const NS_CANCELED = 506579411; + + private static $valueToName = [ + self::UNDEFINED_STATE => 'UNDEFINED_STATE', + self::ACTIVE => 'ACTIVE', + self::CANCELLED => 'CANCELLED', + self::COMPLETED => 'COMPLETED', + self::NS_ACTIVE => 'NS_ACTIVE', + self::NS_CANCELED => 'NS_CANCELED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Compute\V1\InterconnectOutageNotification_State::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocation.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocation.php new file mode 100644 index 000000000000..b57f4a69c605 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocation.php @@ -0,0 +1,915 @@ +google.cloud.compute.v1.InterconnectRemoteLocation + */ +class InterconnectRemoteLocation extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The postal address of the Point of Presence, each line in the address is separated by a newline character. + * + * Generated from protobuf field optional string address = 462920692; + */ + protected $address = null; + /** + * [Output Only] Subset of fields from InterconnectAttachment's |configurationConstraints| field that apply to all attachments for this remote location. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectAttachmentConfigurationConstraints attachment_configuration_constraints = 326825041; + */ + protected $attachment_configuration_constraints = null; + /** + * [Output Only] Metropolitan area designator that indicates which city an interconnect is located. For example: "Chicago, IL", "Amsterdam, Netherlands". + * + * Generated from protobuf field optional string city = 3053931; + */ + protected $city = null; + /** + * [Output Only] Constraints on the parameters for creating Cross-Cloud Interconnect and associated InterconnectAttachments. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectRemoteLocationConstraints constraints = 3909174; + */ + protected $constraints = null; + /** + * [Output Only] Continent for this location, which can take one of the following values: - AFRICA - ASIA_PAC - EUROPE - NORTH_AMERICA - SOUTH_AMERICA + * Check the Continent enum for the list of possible values. + * + * Generated from protobuf field optional string continent = 133442996; + */ + protected $continent = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * [Output Only] An optional description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The name of the provider for this facility (e.g., EQUINIX). + * + * Generated from protobuf field optional string facility_provider = 533303309; + */ + protected $facility_provider = null; + /** + * [Output Only] A provider-assigned Identifier for this facility (e.g., Ashburn-DC1). + * + * Generated from protobuf field optional string facility_provider_facility_id = 87269125; + */ + protected $facility_provider_facility_id = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#interconnectRemoteLocation for interconnect remote locations. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * [Output Only] Link Aggregation Control Protocol (LACP) constraints, which can take one of the following values: LACP_SUPPORTED, LACP_UNSUPPORTED + * Check the Lacp enum for the list of possible values. + * + * Generated from protobuf field optional string lacp = 3313826; + */ + protected $lacp = null; + /** + * [Output Only] The maximum number of 100 Gbps ports supported in a link aggregation group (LAG). When linkType is 100 Gbps, requestedLinkCount cannot exceed max_lag_size_100_gbps. + * + * Generated from protobuf field optional int32 max_lag_size100_gbps = 245219253; + */ + protected $max_lag_size100_gbps = null; + /** + * [Output Only] The maximum number of 10 Gbps ports supported in a link aggregation group (LAG). When linkType is 10 Gbps, requestedLinkCount cannot exceed max_lag_size_10_gbps. + * + * Generated from protobuf field optional int32 max_lag_size10_gbps = 294007573; + */ + protected $max_lag_size10_gbps = null; + /** + * [Output Only] Name of the resource. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] The peeringdb identifier for this facility (corresponding with a netfac type in peeringdb). + * + * Generated from protobuf field optional string peeringdb_facility_id = 536567094; + */ + protected $peeringdb_facility_id = null; + /** + * [Output Only] Permitted connections. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectRemoteLocationPermittedConnections permitted_connections = 442063278; + */ + private $permitted_connections; + /** + * [Output Only] Indicates the service provider present at the remote location. Example values: "Amazon Web Services", "Microsoft Azure". + * + * Generated from protobuf field optional string remote_service = 391954364; + */ + protected $remote_service = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] The status of this InterconnectRemoteLocation, which can take one of the following values: - CLOSED: The InterconnectRemoteLocation is closed and is unavailable for provisioning new Cross-Cloud Interconnects. - AVAILABLE: The InterconnectRemoteLocation is available for provisioning new Cross-Cloud Interconnects. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $address + * [Output Only] The postal address of the Point of Presence, each line in the address is separated by a newline character. + * @type \Google\Cloud\Compute\V1\InterconnectAttachmentConfigurationConstraints $attachment_configuration_constraints + * [Output Only] Subset of fields from InterconnectAttachment's |configurationConstraints| field that apply to all attachments for this remote location. + * @type string $city + * [Output Only] Metropolitan area designator that indicates which city an interconnect is located. For example: "Chicago, IL", "Amsterdam, Netherlands". + * @type \Google\Cloud\Compute\V1\InterconnectRemoteLocationConstraints $constraints + * [Output Only] Constraints on the parameters for creating Cross-Cloud Interconnect and associated InterconnectAttachments. + * @type string $continent + * [Output Only] Continent for this location, which can take one of the following values: - AFRICA - ASIA_PAC - EUROPE - NORTH_AMERICA - SOUTH_AMERICA + * Check the Continent enum for the list of possible values. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * [Output Only] An optional description of the resource. + * @type string $facility_provider + * [Output Only] The name of the provider for this facility (e.g., EQUINIX). + * @type string $facility_provider_facility_id + * [Output Only] A provider-assigned Identifier for this facility (e.g., Ashburn-DC1). + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of the resource. Always compute#interconnectRemoteLocation for interconnect remote locations. + * @type string $lacp + * [Output Only] Link Aggregation Control Protocol (LACP) constraints, which can take one of the following values: LACP_SUPPORTED, LACP_UNSUPPORTED + * Check the Lacp enum for the list of possible values. + * @type int $max_lag_size100_gbps + * [Output Only] The maximum number of 100 Gbps ports supported in a link aggregation group (LAG). When linkType is 100 Gbps, requestedLinkCount cannot exceed max_lag_size_100_gbps. + * @type int $max_lag_size10_gbps + * [Output Only] The maximum number of 10 Gbps ports supported in a link aggregation group (LAG). When linkType is 10 Gbps, requestedLinkCount cannot exceed max_lag_size_10_gbps. + * @type string $name + * [Output Only] Name of the resource. + * @type string $peeringdb_facility_id + * [Output Only] The peeringdb identifier for this facility (corresponding with a netfac type in peeringdb). + * @type array<\Google\Cloud\Compute\V1\InterconnectRemoteLocationPermittedConnections>|\Google\Protobuf\Internal\RepeatedField $permitted_connections + * [Output Only] Permitted connections. + * @type string $remote_service + * [Output Only] Indicates the service provider present at the remote location. Example values: "Amazon Web Services", "Microsoft Azure". + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $status + * [Output Only] The status of this InterconnectRemoteLocation, which can take one of the following values: - CLOSED: The InterconnectRemoteLocation is closed and is unavailable for provisioning new Cross-Cloud Interconnects. - AVAILABLE: The InterconnectRemoteLocation is available for provisioning new Cross-Cloud Interconnects. + * Check the Status enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The postal address of the Point of Presence, each line in the address is separated by a newline character. + * + * Generated from protobuf field optional string address = 462920692; + * @return string + */ + public function getAddress() + { + return isset($this->address) ? $this->address : ''; + } + + public function hasAddress() + { + return isset($this->address); + } + + public function clearAddress() + { + unset($this->address); + } + + /** + * [Output Only] The postal address of the Point of Presence, each line in the address is separated by a newline character. + * + * Generated from protobuf field optional string address = 462920692; + * @param string $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkString($var, True); + $this->address = $var; + + return $this; + } + + /** + * [Output Only] Subset of fields from InterconnectAttachment's |configurationConstraints| field that apply to all attachments for this remote location. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectAttachmentConfigurationConstraints attachment_configuration_constraints = 326825041; + * @return \Google\Cloud\Compute\V1\InterconnectAttachmentConfigurationConstraints|null + */ + public function getAttachmentConfigurationConstraints() + { + return $this->attachment_configuration_constraints; + } + + public function hasAttachmentConfigurationConstraints() + { + return isset($this->attachment_configuration_constraints); + } + + public function clearAttachmentConfigurationConstraints() + { + unset($this->attachment_configuration_constraints); + } + + /** + * [Output Only] Subset of fields from InterconnectAttachment's |configurationConstraints| field that apply to all attachments for this remote location. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectAttachmentConfigurationConstraints attachment_configuration_constraints = 326825041; + * @param \Google\Cloud\Compute\V1\InterconnectAttachmentConfigurationConstraints $var + * @return $this + */ + public function setAttachmentConfigurationConstraints($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InterconnectAttachmentConfigurationConstraints::class); + $this->attachment_configuration_constraints = $var; + + return $this; + } + + /** + * [Output Only] Metropolitan area designator that indicates which city an interconnect is located. For example: "Chicago, IL", "Amsterdam, Netherlands". + * + * Generated from protobuf field optional string city = 3053931; + * @return string + */ + public function getCity() + { + return isset($this->city) ? $this->city : ''; + } + + public function hasCity() + { + return isset($this->city); + } + + public function clearCity() + { + unset($this->city); + } + + /** + * [Output Only] Metropolitan area designator that indicates which city an interconnect is located. For example: "Chicago, IL", "Amsterdam, Netherlands". + * + * Generated from protobuf field optional string city = 3053931; + * @param string $var + * @return $this + */ + public function setCity($var) + { + GPBUtil::checkString($var, True); + $this->city = $var; + + return $this; + } + + /** + * [Output Only] Constraints on the parameters for creating Cross-Cloud Interconnect and associated InterconnectAttachments. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectRemoteLocationConstraints constraints = 3909174; + * @return \Google\Cloud\Compute\V1\InterconnectRemoteLocationConstraints|null + */ + public function getConstraints() + { + return $this->constraints; + } + + public function hasConstraints() + { + return isset($this->constraints); + } + + public function clearConstraints() + { + unset($this->constraints); + } + + /** + * [Output Only] Constraints on the parameters for creating Cross-Cloud Interconnect and associated InterconnectAttachments. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectRemoteLocationConstraints constraints = 3909174; + * @param \Google\Cloud\Compute\V1\InterconnectRemoteLocationConstraints $var + * @return $this + */ + public function setConstraints($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InterconnectRemoteLocationConstraints::class); + $this->constraints = $var; + + return $this; + } + + /** + * [Output Only] Continent for this location, which can take one of the following values: - AFRICA - ASIA_PAC - EUROPE - NORTH_AMERICA - SOUTH_AMERICA + * Check the Continent enum for the list of possible values. + * + * Generated from protobuf field optional string continent = 133442996; + * @return string + */ + public function getContinent() + { + return isset($this->continent) ? $this->continent : ''; + } + + public function hasContinent() + { + return isset($this->continent); + } + + public function clearContinent() + { + unset($this->continent); + } + + /** + * [Output Only] Continent for this location, which can take one of the following values: - AFRICA - ASIA_PAC - EUROPE - NORTH_AMERICA - SOUTH_AMERICA + * Check the Continent enum for the list of possible values. + * + * Generated from protobuf field optional string continent = 133442996; + * @param string $var + * @return $this + */ + public function setContinent($var) + { + GPBUtil::checkString($var, True); + $this->continent = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * [Output Only] An optional description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * [Output Only] An optional description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The name of the provider for this facility (e.g., EQUINIX). + * + * Generated from protobuf field optional string facility_provider = 533303309; + * @return string + */ + public function getFacilityProvider() + { + return isset($this->facility_provider) ? $this->facility_provider : ''; + } + + public function hasFacilityProvider() + { + return isset($this->facility_provider); + } + + public function clearFacilityProvider() + { + unset($this->facility_provider); + } + + /** + * [Output Only] The name of the provider for this facility (e.g., EQUINIX). + * + * Generated from protobuf field optional string facility_provider = 533303309; + * @param string $var + * @return $this + */ + public function setFacilityProvider($var) + { + GPBUtil::checkString($var, True); + $this->facility_provider = $var; + + return $this; + } + + /** + * [Output Only] A provider-assigned Identifier for this facility (e.g., Ashburn-DC1). + * + * Generated from protobuf field optional string facility_provider_facility_id = 87269125; + * @return string + */ + public function getFacilityProviderFacilityId() + { + return isset($this->facility_provider_facility_id) ? $this->facility_provider_facility_id : ''; + } + + public function hasFacilityProviderFacilityId() + { + return isset($this->facility_provider_facility_id); + } + + public function clearFacilityProviderFacilityId() + { + unset($this->facility_provider_facility_id); + } + + /** + * [Output Only] A provider-assigned Identifier for this facility (e.g., Ashburn-DC1). + * + * Generated from protobuf field optional string facility_provider_facility_id = 87269125; + * @param string $var + * @return $this + */ + public function setFacilityProviderFacilityId($var) + { + GPBUtil::checkString($var, True); + $this->facility_provider_facility_id = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#interconnectRemoteLocation for interconnect remote locations. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#interconnectRemoteLocation for interconnect remote locations. + * + * 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] Link Aggregation Control Protocol (LACP) constraints, which can take one of the following values: LACP_SUPPORTED, LACP_UNSUPPORTED + * Check the Lacp enum for the list of possible values. + * + * Generated from protobuf field optional string lacp = 3313826; + * @return string + */ + public function getLacp() + { + return isset($this->lacp) ? $this->lacp : ''; + } + + public function hasLacp() + { + return isset($this->lacp); + } + + public function clearLacp() + { + unset($this->lacp); + } + + /** + * [Output Only] Link Aggregation Control Protocol (LACP) constraints, which can take one of the following values: LACP_SUPPORTED, LACP_UNSUPPORTED + * Check the Lacp enum for the list of possible values. + * + * Generated from protobuf field optional string lacp = 3313826; + * @param string $var + * @return $this + */ + public function setLacp($var) + { + GPBUtil::checkString($var, True); + $this->lacp = $var; + + return $this; + } + + /** + * [Output Only] The maximum number of 100 Gbps ports supported in a link aggregation group (LAG). When linkType is 100 Gbps, requestedLinkCount cannot exceed max_lag_size_100_gbps. + * + * Generated from protobuf field optional int32 max_lag_size100_gbps = 245219253; + * @return int + */ + public function getMaxLagSize100Gbps() + { + return isset($this->max_lag_size100_gbps) ? $this->max_lag_size100_gbps : 0; + } + + public function hasMaxLagSize100Gbps() + { + return isset($this->max_lag_size100_gbps); + } + + public function clearMaxLagSize100Gbps() + { + unset($this->max_lag_size100_gbps); + } + + /** + * [Output Only] The maximum number of 100 Gbps ports supported in a link aggregation group (LAG). When linkType is 100 Gbps, requestedLinkCount cannot exceed max_lag_size_100_gbps. + * + * Generated from protobuf field optional int32 max_lag_size100_gbps = 245219253; + * @param int $var + * @return $this + */ + public function setMaxLagSize100Gbps($var) + { + GPBUtil::checkInt32($var); + $this->max_lag_size100_gbps = $var; + + return $this; + } + + /** + * [Output Only] The maximum number of 10 Gbps ports supported in a link aggregation group (LAG). When linkType is 10 Gbps, requestedLinkCount cannot exceed max_lag_size_10_gbps. + * + * Generated from protobuf field optional int32 max_lag_size10_gbps = 294007573; + * @return int + */ + public function getMaxLagSize10Gbps() + { + return isset($this->max_lag_size10_gbps) ? $this->max_lag_size10_gbps : 0; + } + + public function hasMaxLagSize10Gbps() + { + return isset($this->max_lag_size10_gbps); + } + + public function clearMaxLagSize10Gbps() + { + unset($this->max_lag_size10_gbps); + } + + /** + * [Output Only] The maximum number of 10 Gbps ports supported in a link aggregation group (LAG). When linkType is 10 Gbps, requestedLinkCount cannot exceed max_lag_size_10_gbps. + * + * Generated from protobuf field optional int32 max_lag_size10_gbps = 294007573; + * @param int $var + * @return $this + */ + public function setMaxLagSize10Gbps($var) + { + GPBUtil::checkInt32($var); + $this->max_lag_size10_gbps = $var; + + return $this; + } + + /** + * [Output Only] Name of the resource. + * + * 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); + } + + /** + * [Output Only] Name of the resource. + * + * 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; + } + + /** + * [Output Only] The peeringdb identifier for this facility (corresponding with a netfac type in peeringdb). + * + * Generated from protobuf field optional string peeringdb_facility_id = 536567094; + * @return string + */ + public function getPeeringdbFacilityId() + { + return isset($this->peeringdb_facility_id) ? $this->peeringdb_facility_id : ''; + } + + public function hasPeeringdbFacilityId() + { + return isset($this->peeringdb_facility_id); + } + + public function clearPeeringdbFacilityId() + { + unset($this->peeringdb_facility_id); + } + + /** + * [Output Only] The peeringdb identifier for this facility (corresponding with a netfac type in peeringdb). + * + * Generated from protobuf field optional string peeringdb_facility_id = 536567094; + * @param string $var + * @return $this + */ + public function setPeeringdbFacilityId($var) + { + GPBUtil::checkString($var, True); + $this->peeringdb_facility_id = $var; + + return $this; + } + + /** + * [Output Only] Permitted connections. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectRemoteLocationPermittedConnections permitted_connections = 442063278; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPermittedConnections() + { + return $this->permitted_connections; + } + + /** + * [Output Only] Permitted connections. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectRemoteLocationPermittedConnections permitted_connections = 442063278; + * @param array<\Google\Cloud\Compute\V1\InterconnectRemoteLocationPermittedConnections>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPermittedConnections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InterconnectRemoteLocationPermittedConnections::class); + $this->permitted_connections = $arr; + + return $this; + } + + /** + * [Output Only] Indicates the service provider present at the remote location. Example values: "Amazon Web Services", "Microsoft Azure". + * + * Generated from protobuf field optional string remote_service = 391954364; + * @return string + */ + public function getRemoteService() + { + return isset($this->remote_service) ? $this->remote_service : ''; + } + + public function hasRemoteService() + { + return isset($this->remote_service); + } + + public function clearRemoteService() + { + unset($this->remote_service); + } + + /** + * [Output Only] Indicates the service provider present at the remote location. Example values: "Amazon Web Services", "Microsoft Azure". + * + * Generated from protobuf field optional string remote_service = 391954364; + * @param string $var + * @return $this + */ + public function setRemoteService($var) + { + GPBUtil::checkString($var, True); + $this->remote_service = $var; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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] The status of this InterconnectRemoteLocation, which can take one of the following values: - CLOSED: The InterconnectRemoteLocation is closed and is unavailable for provisioning new Cross-Cloud Interconnects. - AVAILABLE: The InterconnectRemoteLocation is available for provisioning new Cross-Cloud Interconnects. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] The status of this InterconnectRemoteLocation, which can take one of the following values: - CLOSED: The InterconnectRemoteLocation is closed and is unavailable for provisioning new Cross-Cloud Interconnects. - AVAILABLE: The InterconnectRemoteLocation is available for provisioning new Cross-Cloud Interconnects. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocation/Continent.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocation/Continent.php new file mode 100644 index 000000000000..e2811fc099c1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocation/Continent.php @@ -0,0 +1,75 @@ +google.cloud.compute.v1.InterconnectRemoteLocation.Continent + */ +class Continent +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_CONTINENT = 0; + */ + const UNDEFINED_CONTINENT = 0; + /** + * Generated from protobuf enum AFRICA = 317443706; + */ + const AFRICA = 317443706; + /** + * Generated from protobuf enum ASIA_PAC = 119782269; + */ + const ASIA_PAC = 119782269; + /** + * Generated from protobuf enum EUROPE = 445819298; + */ + const EUROPE = 445819298; + /** + * Generated from protobuf enum NORTH_AMERICA = 448015508; + */ + const NORTH_AMERICA = 448015508; + /** + * Generated from protobuf enum SOUTH_AMERICA = 32597340; + */ + const SOUTH_AMERICA = 32597340; + + private static $valueToName = [ + self::UNDEFINED_CONTINENT => 'UNDEFINED_CONTINENT', + self::AFRICA => 'AFRICA', + self::ASIA_PAC => 'ASIA_PAC', + self::EUROPE => 'EUROPE', + self::NORTH_AMERICA => 'NORTH_AMERICA', + self::SOUTH_AMERICA => 'SOUTH_AMERICA', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Continent::class, \Google\Cloud\Compute\V1\InterconnectRemoteLocation_Continent::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocation/Lacp.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocation/Lacp.php new file mode 100644 index 000000000000..e69f383cf612 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocation/Lacp.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.InterconnectRemoteLocation.Lacp + */ +class Lacp +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_LACP = 0; + */ + const UNDEFINED_LACP = 0; + /** + * LACP_SUPPORTED: LACP is supported, and enabled by default on the Cross-Cloud Interconnect. + * + * Generated from protobuf enum LACP_SUPPORTED = 339576113; + */ + const LACP_SUPPORTED = 339576113; + /** + * LACP_UNSUPPORTED: LACP is not supported and is not be enabled on this port. GetDiagnostics shows bundleAggregationType as "static". GCP does not support LAGs without LACP, so requestedLinkCount must be 1. + * + * Generated from protobuf enum LACP_UNSUPPORTED = 203930104; + */ + const LACP_UNSUPPORTED = 203930104; + + private static $valueToName = [ + self::UNDEFINED_LACP => 'UNDEFINED_LACP', + self::LACP_SUPPORTED => 'LACP_SUPPORTED', + self::LACP_UNSUPPORTED => 'LACP_UNSUPPORTED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Lacp::class, \Google\Cloud\Compute\V1\InterconnectRemoteLocation_Lacp::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocation/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocation/Status.php new file mode 100644 index 000000000000..f40fb0063968 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocation/Status.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.InterconnectRemoteLocation.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * The InterconnectRemoteLocation is available for provisioning new Cross-Cloud Interconnects. + * + * Generated from protobuf enum AVAILABLE = 442079913; + */ + const AVAILABLE = 442079913; + /** + * The InterconnectRemoteLocation is closed for provisioning new Cross-Cloud Interconnects. + * + * Generated from protobuf enum CLOSED = 380163436; + */ + const CLOSED = 380163436; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::AVAILABLE => 'AVAILABLE', + self::CLOSED => 'CLOSED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\InterconnectRemoteLocation_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationConstraints.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationConstraints.php new file mode 100644 index 000000000000..11246431223d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationConstraints.php @@ -0,0 +1,172 @@ +google.cloud.compute.v1.InterconnectRemoteLocationConstraints + */ +class InterconnectRemoteLocationConstraints extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Port pair remote location constraints, which can take one of the following values: PORT_PAIR_UNCONSTRAINED_REMOTE_LOCATION, PORT_PAIR_MATCHING_REMOTE_LOCATION. Google Cloud API refers only to individual ports, but the UI uses this field when ordering a pair of ports, to prevent users from accidentally ordering something that is incompatible with their cloud provider. Specifically, when ordering a redundant pair of Cross-Cloud Interconnect ports, and one of them uses a remote location with portPairMatchingRemoteLocation set to matching, the UI requires that both ports use the same remote location. + * Check the PortPairRemoteLocation enum for the list of possible values. + * + * Generated from protobuf field optional string port_pair_remote_location = 495917351; + */ + protected $port_pair_remote_location = null; + /** + * [Output Only] Port pair VLAN constraints, which can take one of the following values: PORT_PAIR_UNCONSTRAINED_VLAN, PORT_PAIR_MATCHING_VLAN + * Check the PortPairVlan enum for the list of possible values. + * + * Generated from protobuf field optional string port_pair_vlan = 478214506; + */ + protected $port_pair_vlan = null; + /** + * [Output Only] [min-length, max-length] The minimum and maximum value (inclusive) for the IPv4 subnet length. For example, an interconnectRemoteLocation for Azure has {min: 30, max: 30} because Azure requires /30 subnets. This range specifies the values supported by both cloud providers. Interconnect currently supports /29 and /30 IPv4 subnet lengths. If a remote cloud has no constraint on IPv4 subnet length, the range would thus be {min: 29, max: 30}. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectRemoteLocationConstraintsSubnetLengthRange subnet_length_range = 184473670; + */ + protected $subnet_length_range = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $port_pair_remote_location + * [Output Only] Port pair remote location constraints, which can take one of the following values: PORT_PAIR_UNCONSTRAINED_REMOTE_LOCATION, PORT_PAIR_MATCHING_REMOTE_LOCATION. Google Cloud API refers only to individual ports, but the UI uses this field when ordering a pair of ports, to prevent users from accidentally ordering something that is incompatible with their cloud provider. Specifically, when ordering a redundant pair of Cross-Cloud Interconnect ports, and one of them uses a remote location with portPairMatchingRemoteLocation set to matching, the UI requires that both ports use the same remote location. + * Check the PortPairRemoteLocation enum for the list of possible values. + * @type string $port_pair_vlan + * [Output Only] Port pair VLAN constraints, which can take one of the following values: PORT_PAIR_UNCONSTRAINED_VLAN, PORT_PAIR_MATCHING_VLAN + * Check the PortPairVlan enum for the list of possible values. + * @type \Google\Cloud\Compute\V1\InterconnectRemoteLocationConstraintsSubnetLengthRange $subnet_length_range + * [Output Only] [min-length, max-length] The minimum and maximum value (inclusive) for the IPv4 subnet length. For example, an interconnectRemoteLocation for Azure has {min: 30, max: 30} because Azure requires /30 subnets. This range specifies the values supported by both cloud providers. Interconnect currently supports /29 and /30 IPv4 subnet lengths. If a remote cloud has no constraint on IPv4 subnet length, the range would thus be {min: 29, max: 30}. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Port pair remote location constraints, which can take one of the following values: PORT_PAIR_UNCONSTRAINED_REMOTE_LOCATION, PORT_PAIR_MATCHING_REMOTE_LOCATION. Google Cloud API refers only to individual ports, but the UI uses this field when ordering a pair of ports, to prevent users from accidentally ordering something that is incompatible with their cloud provider. Specifically, when ordering a redundant pair of Cross-Cloud Interconnect ports, and one of them uses a remote location with portPairMatchingRemoteLocation set to matching, the UI requires that both ports use the same remote location. + * Check the PortPairRemoteLocation enum for the list of possible values. + * + * Generated from protobuf field optional string port_pair_remote_location = 495917351; + * @return string + */ + public function getPortPairRemoteLocation() + { + return isset($this->port_pair_remote_location) ? $this->port_pair_remote_location : ''; + } + + public function hasPortPairRemoteLocation() + { + return isset($this->port_pair_remote_location); + } + + public function clearPortPairRemoteLocation() + { + unset($this->port_pair_remote_location); + } + + /** + * [Output Only] Port pair remote location constraints, which can take one of the following values: PORT_PAIR_UNCONSTRAINED_REMOTE_LOCATION, PORT_PAIR_MATCHING_REMOTE_LOCATION. Google Cloud API refers only to individual ports, but the UI uses this field when ordering a pair of ports, to prevent users from accidentally ordering something that is incompatible with their cloud provider. Specifically, when ordering a redundant pair of Cross-Cloud Interconnect ports, and one of them uses a remote location with portPairMatchingRemoteLocation set to matching, the UI requires that both ports use the same remote location. + * Check the PortPairRemoteLocation enum for the list of possible values. + * + * Generated from protobuf field optional string port_pair_remote_location = 495917351; + * @param string $var + * @return $this + */ + public function setPortPairRemoteLocation($var) + { + GPBUtil::checkString($var, True); + $this->port_pair_remote_location = $var; + + return $this; + } + + /** + * [Output Only] Port pair VLAN constraints, which can take one of the following values: PORT_PAIR_UNCONSTRAINED_VLAN, PORT_PAIR_MATCHING_VLAN + * Check the PortPairVlan enum for the list of possible values. + * + * Generated from protobuf field optional string port_pair_vlan = 478214506; + * @return string + */ + public function getPortPairVlan() + { + return isset($this->port_pair_vlan) ? $this->port_pair_vlan : ''; + } + + public function hasPortPairVlan() + { + return isset($this->port_pair_vlan); + } + + public function clearPortPairVlan() + { + unset($this->port_pair_vlan); + } + + /** + * [Output Only] Port pair VLAN constraints, which can take one of the following values: PORT_PAIR_UNCONSTRAINED_VLAN, PORT_PAIR_MATCHING_VLAN + * Check the PortPairVlan enum for the list of possible values. + * + * Generated from protobuf field optional string port_pair_vlan = 478214506; + * @param string $var + * @return $this + */ + public function setPortPairVlan($var) + { + GPBUtil::checkString($var, True); + $this->port_pair_vlan = $var; + + return $this; + } + + /** + * [Output Only] [min-length, max-length] The minimum and maximum value (inclusive) for the IPv4 subnet length. For example, an interconnectRemoteLocation for Azure has {min: 30, max: 30} because Azure requires /30 subnets. This range specifies the values supported by both cloud providers. Interconnect currently supports /29 and /30 IPv4 subnet lengths. If a remote cloud has no constraint on IPv4 subnet length, the range would thus be {min: 29, max: 30}. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectRemoteLocationConstraintsSubnetLengthRange subnet_length_range = 184473670; + * @return \Google\Cloud\Compute\V1\InterconnectRemoteLocationConstraintsSubnetLengthRange|null + */ + public function getSubnetLengthRange() + { + return $this->subnet_length_range; + } + + public function hasSubnetLengthRange() + { + return isset($this->subnet_length_range); + } + + public function clearSubnetLengthRange() + { + unset($this->subnet_length_range); + } + + /** + * [Output Only] [min-length, max-length] The minimum and maximum value (inclusive) for the IPv4 subnet length. For example, an interconnectRemoteLocation for Azure has {min: 30, max: 30} because Azure requires /30 subnets. This range specifies the values supported by both cloud providers. Interconnect currently supports /29 and /30 IPv4 subnet lengths. If a remote cloud has no constraint on IPv4 subnet length, the range would thus be {min: 29, max: 30}. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectRemoteLocationConstraintsSubnetLengthRange subnet_length_range = 184473670; + * @param \Google\Cloud\Compute\V1\InterconnectRemoteLocationConstraintsSubnetLengthRange $var + * @return $this + */ + public function setSubnetLengthRange($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InterconnectRemoteLocationConstraintsSubnetLengthRange::class); + $this->subnet_length_range = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationConstraints/PortPairRemoteLocation.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationConstraints/PortPairRemoteLocation.php new file mode 100644 index 000000000000..b6df225ae639 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationConstraints/PortPairRemoteLocation.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.InterconnectRemoteLocationConstraints.PortPairRemoteLocation + */ +class PortPairRemoteLocation +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PORT_PAIR_REMOTE_LOCATION = 0; + */ + const UNDEFINED_PORT_PAIR_REMOTE_LOCATION = 0; + /** + * If PORT_PAIR_MATCHING_REMOTE_LOCATION, the remote cloud provider allocates ports in pairs, and the user should choose the same remote location for both ports. + * + * Generated from protobuf enum PORT_PAIR_MATCHING_REMOTE_LOCATION = 207291859; + */ + const PORT_PAIR_MATCHING_REMOTE_LOCATION = 207291859; + /** + * If PORT_PAIR_UNCONSTRAINED_REMOTE_LOCATION, a user may opt to provision a redundant pair of Cross-Cloud Interconnects using two different remote locations in the same city. + * + * Generated from protobuf enum PORT_PAIR_UNCONSTRAINED_REMOTE_LOCATION = 60609829; + */ + const PORT_PAIR_UNCONSTRAINED_REMOTE_LOCATION = 60609829; + + private static $valueToName = [ + self::UNDEFINED_PORT_PAIR_REMOTE_LOCATION => 'UNDEFINED_PORT_PAIR_REMOTE_LOCATION', + self::PORT_PAIR_MATCHING_REMOTE_LOCATION => 'PORT_PAIR_MATCHING_REMOTE_LOCATION', + self::PORT_PAIR_UNCONSTRAINED_REMOTE_LOCATION => 'PORT_PAIR_UNCONSTRAINED_REMOTE_LOCATION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PortPairRemoteLocation::class, \Google\Cloud\Compute\V1\InterconnectRemoteLocationConstraints_PortPairRemoteLocation::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationConstraints/PortPairVlan.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationConstraints/PortPairVlan.php new file mode 100644 index 000000000000..8a1cdbdab6e9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationConstraints/PortPairVlan.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.InterconnectRemoteLocationConstraints.PortPairVlan + */ +class PortPairVlan +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PORT_PAIR_VLAN = 0; + */ + const UNDEFINED_PORT_PAIR_VLAN = 0; + /** + * If PORT_PAIR_MATCHING_VLAN, the Interconnect for this attachment is part of a pair of ports that should have matching VLAN allocations. This occurs with Cross-Cloud Interconnect to Azure remote locations. While GCP's API does not explicitly group pairs of ports, the UI uses this field to ensure matching VLAN ids when configuring a redundant VLAN pair. + * + * Generated from protobuf enum PORT_PAIR_MATCHING_VLAN = 250295358; + */ + const PORT_PAIR_MATCHING_VLAN = 250295358; + /** + * PORT_PAIR_UNCONSTRAINED_VLAN means there is no constraint. + * + * Generated from protobuf enum PORT_PAIR_UNCONSTRAINED_VLAN = 175227948; + */ + const PORT_PAIR_UNCONSTRAINED_VLAN = 175227948; + + private static $valueToName = [ + self::UNDEFINED_PORT_PAIR_VLAN => 'UNDEFINED_PORT_PAIR_VLAN', + self::PORT_PAIR_MATCHING_VLAN => 'PORT_PAIR_MATCHING_VLAN', + self::PORT_PAIR_UNCONSTRAINED_VLAN => 'PORT_PAIR_UNCONSTRAINED_VLAN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PortPairVlan::class, \Google\Cloud\Compute\V1\InterconnectRemoteLocationConstraints_PortPairVlan::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationConstraintsSubnetLengthRange.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationConstraintsSubnetLengthRange.php new file mode 100644 index 000000000000..d922974f1c92 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationConstraintsSubnetLengthRange.php @@ -0,0 +1,106 @@ +google.cloud.compute.v1.InterconnectRemoteLocationConstraintsSubnetLengthRange + */ +class InterconnectRemoteLocationConstraintsSubnetLengthRange extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional int32 max = 107876; + */ + protected $max = null; + /** + * Generated from protobuf field optional int32 min = 108114; + */ + protected $min = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $max + * @type int $min + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional int32 max = 107876; + * @return int + */ + public function getMax() + { + return isset($this->max) ? $this->max : 0; + } + + public function hasMax() + { + return isset($this->max); + } + + public function clearMax() + { + unset($this->max); + } + + /** + * Generated from protobuf field optional int32 max = 107876; + * @param int $var + * @return $this + */ + public function setMax($var) + { + GPBUtil::checkInt32($var); + $this->max = $var; + + return $this; + } + + /** + * Generated from protobuf field optional int32 min = 108114; + * @return int + */ + public function getMin() + { + return isset($this->min) ? $this->min : 0; + } + + public function hasMin() + { + return isset($this->min); + } + + public function clearMin() + { + unset($this->min); + } + + /** + * Generated from protobuf field optional int32 min = 108114; + * @param int $var + * @return $this + */ + public function setMin($var) + { + GPBUtil::checkInt32($var); + $this->min = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationList.php new file mode 100644 index 000000000000..459b895aa566 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.InterconnectRemoteLocationList + */ +class InterconnectRemoteLocationList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of InterconnectRemoteLocation resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectRemoteLocation items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#interconnectRemoteLocationList for lists of interconnect remote locations. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * [Output Only] This token lets you 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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\InterconnectRemoteLocation>|\Google\Protobuf\Internal\RepeatedField $items + * A list of InterconnectRemoteLocation resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#interconnectRemoteLocationList for lists of interconnect remote locations. + * @type string $next_page_token + * [Output Only] This token lets you 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 InterconnectRemoteLocation resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectRemoteLocation items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of InterconnectRemoteLocation resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InterconnectRemoteLocation items = 100526016; + * @param array<\Google\Cloud\Compute\V1\InterconnectRemoteLocation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InterconnectRemoteLocation::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#interconnectRemoteLocationList for lists of interconnect remote locations. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#interconnectRemoteLocationList for lists of interconnect remote locations. + * + * 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 lets you 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 lets you 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationPermittedConnections.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationPermittedConnections.php new file mode 100644 index 000000000000..0e67b4f616c3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectRemoteLocationPermittedConnections.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.InterconnectRemoteLocationPermittedConnections + */ +class InterconnectRemoteLocationPermittedConnections extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] URL of an Interconnect location that is permitted to connect to this Interconnect remote location. + * + * Generated from protobuf field optional string interconnect_location = 492235846; + */ + protected $interconnect_location = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $interconnect_location + * [Output Only] URL of an Interconnect location that is permitted to connect to this Interconnect remote location. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] URL of an Interconnect location that is permitted to connect to this Interconnect remote location. + * + * Generated from protobuf field optional string interconnect_location = 492235846; + * @return string + */ + public function getInterconnectLocation() + { + return isset($this->interconnect_location) ? $this->interconnect_location : ''; + } + + public function hasInterconnectLocation() + { + return isset($this->interconnect_location); + } + + public function clearInterconnectLocation() + { + unset($this->interconnect_location); + } + + /** + * [Output Only] URL of an Interconnect location that is permitted to connect to this Interconnect remote location. + * + * Generated from protobuf field optional string interconnect_location = 492235846; + * @param string $var + * @return $this + */ + public function setInterconnectLocation($var) + { + GPBUtil::checkString($var, True); + $this->interconnect_location = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectsGetDiagnosticsResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectsGetDiagnosticsResponse.php new file mode 100644 index 000000000000..f0f4225b05df --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectsGetDiagnosticsResponse.php @@ -0,0 +1,70 @@ +google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse + */ +class InterconnectsGetDiagnosticsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectDiagnostics result = 139315229; + */ + protected $result = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\InterconnectDiagnostics $result + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectDiagnostics result = 139315229; + * @return \Google\Cloud\Compute\V1\InterconnectDiagnostics|null + */ + public function getResult() + { + return $this->result; + } + + public function hasResult() + { + return isset($this->result); + } + + public function clearResult() + { + unset($this->result); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectDiagnostics result = 139315229; + * @param \Google\Cloud\Compute\V1\InterconnectDiagnostics $var + * @return $this + */ + public function setResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InterconnectDiagnostics::class); + $this->result = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectsGetMacsecConfigResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectsGetMacsecConfigResponse.php new file mode 100644 index 000000000000..dcf69aae9bb5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InterconnectsGetMacsecConfigResponse.php @@ -0,0 +1,114 @@ +google.cloud.compute.v1.InterconnectsGetMacsecConfigResponse + */ +class InterconnectsGetMacsecConfigResponse extends \Google\Protobuf\Internal\Message +{ + /** + * end_interface: MixerGetResponseWithEtagBuilder + * + * Generated from protobuf field optional string etag = 3123477; + */ + protected $etag = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectMacsecConfig result = 139315229; + */ + protected $result = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $etag + * end_interface: MixerGetResponseWithEtagBuilder + * @type \Google\Cloud\Compute\V1\InterconnectMacsecConfig $result + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * end_interface: MixerGetResponseWithEtagBuilder + * + * Generated from protobuf field optional string etag = 3123477; + * @return string + */ + public function getEtag() + { + return isset($this->etag) ? $this->etag : ''; + } + + public function hasEtag() + { + return isset($this->etag); + } + + public function clearEtag() + { + unset($this->etag); + } + + /** + * end_interface: MixerGetResponseWithEtagBuilder + * + * Generated from protobuf field optional string etag = 3123477; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectMacsecConfig result = 139315229; + * @return \Google\Cloud\Compute\V1\InterconnectMacsecConfig|null + */ + public function getResult() + { + return $this->result; + } + + public function hasResult() + { + return isset($this->result); + } + + public function clearResult() + { + unset($this->result); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.InterconnectMacsecConfig result = 139315229; + * @param \Google\Cloud\Compute\V1\InterconnectMacsecConfig $var + * @return $this + */ + public function setResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InterconnectMacsecConfig::class); + $this->result = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InvalidateCacheUrlMapRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InvalidateCacheUrlMapRequest.php new file mode 100644 index 000000000000..16b88d157bb6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InvalidateCacheUrlMapRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.InvalidateCacheUrlMapRequest + */ +class InvalidateCacheUrlMapRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.CacheInvalidationRule cache_invalidation_rule_resource = 312795565 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cache_invalidation_rule_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the UrlMap scoping this request. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url_map = ''; + + /** + * @param string $project Project ID for this request. + * @param string $urlMap Name of the UrlMap scoping this request. + * @param \Google\Cloud\Compute\V1\CacheInvalidationRule $cacheInvalidationRuleResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\InvalidateCacheUrlMapRequest + * + * @experimental + */ + public static function build(string $project, string $urlMap, \Google\Cloud\Compute\V1\CacheInvalidationRule $cacheInvalidationRuleResource): self + { + return (new self()) + ->setProject($project) + ->setUrlMap($urlMap) + ->setCacheInvalidationRuleResource($cacheInvalidationRuleResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\CacheInvalidationRule $cache_invalidation_rule_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 $url_map + * Name of the UrlMap scoping this request. + * } + */ + 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.CacheInvalidationRule cache_invalidation_rule_resource = 312795565 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\CacheInvalidationRule|null + */ + public function getCacheInvalidationRuleResource() + { + return $this->cache_invalidation_rule_resource; + } + + public function hasCacheInvalidationRuleResource() + { + return isset($this->cache_invalidation_rule_resource); + } + + public function clearCacheInvalidationRuleResource() + { + unset($this->cache_invalidation_rule_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.CacheInvalidationRule cache_invalidation_rule_resource = 312795565 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\CacheInvalidationRule $var + * @return $this + */ + public function setCacheInvalidationRuleResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CacheInvalidationRule::class); + $this->cache_invalidation_rule_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; + } + + /** + * Name of the UrlMap scoping this request. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUrlMap() + { + return $this->url_map; + } + + /** + * Name of the UrlMap scoping this request. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUrlMap($var) + { + GPBUtil::checkString($var, True); + $this->url_map = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Items.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Items.php new file mode 100644 index 000000000000..63a13da325f5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Items.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.Items + */ +class Items extends \Google\Protobuf\Internal\Message +{ + /** + * Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project. + * + * Generated from protobuf field optional string key = 106079; + */ + protected $key = null; + /** + * Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 262144 bytes (256 KiB). + * + * Generated from protobuf field optional string value = 111972721; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project. + * @type string $value + * Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 262144 bytes (256 KiB). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project. + * + * Generated from protobuf field optional string key = 106079; + * @return string + */ + public function getKey() + { + return isset($this->key) ? $this->key : ''; + } + + public function hasKey() + { + return isset($this->key); + } + + public function clearKey() + { + unset($this->key); + } + + /** + * Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project. + * + * Generated from protobuf field optional string key = 106079; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 262144 bytes (256 KiB). + * + * Generated from protobuf field optional string value = 111972721; + * @return string + */ + public function getValue() + { + return isset($this->value) ? $this->value : ''; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 262144 bytes (256 KiB). + * + * Generated from protobuf field optional string value = 111972721; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/License.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/License.php new file mode 100644 index 000000000000..a7b4181d68c7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/License.php @@ -0,0 +1,466 @@ +google.cloud.compute.v1.License + */ +class License extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Deprecated. This field no longer reflects whether a license charges a usage fee. + * + * Generated from protobuf field optional bool charges_use_fee = 372412622; + */ + protected $charges_use_fee = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional textual description of the resource; provided by the client when the resource is created. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of resource. Always compute#license for licenses. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * [Output Only] The unique code used to attach this license to images, snapshots, and disks. + * + * Generated from protobuf field optional uint64 license_code = 1467179; + */ + protected $license_code = null; + /** + * Name of the resource. The name must be 1-63 characters long and comply with RFC1035. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.LicenseResourceRequirements resource_requirements = 214292769; + */ + protected $resource_requirements = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * If false, licenses will not be copied from the source resource when creating an image from a disk, disk from snapshot, or snapshot from disk. + * + * Generated from protobuf field optional bool transferable = 4349893; + */ + protected $transferable = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $charges_use_fee + * [Output Only] Deprecated. This field no longer reflects whether a license charges a usage fee. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional textual description of the resource; provided by the client when the resource is created. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of resource. Always compute#license for licenses. + * @type int|string $license_code + * [Output Only] The unique code used to attach this license to images, snapshots, and disks. + * @type string $name + * Name of the resource. The name must be 1-63 characters long and comply with RFC1035. + * @type \Google\Cloud\Compute\V1\LicenseResourceRequirements $resource_requirements + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type bool $transferable + * If false, licenses will not be copied from the source resource when creating an image from a disk, disk from snapshot, or snapshot from disk. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Deprecated. This field no longer reflects whether a license charges a usage fee. + * + * Generated from protobuf field optional bool charges_use_fee = 372412622; + * @return bool + */ + public function getChargesUseFee() + { + return isset($this->charges_use_fee) ? $this->charges_use_fee : false; + } + + public function hasChargesUseFee() + { + return isset($this->charges_use_fee); + } + + public function clearChargesUseFee() + { + unset($this->charges_use_fee); + } + + /** + * [Output Only] Deprecated. This field no longer reflects whether a license charges a usage fee. + * + * Generated from protobuf field optional bool charges_use_fee = 372412622; + * @param bool $var + * @return $this + */ + public function setChargesUseFee($var) + { + GPBUtil::checkBool($var); + $this->charges_use_fee = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional textual description of the resource; provided by the client when the resource is created. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional textual description of the resource; provided by the client when the resource is created. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#license for licenses. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#license for licenses. + * + * 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] The unique code used to attach this license to images, snapshots, and disks. + * + * Generated from protobuf field optional uint64 license_code = 1467179; + * @return int|string + */ + public function getLicenseCode() + { + return isset($this->license_code) ? $this->license_code : 0; + } + + public function hasLicenseCode() + { + return isset($this->license_code); + } + + public function clearLicenseCode() + { + unset($this->license_code); + } + + /** + * [Output Only] The unique code used to attach this license to images, snapshots, and disks. + * + * Generated from protobuf field optional uint64 license_code = 1467179; + * @param int|string $var + * @return $this + */ + public function setLicenseCode($var) + { + GPBUtil::checkUint64($var); + $this->license_code = $var; + + return $this; + } + + /** + * Name of the resource. The name must be 1-63 characters long and comply with RFC1035. + * + * 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); + } + + /** + * Name of the resource. The name must be 1-63 characters long and comply with RFC1035. + * + * 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; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.LicenseResourceRequirements resource_requirements = 214292769; + * @return \Google\Cloud\Compute\V1\LicenseResourceRequirements|null + */ + public function getResourceRequirements() + { + return $this->resource_requirements; + } + + public function hasResourceRequirements() + { + return isset($this->resource_requirements); + } + + public function clearResourceRequirements() + { + unset($this->resource_requirements); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.LicenseResourceRequirements resource_requirements = 214292769; + * @param \Google\Cloud\Compute\V1\LicenseResourceRequirements $var + * @return $this + */ + public function setResourceRequirements($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\LicenseResourceRequirements::class); + $this->resource_requirements = $var; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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; + } + + /** + * If false, licenses will not be copied from the source resource when creating an image from a disk, disk from snapshot, or snapshot from disk. + * + * Generated from protobuf field optional bool transferable = 4349893; + * @return bool + */ + public function getTransferable() + { + return isset($this->transferable) ? $this->transferable : false; + } + + public function hasTransferable() + { + return isset($this->transferable); + } + + public function clearTransferable() + { + unset($this->transferable); + } + + /** + * If false, licenses will not be copied from the source resource when creating an image from a disk, disk from snapshot, or snapshot from disk. + * + * Generated from protobuf field optional bool transferable = 4349893; + * @param bool $var + * @return $this + */ + public function setTransferable($var) + { + GPBUtil::checkBool($var); + $this->transferable = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicenseCode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicenseCode.php new file mode 100644 index 000000000000..bf1e88e4bc73 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicenseCode.php @@ -0,0 +1,423 @@ +google.cloud.compute.v1.LicenseCode + */ +class LicenseCode extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * [Output Only] Description of this License Code. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of resource. Always compute#licenseCode for licenses. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * [Output Only] URL and description aliases of Licenses with the same License Code. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.LicenseCodeLicenseAlias license_alias = 43550930; + */ + private $license_alias; + /** + * [Output Only] Name of the resource. The name is 1-20 characters long and must be a valid 64 bit integer. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Current state of this License Code. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + */ + protected $state = null; + /** + * [Output Only] If true, the license will remain attached when creating images or snapshots from disks. Otherwise, the license is not transferred. + * + * Generated from protobuf field optional bool transferable = 4349893; + */ + protected $transferable = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * [Output Only] Description of this License Code. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of resource. Always compute#licenseCode for licenses. + * @type array<\Google\Cloud\Compute\V1\LicenseCodeLicenseAlias>|\Google\Protobuf\Internal\RepeatedField $license_alias + * [Output Only] URL and description aliases of Licenses with the same License Code. + * @type string $name + * [Output Only] Name of the resource. The name is 1-20 characters long and must be a valid 64 bit integer. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $state + * [Output Only] Current state of this License Code. + * Check the State enum for the list of possible values. + * @type bool $transferable + * [Output Only] If true, the license will remain attached when creating images or snapshots from disks. Otherwise, the license is not transferred. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * [Output Only] Description of this License Code. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * [Output Only] Description of this License Code. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#licenseCode for licenses. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#licenseCode for licenses. + * + * 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] URL and description aliases of Licenses with the same License Code. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.LicenseCodeLicenseAlias license_alias = 43550930; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLicenseAlias() + { + return $this->license_alias; + } + + /** + * [Output Only] URL and description aliases of Licenses with the same License Code. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.LicenseCodeLicenseAlias license_alias = 43550930; + * @param array<\Google\Cloud\Compute\V1\LicenseCodeLicenseAlias>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLicenseAlias($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\LicenseCodeLicenseAlias::class); + $this->license_alias = $arr; + + return $this; + } + + /** + * [Output Only] Name of the resource. The name is 1-20 characters long and must be a valid 64 bit integer. + * + * 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); + } + + /** + * [Output Only] Name of the resource. The name is 1-20 characters long and must be a valid 64 bit integer. + * + * 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; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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] Current state of this License Code. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @return string + */ + public function getState() + { + return isset($this->state) ? $this->state : ''; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * [Output Only] Current state of this License Code. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + + /** + * [Output Only] If true, the license will remain attached when creating images or snapshots from disks. Otherwise, the license is not transferred. + * + * Generated from protobuf field optional bool transferable = 4349893; + * @return bool + */ + public function getTransferable() + { + return isset($this->transferable) ? $this->transferable : false; + } + + public function hasTransferable() + { + return isset($this->transferable); + } + + public function clearTransferable() + { + unset($this->transferable); + } + + /** + * [Output Only] If true, the license will remain attached when creating images or snapshots from disks. Otherwise, the license is not transferred. + * + * Generated from protobuf field optional bool transferable = 4349893; + * @param bool $var + * @return $this + */ + public function setTransferable($var) + { + GPBUtil::checkBool($var); + $this->transferable = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicenseCode/State.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicenseCode/State.php new file mode 100644 index 000000000000..082485607aa8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicenseCode/State.php @@ -0,0 +1,83 @@ +google.cloud.compute.v1.LicenseCode.State + */ +class State +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATE = 0; + */ + const UNDEFINED_STATE = 0; + /** + * Machines are not allowed to attach boot disks with this License Code. Requests to create new resources with this license will be rejected. + * + * Generated from protobuf enum DISABLED = 516696700; + */ + const DISABLED = 516696700; + /** + * Use is allowed for anyone with USE_READ_ONLY access to this License Code. + * + * Generated from protobuf enum ENABLED = 182130465; + */ + const ENABLED = 182130465; + /** + * Use of this license is limited to a project whitelist. + * + * Generated from protobuf enum RESTRICTED = 261551195; + */ + const RESTRICTED = 261551195; + /** + * Generated from protobuf enum STATE_UNSPECIFIED = 470755401; + */ + const STATE_UNSPECIFIED = 470755401; + /** + * Reserved state. + * + * Generated from protobuf enum TERMINATED = 250018339; + */ + const TERMINATED = 250018339; + + private static $valueToName = [ + self::UNDEFINED_STATE => 'UNDEFINED_STATE', + self::DISABLED => 'DISABLED', + self::ENABLED => 'ENABLED', + self::RESTRICTED => 'RESTRICTED', + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::TERMINATED => 'TERMINATED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Compute\V1\LicenseCode_State::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicenseCodeLicenseAlias.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicenseCodeLicenseAlias.php new file mode 100644 index 000000000000..f1e0ff5a1026 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicenseCodeLicenseAlias.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.LicenseCodeLicenseAlias + */ +class LicenseCodeLicenseAlias extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Description of this License Code. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] URL of license corresponding to this License Code. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $description + * [Output Only] Description of this License Code. + * @type string $self_link + * [Output Only] URL of license corresponding to this License Code. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Description of this License Code. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * [Output Only] Description of this License Code. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] URL of license corresponding to this License Code. + * + * 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] URL of license corresponding to this License Code. + * + * 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicenseResourceCommitment.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicenseResourceCommitment.php new file mode 100644 index 000000000000..eacf252beebe --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicenseResourceCommitment.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.LicenseResourceCommitment + */ +class LicenseResourceCommitment extends \Google\Protobuf\Internal\Message +{ + /** + * The number of licenses purchased. + * + * Generated from protobuf field optional int64 amount = 196759640; + */ + protected $amount = null; + /** + * Specifies the core range of the instance for which this license applies. + * + * Generated from protobuf field optional string cores_per_license = 32482324; + */ + protected $cores_per_license = null; + /** + * Any applicable license URI. + * + * Generated from protobuf field optional string license = 166757441; + */ + protected $license = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $amount + * The number of licenses purchased. + * @type string $cores_per_license + * Specifies the core range of the instance for which this license applies. + * @type string $license + * Any applicable license URI. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The number of licenses purchased. + * + * Generated from protobuf field optional int64 amount = 196759640; + * @return int|string + */ + public function getAmount() + { + return isset($this->amount) ? $this->amount : 0; + } + + public function hasAmount() + { + return isset($this->amount); + } + + public function clearAmount() + { + unset($this->amount); + } + + /** + * The number of licenses purchased. + * + * Generated from protobuf field optional int64 amount = 196759640; + * @param int|string $var + * @return $this + */ + public function setAmount($var) + { + GPBUtil::checkInt64($var); + $this->amount = $var; + + return $this; + } + + /** + * Specifies the core range of the instance for which this license applies. + * + * Generated from protobuf field optional string cores_per_license = 32482324; + * @return string + */ + public function getCoresPerLicense() + { + return isset($this->cores_per_license) ? $this->cores_per_license : ''; + } + + public function hasCoresPerLicense() + { + return isset($this->cores_per_license); + } + + public function clearCoresPerLicense() + { + unset($this->cores_per_license); + } + + /** + * Specifies the core range of the instance for which this license applies. + * + * Generated from protobuf field optional string cores_per_license = 32482324; + * @param string $var + * @return $this + */ + public function setCoresPerLicense($var) + { + GPBUtil::checkString($var, True); + $this->cores_per_license = $var; + + return $this; + } + + /** + * Any applicable license URI. + * + * Generated from protobuf field optional string license = 166757441; + * @return string + */ + public function getLicense() + { + return isset($this->license) ? $this->license : ''; + } + + public function hasLicense() + { + return isset($this->license); + } + + public function clearLicense() + { + unset($this->license); + } + + /** + * Any applicable license URI. + * + * Generated from protobuf field optional string license = 166757441; + * @param string $var + * @return $this + */ + public function setLicense($var) + { + GPBUtil::checkString($var, True); + $this->license = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicenseResourceRequirements.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicenseResourceRequirements.php new file mode 100644 index 000000000000..0bb6e5219539 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicenseResourceRequirements.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.LicenseResourceRequirements + */ +class LicenseResourceRequirements extends \Google\Protobuf\Internal\Message +{ + /** + * Minimum number of guest cpus required to use the Instance. Enforced at Instance creation and Instance start. + * + * Generated from protobuf field optional int32 min_guest_cpu_count = 477964836; + */ + protected $min_guest_cpu_count = null; + /** + * Minimum memory required to use the Instance. Enforced at Instance creation and Instance start. + * + * Generated from protobuf field optional int32 min_memory_mb = 504785894; + */ + protected $min_memory_mb = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $min_guest_cpu_count + * Minimum number of guest cpus required to use the Instance. Enforced at Instance creation and Instance start. + * @type int $min_memory_mb + * Minimum memory required to use the Instance. Enforced at Instance creation and Instance start. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Minimum number of guest cpus required to use the Instance. Enforced at Instance creation and Instance start. + * + * Generated from protobuf field optional int32 min_guest_cpu_count = 477964836; + * @return int + */ + public function getMinGuestCpuCount() + { + return isset($this->min_guest_cpu_count) ? $this->min_guest_cpu_count : 0; + } + + public function hasMinGuestCpuCount() + { + return isset($this->min_guest_cpu_count); + } + + public function clearMinGuestCpuCount() + { + unset($this->min_guest_cpu_count); + } + + /** + * Minimum number of guest cpus required to use the Instance. Enforced at Instance creation and Instance start. + * + * Generated from protobuf field optional int32 min_guest_cpu_count = 477964836; + * @param int $var + * @return $this + */ + public function setMinGuestCpuCount($var) + { + GPBUtil::checkInt32($var); + $this->min_guest_cpu_count = $var; + + return $this; + } + + /** + * Minimum memory required to use the Instance. Enforced at Instance creation and Instance start. + * + * Generated from protobuf field optional int32 min_memory_mb = 504785894; + * @return int + */ + public function getMinMemoryMb() + { + return isset($this->min_memory_mb) ? $this->min_memory_mb : 0; + } + + public function hasMinMemoryMb() + { + return isset($this->min_memory_mb); + } + + public function clearMinMemoryMb() + { + unset($this->min_memory_mb); + } + + /** + * Minimum memory required to use the Instance. Enforced at Instance creation and Instance start. + * + * Generated from protobuf field optional int32 min_memory_mb = 504785894; + * @param int $var + * @return $this + */ + public function setMinMemoryMb($var) + { + GPBUtil::checkInt32($var); + $this->min_memory_mb = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicensesListResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicensesListResponse.php new file mode 100644 index 000000000000..8c1c8cd3eec8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LicensesListResponse.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.LicensesListResponse + */ +class LicensesListResponse extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of License resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.License items = 100526016; + */ + private $items; + /** + * [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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\License>|\Google\Protobuf\Internal\RepeatedField $items + * A list of License resources. + * @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 License resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.License items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of License resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.License items = 100526016; + * @param array<\Google\Cloud\Compute\V1\License>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\License::class); + $this->items = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAcceleratorTypesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAcceleratorTypesRequest.php new file mode 100644 index 000000000000..74a7cc24e213 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAcceleratorTypesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListAcceleratorTypesRequest + */ +class ListAcceleratorTypesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * + * @return \Google\Cloud\Compute\V1\ListAcceleratorTypesRequest + * + * @experimental + */ + public static function build(string $project, string $zone): self + { + return (new self()) + ->setProject($project) + ->setZone($zone); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAddressesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAddressesRequest.php new file mode 100644 index 000000000000..921669735ce3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAddressesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListAddressesRequest + */ +class ListAddressesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * + * @return \Google\Cloud\Compute\V1\ListAddressesRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAssociationsFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAssociationsFirewallPolicyRequest.php new file mode 100644 index 000000000000..1288003172eb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAssociationsFirewallPolicyRequest.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest + */ +class ListAssociationsFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The target resource to list associations. It is an organization, or a folder. + * + * Generated from protobuf field optional string target_resource = 467318524; + */ + protected $target_resource = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $target_resource + * The target resource to list associations. It is an organization, or a folder. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The target resource to list associations. It is an organization, or a folder. + * + * Generated from protobuf field optional string target_resource = 467318524; + * @return string + */ + public function getTargetResource() + { + return isset($this->target_resource) ? $this->target_resource : ''; + } + + public function hasTargetResource() + { + return isset($this->target_resource); + } + + public function clearTargetResource() + { + unset($this->target_resource); + } + + /** + * The target resource to list associations. It is an organization, or a folder. + * + * Generated from protobuf field optional string target_resource = 467318524; + * @param string $var + * @return $this + */ + public function setTargetResource($var) + { + GPBUtil::checkString($var, True); + $this->target_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAutoscalersRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAutoscalersRequest.php new file mode 100644 index 000000000000..945a6cde7bc2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAutoscalersRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListAutoscalersRequest + */ +class ListAutoscalersRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone for this request. + * + * @return \Google\Cloud\Compute\V1\ListAutoscalersRequest + * + * @experimental + */ + public static function build(string $project, string $zone): self + { + return (new self()) + ->setProject($project) + ->setZone($zone); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type string $zone + * Name of the zone for this request. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAvailableFeaturesRegionSslPoliciesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAvailableFeaturesRegionSslPoliciesRequest.php new file mode 100644 index 000000000000..8a5440e1194e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAvailableFeaturesRegionSslPoliciesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListAvailableFeaturesRegionSslPoliciesRequest + */ +class ListAvailableFeaturesRegionSslPoliciesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * + * @return \Google\Cloud\Compute\V1\ListAvailableFeaturesRegionSslPoliciesRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAvailableFeaturesSslPoliciesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAvailableFeaturesSslPoliciesRequest.php new file mode 100644 index 000000000000..0ea329e82c7d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListAvailableFeaturesSslPoliciesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest + */ +class ListAvailableFeaturesSslPoliciesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListAvailableFeaturesSslPoliciesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListBackendBucketsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListBackendBucketsRequest.php new file mode 100644 index 000000000000..fa2447588155 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListBackendBucketsRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListBackendBucketsRequest + */ +class ListBackendBucketsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListBackendBucketsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListBackendServicesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListBackendServicesRequest.php new file mode 100644 index 000000000000..c3ab95da319e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListBackendServicesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListBackendServicesRequest + */ +class ListBackendServicesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListBackendServicesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListDiskTypesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListDiskTypesRequest.php new file mode 100644 index 000000000000..1258610254eb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListDiskTypesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListDiskTypesRequest + */ +class ListDiskTypesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * + * @return \Google\Cloud\Compute\V1\ListDiskTypesRequest + * + * @experimental + */ + public static function build(string $project, string $zone): self + { + return (new self()) + ->setProject($project) + ->setZone($zone); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListDisksRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListDisksRequest.php new file mode 100644 index 000000000000..4014f74ec7dd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListDisksRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListDisksRequest + */ +class ListDisksRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * + * @return \Google\Cloud\Compute\V1\ListDisksRequest + * + * @experimental + */ + public static function build(string $project, string $zone): self + { + return (new self()) + ->setProject($project) + ->setZone($zone); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListDisksStoragePoolsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListDisksStoragePoolsRequest.php new file mode 100644 index 000000000000..7f906cedf636 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListDisksStoragePoolsRequest.php @@ -0,0 +1,372 @@ +google.cloud.compute.v1.ListDisksStoragePoolsRequest + */ +class ListDisksStoragePoolsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * Name of the storage pool to list disks of. + * + * Generated from protobuf field string storage_pool = 360473440 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $storage_pool = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $storagePool Name of the storage pool to list disks of. + * + * @return \Google\Cloud\Compute\V1\ListDisksStoragePoolsRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $storagePool): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setStoragePool($storagePool); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type string $storage_pool + * Name of the storage pool to list disks of. + * @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); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * Name of the storage pool to list disks of. + * + * Generated from protobuf field string storage_pool = 360473440 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getStoragePool() + { + return $this->storage_pool; + } + + /** + * Name of the storage pool to list disks of. + * + * Generated from protobuf field string storage_pool = 360473440 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setStoragePool($var) + { + GPBUtil::checkString($var, True); + $this->storage_pool = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListErrorsInstanceGroupManagersRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListErrorsInstanceGroupManagersRequest.php new file mode 100644 index 000000000000..4aa568422089 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListErrorsInstanceGroupManagersRequest.php @@ -0,0 +1,372 @@ +google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + */ +class ListErrorsInstanceGroupManagersRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $filter = null; + /** + * The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * 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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @param string $instanceGroupManager The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}. + * + * @return \Google\Cloud\Compute\V1\ListErrorsInstanceGroupManagersRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @type string $instance_group_manager + * The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type string $zone + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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 name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListErrorsRegionInstanceGroupManagersRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListErrorsRegionInstanceGroupManagersRequest.php new file mode 100644 index 000000000000..50f23400d350 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListErrorsRegionInstanceGroupManagersRequest.php @@ -0,0 +1,372 @@ +google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + */ +class ListErrorsRegionInstanceGroupManagersRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $filter = null; + /** + * The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * 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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. This should conform to RFC1035. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. This should conform to RFC1035. + * @param string $instanceGroupManager The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}. + * + * @return \Google\Cloud\Compute\V1\ListErrorsRegionInstanceGroupManagersRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroupManager): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroupManager($instanceGroupManager); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @type string $instance_group_manager + * The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}. + * @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 + * Name of the region scoping this request. This should conform to RFC1035. + * @type bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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 name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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; + } + + /** + * Name of the region scoping this request. This should conform to RFC1035. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping this request. This should conform to RFC1035. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListExternalVpnGatewaysRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListExternalVpnGatewaysRequest.php new file mode 100644 index 000000000000..db77ca224c1a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListExternalVpnGatewaysRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListExternalVpnGatewaysRequest + */ +class ListExternalVpnGatewaysRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListExternalVpnGatewaysRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListFirewallPoliciesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListFirewallPoliciesRequest.php new file mode 100644 index 000000000000..760b8674d943 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListFirewallPoliciesRequest.php @@ -0,0 +1,297 @@ +google.cloud.compute.v1.ListFirewallPoliciesRequest + */ +class ListFirewallPoliciesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * 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; + */ + protected $parent_id = null; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 $parent_id + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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 + */ + public function getParentId() + { + return isset($this->parent_id) ? $this->parent_id : ''; + } + + public function hasParentId() + { + return isset($this->parent_id); + } + + public function clearParentId() + { + unset($this->parent_id); + } + + /** + * 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 + * @return $this + */ + public function setParentId($var) + { + GPBUtil::checkString($var, True); + $this->parent_id = $var; + + return $this; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListFirewallsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListFirewallsRequest.php new file mode 100644 index 000000000000..0799c237ce71 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListFirewallsRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListFirewallsRequest + */ +class ListFirewallsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListFirewallsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListForwardingRulesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListForwardingRulesRequest.php new file mode 100644 index 000000000000..1ba7dd7a13c7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListForwardingRulesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListForwardingRulesRequest + */ +class ListForwardingRulesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * + * @return \Google\Cloud\Compute\V1\ListForwardingRulesRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalAddressesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalAddressesRequest.php new file mode 100644 index 000000000000..cc2513d3798c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalAddressesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListGlobalAddressesRequest + */ +class ListGlobalAddressesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListGlobalAddressesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalForwardingRulesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalForwardingRulesRequest.php new file mode 100644 index 000000000000..e804e31b6ff2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalForwardingRulesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListGlobalForwardingRulesRequest + */ +class ListGlobalForwardingRulesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListGlobalForwardingRulesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalNetworkEndpointGroupsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalNetworkEndpointGroupsRequest.php new file mode 100644 index 000000000000..a69a715d4fa6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalNetworkEndpointGroupsRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest + */ +class ListGlobalNetworkEndpointGroupsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListGlobalNetworkEndpointGroupsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalOperationsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalOperationsRequest.php new file mode 100644 index 000000000000..e8d28ecf8298 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalOperationsRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListGlobalOperationsRequest + */ +class ListGlobalOperationsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListGlobalOperationsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalOrganizationOperationsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalOrganizationOperationsRequest.php new file mode 100644 index 000000000000..27eb17ea00c1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalOrganizationOperationsRequest.php @@ -0,0 +1,297 @@ +google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest + */ +class ListGlobalOrganizationOperationsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Parent ID for this request. + * + * Generated from protobuf field optional string parent_id = 459714768; + */ + protected $parent_id = null; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 $parent_id + * Parent ID 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Parent ID for this request. + * + * Generated from protobuf field optional string parent_id = 459714768; + * @return string + */ + public function getParentId() + { + return isset($this->parent_id) ? $this->parent_id : ''; + } + + public function hasParentId() + { + return isset($this->parent_id); + } + + public function clearParentId() + { + unset($this->parent_id); + } + + /** + * Parent ID for this request. + * + * Generated from protobuf field optional string parent_id = 459714768; + * @param string $var + * @return $this + */ + public function setParentId($var) + { + GPBUtil::checkString($var, True); + $this->parent_id = $var; + + return $this; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalPublicDelegatedPrefixesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalPublicDelegatedPrefixesRequest.php new file mode 100644 index 000000000000..ffe88dd042a8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListGlobalPublicDelegatedPrefixesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest + */ +class ListGlobalPublicDelegatedPrefixesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListGlobalPublicDelegatedPrefixesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListHealthChecksRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListHealthChecksRequest.php new file mode 100644 index 000000000000..70801cb8bbb9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListHealthChecksRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListHealthChecksRequest + */ +class ListHealthChecksRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListHealthChecksRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListImagesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListImagesRequest.php new file mode 100644 index 000000000000..667a8affff17 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListImagesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListImagesRequest + */ +class ListImagesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListImagesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstanceGroupManagerResizeRequestsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstanceGroupManagerResizeRequestsRequest.php new file mode 100644 index 000000000000..48e48be47d2b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstanceGroupManagerResizeRequestsRequest.php @@ -0,0 +1,372 @@ +google.cloud.compute.v1.ListInstanceGroupManagerResizeRequestsRequest + */ +class ListInstanceGroupManagerResizeRequestsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $filter = null; + /** + * The name of the managed instance group. The name should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * 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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The name of the zone where the managed instance group is located. The name should conform to RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. The name should conform to RFC1035. + * @param string $instanceGroupManager The name of the managed instance group. The name should conform to RFC1035. + * + * @return \Google\Cloud\Compute\V1\ListInstanceGroupManagerResizeRequestsRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @type string $instance_group_manager + * The name of the managed instance group. The name should conform to RFC1035. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type string $zone + * The name of the zone where the managed instance group is located. The name should conform to RFC1035. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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 name of the managed instance group. The name should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. The name should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The name of the zone where the managed instance group is located. The name should conform to RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * The name of the zone where the managed instance group is located. The name should conform to RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstanceGroupManagersRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstanceGroupManagersRequest.php new file mode 100644 index 000000000000..737d68ab7e9f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstanceGroupManagersRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListInstanceGroupManagersRequest + */ +class ListInstanceGroupManagersRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The name of the zone where the managed instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. + * + * @return \Google\Cloud\Compute\V1\ListInstanceGroupManagersRequest + * + * @experimental + */ + public static function build(string $project, string $zone): self + { + return (new self()) + ->setProject($project) + ->setZone($zone); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type string $zone + * The name of the zone where the managed instance group is located. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The name of the zone where the managed instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * The name of the zone where the managed instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstanceGroupsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstanceGroupsRequest.php new file mode 100644 index 000000000000..117824f3b3ba --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstanceGroupsRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListInstanceGroupsRequest + */ +class ListInstanceGroupsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The name of the zone where the instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the instance group is located. + * + * @return \Google\Cloud\Compute\V1\ListInstanceGroupsRequest + * + * @experimental + */ + public static function build(string $project, string $zone): self + { + return (new self()) + ->setProject($project) + ->setZone($zone); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type string $zone + * The name of the zone where the instance group is located. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The name of the zone where the instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * The name of the zone where the instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstanceTemplatesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstanceTemplatesRequest.php new file mode 100644 index 000000000000..c78396944faf --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstanceTemplatesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListInstanceTemplatesRequest + */ +class ListInstanceTemplatesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListInstanceTemplatesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstancesInstanceGroupsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstancesInstanceGroupsRequest.php new file mode 100644 index 000000000000..6535930b3074 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstancesInstanceGroupsRequest.php @@ -0,0 +1,418 @@ +google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + */ +class ListInstancesInstanceGroupsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $filter = null; + /** + * The name of the instance group from which you want to generate a list of included instances. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupsListInstancesRequest instance_groups_list_instances_request_resource = 476255263 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_groups_list_instances_request_resource = 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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The name of the zone where the instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the instance group is located. + * @param string $instanceGroup The name of the instance group from which you want to generate a list of included instances. + * @param \Google\Cloud\Compute\V1\InstanceGroupsListInstancesRequest $instanceGroupsListInstancesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\ListInstancesInstanceGroupsRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroup, \Google\Cloud\Compute\V1\InstanceGroupsListInstancesRequest $instanceGroupsListInstancesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroup($instanceGroup) + ->setInstanceGroupsListInstancesRequestResource($instanceGroupsListInstancesRequestResource); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @type string $instance_group + * The name of the instance group from which you want to generate a list of included instances. + * @type \Google\Cloud\Compute\V1\InstanceGroupsListInstancesRequest $instance_groups_list_instances_request_resource + * The body resource for this request + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type string $zone + * The name of the zone where the instance group is located. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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 name of the instance group from which you want to generate a list of included instances. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroup() + { + return $this->instance_group; + } + + /** + * The name of the instance group from which you want to generate a list of included instances. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroup($var) + { + GPBUtil::checkString($var, True); + $this->instance_group = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupsListInstancesRequest instance_groups_list_instances_request_resource = 476255263 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupsListInstancesRequest|null + */ + public function getInstanceGroupsListInstancesRequestResource() + { + return $this->instance_groups_list_instances_request_resource; + } + + public function hasInstanceGroupsListInstancesRequestResource() + { + return isset($this->instance_groups_list_instances_request_resource); + } + + public function clearInstanceGroupsListInstancesRequestResource() + { + unset($this->instance_groups_list_instances_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupsListInstancesRequest instance_groups_list_instances_request_resource = 476255263 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupsListInstancesRequest $var + * @return $this + */ + public function setInstanceGroupsListInstancesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupsListInstancesRequest::class); + $this->instance_groups_list_instances_request_resource = $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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The name of the zone where the instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * The name of the zone where the instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstancesRegionInstanceGroupsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstancesRegionInstanceGroupsRequest.php new file mode 100644 index 000000000000..cc9291c2a0d1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstancesRegionInstanceGroupsRequest.php @@ -0,0 +1,418 @@ +google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + */ +class ListInstancesRegionInstanceGroupsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $filter = null; + /** + * Name of the regional instance group for which we want to list the instances. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group = ''; + /** + * 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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest region_instance_groups_list_instances_request_resource = 48239828 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_instance_groups_list_instances_request_resource = null; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $instanceGroup Name of the regional instance group for which we want to list the instances. + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupsListInstancesRequest $regionInstanceGroupsListInstancesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\ListInstancesRegionInstanceGroupsRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroup, \Google\Cloud\Compute\V1\RegionInstanceGroupsListInstancesRequest $regionInstanceGroupsListInstancesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroup($instanceGroup) + ->setRegionInstanceGroupsListInstancesRequestResource($regionInstanceGroupsListInstancesRequestResource); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @type string $instance_group + * Name of the regional instance group for which we want to list the instances. + * @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 + * Name of the region scoping this request. + * @type \Google\Cloud\Compute\V1\RegionInstanceGroupsListInstancesRequest $region_instance_groups_list_instances_request_resource + * The body resource 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the regional instance group for which we want to list the instances. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroup() + { + return $this->instance_group; + } + + /** + * Name of the regional instance group for which we want to list the instances. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroup($var) + { + GPBUtil::checkString($var, True); + $this->instance_group = $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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest region_instance_groups_list_instances_request_resource = 48239828 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionInstanceGroupsListInstancesRequest|null + */ + public function getRegionInstanceGroupsListInstancesRequestResource() + { + return $this->region_instance_groups_list_instances_request_resource; + } + + public function hasRegionInstanceGroupsListInstancesRequestResource() + { + return isset($this->region_instance_groups_list_instances_request_resource); + } + + public function clearRegionInstanceGroupsListInstancesRequestResource() + { + unset($this->region_instance_groups_list_instances_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest region_instance_groups_list_instances_request_resource = 48239828 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupsListInstancesRequest $var + * @return $this + */ + public function setRegionInstanceGroupsListInstancesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionInstanceGroupsListInstancesRequest::class); + $this->region_instance_groups_list_instances_request_resource = $var; + + return $this; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstancesRequest.php new file mode 100644 index 000000000000..96831a1794e2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstancesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListInstancesRequest + */ +class ListInstancesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * + * @return \Google\Cloud\Compute\V1\ListInstancesRequest + * + * @experimental + */ + public static function build(string $project, string $zone): self + { + return (new self()) + ->setProject($project) + ->setZone($zone); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstantSnapshotsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstantSnapshotsRequest.php new file mode 100644 index 000000000000..4dd5e4ec023c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInstantSnapshotsRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListInstantSnapshotsRequest + */ +class ListInstantSnapshotsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * + * @return \Google\Cloud\Compute\V1\ListInstantSnapshotsRequest + * + * @experimental + */ + public static function build(string $project, string $zone): self + { + return (new self()) + ->setProject($project) + ->setZone($zone); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInterconnectAttachmentsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInterconnectAttachmentsRequest.php new file mode 100644 index 000000000000..d359167ce977 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInterconnectAttachmentsRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListInterconnectAttachmentsRequest + */ +class ListInterconnectAttachmentsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * + * @return \Google\Cloud\Compute\V1\ListInterconnectAttachmentsRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInterconnectLocationsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInterconnectLocationsRequest.php new file mode 100644 index 000000000000..b6c0762f167d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInterconnectLocationsRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListInterconnectLocationsRequest + */ +class ListInterconnectLocationsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListInterconnectLocationsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInterconnectRemoteLocationsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInterconnectRemoteLocationsRequest.php new file mode 100644 index 000000000000..f25d40521b88 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInterconnectRemoteLocationsRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListInterconnectRemoteLocationsRequest + */ +class ListInterconnectRemoteLocationsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListInterconnectRemoteLocationsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInterconnectsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInterconnectsRequest.php new file mode 100644 index 000000000000..47c06928bc77 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListInterconnectsRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListInterconnectsRequest + */ +class ListInterconnectsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListInterconnectsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListLicensesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListLicensesRequest.php new file mode 100644 index 000000000000..53f2618a69ce --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListLicensesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListLicensesRequest + */ +class ListLicensesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListLicensesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListMachineImagesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListMachineImagesRequest.php new file mode 100644 index 000000000000..466c80b452f8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListMachineImagesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListMachineImagesRequest + */ +class ListMachineImagesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListMachineImagesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListMachineTypesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListMachineTypesRequest.php new file mode 100644 index 000000000000..5f7c044fd729 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListMachineTypesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListMachineTypesRequest + */ +class ListMachineTypesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * + * @return \Google\Cloud\Compute\V1\ListMachineTypesRequest + * + * @experimental + */ + public static function build(string $project, string $zone): self + { + return (new self()) + ->setProject($project) + ->setZone($zone); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListManagedInstancesInstanceGroupManagersRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListManagedInstancesInstanceGroupManagersRequest.php new file mode 100644 index 000000000000..b951a55c6874 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListManagedInstancesInstanceGroupManagersRequest.php @@ -0,0 +1,372 @@ +google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + */ +class ListManagedInstancesInstanceGroupManagersRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $filter = null; + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * 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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The name of the zone where the managed instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. + * @param string $instanceGroupManager The name of the managed instance group. + * + * @return \Google\Cloud\Compute\V1\ListManagedInstancesInstanceGroupManagersRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @type string $instance_group_manager + * The name of the managed instance group. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type string $zone + * The name of the zone where the managed instance group is located. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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 name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The name of the zone where the managed instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * The name of the zone where the managed instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListManagedInstancesRegionInstanceGroupManagersRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListManagedInstancesRegionInstanceGroupManagersRequest.php new file mode 100644 index 000000000000..3a1ea5c19484 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListManagedInstancesRegionInstanceGroupManagersRequest.php @@ -0,0 +1,372 @@ +google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + */ +class ListManagedInstancesRegionInstanceGroupManagersRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $filter = null; + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * 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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $instanceGroupManager The name of the managed instance group. + * + * @return \Google\Cloud\Compute\V1\ListManagedInstancesRegionInstanceGroupManagersRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroupManager): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroupManager($instanceGroupManager); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @type string $instance_group_manager + * The name of the managed instance group. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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 name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkAttachmentsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkAttachmentsRequest.php new file mode 100644 index 000000000000..10aca8092a60 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkAttachmentsRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListNetworkAttachmentsRequest + */ +class ListNetworkAttachmentsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region of this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region of this request. + * + * @return \Google\Cloud\Compute\V1\ListNetworkAttachmentsRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region of 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region of this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region of 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkEndpointGroupsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkEndpointGroupsRequest.php new file mode 100644 index 000000000000..db4b5e86cdfa --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkEndpointGroupsRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListNetworkEndpointGroupsRequest + */ +class ListNetworkEndpointGroupsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * + * @return \Google\Cloud\Compute\V1\ListNetworkEndpointGroupsRequest + * + * @experimental + */ + public static function build(string $project, string $zone): self + { + return (new self()) + ->setProject($project) + ->setZone($zone); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type string $zone + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.php new file mode 100644 index 000000000000..b970f278b22c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + */ +class ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $max_results = null; + /** + * The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_endpoint_group = ''; + /** + * 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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $networkEndpointGroup The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * + * @return \Google\Cloud\Compute\V1\ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * + * @experimental + */ + public static function build(string $project, string $networkEndpointGroup): self + { + return (new self()) + ->setProject($project) + ->setNetworkEndpointGroup($networkEndpointGroup); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 $network_endpoint_group + * The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkEndpointGroup() + { + return $this->network_endpoint_group; + } + + /** + * The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkEndpointGroup($var) + { + GPBUtil::checkString($var, True); + $this->network_endpoint_group = $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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkEndpointsNetworkEndpointGroupsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkEndpointsNetworkEndpointGroupsRequest.php new file mode 100644 index 000000000000..c59430ca6c58 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkEndpointsNetworkEndpointGroupsRequest.php @@ -0,0 +1,418 @@ +google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + */ +class ListNetworkEndpointsNetworkEndpointGroupsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $max_results = null; + /** + * The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_endpoint_group = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest network_endpoint_groups_list_endpoints_request_resource = 59493390 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_endpoint_groups_list_endpoints_request_resource = 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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @param string $networkEndpointGroup The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * @param \Google\Cloud\Compute\V1\NetworkEndpointGroupsListEndpointsRequest $networkEndpointGroupsListEndpointsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\ListNetworkEndpointsNetworkEndpointGroupsRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $networkEndpointGroup, \Google\Cloud\Compute\V1\NetworkEndpointGroupsListEndpointsRequest $networkEndpointGroupsListEndpointsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setNetworkEndpointGroupsListEndpointsRequestResource($networkEndpointGroupsListEndpointsRequestResource); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 $network_endpoint_group + * The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * @type \Google\Cloud\Compute\V1\NetworkEndpointGroupsListEndpointsRequest $network_endpoint_groups_list_endpoints_request_resource + * The body resource for this request + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type string $zone + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkEndpointGroup() + { + return $this->network_endpoint_group; + } + + /** + * The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkEndpointGroup($var) + { + GPBUtil::checkString($var, True); + $this->network_endpoint_group = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest network_endpoint_groups_list_endpoints_request_resource = 59493390 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NetworkEndpointGroupsListEndpointsRequest|null + */ + public function getNetworkEndpointGroupsListEndpointsRequestResource() + { + return $this->network_endpoint_groups_list_endpoints_request_resource; + } + + public function hasNetworkEndpointGroupsListEndpointsRequestResource() + { + return isset($this->network_endpoint_groups_list_endpoints_request_resource); + } + + public function clearNetworkEndpointGroupsListEndpointsRequestResource() + { + unset($this->network_endpoint_groups_list_endpoints_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest network_endpoint_groups_list_endpoints_request_resource = 59493390 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NetworkEndpointGroupsListEndpointsRequest $var + * @return $this + */ + public function setNetworkEndpointGroupsListEndpointsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkEndpointGroupsListEndpointsRequest::class); + $this->network_endpoint_groups_list_endpoints_request_resource = $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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkEndpointsRegionNetworkEndpointGroupsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkEndpointsRegionNetworkEndpointGroupsRequest.php new file mode 100644 index 000000000000..ba1f50c3a5ee --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkEndpointsRegionNetworkEndpointGroupsRequest.php @@ -0,0 +1,372 @@ +google.cloud.compute.v1.ListNetworkEndpointsRegionNetworkEndpointGroupsRequest + */ +class ListNetworkEndpointsRegionNetworkEndpointGroupsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $max_results = null; + /** + * The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_endpoint_group = ''; + /** + * 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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region where the network endpoint group is located. It should comply with RFC1035. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region where the network endpoint group is located. It should comply with RFC1035. + * @param string $networkEndpointGroup The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * + * @return \Google\Cloud\Compute\V1\ListNetworkEndpointsRegionNetworkEndpointGroupsRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $networkEndpointGroup): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setNetworkEndpointGroup($networkEndpointGroup); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 $network_endpoint_group + * The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * @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 region where the network endpoint group is located. It should comply with RFC1035. + * @type bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkEndpointGroup() + { + return $this->network_endpoint_group; + } + + /** + * The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * + * Generated from protobuf field string network_endpoint_group = 433907078 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkEndpointGroup($var) + { + GPBUtil::checkString($var, True); + $this->network_endpoint_group = $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 region where the network endpoint group is located. It should comply with RFC1035. + * + * 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 where the network endpoint group is located. It should comply with RFC1035. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkFirewallPoliciesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkFirewallPoliciesRequest.php new file mode 100644 index 000000000000..986c27084bec --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkFirewallPoliciesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListNetworkFirewallPoliciesRequest + */ +class ListNetworkFirewallPoliciesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListNetworkFirewallPoliciesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworksRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworksRequest.php new file mode 100644 index 000000000000..39aa0e53e1d9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworksRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListNetworksRequest + */ +class ListNetworksRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListNetworksRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNodeGroupsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNodeGroupsRequest.php new file mode 100644 index 000000000000..1ad30681e36b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNodeGroupsRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListNodeGroupsRequest + */ +class ListNodeGroupsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * + * @return \Google\Cloud\Compute\V1\ListNodeGroupsRequest + * + * @experimental + */ + public static function build(string $project, string $zone): self + { + return (new self()) + ->setProject($project) + ->setZone($zone); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNodeTemplatesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNodeTemplatesRequest.php new file mode 100644 index 000000000000..baea0e87ecd6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNodeTemplatesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListNodeTemplatesRequest + */ +class ListNodeTemplatesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * + * @return \Google\Cloud\Compute\V1\ListNodeTemplatesRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNodeTypesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNodeTypesRequest.php new file mode 100644 index 000000000000..b8142ecf3112 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNodeTypesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListNodeTypesRequest + */ +class ListNodeTypesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * + * @return \Google\Cloud\Compute\V1\ListNodeTypesRequest + * + * @experimental + */ + public static function build(string $project, string $zone): self + { + return (new self()) + ->setProject($project) + ->setZone($zone); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNodesNodeGroupsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNodesNodeGroupsRequest.php new file mode 100644 index 000000000000..1c6401b781d4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNodesNodeGroupsRequest.php @@ -0,0 +1,372 @@ +google.cloud.compute.v1.ListNodesNodeGroupsRequest + */ +class ListNodesNodeGroupsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $max_results = null; + /** + * Name of the NodeGroup resource whose nodes you want to list. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $node_group = ''; + /** + * 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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $nodeGroup Name of the NodeGroup resource whose nodes you want to list. + * + * @return \Google\Cloud\Compute\V1\ListNodesNodeGroupsRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $nodeGroup): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setNodeGroup($nodeGroup); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 $node_group + * Name of the NodeGroup resource whose nodes you want to list. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the NodeGroup resource whose nodes you want to list. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNodeGroup() + { + return $this->node_group; + } + + /** + * Name of the NodeGroup resource whose nodes you want to list. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNodeGroup($var) + { + GPBUtil::checkString($var, True); + $this->node_group = $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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPacketMirroringsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPacketMirroringsRequest.php new file mode 100644 index 000000000000..b30deb82c186 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPacketMirroringsRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListPacketMirroringsRequest + */ +class ListPacketMirroringsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * + * @return \Google\Cloud\Compute\V1\ListPacketMirroringsRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPeeringRoutesNetworksRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPeeringRoutesNetworksRequest.php new file mode 100644 index 000000000000..ea21682f5935 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPeeringRoutesNetworksRequest.php @@ -0,0 +1,472 @@ +google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + */ +class ListPeeringRoutesNetworksRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The direction of the exchanged routes. + * Check the Direction enum for the list of possible values. + * + * Generated from protobuf field optional string direction = 111150975; + */ + protected $direction = null; + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $max_results = null; + /** + * Name of the network for this request. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network = ''; + /** + * 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; + */ + protected $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; + */ + protected $page_token = null; + /** + * The response will show routes exchanged over the given peering connection. + * + * Generated from protobuf field optional string peering_name = 249571370; + */ + protected $peering_name = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The region of the request. The response will include all subnet routes, static routes and dynamic routes in the region. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $network Name of the network for this request. + * + * @return \Google\Cloud\Compute\V1\ListPeeringRoutesNetworksRequest + * + * @experimental + */ + public static function build(string $project, string $network): self + { + return (new self()) + ->setProject($project) + ->setNetwork($network); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $direction + * The direction of the exchanged routes. + * Check the Direction enum for the list of possible values. + * @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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 $network + * Name of the network for this request. + * @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 $peering_name + * The response will show routes exchanged over the given peering connection. + * @type string $project + * Project ID for this request. + * @type string $region + * The region of the request. The response will include all subnet routes, static routes and dynamic routes in the region. + * @type bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The direction of the exchanged routes. + * Check the Direction enum for the list of possible values. + * + * Generated from protobuf field optional string direction = 111150975; + * @return string + */ + public function getDirection() + { + return isset($this->direction) ? $this->direction : ''; + } + + public function hasDirection() + { + return isset($this->direction); + } + + public function clearDirection() + { + unset($this->direction); + } + + /** + * The direction of the exchanged routes. + * Check the Direction enum for the list of possible values. + * + * Generated from protobuf field optional string direction = 111150975; + * @param string $var + * @return $this + */ + public function setDirection($var) + { + GPBUtil::checkString($var, True); + $this->direction = $var; + + return $this; + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the network for this request. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Name of the network for this request. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $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; + } + + /** + * The response will show routes exchanged over the given peering connection. + * + * Generated from protobuf field optional string peering_name = 249571370; + * @return string + */ + public function getPeeringName() + { + return isset($this->peering_name) ? $this->peering_name : ''; + } + + public function hasPeeringName() + { + return isset($this->peering_name); + } + + public function clearPeeringName() + { + unset($this->peering_name); + } + + /** + * The response will show routes exchanged over the given peering connection. + * + * Generated from protobuf field optional string peering_name = 249571370; + * @param string $var + * @return $this + */ + public function setPeeringName($var) + { + GPBUtil::checkString($var, True); + $this->peering_name = $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 region of the request. The response will include all subnet routes, static routes and dynamic routes in the region. + * + * 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); + } + + /** + * The region of the request. The response will include all subnet routes, static routes and dynamic routes in the region. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPeeringRoutesNetworksRequest/Direction.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPeeringRoutesNetworksRequest/Direction.php new file mode 100644 index 000000000000..69ad35afc6f5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPeeringRoutesNetworksRequest/Direction.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.ListPeeringRoutesNetworksRequest.Direction + */ +class Direction +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_DIRECTION = 0; + */ + const UNDEFINED_DIRECTION = 0; + /** + * For routes exported from peer network. + * + * Generated from protobuf enum INCOMING = 338552870; + */ + const INCOMING = 338552870; + /** + * For routes exported from local network. + * + * Generated from protobuf enum OUTGOING = 307438444; + */ + const OUTGOING = 307438444; + + private static $valueToName = [ + self::UNDEFINED_DIRECTION => 'UNDEFINED_DIRECTION', + self::INCOMING => 'INCOMING', + self::OUTGOING => 'OUTGOING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Direction::class, \Google\Cloud\Compute\V1\ListPeeringRoutesNetworksRequest_Direction::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPerInstanceConfigsInstanceGroupManagersRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPerInstanceConfigsInstanceGroupManagersRequest.php new file mode 100644 index 000000000000..a4da68ebf6be --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPerInstanceConfigsInstanceGroupManagersRequest.php @@ -0,0 +1,372 @@ +google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + */ +class ListPerInstanceConfigsInstanceGroupManagersRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $filter = null; + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * 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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @param string $instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * + * @return \Google\Cloud\Compute\V1\ListPerInstanceConfigsInstanceGroupManagersRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @type string $instance_group_manager + * The name of the managed instance group. It should conform to RFC1035. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type string $zone + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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 name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPerInstanceConfigsRegionInstanceGroupManagersRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPerInstanceConfigsRegionInstanceGroupManagersRequest.php new file mode 100644 index 000000000000..f22324e5d69e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPerInstanceConfigsRegionInstanceGroupManagersRequest.php @@ -0,0 +1,372 @@ +google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + */ +class ListPerInstanceConfigsRegionInstanceGroupManagersRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $filter = null; + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * 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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request, should conform to RFC1035. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request, should conform to RFC1035. + * @param string $instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * + * @return \Google\Cloud\Compute\V1\ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroupManager): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroupManager($instanceGroupManager); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @type string $instance_group_manager + * The name of the managed instance group. It should conform to RFC1035. + * @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 + * Name of the region scoping this request, should conform to RFC1035. + * @type bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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 name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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; + } + + /** + * Name of the region scoping this request, should conform to RFC1035. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping this request, should conform to RFC1035. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPreconfiguredExpressionSetsSecurityPoliciesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPreconfiguredExpressionSetsSecurityPoliciesRequest.php new file mode 100644 index 000000000000..dc3e536f13fb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPreconfiguredExpressionSetsSecurityPoliciesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest + */ +class ListPreconfiguredExpressionSetsSecurityPoliciesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPublicAdvertisedPrefixesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPublicAdvertisedPrefixesRequest.php new file mode 100644 index 000000000000..5b3464cb0194 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPublicAdvertisedPrefixesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest + */ +class ListPublicAdvertisedPrefixesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListPublicAdvertisedPrefixesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPublicDelegatedPrefixesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPublicDelegatedPrefixesRequest.php new file mode 100644 index 000000000000..3212d31313d9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListPublicDelegatedPrefixesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest + */ +class ListPublicDelegatedPrefixesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region of this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region of this request. + * + * @return \Google\Cloud\Compute\V1\ListPublicDelegatedPrefixesRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region of 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region of this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region of 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListReferrersInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListReferrersInstancesRequest.php new file mode 100644 index 000000000000..a49bf6580a1d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListReferrersInstancesRequest.php @@ -0,0 +1,372 @@ +google.cloud.compute.v1.ListReferrersInstancesRequest + */ +class ListReferrersInstancesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $filter = null; + /** + * Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * 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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. + * + * @return \Google\Cloud\Compute\V1\ListReferrersInstancesRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @type string $instance + * Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. + * + * 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 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionAutoscalersRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionAutoscalersRequest.php new file mode 100644 index 000000000000..b8f15dc5e4e4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionAutoscalersRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRegionAutoscalersRequest + */ +class ListRegionAutoscalersRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionAutoscalersRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionBackendServicesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionBackendServicesRequest.php new file mode 100644 index 000000000000..e5c342c400e5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionBackendServicesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRegionBackendServicesRequest + */ +class ListRegionBackendServicesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionBackendServicesRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionCommitmentsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionCommitmentsRequest.php new file mode 100644 index 000000000000..ca4362086407 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionCommitmentsRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRegionCommitmentsRequest + */ +class ListRegionCommitmentsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionCommitmentsRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionDiskTypesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionDiskTypesRequest.php new file mode 100644 index 000000000000..a73ee89c0ab3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionDiskTypesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRegionDiskTypesRequest + */ +class ListRegionDiskTypesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionDiskTypesRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionDisksRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionDisksRequest.php new file mode 100644 index 000000000000..cfe0c8cd6023 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionDisksRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRegionDisksRequest + */ +class ListRegionDisksRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionDisksRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionHealthCheckServicesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionHealthCheckServicesRequest.php new file mode 100644 index 000000000000..01c06176a646 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionHealthCheckServicesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRegionHealthCheckServicesRequest + */ +class ListRegionHealthCheckServicesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionHealthCheckServicesRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionHealthChecksRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionHealthChecksRequest.php new file mode 100644 index 000000000000..d4ba6aeebb9b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionHealthChecksRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRegionHealthChecksRequest + */ +class ListRegionHealthChecksRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionHealthChecksRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionInstanceGroupManagersRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionInstanceGroupManagersRequest.php new file mode 100644 index 000000000000..5995f2ef465b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionInstanceGroupManagersRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest + */ +class ListRegionInstanceGroupManagersRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionInstanceGroupManagersRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionInstanceGroupsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionInstanceGroupsRequest.php new file mode 100644 index 000000000000..e5f44af5d0f4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionInstanceGroupsRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRegionInstanceGroupsRequest + */ +class ListRegionInstanceGroupsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionInstanceGroupsRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionInstanceTemplatesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionInstanceTemplatesRequest.php new file mode 100644 index 000000000000..81f48b3f0fe4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionInstanceTemplatesRequest.php @@ -0,0 +1,336 @@ +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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the regions for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the regions for this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionInstanceTemplatesRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionInstantSnapshotsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionInstantSnapshotsRequest.php new file mode 100644 index 000000000000..0938b406667d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionInstantSnapshotsRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRegionInstantSnapshotsRequest + */ +class ListRegionInstantSnapshotsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionInstantSnapshotsRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionNetworkEndpointGroupsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionNetworkEndpointGroupsRequest.php new file mode 100644 index 000000000000..a6c6c3f78ee9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionNetworkEndpointGroupsRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest + */ +class ListRegionNetworkEndpointGroupsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region where the network endpoint group is located. It should comply with RFC1035. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region where the network endpoint group is located. It should comply with RFC1035. + * + * @return \Google\Cloud\Compute\V1\ListRegionNetworkEndpointGroupsRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 region where the network endpoint group is located. It should comply with RFC1035. + * @type bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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 region where the network endpoint group is located. It should comply with RFC1035. + * + * 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 where the network endpoint group is located. It should comply with RFC1035. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionNetworkFirewallPoliciesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionNetworkFirewallPoliciesRequest.php new file mode 100644 index 000000000000..5004e5a88ac5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionNetworkFirewallPoliciesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRegionNetworkFirewallPoliciesRequest + */ +class ListRegionNetworkFirewallPoliciesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionNetworkFirewallPoliciesRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionNotificationEndpointsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionNotificationEndpointsRequest.php new file mode 100644 index 000000000000..3c3c86333ba8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionNotificationEndpointsRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRegionNotificationEndpointsRequest + */ +class ListRegionNotificationEndpointsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionNotificationEndpointsRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionOperationsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionOperationsRequest.php new file mode 100644 index 000000000000..af55a58032e7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionOperationsRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRegionOperationsRequest + */ +class ListRegionOperationsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionOperationsRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionSecurityPoliciesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionSecurityPoliciesRequest.php new file mode 100644 index 000000000000..21ee41641241 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionSecurityPoliciesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRegionSecurityPoliciesRequest + */ +class ListRegionSecurityPoliciesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionSecurityPoliciesRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionSslCertificatesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionSslCertificatesRequest.php new file mode 100644 index 000000000000..c735791ddc27 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionSslCertificatesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRegionSslCertificatesRequest + */ +class ListRegionSslCertificatesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionSslCertificatesRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionSslPoliciesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionSslPoliciesRequest.php new file mode 100644 index 000000000000..c015a934c39d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionSslPoliciesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRegionSslPoliciesRequest + */ +class ListRegionSslPoliciesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionSslPoliciesRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionTargetHttpProxiesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionTargetHttpProxiesRequest.php new file mode 100644 index 000000000000..27b97bbda890 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionTargetHttpProxiesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest + */ +class ListRegionTargetHttpProxiesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionTargetHttpProxiesRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionTargetHttpsProxiesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionTargetHttpsProxiesRequest.php new file mode 100644 index 000000000000..7fb002d3983a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionTargetHttpsProxiesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest + */ +class ListRegionTargetHttpsProxiesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionTargetHttpsProxiesRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionTargetTcpProxiesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionTargetTcpProxiesRequest.php new file mode 100644 index 000000000000..726637e34eef --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionTargetTcpProxiesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRegionTargetTcpProxiesRequest + */ +class ListRegionTargetTcpProxiesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionTargetTcpProxiesRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionUrlMapsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionUrlMapsRequest.php new file mode 100644 index 000000000000..3bf359a0e1a4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionUrlMapsRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRegionUrlMapsRequest + */ +class ListRegionUrlMapsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionUrlMapsRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionZonesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionZonesRequest.php new file mode 100644 index 000000000000..a3ea570d9561 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionZonesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRegionZonesRequest + */ +class ListRegionZonesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Region for this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionZonesRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionsRequest.php new file mode 100644 index 000000000000..ed9bbf043a27 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRegionsRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListRegionsRequest + */ +class ListRegionsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListRegionsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListReservationsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListReservationsRequest.php new file mode 100644 index 000000000000..7b83d9d0bd1c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListReservationsRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListReservationsRequest + */ +class ListReservationsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone for this request. + * + * @return \Google\Cloud\Compute\V1\ListReservationsRequest + * + * @experimental + */ + public static function build(string $project, string $zone): self + { + return (new self()) + ->setProject($project) + ->setZone($zone); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type string $zone + * Name of the zone for this request. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListResourcePoliciesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListResourcePoliciesRequest.php new file mode 100644 index 000000000000..f88a19617577 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListResourcePoliciesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListResourcePoliciesRequest + */ +class ListResourcePoliciesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * + * @return \Google\Cloud\Compute\V1\ListResourcePoliciesRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRoutersRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRoutersRequest.php new file mode 100644 index 000000000000..c8ee80df82e9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRoutersRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListRoutersRequest + */ +class ListRoutersRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * + * @return \Google\Cloud\Compute\V1\ListRoutersRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRoutesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRoutesRequest.php new file mode 100644 index 000000000000..c43a36598d23 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListRoutesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListRoutesRequest + */ +class ListRoutesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListRoutesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListSecurityPoliciesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListSecurityPoliciesRequest.php new file mode 100644 index 000000000000..3cbc09205eb8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListSecurityPoliciesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListSecurityPoliciesRequest + */ +class ListSecurityPoliciesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListSecurityPoliciesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListServiceAttachmentsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListServiceAttachmentsRequest.php new file mode 100644 index 000000000000..7c85bc6f53f1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListServiceAttachmentsRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListServiceAttachmentsRequest + */ +class ListServiceAttachmentsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region of this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region of this request. + * + * @return \Google\Cloud\Compute\V1\ListServiceAttachmentsRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region of 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region of this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region of 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListSnapshotsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListSnapshotsRequest.php new file mode 100644 index 000000000000..ca61701d4f9c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListSnapshotsRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListSnapshotsRequest + */ +class ListSnapshotsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListSnapshotsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListSslCertificatesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListSslCertificatesRequest.php new file mode 100644 index 000000000000..abd9b6caf7ca --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListSslCertificatesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListSslCertificatesRequest + */ +class ListSslCertificatesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListSslCertificatesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListSslPoliciesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListSslPoliciesRequest.php new file mode 100644 index 000000000000..f5cb2b4cf316 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListSslPoliciesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListSslPoliciesRequest + */ +class ListSslPoliciesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListSslPoliciesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListStoragePoolTypesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListStoragePoolTypesRequest.php new file mode 100644 index 000000000000..30059f2b667e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListStoragePoolTypesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListStoragePoolTypesRequest + */ +class ListStoragePoolTypesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * + * @return \Google\Cloud\Compute\V1\ListStoragePoolTypesRequest + * + * @experimental + */ + public static function build(string $project, string $zone): self + { + return (new self()) + ->setProject($project) + ->setZone($zone); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListStoragePoolsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListStoragePoolsRequest.php new file mode 100644 index 000000000000..c509861733a6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListStoragePoolsRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListStoragePoolsRequest + */ +class ListStoragePoolsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * + * @return \Google\Cloud\Compute\V1\ListStoragePoolsRequest + * + * @experimental + */ + public static function build(string $project, string $zone): self + { + return (new self()) + ->setProject($project) + ->setZone($zone); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListSubnetworksRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListSubnetworksRequest.php new file mode 100644 index 000000000000..2ff2aa735d74 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListSubnetworksRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListSubnetworksRequest + */ +class ListSubnetworksRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * + * @return \Google\Cloud\Compute\V1\ListSubnetworksRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetGrpcProxiesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetGrpcProxiesRequest.php new file mode 100644 index 000000000000..04fa1d142e50 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetGrpcProxiesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListTargetGrpcProxiesRequest + */ +class ListTargetGrpcProxiesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListTargetGrpcProxiesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetHttpProxiesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetHttpProxiesRequest.php new file mode 100644 index 000000000000..b68b8e1b0920 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetHttpProxiesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListTargetHttpProxiesRequest + */ +class ListTargetHttpProxiesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListTargetHttpProxiesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetHttpsProxiesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetHttpsProxiesRequest.php new file mode 100644 index 000000000000..837c13efc9bb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetHttpsProxiesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListTargetHttpsProxiesRequest + */ +class ListTargetHttpsProxiesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListTargetHttpsProxiesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetInstancesRequest.php new file mode 100644 index 000000000000..aab9d93e9064 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetInstancesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListTargetInstancesRequest + */ +class ListTargetInstancesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * Name of the zone scoping this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone scoping this request. + * + * @return \Google\Cloud\Compute\V1\ListTargetInstancesRequest + * + * @experimental + */ + public static function build(string $project, string $zone): self + { + return (new self()) + ->setProject($project) + ->setZone($zone); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type string $zone + * Name of the zone scoping this request. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * Name of the zone scoping this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Name of the zone scoping this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetPoolsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetPoolsRequest.php new file mode 100644 index 000000000000..17078508d504 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetPoolsRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListTargetPoolsRequest + */ +class ListTargetPoolsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * + * @return \Google\Cloud\Compute\V1\ListTargetPoolsRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetSslProxiesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetSslProxiesRequest.php new file mode 100644 index 000000000000..a23a676b1231 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetSslProxiesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListTargetSslProxiesRequest + */ +class ListTargetSslProxiesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListTargetSslProxiesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetTcpProxiesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetTcpProxiesRequest.php new file mode 100644 index 000000000000..03b1be115703 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetTcpProxiesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListTargetTcpProxiesRequest + */ +class ListTargetTcpProxiesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListTargetTcpProxiesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetVpnGatewaysRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetVpnGatewaysRequest.php new file mode 100644 index 000000000000..aeff9329739b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListTargetVpnGatewaysRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListTargetVpnGatewaysRequest + */ +class ListTargetVpnGatewaysRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * + * @return \Google\Cloud\Compute\V1\ListTargetVpnGatewaysRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListUrlMapsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListUrlMapsRequest.php new file mode 100644 index 000000000000..df34e7227dbe --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListUrlMapsRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListUrlMapsRequest + */ +class ListUrlMapsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListUrlMapsRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListUsableBackendServicesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListUsableBackendServicesRequest.php new file mode 100644 index 000000000000..a279e5975cf5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListUsableBackendServicesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListUsableBackendServicesRequest + */ +class ListUsableBackendServicesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListUsableBackendServicesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListUsableRegionBackendServicesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListUsableRegionBackendServicesRequest.php new file mode 100644 index 000000000000..53e0157a26a1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListUsableRegionBackendServicesRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListUsableRegionBackendServicesRequest + */ +class ListUsableRegionBackendServicesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. It must be a string that meets the requirements in RFC1035. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. It must be a string that meets the requirements in RFC1035. + * + * @return \Google\Cloud\Compute\V1\ListUsableRegionBackendServicesRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region scoping this request. It must be a string that meets the requirements in RFC1035. + * @type bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Name of the region scoping this request. It must be a string that meets the requirements in RFC1035. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping this request. It must be a string that meets the requirements in RFC1035. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListUsableSubnetworksRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListUsableSubnetworksRequest.php new file mode 100644 index 000000000000..1f9edc1f3a73 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListUsableSubnetworksRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListUsableSubnetworksRequest + */ +class ListUsableSubnetworksRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListUsableSubnetworksRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListVpnGatewaysRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListVpnGatewaysRequest.php new file mode 100644 index 000000000000..b1950cefe12a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListVpnGatewaysRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListVpnGatewaysRequest + */ +class ListVpnGatewaysRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * + * @return \Google\Cloud\Compute\V1\ListVpnGatewaysRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListVpnTunnelsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListVpnTunnelsRequest.php new file mode 100644 index 000000000000..d8a656d4f843 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListVpnTunnelsRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListVpnTunnelsRequest + */ +class ListVpnTunnelsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * + * @return \Google\Cloud\Compute\V1\ListVpnTunnelsRequest + * + * @experimental + */ + public static function build(string $project, string $region): self + { + return (new self()) + ->setProject($project) + ->setRegion($region); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * Name of the region 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListXpnHostsProjectsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListXpnHostsProjectsRequest.php new file mode 100644 index 000000000000..93bdc58d7690 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListXpnHostsProjectsRequest.php @@ -0,0 +1,346 @@ +google.cloud.compute.v1.ListXpnHostsProjectsRequest + */ +class ListXpnHostsProjectsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ProjectsListXpnHostsRequest projects_list_xpn_hosts_request_resource = 238266391 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $projects_list_xpn_hosts_request_resource = null; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\ProjectsListXpnHostsRequest $projectsListXpnHostsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\ListXpnHostsProjectsRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\ProjectsListXpnHostsRequest $projectsListXpnHostsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setProjectsListXpnHostsRequestResource($projectsListXpnHostsRequestResource); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 \Google\Cloud\Compute\V1\ProjectsListXpnHostsRequest $projects_list_xpn_hosts_request_resource + * The body resource 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ProjectsListXpnHostsRequest projects_list_xpn_hosts_request_resource = 238266391 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ProjectsListXpnHostsRequest|null + */ + public function getProjectsListXpnHostsRequestResource() + { + return $this->projects_list_xpn_hosts_request_resource; + } + + public function hasProjectsListXpnHostsRequestResource() + { + return isset($this->projects_list_xpn_hosts_request_resource); + } + + public function clearProjectsListXpnHostsRequestResource() + { + unset($this->projects_list_xpn_hosts_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ProjectsListXpnHostsRequest projects_list_xpn_hosts_request_resource = 238266391 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ProjectsListXpnHostsRequest $var + * @return $this + */ + public function setProjectsListXpnHostsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ProjectsListXpnHostsRequest::class); + $this->projects_list_xpn_hosts_request_resource = $var; + + return $this; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListZoneOperationsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListZoneOperationsRequest.php new file mode 100644 index 000000000000..afb448e842dd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListZoneOperationsRequest.php @@ -0,0 +1,336 @@ +google.cloud.compute.v1.ListZoneOperationsRequest + */ +class ListZoneOperationsRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + /** + * Name of the zone for request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone for request. + * + * @return \Google\Cloud\Compute\V1\ListZoneOperationsRequest + * + * @experimental + */ + public static function build(string $project, string $zone): self + { + return (new self()) + ->setProject($project) + ->setZone($zone); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type string $zone + * Name of the zone for request. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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; + } + + /** + * Name of the zone for request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Name of the zone for request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListZonesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListZonesRequest.php new file mode 100644 index 000000000000..3e5638104504 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListZonesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListZonesRequest + */ +class ListZonesRequest 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $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; + */ + protected $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; + */ + protected $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; + */ + protected $page_token = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * Generated from protobuf field optional bool return_partial_success = 517198390; + */ + protected $return_partial_success = null; + + /** + * @param string $project Project ID for this request. + * + * @return \Google\Cloud\Compute\V1\ListZonesRequest + * + * @experimental + */ + public static function build(string $project): self + { + return (new self()) + ->setProject($project); + } + + /** + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 bool $return_partial_success + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * } + */ + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * + * 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; + } + + /** + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocalDisk.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocalDisk.php new file mode 100644 index 000000000000..a6df8080f3ff --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocalDisk.php @@ -0,0 +1,164 @@ +google.cloud.compute.v1.LocalDisk + */ +class LocalDisk extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies the number of such disks. + * + * Generated from protobuf field optional int32 disk_count = 182933485; + */ + protected $disk_count = null; + /** + * Specifies the size of the disk in base-2 GB. + * + * Generated from protobuf field optional int32 disk_size_gb = 316263735; + */ + protected $disk_size_gb = null; + /** + * Specifies the desired disk type on the node. This disk type must be a local storage type (e.g.: local-ssd). Note that for nodeTemplates, this should be the name of the disk type and not its URL. + * + * Generated from protobuf field optional string disk_type = 93009052; + */ + protected $disk_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $disk_count + * Specifies the number of such disks. + * @type int $disk_size_gb + * Specifies the size of the disk in base-2 GB. + * @type string $disk_type + * Specifies the desired disk type on the node. This disk type must be a local storage type (e.g.: local-ssd). Note that for nodeTemplates, this should be the name of the disk type and not its URL. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies the number of such disks. + * + * Generated from protobuf field optional int32 disk_count = 182933485; + * @return int + */ + public function getDiskCount() + { + return isset($this->disk_count) ? $this->disk_count : 0; + } + + public function hasDiskCount() + { + return isset($this->disk_count); + } + + public function clearDiskCount() + { + unset($this->disk_count); + } + + /** + * Specifies the number of such disks. + * + * Generated from protobuf field optional int32 disk_count = 182933485; + * @param int $var + * @return $this + */ + public function setDiskCount($var) + { + GPBUtil::checkInt32($var); + $this->disk_count = $var; + + return $this; + } + + /** + * Specifies the size of the disk in base-2 GB. + * + * Generated from protobuf field optional int32 disk_size_gb = 316263735; + * @return int + */ + public function getDiskSizeGb() + { + return isset($this->disk_size_gb) ? $this->disk_size_gb : 0; + } + + public function hasDiskSizeGb() + { + return isset($this->disk_size_gb); + } + + public function clearDiskSizeGb() + { + unset($this->disk_size_gb); + } + + /** + * Specifies the size of the disk in base-2 GB. + * + * Generated from protobuf field optional int32 disk_size_gb = 316263735; + * @param int $var + * @return $this + */ + public function setDiskSizeGb($var) + { + GPBUtil::checkInt32($var); + $this->disk_size_gb = $var; + + return $this; + } + + /** + * Specifies the desired disk type on the node. This disk type must be a local storage type (e.g.: local-ssd). Note that for nodeTemplates, this should be the name of the disk type and not its URL. + * + * Generated from protobuf field optional string disk_type = 93009052; + * @return string + */ + public function getDiskType() + { + return isset($this->disk_type) ? $this->disk_type : ''; + } + + public function hasDiskType() + { + return isset($this->disk_type); + } + + public function clearDiskType() + { + unset($this->disk_type); + } + + /** + * Specifies the desired disk type on the node. This disk type must be a local storage type (e.g.: local-ssd). Note that for nodeTemplates, this should be the name of the disk type and not its URL. + * + * Generated from protobuf field optional string disk_type = 93009052; + * @param string $var + * @return $this + */ + public function setDiskType($var) + { + GPBUtil::checkString($var, True); + $this->disk_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocalizedMessage.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocalizedMessage.php new file mode 100644 index 000000000000..135da6c93bea --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocalizedMessage.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.LocalizedMessage + */ +class LocalizedMessage extends \Google\Protobuf\Internal\Message +{ + /** + * The locale used following the specification defined at https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: "en-US", "fr-CH", "es-MX" + * + * Generated from protobuf field optional string locale = 513150554; + */ + protected $locale = null; + /** + * The localized error message in the above locale. + * + * Generated from protobuf field optional string message = 418054151; + */ + protected $message = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $locale + * The locale used following the specification defined at https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: "en-US", "fr-CH", "es-MX" + * @type string $message + * The localized error message in the above locale. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The locale used following the specification defined at https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: "en-US", "fr-CH", "es-MX" + * + * Generated from protobuf field optional string locale = 513150554; + * @return string + */ + public function getLocale() + { + return isset($this->locale) ? $this->locale : ''; + } + + public function hasLocale() + { + return isset($this->locale); + } + + public function clearLocale() + { + unset($this->locale); + } + + /** + * The locale used following the specification defined at https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: "en-US", "fr-CH", "es-MX" + * + * Generated from protobuf field optional string locale = 513150554; + * @param string $var + * @return $this + */ + public function setLocale($var) + { + GPBUtil::checkString($var, True); + $this->locale = $var; + + return $this; + } + + /** + * The localized error message in the above locale. + * + * Generated from protobuf field optional string message = 418054151; + * @return string + */ + public function getMessage() + { + return isset($this->message) ? $this->message : ''; + } + + public function hasMessage() + { + return isset($this->message); + } + + public function clearMessage() + { + unset($this->message); + } + + /** + * The localized error message in the above locale. + * + * Generated from protobuf field optional string message = 418054151; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocationPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocationPolicy.php new file mode 100644 index 000000000000..5f0ae6ade56d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocationPolicy.php @@ -0,0 +1,115 @@ +google.cloud.compute.v1.LocationPolicy + */ +class LocationPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Location configurations mapped by location name. Currently only zone names are supported and must be represented as valid internal URLs, such as zones/us-central1-a. + * + * Generated from protobuf field map locations = 413423454; + */ + private $locations; + /** + * Strategy for distributing VMs across zones in a region. + * Check the TargetShape enum for the list of possible values. + * + * Generated from protobuf field optional string target_shape = 338621299; + */ + protected $target_shape = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $locations + * Location configurations mapped by location name. Currently only zone names are supported and must be represented as valid internal URLs, such as zones/us-central1-a. + * @type string $target_shape + * Strategy for distributing VMs across zones in a region. + * Check the TargetShape enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Location configurations mapped by location name. Currently only zone names are supported and must be represented as valid internal URLs, such as zones/us-central1-a. + * + * Generated from protobuf field map locations = 413423454; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLocations() + { + return $this->locations; + } + + /** + * Location configurations mapped by location name. Currently only zone names are supported and must be represented as valid internal URLs, such as zones/us-central1-a. + * + * Generated from protobuf field map locations = 413423454; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLocations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\LocationPolicyLocation::class); + $this->locations = $arr; + + return $this; + } + + /** + * Strategy for distributing VMs across zones in a region. + * Check the TargetShape enum for the list of possible values. + * + * Generated from protobuf field optional string target_shape = 338621299; + * @return string + */ + public function getTargetShape() + { + return isset($this->target_shape) ? $this->target_shape : ''; + } + + public function hasTargetShape() + { + return isset($this->target_shape); + } + + public function clearTargetShape() + { + unset($this->target_shape); + } + + /** + * Strategy for distributing VMs across zones in a region. + * Check the TargetShape enum for the list of possible values. + * + * Generated from protobuf field optional string target_shape = 338621299; + * @param string $var + * @return $this + */ + public function setTargetShape($var) + { + GPBUtil::checkString($var, True); + $this->target_shape = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocationPolicy/TargetShape.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocationPolicy/TargetShape.php new file mode 100644 index 000000000000..5b7fff251cb0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocationPolicy/TargetShape.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.LocationPolicy.TargetShape + */ +class TargetShape +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TARGET_SHAPE = 0; + */ + const UNDEFINED_TARGET_SHAPE = 0; + /** + * GCE picks zones for creating VM instances to fulfill the requested number of VMs within present resource constraints and to maximize utilization of unused zonal reservations. Recommended for batch workloads that do not require high availability. + * + * Generated from protobuf enum ANY = 64972; + */ + const ANY = 64972; + /** + * GCE always selects a single zone for all the VMs, optimizing for resource quotas, available reservations and general capacity. Recommended for batch workloads that cannot tollerate distribution over multiple zones. This the default shape in Bulk Insert and Capacity Advisor APIs. + * + * Generated from protobuf enum ANY_SINGLE_ZONE = 61100880; + */ + const ANY_SINGLE_ZONE = 61100880; + /** + * GCE prioritizes acquisition of resources, scheduling VMs in zones where resources are available while distributing VMs as evenly as possible across allowed zones to minimize the impact of zonal failure. Recommended for highly available serving workloads. + * + * Generated from protobuf enum BALANCED = 468409608; + */ + const BALANCED = 468409608; + + private static $valueToName = [ + self::UNDEFINED_TARGET_SHAPE => 'UNDEFINED_TARGET_SHAPE', + self::ANY => 'ANY', + self::ANY_SINGLE_ZONE => 'ANY_SINGLE_ZONE', + self::BALANCED => 'BALANCED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TargetShape::class, \Google\Cloud\Compute\V1\LocationPolicy_TargetShape::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocationPolicyLocation.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocationPolicyLocation.php new file mode 100644 index 000000000000..52b801d1d263 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocationPolicyLocation.php @@ -0,0 +1,124 @@ +google.cloud.compute.v1.LocationPolicyLocation + */ +class LocationPolicyLocation extends \Google\Protobuf\Internal\Message +{ + /** + * Constraints that the caller requires on the result distribution in this zone. + * + * Generated from protobuf field optional .google.cloud.compute.v1.LocationPolicyLocationConstraints constraints = 3909174; + */ + protected $constraints = null; + /** + * Preference for a given location. Set to either ALLOW or DENY. + * Check the Preference enum for the list of possible values. + * + * Generated from protobuf field optional string preference = 150781147; + */ + protected $preference = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\LocationPolicyLocationConstraints $constraints + * Constraints that the caller requires on the result distribution in this zone. + * @type string $preference + * Preference for a given location. Set to either ALLOW or DENY. + * Check the Preference enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Constraints that the caller requires on the result distribution in this zone. + * + * Generated from protobuf field optional .google.cloud.compute.v1.LocationPolicyLocationConstraints constraints = 3909174; + * @return \Google\Cloud\Compute\V1\LocationPolicyLocationConstraints|null + */ + public function getConstraints() + { + return $this->constraints; + } + + public function hasConstraints() + { + return isset($this->constraints); + } + + public function clearConstraints() + { + unset($this->constraints); + } + + /** + * Constraints that the caller requires on the result distribution in this zone. + * + * Generated from protobuf field optional .google.cloud.compute.v1.LocationPolicyLocationConstraints constraints = 3909174; + * @param \Google\Cloud\Compute\V1\LocationPolicyLocationConstraints $var + * @return $this + */ + public function setConstraints($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\LocationPolicyLocationConstraints::class); + $this->constraints = $var; + + return $this; + } + + /** + * Preference for a given location. Set to either ALLOW or DENY. + * Check the Preference enum for the list of possible values. + * + * Generated from protobuf field optional string preference = 150781147; + * @return string + */ + public function getPreference() + { + return isset($this->preference) ? $this->preference : ''; + } + + public function hasPreference() + { + return isset($this->preference); + } + + public function clearPreference() + { + unset($this->preference); + } + + /** + * Preference for a given location. Set to either ALLOW or DENY. + * Check the Preference enum for the list of possible values. + * + * Generated from protobuf field optional string preference = 150781147; + * @param string $var + * @return $this + */ + public function setPreference($var) + { + GPBUtil::checkString($var, True); + $this->preference = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocationPolicyLocation/Preference.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocationPolicyLocation/Preference.php new file mode 100644 index 000000000000..37783248831e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocationPolicyLocation/Preference.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.LocationPolicyLocation.Preference + */ +class Preference +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PREFERENCE = 0; + */ + const UNDEFINED_PREFERENCE = 0; + /** + * Location is allowed for use. + * + * Generated from protobuf enum ALLOW = 62368553; + */ + const ALLOW = 62368553; + /** + * Location is prohibited. + * + * Generated from protobuf enum DENY = 2094604; + */ + const DENY = 2094604; + /** + * Default value, unused. + * + * Generated from protobuf enum PREFERENCE_UNSPECIFIED = 496219571; + */ + const PREFERENCE_UNSPECIFIED = 496219571; + + private static $valueToName = [ + self::UNDEFINED_PREFERENCE => 'UNDEFINED_PREFERENCE', + self::ALLOW => 'ALLOW', + self::DENY => 'DENY', + self::PREFERENCE_UNSPECIFIED => 'PREFERENCE_UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Preference::class, \Google\Cloud\Compute\V1\LocationPolicyLocation_Preference::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocationPolicyLocationConstraints.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocationPolicyLocationConstraints.php new file mode 100644 index 000000000000..c1d1707df15a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LocationPolicyLocationConstraints.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.LocationPolicyLocationConstraints + */ +class LocationPolicyLocationConstraints extends \Google\Protobuf\Internal\Message +{ + /** + * Maximum number of items that are allowed to be placed in this zone. The value must be non-negative. + * + * Generated from protobuf field optional int32 max_count = 287620724; + */ + protected $max_count = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $max_count + * Maximum number of items that are allowed to be placed in this zone. The value must be non-negative. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Maximum number of items that are allowed to be placed in this zone. The value must be non-negative. + * + * Generated from protobuf field optional int32 max_count = 287620724; + * @return int + */ + public function getMaxCount() + { + return isset($this->max_count) ? $this->max_count : 0; + } + + public function hasMaxCount() + { + return isset($this->max_count); + } + + public function clearMaxCount() + { + unset($this->max_count); + } + + /** + * Maximum number of items that are allowed to be placed in this zone. The value must be non-negative. + * + * Generated from protobuf field optional int32 max_count = 287620724; + * @param int $var + * @return $this + */ + public function setMaxCount($var) + { + GPBUtil::checkInt32($var); + $this->max_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfig.php new file mode 100644 index 000000000000..bc718ce57667 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfig.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.LogConfig + */ +class LogConfig extends \Google\Protobuf\Internal\Message +{ + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional .google.cloud.compute.v1.LogConfigCloudAuditOptions cloud_audit = 412852561; + */ + protected $cloud_audit = null; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional .google.cloud.compute.v1.LogConfigCounterOptions counter = 420959740; + */ + protected $counter = null; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional .google.cloud.compute.v1.LogConfigDataAccessOptions data_access = 286633881; + */ + protected $data_access = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\LogConfigCloudAuditOptions $cloud_audit + * This is deprecated and has no effect. Do not use. + * @type \Google\Cloud\Compute\V1\LogConfigCounterOptions $counter + * This is deprecated and has no effect. Do not use. + * @type \Google\Cloud\Compute\V1\LogConfigDataAccessOptions $data_access + * This is deprecated and has no effect. Do not use. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional .google.cloud.compute.v1.LogConfigCloudAuditOptions cloud_audit = 412852561; + * @return \Google\Cloud\Compute\V1\LogConfigCloudAuditOptions|null + */ + public function getCloudAudit() + { + return $this->cloud_audit; + } + + public function hasCloudAudit() + { + return isset($this->cloud_audit); + } + + public function clearCloudAudit() + { + unset($this->cloud_audit); + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional .google.cloud.compute.v1.LogConfigCloudAuditOptions cloud_audit = 412852561; + * @param \Google\Cloud\Compute\V1\LogConfigCloudAuditOptions $var + * @return $this + */ + public function setCloudAudit($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\LogConfigCloudAuditOptions::class); + $this->cloud_audit = $var; + + return $this; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional .google.cloud.compute.v1.LogConfigCounterOptions counter = 420959740; + * @return \Google\Cloud\Compute\V1\LogConfigCounterOptions|null + */ + public function getCounter() + { + return $this->counter; + } + + public function hasCounter() + { + return isset($this->counter); + } + + public function clearCounter() + { + unset($this->counter); + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional .google.cloud.compute.v1.LogConfigCounterOptions counter = 420959740; + * @param \Google\Cloud\Compute\V1\LogConfigCounterOptions $var + * @return $this + */ + public function setCounter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\LogConfigCounterOptions::class); + $this->counter = $var; + + return $this; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional .google.cloud.compute.v1.LogConfigDataAccessOptions data_access = 286633881; + * @return \Google\Cloud\Compute\V1\LogConfigDataAccessOptions|null + */ + public function getDataAccess() + { + return $this->data_access; + } + + public function hasDataAccess() + { + return isset($this->data_access); + } + + public function clearDataAccess() + { + unset($this->data_access); + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional .google.cloud.compute.v1.LogConfigDataAccessOptions data_access = 286633881; + * @param \Google\Cloud\Compute\V1\LogConfigDataAccessOptions $var + * @return $this + */ + public function setDataAccess($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\LogConfigDataAccessOptions::class); + $this->data_access = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigCloudAuditOptions.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigCloudAuditOptions.php new file mode 100644 index 000000000000..13eb20815cb5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigCloudAuditOptions.php @@ -0,0 +1,125 @@ +google.cloud.compute.v1.LogConfigCloudAuditOptions + */ +class LogConfigCloudAuditOptions extends \Google\Protobuf\Internal\Message +{ + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AuthorizationLoggingOptions authorization_logging_options = 217861624; + */ + protected $authorization_logging_options = null; + /** + * This is deprecated and has no effect. Do not use. + * Check the LogName enum for the list of possible values. + * + * Generated from protobuf field optional string log_name = 402913958; + */ + protected $log_name = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\AuthorizationLoggingOptions $authorization_logging_options + * This is deprecated and has no effect. Do not use. + * @type string $log_name + * This is deprecated and has no effect. Do not use. + * Check the LogName enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AuthorizationLoggingOptions authorization_logging_options = 217861624; + * @return \Google\Cloud\Compute\V1\AuthorizationLoggingOptions|null + */ + public function getAuthorizationLoggingOptions() + { + return $this->authorization_logging_options; + } + + public function hasAuthorizationLoggingOptions() + { + return isset($this->authorization_logging_options); + } + + public function clearAuthorizationLoggingOptions() + { + unset($this->authorization_logging_options); + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AuthorizationLoggingOptions authorization_logging_options = 217861624; + * @param \Google\Cloud\Compute\V1\AuthorizationLoggingOptions $var + * @return $this + */ + public function setAuthorizationLoggingOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\AuthorizationLoggingOptions::class); + $this->authorization_logging_options = $var; + + return $this; + } + + /** + * This is deprecated and has no effect. Do not use. + * Check the LogName enum for the list of possible values. + * + * Generated from protobuf field optional string log_name = 402913958; + * @return string + */ + public function getLogName() + { + return isset($this->log_name) ? $this->log_name : ''; + } + + public function hasLogName() + { + return isset($this->log_name); + } + + public function clearLogName() + { + unset($this->log_name); + } + + /** + * This is deprecated and has no effect. Do not use. + * Check the LogName enum for the list of possible values. + * + * Generated from protobuf field optional string log_name = 402913958; + * @param string $var + * @return $this + */ + public function setLogName($var) + { + GPBUtil::checkString($var, True); + $this->log_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigCloudAuditOptions/LogName.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigCloudAuditOptions/LogName.php new file mode 100644 index 000000000000..3e18896c2b8f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigCloudAuditOptions/LogName.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.LogConfigCloudAuditOptions.LogName + */ +class LogName +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_LOG_NAME = 0; + */ + const UNDEFINED_LOG_NAME = 0; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum ADMIN_ACTIVITY = 427503135; + */ + const ADMIN_ACTIVITY = 427503135; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum DATA_ACCESS = 238070681; + */ + const DATA_ACCESS = 238070681; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum UNSPECIFIED_LOG_NAME = 410515182; + */ + const UNSPECIFIED_LOG_NAME = 410515182; + + private static $valueToName = [ + self::UNDEFINED_LOG_NAME => 'UNDEFINED_LOG_NAME', + self::ADMIN_ACTIVITY => 'ADMIN_ACTIVITY', + self::DATA_ACCESS => 'DATA_ACCESS', + self::UNSPECIFIED_LOG_NAME => 'UNSPECIFIED_LOG_NAME', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LogName::class, \Google\Cloud\Compute\V1\LogConfigCloudAuditOptions_LogName::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigCounterOptions.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigCounterOptions.php new file mode 100644 index 000000000000..ce5993b5f45c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigCounterOptions.php @@ -0,0 +1,155 @@ +google.cloud.compute.v1.LogConfigCounterOptions + */ +class LogConfigCounterOptions extends \Google\Protobuf\Internal\Message +{ + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.LogConfigCounterOptionsCustomField custom_fields = 249651015; + */ + private $custom_fields; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional string field = 97427706; + */ + protected $field = null; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional string metric = 533067184; + */ + protected $metric = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\LogConfigCounterOptionsCustomField>|\Google\Protobuf\Internal\RepeatedField $custom_fields + * This is deprecated and has no effect. Do not use. + * @type string $field + * This is deprecated and has no effect. Do not use. + * @type string $metric + * This is deprecated and has no effect. Do not use. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.LogConfigCounterOptionsCustomField custom_fields = 249651015; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCustomFields() + { + return $this->custom_fields; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.LogConfigCounterOptionsCustomField custom_fields = 249651015; + * @param array<\Google\Cloud\Compute\V1\LogConfigCounterOptionsCustomField>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCustomFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\LogConfigCounterOptionsCustomField::class); + $this->custom_fields = $arr; + + return $this; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional string field = 97427706; + * @return string + */ + public function getField() + { + return isset($this->field) ? $this->field : ''; + } + + public function hasField() + { + return isset($this->field); + } + + public function clearField() + { + unset($this->field); + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional string field = 97427706; + * @param string $var + * @return $this + */ + public function setField($var) + { + GPBUtil::checkString($var, True); + $this->field = $var; + + return $this; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional string metric = 533067184; + * @return string + */ + public function getMetric() + { + return isset($this->metric) ? $this->metric : ''; + } + + public function hasMetric() + { + return isset($this->metric); + } + + public function clearMetric() + { + unset($this->metric); + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional string metric = 533067184; + * @param string $var + * @return $this + */ + public function setMetric($var) + { + GPBUtil::checkString($var, True); + $this->metric = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigCounterOptionsCustomField.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigCounterOptionsCustomField.php new file mode 100644 index 000000000000..134ecae8d372 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigCounterOptionsCustomField.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.LogConfigCounterOptionsCustomField + */ +class LogConfigCounterOptionsCustomField extends \Google\Protobuf\Internal\Message +{ + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional string value = 111972721; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * This is deprecated and has no effect. Do not use. + * @type string $value + * This is deprecated and has no effect. Do not use. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * This is deprecated and has no effect. Do not use. + * + * 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); + } + + /** + * This is deprecated and has no effect. Do not use. + * + * 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; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional string value = 111972721; + * @return string + */ + public function getValue() + { + return isset($this->value) ? $this->value : ''; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional string value = 111972721; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigDataAccessOptions.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigDataAccessOptions.php new file mode 100644 index 000000000000..b64d34af945c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigDataAccessOptions.php @@ -0,0 +1,81 @@ +google.cloud.compute.v1.LogConfigDataAccessOptions + */ +class LogConfigDataAccessOptions extends \Google\Protobuf\Internal\Message +{ + /** + * This is deprecated and has no effect. Do not use. + * Check the LogMode enum for the list of possible values. + * + * Generated from protobuf field optional string log_mode = 402897342; + */ + protected $log_mode = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $log_mode + * This is deprecated and has no effect. Do not use. + * Check the LogMode enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * This is deprecated and has no effect. Do not use. + * Check the LogMode enum for the list of possible values. + * + * Generated from protobuf field optional string log_mode = 402897342; + * @return string + */ + public function getLogMode() + { + return isset($this->log_mode) ? $this->log_mode : ''; + } + + public function hasLogMode() + { + return isset($this->log_mode); + } + + public function clearLogMode() + { + unset($this->log_mode); + } + + /** + * This is deprecated and has no effect. Do not use. + * Check the LogMode enum for the list of possible values. + * + * Generated from protobuf field optional string log_mode = 402897342; + * @param string $var + * @return $this + */ + public function setLogMode($var) + { + GPBUtil::checkString($var, True); + $this->log_mode = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigDataAccessOptions/LogMode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigDataAccessOptions/LogMode.php new file mode 100644 index 000000000000..3b1db8d1e201 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/LogConfigDataAccessOptions/LogMode.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.LogConfigDataAccessOptions.LogMode + */ +class LogMode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_LOG_MODE = 0; + */ + const UNDEFINED_LOG_MODE = 0; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum LOG_FAIL_CLOSED = 360469778; + */ + const LOG_FAIL_CLOSED = 360469778; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum LOG_MODE_UNSPECIFIED = 88160822; + */ + const LOG_MODE_UNSPECIFIED = 88160822; + + private static $valueToName = [ + self::UNDEFINED_LOG_MODE => 'UNDEFINED_LOG_MODE', + self::LOG_FAIL_CLOSED => 'LOG_FAIL_CLOSED', + self::LOG_MODE_UNSPECIFIED => 'LOG_MODE_UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LogMode::class, \Google\Cloud\Compute\V1\LogConfigDataAccessOptions_LogMode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineImage.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineImage.php new file mode 100644 index 000000000000..c636be984649 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineImage.php @@ -0,0 +1,799 @@ +google.cloud.compute.v1.MachineImage + */ +class MachineImage extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The creation timestamp for this machine image in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Input Only] Whether to attempt an application consistent machine image by informing the OS to prepare for the snapshot process. + * + * Generated from protobuf field optional bool guest_flush = 385550813; + */ + protected $guest_flush = null; + /** + * [Output Only] A unique identifier for this machine image. The server defines this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Properties of source instance + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceProperties instance_properties = 215355165; + */ + protected $instance_properties = null; + /** + * [Output Only] The resource type, which is always compute#machineImage for machine image. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * Encrypts the machine image using a customer-supplied encryption key. After you encrypt a machine image using a customer-supplied key, you must provide the same key if you use the machine image later. For example, you must provide the encryption key when you create an instance from the encrypted machine image in a future request. Customer-supplied encryption keys do not protect access to metadata of the machine image. If you do not provide an encryption key when creating the machine image, then the machine image will be encrypted using an automatically generated key and you do not need to provide a key to use the machine image later. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey machine_image_encryption_key = 528089087; + */ + protected $machine_image_encryption_key = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzi = 480964257; + */ + protected $satisfies_pzi = null; + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + */ + protected $satisfies_pzs = null; + /** + * An array of Machine Image specific properties for disks attached to the source instance + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SavedDisk saved_disks = 397424318; + */ + private $saved_disks; + /** + * [Output Only] The URL for this machine image. The server defines this URL. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Input Only] The customer-supplied encryption key of the disks attached to the source instance. Required if the source disk is protected by a customer-supplied encryption key. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SourceDiskEncryptionKey source_disk_encryption_keys = 370408498; + */ + private $source_disk_encryption_keys; + /** + * The source instance used to create the machine image. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instances/instance - projects/project/zones/zone/instances/instance + * + * Generated from protobuf field optional string source_instance = 396315705; + */ + protected $source_instance = null; + /** + * [Output Only] DEPRECATED: Please use instance_properties instead for source instance related properties. New properties will not be added to this field. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SourceInstanceProperties source_instance_properties = 475195641; + */ + protected $source_instance_properties = null; + /** + * [Output Only] The status of the machine image. One of the following values: INVALID, CREATING, READY, DELETING, and UPLOADING. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + /** + * The regional or multi-regional Cloud Storage bucket location where the machine image is stored. + * + * Generated from protobuf field repeated string storage_locations = 328005274; + */ + private $storage_locations; + /** + * [Output Only] Total size of the storage used by the machine image. + * + * Generated from protobuf field optional int64 total_storage_bytes = 81855468; + */ + protected $total_storage_bytes = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] The creation timestamp for this machine image in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type bool $guest_flush + * [Input Only] Whether to attempt an application consistent machine image by informing the OS to prepare for the snapshot process. + * @type int|string $id + * [Output Only] A unique identifier for this machine image. The server defines this identifier. + * @type \Google\Cloud\Compute\V1\InstanceProperties $instance_properties + * [Output Only] Properties of source instance + * @type string $kind + * [Output Only] The resource type, which is always compute#machineImage for machine image. + * @type \Google\Cloud\Compute\V1\CustomerEncryptionKey $machine_image_encryption_key + * Encrypts the machine image using a customer-supplied encryption key. After you encrypt a machine image using a customer-supplied key, you must provide the same key if you use the machine image later. For example, you must provide the encryption key when you create an instance from the encrypted machine image in a future request. Customer-supplied encryption keys do not protect access to metadata of the machine image. If you do not provide an encryption key when creating the machine image, then the machine image will be encrypted using an automatically generated key and you do not need to provide a key to use the machine image later. + * @type string $name + * 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 bool $satisfies_pzi + * Output only. Reserved for future use. + * @type bool $satisfies_pzs + * [Output Only] Reserved for future use. + * @type array<\Google\Cloud\Compute\V1\SavedDisk>|\Google\Protobuf\Internal\RepeatedField $saved_disks + * An array of Machine Image specific properties for disks attached to the source instance + * @type string $self_link + * [Output Only] The URL for this machine image. The server defines this URL. + * @type array<\Google\Cloud\Compute\V1\SourceDiskEncryptionKey>|\Google\Protobuf\Internal\RepeatedField $source_disk_encryption_keys + * [Input Only] The customer-supplied encryption key of the disks attached to the source instance. Required if the source disk is protected by a customer-supplied encryption key. + * @type string $source_instance + * The source instance used to create the machine image. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instances/instance - projects/project/zones/zone/instances/instance + * @type \Google\Cloud\Compute\V1\SourceInstanceProperties $source_instance_properties + * [Output Only] DEPRECATED: Please use instance_properties instead for source instance related properties. New properties will not be added to this field. + * @type string $status + * [Output Only] The status of the machine image. One of the following values: INVALID, CREATING, READY, DELETING, and UPLOADING. + * Check the Status enum for the list of possible values. + * @type array|\Google\Protobuf\Internal\RepeatedField $storage_locations + * The regional or multi-regional Cloud Storage bucket location where the machine image is stored. + * @type int|string $total_storage_bytes + * [Output Only] Total size of the storage used by the machine image. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The creation timestamp for this machine image in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] The creation timestamp for this machine image in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Input Only] Whether to attempt an application consistent machine image by informing the OS to prepare for the snapshot process. + * + * Generated from protobuf field optional bool guest_flush = 385550813; + * @return bool + */ + public function getGuestFlush() + { + return isset($this->guest_flush) ? $this->guest_flush : false; + } + + public function hasGuestFlush() + { + return isset($this->guest_flush); + } + + public function clearGuestFlush() + { + unset($this->guest_flush); + } + + /** + * [Input Only] Whether to attempt an application consistent machine image by informing the OS to prepare for the snapshot process. + * + * Generated from protobuf field optional bool guest_flush = 385550813; + * @param bool $var + * @return $this + */ + public function setGuestFlush($var) + { + GPBUtil::checkBool($var); + $this->guest_flush = $var; + + return $this; + } + + /** + * [Output Only] A unique identifier for this machine image. The server defines this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] A unique identifier for this machine image. The server defines this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Properties of source instance + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceProperties instance_properties = 215355165; + * @return \Google\Cloud\Compute\V1\InstanceProperties|null + */ + public function getInstanceProperties() + { + return $this->instance_properties; + } + + public function hasInstanceProperties() + { + return isset($this->instance_properties); + } + + public function clearInstanceProperties() + { + unset($this->instance_properties); + } + + /** + * [Output Only] Properties of source instance + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceProperties instance_properties = 215355165; + * @param \Google\Cloud\Compute\V1\InstanceProperties $var + * @return $this + */ + public function setInstanceProperties($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceProperties::class); + $this->instance_properties = $var; + + return $this; + } + + /** + * [Output Only] The resource type, which is always compute#machineImage for machine image. + * + * 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); + } + + /** + * [Output Only] The resource type, which is always compute#machineImage for machine image. + * + * 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; + } + + /** + * Encrypts the machine image using a customer-supplied encryption key. After you encrypt a machine image using a customer-supplied key, you must provide the same key if you use the machine image later. For example, you must provide the encryption key when you create an instance from the encrypted machine image in a future request. Customer-supplied encryption keys do not protect access to metadata of the machine image. If you do not provide an encryption key when creating the machine image, then the machine image will be encrypted using an automatically generated key and you do not need to provide a key to use the machine image later. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey machine_image_encryption_key = 528089087; + * @return \Google\Cloud\Compute\V1\CustomerEncryptionKey|null + */ + public function getMachineImageEncryptionKey() + { + return $this->machine_image_encryption_key; + } + + public function hasMachineImageEncryptionKey() + { + return isset($this->machine_image_encryption_key); + } + + public function clearMachineImageEncryptionKey() + { + unset($this->machine_image_encryption_key); + } + + /** + * Encrypts the machine image using a customer-supplied encryption key. After you encrypt a machine image using a customer-supplied key, you must provide the same key if you use the machine image later. For example, you must provide the encryption key when you create an instance from the encrypted machine image in a future request. Customer-supplied encryption keys do not protect access to metadata of the machine image. If you do not provide an encryption key when creating the machine image, then the machine image will be encrypted using an automatically generated key and you do not need to provide a key to use the machine image later. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey machine_image_encryption_key = 528089087; + * @param \Google\Cloud\Compute\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setMachineImageEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomerEncryptionKey::class); + $this->machine_image_encryption_key = $var; + + return $this; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzi = 480964257; + * @return bool + */ + public function getSatisfiesPzi() + { + return isset($this->satisfies_pzi) ? $this->satisfies_pzi : false; + } + + public function hasSatisfiesPzi() + { + return isset($this->satisfies_pzi); + } + + public function clearSatisfiesPzi() + { + unset($this->satisfies_pzi); + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzi = 480964257; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + * @return bool + */ + public function getSatisfiesPzs() + { + return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; + } + + public function hasSatisfiesPzs() + { + return isset($this->satisfies_pzs); + } + + public function clearSatisfiesPzs() + { + unset($this->satisfies_pzs); + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * An array of Machine Image specific properties for disks attached to the source instance + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SavedDisk saved_disks = 397424318; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSavedDisks() + { + return $this->saved_disks; + } + + /** + * An array of Machine Image specific properties for disks attached to the source instance + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SavedDisk saved_disks = 397424318; + * @param array<\Google\Cloud\Compute\V1\SavedDisk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSavedDisks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SavedDisk::class); + $this->saved_disks = $arr; + + return $this; + } + + /** + * [Output Only] The URL for this machine image. The server defines this URL. + * + * 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] The URL for this machine image. The server defines this URL. + * + * 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; + } + + /** + * [Input Only] The customer-supplied encryption key of the disks attached to the source instance. Required if the source disk is protected by a customer-supplied encryption key. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SourceDiskEncryptionKey source_disk_encryption_keys = 370408498; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSourceDiskEncryptionKeys() + { + return $this->source_disk_encryption_keys; + } + + /** + * [Input Only] The customer-supplied encryption key of the disks attached to the source instance. Required if the source disk is protected by a customer-supplied encryption key. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SourceDiskEncryptionKey source_disk_encryption_keys = 370408498; + * @param array<\Google\Cloud\Compute\V1\SourceDiskEncryptionKey>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSourceDiskEncryptionKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SourceDiskEncryptionKey::class); + $this->source_disk_encryption_keys = $arr; + + return $this; + } + + /** + * The source instance used to create the machine image. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instances/instance - projects/project/zones/zone/instances/instance + * + * Generated from protobuf field optional string source_instance = 396315705; + * @return string + */ + public function getSourceInstance() + { + return isset($this->source_instance) ? $this->source_instance : ''; + } + + public function hasSourceInstance() + { + return isset($this->source_instance); + } + + public function clearSourceInstance() + { + unset($this->source_instance); + } + + /** + * The source instance used to create the machine image. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instances/instance - projects/project/zones/zone/instances/instance + * + * Generated from protobuf field optional string source_instance = 396315705; + * @param string $var + * @return $this + */ + public function setSourceInstance($var) + { + GPBUtil::checkString($var, True); + $this->source_instance = $var; + + return $this; + } + + /** + * [Output Only] DEPRECATED: Please use instance_properties instead for source instance related properties. New properties will not be added to this field. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SourceInstanceProperties source_instance_properties = 475195641; + * @return \Google\Cloud\Compute\V1\SourceInstanceProperties|null + */ + public function getSourceInstanceProperties() + { + return $this->source_instance_properties; + } + + public function hasSourceInstanceProperties() + { + return isset($this->source_instance_properties); + } + + public function clearSourceInstanceProperties() + { + unset($this->source_instance_properties); + } + + /** + * [Output Only] DEPRECATED: Please use instance_properties instead for source instance related properties. New properties will not be added to this field. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SourceInstanceProperties source_instance_properties = 475195641; + * @param \Google\Cloud\Compute\V1\SourceInstanceProperties $var + * @return $this + */ + public function setSourceInstanceProperties($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SourceInstanceProperties::class); + $this->source_instance_properties = $var; + + return $this; + } + + /** + * [Output Only] The status of the machine image. One of the following values: INVALID, CREATING, READY, DELETING, and UPLOADING. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] The status of the machine image. One of the following values: INVALID, CREATING, READY, DELETING, and UPLOADING. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + + /** + * The regional or multi-regional Cloud Storage bucket location where the machine image is stored. + * + * Generated from protobuf field repeated string storage_locations = 328005274; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStorageLocations() + { + return $this->storage_locations; + } + + /** + * The regional or multi-regional Cloud Storage bucket location where the machine image is stored. + * + * Generated from protobuf field repeated string storage_locations = 328005274; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStorageLocations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->storage_locations = $arr; + + return $this; + } + + /** + * [Output Only] Total size of the storage used by the machine image. + * + * Generated from protobuf field optional int64 total_storage_bytes = 81855468; + * @return int|string + */ + public function getTotalStorageBytes() + { + return isset($this->total_storage_bytes) ? $this->total_storage_bytes : 0; + } + + public function hasTotalStorageBytes() + { + return isset($this->total_storage_bytes); + } + + public function clearTotalStorageBytes() + { + unset($this->total_storage_bytes); + } + + /** + * [Output Only] Total size of the storage used by the machine image. + * + * Generated from protobuf field optional int64 total_storage_bytes = 81855468; + * @param int|string $var + * @return $this + */ + public function setTotalStorageBytes($var) + { + GPBUtil::checkInt64($var); + $this->total_storage_bytes = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineImage/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineImage/Status.php new file mode 100644 index 000000000000..2694838962ed --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineImage/Status.php @@ -0,0 +1,75 @@ +google.cloud.compute.v1.MachineImage.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * Generated from protobuf enum CREATING = 455564985; + */ + const CREATING = 455564985; + /** + * Generated from protobuf enum DELETING = 528602024; + */ + const DELETING = 528602024; + /** + * Generated from protobuf enum INVALID = 530283991; + */ + const INVALID = 530283991; + /** + * Generated from protobuf enum READY = 77848963; + */ + const READY = 77848963; + /** + * Generated from protobuf enum UPLOADING = 267603489; + */ + const UPLOADING = 267603489; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::CREATING => 'CREATING', + self::DELETING => 'DELETING', + self::INVALID => 'INVALID', + self::READY => 'READY', + self::UPLOADING => 'UPLOADING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\MachineImage_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineImageList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineImageList.php new file mode 100644 index 000000000000..39b235425758 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineImageList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.MachineImageList + */ +class MachineImageList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of MachineImage resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.MachineImage items = 100526016; + */ + private $items; + /** + * [Output Only] The resource type, which is always compute#machineImagesListResponse for machine image lists. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\MachineImage>|\Google\Protobuf\Internal\RepeatedField $items + * A list of MachineImage resources. + * @type string $kind + * [Output Only] The resource type, which is always compute#machineImagesListResponse for machine image lists. + * @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 MachineImage resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.MachineImage items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of MachineImage resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.MachineImage items = 100526016; + * @param array<\Google\Cloud\Compute\V1\MachineImage>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\MachineImage::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] The resource type, which is always compute#machineImagesListResponse for machine image lists. + * + * 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); + } + + /** + * [Output Only] The resource type, which is always compute#machineImagesListResponse for machine image lists. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineType.php new file mode 100644 index 000000000000..d1312228a16a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineType.php @@ -0,0 +1,717 @@ +google.cloud.compute.v1.MachineType + */ +class MachineType extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A list of accelerator configurations assigned to this machine type. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Accelerators accelerators = 269577064; + */ + private $accelerators; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * [Output Only] The deprecation status associated with this machine type. Only applicable if the machine type is unavailable. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + */ + protected $deprecated = null; + /** + * [Output Only] An optional textual description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The number of virtual CPUs that are available to the instance. + * + * Generated from protobuf field optional int32 guest_cpus = 393356754; + */ + protected $guest_cpus = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Deprecated] This property is deprecated and will never be populated with any relevant values. + * + * Generated from protobuf field optional int32 image_space_gb = 75331864; + */ + protected $image_space_gb = null; + /** + * [Output Only] Whether this machine type has a shared CPU. See Shared-core machine types for more information. + * + * Generated from protobuf field optional bool is_shared_cpu = 521399555; + */ + protected $is_shared_cpu = null; + /** + * [Output Only] The type of the resource. Always compute#machineType for machine types. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * [Output Only] Maximum persistent disks allowed. + * + * Generated from protobuf field optional int32 maximum_persistent_disks = 496220941; + */ + protected $maximum_persistent_disks = null; + /** + * [Output Only] Maximum total persistent disks size (GB) allowed. + * + * Generated from protobuf field optional int64 maximum_persistent_disks_size_gb = 154274471; + */ + protected $maximum_persistent_disks_size_gb = null; + /** + * [Output Only] The amount of physical memory available to the instance, defined in MB. + * + * Generated from protobuf field optional int32 memory_mb = 116001171; + */ + protected $memory_mb = null; + /** + * [Output Only] Name of the resource. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] A list of extended scratch disks assigned to the instance. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ScratchDisks scratch_disks = 480778481; + */ + private $scratch_disks; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] The name of the zone where the machine type resides, such as us-central1-a. + * + * Generated from protobuf field optional string zone = 3744684; + */ + protected $zone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\Accelerators>|\Google\Protobuf\Internal\RepeatedField $accelerators + * [Output Only] A list of accelerator configurations assigned to this machine type. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type \Google\Cloud\Compute\V1\DeprecationStatus $deprecated + * [Output Only] The deprecation status associated with this machine type. Only applicable if the machine type is unavailable. + * @type string $description + * [Output Only] An optional textual description of the resource. + * @type int $guest_cpus + * [Output Only] The number of virtual CPUs that are available to the instance. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type int $image_space_gb + * [Deprecated] This property is deprecated and will never be populated with any relevant values. + * @type bool $is_shared_cpu + * [Output Only] Whether this machine type has a shared CPU. See Shared-core machine types for more information. + * @type string $kind + * [Output Only] The type of the resource. Always compute#machineType for machine types. + * @type int $maximum_persistent_disks + * [Output Only] Maximum persistent disks allowed. + * @type int|string $maximum_persistent_disks_size_gb + * [Output Only] Maximum total persistent disks size (GB) allowed. + * @type int $memory_mb + * [Output Only] The amount of physical memory available to the instance, defined in MB. + * @type string $name + * [Output Only] Name of the resource. + * @type array<\Google\Cloud\Compute\V1\ScratchDisks>|\Google\Protobuf\Internal\RepeatedField $scratch_disks + * [Output Only] A list of extended scratch disks assigned to the instance. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $zone + * [Output Only] The name of the zone where the machine type resides, such as us-central1-a. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] A list of accelerator configurations assigned to this machine type. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Accelerators accelerators = 269577064; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAccelerators() + { + return $this->accelerators; + } + + /** + * [Output Only] A list of accelerator configurations assigned to this machine type. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Accelerators accelerators = 269577064; + * @param array<\Google\Cloud\Compute\V1\Accelerators>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAccelerators($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Accelerators::class); + $this->accelerators = $arr; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * [Output Only] The deprecation status associated with this machine type. Only applicable if the machine type is unavailable. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + * @return \Google\Cloud\Compute\V1\DeprecationStatus|null + */ + public function getDeprecated() + { + return $this->deprecated; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * [Output Only] The deprecation status associated with this machine type. Only applicable if the machine type is unavailable. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + * @param \Google\Cloud\Compute\V1\DeprecationStatus $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DeprecationStatus::class); + $this->deprecated = $var; + + return $this; + } + + /** + * [Output Only] An optional textual description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * [Output Only] An optional textual description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The number of virtual CPUs that are available to the instance. + * + * Generated from protobuf field optional int32 guest_cpus = 393356754; + * @return int + */ + public function getGuestCpus() + { + return isset($this->guest_cpus) ? $this->guest_cpus : 0; + } + + public function hasGuestCpus() + { + return isset($this->guest_cpus); + } + + public function clearGuestCpus() + { + unset($this->guest_cpus); + } + + /** + * [Output Only] The number of virtual CPUs that are available to the instance. + * + * Generated from protobuf field optional int32 guest_cpus = 393356754; + * @param int $var + * @return $this + */ + public function setGuestCpus($var) + { + GPBUtil::checkInt32($var); + $this->guest_cpus = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Deprecated] This property is deprecated and will never be populated with any relevant values. + * + * Generated from protobuf field optional int32 image_space_gb = 75331864; + * @return int + */ + public function getImageSpaceGb() + { + return isset($this->image_space_gb) ? $this->image_space_gb : 0; + } + + public function hasImageSpaceGb() + { + return isset($this->image_space_gb); + } + + public function clearImageSpaceGb() + { + unset($this->image_space_gb); + } + + /** + * [Deprecated] This property is deprecated and will never be populated with any relevant values. + * + * Generated from protobuf field optional int32 image_space_gb = 75331864; + * @param int $var + * @return $this + */ + public function setImageSpaceGb($var) + { + GPBUtil::checkInt32($var); + $this->image_space_gb = $var; + + return $this; + } + + /** + * [Output Only] Whether this machine type has a shared CPU. See Shared-core machine types for more information. + * + * Generated from protobuf field optional bool is_shared_cpu = 521399555; + * @return bool + */ + public function getIsSharedCpu() + { + return isset($this->is_shared_cpu) ? $this->is_shared_cpu : false; + } + + public function hasIsSharedCpu() + { + return isset($this->is_shared_cpu); + } + + public function clearIsSharedCpu() + { + unset($this->is_shared_cpu); + } + + /** + * [Output Only] Whether this machine type has a shared CPU. See Shared-core machine types for more information. + * + * Generated from protobuf field optional bool is_shared_cpu = 521399555; + * @param bool $var + * @return $this + */ + public function setIsSharedCpu($var) + { + GPBUtil::checkBool($var); + $this->is_shared_cpu = $var; + + return $this; + } + + /** + * [Output Only] The type of the resource. Always compute#machineType for machine types. + * + * 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); + } + + /** + * [Output Only] The type of the resource. Always compute#machineType for machine types. + * + * 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] Maximum persistent disks allowed. + * + * Generated from protobuf field optional int32 maximum_persistent_disks = 496220941; + * @return int + */ + public function getMaximumPersistentDisks() + { + return isset($this->maximum_persistent_disks) ? $this->maximum_persistent_disks : 0; + } + + public function hasMaximumPersistentDisks() + { + return isset($this->maximum_persistent_disks); + } + + public function clearMaximumPersistentDisks() + { + unset($this->maximum_persistent_disks); + } + + /** + * [Output Only] Maximum persistent disks allowed. + * + * Generated from protobuf field optional int32 maximum_persistent_disks = 496220941; + * @param int $var + * @return $this + */ + public function setMaximumPersistentDisks($var) + { + GPBUtil::checkInt32($var); + $this->maximum_persistent_disks = $var; + + return $this; + } + + /** + * [Output Only] Maximum total persistent disks size (GB) allowed. + * + * Generated from protobuf field optional int64 maximum_persistent_disks_size_gb = 154274471; + * @return int|string + */ + public function getMaximumPersistentDisksSizeGb() + { + return isset($this->maximum_persistent_disks_size_gb) ? $this->maximum_persistent_disks_size_gb : 0; + } + + public function hasMaximumPersistentDisksSizeGb() + { + return isset($this->maximum_persistent_disks_size_gb); + } + + public function clearMaximumPersistentDisksSizeGb() + { + unset($this->maximum_persistent_disks_size_gb); + } + + /** + * [Output Only] Maximum total persistent disks size (GB) allowed. + * + * Generated from protobuf field optional int64 maximum_persistent_disks_size_gb = 154274471; + * @param int|string $var + * @return $this + */ + public function setMaximumPersistentDisksSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->maximum_persistent_disks_size_gb = $var; + + return $this; + } + + /** + * [Output Only] The amount of physical memory available to the instance, defined in MB. + * + * Generated from protobuf field optional int32 memory_mb = 116001171; + * @return int + */ + public function getMemoryMb() + { + return isset($this->memory_mb) ? $this->memory_mb : 0; + } + + public function hasMemoryMb() + { + return isset($this->memory_mb); + } + + public function clearMemoryMb() + { + unset($this->memory_mb); + } + + /** + * [Output Only] The amount of physical memory available to the instance, defined in MB. + * + * Generated from protobuf field optional int32 memory_mb = 116001171; + * @param int $var + * @return $this + */ + public function setMemoryMb($var) + { + GPBUtil::checkInt32($var); + $this->memory_mb = $var; + + return $this; + } + + /** + * [Output Only] Name of the resource. + * + * 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); + } + + /** + * [Output Only] Name of the resource. + * + * 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; + } + + /** + * [Output Only] A list of extended scratch disks assigned to the instance. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ScratchDisks scratch_disks = 480778481; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getScratchDisks() + { + return $this->scratch_disks; + } + + /** + * [Output Only] A list of extended scratch disks assigned to the instance. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ScratchDisks scratch_disks = 480778481; + * @param array<\Google\Cloud\Compute\V1\ScratchDisks>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScratchDisks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ScratchDisks::class); + $this->scratch_disks = $arr; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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] The name of the zone where the machine type resides, such as us-central1-a. + * + * Generated from protobuf field optional string zone = 3744684; + * @return string + */ + public function getZone() + { + return isset($this->zone) ? $this->zone : ''; + } + + public function hasZone() + { + return isset($this->zone); + } + + public function clearZone() + { + unset($this->zone); + } + + /** + * [Output Only] The name of the zone where the machine type resides, such as us-central1-a. + * + * Generated from protobuf field optional string zone = 3744684; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineTypeAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineTypeAggregatedList.php new file mode 100644 index 000000000000..ce6bae4eba38 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineTypeAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.MachineTypeAggregatedList + */ +class MachineTypeAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of MachineTypesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#machineTypeAggregatedList for aggregated lists of machine types. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 MachineTypesScopedList resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#machineTypeAggregatedList for aggregated lists of machine types. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 MachineTypesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of MachineTypesScopedList 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\MachineTypesScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#machineTypeAggregatedList for aggregated lists of machine types. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#machineTypeAggregatedList for aggregated lists of machine types. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineTypeList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineTypeList.php new file mode 100644 index 000000000000..2ea972c318b8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineTypeList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.MachineTypeList + */ +class MachineTypeList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of MachineType resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.MachineType items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#machineTypeList for lists of machine types. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\MachineType>|\Google\Protobuf\Internal\RepeatedField $items + * A list of MachineType resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#machineTypeList for lists of machine types. + * @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 MachineType resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.MachineType items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of MachineType resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.MachineType items = 100526016; + * @param array<\Google\Cloud\Compute\V1\MachineType>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\MachineType::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#machineTypeList for lists of machine types. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#machineTypeList for lists of machine types. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineTypesScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineTypesScopedList.php new file mode 100644 index 000000000000..be492637f8e3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineTypesScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.MachineTypesScopedList + */ +class MachineTypesScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A list of machine types contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.MachineType machine_types = 79720065; + */ + private $machine_types; + /** + * [Output Only] An informational warning that appears when the machine types list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\MachineType>|\Google\Protobuf\Internal\RepeatedField $machine_types + * [Output Only] A list of machine types contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] An informational warning that appears when the machine types list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] A list of machine types contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.MachineType machine_types = 79720065; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMachineTypes() + { + return $this->machine_types; + } + + /** + * [Output Only] A list of machine types contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.MachineType machine_types = 79720065; + * @param array<\Google\Cloud\Compute\V1\MachineType>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMachineTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\MachineType::class); + $this->machine_types = $arr; + + return $this; + } + + /** + * [Output Only] An informational warning that appears when the machine types 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 appears when the machine types 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstance.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstance.php new file mode 100644 index 000000000000..163b8d781d5c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstance.php @@ -0,0 +1,471 @@ +google.cloud.compute.v1.ManagedInstance + */ +class ManagedInstance extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The current action that the managed instance group has scheduled for the instance. Possible values: - NONE The instance is running, and the managed instance group does not have any scheduled actions for this instance. - CREATING The managed instance group is creating this instance. If the group fails to create this instance, it will try again until it is successful. - CREATING_WITHOUT_RETRIES The managed instance group is attempting to create this instance only once. If the group fails to create this instance, it does not try again and the group's targetSize value is decreased instead. - RECREATING The managed instance group is recreating this instance. - DELETING The managed instance group is permanently deleting this instance. - ABANDONING The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group. - RESTARTING The managed instance group is restarting the instance. - REFRESHING The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance. - VERIFYING The managed instance group has created the instance and it is in the process of being verified. + * Check the CurrentAction enum for the list of possible values. + * + * Generated from protobuf field optional string current_action = 178475964; + */ + protected $current_action = null; + /** + * [Output only] The unique identifier for this resource. This field is empty when instance does not exist. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] The URL of the instance. The URL can exist even if the instance has not yet been created. + * + * Generated from protobuf field optional string instance = 18257045; + */ + protected $instance = null; + /** + * [Output Only] Health state of the instance per health-check. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ManagedInstanceInstanceHealth instance_health = 382667078; + */ + private $instance_health; + /** + * [Output Only] The status of the instance. This field is empty when the instance does not exist. + * Check the InstanceStatus enum for the list of possible values. + * + * Generated from protobuf field optional string instance_status = 174577372; + */ + protected $instance_status = null; + /** + * [Output Only] Information about the last attempt to create or delete the instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ManagedInstanceLastAttempt last_attempt = 434771492; + */ + protected $last_attempt = null; + /** + * [Output Only] The name of the instance. The name always exists even if the instance has not yet been created. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] Preserved state applied from per-instance config for this instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.PreservedState preserved_state_from_config = 98661858; + */ + protected $preserved_state_from_config = null; + /** + * [Output Only] Preserved state generated based on stateful policy for this instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.PreservedState preserved_state_from_policy = 470783954; + */ + protected $preserved_state_from_policy = null; + /** + * [Output Only] Intended version of this instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ManagedInstanceVersion version = 351608024; + */ + protected $version = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $current_action + * [Output Only] The current action that the managed instance group has scheduled for the instance. Possible values: - NONE The instance is running, and the managed instance group does not have any scheduled actions for this instance. - CREATING The managed instance group is creating this instance. If the group fails to create this instance, it will try again until it is successful. - CREATING_WITHOUT_RETRIES The managed instance group is attempting to create this instance only once. If the group fails to create this instance, it does not try again and the group's targetSize value is decreased instead. - RECREATING The managed instance group is recreating this instance. - DELETING The managed instance group is permanently deleting this instance. - ABANDONING The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group. - RESTARTING The managed instance group is restarting the instance. - REFRESHING The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance. - VERIFYING The managed instance group has created the instance and it is in the process of being verified. + * Check the CurrentAction enum for the list of possible values. + * @type int|string $id + * [Output only] The unique identifier for this resource. This field is empty when instance does not exist. + * @type string $instance + * [Output Only] The URL of the instance. The URL can exist even if the instance has not yet been created. + * @type array<\Google\Cloud\Compute\V1\ManagedInstanceInstanceHealth>|\Google\Protobuf\Internal\RepeatedField $instance_health + * [Output Only] Health state of the instance per health-check. + * @type string $instance_status + * [Output Only] The status of the instance. This field is empty when the instance does not exist. + * Check the InstanceStatus enum for the list of possible values. + * @type \Google\Cloud\Compute\V1\ManagedInstanceLastAttempt $last_attempt + * [Output Only] Information about the last attempt to create or delete the instance. + * @type string $name + * [Output Only] The name of the instance. The name always exists even if the instance has not yet been created. + * @type \Google\Cloud\Compute\V1\PreservedState $preserved_state_from_config + * [Output Only] Preserved state applied from per-instance config for this instance. + * @type \Google\Cloud\Compute\V1\PreservedState $preserved_state_from_policy + * [Output Only] Preserved state generated based on stateful policy for this instance. + * @type \Google\Cloud\Compute\V1\ManagedInstanceVersion $version + * [Output Only] Intended version of this instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The current action that the managed instance group has scheduled for the instance. Possible values: - NONE The instance is running, and the managed instance group does not have any scheduled actions for this instance. - CREATING The managed instance group is creating this instance. If the group fails to create this instance, it will try again until it is successful. - CREATING_WITHOUT_RETRIES The managed instance group is attempting to create this instance only once. If the group fails to create this instance, it does not try again and the group's targetSize value is decreased instead. - RECREATING The managed instance group is recreating this instance. - DELETING The managed instance group is permanently deleting this instance. - ABANDONING The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group. - RESTARTING The managed instance group is restarting the instance. - REFRESHING The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance. - VERIFYING The managed instance group has created the instance and it is in the process of being verified. + * Check the CurrentAction enum for the list of possible values. + * + * Generated from protobuf field optional string current_action = 178475964; + * @return string + */ + public function getCurrentAction() + { + return isset($this->current_action) ? $this->current_action : ''; + } + + public function hasCurrentAction() + { + return isset($this->current_action); + } + + public function clearCurrentAction() + { + unset($this->current_action); + } + + /** + * [Output Only] The current action that the managed instance group has scheduled for the instance. Possible values: - NONE The instance is running, and the managed instance group does not have any scheduled actions for this instance. - CREATING The managed instance group is creating this instance. If the group fails to create this instance, it will try again until it is successful. - CREATING_WITHOUT_RETRIES The managed instance group is attempting to create this instance only once. If the group fails to create this instance, it does not try again and the group's targetSize value is decreased instead. - RECREATING The managed instance group is recreating this instance. - DELETING The managed instance group is permanently deleting this instance. - ABANDONING The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group. - RESTARTING The managed instance group is restarting the instance. - REFRESHING The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance. - VERIFYING The managed instance group has created the instance and it is in the process of being verified. + * Check the CurrentAction enum for the list of possible values. + * + * Generated from protobuf field optional string current_action = 178475964; + * @param string $var + * @return $this + */ + public function setCurrentAction($var) + { + GPBUtil::checkString($var, True); + $this->current_action = $var; + + return $this; + } + + /** + * [Output only] The unique identifier for this resource. This field is empty when instance does not exist. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output only] The unique identifier for this resource. This field is empty when instance does not exist. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] The URL of the instance. The URL can exist even if the instance has not yet been created. + * + * Generated from protobuf field optional string instance = 18257045; + * @return string + */ + public function getInstance() + { + return isset($this->instance) ? $this->instance : ''; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * [Output Only] The URL of the instance. The URL can exist even if the instance has not yet been created. + * + * Generated from protobuf field optional string instance = 18257045; + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + + /** + * [Output Only] Health state of the instance per health-check. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ManagedInstanceInstanceHealth instance_health = 382667078; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstanceHealth() + { + return $this->instance_health; + } + + /** + * [Output Only] Health state of the instance per health-check. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ManagedInstanceInstanceHealth instance_health = 382667078; + * @param array<\Google\Cloud\Compute\V1\ManagedInstanceInstanceHealth>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstanceHealth($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ManagedInstanceInstanceHealth::class); + $this->instance_health = $arr; + + return $this; + } + + /** + * [Output Only] The status of the instance. This field is empty when the instance does not exist. + * Check the InstanceStatus enum for the list of possible values. + * + * Generated from protobuf field optional string instance_status = 174577372; + * @return string + */ + public function getInstanceStatus() + { + return isset($this->instance_status) ? $this->instance_status : ''; + } + + public function hasInstanceStatus() + { + return isset($this->instance_status); + } + + public function clearInstanceStatus() + { + unset($this->instance_status); + } + + /** + * [Output Only] The status of the instance. This field is empty when the instance does not exist. + * Check the InstanceStatus enum for the list of possible values. + * + * Generated from protobuf field optional string instance_status = 174577372; + * @param string $var + * @return $this + */ + public function setInstanceStatus($var) + { + GPBUtil::checkString($var, True); + $this->instance_status = $var; + + return $this; + } + + /** + * [Output Only] Information about the last attempt to create or delete the instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ManagedInstanceLastAttempt last_attempt = 434771492; + * @return \Google\Cloud\Compute\V1\ManagedInstanceLastAttempt|null + */ + public function getLastAttempt() + { + return $this->last_attempt; + } + + public function hasLastAttempt() + { + return isset($this->last_attempt); + } + + public function clearLastAttempt() + { + unset($this->last_attempt); + } + + /** + * [Output Only] Information about the last attempt to create or delete the instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ManagedInstanceLastAttempt last_attempt = 434771492; + * @param \Google\Cloud\Compute\V1\ManagedInstanceLastAttempt $var + * @return $this + */ + public function setLastAttempt($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ManagedInstanceLastAttempt::class); + $this->last_attempt = $var; + + return $this; + } + + /** + * [Output Only] The name of the instance. The name always exists even if the instance has not yet been created. + * + * 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); + } + + /** + * [Output Only] The name of the instance. The name always exists even if the instance has not yet been created. + * + * 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; + } + + /** + * [Output Only] Preserved state applied from per-instance config for this instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.PreservedState preserved_state_from_config = 98661858; + * @return \Google\Cloud\Compute\V1\PreservedState|null + */ + public function getPreservedStateFromConfig() + { + return $this->preserved_state_from_config; + } + + public function hasPreservedStateFromConfig() + { + return isset($this->preserved_state_from_config); + } + + public function clearPreservedStateFromConfig() + { + unset($this->preserved_state_from_config); + } + + /** + * [Output Only] Preserved state applied from per-instance config for this instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.PreservedState preserved_state_from_config = 98661858; + * @param \Google\Cloud\Compute\V1\PreservedState $var + * @return $this + */ + public function setPreservedStateFromConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\PreservedState::class); + $this->preserved_state_from_config = $var; + + return $this; + } + + /** + * [Output Only] Preserved state generated based on stateful policy for this instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.PreservedState preserved_state_from_policy = 470783954; + * @return \Google\Cloud\Compute\V1\PreservedState|null + */ + public function getPreservedStateFromPolicy() + { + return $this->preserved_state_from_policy; + } + + public function hasPreservedStateFromPolicy() + { + return isset($this->preserved_state_from_policy); + } + + public function clearPreservedStateFromPolicy() + { + unset($this->preserved_state_from_policy); + } + + /** + * [Output Only] Preserved state generated based on stateful policy for this instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.PreservedState preserved_state_from_policy = 470783954; + * @param \Google\Cloud\Compute\V1\PreservedState $var + * @return $this + */ + public function setPreservedStateFromPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\PreservedState::class); + $this->preserved_state_from_policy = $var; + + return $this; + } + + /** + * [Output Only] Intended version of this instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ManagedInstanceVersion version = 351608024; + * @return \Google\Cloud\Compute\V1\ManagedInstanceVersion|null + */ + public function getVersion() + { + return $this->version; + } + + public function hasVersion() + { + return isset($this->version); + } + + public function clearVersion() + { + unset($this->version); + } + + /** + * [Output Only] Intended version of this instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ManagedInstanceVersion version = 351608024; + * @param \Google\Cloud\Compute\V1\ManagedInstanceVersion $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ManagedInstanceVersion::class); + $this->version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstance/CurrentAction.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstance/CurrentAction.php new file mode 100644 index 000000000000..4eb11d204355 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstance/CurrentAction.php @@ -0,0 +1,130 @@ +google.cloud.compute.v1.ManagedInstance.CurrentAction + */ +class CurrentAction +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_CURRENT_ACTION = 0; + */ + const UNDEFINED_CURRENT_ACTION = 0; + /** + * The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group. + * + * Generated from protobuf enum ABANDONING = 388244813; + */ + const ABANDONING = 388244813; + /** + * The managed instance group is creating this instance. If the group fails to create this instance, it will try again until it is successful. + * + * Generated from protobuf enum CREATING = 455564985; + */ + const CREATING = 455564985; + /** + * The managed instance group is attempting to create this instance only once. If the group fails to create this instance, it does not try again and the group's targetSize value is decreased. + * + * Generated from protobuf enum CREATING_WITHOUT_RETRIES = 428843785; + */ + const CREATING_WITHOUT_RETRIES = 428843785; + /** + * The managed instance group is permanently deleting this instance. + * + * Generated from protobuf enum DELETING = 528602024; + */ + const DELETING = 528602024; + /** + * The managed instance group has not scheduled any actions for this instance. + * + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + /** + * The managed instance group is recreating this instance. + * + * Generated from protobuf enum RECREATING = 287278572; + */ + const RECREATING = 287278572; + /** + * The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance. + * + * Generated from protobuf enum REFRESHING = 163266343; + */ + const REFRESHING = 163266343; + /** + * The managed instance group is restarting this instance. + * + * Generated from protobuf enum RESTARTING = 320534387; + */ + const RESTARTING = 320534387; + /** + * The managed instance group is resuming this instance. + * + * Generated from protobuf enum RESUMING = 446856618; + */ + const RESUMING = 446856618; + /** + * The managed instance group is starting this instance. + * + * Generated from protobuf enum STARTING = 488820800; + */ + const STARTING = 488820800; + /** + * The managed instance group is verifying this already created instance. Verification happens every time the instance is (re)created or restarted and consists of: 1. Waiting until health check specified as part of this managed instance group's autohealing policy reports HEALTHY. Note: Applies only if autohealing policy has a health check specified 2. Waiting for addition verification steps performed as post-instance creation (subject to future extensions). + * + * Generated from protobuf enum VERIFYING = 16982185; + */ + const VERIFYING = 16982185; + + private static $valueToName = [ + self::UNDEFINED_CURRENT_ACTION => 'UNDEFINED_CURRENT_ACTION', + self::ABANDONING => 'ABANDONING', + self::CREATING => 'CREATING', + self::CREATING_WITHOUT_RETRIES => 'CREATING_WITHOUT_RETRIES', + self::DELETING => 'DELETING', + self::NONE => 'NONE', + self::RECREATING => 'RECREATING', + self::REFRESHING => 'REFRESHING', + self::RESTARTING => 'RESTARTING', + self::RESUMING => 'RESUMING', + self::STARTING => 'STARTING', + self::VERIFYING => 'VERIFYING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CurrentAction::class, \Google\Cloud\Compute\V1\ManagedInstance_CurrentAction::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstance/InstanceStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstance/InstanceStatus.php new file mode 100644 index 000000000000..b0ad890ca5c3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstance/InstanceStatus.php @@ -0,0 +1,119 @@ +google.cloud.compute.v1.ManagedInstance.InstanceStatus + */ +class InstanceStatus +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_INSTANCE_STATUS = 0; + */ + const UNDEFINED_INSTANCE_STATUS = 0; + /** + * The instance is halted and we are performing tear down tasks like network deprogramming, releasing quota, IP, tearing down disks etc. + * + * Generated from protobuf enum DEPROVISIONING = 428935662; + */ + const DEPROVISIONING = 428935662; + /** + * Resources are being allocated for the instance. + * + * Generated from protobuf enum PROVISIONING = 290896621; + */ + const PROVISIONING = 290896621; + /** + * The instance is in repair. + * + * Generated from protobuf enum REPAIRING = 413483285; + */ + const REPAIRING = 413483285; + /** + * The instance is running. + * + * Generated from protobuf enum RUNNING = 121282975; + */ + const RUNNING = 121282975; + /** + * All required resources have been allocated and the instance is being started. + * + * Generated from protobuf enum STAGING = 431072283; + */ + const STAGING = 431072283; + /** + * The instance has stopped successfully. + * + * Generated from protobuf enum STOPPED = 444276141; + */ + const STOPPED = 444276141; + /** + * Generated from protobuf enum STOPPING = 350791796; + */ + const STOPPING = 350791796; + /** + * The instance has suspended. + * + * Generated from protobuf enum SUSPENDED = 51223995; + */ + const SUSPENDED = 51223995; + /** + * Generated from protobuf enum SUSPENDING = 514206246; + */ + const SUSPENDING = 514206246; + /** + * The instance has stopped (either by explicit action or underlying failure). + * + * Generated from protobuf enum TERMINATED = 250018339; + */ + const TERMINATED = 250018339; + + private static $valueToName = [ + self::UNDEFINED_INSTANCE_STATUS => 'UNDEFINED_INSTANCE_STATUS', + self::DEPROVISIONING => 'DEPROVISIONING', + self::PROVISIONING => 'PROVISIONING', + self::REPAIRING => 'REPAIRING', + self::RUNNING => 'RUNNING', + self::STAGING => 'STAGING', + self::STOPPED => 'STOPPED', + self::STOPPING => 'STOPPING', + self::SUSPENDED => 'SUSPENDED', + self::SUSPENDING => 'SUSPENDING', + self::TERMINATED => 'TERMINATED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(InstanceStatus::class, \Google\Cloud\Compute\V1\ManagedInstance_InstanceStatus::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstanceInstanceHealth.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstanceInstanceHealth.php new file mode 100644 index 000000000000..3ce8478f8fb5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstanceInstanceHealth.php @@ -0,0 +1,124 @@ +google.cloud.compute.v1.ManagedInstanceInstanceHealth + */ +class ManagedInstanceInstanceHealth extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The current detailed instance health state. + * Check the DetailedHealthState enum for the list of possible values. + * + * Generated from protobuf field optional string detailed_health_state = 510470173; + */ + protected $detailed_health_state = null; + /** + * [Output Only] The URL for the health check that verifies whether the instance is healthy. + * + * Generated from protobuf field optional string health_check = 308876645; + */ + protected $health_check = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $detailed_health_state + * [Output Only] The current detailed instance health state. + * Check the DetailedHealthState enum for the list of possible values. + * @type string $health_check + * [Output Only] The URL for the health check that verifies whether the instance is healthy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The current detailed instance health state. + * Check the DetailedHealthState enum for the list of possible values. + * + * Generated from protobuf field optional string detailed_health_state = 510470173; + * @return string + */ + public function getDetailedHealthState() + { + return isset($this->detailed_health_state) ? $this->detailed_health_state : ''; + } + + public function hasDetailedHealthState() + { + return isset($this->detailed_health_state); + } + + public function clearDetailedHealthState() + { + unset($this->detailed_health_state); + } + + /** + * [Output Only] The current detailed instance health state. + * Check the DetailedHealthState enum for the list of possible values. + * + * Generated from protobuf field optional string detailed_health_state = 510470173; + * @param string $var + * @return $this + */ + public function setDetailedHealthState($var) + { + GPBUtil::checkString($var, True); + $this->detailed_health_state = $var; + + return $this; + } + + /** + * [Output Only] The URL for the health check that verifies whether the instance is healthy. + * + * Generated from protobuf field optional string health_check = 308876645; + * @return string + */ + public function getHealthCheck() + { + return isset($this->health_check) ? $this->health_check : ''; + } + + public function hasHealthCheck() + { + return isset($this->health_check); + } + + public function clearHealthCheck() + { + unset($this->health_check); + } + + /** + * [Output Only] The URL for the health check that verifies whether the instance is healthy. + * + * Generated from protobuf field optional string health_check = 308876645; + * @param string $var + * @return $this + */ + public function setHealthCheck($var) + { + GPBUtil::checkString($var, True); + $this->health_check = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstanceInstanceHealth/DetailedHealthState.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstanceInstanceHealth/DetailedHealthState.php new file mode 100644 index 000000000000..0e15cf5ab2e0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstanceInstanceHealth/DetailedHealthState.php @@ -0,0 +1,85 @@ +google.cloud.compute.v1.ManagedInstanceInstanceHealth.DetailedHealthState + */ +class DetailedHealthState +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_DETAILED_HEALTH_STATE = 0; + */ + const UNDEFINED_DETAILED_HEALTH_STATE = 0; + /** + * The instance is being drained. The existing connections to the instance have time to complete, but the new ones are being refused. + * + * Generated from protobuf enum DRAINING = 480455402; + */ + const DRAINING = 480455402; + /** + * The instance is reachable i.e. a connection to the application health checking endpoint can be established, and conforms to the requirements defined by the health check. + * + * Generated from protobuf enum HEALTHY = 439801213; + */ + const HEALTHY = 439801213; + /** + * The instance is unreachable i.e. a connection to the application health checking endpoint cannot be established, or the server does not respond within the specified timeout. + * + * Generated from protobuf enum TIMEOUT = 477813057; + */ + const TIMEOUT = 477813057; + /** + * The instance is reachable, but does not conform to the requirements defined by the health check. + * + * Generated from protobuf enum UNHEALTHY = 462118084; + */ + const UNHEALTHY = 462118084; + /** + * The health checking system is aware of the instance but its health is not known at the moment. + * + * Generated from protobuf enum UNKNOWN = 433141802; + */ + const UNKNOWN = 433141802; + + private static $valueToName = [ + self::UNDEFINED_DETAILED_HEALTH_STATE => 'UNDEFINED_DETAILED_HEALTH_STATE', + self::DRAINING => 'DRAINING', + self::HEALTHY => 'HEALTHY', + self::TIMEOUT => 'TIMEOUT', + self::UNHEALTHY => 'UNHEALTHY', + self::UNKNOWN => 'UNKNOWN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DetailedHealthState::class, \Google\Cloud\Compute\V1\ManagedInstanceInstanceHealth_DetailedHealthState::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstanceLastAttempt.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstanceLastAttempt.php new file mode 100644 index 000000000000..529ac6809cef --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstanceLastAttempt.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.ManagedInstanceLastAttempt + */ +class ManagedInstanceLastAttempt extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Encountered errors during the last attempt to create or delete the instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Errors errors = 315977579; + */ + protected $errors = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\Errors $errors + * [Output Only] Encountered errors during the last attempt to create or delete the instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Encountered errors during the last attempt to create or delete the instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Errors errors = 315977579; + * @return \Google\Cloud\Compute\V1\Errors|null + */ + public function getErrors() + { + return $this->errors; + } + + public function hasErrors() + { + return isset($this->errors); + } + + public function clearErrors() + { + unset($this->errors); + } + + /** + * [Output Only] Encountered errors during the last attempt to create or delete the instance. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Errors errors = 315977579; + * @param \Google\Cloud\Compute\V1\Errors $var + * @return $this + */ + public function setErrors($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Errors::class); + $this->errors = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstanceVersion.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstanceVersion.php new file mode 100644 index 000000000000..044944d7ec5e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstanceVersion.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.ManagedInstanceVersion + */ +class ManagedInstanceVersion extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The intended template of the instance. This field is empty when current_action is one of { DELETING, ABANDONING }. + * + * Generated from protobuf field optional string instance_template = 309248228; + */ + protected $instance_template = null; + /** + * [Output Only] Name of the version. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_template + * [Output Only] The intended template of the instance. This field is empty when current_action is one of { DELETING, ABANDONING }. + * @type string $name + * [Output Only] Name of the version. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The intended template of the instance. This field is empty when current_action is one of { DELETING, ABANDONING }. + * + * Generated from protobuf field optional string instance_template = 309248228; + * @return string + */ + public function getInstanceTemplate() + { + return isset($this->instance_template) ? $this->instance_template : ''; + } + + public function hasInstanceTemplate() + { + return isset($this->instance_template); + } + + public function clearInstanceTemplate() + { + unset($this->instance_template); + } + + /** + * [Output Only] The intended template of the instance. This field is empty when current_action is one of { DELETING, ABANDONING }. + * + * Generated from protobuf field optional string instance_template = 309248228; + * @param string $var + * @return $this + */ + public function setInstanceTemplate($var) + { + GPBUtil::checkString($var, True); + $this->instance_template = $var; + + return $this; + } + + /** + * [Output Only] Name of the version. + * + * 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); + } + + /** + * [Output Only] Name of the version. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Metadata.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Metadata.php new file mode 100644 index 000000000000..ac74cbd159bc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Metadata.php @@ -0,0 +1,155 @@ +google.cloud.compute.v1.Metadata + */ +class Metadata extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the resource. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * Array of key/value pairs. The total size of all keys and values must be less than 512 KB. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Items items = 100526016; + */ + private $items; + /** + * [Output Only] Type of the resource. Always compute#metadata for metadata. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $fingerprint + * Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the resource. + * @type array<\Google\Cloud\Compute\V1\Items>|\Google\Protobuf\Internal\RepeatedField $items + * Array of key/value pairs. The total size of all keys and values must be less than 512 KB. + * @type string $kind + * [Output Only] Type of the resource. Always compute#metadata for metadata. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the resource. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the resource. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * Array of key/value pairs. The total size of all keys and values must be less than 512 KB. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Items items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * Array of key/value pairs. The total size of all keys and values must be less than 512 KB. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Items items = 100526016; + * @param array<\Google\Cloud\Compute\V1\Items>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Items::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#metadata for metadata. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#metadata for metadata. + * + * 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MetadataFilter.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MetadataFilter.php new file mode 100644 index 000000000000..54b785c8aaee --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MetadataFilter.php @@ -0,0 +1,115 @@ +google.cloud.compute.v1.MetadataFilter + */ +class MetadataFilter extends \Google\Protobuf\Internal\Message +{ + /** + * The list of label value pairs that must match labels in the provided metadata based on filterMatchCriteria This list must not be empty and can have at the most 64 entries. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.MetadataFilterLabelMatch filter_labels = 307903142; + */ + private $filter_labels; + /** + * Specifies how individual filter label matches within the list of filterLabels and contributes toward the overall metadataFilter match. Supported values are: - MATCH_ANY: at least one of the filterLabels must have a matching label in the provided metadata. - MATCH_ALL: all filterLabels must have matching labels in the provided metadata. + * Check the FilterMatchCriteria enum for the list of possible values. + * + * Generated from protobuf field optional string filter_match_criteria = 239970368; + */ + protected $filter_match_criteria = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\MetadataFilterLabelMatch>|\Google\Protobuf\Internal\RepeatedField $filter_labels + * The list of label value pairs that must match labels in the provided metadata based on filterMatchCriteria This list must not be empty and can have at the most 64 entries. + * @type string $filter_match_criteria + * Specifies how individual filter label matches within the list of filterLabels and contributes toward the overall metadataFilter match. Supported values are: - MATCH_ANY: at least one of the filterLabels must have a matching label in the provided metadata. - MATCH_ALL: all filterLabels must have matching labels in the provided metadata. + * Check the FilterMatchCriteria enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The list of label value pairs that must match labels in the provided metadata based on filterMatchCriteria This list must not be empty and can have at the most 64 entries. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.MetadataFilterLabelMatch filter_labels = 307903142; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFilterLabels() + { + return $this->filter_labels; + } + + /** + * The list of label value pairs that must match labels in the provided metadata based on filterMatchCriteria This list must not be empty and can have at the most 64 entries. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.MetadataFilterLabelMatch filter_labels = 307903142; + * @param array<\Google\Cloud\Compute\V1\MetadataFilterLabelMatch>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFilterLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\MetadataFilterLabelMatch::class); + $this->filter_labels = $arr; + + return $this; + } + + /** + * Specifies how individual filter label matches within the list of filterLabels and contributes toward the overall metadataFilter match. Supported values are: - MATCH_ANY: at least one of the filterLabels must have a matching label in the provided metadata. - MATCH_ALL: all filterLabels must have matching labels in the provided metadata. + * Check the FilterMatchCriteria enum for the list of possible values. + * + * Generated from protobuf field optional string filter_match_criteria = 239970368; + * @return string + */ + public function getFilterMatchCriteria() + { + return isset($this->filter_match_criteria) ? $this->filter_match_criteria : ''; + } + + public function hasFilterMatchCriteria() + { + return isset($this->filter_match_criteria); + } + + public function clearFilterMatchCriteria() + { + unset($this->filter_match_criteria); + } + + /** + * Specifies how individual filter label matches within the list of filterLabels and contributes toward the overall metadataFilter match. Supported values are: - MATCH_ANY: at least one of the filterLabels must have a matching label in the provided metadata. - MATCH_ALL: all filterLabels must have matching labels in the provided metadata. + * Check the FilterMatchCriteria enum for the list of possible values. + * + * Generated from protobuf field optional string filter_match_criteria = 239970368; + * @param string $var + * @return $this + */ + public function setFilterMatchCriteria($var) + { + GPBUtil::checkString($var, True); + $this->filter_match_criteria = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MetadataFilter/FilterMatchCriteria.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MetadataFilter/FilterMatchCriteria.php new file mode 100644 index 000000000000..9ceeb3bde4c6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MetadataFilter/FilterMatchCriteria.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.MetadataFilter.FilterMatchCriteria + */ +class FilterMatchCriteria +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_FILTER_MATCH_CRITERIA = 0; + */ + const UNDEFINED_FILTER_MATCH_CRITERIA = 0; + /** + * Specifies that all filterLabels must match for the metadataFilter to be considered a match. + * + * Generated from protobuf enum MATCH_ALL = 180663271; + */ + const MATCH_ALL = 180663271; + /** + * Specifies that any filterLabel must match for the metadataFilter to be considered a match. + * + * Generated from protobuf enum MATCH_ANY = 180663346; + */ + const MATCH_ANY = 180663346; + /** + * Indicates that the match criteria was not set. A metadataFilter must never be created with this value. + * + * Generated from protobuf enum NOT_SET = 163646646; + */ + const NOT_SET = 163646646; + + private static $valueToName = [ + self::UNDEFINED_FILTER_MATCH_CRITERIA => 'UNDEFINED_FILTER_MATCH_CRITERIA', + self::MATCH_ALL => 'MATCH_ALL', + self::MATCH_ANY => 'MATCH_ANY', + self::NOT_SET => 'NOT_SET', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(FilterMatchCriteria::class, \Google\Cloud\Compute\V1\MetadataFilter_FilterMatchCriteria::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MetadataFilterLabelMatch.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MetadataFilterLabelMatch.php new file mode 100644 index 000000000000..2155c11297d9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MetadataFilterLabelMatch.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.MetadataFilterLabelMatch + */ +class MetadataFilterLabelMatch extends \Google\Protobuf\Internal\Message +{ + /** + * Name of metadata label. The name can have a maximum length of 1024 characters and must be at least 1 character long. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * The value of the label must match the specified value. value can have a maximum length of 1024 characters. + * + * Generated from protobuf field optional string value = 111972721; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of metadata label. The name can have a maximum length of 1024 characters and must be at least 1 character long. + * @type string $value + * The value of the label must match the specified value. value can have a maximum length of 1024 characters. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of metadata label. The name can have a maximum length of 1024 characters and must be at least 1 character long. + * + * 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); + } + + /** + * Name of metadata label. The name can have a maximum length of 1024 characters and must be at least 1 character long. + * + * 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; + } + + /** + * The value of the label must match the specified value. value can have a maximum length of 1024 characters. + * + * Generated from protobuf field optional string value = 111972721; + * @return string + */ + public function getValue() + { + return isset($this->value) ? $this->value : ''; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * The value of the label must match the specified value. value can have a maximum length of 1024 characters. + * + * Generated from protobuf field optional string value = 111972721; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MoveAddressRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MoveAddressRequest.php new file mode 100644 index 000000000000..16dfe627fc1a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MoveAddressRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.MoveAddressRequest + */ +class MoveAddressRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the address resource to move. + * + * Generated from protobuf field string address = 462920692 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $address = ''; + /** + * Source project ID which the Address is moved from. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionAddressesMoveRequest region_addresses_move_request_resource = 409081924 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_addresses_move_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Source project ID which the Address is moved from. + * @param string $region Name of the region for this request. + * @param string $address Name of the address resource to move. + * @param \Google\Cloud\Compute\V1\RegionAddressesMoveRequest $regionAddressesMoveRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\MoveAddressRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $address, \Google\Cloud\Compute\V1\RegionAddressesMoveRequest $regionAddressesMoveRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setAddress($address) + ->setRegionAddressesMoveRequestResource($regionAddressesMoveRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $address + * Name of the address resource to move. + * @type string $project + * Source project ID which the Address is moved from. + * @type string $region + * Name of the region for this request. + * @type \Google\Cloud\Compute\V1\RegionAddressesMoveRequest $region_addresses_move_request_resource + * The body resource 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); + } + + /** + * Name of the address resource to move. + * + * Generated from protobuf field string address = 462920692 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAddress() + { + return $this->address; + } + + /** + * Name of the address resource to move. + * + * Generated from protobuf field string address = 462920692 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkString($var, True); + $this->address = $var; + + return $this; + } + + /** + * Source project ID which the Address is moved from. + * + * 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; + } + + /** + * Source project ID which the Address is moved from. + * + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionAddressesMoveRequest region_addresses_move_request_resource = 409081924 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionAddressesMoveRequest|null + */ + public function getRegionAddressesMoveRequestResource() + { + return $this->region_addresses_move_request_resource; + } + + public function hasRegionAddressesMoveRequestResource() + { + return isset($this->region_addresses_move_request_resource); + } + + public function clearRegionAddressesMoveRequestResource() + { + unset($this->region_addresses_move_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionAddressesMoveRequest region_addresses_move_request_resource = 409081924 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionAddressesMoveRequest $var + * @return $this + */ + public function setRegionAddressesMoveRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionAddressesMoveRequest::class); + $this->region_addresses_move_request_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MoveDiskProjectRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MoveDiskProjectRequest.php new file mode 100644 index 000000000000..f39fe4901049 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MoveDiskProjectRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.MoveDiskProjectRequest + */ +class MoveDiskProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.DiskMoveRequest disk_move_request_resource = 313008458 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk_move_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\DiskMoveRequest $diskMoveRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\MoveDiskProjectRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\DiskMoveRequest $diskMoveRequestResource): self + { + return (new self()) + ->setProject($project) + ->setDiskMoveRequestResource($diskMoveRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\DiskMoveRequest $disk_move_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). + * } + */ + 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.DiskMoveRequest disk_move_request_resource = 313008458 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\DiskMoveRequest|null + */ + public function getDiskMoveRequestResource() + { + return $this->disk_move_request_resource; + } + + public function hasDiskMoveRequestResource() + { + return isset($this->disk_move_request_resource); + } + + public function clearDiskMoveRequestResource() + { + unset($this->disk_move_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.DiskMoveRequest disk_move_request_resource = 313008458 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\DiskMoveRequest $var + * @return $this + */ + public function setDiskMoveRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DiskMoveRequest::class); + $this->disk_move_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MoveFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MoveFirewallPolicyRequest.php new file mode 100644 index 000000000000..76912e1d69c0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MoveFirewallPolicyRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.MoveFirewallPolicyRequest + */ +class MoveFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $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"]; + */ + protected $parent_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; + */ + protected $request_id = null; + + /** + * @param string $firewallPolicy Name of the firewall policy to update. + * @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. + * + * @return \Google\Cloud\Compute\V1\MoveFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $firewallPolicy, string $parentId): self + { + return (new self()) + ->setFirewallPolicy($firewallPolicy) + ->setParentId($parentId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to update. + * @type string $parent_id + * 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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * 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 + */ + public function getParentId() + { + return $this->parent_id; + } + + /** + * 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 + * @return $this + */ + public function setParentId($var) + { + GPBUtil::checkString($var, True); + $this->parent_id = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MoveGlobalAddressRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MoveGlobalAddressRequest.php new file mode 100644 index 000000000000..947e4180e9a3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MoveGlobalAddressRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.MoveGlobalAddressRequest + */ +class MoveGlobalAddressRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the address resource to move. + * + * Generated from protobuf field string address = 462920692 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $address = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalAddressesMoveRequest global_addresses_move_request_resource = 302807283 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $global_addresses_move_request_resource = null; + /** + * Source project ID which the Address is moved from. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Source project ID which the Address is moved from. + * @param string $address Name of the address resource to move. + * @param \Google\Cloud\Compute\V1\GlobalAddressesMoveRequest $globalAddressesMoveRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\MoveGlobalAddressRequest + * + * @experimental + */ + public static function build(string $project, string $address, \Google\Cloud\Compute\V1\GlobalAddressesMoveRequest $globalAddressesMoveRequestResource): self + { + return (new self()) + ->setProject($project) + ->setAddress($address) + ->setGlobalAddressesMoveRequestResource($globalAddressesMoveRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $address + * Name of the address resource to move. + * @type \Google\Cloud\Compute\V1\GlobalAddressesMoveRequest $global_addresses_move_request_resource + * The body resource for this request + * @type string $project + * Source project ID which the Address is moved from. + * @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); + } + + /** + * Name of the address resource to move. + * + * Generated from protobuf field string address = 462920692 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAddress() + { + return $this->address; + } + + /** + * Name of the address resource to move. + * + * Generated from protobuf field string address = 462920692 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkString($var, True); + $this->address = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalAddressesMoveRequest global_addresses_move_request_resource = 302807283 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\GlobalAddressesMoveRequest|null + */ + public function getGlobalAddressesMoveRequestResource() + { + return $this->global_addresses_move_request_resource; + } + + public function hasGlobalAddressesMoveRequestResource() + { + return isset($this->global_addresses_move_request_resource); + } + + public function clearGlobalAddressesMoveRequestResource() + { + unset($this->global_addresses_move_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalAddressesMoveRequest global_addresses_move_request_resource = 302807283 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\GlobalAddressesMoveRequest $var + * @return $this + */ + public function setGlobalAddressesMoveRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\GlobalAddressesMoveRequest::class); + $this->global_addresses_move_request_resource = $var; + + return $this; + } + + /** + * Source project ID which the Address is moved from. + * + * 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; + } + + /** + * Source project ID which the Address is moved from. + * + * 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MoveInstanceProjectRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MoveInstanceProjectRequest.php new file mode 100644 index 000000000000..91d6b575be6b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MoveInstanceProjectRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.MoveInstanceProjectRequest + */ +class MoveInstanceProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceMoveRequest instance_move_request_resource = 311664194 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_move_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\InstanceMoveRequest $instanceMoveRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\MoveInstanceProjectRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\InstanceMoveRequest $instanceMoveRequestResource): self + { + return (new self()) + ->setProject($project) + ->setInstanceMoveRequestResource($instanceMoveRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\InstanceMoveRequest $instance_move_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). + * } + */ + 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.InstanceMoveRequest instance_move_request_resource = 311664194 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceMoveRequest|null + */ + public function getInstanceMoveRequestResource() + { + return $this->instance_move_request_resource; + } + + public function hasInstanceMoveRequestResource() + { + return isset($this->instance_move_request_resource); + } + + public function clearInstanceMoveRequestResource() + { + unset($this->instance_move_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceMoveRequest instance_move_request_resource = 311664194 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceMoveRequest $var + * @return $this + */ + public function setInstanceMoveRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceMoveRequest::class); + $this->instance_move_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NamedPort.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NamedPort.php new file mode 100644 index 000000000000..d007030dbc21 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NamedPort.php @@ -0,0 +1,121 @@ +. + * + * Generated from protobuf message google.cloud.compute.v1.NamedPort + */ +class NamedPort extends \Google\Protobuf\Internal\Message +{ + /** + * The name for this named port. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * The port number, which can be a value between 1 and 65535. + * + * Generated from protobuf field optional int32 port = 3446913; + */ + protected $port = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name for this named port. The name must be 1-63 characters long, and comply with RFC1035. + * @type int $port + * The port number, which can be a value between 1 and 65535. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name for this named port. The name must be 1-63 characters long, and comply with RFC1035. + * + * 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 for this named port. The name must be 1-63 characters long, and comply with RFC1035. + * + * 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; + } + + /** + * The port number, which can be a value between 1 and 65535. + * + * Generated from protobuf field optional int32 port = 3446913; + * @return int + */ + public function getPort() + { + return isset($this->port) ? $this->port : 0; + } + + public function hasPort() + { + return isset($this->port); + } + + public function clearPort() + { + unset($this->port); + } + + /** + * The port number, which can be a value between 1 and 65535. + * + * Generated from protobuf field optional int32 port = 3446913; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NatIpInfo.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NatIpInfo.php new file mode 100644 index 000000000000..b49e6deb0e42 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NatIpInfo.php @@ -0,0 +1,111 @@ +google.cloud.compute.v1.NatIpInfo + */ +class NatIpInfo extends \Google\Protobuf\Internal\Message +{ + /** + * A list of all NAT IPs assigned to this NAT config. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NatIpInfoNatIpInfoMapping nat_ip_info_mappings = 241401884; + */ + private $nat_ip_info_mappings; + /** + * Name of the NAT config which the NAT IP belongs to. + * + * Generated from protobuf field optional string nat_name = 425596649; + */ + protected $nat_name = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\NatIpInfoNatIpInfoMapping>|\Google\Protobuf\Internal\RepeatedField $nat_ip_info_mappings + * A list of all NAT IPs assigned to this NAT config. + * @type string $nat_name + * Name of the NAT config which the NAT IP belongs to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of all NAT IPs assigned to this NAT config. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NatIpInfoNatIpInfoMapping nat_ip_info_mappings = 241401884; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNatIpInfoMappings() + { + return $this->nat_ip_info_mappings; + } + + /** + * A list of all NAT IPs assigned to this NAT config. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NatIpInfoNatIpInfoMapping nat_ip_info_mappings = 241401884; + * @param array<\Google\Cloud\Compute\V1\NatIpInfoNatIpInfoMapping>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNatIpInfoMappings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NatIpInfoNatIpInfoMapping::class); + $this->nat_ip_info_mappings = $arr; + + return $this; + } + + /** + * Name of the NAT config which the NAT IP belongs to. + * + * Generated from protobuf field optional string nat_name = 425596649; + * @return string + */ + public function getNatName() + { + return isset($this->nat_name) ? $this->nat_name : ''; + } + + public function hasNatName() + { + return isset($this->nat_name); + } + + public function clearNatName() + { + unset($this->nat_name); + } + + /** + * Name of the NAT config which the NAT IP belongs to. + * + * Generated from protobuf field optional string nat_name = 425596649; + * @param string $var + * @return $this + */ + public function setNatName($var) + { + GPBUtil::checkString($var, True); + $this->nat_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NatIpInfoNatIpInfoMapping.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NatIpInfoNatIpInfoMapping.php new file mode 100644 index 000000000000..e84758fc7d20 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NatIpInfoNatIpInfoMapping.php @@ -0,0 +1,173 @@ +google.cloud.compute.v1.NatIpInfoNatIpInfoMapping + */ +class NatIpInfoNatIpInfoMapping extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies whether NAT IP is auto or manual. + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + */ + protected $mode = null; + /** + * NAT IP address. For example: 203.0.113.11. + * + * Generated from protobuf field optional string nat_ip = 21113093; + */ + protected $nat_ip = null; + /** + * Specifies whether NAT IP is currently serving at least one endpoint or not. + * Check the Usage enum for the list of possible values. + * + * Generated from protobuf field optional string usage = 111574433; + */ + protected $usage = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $mode + * Specifies whether NAT IP is auto or manual. + * Check the Mode enum for the list of possible values. + * @type string $nat_ip + * NAT IP address. For example: 203.0.113.11. + * @type string $usage + * Specifies whether NAT IP is currently serving at least one endpoint or not. + * Check the Usage enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies whether NAT IP is auto or manual. + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + * @return string + */ + public function getMode() + { + return isset($this->mode) ? $this->mode : ''; + } + + public function hasMode() + { + return isset($this->mode); + } + + public function clearMode() + { + unset($this->mode); + } + + /** + * Specifies whether NAT IP is auto or manual. + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + * @param string $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkString($var, True); + $this->mode = $var; + + return $this; + } + + /** + * NAT IP address. For example: 203.0.113.11. + * + * Generated from protobuf field optional string nat_ip = 21113093; + * @return string + */ + public function getNatIp() + { + return isset($this->nat_ip) ? $this->nat_ip : ''; + } + + public function hasNatIp() + { + return isset($this->nat_ip); + } + + public function clearNatIp() + { + unset($this->nat_ip); + } + + /** + * NAT IP address. For example: 203.0.113.11. + * + * Generated from protobuf field optional string nat_ip = 21113093; + * @param string $var + * @return $this + */ + public function setNatIp($var) + { + GPBUtil::checkString($var, True); + $this->nat_ip = $var; + + return $this; + } + + /** + * Specifies whether NAT IP is currently serving at least one endpoint or not. + * Check the Usage enum for the list of possible values. + * + * Generated from protobuf field optional string usage = 111574433; + * @return string + */ + public function getUsage() + { + return isset($this->usage) ? $this->usage : ''; + } + + public function hasUsage() + { + return isset($this->usage); + } + + public function clearUsage() + { + unset($this->usage); + } + + /** + * Specifies whether NAT IP is currently serving at least one endpoint or not. + * Check the Usage enum for the list of possible values. + * + * Generated from protobuf field optional string usage = 111574433; + * @param string $var + * @return $this + */ + public function setUsage($var) + { + GPBUtil::checkString($var, True); + $this->usage = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NatIpInfoNatIpInfoMapping/Mode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NatIpInfoNatIpInfoMapping/Mode.php new file mode 100644 index 000000000000..a609c53927e7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NatIpInfoNatIpInfoMapping/Mode.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.NatIpInfoNatIpInfoMapping.Mode + */ +class Mode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MODE = 0; + */ + const UNDEFINED_MODE = 0; + /** + * Generated from protobuf enum AUTO = 2020783; + */ + const AUTO = 2020783; + /** + * Generated from protobuf enum MANUAL = 119397318; + */ + const MANUAL = 119397318; + + private static $valueToName = [ + self::UNDEFINED_MODE => 'UNDEFINED_MODE', + self::AUTO => 'AUTO', + self::MANUAL => 'MANUAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Mode::class, \Google\Cloud\Compute\V1\NatIpInfoNatIpInfoMapping_Mode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NatIpInfoNatIpInfoMapping/Usage.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NatIpInfoNatIpInfoMapping/Usage.php new file mode 100644 index 000000000000..6dadd5a95190 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NatIpInfoNatIpInfoMapping/Usage.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.NatIpInfoNatIpInfoMapping.Usage + */ +class Usage +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_USAGE = 0; + */ + const UNDEFINED_USAGE = 0; + /** + * Generated from protobuf enum IN_USE = 17393485; + */ + const IN_USE = 17393485; + /** + * Generated from protobuf enum UNUSED = 360643030; + */ + const UNUSED = 360643030; + + private static $valueToName = [ + self::UNDEFINED_USAGE => 'UNDEFINED_USAGE', + self::IN_USE => 'IN_USE', + self::UNUSED => 'UNUSED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Usage::class, \Google\Cloud\Compute\V1\NatIpInfoNatIpInfoMapping_Usage::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NatIpInfoResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NatIpInfoResponse.php new file mode 100644 index 000000000000..c1a834c05801 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NatIpInfoResponse.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.NatIpInfoResponse + */ +class NatIpInfoResponse extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A list of NAT IP information. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NatIpInfo result = 139315229; + */ + private $result; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\NatIpInfo>|\Google\Protobuf\Internal\RepeatedField $result + * [Output Only] A list of NAT IP information. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] A list of NAT IP information. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NatIpInfo result = 139315229; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResult() + { + return $this->result; + } + + /** + * [Output Only] A list of NAT IP information. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NatIpInfo result = 139315229; + * @param array<\Google\Cloud\Compute\V1\NatIpInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResult($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NatIpInfo::class); + $this->result = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Network.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Network.php new file mode 100644 index 000000000000..19c082d3414b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Network.php @@ -0,0 +1,809 @@ +google.cloud.compute.v1.Network + */ +class Network extends \Google\Protobuf\Internal\Message +{ + /** + * Deprecated in favor of subnet mode networks. The range of internal addresses that are legal on this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by the client when the network is created. + * + * Generated from protobuf field optional string I_pv4_range = 59234358; + */ + protected $I_pv4_range = null; + /** + * Must be set to create a VPC network. If not set, a legacy network is created. When set to true, the VPC network is created in auto mode. When set to false, the VPC network is created in custom mode. An auto mode VPC network starts with one subnet per region. Each subnet has a predetermined range as described in Auto mode VPC network IP ranges. For custom mode VPC networks, you can add subnets using the subnetworks insert method. + * + * Generated from protobuf field optional bool auto_create_subnetworks = 256156690; + */ + protected $auto_create_subnetworks = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this field when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Enable ULA internal ipv6 on this network. Enabling this feature will assign a /48 from google defined ULA prefix fd20::/20. . + * + * Generated from protobuf field optional bool enable_ula_internal_ipv6 = 423757720; + */ + protected $enable_ula_internal_ipv6 = null; + /** + * [Output Only] URL of the firewall policy the network is associated with. + * + * Generated from protobuf field optional string firewall_policy = 498173265; + */ + protected $firewall_policy = null; + /** + * [Output Only] The gateway address for default routing out of the network, selected by Google Cloud. + * + * Generated from protobuf field optional string gateway_i_pv4 = 178678877; + */ + protected $gateway_i_pv4 = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * When enabling ula internal ipv6, caller optionally can specify the /48 range they want from the google defined ULA prefix fd20::/20. The input must be a valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will fail if the speficied /48 is already in used by another resource. If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field. . + * + * Generated from protobuf field optional string internal_ipv6_range = 277456807; + */ + protected $internal_ipv6_range = null; + /** + * [Output Only] Type of the resource. Always compute#network for networks. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * Maximum Transmission Unit in bytes. The minimum value for this field is 1300 and the maximum value is 8896. The suggested value is 1500, which is the default MTU used on the Internet, or 8896 if you want to use Jumbo frames. If unspecified, the value defaults to 1460. + * + * Generated from protobuf field optional int32 mtu = 108462; + */ + protected $mtu = null; + /** + * 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])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * The network firewall policy enforcement order. Can be either AFTER_CLASSIC_FIREWALL or BEFORE_CLASSIC_FIREWALL. Defaults to AFTER_CLASSIC_FIREWALL if the field is not specified. + * Check the NetworkFirewallPolicyEnforcementOrder enum for the list of possible values. + * + * Generated from protobuf field optional string network_firewall_policy_enforcement_order = 6504784; + */ + protected $network_firewall_policy_enforcement_order = null; + /** + * [Output Only] A list of network peerings for the resource. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkPeering peerings = 69883187; + */ + private $peerings; + /** + * The network-level routing configuration for this network. Used by Cloud Router to determine what type of network-wide routing behavior to enforce. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkRoutingConfig routing_config = 523556059; + */ + protected $routing_config = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Server-defined URL for this resource with the resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + */ + protected $self_link_with_id = null; + /** + * [Output Only] Server-defined fully-qualified URLs for all subnetworks in this VPC network. + * + * Generated from protobuf field repeated string subnetworks = 415853125; + */ + private $subnetworks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $I_pv4_range + * Deprecated in favor of subnet mode networks. The range of internal addresses that are legal on this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by the client when the network is created. + * @type bool $auto_create_subnetworks + * Must be set to create a VPC network. If not set, a legacy network is created. When set to true, the VPC network is created in auto mode. When set to false, the VPC network is created in custom mode. An auto mode VPC network starts with one subnet per region. Each subnet has a predetermined range as described in Auto mode VPC network IP ranges. For custom mode VPC networks, you can add subnets using the subnetworks insert method. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this field when you create the resource. + * @type bool $enable_ula_internal_ipv6 + * Enable ULA internal ipv6 on this network. Enabling this feature will assign a /48 from google defined ULA prefix fd20::/20. . + * @type string $firewall_policy + * [Output Only] URL of the firewall policy the network is associated with. + * @type string $gateway_i_pv4 + * [Output Only] The gateway address for default routing out of the network, selected by Google Cloud. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $internal_ipv6_range + * When enabling ula internal ipv6, caller optionally can specify the /48 range they want from the google defined ULA prefix fd20::/20. The input must be a valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will fail if the speficied /48 is already in used by another resource. If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field. . + * @type string $kind + * [Output Only] Type of the resource. Always compute#network for networks. + * @type int $mtu + * Maximum Transmission Unit in bytes. The minimum value for this field is 1300 and the maximum value is 8896. The suggested value is 1500, which is the default MTU used on the Internet, or 8896 if you want to use Jumbo frames. If unspecified, the value defaults to 1460. + * @type string $name + * 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])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. + * @type string $network_firewall_policy_enforcement_order + * The network firewall policy enforcement order. Can be either AFTER_CLASSIC_FIREWALL or BEFORE_CLASSIC_FIREWALL. Defaults to AFTER_CLASSIC_FIREWALL if the field is not specified. + * Check the NetworkFirewallPolicyEnforcementOrder enum for the list of possible values. + * @type array<\Google\Cloud\Compute\V1\NetworkPeering>|\Google\Protobuf\Internal\RepeatedField $peerings + * [Output Only] A list of network peerings for the resource. + * @type \Google\Cloud\Compute\V1\NetworkRoutingConfig $routing_config + * The network-level routing configuration for this network. Used by Cloud Router to determine what type of network-wide routing behavior to enforce. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $self_link_with_id + * [Output Only] Server-defined URL for this resource with the resource id. + * @type array|\Google\Protobuf\Internal\RepeatedField $subnetworks + * [Output Only] Server-defined fully-qualified URLs for all subnetworks in this VPC network. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Deprecated in favor of subnet mode networks. The range of internal addresses that are legal on this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by the client when the network is created. + * + * Generated from protobuf field optional string I_pv4_range = 59234358; + * @return string + */ + public function getIPv4Range() + { + return isset($this->I_pv4_range) ? $this->I_pv4_range : ''; + } + + public function hasIPv4Range() + { + return isset($this->I_pv4_range); + } + + public function clearIPv4Range() + { + unset($this->I_pv4_range); + } + + /** + * Deprecated in favor of subnet mode networks. The range of internal addresses that are legal on this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by the client when the network is created. + * + * Generated from protobuf field optional string I_pv4_range = 59234358; + * @param string $var + * @return $this + */ + public function setIPv4Range($var) + { + GPBUtil::checkString($var, True); + $this->I_pv4_range = $var; + + return $this; + } + + /** + * Must be set to create a VPC network. If not set, a legacy network is created. When set to true, the VPC network is created in auto mode. When set to false, the VPC network is created in custom mode. An auto mode VPC network starts with one subnet per region. Each subnet has a predetermined range as described in Auto mode VPC network IP ranges. For custom mode VPC networks, you can add subnets using the subnetworks insert method. + * + * Generated from protobuf field optional bool auto_create_subnetworks = 256156690; + * @return bool + */ + public function getAutoCreateSubnetworks() + { + return isset($this->auto_create_subnetworks) ? $this->auto_create_subnetworks : false; + } + + public function hasAutoCreateSubnetworks() + { + return isset($this->auto_create_subnetworks); + } + + public function clearAutoCreateSubnetworks() + { + unset($this->auto_create_subnetworks); + } + + /** + * Must be set to create a VPC network. If not set, a legacy network is created. When set to true, the VPC network is created in auto mode. When set to false, the VPC network is created in custom mode. An auto mode VPC network starts with one subnet per region. Each subnet has a predetermined range as described in Auto mode VPC network IP ranges. For custom mode VPC networks, you can add subnets using the subnetworks insert method. + * + * Generated from protobuf field optional bool auto_create_subnetworks = 256156690; + * @param bool $var + * @return $this + */ + public function setAutoCreateSubnetworks($var) + { + GPBUtil::checkBool($var); + $this->auto_create_subnetworks = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this field when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this field when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Enable ULA internal ipv6 on this network. Enabling this feature will assign a /48 from google defined ULA prefix fd20::/20. . + * + * Generated from protobuf field optional bool enable_ula_internal_ipv6 = 423757720; + * @return bool + */ + public function getEnableUlaInternalIpv6() + { + return isset($this->enable_ula_internal_ipv6) ? $this->enable_ula_internal_ipv6 : false; + } + + public function hasEnableUlaInternalIpv6() + { + return isset($this->enable_ula_internal_ipv6); + } + + public function clearEnableUlaInternalIpv6() + { + unset($this->enable_ula_internal_ipv6); + } + + /** + * Enable ULA internal ipv6 on this network. Enabling this feature will assign a /48 from google defined ULA prefix fd20::/20. . + * + * Generated from protobuf field optional bool enable_ula_internal_ipv6 = 423757720; + * @param bool $var + * @return $this + */ + public function setEnableUlaInternalIpv6($var) + { + GPBUtil::checkBool($var); + $this->enable_ula_internal_ipv6 = $var; + + return $this; + } + + /** + * [Output Only] URL of the firewall policy the network is associated with. + * + * Generated from protobuf field optional string firewall_policy = 498173265; + * @return string + */ + public function getFirewallPolicy() + { + return isset($this->firewall_policy) ? $this->firewall_policy : ''; + } + + public function hasFirewallPolicy() + { + return isset($this->firewall_policy); + } + + public function clearFirewallPolicy() + { + unset($this->firewall_policy); + } + + /** + * [Output Only] URL of the firewall policy the network is associated with. + * + * Generated from protobuf field optional string firewall_policy = 498173265; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * [Output Only] The gateway address for default routing out of the network, selected by Google Cloud. + * + * Generated from protobuf field optional string gateway_i_pv4 = 178678877; + * @return string + */ + public function getGatewayIPv4() + { + return isset($this->gateway_i_pv4) ? $this->gateway_i_pv4 : ''; + } + + public function hasGatewayIPv4() + { + return isset($this->gateway_i_pv4); + } + + public function clearGatewayIPv4() + { + unset($this->gateway_i_pv4); + } + + /** + * [Output Only] The gateway address for default routing out of the network, selected by Google Cloud. + * + * Generated from protobuf field optional string gateway_i_pv4 = 178678877; + * @param string $var + * @return $this + */ + public function setGatewayIPv4($var) + { + GPBUtil::checkString($var, True); + $this->gateway_i_pv4 = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * When enabling ula internal ipv6, caller optionally can specify the /48 range they want from the google defined ULA prefix fd20::/20. The input must be a valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will fail if the speficied /48 is already in used by another resource. If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field. . + * + * Generated from protobuf field optional string internal_ipv6_range = 277456807; + * @return string + */ + public function getInternalIpv6Range() + { + return isset($this->internal_ipv6_range) ? $this->internal_ipv6_range : ''; + } + + public function hasInternalIpv6Range() + { + return isset($this->internal_ipv6_range); + } + + public function clearInternalIpv6Range() + { + unset($this->internal_ipv6_range); + } + + /** + * When enabling ula internal ipv6, caller optionally can specify the /48 range they want from the google defined ULA prefix fd20::/20. The input must be a valid /48 ULA IPv6 address and must be within the fd20::/20. Operation will fail if the speficied /48 is already in used by another resource. If the field is not speficied, then a /48 range will be randomly allocated from fd20::/20 and returned via this field. . + * + * Generated from protobuf field optional string internal_ipv6_range = 277456807; + * @param string $var + * @return $this + */ + public function setInternalIpv6Range($var) + { + GPBUtil::checkString($var, True); + $this->internal_ipv6_range = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#network for networks. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#network for networks. + * + * 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; + } + + /** + * Maximum Transmission Unit in bytes. The minimum value for this field is 1300 and the maximum value is 8896. The suggested value is 1500, which is the default MTU used on the Internet, or 8896 if you want to use Jumbo frames. If unspecified, the value defaults to 1460. + * + * Generated from protobuf field optional int32 mtu = 108462; + * @return int + */ + public function getMtu() + { + return isset($this->mtu) ? $this->mtu : 0; + } + + public function hasMtu() + { + return isset($this->mtu); + } + + public function clearMtu() + { + unset($this->mtu); + } + + /** + * Maximum Transmission Unit in bytes. The minimum value for this field is 1300 and the maximum value is 8896. The suggested value is 1500, which is the default MTU used on the Internet, or 8896 if you want to use Jumbo frames. If unspecified, the value defaults to 1460. + * + * Generated from protobuf field optional int32 mtu = 108462; + * @param int $var + * @return $this + */ + public function setMtu($var) + { + GPBUtil::checkInt32($var); + $this->mtu = $var; + + return $this; + } + + /** + * 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])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. + * + * 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); + } + + /** + * 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])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. + * + * 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; + } + + /** + * The network firewall policy enforcement order. Can be either AFTER_CLASSIC_FIREWALL or BEFORE_CLASSIC_FIREWALL. Defaults to AFTER_CLASSIC_FIREWALL if the field is not specified. + * Check the NetworkFirewallPolicyEnforcementOrder enum for the list of possible values. + * + * Generated from protobuf field optional string network_firewall_policy_enforcement_order = 6504784; + * @return string + */ + public function getNetworkFirewallPolicyEnforcementOrder() + { + return isset($this->network_firewall_policy_enforcement_order) ? $this->network_firewall_policy_enforcement_order : ''; + } + + public function hasNetworkFirewallPolicyEnforcementOrder() + { + return isset($this->network_firewall_policy_enforcement_order); + } + + public function clearNetworkFirewallPolicyEnforcementOrder() + { + unset($this->network_firewall_policy_enforcement_order); + } + + /** + * The network firewall policy enforcement order. Can be either AFTER_CLASSIC_FIREWALL or BEFORE_CLASSIC_FIREWALL. Defaults to AFTER_CLASSIC_FIREWALL if the field is not specified. + * Check the NetworkFirewallPolicyEnforcementOrder enum for the list of possible values. + * + * Generated from protobuf field optional string network_firewall_policy_enforcement_order = 6504784; + * @param string $var + * @return $this + */ + public function setNetworkFirewallPolicyEnforcementOrder($var) + { + GPBUtil::checkString($var, True); + $this->network_firewall_policy_enforcement_order = $var; + + return $this; + } + + /** + * [Output Only] A list of network peerings for the resource. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkPeering peerings = 69883187; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPeerings() + { + return $this->peerings; + } + + /** + * [Output Only] A list of network peerings for the resource. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkPeering peerings = 69883187; + * @param array<\Google\Cloud\Compute\V1\NetworkPeering>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPeerings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NetworkPeering::class); + $this->peerings = $arr; + + return $this; + } + + /** + * The network-level routing configuration for this network. Used by Cloud Router to determine what type of network-wide routing behavior to enforce. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkRoutingConfig routing_config = 523556059; + * @return \Google\Cloud\Compute\V1\NetworkRoutingConfig|null + */ + public function getRoutingConfig() + { + return $this->routing_config; + } + + public function hasRoutingConfig() + { + return isset($this->routing_config); + } + + public function clearRoutingConfig() + { + unset($this->routing_config); + } + + /** + * The network-level routing configuration for this network. Used by Cloud Router to determine what type of network-wide routing behavior to enforce. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkRoutingConfig routing_config = 523556059; + * @param \Google\Cloud\Compute\V1\NetworkRoutingConfig $var + * @return $this + */ + public function setRoutingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkRoutingConfig::class); + $this->routing_config = $var; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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] Server-defined URL for this resource with the resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + * @return string + */ + public function getSelfLinkWithId() + { + return isset($this->self_link_with_id) ? $this->self_link_with_id : ''; + } + + public function hasSelfLinkWithId() + { + return isset($this->self_link_with_id); + } + + public function clearSelfLinkWithId() + { + unset($this->self_link_with_id); + } + + /** + * [Output Only] Server-defined URL for this resource with the resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + * @param string $var + * @return $this + */ + public function setSelfLinkWithId($var) + { + GPBUtil::checkString($var, True); + $this->self_link_with_id = $var; + + return $this; + } + + /** + * [Output Only] Server-defined fully-qualified URLs for all subnetworks in this VPC network. + * + * Generated from protobuf field repeated string subnetworks = 415853125; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSubnetworks() + { + return $this->subnetworks; + } + + /** + * [Output Only] Server-defined fully-qualified URLs for all subnetworks in this VPC network. + * + * Generated from protobuf field repeated string subnetworks = 415853125; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSubnetworks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->subnetworks = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Network/NetworkFirewallPolicyEnforcementOrder.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Network/NetworkFirewallPolicyEnforcementOrder.php new file mode 100644 index 000000000000..8c3dc560d1c5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Network/NetworkFirewallPolicyEnforcementOrder.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.Network.NetworkFirewallPolicyEnforcementOrder + */ +class NetworkFirewallPolicyEnforcementOrder +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_NETWORK_FIREWALL_POLICY_ENFORCEMENT_ORDER = 0; + */ + const UNDEFINED_NETWORK_FIREWALL_POLICY_ENFORCEMENT_ORDER = 0; + /** + * Generated from protobuf enum AFTER_CLASSIC_FIREWALL = 154582608; + */ + const AFTER_CLASSIC_FIREWALL = 154582608; + /** + * Generated from protobuf enum BEFORE_CLASSIC_FIREWALL = 338458349; + */ + const BEFORE_CLASSIC_FIREWALL = 338458349; + + private static $valueToName = [ + self::UNDEFINED_NETWORK_FIREWALL_POLICY_ENFORCEMENT_ORDER => 'UNDEFINED_NETWORK_FIREWALL_POLICY_ENFORCEMENT_ORDER', + self::AFTER_CLASSIC_FIREWALL => 'AFTER_CLASSIC_FIREWALL', + self::BEFORE_CLASSIC_FIREWALL => 'BEFORE_CLASSIC_FIREWALL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NetworkFirewallPolicyEnforcementOrder::class, \Google\Cloud\Compute\V1\Network_NetworkFirewallPolicyEnforcementOrder::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachment.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachment.php new file mode 100644 index 000000000000..67a1016c2573 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachment.php @@ -0,0 +1,657 @@ +google.cloud.compute.v1.NetworkAttachment + */ +class NetworkAttachment extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] An array of connections for all the producers connected to this network attachment. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkAttachmentConnectedEndpoint connection_endpoints = 326078813; + */ + private $connection_endpoints; + /** + * + * Check the ConnectionPreference enum for the list of possible values. + * + * Generated from protobuf field optional string connection_preference = 285818076; + */ + protected $connection_preference = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. An up-to-date fingerprint must be provided in order to patch. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * [Output Only] The unique identifier for the resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] The URL of the network which the Network Attachment belongs to. Practically it is inferred by fetching the network of the first subnetwork associated. Because it is required that all the subnetworks must be from the same network, it is assured that the Network Attachment belongs to the same network as all the subnetworks. + * + * Generated from protobuf field optional string network = 232872494; + */ + protected $network = null; + /** + * Projects that are allowed to connect to this network attachment. The project can be specified using its id or number. + * + * Generated from protobuf field repeated string producer_accept_lists = 202804523; + */ + private $producer_accept_lists; + /** + * Projects that are not allowed to connect to this network attachment. The project can be specified using its id or number. + * + * Generated from protobuf field repeated string producer_reject_lists = 4112002; + */ + private $producer_reject_lists; + /** + * [Output Only] URL of the region where the network attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Server-defined URL for this resource's resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + */ + protected $self_link_with_id = null; + /** + * An array of URLs where each entry is the URL of a subnet provided by the service consumer to use for endpoints in the producers that connect to this network attachment. + * + * Generated from protobuf field repeated string subnetworks = 415853125; + */ + private $subnetworks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\NetworkAttachmentConnectedEndpoint>|\Google\Protobuf\Internal\RepeatedField $connection_endpoints + * [Output Only] An array of connections for all the producers connected to this network attachment. + * @type string $connection_preference + * + * Check the ConnectionPreference enum for the list of possible values. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type string $fingerprint + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. An up-to-date fingerprint must be provided in order to patch. + * @type int|string $id + * [Output Only] The unique identifier for the resource type. The server generates this identifier. + * @type string $kind + * [Output Only] Type of the resource. + * @type string $name + * 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 string $network + * [Output Only] The URL of the network which the Network Attachment belongs to. Practically it is inferred by fetching the network of the first subnetwork associated. Because it is required that all the subnetworks must be from the same network, it is assured that the Network Attachment belongs to the same network as all the subnetworks. + * @type array|\Google\Protobuf\Internal\RepeatedField $producer_accept_lists + * Projects that are allowed to connect to this network attachment. The project can be specified using its id or number. + * @type array|\Google\Protobuf\Internal\RepeatedField $producer_reject_lists + * Projects that are not allowed to connect to this network attachment. The project can be specified using its id or number. + * @type string $region + * [Output Only] URL of the region where the network attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $self_link_with_id + * [Output Only] Server-defined URL for this resource's resource id. + * @type array|\Google\Protobuf\Internal\RepeatedField $subnetworks + * An array of URLs where each entry is the URL of a subnet provided by the service consumer to use for endpoints in the producers that connect to this network attachment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] An array of connections for all the producers connected to this network attachment. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkAttachmentConnectedEndpoint connection_endpoints = 326078813; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConnectionEndpoints() + { + return $this->connection_endpoints; + } + + /** + * [Output Only] An array of connections for all the producers connected to this network attachment. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkAttachmentConnectedEndpoint connection_endpoints = 326078813; + * @param array<\Google\Cloud\Compute\V1\NetworkAttachmentConnectedEndpoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConnectionEndpoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NetworkAttachmentConnectedEndpoint::class); + $this->connection_endpoints = $arr; + + return $this; + } + + /** + * + * Check the ConnectionPreference enum for the list of possible values. + * + * Generated from protobuf field optional string connection_preference = 285818076; + * @return string + */ + public function getConnectionPreference() + { + return isset($this->connection_preference) ? $this->connection_preference : ''; + } + + public function hasConnectionPreference() + { + return isset($this->connection_preference); + } + + public function clearConnectionPreference() + { + unset($this->connection_preference); + } + + /** + * + * Check the ConnectionPreference enum for the list of possible values. + * + * Generated from protobuf field optional string connection_preference = 285818076; + * @param string $var + * @return $this + */ + public function setConnectionPreference($var) + { + GPBUtil::checkString($var, True); + $this->connection_preference = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. An up-to-date fingerprint must be provided in order to patch. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. An up-to-date fingerprint must be provided in order to patch. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the 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); + } + + /** + * [Output Only] Type of the 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; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * [Output Only] The URL of the network which the Network Attachment belongs to. Practically it is inferred by fetching the network of the first subnetwork associated. Because it is required that all the subnetworks must be from the same network, it is assured that the Network Attachment belongs to the same network as all the subnetworks. + * + * Generated from protobuf field optional string network = 232872494; + * @return string + */ + public function getNetwork() + { + return isset($this->network) ? $this->network : ''; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * [Output Only] The URL of the network which the Network Attachment belongs to. Practically it is inferred by fetching the network of the first subnetwork associated. Because it is required that all the subnetworks must be from the same network, it is assured that the Network Attachment belongs to the same network as all the subnetworks. + * + * Generated from protobuf field optional string network = 232872494; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Projects that are allowed to connect to this network attachment. The project can be specified using its id or number. + * + * Generated from protobuf field repeated string producer_accept_lists = 202804523; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProducerAcceptLists() + { + return $this->producer_accept_lists; + } + + /** + * Projects that are allowed to connect to this network attachment. The project can be specified using its id or number. + * + * Generated from protobuf field repeated string producer_accept_lists = 202804523; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProducerAcceptLists($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->producer_accept_lists = $arr; + + return $this; + } + + /** + * Projects that are not allowed to connect to this network attachment. The project can be specified using its id or number. + * + * Generated from protobuf field repeated string producer_reject_lists = 4112002; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProducerRejectLists() + { + return $this->producer_reject_lists; + } + + /** + * Projects that are not allowed to connect to this network attachment. The project can be specified using its id or number. + * + * Generated from protobuf field repeated string producer_reject_lists = 4112002; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProducerRejectLists($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->producer_reject_lists = $arr; + + return $this; + } + + /** + * [Output Only] URL of the region where the network attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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 network attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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] Server-defined URL for the 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 the 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] Server-defined URL for this resource's resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + * @return string + */ + public function getSelfLinkWithId() + { + return isset($this->self_link_with_id) ? $this->self_link_with_id : ''; + } + + public function hasSelfLinkWithId() + { + return isset($this->self_link_with_id); + } + + public function clearSelfLinkWithId() + { + unset($this->self_link_with_id); + } + + /** + * [Output Only] Server-defined URL for this resource's resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + * @param string $var + * @return $this + */ + public function setSelfLinkWithId($var) + { + GPBUtil::checkString($var, True); + $this->self_link_with_id = $var; + + return $this; + } + + /** + * An array of URLs where each entry is the URL of a subnet provided by the service consumer to use for endpoints in the producers that connect to this network attachment. + * + * Generated from protobuf field repeated string subnetworks = 415853125; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSubnetworks() + { + return $this->subnetworks; + } + + /** + * An array of URLs where each entry is the URL of a subnet provided by the service consumer to use for endpoints in the producers that connect to this network attachment. + * + * Generated from protobuf field repeated string subnetworks = 415853125; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSubnetworks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->subnetworks = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachment/ConnectionPreference.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachment/ConnectionPreference.php new file mode 100644 index 000000000000..c12fbf4d70f9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachment/ConnectionPreference.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.NetworkAttachment.ConnectionPreference + */ +class ConnectionPreference +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_CONNECTION_PREFERENCE = 0; + */ + const UNDEFINED_CONNECTION_PREFERENCE = 0; + /** + * Generated from protobuf enum ACCEPT_AUTOMATIC = 75250580; + */ + const ACCEPT_AUTOMATIC = 75250580; + /** + * Generated from protobuf enum ACCEPT_MANUAL = 373061341; + */ + const ACCEPT_MANUAL = 373061341; + /** + * Generated from protobuf enum INVALID = 530283991; + */ + const INVALID = 530283991; + + private static $valueToName = [ + self::UNDEFINED_CONNECTION_PREFERENCE => 'UNDEFINED_CONNECTION_PREFERENCE', + self::ACCEPT_AUTOMATIC => 'ACCEPT_AUTOMATIC', + self::ACCEPT_MANUAL => 'ACCEPT_MANUAL', + self::INVALID => 'INVALID', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConnectionPreference::class, \Google\Cloud\Compute\V1\NetworkAttachment_ConnectionPreference::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachmentAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachmentAggregatedList.php new file mode 100644 index 000000000000..8ccccad00faa --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachmentAggregatedList.php @@ -0,0 +1,280 @@ +google.cloud.compute.v1.NetworkAttachmentAggregatedList + */ +class NetworkAttachmentAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of NetworkAttachmentsScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 NetworkAttachmentsScopedList resources. + * @type string $kind + * @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 NetworkAttachmentsScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of NetworkAttachmentsScopedList 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\NetworkAttachmentsScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * 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); + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachmentConnectedEndpoint.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachmentConnectedEndpoint.php new file mode 100644 index 000000000000..cb4a8dd6ae3b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachmentConnectedEndpoint.php @@ -0,0 +1,335 @@ +google.cloud.compute.v1.NetworkAttachmentConnectedEndpoint + */ +class NetworkAttachmentConnectedEndpoint extends \Google\Protobuf\Internal\Message +{ + /** + * The IPv4 address assigned to the producer instance network interface. This value will be a range in case of Serverless. + * + * Generated from protobuf field optional string ip_address = 406272220; + */ + protected $ip_address = null; + /** + * The IPv6 address assigned to the producer instance network interface. This is only assigned when the stack types of both the instance network interface and the consumer subnet are IPv4_IPv6. + * + * Generated from protobuf field optional string ipv6_address = 341563804; + */ + protected $ipv6_address = null; + /** + * The project id or number of the interface to which the IP was assigned. + * + * Generated from protobuf field optional string project_id_or_num = 349783336; + */ + protected $project_id_or_num = null; + /** + * Alias IP ranges from the same subnetwork. + * + * Generated from protobuf field repeated string secondary_ip_cidr_ranges = 117184788; + */ + private $secondary_ip_cidr_ranges; + /** + * The status of a connected endpoint to this network attachment. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + /** + * The subnetwork used to assign the IP to the producer instance network interface. + * + * Generated from protobuf field optional string subnetwork = 307827694; + */ + protected $subnetwork = null; + /** + * [Output Only] The CIDR range of the subnet from which the IPv4 internal IP was allocated from. + * + * Generated from protobuf field optional string subnetwork_cidr_range = 383249827; + */ + protected $subnetwork_cidr_range = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ip_address + * The IPv4 address assigned to the producer instance network interface. This value will be a range in case of Serverless. + * @type string $ipv6_address + * The IPv6 address assigned to the producer instance network interface. This is only assigned when the stack types of both the instance network interface and the consumer subnet are IPv4_IPv6. + * @type string $project_id_or_num + * The project id or number of the interface to which the IP was assigned. + * @type array|\Google\Protobuf\Internal\RepeatedField $secondary_ip_cidr_ranges + * Alias IP ranges from the same subnetwork. + * @type string $status + * The status of a connected endpoint to this network attachment. + * Check the Status enum for the list of possible values. + * @type string $subnetwork + * The subnetwork used to assign the IP to the producer instance network interface. + * @type string $subnetwork_cidr_range + * [Output Only] The CIDR range of the subnet from which the IPv4 internal IP was allocated from. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The IPv4 address assigned to the producer instance network interface. This value will be a range in case of Serverless. + * + * Generated from protobuf field optional string ip_address = 406272220; + * @return string + */ + public function getIpAddress() + { + return isset($this->ip_address) ? $this->ip_address : ''; + } + + public function hasIpAddress() + { + return isset($this->ip_address); + } + + public function clearIpAddress() + { + unset($this->ip_address); + } + + /** + * The IPv4 address assigned to the producer instance network interface. This value will be a range in case of Serverless. + * + * Generated from protobuf field optional string ip_address = 406272220; + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + + /** + * The IPv6 address assigned to the producer instance network interface. This is only assigned when the stack types of both the instance network interface and the consumer subnet are IPv4_IPv6. + * + * Generated from protobuf field optional string ipv6_address = 341563804; + * @return string + */ + public function getIpv6Address() + { + return isset($this->ipv6_address) ? $this->ipv6_address : ''; + } + + public function hasIpv6Address() + { + return isset($this->ipv6_address); + } + + public function clearIpv6Address() + { + unset($this->ipv6_address); + } + + /** + * The IPv6 address assigned to the producer instance network interface. This is only assigned when the stack types of both the instance network interface and the consumer subnet are IPv4_IPv6. + * + * Generated from protobuf field optional string ipv6_address = 341563804; + * @param string $var + * @return $this + */ + public function setIpv6Address($var) + { + GPBUtil::checkString($var, True); + $this->ipv6_address = $var; + + return $this; + } + + /** + * The project id or number of the interface to which the IP was assigned. + * + * Generated from protobuf field optional string project_id_or_num = 349783336; + * @return string + */ + public function getProjectIdOrNum() + { + return isset($this->project_id_or_num) ? $this->project_id_or_num : ''; + } + + public function hasProjectIdOrNum() + { + return isset($this->project_id_or_num); + } + + public function clearProjectIdOrNum() + { + unset($this->project_id_or_num); + } + + /** + * The project id or number of the interface to which the IP was assigned. + * + * Generated from protobuf field optional string project_id_or_num = 349783336; + * @param string $var + * @return $this + */ + public function setProjectIdOrNum($var) + { + GPBUtil::checkString($var, True); + $this->project_id_or_num = $var; + + return $this; + } + + /** + * Alias IP ranges from the same subnetwork. + * + * Generated from protobuf field repeated string secondary_ip_cidr_ranges = 117184788; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSecondaryIpCidrRanges() + { + return $this->secondary_ip_cidr_ranges; + } + + /** + * Alias IP ranges from the same subnetwork. + * + * Generated from protobuf field repeated string secondary_ip_cidr_ranges = 117184788; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSecondaryIpCidrRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->secondary_ip_cidr_ranges = $arr; + + return $this; + } + + /** + * The status of a connected endpoint to this network attachment. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * The status of a connected endpoint to this network attachment. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + + /** + * The subnetwork used to assign the IP to the producer instance network interface. + * + * Generated from protobuf field optional string subnetwork = 307827694; + * @return string + */ + public function getSubnetwork() + { + return isset($this->subnetwork) ? $this->subnetwork : ''; + } + + public function hasSubnetwork() + { + return isset($this->subnetwork); + } + + public function clearSubnetwork() + { + unset($this->subnetwork); + } + + /** + * The subnetwork used to assign the IP to the producer instance network interface. + * + * Generated from protobuf field optional string subnetwork = 307827694; + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork = $var; + + return $this; + } + + /** + * [Output Only] The CIDR range of the subnet from which the IPv4 internal IP was allocated from. + * + * Generated from protobuf field optional string subnetwork_cidr_range = 383249827; + * @return string + */ + public function getSubnetworkCidrRange() + { + return isset($this->subnetwork_cidr_range) ? $this->subnetwork_cidr_range : ''; + } + + public function hasSubnetworkCidrRange() + { + return isset($this->subnetwork_cidr_range); + } + + public function clearSubnetworkCidrRange() + { + unset($this->subnetwork_cidr_range); + } + + /** + * [Output Only] The CIDR range of the subnet from which the IPv4 internal IP was allocated from. + * + * Generated from protobuf field optional string subnetwork_cidr_range = 383249827; + * @param string $var + * @return $this + */ + public function setSubnetworkCidrRange($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork_cidr_range = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachmentConnectedEndpoint/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachmentConnectedEndpoint/Status.php new file mode 100644 index 000000000000..7dcefac92a3b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachmentConnectedEndpoint/Status.php @@ -0,0 +1,90 @@ +google.cloud.compute.v1.NetworkAttachmentConnectedEndpoint.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * The consumer allows traffic from the producer to reach its VPC. + * + * Generated from protobuf enum ACCEPTED = 246714279; + */ + const ACCEPTED = 246714279; + /** + * The consumer network attachment no longer exists. + * + * Generated from protobuf enum CLOSED = 380163436; + */ + const CLOSED = 380163436; + /** + * The consumer needs to take further action before traffic can be served. + * + * Generated from protobuf enum NEEDS_ATTENTION = 344491452; + */ + const NEEDS_ATTENTION = 344491452; + /** + * The consumer neither allows nor prohibits traffic from the producer to reach its VPC. + * + * Generated from protobuf enum PENDING = 35394935; + */ + const PENDING = 35394935; + /** + * The consumer prohibits traffic from the producer to reach its VPC. + * + * Generated from protobuf enum REJECTED = 174130302; + */ + const REJECTED = 174130302; + /** + * Generated from protobuf enum STATUS_UNSPECIFIED = 42133066; + */ + const STATUS_UNSPECIFIED = 42133066; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::ACCEPTED => 'ACCEPTED', + self::CLOSED => 'CLOSED', + self::NEEDS_ATTENTION => 'NEEDS_ATTENTION', + self::PENDING => 'PENDING', + self::REJECTED => 'REJECTED', + self::STATUS_UNSPECIFIED => 'STATUS_UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\NetworkAttachmentConnectedEndpoint_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachmentList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachmentList.php new file mode 100644 index 000000000000..be0f96ce8ea1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachmentList.php @@ -0,0 +1,279 @@ +google.cloud.compute.v1.NetworkAttachmentList + */ +class NetworkAttachmentList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of NetworkAttachment resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkAttachment items = 100526016; + */ + private $items; + /** + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\NetworkAttachment>|\Google\Protobuf\Internal\RepeatedField $items + * A list of NetworkAttachment resources. + * @type string $kind + * @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 NetworkAttachment resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkAttachment items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of NetworkAttachment resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkAttachment items = 100526016; + * @param array<\Google\Cloud\Compute\V1\NetworkAttachment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NetworkAttachment::class); + $this->items = $arr; + + return $this; + } + + /** + * 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); + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachmentsScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachmentsScopedList.php new file mode 100644 index 000000000000..19e671b62eb9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkAttachmentsScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.NetworkAttachmentsScopedList + */ +class NetworkAttachmentsScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * A list of NetworkAttachments contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkAttachment network_attachments = 521514783; + */ + private $network_attachments; + /** + * Informational warning which replaces the list of network attachments when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\NetworkAttachment>|\Google\Protobuf\Internal\RepeatedField $network_attachments + * A list of NetworkAttachments contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * Informational warning which replaces the list of network attachments when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of NetworkAttachments contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkAttachment network_attachments = 521514783; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkAttachments() + { + return $this->network_attachments; + } + + /** + * A list of NetworkAttachments contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkAttachment network_attachments = 521514783; + * @param array<\Google\Cloud\Compute\V1\NetworkAttachment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkAttachments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NetworkAttachment::class); + $this->network_attachments = $arr; + + return $this; + } + + /** + * Informational warning which replaces the list of network attachments 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); + } + + /** + * Informational warning which replaces the list of network attachments 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEdgeSecurityService.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEdgeSecurityService.php new file mode 100644 index 000000000000..71198249ad4d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEdgeSecurityService.php @@ -0,0 +1,473 @@ +google.cloud.compute.v1.NetworkEdgeSecurityService + */ +class NetworkEdgeSecurityService extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a NetworkEdgeSecurityService. An up-to-date fingerprint must be provided in order to update the NetworkEdgeSecurityService, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a NetworkEdgeSecurityService. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output only] Type of the resource. Always compute#networkEdgeSecurityService for NetworkEdgeSecurityServices + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] URL of the region where the resource resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * The resource URL for the network edge security service associated with this network edge security service. + * + * Generated from protobuf field optional string security_policy = 171082513; + */ + protected $security_policy = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Server-defined URL for this resource with the resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + */ + protected $self_link_with_id = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type string $fingerprint + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a NetworkEdgeSecurityService. An up-to-date fingerprint must be provided in order to update the NetworkEdgeSecurityService, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a NetworkEdgeSecurityService. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output only] Type of the resource. Always compute#networkEdgeSecurityService for NetworkEdgeSecurityServices + * @type string $name + * 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 string $region + * [Output Only] URL of the region where the resource resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * @type string $security_policy + * The resource URL for the network edge security service associated with this network edge security service. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $self_link_with_id + * [Output Only] Server-defined URL for this resource with the resource id. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a NetworkEdgeSecurityService. An up-to-date fingerprint must be provided in order to update the NetworkEdgeSecurityService, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a NetworkEdgeSecurityService. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a NetworkEdgeSecurityService. An up-to-date fingerprint must be provided in order to update the NetworkEdgeSecurityService, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a NetworkEdgeSecurityService. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output only] Type of the resource. Always compute#networkEdgeSecurityService for NetworkEdgeSecurityServices + * + * 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); + } + + /** + * [Output only] Type of the resource. Always compute#networkEdgeSecurityService for NetworkEdgeSecurityServices + * + * 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; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * [Output Only] URL of the region where the resource resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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 resource resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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; + } + + /** + * The resource URL for the network edge security service associated with this network edge security service. + * + * Generated from protobuf field optional string security_policy = 171082513; + * @return string + */ + public function getSecurityPolicy() + { + return isset($this->security_policy) ? $this->security_policy : ''; + } + + public function hasSecurityPolicy() + { + return isset($this->security_policy); + } + + public function clearSecurityPolicy() + { + unset($this->security_policy); + } + + /** + * The resource URL for the network edge security service associated with this network edge security service. + * + * Generated from protobuf field optional string security_policy = 171082513; + * @param string $var + * @return $this + */ + public function setSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->security_policy = $var; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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] Server-defined URL for this resource with the resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + * @return string + */ + public function getSelfLinkWithId() + { + return isset($this->self_link_with_id) ? $this->self_link_with_id : ''; + } + + public function hasSelfLinkWithId() + { + return isset($this->self_link_with_id); + } + + public function clearSelfLinkWithId() + { + unset($this->self_link_with_id); + } + + /** + * [Output Only] Server-defined URL for this resource with the resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + * @param string $var + * @return $this + */ + public function setSelfLinkWithId($var) + { + GPBUtil::checkString($var, True); + $this->self_link_with_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEdgeSecurityServiceAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEdgeSecurityServiceAggregatedList.php new file mode 100644 index 000000000000..be37a3508408 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEdgeSecurityServiceAggregatedList.php @@ -0,0 +1,357 @@ +google.cloud.compute.v1.NetworkEdgeSecurityServiceAggregatedList + */ +class NetworkEdgeSecurityServiceAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string etag = 3123477; + */ + protected $etag = null; + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of NetworkEdgeSecurityServicesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#networkEdgeSecurityServiceAggregatedList for lists of Network Edge Security Services. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $etag + * @type string $id + * [Output Only] Unique identifier for the resource; defined by the server. + * @type array|\Google\Protobuf\Internal\MapField $items + * A list of NetworkEdgeSecurityServicesScopedList resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#networkEdgeSecurityServiceAggregatedList for lists of Network Edge Security Services. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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); + } + + /** + * Generated from protobuf field optional string etag = 3123477; + * @return string + */ + public function getEtag() + { + return isset($this->etag) ? $this->etag : ''; + } + + public function hasEtag() + { + return isset($this->etag); + } + + public function clearEtag() + { + unset($this->etag); + } + + /** + * Generated from protobuf field optional string etag = 3123477; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * [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 NetworkEdgeSecurityServicesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of NetworkEdgeSecurityServicesScopedList 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\NetworkEdgeSecurityServicesScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#networkEdgeSecurityServiceAggregatedList for lists of Network Edge Security Services. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#networkEdgeSecurityServiceAggregatedList for lists of Network Edge Security Services. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEdgeSecurityServicesScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEdgeSecurityServicesScopedList.php new file mode 100644 index 000000000000..3fa07cd73f55 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEdgeSecurityServicesScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.NetworkEdgeSecurityServicesScopedList + */ +class NetworkEdgeSecurityServicesScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * A list of NetworkEdgeSecurityServices contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEdgeSecurityService network_edge_security_services = 35530156; + */ + private $network_edge_security_services; + /** + * Informational warning which replaces the list of security policies when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\NetworkEdgeSecurityService>|\Google\Protobuf\Internal\RepeatedField $network_edge_security_services + * A list of NetworkEdgeSecurityServices contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * Informational warning which replaces the list of security policies when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of NetworkEdgeSecurityServices contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEdgeSecurityService network_edge_security_services = 35530156; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkEdgeSecurityServices() + { + return $this->network_edge_security_services; + } + + /** + * A list of NetworkEdgeSecurityServices contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEdgeSecurityService network_edge_security_services = 35530156; + * @param array<\Google\Cloud\Compute\V1\NetworkEdgeSecurityService>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkEdgeSecurityServices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NetworkEdgeSecurityService::class); + $this->network_edge_security_services = $arr; + + return $this; + } + + /** + * Informational warning which replaces the list of security policies 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); + } + + /** + * Informational warning which replaces the list of security policies 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpoint.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpoint.php new file mode 100644 index 000000000000..1682cd8e0b97 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpoint.php @@ -0,0 +1,243 @@ +google.cloud.compute.v1.NetworkEndpoint + */ +class NetworkEndpoint extends \Google\Protobuf\Internal\Message +{ + /** + * Metadata defined as annotations on the network endpoint. + * + * Generated from protobuf field map annotations = 112032548; + */ + private $annotations; + /** + * Optional fully qualified domain name of network endpoint. This can only be specified when NetworkEndpointGroup.network_endpoint_type is NON_GCP_FQDN_PORT. + * + * Generated from protobuf field optional string fqdn = 3150485; + */ + protected $fqdn = null; + /** + * The name or a URL of VM instance of this network endpoint. This field is required for network endpoints of type GCE_VM_IP and GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group (for zonal NEGs) or in the zone within the region of the NEG (for regional NEGs). If the ipAddress is specified, it must belongs to the VM instance. The name must be 1-63 characters long, and comply with RFC1035 or be a valid URL pointing to an existing instance. + * + * Generated from protobuf field optional string instance = 18257045; + */ + protected $instance = null; + /** + * Optional IPv4 address of network endpoint. The IP address must belong to a VM in Compute Engine (either the primary IP or as part of an aliased IP range). If the IP address is not specified, then the primary IP address for the VM instance in the network that the network endpoint group belongs to will be used. This field is redundant and need not be set for network endpoints of type GCE_VM_IP. If set, it must be set to the primary internal IP address of the attached VM instance that matches the subnetwork of the NEG. The primary internal IP address from any NIC of a multi-NIC VM instance can be added to a NEG as long as it matches the NEG subnetwork. + * + * Generated from protobuf field optional string ip_address = 406272220; + */ + protected $ip_address = null; + /** + * Optional port number of network endpoint. If not specified, the defaultPort for the network endpoint group will be used. This field can not be set for network endpoints of type GCE_VM_IP. + * + * Generated from protobuf field optional int32 port = 3446913; + */ + protected $port = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Metadata defined as annotations on the network endpoint. + * @type string $fqdn + * Optional fully qualified domain name of network endpoint. This can only be specified when NetworkEndpointGroup.network_endpoint_type is NON_GCP_FQDN_PORT. + * @type string $instance + * The name or a URL of VM instance of this network endpoint. This field is required for network endpoints of type GCE_VM_IP and GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group (for zonal NEGs) or in the zone within the region of the NEG (for regional NEGs). If the ipAddress is specified, it must belongs to the VM instance. The name must be 1-63 characters long, and comply with RFC1035 or be a valid URL pointing to an existing instance. + * @type string $ip_address + * Optional IPv4 address of network endpoint. The IP address must belong to a VM in Compute Engine (either the primary IP or as part of an aliased IP range). If the IP address is not specified, then the primary IP address for the VM instance in the network that the network endpoint group belongs to will be used. This field is redundant and need not be set for network endpoints of type GCE_VM_IP. If set, it must be set to the primary internal IP address of the attached VM instance that matches the subnetwork of the NEG. The primary internal IP address from any NIC of a multi-NIC VM instance can be added to a NEG as long as it matches the NEG subnetwork. + * @type int $port + * Optional port number of network endpoint. If not specified, the defaultPort for the network endpoint group will be used. This field can not be set for network endpoints of type GCE_VM_IP. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Metadata defined as annotations on the network endpoint. + * + * Generated from protobuf field map annotations = 112032548; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Metadata defined as annotations on the network endpoint. + * + * Generated from protobuf field map annotations = 112032548; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Optional fully qualified domain name of network endpoint. This can only be specified when NetworkEndpointGroup.network_endpoint_type is NON_GCP_FQDN_PORT. + * + * Generated from protobuf field optional string fqdn = 3150485; + * @return string + */ + public function getFqdn() + { + return isset($this->fqdn) ? $this->fqdn : ''; + } + + public function hasFqdn() + { + return isset($this->fqdn); + } + + public function clearFqdn() + { + unset($this->fqdn); + } + + /** + * Optional fully qualified domain name of network endpoint. This can only be specified when NetworkEndpointGroup.network_endpoint_type is NON_GCP_FQDN_PORT. + * + * Generated from protobuf field optional string fqdn = 3150485; + * @param string $var + * @return $this + */ + public function setFqdn($var) + { + GPBUtil::checkString($var, True); + $this->fqdn = $var; + + return $this; + } + + /** + * The name or a URL of VM instance of this network endpoint. This field is required for network endpoints of type GCE_VM_IP and GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group (for zonal NEGs) or in the zone within the region of the NEG (for regional NEGs). If the ipAddress is specified, it must belongs to the VM instance. The name must be 1-63 characters long, and comply with RFC1035 or be a valid URL pointing to an existing instance. + * + * Generated from protobuf field optional string instance = 18257045; + * @return string + */ + public function getInstance() + { + return isset($this->instance) ? $this->instance : ''; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * The name or a URL of VM instance of this network endpoint. This field is required for network endpoints of type GCE_VM_IP and GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group (for zonal NEGs) or in the zone within the region of the NEG (for regional NEGs). If the ipAddress is specified, it must belongs to the VM instance. The name must be 1-63 characters long, and comply with RFC1035 or be a valid URL pointing to an existing instance. + * + * Generated from protobuf field optional string instance = 18257045; + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + + /** + * Optional IPv4 address of network endpoint. The IP address must belong to a VM in Compute Engine (either the primary IP or as part of an aliased IP range). If the IP address is not specified, then the primary IP address for the VM instance in the network that the network endpoint group belongs to will be used. This field is redundant and need not be set for network endpoints of type GCE_VM_IP. If set, it must be set to the primary internal IP address of the attached VM instance that matches the subnetwork of the NEG. The primary internal IP address from any NIC of a multi-NIC VM instance can be added to a NEG as long as it matches the NEG subnetwork. + * + * Generated from protobuf field optional string ip_address = 406272220; + * @return string + */ + public function getIpAddress() + { + return isset($this->ip_address) ? $this->ip_address : ''; + } + + public function hasIpAddress() + { + return isset($this->ip_address); + } + + public function clearIpAddress() + { + unset($this->ip_address); + } + + /** + * Optional IPv4 address of network endpoint. The IP address must belong to a VM in Compute Engine (either the primary IP or as part of an aliased IP range). If the IP address is not specified, then the primary IP address for the VM instance in the network that the network endpoint group belongs to will be used. This field is redundant and need not be set for network endpoints of type GCE_VM_IP. If set, it must be set to the primary internal IP address of the attached VM instance that matches the subnetwork of the NEG. The primary internal IP address from any NIC of a multi-NIC VM instance can be added to a NEG as long as it matches the NEG subnetwork. + * + * Generated from protobuf field optional string ip_address = 406272220; + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + + /** + * Optional port number of network endpoint. If not specified, the defaultPort for the network endpoint group will be used. This field can not be set for network endpoints of type GCE_VM_IP. + * + * Generated from protobuf field optional int32 port = 3446913; + * @return int + */ + public function getPort() + { + return isset($this->port) ? $this->port : 0; + } + + public function hasPort() + { + return isset($this->port); + } + + public function clearPort() + { + unset($this->port); + } + + /** + * Optional port number of network endpoint. If not specified, the defaultPort for the network endpoint group will be used. This field can not be set for network endpoints of type GCE_VM_IP. + * + * Generated from protobuf field optional int32 port = 3446913; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroup.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroup.php new file mode 100644 index 000000000000..b957688b4627 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroup.php @@ -0,0 +1,856 @@ +google.cloud.compute.v1.NetworkEndpointGroup + */ +class NetworkEndpointGroup extends \Google\Protobuf\Internal\Message +{ + /** + * Metadata defined as annotations on the network endpoint group. + * + * Generated from protobuf field map annotations = 112032548; + */ + private $annotations; + /** + * Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkEndpointGroupAppEngine app_engine = 340788768; + */ + protected $app_engine = null; + /** + * Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkEndpointGroupCloudFunction cloud_function = 519893666; + */ + protected $cloud_function = null; + /** + * Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkEndpointGroupCloudRun cloud_run = 111060353; + */ + protected $cloud_run = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * The default port used if the port number is not specified in the network endpoint. If the network endpoint type is either GCE_VM_IP, SERVERLESS or PRIVATE_SERVICE_CONNECT, this field must not be specified. + * + * Generated from protobuf field optional int32 default_port = 423377855; + */ + protected $default_port = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#networkEndpointGroup for network endpoint group. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * The URL of the network to which all network endpoints in the NEG belong. Uses default project network if unspecified. + * + * Generated from protobuf field optional string network = 232872494; + */ + protected $network = null; + /** + * Type of network endpoints in this network endpoint group. Can be one of GCE_VM_IP, GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT, INTERNET_FQDN_PORT, INTERNET_IP_PORT, SERVERLESS, PRIVATE_SERVICE_CONNECT, GCE_VM_IP_PORTMAP. + * Check the NetworkEndpointType enum for the list of possible values. + * + * Generated from protobuf field optional string network_endpoint_type = 118301523; + */ + protected $network_endpoint_type = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkEndpointGroupPscData psc_data = 71937481; + */ + protected $psc_data = null; + /** + * The target service url used to set up private service connection to a Google API or a PSC Producer Service Attachment. An example value is: asia-northeast3-cloudkms.googleapis.com + * + * Generated from protobuf field optional string psc_target_service = 269132134; + */ + protected $psc_target_service = null; + /** + * [Output Only] The URL of the region where the network endpoint group is located. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output only] Number of network endpoints in the network endpoint group. + * + * Generated from protobuf field optional int32 size = 3530753; + */ + protected $size = null; + /** + * Optional URL of the subnetwork to which all network endpoints in the NEG belong. + * + * Generated from protobuf field optional string subnetwork = 307827694; + */ + protected $subnetwork = null; + /** + * [Output Only] The URL of the zone where the network endpoint group is located. + * + * Generated from protobuf field optional string zone = 3744684; + */ + protected $zone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Metadata defined as annotations on the network endpoint group. + * @type \Google\Cloud\Compute\V1\NetworkEndpointGroupAppEngine $app_engine + * Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set. + * @type \Google\Cloud\Compute\V1\NetworkEndpointGroupCloudFunction $cloud_function + * Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set. + * @type \Google\Cloud\Compute\V1\NetworkEndpointGroupCloudRun $cloud_run + * Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type int $default_port + * The default port used if the port number is not specified in the network endpoint. If the network endpoint type is either GCE_VM_IP, SERVERLESS or PRIVATE_SERVICE_CONNECT, this field must not be specified. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of the resource. Always compute#networkEndpointGroup for network endpoint group. + * @type string $name + * 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 string $network + * The URL of the network to which all network endpoints in the NEG belong. Uses default project network if unspecified. + * @type string $network_endpoint_type + * Type of network endpoints in this network endpoint group. Can be one of GCE_VM_IP, GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT, INTERNET_FQDN_PORT, INTERNET_IP_PORT, SERVERLESS, PRIVATE_SERVICE_CONNECT, GCE_VM_IP_PORTMAP. + * Check the NetworkEndpointType enum for the list of possible values. + * @type \Google\Cloud\Compute\V1\NetworkEndpointGroupPscData $psc_data + * @type string $psc_target_service + * The target service url used to set up private service connection to a Google API or a PSC Producer Service Attachment. An example value is: asia-northeast3-cloudkms.googleapis.com + * @type string $region + * [Output Only] The URL of the region where the network endpoint group is located. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type int $size + * [Output only] Number of network endpoints in the network endpoint group. + * @type string $subnetwork + * Optional URL of the subnetwork to which all network endpoints in the NEG belong. + * @type string $zone + * [Output Only] The URL of the zone where the network endpoint group is located. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Metadata defined as annotations on the network endpoint group. + * + * Generated from protobuf field map annotations = 112032548; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Metadata defined as annotations on the network endpoint group. + * + * Generated from protobuf field map annotations = 112032548; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkEndpointGroupAppEngine app_engine = 340788768; + * @return \Google\Cloud\Compute\V1\NetworkEndpointGroupAppEngine|null + */ + public function getAppEngine() + { + return $this->app_engine; + } + + public function hasAppEngine() + { + return isset($this->app_engine); + } + + public function clearAppEngine() + { + unset($this->app_engine); + } + + /** + * Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkEndpointGroupAppEngine app_engine = 340788768; + * @param \Google\Cloud\Compute\V1\NetworkEndpointGroupAppEngine $var + * @return $this + */ + public function setAppEngine($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkEndpointGroupAppEngine::class); + $this->app_engine = $var; + + return $this; + } + + /** + * Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkEndpointGroupCloudFunction cloud_function = 519893666; + * @return \Google\Cloud\Compute\V1\NetworkEndpointGroupCloudFunction|null + */ + public function getCloudFunction() + { + return $this->cloud_function; + } + + public function hasCloudFunction() + { + return isset($this->cloud_function); + } + + public function clearCloudFunction() + { + unset($this->cloud_function); + } + + /** + * Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkEndpointGroupCloudFunction cloud_function = 519893666; + * @param \Google\Cloud\Compute\V1\NetworkEndpointGroupCloudFunction $var + * @return $this + */ + public function setCloudFunction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkEndpointGroupCloudFunction::class); + $this->cloud_function = $var; + + return $this; + } + + /** + * Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkEndpointGroupCloudRun cloud_run = 111060353; + * @return \Google\Cloud\Compute\V1\NetworkEndpointGroupCloudRun|null + */ + public function getCloudRun() + { + return $this->cloud_run; + } + + public function hasCloudRun() + { + return isset($this->cloud_run); + } + + public function clearCloudRun() + { + unset($this->cloud_run); + } + + /** + * Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkEndpointGroupCloudRun cloud_run = 111060353; + * @param \Google\Cloud\Compute\V1\NetworkEndpointGroupCloudRun $var + * @return $this + */ + public function setCloudRun($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkEndpointGroupCloudRun::class); + $this->cloud_run = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * The default port used if the port number is not specified in the network endpoint. If the network endpoint type is either GCE_VM_IP, SERVERLESS or PRIVATE_SERVICE_CONNECT, this field must not be specified. + * + * Generated from protobuf field optional int32 default_port = 423377855; + * @return int + */ + public function getDefaultPort() + { + return isset($this->default_port) ? $this->default_port : 0; + } + + public function hasDefaultPort() + { + return isset($this->default_port); + } + + public function clearDefaultPort() + { + unset($this->default_port); + } + + /** + * The default port used if the port number is not specified in the network endpoint. If the network endpoint type is either GCE_VM_IP, SERVERLESS or PRIVATE_SERVICE_CONNECT, this field must not be specified. + * + * Generated from protobuf field optional int32 default_port = 423377855; + * @param int $var + * @return $this + */ + public function setDefaultPort($var) + { + GPBUtil::checkInt32($var); + $this->default_port = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#networkEndpointGroup for network endpoint group. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#networkEndpointGroup for network endpoint group. + * + * 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; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * The URL of the network to which all network endpoints in the NEG belong. Uses default project network if unspecified. + * + * Generated from protobuf field optional string network = 232872494; + * @return string + */ + public function getNetwork() + { + return isset($this->network) ? $this->network : ''; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * The URL of the network to which all network endpoints in the NEG belong. Uses default project network if unspecified. + * + * Generated from protobuf field optional string network = 232872494; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Type of network endpoints in this network endpoint group. Can be one of GCE_VM_IP, GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT, INTERNET_FQDN_PORT, INTERNET_IP_PORT, SERVERLESS, PRIVATE_SERVICE_CONNECT, GCE_VM_IP_PORTMAP. + * Check the NetworkEndpointType enum for the list of possible values. + * + * Generated from protobuf field optional string network_endpoint_type = 118301523; + * @return string + */ + public function getNetworkEndpointType() + { + return isset($this->network_endpoint_type) ? $this->network_endpoint_type : ''; + } + + public function hasNetworkEndpointType() + { + return isset($this->network_endpoint_type); + } + + public function clearNetworkEndpointType() + { + unset($this->network_endpoint_type); + } + + /** + * Type of network endpoints in this network endpoint group. Can be one of GCE_VM_IP, GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT, INTERNET_FQDN_PORT, INTERNET_IP_PORT, SERVERLESS, PRIVATE_SERVICE_CONNECT, GCE_VM_IP_PORTMAP. + * Check the NetworkEndpointType enum for the list of possible values. + * + * Generated from protobuf field optional string network_endpoint_type = 118301523; + * @param string $var + * @return $this + */ + public function setNetworkEndpointType($var) + { + GPBUtil::checkString($var, True); + $this->network_endpoint_type = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkEndpointGroupPscData psc_data = 71937481; + * @return \Google\Cloud\Compute\V1\NetworkEndpointGroupPscData|null + */ + public function getPscData() + { + return $this->psc_data; + } + + public function hasPscData() + { + return isset($this->psc_data); + } + + public function clearPscData() + { + unset($this->psc_data); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkEndpointGroupPscData psc_data = 71937481; + * @param \Google\Cloud\Compute\V1\NetworkEndpointGroupPscData $var + * @return $this + */ + public function setPscData($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkEndpointGroupPscData::class); + $this->psc_data = $var; + + return $this; + } + + /** + * The target service url used to set up private service connection to a Google API or a PSC Producer Service Attachment. An example value is: asia-northeast3-cloudkms.googleapis.com + * + * Generated from protobuf field optional string psc_target_service = 269132134; + * @return string + */ + public function getPscTargetService() + { + return isset($this->psc_target_service) ? $this->psc_target_service : ''; + } + + public function hasPscTargetService() + { + return isset($this->psc_target_service); + } + + public function clearPscTargetService() + { + unset($this->psc_target_service); + } + + /** + * The target service url used to set up private service connection to a Google API or a PSC Producer Service Attachment. An example value is: asia-northeast3-cloudkms.googleapis.com + * + * Generated from protobuf field optional string psc_target_service = 269132134; + * @param string $var + * @return $this + */ + public function setPscTargetService($var) + { + GPBUtil::checkString($var, True); + $this->psc_target_service = $var; + + return $this; + } + + /** + * [Output Only] The URL of the region where the network endpoint group is located. + * + * 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] The URL of the region where the network endpoint group is located. + * + * 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] Server-defined URL for the 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 the 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] Number of network endpoints in the network endpoint group. + * + * Generated from protobuf field optional int32 size = 3530753; + * @return int + */ + public function getSize() + { + return isset($this->size) ? $this->size : 0; + } + + public function hasSize() + { + return isset($this->size); + } + + public function clearSize() + { + unset($this->size); + } + + /** + * [Output only] Number of network endpoints in the network endpoint group. + * + * Generated from protobuf field optional int32 size = 3530753; + * @param int $var + * @return $this + */ + public function setSize($var) + { + GPBUtil::checkInt32($var); + $this->size = $var; + + return $this; + } + + /** + * Optional URL of the subnetwork to which all network endpoints in the NEG belong. + * + * Generated from protobuf field optional string subnetwork = 307827694; + * @return string + */ + public function getSubnetwork() + { + return isset($this->subnetwork) ? $this->subnetwork : ''; + } + + public function hasSubnetwork() + { + return isset($this->subnetwork); + } + + public function clearSubnetwork() + { + unset($this->subnetwork); + } + + /** + * Optional URL of the subnetwork to which all network endpoints in the NEG belong. + * + * Generated from protobuf field optional string subnetwork = 307827694; + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork = $var; + + return $this; + } + + /** + * [Output Only] The URL of the zone where the network endpoint group is located. + * + * Generated from protobuf field optional string zone = 3744684; + * @return string + */ + public function getZone() + { + return isset($this->zone) ? $this->zone : ''; + } + + public function hasZone() + { + return isset($this->zone); + } + + public function clearZone() + { + unset($this->zone); + } + + /** + * [Output Only] The URL of the zone where the network endpoint group is located. + * + * Generated from protobuf field optional string zone = 3744684; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroup/NetworkEndpointType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroup/NetworkEndpointType.php new file mode 100644 index 000000000000..19c6f0bbdf79 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroup/NetworkEndpointType.php @@ -0,0 +1,99 @@ +google.cloud.compute.v1.NetworkEndpointGroup.NetworkEndpointType + */ +class NetworkEndpointType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_NETWORK_ENDPOINT_TYPE = 0; + */ + const UNDEFINED_NETWORK_ENDPOINT_TYPE = 0; + /** + * The network endpoint is represented by an IP address. + * + * Generated from protobuf enum GCE_VM_IP = 401880793; + */ + const GCE_VM_IP = 401880793; + /** + * The network endpoint is represented by IP address and port pair. + * + * Generated from protobuf enum GCE_VM_IP_PORT = 501838375; + */ + const GCE_VM_IP_PORT = 501838375; + /** + * The network endpoint is represented by fully qualified domain name and port. + * + * Generated from protobuf enum INTERNET_FQDN_PORT = 404154477; + */ + const INTERNET_FQDN_PORT = 404154477; + /** + * The network endpoint is represented by an internet IP address and port. + * + * Generated from protobuf enum INTERNET_IP_PORT = 477719963; + */ + const INTERNET_IP_PORT = 477719963; + /** + * The network endpoint is represented by an IP address and port. The endpoint belongs to a VM or pod running in a customer's on-premises. + * + * Generated from protobuf enum NON_GCP_PRIVATE_IP_PORT = 336447968; + */ + const NON_GCP_PRIVATE_IP_PORT = 336447968; + /** + * The network endpoint is either public Google APIs or services exposed by other GCP Project with a Service Attachment. The connection is set up by private service connect + * + * Generated from protobuf enum PRIVATE_SERVICE_CONNECT = 48134724; + */ + const PRIVATE_SERVICE_CONNECT = 48134724; + /** + * The network endpoint is handled by specified serverless infrastructure. + * + * Generated from protobuf enum SERVERLESS = 270492508; + */ + const SERVERLESS = 270492508; + + private static $valueToName = [ + self::UNDEFINED_NETWORK_ENDPOINT_TYPE => 'UNDEFINED_NETWORK_ENDPOINT_TYPE', + self::GCE_VM_IP => 'GCE_VM_IP', + self::GCE_VM_IP_PORT => 'GCE_VM_IP_PORT', + self::INTERNET_FQDN_PORT => 'INTERNET_FQDN_PORT', + self::INTERNET_IP_PORT => 'INTERNET_IP_PORT', + self::NON_GCP_PRIVATE_IP_PORT => 'NON_GCP_PRIVATE_IP_PORT', + self::PRIVATE_SERVICE_CONNECT => 'PRIVATE_SERVICE_CONNECT', + self::SERVERLESS => 'SERVERLESS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NetworkEndpointType::class, \Google\Cloud\Compute\V1\NetworkEndpointGroup_NetworkEndpointType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupAggregatedList.php new file mode 100644 index 000000000000..6d7180bffd41 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.NetworkEndpointGroupAggregatedList + */ +class NetworkEndpointGroupAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of NetworkEndpointGroupsScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] The resource type, which is always compute#networkEndpointGroupAggregatedList for aggregated lists of network endpoint groups. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 NetworkEndpointGroupsScopedList resources. + * @type string $kind + * [Output Only] The resource type, which is always compute#networkEndpointGroupAggregatedList for aggregated lists of network endpoint groups. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 NetworkEndpointGroupsScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of NetworkEndpointGroupsScopedList 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\NetworkEndpointGroupsScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] The resource type, which is always compute#networkEndpointGroupAggregatedList for aggregated lists of network endpoint groups. + * + * 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); + } + + /** + * [Output Only] The resource type, which is always compute#networkEndpointGroupAggregatedList for aggregated lists of network endpoint groups. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupAppEngine.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupAppEngine.php new file mode 100644 index 000000000000..c7181f4917fe --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupAppEngine.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.NetworkEndpointGroupAppEngine + */ +class NetworkEndpointGroupAppEngine extends \Google\Protobuf\Internal\Message +{ + /** + * Optional serving service. The service name is case-sensitive and must be 1-63 characters long. Example value: default, my-service. + * + * Generated from protobuf field optional string service = 373540533; + */ + protected $service = null; + /** + * An URL mask is one of the main components of the Cloud Function. A template to parse service and version fields from a request URL. URL mask allows for routing to multiple App Engine services without having to create multiple Network Endpoint Groups and backend services. For example, the request URLs foo1-dot-appname.appspot.com/v1 and foo1-dot-appname.appspot.com/v2 can be backed by the same Serverless NEG with URL mask -dot-appname.appspot.com/. The URL mask will parse them to { service = "foo1", version = "v1" } and { service = "foo1", version = "v2" } respectively. + * + * Generated from protobuf field optional string url_mask = 103352252; + */ + protected $url_mask = null; + /** + * Optional serving version. The version name is case-sensitive and must be 1-100 characters long. Example value: v1, v2. + * + * Generated from protobuf field optional string version = 351608024; + */ + protected $version = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service + * Optional serving service. The service name is case-sensitive and must be 1-63 characters long. Example value: default, my-service. + * @type string $url_mask + * An URL mask is one of the main components of the Cloud Function. A template to parse service and version fields from a request URL. URL mask allows for routing to multiple App Engine services without having to create multiple Network Endpoint Groups and backend services. For example, the request URLs foo1-dot-appname.appspot.com/v1 and foo1-dot-appname.appspot.com/v2 can be backed by the same Serverless NEG with URL mask -dot-appname.appspot.com/. The URL mask will parse them to { service = "foo1", version = "v1" } and { service = "foo1", version = "v2" } respectively. + * @type string $version + * Optional serving version. The version name is case-sensitive and must be 1-100 characters long. Example value: v1, v2. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Optional serving service. The service name is case-sensitive and must be 1-63 characters long. Example value: default, my-service. + * + * Generated from protobuf field optional string service = 373540533; + * @return string + */ + public function getService() + { + return isset($this->service) ? $this->service : ''; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * Optional serving service. The service name is case-sensitive and must be 1-63 characters long. Example value: default, my-service. + * + * Generated from protobuf field optional string service = 373540533; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * An URL mask is one of the main components of the Cloud Function. A template to parse service and version fields from a request URL. URL mask allows for routing to multiple App Engine services without having to create multiple Network Endpoint Groups and backend services. For example, the request URLs foo1-dot-appname.appspot.com/v1 and foo1-dot-appname.appspot.com/v2 can be backed by the same Serverless NEG with URL mask -dot-appname.appspot.com/. The URL mask will parse them to { service = "foo1", version = "v1" } and { service = "foo1", version = "v2" } respectively. + * + * Generated from protobuf field optional string url_mask = 103352252; + * @return string + */ + public function getUrlMask() + { + return isset($this->url_mask) ? $this->url_mask : ''; + } + + public function hasUrlMask() + { + return isset($this->url_mask); + } + + public function clearUrlMask() + { + unset($this->url_mask); + } + + /** + * An URL mask is one of the main components of the Cloud Function. A template to parse service and version fields from a request URL. URL mask allows for routing to multiple App Engine services without having to create multiple Network Endpoint Groups and backend services. For example, the request URLs foo1-dot-appname.appspot.com/v1 and foo1-dot-appname.appspot.com/v2 can be backed by the same Serverless NEG with URL mask -dot-appname.appspot.com/. The URL mask will parse them to { service = "foo1", version = "v1" } and { service = "foo1", version = "v2" } respectively. + * + * Generated from protobuf field optional string url_mask = 103352252; + * @param string $var + * @return $this + */ + public function setUrlMask($var) + { + GPBUtil::checkString($var, True); + $this->url_mask = $var; + + return $this; + } + + /** + * Optional serving version. The version name is case-sensitive and must be 1-100 characters long. Example value: v1, v2. + * + * Generated from protobuf field optional string version = 351608024; + * @return string + */ + public function getVersion() + { + return isset($this->version) ? $this->version : ''; + } + + public function hasVersion() + { + return isset($this->version); + } + + public function clearVersion() + { + unset($this->version); + } + + /** + * Optional serving version. The version name is case-sensitive and must be 1-100 characters long. Example value: v1, v2. + * + * Generated from protobuf field optional string version = 351608024; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupCloudFunction.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupCloudFunction.php new file mode 100644 index 000000000000..1114f19c43e7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupCloudFunction.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.NetworkEndpointGroupCloudFunction + */ +class NetworkEndpointGroupCloudFunction extends \Google\Protobuf\Internal\Message +{ + /** + * A user-defined name of the Cloud Function. The function name is case-sensitive and must be 1-63 characters long. Example value: func1. + * + * Generated from protobuf field optional string function = 307196888; + */ + protected $function = null; + /** + * An URL mask is one of the main components of the Cloud Function. A template to parse function field from a request URL. URL mask allows for routing to multiple Cloud Functions without having to create multiple Network Endpoint Groups and backend services. For example, request URLs mydomain.com/function1 and mydomain.com/function2 can be backed by the same Serverless NEG with URL mask /. The URL mask will parse them to { function = "function1" } and { function = "function2" } respectively. + * + * Generated from protobuf field optional string url_mask = 103352252; + */ + protected $url_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $function + * A user-defined name of the Cloud Function. The function name is case-sensitive and must be 1-63 characters long. Example value: func1. + * @type string $url_mask + * An URL mask is one of the main components of the Cloud Function. A template to parse function field from a request URL. URL mask allows for routing to multiple Cloud Functions without having to create multiple Network Endpoint Groups and backend services. For example, request URLs mydomain.com/function1 and mydomain.com/function2 can be backed by the same Serverless NEG with URL mask /. The URL mask will parse them to { function = "function1" } and { function = "function2" } respectively. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A user-defined name of the Cloud Function. The function name is case-sensitive and must be 1-63 characters long. Example value: func1. + * + * Generated from protobuf field optional string function = 307196888; + * @return string + */ + public function getFunction() + { + return isset($this->function) ? $this->function : ''; + } + + public function hasFunction() + { + return isset($this->function); + } + + public function clearFunction() + { + unset($this->function); + } + + /** + * A user-defined name of the Cloud Function. The function name is case-sensitive and must be 1-63 characters long. Example value: func1. + * + * Generated from protobuf field optional string function = 307196888; + * @param string $var + * @return $this + */ + public function setFunction($var) + { + GPBUtil::checkString($var, True); + $this->function = $var; + + return $this; + } + + /** + * An URL mask is one of the main components of the Cloud Function. A template to parse function field from a request URL. URL mask allows for routing to multiple Cloud Functions without having to create multiple Network Endpoint Groups and backend services. For example, request URLs mydomain.com/function1 and mydomain.com/function2 can be backed by the same Serverless NEG with URL mask /. The URL mask will parse them to { function = "function1" } and { function = "function2" } respectively. + * + * Generated from protobuf field optional string url_mask = 103352252; + * @return string + */ + public function getUrlMask() + { + return isset($this->url_mask) ? $this->url_mask : ''; + } + + public function hasUrlMask() + { + return isset($this->url_mask); + } + + public function clearUrlMask() + { + unset($this->url_mask); + } + + /** + * An URL mask is one of the main components of the Cloud Function. A template to parse function field from a request URL. URL mask allows for routing to multiple Cloud Functions without having to create multiple Network Endpoint Groups and backend services. For example, request URLs mydomain.com/function1 and mydomain.com/function2 can be backed by the same Serverless NEG with URL mask /. The URL mask will parse them to { function = "function1" } and { function = "function2" } respectively. + * + * Generated from protobuf field optional string url_mask = 103352252; + * @param string $var + * @return $this + */ + public function setUrlMask($var) + { + GPBUtil::checkString($var, True); + $this->url_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupCloudRun.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupCloudRun.php new file mode 100644 index 000000000000..d6cb2ea5e6d2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupCloudRun.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.NetworkEndpointGroupCloudRun + */ +class NetworkEndpointGroupCloudRun extends \Google\Protobuf\Internal\Message +{ + /** + * Cloud Run service is the main resource of Cloud Run. The service must be 1-63 characters long, and comply with RFC1035. Example value: "run-service". + * + * Generated from protobuf field optional string service = 373540533; + */ + protected $service = null; + /** + * Optional Cloud Run tag represents the "named-revision" to provide additional fine-grained traffic routing information. The tag must be 1-63 characters long, and comply with RFC1035. Example value: "revision-0010". + * + * Generated from protobuf field optional string tag = 114586; + */ + protected $tag = null; + /** + * An URL mask is one of the main components of the Cloud Function. A template to parse and fields from a request URL. URL mask allows for routing to multiple Run services without having to create multiple network endpoint groups and backend services. For example, request URLs foo1.domain.com/bar1 and foo1.domain.com/bar2 can be backed by the same Serverless Network Endpoint Group (NEG) with URL mask .domain.com/. The URL mask will parse them to { service="bar1", tag="foo1" } and { service="bar2", tag="foo2" } respectively. + * + * Generated from protobuf field optional string url_mask = 103352252; + */ + protected $url_mask = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service + * Cloud Run service is the main resource of Cloud Run. The service must be 1-63 characters long, and comply with RFC1035. Example value: "run-service". + * @type string $tag + * Optional Cloud Run tag represents the "named-revision" to provide additional fine-grained traffic routing information. The tag must be 1-63 characters long, and comply with RFC1035. Example value: "revision-0010". + * @type string $url_mask + * An URL mask is one of the main components of the Cloud Function. A template to parse and fields from a request URL. URL mask allows for routing to multiple Run services without having to create multiple network endpoint groups and backend services. For example, request URLs foo1.domain.com/bar1 and foo1.domain.com/bar2 can be backed by the same Serverless Network Endpoint Group (NEG) with URL mask .domain.com/. The URL mask will parse them to { service="bar1", tag="foo1" } and { service="bar2", tag="foo2" } respectively. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Cloud Run service is the main resource of Cloud Run. The service must be 1-63 characters long, and comply with RFC1035. Example value: "run-service". + * + * Generated from protobuf field optional string service = 373540533; + * @return string + */ + public function getService() + { + return isset($this->service) ? $this->service : ''; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * Cloud Run service is the main resource of Cloud Run. The service must be 1-63 characters long, and comply with RFC1035. Example value: "run-service". + * + * Generated from protobuf field optional string service = 373540533; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * Optional Cloud Run tag represents the "named-revision" to provide additional fine-grained traffic routing information. The tag must be 1-63 characters long, and comply with RFC1035. Example value: "revision-0010". + * + * Generated from protobuf field optional string tag = 114586; + * @return string + */ + public function getTag() + { + return isset($this->tag) ? $this->tag : ''; + } + + public function hasTag() + { + return isset($this->tag); + } + + public function clearTag() + { + unset($this->tag); + } + + /** + * Optional Cloud Run tag represents the "named-revision" to provide additional fine-grained traffic routing information. The tag must be 1-63 characters long, and comply with RFC1035. Example value: "revision-0010". + * + * Generated from protobuf field optional string tag = 114586; + * @param string $var + * @return $this + */ + public function setTag($var) + { + GPBUtil::checkString($var, True); + $this->tag = $var; + + return $this; + } + + /** + * An URL mask is one of the main components of the Cloud Function. A template to parse and fields from a request URL. URL mask allows for routing to multiple Run services without having to create multiple network endpoint groups and backend services. For example, request URLs foo1.domain.com/bar1 and foo1.domain.com/bar2 can be backed by the same Serverless Network Endpoint Group (NEG) with URL mask .domain.com/. The URL mask will parse them to { service="bar1", tag="foo1" } and { service="bar2", tag="foo2" } respectively. + * + * Generated from protobuf field optional string url_mask = 103352252; + * @return string + */ + public function getUrlMask() + { + return isset($this->url_mask) ? $this->url_mask : ''; + } + + public function hasUrlMask() + { + return isset($this->url_mask); + } + + public function clearUrlMask() + { + unset($this->url_mask); + } + + /** + * An URL mask is one of the main components of the Cloud Function. A template to parse and fields from a request URL. URL mask allows for routing to multiple Run services without having to create multiple network endpoint groups and backend services. For example, request URLs foo1.domain.com/bar1 and foo1.domain.com/bar2 can be backed by the same Serverless Network Endpoint Group (NEG) with URL mask .domain.com/. The URL mask will parse them to { service="bar1", tag="foo1" } and { service="bar2", tag="foo2" } respectively. + * + * Generated from protobuf field optional string url_mask = 103352252; + * @param string $var + * @return $this + */ + public function setUrlMask($var) + { + GPBUtil::checkString($var, True); + $this->url_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupList.php new file mode 100644 index 000000000000..b5d0a1597be7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupList.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.NetworkEndpointGroupList + */ +class NetworkEndpointGroupList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of NetworkEndpointGroup resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpointGroup items = 100526016; + */ + private $items; + /** + * [Output Only] The resource type, which is always compute#networkEndpointGroupList for network endpoint group lists. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\NetworkEndpointGroup>|\Google\Protobuf\Internal\RepeatedField $items + * A list of NetworkEndpointGroup resources. + * @type string $kind + * [Output Only] The resource type, which is always compute#networkEndpointGroupList for network endpoint group lists. + * @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 NetworkEndpointGroup resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpointGroup items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of NetworkEndpointGroup resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpointGroup items = 100526016; + * @param array<\Google\Cloud\Compute\V1\NetworkEndpointGroup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NetworkEndpointGroup::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] The resource type, which is always compute#networkEndpointGroupList for network endpoint group lists. + * + * 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); + } + + /** + * [Output Only] The resource type, which is always compute#networkEndpointGroupList for network endpoint group lists. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupPscData.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupPscData.php new file mode 100644 index 000000000000..76e039268a4c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupPscData.php @@ -0,0 +1,169 @@ +google.cloud.compute.v1.NetworkEndpointGroupPscData + */ +class NetworkEndpointGroupPscData extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Address allocated from given subnetwork for PSC. This IP address acts as a VIP for a PSC NEG, allowing it to act as an endpoint in L7 PSC-XLB. + * + * Generated from protobuf field optional string consumer_psc_address = 452646572; + */ + protected $consumer_psc_address = null; + /** + * [Output Only] The PSC connection id of the PSC Network Endpoint Group Consumer. + * + * Generated from protobuf field optional uint64 psc_connection_id = 292082397; + */ + protected $psc_connection_id = null; + /** + * [Output Only] The connection status of the PSC Forwarding Rule. + * Check the PscConnectionStatus enum for the list of possible values. + * + * Generated from protobuf field optional string psc_connection_status = 184149172; + */ + protected $psc_connection_status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $consumer_psc_address + * [Output Only] Address allocated from given subnetwork for PSC. This IP address acts as a VIP for a PSC NEG, allowing it to act as an endpoint in L7 PSC-XLB. + * @type int|string $psc_connection_id + * [Output Only] The PSC connection id of the PSC Network Endpoint Group Consumer. + * @type string $psc_connection_status + * [Output Only] The connection status of the PSC Forwarding Rule. + * Check the PscConnectionStatus enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Address allocated from given subnetwork for PSC. This IP address acts as a VIP for a PSC NEG, allowing it to act as an endpoint in L7 PSC-XLB. + * + * Generated from protobuf field optional string consumer_psc_address = 452646572; + * @return string + */ + public function getConsumerPscAddress() + { + return isset($this->consumer_psc_address) ? $this->consumer_psc_address : ''; + } + + public function hasConsumerPscAddress() + { + return isset($this->consumer_psc_address); + } + + public function clearConsumerPscAddress() + { + unset($this->consumer_psc_address); + } + + /** + * [Output Only] Address allocated from given subnetwork for PSC. This IP address acts as a VIP for a PSC NEG, allowing it to act as an endpoint in L7 PSC-XLB. + * + * Generated from protobuf field optional string consumer_psc_address = 452646572; + * @param string $var + * @return $this + */ + public function setConsumerPscAddress($var) + { + GPBUtil::checkString($var, True); + $this->consumer_psc_address = $var; + + return $this; + } + + /** + * [Output Only] The PSC connection id of the PSC Network Endpoint Group Consumer. + * + * Generated from protobuf field optional uint64 psc_connection_id = 292082397; + * @return int|string + */ + public function getPscConnectionId() + { + return isset($this->psc_connection_id) ? $this->psc_connection_id : 0; + } + + public function hasPscConnectionId() + { + return isset($this->psc_connection_id); + } + + public function clearPscConnectionId() + { + unset($this->psc_connection_id); + } + + /** + * [Output Only] The PSC connection id of the PSC Network Endpoint Group Consumer. + * + * Generated from protobuf field optional uint64 psc_connection_id = 292082397; + * @param int|string $var + * @return $this + */ + public function setPscConnectionId($var) + { + GPBUtil::checkUint64($var); + $this->psc_connection_id = $var; + + return $this; + } + + /** + * [Output Only] The connection status of the PSC Forwarding Rule. + * Check the PscConnectionStatus enum for the list of possible values. + * + * Generated from protobuf field optional string psc_connection_status = 184149172; + * @return string + */ + public function getPscConnectionStatus() + { + return isset($this->psc_connection_status) ? $this->psc_connection_status : ''; + } + + public function hasPscConnectionStatus() + { + return isset($this->psc_connection_status); + } + + public function clearPscConnectionStatus() + { + unset($this->psc_connection_status); + } + + /** + * [Output Only] The connection status of the PSC Forwarding Rule. + * Check the PscConnectionStatus enum for the list of possible values. + * + * Generated from protobuf field optional string psc_connection_status = 184149172; + * @param string $var + * @return $this + */ + public function setPscConnectionStatus($var) + { + GPBUtil::checkString($var, True); + $this->psc_connection_status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupPscData/PscConnectionStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupPscData/PscConnectionStatus.php new file mode 100644 index 000000000000..19f1a76b004a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupPscData/PscConnectionStatus.php @@ -0,0 +1,90 @@ +google.cloud.compute.v1.NetworkEndpointGroupPscData.PscConnectionStatus + */ +class PscConnectionStatus +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PSC_CONNECTION_STATUS = 0; + */ + const UNDEFINED_PSC_CONNECTION_STATUS = 0; + /** + * The connection has been accepted by the producer. + * + * Generated from protobuf enum ACCEPTED = 246714279; + */ + const ACCEPTED = 246714279; + /** + * The connection has been closed by the producer and will not serve traffic going forward. + * + * Generated from protobuf enum CLOSED = 380163436; + */ + const CLOSED = 380163436; + /** + * The connection has been accepted by the producer, but the producer needs to take further action before the forwarding rule can serve traffic. + * + * Generated from protobuf enum NEEDS_ATTENTION = 344491452; + */ + const NEEDS_ATTENTION = 344491452; + /** + * The connection is pending acceptance by the producer. + * + * Generated from protobuf enum PENDING = 35394935; + */ + const PENDING = 35394935; + /** + * The connection has been rejected by the producer. + * + * Generated from protobuf enum REJECTED = 174130302; + */ + const REJECTED = 174130302; + /** + * Generated from protobuf enum STATUS_UNSPECIFIED = 42133066; + */ + const STATUS_UNSPECIFIED = 42133066; + + private static $valueToName = [ + self::UNDEFINED_PSC_CONNECTION_STATUS => 'UNDEFINED_PSC_CONNECTION_STATUS', + self::ACCEPTED => 'ACCEPTED', + self::CLOSED => 'CLOSED', + self::NEEDS_ATTENTION => 'NEEDS_ATTENTION', + self::PENDING => 'PENDING', + self::REJECTED => 'REJECTED', + self::STATUS_UNSPECIFIED => 'STATUS_UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PscConnectionStatus::class, \Google\Cloud\Compute\V1\NetworkEndpointGroupPscData_PscConnectionStatus::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsAttachEndpointsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsAttachEndpointsRequest.php new file mode 100644 index 000000000000..b641de91f126 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsAttachEndpointsRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest + */ +class NetworkEndpointGroupsAttachEndpointsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The list of network endpoints to be attached. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpoint network_endpoints = 149850285; + */ + private $network_endpoints; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\NetworkEndpoint>|\Google\Protobuf\Internal\RepeatedField $network_endpoints + * The list of network endpoints to be attached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The list of network endpoints to be attached. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpoint network_endpoints = 149850285; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkEndpoints() + { + return $this->network_endpoints; + } + + /** + * The list of network endpoints to be attached. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpoint network_endpoints = 149850285; + * @param array<\Google\Cloud\Compute\V1\NetworkEndpoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkEndpoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NetworkEndpoint::class); + $this->network_endpoints = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsDetachEndpointsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsDetachEndpointsRequest.php new file mode 100644 index 000000000000..a3ef886614e1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsDetachEndpointsRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest + */ +class NetworkEndpointGroupsDetachEndpointsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The list of network endpoints to be detached. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpoint network_endpoints = 149850285; + */ + private $network_endpoints; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\NetworkEndpoint>|\Google\Protobuf\Internal\RepeatedField $network_endpoints + * The list of network endpoints to be detached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The list of network endpoints to be detached. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpoint network_endpoints = 149850285; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkEndpoints() + { + return $this->network_endpoints; + } + + /** + * The list of network endpoints to be detached. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpoint network_endpoints = 149850285; + * @param array<\Google\Cloud\Compute\V1\NetworkEndpoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkEndpoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NetworkEndpoint::class); + $this->network_endpoints = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsListEndpointsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsListEndpointsRequest.php new file mode 100644 index 000000000000..7ed43d3bcc9d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsListEndpointsRequest.php @@ -0,0 +1,80 @@ +google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest + */ +class NetworkEndpointGroupsListEndpointsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional query parameter for showing the health status of each network endpoint. Valid options are SKIP or SHOW. If you don't specify this parameter, the health status of network endpoints will not be provided. + * Check the HealthStatus enum for the list of possible values. + * + * Generated from protobuf field optional string health_status = 380545845; + */ + protected $health_status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $health_status + * Optional query parameter for showing the health status of each network endpoint. Valid options are SKIP or SHOW. If you don't specify this parameter, the health status of network endpoints will not be provided. + * Check the HealthStatus enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Optional query parameter for showing the health status of each network endpoint. Valid options are SKIP or SHOW. If you don't specify this parameter, the health status of network endpoints will not be provided. + * Check the HealthStatus enum for the list of possible values. + * + * Generated from protobuf field optional string health_status = 380545845; + * @return string + */ + public function getHealthStatus() + { + return isset($this->health_status) ? $this->health_status : ''; + } + + public function hasHealthStatus() + { + return isset($this->health_status); + } + + public function clearHealthStatus() + { + unset($this->health_status); + } + + /** + * Optional query parameter for showing the health status of each network endpoint. Valid options are SKIP or SHOW. If you don't specify this parameter, the health status of network endpoints will not be provided. + * Check the HealthStatus enum for the list of possible values. + * + * Generated from protobuf field optional string health_status = 380545845; + * @param string $var + * @return $this + */ + public function setHealthStatus($var) + { + GPBUtil::checkString($var, True); + $this->health_status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsListEndpointsRequest/HealthStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsListEndpointsRequest/HealthStatus.php new file mode 100644 index 000000000000..0029983ee7c3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsListEndpointsRequest/HealthStatus.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest.HealthStatus + */ +class HealthStatus +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_HEALTH_STATUS = 0; + */ + const UNDEFINED_HEALTH_STATUS = 0; + /** + * Show the health status for each network endpoint. Impacts latency of the call. + * + * Generated from protobuf enum SHOW = 2544381; + */ + const SHOW = 2544381; + /** + * Health status for network endpoints will not be provided. + * + * Generated from protobuf enum SKIP = 2547071; + */ + const SKIP = 2547071; + + private static $valueToName = [ + self::UNDEFINED_HEALTH_STATUS => 'UNDEFINED_HEALTH_STATUS', + self::SHOW => 'SHOW', + self::SKIP => 'SKIP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(HealthStatus::class, \Google\Cloud\Compute\V1\NetworkEndpointGroupsListEndpointsRequest_HealthStatus::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsListNetworkEndpoints.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsListNetworkEndpoints.php new file mode 100644 index 000000000000..c7190acbb47f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsListNetworkEndpoints.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints + */ +class NetworkEndpointGroupsListNetworkEndpoints extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of NetworkEndpointWithHealthStatus resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpointWithHealthStatus items = 100526016; + */ + private $items; + /** + * [Output Only] The resource type, which is always compute#networkEndpointGroupsListNetworkEndpoints for the list of network endpoints in the specified network endpoint group. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\NetworkEndpointWithHealthStatus>|\Google\Protobuf\Internal\RepeatedField $items + * A list of NetworkEndpointWithHealthStatus resources. + * @type string $kind + * [Output Only] The resource type, which is always compute#networkEndpointGroupsListNetworkEndpoints for the list of network endpoints in the specified network endpoint group. + * @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 \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 NetworkEndpointWithHealthStatus resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpointWithHealthStatus items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of NetworkEndpointWithHealthStatus resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpointWithHealthStatus items = 100526016; + * @param array<\Google\Cloud\Compute\V1\NetworkEndpointWithHealthStatus>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NetworkEndpointWithHealthStatus::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] The resource type, which is always compute#networkEndpointGroupsListNetworkEndpoints for the list of network endpoints in the specified network endpoint group. + * + * 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); + } + + /** + * [Output Only] The resource type, which is always compute#networkEndpointGroupsListNetworkEndpoints for the list of network endpoints in the specified network endpoint group. + * + * 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] 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsScopedList.php new file mode 100644 index 000000000000..8a2a3e7583fb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupsScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.NetworkEndpointGroupsScopedList + */ +class NetworkEndpointGroupsScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The list of network endpoint groups that are contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpointGroup network_endpoint_groups = 29346733; + */ + private $network_endpoint_groups; + /** + * [Output Only] An informational warning that replaces the list of network endpoint groups when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\NetworkEndpointGroup>|\Google\Protobuf\Internal\RepeatedField $network_endpoint_groups + * [Output Only] The list of network endpoint groups that are contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] An informational warning that replaces the list of network endpoint groups when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The list of network endpoint groups that are contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpointGroup network_endpoint_groups = 29346733; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkEndpointGroups() + { + return $this->network_endpoint_groups; + } + + /** + * [Output Only] The list of network endpoint groups that are contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpointGroup network_endpoint_groups = 29346733; + * @param array<\Google\Cloud\Compute\V1\NetworkEndpointGroup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkEndpointGroups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NetworkEndpointGroup::class); + $this->network_endpoint_groups = $arr; + + return $this; + } + + /** + * [Output Only] An informational warning that replaces the list of network endpoint groups 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 network endpoint groups 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointWithHealthStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointWithHealthStatus.php new file mode 100644 index 000000000000..e9e57b855398 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointWithHealthStatus.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.NetworkEndpointWithHealthStatus + */ +class NetworkEndpointWithHealthStatus extends \Google\Protobuf\Internal\Message +{ + /** + * [Output only] The health status of network endpoint; + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthStatusForNetworkEndpoint healths = 258689431; + */ + private $healths; + /** + * [Output only] The network endpoint; + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkEndpoint network_endpoint = 56789126; + */ + protected $network_endpoint = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\HealthStatusForNetworkEndpoint>|\Google\Protobuf\Internal\RepeatedField $healths + * [Output only] The health status of network endpoint; + * @type \Google\Cloud\Compute\V1\NetworkEndpoint $network_endpoint + * [Output only] The network endpoint; + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output only] The health status of network endpoint; + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthStatusForNetworkEndpoint healths = 258689431; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHealths() + { + return $this->healths; + } + + /** + * [Output only] The health status of network endpoint; + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthStatusForNetworkEndpoint healths = 258689431; + * @param array<\Google\Cloud\Compute\V1\HealthStatusForNetworkEndpoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHealths($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\HealthStatusForNetworkEndpoint::class); + $this->healths = $arr; + + return $this; + } + + /** + * [Output only] The network endpoint; + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkEndpoint network_endpoint = 56789126; + * @return \Google\Cloud\Compute\V1\NetworkEndpoint|null + */ + public function getNetworkEndpoint() + { + return $this->network_endpoint; + } + + public function hasNetworkEndpoint() + { + return isset($this->network_endpoint); + } + + public function clearNetworkEndpoint() + { + unset($this->network_endpoint); + } + + /** + * [Output only] The network endpoint; + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkEndpoint network_endpoint = 56789126; + * @param \Google\Cloud\Compute\V1\NetworkEndpoint $var + * @return $this + */ + public function setNetworkEndpoint($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkEndpoint::class); + $this->network_endpoint = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkInterface.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkInterface.php new file mode 100644 index 000000000000..a4cb0ee72f0f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkInterface.php @@ -0,0 +1,719 @@ +google.cloud.compute.v1.NetworkInterface + */ +class NetworkInterface extends \Google\Protobuf\Internal\Message +{ + /** + * An array of configurations for this interface. Currently, only one access config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs specified, then this instance will have no external internet access. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AccessConfig access_configs = 111058326; + */ + private $access_configs; + /** + * An array of alias IP ranges for this network interface. You can only specify this field for network interfaces in VPC networks. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AliasIpRange alias_ip_ranges = 165085631; + */ + private $alias_ip_ranges; + /** + * Fingerprint hash of contents stored in this network interface. This field will be ignored when inserting an Instance or adding a NetworkInterface. An up-to-date fingerprint must be provided in order to update the NetworkInterface. The request will fail with error 400 Bad Request if the fingerprint is not provided, or 412 Precondition Failed if the fingerprint is out of date. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * The prefix length of the primary internal IPv6 range. + * + * Generated from protobuf field optional int32 internal_ipv6_prefix_length = 203833757; + */ + protected $internal_ipv6_prefix_length = null; + /** + * An array of IPv6 access configurations for this interface. Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there is no ipv6AccessConfig specified, then this instance will have no external IPv6 Internet access. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AccessConfig ipv6_access_configs = 483472110; + */ + private $ipv6_access_configs; + /** + * [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. + * + * Generated from protobuf field optional string ipv6_access_type = 504658653; + */ + protected $ipv6_access_type = null; + /** + * 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; + */ + protected $ipv6_address = null; + /** + * [Output Only] Type of the resource. Always compute#networkInterface for network interfaces. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * [Output Only] The name of the network interface, which is generated by the server. For a VM, the network interface uses the nicN naming format. Where N is a value between 0 and 7. The default interface value is nic0. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * URL of the VPC network resource for this instance. When creating an instance, if neither the network nor the subnetwork is specified, the default network global/networks/default is used. If the selected project doesn't have the default network, you must specify a network or subnet. If the network is not specified but the subnetwork is specified, the network is inferred. If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: - https://www.googleapis.com/compute/v1/projects/project/global/networks/ network - projects/project/global/networks/network - global/networks/default + * + * Generated from protobuf field optional string network = 232872494; + */ + protected $network = null; + /** + * The URL of the network attachment that this interface should connect to in the following format: projects/{project_number}/regions/{region_name}/networkAttachments/{network_attachment_name}. + * + * Generated from protobuf field optional string network_attachment = 224644052; + */ + protected $network_attachment = null; + /** + * An IPv4 internal IP address to assign to the instance for this network interface. If not specified by the user, an unused internal IP is assigned by the system. + * + * Generated from protobuf field optional string network_i_p = 207181961; + */ + protected $network_i_p = null; + /** + * The type of vNIC to be used on this interface. This may be gVNIC or VirtioNet. + * Check the NicType enum for the list of possible values. + * + * Generated from protobuf field optional string nic_type = 59810577; + */ + protected $nic_type = null; + /** + * The networking queue count that's specified by users for the network interface. Both Rx and Tx queues will be set to this number. It'll be empty if not specified by the users. + * + * Generated from protobuf field optional int32 queue_count = 503708769; + */ + protected $queue_count = null; + /** + * The stack type for this network interface. To assign only IPv4 addresses, use IPV4_ONLY. To assign both IPv4 and IPv6 addresses, use IPV4_IPV6. If not specified, IPV4_ONLY is used. This field can be both set at instance creation and update network interface operations. + * Check the StackType enum for the list of possible values. + * + * Generated from protobuf field optional string stack_type = 425908881; + */ + protected $stack_type = null; + /** + * The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not specify this field. If the network is in auto subnet mode, specifying the subnetwork is optional. If the network is in custom subnet mode, specifying the subnetwork is required. If you specify this field, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs: - https://www.googleapis.com/compute/v1/projects/project/regions/region /subnetworks/subnetwork - regions/region/subnetworks/subnetwork + * + * Generated from protobuf field optional string subnetwork = 307827694; + */ + protected $subnetwork = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\AccessConfig>|\Google\Protobuf\Internal\RepeatedField $access_configs + * An array of configurations for this interface. Currently, only one access config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs specified, then this instance will have no external internet access. + * @type array<\Google\Cloud\Compute\V1\AliasIpRange>|\Google\Protobuf\Internal\RepeatedField $alias_ip_ranges + * An array of alias IP ranges for this network interface. You can only specify this field for network interfaces in VPC networks. + * @type string $fingerprint + * Fingerprint hash of contents stored in this network interface. This field will be ignored when inserting an Instance or adding a NetworkInterface. An up-to-date fingerprint must be provided in order to update the NetworkInterface. The request will fail with error 400 Bad Request if the fingerprint is not provided, or 412 Precondition Failed if the fingerprint is out of date. + * @type int $internal_ipv6_prefix_length + * The prefix length of the primary internal IPv6 range. + * @type array<\Google\Cloud\Compute\V1\AccessConfig>|\Google\Protobuf\Internal\RepeatedField $ipv6_access_configs + * An array of IPv6 access configurations for this interface. Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there is no ipv6AccessConfig specified, then this instance will have no external IPv6 Internet access. + * @type string $ipv6_access_type + * [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. 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 + * [Output Only] The name of the network interface, which is generated by the server. For a VM, the network interface uses the nicN naming format. Where N is a value between 0 and 7. The default interface value is nic0. + * @type string $network + * URL of the VPC network resource for this instance. When creating an instance, if neither the network nor the subnetwork is specified, the default network global/networks/default is used. If the selected project doesn't have the default network, you must specify a network or subnet. If the network is not specified but the subnetwork is specified, the network is inferred. If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: - https://www.googleapis.com/compute/v1/projects/project/global/networks/ network - projects/project/global/networks/network - global/networks/default + * @type string $network_attachment + * The URL of the network attachment that this interface should connect to in the following format: projects/{project_number}/regions/{region_name}/networkAttachments/{network_attachment_name}. + * @type string $network_i_p + * An IPv4 internal IP address to assign to the instance for this network interface. If not specified by the user, an unused internal IP is assigned by the system. + * @type string $nic_type + * The type of vNIC to be used on this interface. This may be gVNIC or VirtioNet. + * Check the NicType enum for the list of possible values. + * @type int $queue_count + * The networking queue count that's specified by users for the network interface. Both Rx and Tx queues will be set to this number. It'll be empty if not specified by the users. + * @type string $stack_type + * The stack type for this network interface. To assign only IPv4 addresses, use IPV4_ONLY. To assign both IPv4 and IPv6 addresses, use IPV4_IPV6. If not specified, IPV4_ONLY is used. This field can be both set at instance creation and update network interface operations. + * Check the StackType enum for the list of possible values. + * @type string $subnetwork + * The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not specify this field. If the network is in auto subnet mode, specifying the subnetwork is optional. If the network is in custom subnet mode, specifying the subnetwork is required. If you specify this field, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs: - https://www.googleapis.com/compute/v1/projects/project/regions/region /subnetworks/subnetwork - regions/region/subnetworks/subnetwork + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * An array of configurations for this interface. Currently, only one access config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs specified, then this instance will have no external internet access. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AccessConfig access_configs = 111058326; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAccessConfigs() + { + return $this->access_configs; + } + + /** + * An array of configurations for this interface. Currently, only one access config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs specified, then this instance will have no external internet access. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AccessConfig access_configs = 111058326; + * @param array<\Google\Cloud\Compute\V1\AccessConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAccessConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AccessConfig::class); + $this->access_configs = $arr; + + return $this; + } + + /** + * An array of alias IP ranges for this network interface. You can only specify this field for network interfaces in VPC networks. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AliasIpRange alias_ip_ranges = 165085631; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAliasIpRanges() + { + return $this->alias_ip_ranges; + } + + /** + * An array of alias IP ranges for this network interface. You can only specify this field for network interfaces in VPC networks. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AliasIpRange alias_ip_ranges = 165085631; + * @param array<\Google\Cloud\Compute\V1\AliasIpRange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAliasIpRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AliasIpRange::class); + $this->alias_ip_ranges = $arr; + + return $this; + } + + /** + * Fingerprint hash of contents stored in this network interface. This field will be ignored when inserting an Instance or adding a NetworkInterface. An up-to-date fingerprint must be provided in order to update the NetworkInterface. The request will fail with error 400 Bad Request if the fingerprint is not provided, or 412 Precondition Failed if the fingerprint is out of date. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Fingerprint hash of contents stored in this network interface. This field will be ignored when inserting an Instance or adding a NetworkInterface. An up-to-date fingerprint must be provided in order to update the NetworkInterface. The request will fail with error 400 Bad Request if the fingerprint is not provided, or 412 Precondition Failed if the fingerprint is out of date. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * The prefix length of the primary internal IPv6 range. + * + * Generated from protobuf field optional int32 internal_ipv6_prefix_length = 203833757; + * @return int + */ + public function getInternalIpv6PrefixLength() + { + return isset($this->internal_ipv6_prefix_length) ? $this->internal_ipv6_prefix_length : 0; + } + + public function hasInternalIpv6PrefixLength() + { + return isset($this->internal_ipv6_prefix_length); + } + + public function clearInternalIpv6PrefixLength() + { + unset($this->internal_ipv6_prefix_length); + } + + /** + * The prefix length of the primary internal IPv6 range. + * + * Generated from protobuf field optional int32 internal_ipv6_prefix_length = 203833757; + * @param int $var + * @return $this + */ + public function setInternalIpv6PrefixLength($var) + { + GPBUtil::checkInt32($var); + $this->internal_ipv6_prefix_length = $var; + + return $this; + } + + /** + * An array of IPv6 access configurations for this interface. Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there is no ipv6AccessConfig specified, then this instance will have no external IPv6 Internet access. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AccessConfig ipv6_access_configs = 483472110; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIpv6AccessConfigs() + { + return $this->ipv6_access_configs; + } + + /** + * An array of IPv6 access configurations for this interface. Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there is no ipv6AccessConfig specified, then this instance will have no external IPv6 Internet access. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AccessConfig ipv6_access_configs = 483472110; + * @param array<\Google\Cloud\Compute\V1\AccessConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIpv6AccessConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AccessConfig::class); + $this->ipv6_access_configs = $arr; + + return $this; + } + + /** + * [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. + * + * Generated from protobuf field optional string ipv6_access_type = 504658653; + * @return string + */ + public function getIpv6AccessType() + { + return isset($this->ipv6_access_type) ? $this->ipv6_access_type : ''; + } + + public function hasIpv6AccessType() + { + return isset($this->ipv6_access_type); + } + + public function clearIpv6AccessType() + { + unset($this->ipv6_access_type); + } + + /** + * [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. + * + * Generated from protobuf field optional string ipv6_access_type = 504658653; + * @param string $var + * @return $this + */ + public function setIpv6AccessType($var) + { + GPBUtil::checkString($var, True); + $this->ipv6_access_type = $var; + + return $this; + } + + /** + * 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 + */ + public function getIpv6Address() + { + return isset($this->ipv6_address) ? $this->ipv6_address : ''; + } + + public function hasIpv6Address() + { + return isset($this->ipv6_address); + } + + public function clearIpv6Address() + { + unset($this->ipv6_address); + } + + /** + * 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 + * @return $this + */ + public function setIpv6Address($var) + { + GPBUtil::checkString($var, True); + $this->ipv6_address = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#networkInterface for network interfaces. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#networkInterface for network interfaces. + * + * 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] The name of the network interface, which is generated by the server. For a VM, the network interface uses the nicN naming format. Where N is a value between 0 and 7. The default interface value is nic0. + * + * 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); + } + + /** + * [Output Only] The name of the network interface, which is generated by the server. For a VM, the network interface uses the nicN naming format. Where N is a value between 0 and 7. The default interface value is nic0. + * + * 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; + } + + /** + * URL of the VPC network resource for this instance. When creating an instance, if neither the network nor the subnetwork is specified, the default network global/networks/default is used. If the selected project doesn't have the default network, you must specify a network or subnet. If the network is not specified but the subnetwork is specified, the network is inferred. If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: - https://www.googleapis.com/compute/v1/projects/project/global/networks/ network - projects/project/global/networks/network - global/networks/default + * + * Generated from protobuf field optional string network = 232872494; + * @return string + */ + public function getNetwork() + { + return isset($this->network) ? $this->network : ''; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * URL of the VPC network resource for this instance. When creating an instance, if neither the network nor the subnetwork is specified, the default network global/networks/default is used. If the selected project doesn't have the default network, you must specify a network or subnet. If the network is not specified but the subnetwork is specified, the network is inferred. If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: - https://www.googleapis.com/compute/v1/projects/project/global/networks/ network - projects/project/global/networks/network - global/networks/default + * + * Generated from protobuf field optional string network = 232872494; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * The URL of the network attachment that this interface should connect to in the following format: projects/{project_number}/regions/{region_name}/networkAttachments/{network_attachment_name}. + * + * Generated from protobuf field optional string network_attachment = 224644052; + * @return string + */ + public function getNetworkAttachment() + { + return isset($this->network_attachment) ? $this->network_attachment : ''; + } + + public function hasNetworkAttachment() + { + return isset($this->network_attachment); + } + + public function clearNetworkAttachment() + { + unset($this->network_attachment); + } + + /** + * The URL of the network attachment that this interface should connect to in the following format: projects/{project_number}/regions/{region_name}/networkAttachments/{network_attachment_name}. + * + * Generated from protobuf field optional string network_attachment = 224644052; + * @param string $var + * @return $this + */ + public function setNetworkAttachment($var) + { + GPBUtil::checkString($var, True); + $this->network_attachment = $var; + + return $this; + } + + /** + * An IPv4 internal IP address to assign to the instance for this network interface. If not specified by the user, an unused internal IP is assigned by the system. + * + * Generated from protobuf field optional string network_i_p = 207181961; + * @return string + */ + public function getNetworkIP() + { + return isset($this->network_i_p) ? $this->network_i_p : ''; + } + + public function hasNetworkIP() + { + return isset($this->network_i_p); + } + + public function clearNetworkIP() + { + unset($this->network_i_p); + } + + /** + * An IPv4 internal IP address to assign to the instance for this network interface. If not specified by the user, an unused internal IP is assigned by the system. + * + * Generated from protobuf field optional string network_i_p = 207181961; + * @param string $var + * @return $this + */ + public function setNetworkIP($var) + { + GPBUtil::checkString($var, True); + $this->network_i_p = $var; + + return $this; + } + + /** + * The type of vNIC to be used on this interface. This may be gVNIC or VirtioNet. + * Check the NicType enum for the list of possible values. + * + * Generated from protobuf field optional string nic_type = 59810577; + * @return string + */ + public function getNicType() + { + return isset($this->nic_type) ? $this->nic_type : ''; + } + + public function hasNicType() + { + return isset($this->nic_type); + } + + public function clearNicType() + { + unset($this->nic_type); + } + + /** + * The type of vNIC to be used on this interface. This may be gVNIC or VirtioNet. + * Check the NicType enum for the list of possible values. + * + * Generated from protobuf field optional string nic_type = 59810577; + * @param string $var + * @return $this + */ + public function setNicType($var) + { + GPBUtil::checkString($var, True); + $this->nic_type = $var; + + return $this; + } + + /** + * The networking queue count that's specified by users for the network interface. Both Rx and Tx queues will be set to this number. It'll be empty if not specified by the users. + * + * Generated from protobuf field optional int32 queue_count = 503708769; + * @return int + */ + public function getQueueCount() + { + return isset($this->queue_count) ? $this->queue_count : 0; + } + + public function hasQueueCount() + { + return isset($this->queue_count); + } + + public function clearQueueCount() + { + unset($this->queue_count); + } + + /** + * The networking queue count that's specified by users for the network interface. Both Rx and Tx queues will be set to this number. It'll be empty if not specified by the users. + * + * Generated from protobuf field optional int32 queue_count = 503708769; + * @param int $var + * @return $this + */ + public function setQueueCount($var) + { + GPBUtil::checkInt32($var); + $this->queue_count = $var; + + return $this; + } + + /** + * The stack type for this network interface. To assign only IPv4 addresses, use IPV4_ONLY. To assign both IPv4 and IPv6 addresses, use IPV4_IPV6. If not specified, IPV4_ONLY is used. This field can be both set at instance creation and update network interface operations. + * Check the StackType enum for the list of possible values. + * + * Generated from protobuf field optional string stack_type = 425908881; + * @return string + */ + public function getStackType() + { + return isset($this->stack_type) ? $this->stack_type : ''; + } + + public function hasStackType() + { + return isset($this->stack_type); + } + + public function clearStackType() + { + unset($this->stack_type); + } + + /** + * The stack type for this network interface. To assign only IPv4 addresses, use IPV4_ONLY. To assign both IPv4 and IPv6 addresses, use IPV4_IPV6. If not specified, IPV4_ONLY is used. This field can be both set at instance creation and update network interface operations. + * Check the StackType enum for the list of possible values. + * + * Generated from protobuf field optional string stack_type = 425908881; + * @param string $var + * @return $this + */ + public function setStackType($var) + { + GPBUtil::checkString($var, True); + $this->stack_type = $var; + + return $this; + } + + /** + * The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not specify this field. If the network is in auto subnet mode, specifying the subnetwork is optional. If the network is in custom subnet mode, specifying the subnetwork is required. If you specify this field, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs: - https://www.googleapis.com/compute/v1/projects/project/regions/region /subnetworks/subnetwork - regions/region/subnetworks/subnetwork + * + * Generated from protobuf field optional string subnetwork = 307827694; + * @return string + */ + public function getSubnetwork() + { + return isset($this->subnetwork) ? $this->subnetwork : ''; + } + + public function hasSubnetwork() + { + return isset($this->subnetwork); + } + + public function clearSubnetwork() + { + unset($this->subnetwork); + } + + /** + * The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not specify this field. If the network is in auto subnet mode, specifying the subnetwork is optional. If the network is in custom subnet mode, specifying the subnetwork is required. If you specify this field, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs: - https://www.googleapis.com/compute/v1/projects/project/regions/region /subnetworks/subnetwork - regions/region/subnetworks/subnetwork + * + * Generated from protobuf field optional string subnetwork = 307827694; + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkInterface/Ipv6AccessType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkInterface/Ipv6AccessType.php new file mode 100644 index 000000000000..f219a210e282 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkInterface/Ipv6AccessType.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.NetworkInterface.Ipv6AccessType + */ +class Ipv6AccessType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_IPV6_ACCESS_TYPE = 0; + */ + const UNDEFINED_IPV6_ACCESS_TYPE = 0; + /** + * This network interface can have external IPv6. + * + * Generated from protobuf enum EXTERNAL = 35607499; + */ + const EXTERNAL = 35607499; + /** + * This network interface can have internal IPv6. + * + * Generated from protobuf enum INTERNAL = 279295677; + */ + const INTERNAL = 279295677; + /** + * Generated from protobuf enum UNSPECIFIED_IPV6_ACCESS_TYPE = 313080613; + */ + const UNSPECIFIED_IPV6_ACCESS_TYPE = 313080613; + + private static $valueToName = [ + self::UNDEFINED_IPV6_ACCESS_TYPE => 'UNDEFINED_IPV6_ACCESS_TYPE', + self::EXTERNAL => 'EXTERNAL', + self::INTERNAL => 'INTERNAL', + self::UNSPECIFIED_IPV6_ACCESS_TYPE => 'UNSPECIFIED_IPV6_ACCESS_TYPE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Ipv6AccessType::class, \Google\Cloud\Compute\V1\NetworkInterface_Ipv6AccessType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkInterface/NicType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkInterface/NicType.php new file mode 100644 index 000000000000..da30df390628 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkInterface/NicType.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.NetworkInterface.NicType + */ +class NicType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_NIC_TYPE = 0; + */ + const UNDEFINED_NIC_TYPE = 0; + /** + * GVNIC + * + * Generated from protobuf enum GVNIC = 68209305; + */ + const GVNIC = 68209305; + /** + * No type specified. + * + * Generated from protobuf enum UNSPECIFIED_NIC_TYPE = 67411801; + */ + const UNSPECIFIED_NIC_TYPE = 67411801; + /** + * VIRTIO + * + * Generated from protobuf enum VIRTIO_NET = 452123481; + */ + const VIRTIO_NET = 452123481; + + private static $valueToName = [ + self::UNDEFINED_NIC_TYPE => 'UNDEFINED_NIC_TYPE', + self::GVNIC => 'GVNIC', + self::UNSPECIFIED_NIC_TYPE => 'UNSPECIFIED_NIC_TYPE', + self::VIRTIO_NET => 'VIRTIO_NET', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NicType::class, \Google\Cloud\Compute\V1\NetworkInterface_NicType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkInterface/StackType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkInterface/StackType.php new file mode 100644 index 000000000000..2f5d9ca37945 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkInterface/StackType.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.NetworkInterface.StackType + */ +class StackType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STACK_TYPE = 0; + */ + const UNDEFINED_STACK_TYPE = 0; + /** + * The network interface can have both IPv4 and IPv6 addresses. + * + * Generated from protobuf enum IPV4_IPV6 = 22197249; + */ + const IPV4_IPV6 = 22197249; + /** + * The network interface will be assigned IPv4 address. + * + * Generated from protobuf enum IPV4_ONLY = 22373798; + */ + const IPV4_ONLY = 22373798; + /** + * Generated from protobuf enum UNSPECIFIED_STACK_TYPE = 298084569; + */ + const UNSPECIFIED_STACK_TYPE = 298084569; + + private static $valueToName = [ + self::UNDEFINED_STACK_TYPE => 'UNDEFINED_STACK_TYPE', + self::IPV4_IPV6 => 'IPV4_IPV6', + self::IPV4_ONLY => 'IPV4_ONLY', + self::UNSPECIFIED_STACK_TYPE => 'UNSPECIFIED_STACK_TYPE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StackType::class, \Google\Cloud\Compute\V1\NetworkInterface_StackType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkList.php new file mode 100644 index 000000000000..bdce11a10503 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.NetworkList + */ +class NetworkList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of Network resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Network items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#networkList for lists of networks. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\Network>|\Google\Protobuf\Internal\RepeatedField $items + * A list of Network resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#networkList for lists of networks. + * @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 Network resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Network items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of Network resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Network items = 100526016; + * @param array<\Google\Cloud\Compute\V1\Network>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Network::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#networkList for lists of networks. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#networkList for lists of networks. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkPeering.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkPeering.php new file mode 100644 index 000000000000..15acd5bf566a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkPeering.php @@ -0,0 +1,569 @@ +google.cloud.compute.v1.NetworkPeering + */ +class NetworkPeering extends \Google\Protobuf\Internal\Message +{ + /** + * This field will be deprecated soon. Use the exchange_subnet_routes field instead. Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE. + * + * Generated from protobuf field optional bool auto_create_routes = 57454941; + */ + protected $auto_create_routes = null; + /** + * Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE. + * + * Generated from protobuf field optional bool exchange_subnet_routes = 26322256; + */ + protected $exchange_subnet_routes = null; + /** + * Whether to export the custom routes to peer network. The default value is false. + * + * Generated from protobuf field optional bool export_custom_routes = 60281485; + */ + protected $export_custom_routes = null; + /** + * Whether subnet routes with public IP range are exported. The default value is true, all subnet routes are exported. IPv4 special-use ranges are always exported to peers and are not controlled by this field. + * + * Generated from protobuf field optional bool export_subnet_routes_with_public_ip = 97940834; + */ + protected $export_subnet_routes_with_public_ip = null; + /** + * Whether to import the custom routes from peer network. The default value is false. + * + * Generated from protobuf field optional bool import_custom_routes = 197982398; + */ + protected $import_custom_routes = null; + /** + * Whether subnet routes with public IP range are imported. The default value is false. IPv4 special-use ranges are always imported from peers and are not controlled by this field. + * + * Generated from protobuf field optional bool import_subnet_routes_with_public_ip = 14419729; + */ + protected $import_subnet_routes_with_public_ip = null; + /** + * Name of this peering. Provided by the client when the peering is created. The name must comply with RFC1035. Specifically, the name must be 1-63 characters long and match regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a lowercase letter, and all the following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * The URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network. + * + * Generated from protobuf field optional string network = 232872494; + */ + protected $network = null; + /** + * Maximum Transmission Unit in bytes. + * + * Generated from protobuf field optional int32 peer_mtu = 69584721; + */ + protected $peer_mtu = null; + /** + * Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY. + * Check the StackType enum for the list of possible values. + * + * Generated from protobuf field optional string stack_type = 425908881; + */ + protected $stack_type = null; + /** + * [Output Only] State for the peering, either `ACTIVE` or `INACTIVE`. The peering is `ACTIVE` when there's a matching configuration in the peer network. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + */ + protected $state = null; + /** + * [Output Only] Details about the current state of the peering. + * + * Generated from protobuf field optional string state_details = 95566996; + */ + protected $state_details = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $auto_create_routes + * This field will be deprecated soon. Use the exchange_subnet_routes field instead. Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE. + * @type bool $exchange_subnet_routes + * Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE. + * @type bool $export_custom_routes + * Whether to export the custom routes to peer network. The default value is false. + * @type bool $export_subnet_routes_with_public_ip + * Whether subnet routes with public IP range are exported. The default value is true, all subnet routes are exported. IPv4 special-use ranges are always exported to peers and are not controlled by this field. + * @type bool $import_custom_routes + * Whether to import the custom routes from peer network. The default value is false. + * @type bool $import_subnet_routes_with_public_ip + * Whether subnet routes with public IP range are imported. The default value is false. IPv4 special-use ranges are always imported from peers and are not controlled by this field. + * @type string $name + * Name of this peering. Provided by the client when the peering is created. The name must comply with RFC1035. Specifically, the name must be 1-63 characters long and match regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a lowercase letter, and all the following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + * @type string $network + * The URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network. + * @type int $peer_mtu + * Maximum Transmission Unit in bytes. + * @type string $stack_type + * Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY. + * Check the StackType enum for the list of possible values. + * @type string $state + * [Output Only] State for the peering, either `ACTIVE` or `INACTIVE`. The peering is `ACTIVE` when there's a matching configuration in the peer network. + * Check the State enum for the list of possible values. + * @type string $state_details + * [Output Only] Details about the current state of the peering. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * This field will be deprecated soon. Use the exchange_subnet_routes field instead. Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE. + * + * Generated from protobuf field optional bool auto_create_routes = 57454941; + * @return bool + */ + public function getAutoCreateRoutes() + { + return isset($this->auto_create_routes) ? $this->auto_create_routes : false; + } + + public function hasAutoCreateRoutes() + { + return isset($this->auto_create_routes); + } + + public function clearAutoCreateRoutes() + { + unset($this->auto_create_routes); + } + + /** + * This field will be deprecated soon. Use the exchange_subnet_routes field instead. Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE. + * + * Generated from protobuf field optional bool auto_create_routes = 57454941; + * @param bool $var + * @return $this + */ + public function setAutoCreateRoutes($var) + { + GPBUtil::checkBool($var); + $this->auto_create_routes = $var; + + return $this; + } + + /** + * Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE. + * + * Generated from protobuf field optional bool exchange_subnet_routes = 26322256; + * @return bool + */ + public function getExchangeSubnetRoutes() + { + return isset($this->exchange_subnet_routes) ? $this->exchange_subnet_routes : false; + } + + public function hasExchangeSubnetRoutes() + { + return isset($this->exchange_subnet_routes); + } + + public function clearExchangeSubnetRoutes() + { + unset($this->exchange_subnet_routes); + } + + /** + * Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE. + * + * Generated from protobuf field optional bool exchange_subnet_routes = 26322256; + * @param bool $var + * @return $this + */ + public function setExchangeSubnetRoutes($var) + { + GPBUtil::checkBool($var); + $this->exchange_subnet_routes = $var; + + return $this; + } + + /** + * Whether to export the custom routes to peer network. The default value is false. + * + * Generated from protobuf field optional bool export_custom_routes = 60281485; + * @return bool + */ + public function getExportCustomRoutes() + { + return isset($this->export_custom_routes) ? $this->export_custom_routes : false; + } + + public function hasExportCustomRoutes() + { + return isset($this->export_custom_routes); + } + + public function clearExportCustomRoutes() + { + unset($this->export_custom_routes); + } + + /** + * Whether to export the custom routes to peer network. The default value is false. + * + * Generated from protobuf field optional bool export_custom_routes = 60281485; + * @param bool $var + * @return $this + */ + public function setExportCustomRoutes($var) + { + GPBUtil::checkBool($var); + $this->export_custom_routes = $var; + + return $this; + } + + /** + * Whether subnet routes with public IP range are exported. The default value is true, all subnet routes are exported. IPv4 special-use ranges are always exported to peers and are not controlled by this field. + * + * Generated from protobuf field optional bool export_subnet_routes_with_public_ip = 97940834; + * @return bool + */ + public function getExportSubnetRoutesWithPublicIp() + { + return isset($this->export_subnet_routes_with_public_ip) ? $this->export_subnet_routes_with_public_ip : false; + } + + public function hasExportSubnetRoutesWithPublicIp() + { + return isset($this->export_subnet_routes_with_public_ip); + } + + public function clearExportSubnetRoutesWithPublicIp() + { + unset($this->export_subnet_routes_with_public_ip); + } + + /** + * Whether subnet routes with public IP range are exported. The default value is true, all subnet routes are exported. IPv4 special-use ranges are always exported to peers and are not controlled by this field. + * + * Generated from protobuf field optional bool export_subnet_routes_with_public_ip = 97940834; + * @param bool $var + * @return $this + */ + public function setExportSubnetRoutesWithPublicIp($var) + { + GPBUtil::checkBool($var); + $this->export_subnet_routes_with_public_ip = $var; + + return $this; + } + + /** + * Whether to import the custom routes from peer network. The default value is false. + * + * Generated from protobuf field optional bool import_custom_routes = 197982398; + * @return bool + */ + public function getImportCustomRoutes() + { + return isset($this->import_custom_routes) ? $this->import_custom_routes : false; + } + + public function hasImportCustomRoutes() + { + return isset($this->import_custom_routes); + } + + public function clearImportCustomRoutes() + { + unset($this->import_custom_routes); + } + + /** + * Whether to import the custom routes from peer network. The default value is false. + * + * Generated from protobuf field optional bool import_custom_routes = 197982398; + * @param bool $var + * @return $this + */ + public function setImportCustomRoutes($var) + { + GPBUtil::checkBool($var); + $this->import_custom_routes = $var; + + return $this; + } + + /** + * Whether subnet routes with public IP range are imported. The default value is false. IPv4 special-use ranges are always imported from peers and are not controlled by this field. + * + * Generated from protobuf field optional bool import_subnet_routes_with_public_ip = 14419729; + * @return bool + */ + public function getImportSubnetRoutesWithPublicIp() + { + return isset($this->import_subnet_routes_with_public_ip) ? $this->import_subnet_routes_with_public_ip : false; + } + + public function hasImportSubnetRoutesWithPublicIp() + { + return isset($this->import_subnet_routes_with_public_ip); + } + + public function clearImportSubnetRoutesWithPublicIp() + { + unset($this->import_subnet_routes_with_public_ip); + } + + /** + * Whether subnet routes with public IP range are imported. The default value is false. IPv4 special-use ranges are always imported from peers and are not controlled by this field. + * + * Generated from protobuf field optional bool import_subnet_routes_with_public_ip = 14419729; + * @param bool $var + * @return $this + */ + public function setImportSubnetRoutesWithPublicIp($var) + { + GPBUtil::checkBool($var); + $this->import_subnet_routes_with_public_ip = $var; + + return $this; + } + + /** + * Name of this peering. Provided by the client when the peering is created. The name must comply with RFC1035. Specifically, the name must be 1-63 characters long and match regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a lowercase letter, and all the following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + * + * 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); + } + + /** + * Name of this peering. Provided by the client when the peering is created. The name must comply with RFC1035. Specifically, the name must be 1-63 characters long and match regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a lowercase letter, and all the following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + * + * 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; + } + + /** + * The URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network. + * + * Generated from protobuf field optional string network = 232872494; + * @return string + */ + public function getNetwork() + { + return isset($this->network) ? $this->network : ''; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * The URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network. + * + * Generated from protobuf field optional string network = 232872494; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Maximum Transmission Unit in bytes. + * + * Generated from protobuf field optional int32 peer_mtu = 69584721; + * @return int + */ + public function getPeerMtu() + { + return isset($this->peer_mtu) ? $this->peer_mtu : 0; + } + + public function hasPeerMtu() + { + return isset($this->peer_mtu); + } + + public function clearPeerMtu() + { + unset($this->peer_mtu); + } + + /** + * Maximum Transmission Unit in bytes. + * + * Generated from protobuf field optional int32 peer_mtu = 69584721; + * @param int $var + * @return $this + */ + public function setPeerMtu($var) + { + GPBUtil::checkInt32($var); + $this->peer_mtu = $var; + + return $this; + } + + /** + * Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY. + * Check the StackType enum for the list of possible values. + * + * Generated from protobuf field optional string stack_type = 425908881; + * @return string + */ + public function getStackType() + { + return isset($this->stack_type) ? $this->stack_type : ''; + } + + public function hasStackType() + { + return isset($this->stack_type); + } + + public function clearStackType() + { + unset($this->stack_type); + } + + /** + * Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY. + * Check the StackType enum for the list of possible values. + * + * Generated from protobuf field optional string stack_type = 425908881; + * @param string $var + * @return $this + */ + public function setStackType($var) + { + GPBUtil::checkString($var, True); + $this->stack_type = $var; + + return $this; + } + + /** + * [Output Only] State for the peering, either `ACTIVE` or `INACTIVE`. The peering is `ACTIVE` when there's a matching configuration in the peer network. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @return string + */ + public function getState() + { + return isset($this->state) ? $this->state : ''; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * [Output Only] State for the peering, either `ACTIVE` or `INACTIVE`. The peering is `ACTIVE` when there's a matching configuration in the peer network. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + + /** + * [Output Only] Details about the current state of the peering. + * + * Generated from protobuf field optional string state_details = 95566996; + * @return string + */ + public function getStateDetails() + { + return isset($this->state_details) ? $this->state_details : ''; + } + + public function hasStateDetails() + { + return isset($this->state_details); + } + + public function clearStateDetails() + { + unset($this->state_details); + } + + /** + * [Output Only] Details about the current state of the peering. + * + * Generated from protobuf field optional string state_details = 95566996; + * @param string $var + * @return $this + */ + public function setStateDetails($var) + { + GPBUtil::checkString($var, True); + $this->state_details = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkPeering/StackType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkPeering/StackType.php new file mode 100644 index 000000000000..c2446e4adc4c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkPeering/StackType.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.NetworkPeering.StackType + */ +class StackType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STACK_TYPE = 0; + */ + const UNDEFINED_STACK_TYPE = 0; + /** + * This Peering will allow IPv4 traffic and routes to be exchanged. Additionally if the matching peering is IPV4_IPV6, IPv6 traffic and routes will be exchanged as well. + * + * Generated from protobuf enum IPV4_IPV6 = 22197249; + */ + const IPV4_IPV6 = 22197249; + /** + * This Peering will only allow IPv4 traffic and routes to be exchanged, even if the matching peering is IPV4_IPV6. + * + * Generated from protobuf enum IPV4_ONLY = 22373798; + */ + const IPV4_ONLY = 22373798; + + private static $valueToName = [ + self::UNDEFINED_STACK_TYPE => 'UNDEFINED_STACK_TYPE', + self::IPV4_IPV6 => 'IPV4_IPV6', + self::IPV4_ONLY => 'IPV4_ONLY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StackType::class, \Google\Cloud\Compute\V1\NetworkPeering_StackType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkPeering/State.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkPeering/State.php new file mode 100644 index 000000000000..53ae9dd0c0a7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkPeering/State.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.NetworkPeering.State + */ +class State +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATE = 0; + */ + const UNDEFINED_STATE = 0; + /** + * Matching configuration exists on the peer. + * + * Generated from protobuf enum ACTIVE = 314733318; + */ + const ACTIVE = 314733318; + /** + * There is no matching configuration on the peer, including the case when peer does not exist. + * + * Generated from protobuf enum INACTIVE = 270421099; + */ + const INACTIVE = 270421099; + + private static $valueToName = [ + self::UNDEFINED_STATE => 'UNDEFINED_STATE', + self::ACTIVE => 'ACTIVE', + self::INACTIVE => 'INACTIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Compute\V1\NetworkPeering_State::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkPerformanceConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkPerformanceConfig.php new file mode 100644 index 000000000000..03426af1668f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkPerformanceConfig.php @@ -0,0 +1,80 @@ +google.cloud.compute.v1.NetworkPerformanceConfig + */ +class NetworkPerformanceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * + * Check the TotalEgressBandwidthTier enum for the list of possible values. + * + * Generated from protobuf field optional string total_egress_bandwidth_tier = 130109439; + */ + protected $total_egress_bandwidth_tier = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $total_egress_bandwidth_tier + * + * Check the TotalEgressBandwidthTier enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * + * Check the TotalEgressBandwidthTier enum for the list of possible values. + * + * Generated from protobuf field optional string total_egress_bandwidth_tier = 130109439; + * @return string + */ + public function getTotalEgressBandwidthTier() + { + return isset($this->total_egress_bandwidth_tier) ? $this->total_egress_bandwidth_tier : ''; + } + + public function hasTotalEgressBandwidthTier() + { + return isset($this->total_egress_bandwidth_tier); + } + + public function clearTotalEgressBandwidthTier() + { + unset($this->total_egress_bandwidth_tier); + } + + /** + * + * Check the TotalEgressBandwidthTier enum for the list of possible values. + * + * Generated from protobuf field optional string total_egress_bandwidth_tier = 130109439; + * @param string $var + * @return $this + */ + public function setTotalEgressBandwidthTier($var) + { + GPBUtil::checkString($var, True); + $this->total_egress_bandwidth_tier = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkPerformanceConfig/TotalEgressBandwidthTier.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkPerformanceConfig/TotalEgressBandwidthTier.php new file mode 100644 index 000000000000..b079be0fd3fb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkPerformanceConfig/TotalEgressBandwidthTier.php @@ -0,0 +1,63 @@ +google.cloud.compute.v1.NetworkPerformanceConfig.TotalEgressBandwidthTier + */ +class TotalEgressBandwidthTier +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TOTAL_EGRESS_BANDWIDTH_TIER = 0; + */ + const UNDEFINED_TOTAL_EGRESS_BANDWIDTH_TIER = 0; + /** + * Generated from protobuf enum DEFAULT = 115302945; + */ + const PBDEFAULT = 115302945; + /** + * Generated from protobuf enum TIER_1 = 326919444; + */ + const TIER_1 = 326919444; + + private static $valueToName = [ + self::UNDEFINED_TOTAL_EGRESS_BANDWIDTH_TIER => 'UNDEFINED_TOTAL_EGRESS_BANDWIDTH_TIER', + self::PBDEFAULT => 'DEFAULT', + self::TIER_1 => 'TIER_1', + ]; + + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TotalEgressBandwidthTier::class, \Google\Cloud\Compute\V1\NetworkPerformanceConfig_TotalEgressBandwidthTier::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkRoutingConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkRoutingConfig.php new file mode 100644 index 000000000000..035a63641744 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkRoutingConfig.php @@ -0,0 +1,81 @@ +google.cloud.compute.v1.NetworkRoutingConfig + */ +class NetworkRoutingConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The network-wide routing mode to use. If set to REGIONAL, this network's Cloud Routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network's Cloud Routers will advertise routes with all subnets of this network, across regions. + * Check the RoutingMode enum for the list of possible values. + * + * Generated from protobuf field optional string routing_mode = 475143548; + */ + protected $routing_mode = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $routing_mode + * The network-wide routing mode to use. If set to REGIONAL, this network's Cloud Routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network's Cloud Routers will advertise routes with all subnets of this network, across regions. + * Check the RoutingMode enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The network-wide routing mode to use. If set to REGIONAL, this network's Cloud Routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network's Cloud Routers will advertise routes with all subnets of this network, across regions. + * Check the RoutingMode enum for the list of possible values. + * + * Generated from protobuf field optional string routing_mode = 475143548; + * @return string + */ + public function getRoutingMode() + { + return isset($this->routing_mode) ? $this->routing_mode : ''; + } + + public function hasRoutingMode() + { + return isset($this->routing_mode); + } + + public function clearRoutingMode() + { + unset($this->routing_mode); + } + + /** + * The network-wide routing mode to use. If set to REGIONAL, this network's Cloud Routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network's Cloud Routers will advertise routes with all subnets of this network, across regions. + * Check the RoutingMode enum for the list of possible values. + * + * Generated from protobuf field optional string routing_mode = 475143548; + * @param string $var + * @return $this + */ + public function setRoutingMode($var) + { + GPBUtil::checkString($var, True); + $this->routing_mode = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkRoutingConfig/RoutingMode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkRoutingConfig/RoutingMode.php new file mode 100644 index 000000000000..0a7b602a257b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkRoutingConfig/RoutingMode.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.NetworkRoutingConfig.RoutingMode + */ +class RoutingMode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ROUTING_MODE = 0; + */ + const UNDEFINED_ROUTING_MODE = 0; + /** + * Generated from protobuf enum GLOBAL = 494663587; + */ + const PBGLOBAL = 494663587; + /** + * Generated from protobuf enum REGIONAL = 92288543; + */ + const REGIONAL = 92288543; + + private static $valueToName = [ + self::UNDEFINED_ROUTING_MODE => 'UNDEFINED_ROUTING_MODE', + self::PBGLOBAL => 'GLOBAL', + self::REGIONAL => 'REGIONAL', + ]; + + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RoutingMode::class, \Google\Cloud\Compute\V1\NetworkRoutingConfig_RoutingMode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksAddPeeringRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksAddPeeringRequest.php new file mode 100644 index 000000000000..acb5972a02e3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksAddPeeringRequest.php @@ -0,0 +1,208 @@ +google.cloud.compute.v1.NetworksAddPeeringRequest + */ +class NetworksAddPeeringRequest extends \Google\Protobuf\Internal\Message +{ + /** + * This field will be deprecated soon. Use exchange_subnet_routes in network_peering instead. Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE. + * + * Generated from protobuf field optional bool auto_create_routes = 57454941; + */ + protected $auto_create_routes = null; + /** + * Name of the peering, which should conform to RFC1035. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Network peering parameters. In order to specify route policies for peering using import and export custom routes, you must specify all peering related parameters (name, peer network, exchange_subnet_routes) in the network_peering field. The corresponding fields in NetworksAddPeeringRequest will be deprecated soon. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkPeering network_peering = 328926767; + */ + protected $network_peering = null; + /** + * URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network. + * + * Generated from protobuf field optional string peer_network = 500625489; + */ + protected $peer_network = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $auto_create_routes + * This field will be deprecated soon. Use exchange_subnet_routes in network_peering instead. Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE. + * @type string $name + * Name of the peering, which should conform to RFC1035. + * @type \Google\Cloud\Compute\V1\NetworkPeering $network_peering + * Network peering parameters. In order to specify route policies for peering using import and export custom routes, you must specify all peering related parameters (name, peer network, exchange_subnet_routes) in the network_peering field. The corresponding fields in NetworksAddPeeringRequest will be deprecated soon. + * @type string $peer_network + * URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * This field will be deprecated soon. Use exchange_subnet_routes in network_peering instead. Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE. + * + * Generated from protobuf field optional bool auto_create_routes = 57454941; + * @return bool + */ + public function getAutoCreateRoutes() + { + return isset($this->auto_create_routes) ? $this->auto_create_routes : false; + } + + public function hasAutoCreateRoutes() + { + return isset($this->auto_create_routes); + } + + public function clearAutoCreateRoutes() + { + unset($this->auto_create_routes); + } + + /** + * This field will be deprecated soon. Use exchange_subnet_routes in network_peering instead. Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE. + * + * Generated from protobuf field optional bool auto_create_routes = 57454941; + * @param bool $var + * @return $this + */ + public function setAutoCreateRoutes($var) + { + GPBUtil::checkBool($var); + $this->auto_create_routes = $var; + + return $this; + } + + /** + * Name of the peering, which should conform to RFC1035. + * + * 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); + } + + /** + * Name of the peering, which should conform to RFC1035. + * + * 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; + } + + /** + * Network peering parameters. In order to specify route policies for peering using import and export custom routes, you must specify all peering related parameters (name, peer network, exchange_subnet_routes) in the network_peering field. The corresponding fields in NetworksAddPeeringRequest will be deprecated soon. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkPeering network_peering = 328926767; + * @return \Google\Cloud\Compute\V1\NetworkPeering|null + */ + public function getNetworkPeering() + { + return $this->network_peering; + } + + public function hasNetworkPeering() + { + return isset($this->network_peering); + } + + public function clearNetworkPeering() + { + unset($this->network_peering); + } + + /** + * Network peering parameters. In order to specify route policies for peering using import and export custom routes, you must specify all peering related parameters (name, peer network, exchange_subnet_routes) in the network_peering field. The corresponding fields in NetworksAddPeeringRequest will be deprecated soon. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkPeering network_peering = 328926767; + * @param \Google\Cloud\Compute\V1\NetworkPeering $var + * @return $this + */ + public function setNetworkPeering($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkPeering::class); + $this->network_peering = $var; + + return $this; + } + + /** + * URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network. + * + * Generated from protobuf field optional string peer_network = 500625489; + * @return string + */ + public function getPeerNetwork() + { + return isset($this->peer_network) ? $this->peer_network : ''; + } + + public function hasPeerNetwork() + { + return isset($this->peer_network); + } + + public function clearPeerNetwork() + { + unset($this->peer_network); + } + + /** + * URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network. + * + * Generated from protobuf field optional string peer_network = 500625489; + * @param string $var + * @return $this + */ + public function setPeerNetwork($var) + { + GPBUtil::checkString($var, True); + $this->peer_network = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksGetEffectiveFirewallsResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksGetEffectiveFirewallsResponse.php new file mode 100644 index 000000000000..a478968c2216 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksGetEffectiveFirewallsResponse.php @@ -0,0 +1,100 @@ +google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse + */ +class NetworksGetEffectiveFirewallsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Effective firewalls from firewall policy. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy firewall_policys = 410985794; + */ + private $firewall_policys; + /** + * Effective firewalls on the network. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Firewall firewalls = 272245619; + */ + private $firewalls; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy>|\Google\Protobuf\Internal\RepeatedField $firewall_policys + * Effective firewalls from firewall policy. + * @type array<\Google\Cloud\Compute\V1\Firewall>|\Google\Protobuf\Internal\RepeatedField $firewalls + * Effective firewalls on the network. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Effective firewalls from firewall policy. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy firewall_policys = 410985794; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFirewallPolicys() + { + return $this->firewall_policys; + } + + /** + * Effective firewalls from firewall policy. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy firewall_policys = 410985794; + * @param array<\Google\Cloud\Compute\V1\NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFirewallPolicys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy::class); + $this->firewall_policys = $arr; + + return $this; + } + + /** + * Effective firewalls on the network. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Firewall firewalls = 272245619; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFirewalls() + { + return $this->firewalls; + } + + /** + * Effective firewalls on the network. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Firewall firewalls = 272245619; + * @param array<\Google\Cloud\Compute\V1\Firewall>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFirewalls($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Firewall::class); + $this->firewalls = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.php new file mode 100644 index 000000000000..2d456fcb13e9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.php @@ -0,0 +1,246 @@ +google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + */ +class NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Deprecated, please use short name instead. The display name of the firewall policy. + * + * Generated from protobuf field optional string display_name = 4473832; + */ + protected $display_name = null; + /** + * [Output Only] The name of the firewall policy. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * The rules that apply to the network. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyRule rules = 108873975; + */ + private $rules; + /** + * [Output Only] The short name of the firewall policy. + * + * Generated from protobuf field optional string short_name = 492051566; + */ + protected $short_name = null; + /** + * [Output Only] The type of the firewall policy. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * [Output Only] Deprecated, please use short name instead. The display name of the firewall policy. + * @type string $name + * [Output Only] The name of the firewall policy. + * @type array<\Google\Cloud\Compute\V1\FirewallPolicyRule>|\Google\Protobuf\Internal\RepeatedField $rules + * The rules that apply to the network. + * @type string $short_name + * [Output Only] The short name of the firewall policy. + * @type string $type + * [Output Only] The type of the firewall policy. + * Check the Type enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Deprecated, please use short name instead. The display name of the firewall policy. + * + * Generated from protobuf field optional string display_name = 4473832; + * @return string + */ + public function getDisplayName() + { + return isset($this->display_name) ? $this->display_name : ''; + } + + public function hasDisplayName() + { + return isset($this->display_name); + } + + public function clearDisplayName() + { + unset($this->display_name); + } + + /** + * [Output Only] Deprecated, please use short name instead. The display name of the firewall policy. + * + * Generated from protobuf field optional string display_name = 4473832; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * [Output Only] The name of the firewall policy. + * + * 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); + } + + /** + * [Output Only] The name of the firewall policy. + * + * 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; + } + + /** + * The rules that apply to the network. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyRule rules = 108873975; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * The rules that apply to the network. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyRule rules = 108873975; + * @param array<\Google\Cloud\Compute\V1\FirewallPolicyRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\FirewallPolicyRule::class); + $this->rules = $arr; + + return $this; + } + + /** + * [Output Only] The short name of the firewall policy. + * + * Generated from protobuf field optional string short_name = 492051566; + * @return string + */ + public function getShortName() + { + return isset($this->short_name) ? $this->short_name : ''; + } + + public function hasShortName() + { + return isset($this->short_name); + } + + public function clearShortName() + { + unset($this->short_name); + } + + /** + * [Output Only] The short name of the firewall policy. + * + * Generated from protobuf field optional string short_name = 492051566; + * @param string $var + * @return $this + */ + public function setShortName($var) + { + GPBUtil::checkString($var, True); + $this->short_name = $var; + + return $this; + } + + /** + * [Output Only] The type of the firewall policy. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * [Output Only] The type of the firewall policy. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy/Type.php new file mode 100644 index 000000000000..83299c3ee207 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy/Type.php @@ -0,0 +1,65 @@ +google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.Type + */ +class Type +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TYPE = 0; + */ + const UNDEFINED_TYPE = 0; + /** + * Generated from protobuf enum HIERARCHY = 69902869; + */ + const HIERARCHY = 69902869; + /** + * Generated from protobuf enum NETWORK = 413984270; + */ + const NETWORK = 413984270; + /** + * Generated from protobuf enum UNSPECIFIED = 526786327; + */ + const UNSPECIFIED = 526786327; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::HIERARCHY => 'HIERARCHY', + self::NETWORK => 'NETWORK', + self::UNSPECIFIED => 'UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Compute\V1\NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy_Type::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksRemovePeeringRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksRemovePeeringRequest.php new file mode 100644 index 000000000000..75ad9fb8e25e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksRemovePeeringRequest.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.NetworksRemovePeeringRequest + */ +class NetworksRemovePeeringRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the peering, which should conform to RFC1035. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of the peering, which should conform to RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the peering, which should conform to RFC1035. + * + * 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); + } + + /** + * Name of the peering, which should conform to RFC1035. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksUpdatePeeringRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksUpdatePeeringRequest.php new file mode 100644 index 000000000000..8401cbbec22a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksUpdatePeeringRequest.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.NetworksUpdatePeeringRequest + */ +class NetworksUpdatePeeringRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkPeering network_peering = 328926767; + */ + protected $network_peering = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\NetworkPeering $network_peering + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkPeering network_peering = 328926767; + * @return \Google\Cloud\Compute\V1\NetworkPeering|null + */ + public function getNetworkPeering() + { + return $this->network_peering; + } + + public function hasNetworkPeering() + { + return isset($this->network_peering); + } + + public function clearNetworkPeering() + { + unset($this->network_peering); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkPeering network_peering = 328926767; + * @param \Google\Cloud\Compute\V1\NetworkPeering $var + * @return $this + */ + public function setNetworkPeering($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkPeering::class); + $this->network_peering = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroup.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroup.php new file mode 100644 index 000000000000..afe1f13bd874 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroup.php @@ -0,0 +1,779 @@ +google.cloud.compute.v1.NodeGroup + */ +class NodeGroup extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies how autoscaling should behave. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NodeGroupAutoscalingPolicy autoscaling_policy = 221950041; + */ + protected $autoscaling_policy = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] The type of the resource. Always compute#nodeGroup for node group. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * An opaque location hint used to place the Node close to other resources. This field is for use by internal tools that use the public API. The location hint here on the NodeGroup overrides any location_hint present in the NodeTemplate. + * + * Generated from protobuf field optional string location_hint = 350519505; + */ + protected $location_hint = null; + /** + * Specifies the frequency of planned maintenance events. The accepted values are: `AS_NEEDED` and `RECURRENT`. + * Check the MaintenanceInterval enum for the list of possible values. + * + * Generated from protobuf field optional string maintenance_interval = 403368049; + */ + protected $maintenance_interval = null; + /** + * Specifies how to handle instances when a node in the group undergoes maintenance. Set to one of: DEFAULT, RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP. The default value is DEFAULT. For more information, see Maintenance policies. + * Check the MaintenancePolicy enum for the list of possible values. + * + * Generated from protobuf field optional string maintenance_policy = 528327646; + */ + protected $maintenance_policy = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.NodeGroupMaintenanceWindow maintenance_window = 186374812; + */ + protected $maintenance_window = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * URL of the node template to create the node group from. + * + * Generated from protobuf field optional string node_template = 323154455; + */ + protected $node_template = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * Share-settings for the node group + * + * Generated from protobuf field optional .google.cloud.compute.v1.ShareSettings share_settings = 266668163; + */ + protected $share_settings = null; + /** + * [Output Only] The total number of nodes in the node group. + * + * Generated from protobuf field optional int32 size = 3530753; + */ + protected $size = null; + /** + * + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + /** + * [Output Only] The name of the zone where the node group resides, such as us-central1-a. + * + * Generated from protobuf field optional string zone = 3744684; + */ + protected $zone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\NodeGroupAutoscalingPolicy $autoscaling_policy + * Specifies how autoscaling should behave. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type string $fingerprint + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] The type of the resource. Always compute#nodeGroup for node group. + * @type string $location_hint + * An opaque location hint used to place the Node close to other resources. This field is for use by internal tools that use the public API. The location hint here on the NodeGroup overrides any location_hint present in the NodeTemplate. + * @type string $maintenance_interval + * Specifies the frequency of planned maintenance events. The accepted values are: `AS_NEEDED` and `RECURRENT`. + * Check the MaintenanceInterval enum for the list of possible values. + * @type string $maintenance_policy + * Specifies how to handle instances when a node in the group undergoes maintenance. Set to one of: DEFAULT, RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP. The default value is DEFAULT. For more information, see Maintenance policies. + * Check the MaintenancePolicy enum for the list of possible values. + * @type \Google\Cloud\Compute\V1\NodeGroupMaintenanceWindow $maintenance_window + * @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 string $node_template + * URL of the node template to create the node group from. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type \Google\Cloud\Compute\V1\ShareSettings $share_settings + * Share-settings for the node group + * @type int $size + * [Output Only] The total number of nodes in the node group. + * @type string $status + * + * Check the Status enum for the list of possible values. + * @type string $zone + * [Output Only] The name of the zone where the node group resides, such as us-central1-a. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies how autoscaling should behave. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NodeGroupAutoscalingPolicy autoscaling_policy = 221950041; + * @return \Google\Cloud\Compute\V1\NodeGroupAutoscalingPolicy|null + */ + public function getAutoscalingPolicy() + { + return $this->autoscaling_policy; + } + + public function hasAutoscalingPolicy() + { + return isset($this->autoscaling_policy); + } + + public function clearAutoscalingPolicy() + { + unset($this->autoscaling_policy); + } + + /** + * Specifies how autoscaling should behave. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NodeGroupAutoscalingPolicy autoscaling_policy = 221950041; + * @param \Google\Cloud\Compute\V1\NodeGroupAutoscalingPolicy $var + * @return $this + */ + public function setAutoscalingPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NodeGroupAutoscalingPolicy::class); + $this->autoscaling_policy = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] The type of the resource. Always compute#nodeGroup for node group. + * + * 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); + } + + /** + * [Output Only] The type of the resource. Always compute#nodeGroup for node group. + * + * 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; + } + + /** + * An opaque location hint used to place the Node close to other resources. This field is for use by internal tools that use the public API. The location hint here on the NodeGroup overrides any location_hint present in the NodeTemplate. + * + * Generated from protobuf field optional string location_hint = 350519505; + * @return string + */ + public function getLocationHint() + { + return isset($this->location_hint) ? $this->location_hint : ''; + } + + public function hasLocationHint() + { + return isset($this->location_hint); + } + + public function clearLocationHint() + { + unset($this->location_hint); + } + + /** + * An opaque location hint used to place the Node close to other resources. This field is for use by internal tools that use the public API. The location hint here on the NodeGroup overrides any location_hint present in the NodeTemplate. + * + * Generated from protobuf field optional string location_hint = 350519505; + * @param string $var + * @return $this + */ + public function setLocationHint($var) + { + GPBUtil::checkString($var, True); + $this->location_hint = $var; + + return $this; + } + + /** + * Specifies the frequency of planned maintenance events. The accepted values are: `AS_NEEDED` and `RECURRENT`. + * Check the MaintenanceInterval enum for the list of possible values. + * + * Generated from protobuf field optional string maintenance_interval = 403368049; + * @return string + */ + public function getMaintenanceInterval() + { + return isset($this->maintenance_interval) ? $this->maintenance_interval : ''; + } + + public function hasMaintenanceInterval() + { + return isset($this->maintenance_interval); + } + + public function clearMaintenanceInterval() + { + unset($this->maintenance_interval); + } + + /** + * Specifies the frequency of planned maintenance events. The accepted values are: `AS_NEEDED` and `RECURRENT`. + * Check the MaintenanceInterval enum for the list of possible values. + * + * Generated from protobuf field optional string maintenance_interval = 403368049; + * @param string $var + * @return $this + */ + public function setMaintenanceInterval($var) + { + GPBUtil::checkString($var, True); + $this->maintenance_interval = $var; + + return $this; + } + + /** + * Specifies how to handle instances when a node in the group undergoes maintenance. Set to one of: DEFAULT, RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP. The default value is DEFAULT. For more information, see Maintenance policies. + * Check the MaintenancePolicy enum for the list of possible values. + * + * Generated from protobuf field optional string maintenance_policy = 528327646; + * @return string + */ + public function getMaintenancePolicy() + { + return isset($this->maintenance_policy) ? $this->maintenance_policy : ''; + } + + public function hasMaintenancePolicy() + { + return isset($this->maintenance_policy); + } + + public function clearMaintenancePolicy() + { + unset($this->maintenance_policy); + } + + /** + * Specifies how to handle instances when a node in the group undergoes maintenance. Set to one of: DEFAULT, RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP. The default value is DEFAULT. For more information, see Maintenance policies. + * Check the MaintenancePolicy enum for the list of possible values. + * + * Generated from protobuf field optional string maintenance_policy = 528327646; + * @param string $var + * @return $this + */ + public function setMaintenancePolicy($var) + { + GPBUtil::checkString($var, True); + $this->maintenance_policy = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.NodeGroupMaintenanceWindow maintenance_window = 186374812; + * @return \Google\Cloud\Compute\V1\NodeGroupMaintenanceWindow|null + */ + public function getMaintenanceWindow() + { + return $this->maintenance_window; + } + + public function hasMaintenanceWindow() + { + return isset($this->maintenance_window); + } + + public function clearMaintenanceWindow() + { + unset($this->maintenance_window); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.NodeGroupMaintenanceWindow maintenance_window = 186374812; + * @param \Google\Cloud\Compute\V1\NodeGroupMaintenanceWindow $var + * @return $this + */ + public function setMaintenanceWindow($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NodeGroupMaintenanceWindow::class); + $this->maintenance_window = $var; + + return $this; + } + + /** + * 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. + * + * 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 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. + * + * 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; + } + + /** + * URL of the node template to create the node group from. + * + * Generated from protobuf field optional string node_template = 323154455; + * @return string + */ + public function getNodeTemplate() + { + return isset($this->node_template) ? $this->node_template : ''; + } + + public function hasNodeTemplate() + { + return isset($this->node_template); + } + + public function clearNodeTemplate() + { + unset($this->node_template); + } + + /** + * URL of the node template to create the node group from. + * + * Generated from protobuf field optional string node_template = 323154455; + * @param string $var + * @return $this + */ + public function setNodeTemplate($var) + { + GPBUtil::checkString($var, True); + $this->node_template = $var; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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; + } + + /** + * Share-settings for the node group + * + * Generated from protobuf field optional .google.cloud.compute.v1.ShareSettings share_settings = 266668163; + * @return \Google\Cloud\Compute\V1\ShareSettings|null + */ + public function getShareSettings() + { + return $this->share_settings; + } + + public function hasShareSettings() + { + return isset($this->share_settings); + } + + public function clearShareSettings() + { + unset($this->share_settings); + } + + /** + * Share-settings for the node group + * + * Generated from protobuf field optional .google.cloud.compute.v1.ShareSettings share_settings = 266668163; + * @param \Google\Cloud\Compute\V1\ShareSettings $var + * @return $this + */ + public function setShareSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ShareSettings::class); + $this->share_settings = $var; + + return $this; + } + + /** + * [Output Only] The total number of nodes in the node group. + * + * Generated from protobuf field optional int32 size = 3530753; + * @return int + */ + public function getSize() + { + return isset($this->size) ? $this->size : 0; + } + + public function hasSize() + { + return isset($this->size); + } + + public function clearSize() + { + unset($this->size); + } + + /** + * [Output Only] The total number of nodes in the node group. + * + * Generated from protobuf field optional int32 size = 3530753; + * @param int $var + * @return $this + */ + public function setSize($var) + { + GPBUtil::checkInt32($var); + $this->size = $var; + + return $this; + } + + /** + * + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + + /** + * [Output Only] The name of the zone where the node group resides, such as us-central1-a. + * + * Generated from protobuf field optional string zone = 3744684; + * @return string + */ + public function getZone() + { + return isset($this->zone) ? $this->zone : ''; + } + + public function hasZone() + { + return isset($this->zone); + } + + public function clearZone() + { + unset($this->zone); + } + + /** + * [Output Only] The name of the zone where the node group resides, such as us-central1-a. + * + * Generated from protobuf field optional string zone = 3744684; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroup/MaintenanceInterval.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroup/MaintenanceInterval.php new file mode 100644 index 000000000000..f08d946d21f3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroup/MaintenanceInterval.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.NodeGroup.MaintenanceInterval + */ +class MaintenanceInterval +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MAINTENANCE_INTERVAL = 0; + */ + const UNDEFINED_MAINTENANCE_INTERVAL = 0; + /** + * VMs are eligible to receive infrastructure and hypervisor updates as they become available. This may result in more maintenance operations (live migrations or terminations) for the VM than the PERIODIC and RECURRENT options. + * + * Generated from protobuf enum AS_NEEDED = 500724834; + */ + const AS_NEEDED = 500724834; + /** + * VMs receive infrastructure and hypervisor updates on a periodic basis, minimizing the number of maintenance operations (live migrations or terminations) on an individual VM. This may mean a VM will take longer to receive an update than if it was configured for AS_NEEDED. Security updates will still be applied as soon as they are available. RECURRENT is used for GEN3 and Slice of Hardware VMs. + * + * Generated from protobuf enum RECURRENT = 194244550; + */ + const RECURRENT = 194244550; + + private static $valueToName = [ + self::UNDEFINED_MAINTENANCE_INTERVAL => 'UNDEFINED_MAINTENANCE_INTERVAL', + self::AS_NEEDED => 'AS_NEEDED', + self::RECURRENT => 'RECURRENT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MaintenanceInterval::class, \Google\Cloud\Compute\V1\NodeGroup_MaintenanceInterval::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroup/MaintenancePolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroup/MaintenancePolicy.php new file mode 100644 index 000000000000..7a2c3f6a8423 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroup/MaintenancePolicy.php @@ -0,0 +1,80 @@ +google.cloud.compute.v1.NodeGroup.MaintenancePolicy + */ +class MaintenancePolicy +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MAINTENANCE_POLICY = 0; + */ + const UNDEFINED_MAINTENANCE_POLICY = 0; + /** + * Allow the node and corresponding instances to retain default maintenance behavior. + * + * Generated from protobuf enum DEFAULT = 115302945; + */ + const PBDEFAULT = 115302945; + /** + * Generated from protobuf enum MAINTENANCE_POLICY_UNSPECIFIED = 72964182; + */ + const MAINTENANCE_POLICY_UNSPECIFIED = 72964182; + /** + * When maintenance must be done on a node, the instances on that node will be moved to other nodes in the group. Instances with onHostMaintenance = MIGRATE will live migrate to their destinations while instances with onHostMaintenance = TERMINATE will terminate and then restart on their destination nodes if automaticRestart = true. + * + * Generated from protobuf enum MIGRATE_WITHIN_NODE_GROUP = 153483394; + */ + const MIGRATE_WITHIN_NODE_GROUP = 153483394; + /** + * Instances in this group will restart on the same node when maintenance has completed. Instances must have onHostMaintenance = TERMINATE, and they will only restart if automaticRestart = true. + * + * Generated from protobuf enum RESTART_IN_PLACE = 228647325; + */ + const RESTART_IN_PLACE = 228647325; + + private static $valueToName = [ + self::UNDEFINED_MAINTENANCE_POLICY => 'UNDEFINED_MAINTENANCE_POLICY', + self::PBDEFAULT => 'DEFAULT', + self::MAINTENANCE_POLICY_UNSPECIFIED => 'MAINTENANCE_POLICY_UNSPECIFIED', + self::MIGRATE_WITHIN_NODE_GROUP => 'MIGRATE_WITHIN_NODE_GROUP', + self::RESTART_IN_PLACE => 'RESTART_IN_PLACE', + ]; + + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MaintenancePolicy::class, \Google\Cloud\Compute\V1\NodeGroup_MaintenancePolicy::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroup/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroup/Status.php new file mode 100644 index 000000000000..bcf80375f21e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroup/Status.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.NodeGroup.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * Generated from protobuf enum CREATING = 455564985; + */ + const CREATING = 455564985; + /** + * Generated from protobuf enum DELETING = 528602024; + */ + const DELETING = 528602024; + /** + * Generated from protobuf enum INVALID = 530283991; + */ + const INVALID = 530283991; + /** + * Generated from protobuf enum READY = 77848963; + */ + const READY = 77848963; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::CREATING => 'CREATING', + self::DELETING => 'DELETING', + self::INVALID => 'INVALID', + self::READY => 'READY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\NodeGroup_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupAggregatedList.php new file mode 100644 index 000000000000..13c89c4c8e8c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.NodeGroupAggregatedList + */ +class NodeGroupAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of NodeGroupsScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource.Always compute#nodeGroupAggregatedList for aggregated lists of node groups. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 NodeGroupsScopedList resources. + * @type string $kind + * [Output Only] Type of resource.Always compute#nodeGroupAggregatedList for aggregated lists of node groups. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 NodeGroupsScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of NodeGroupsScopedList 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\NodeGroupsScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource.Always compute#nodeGroupAggregatedList for aggregated lists of node groups. + * + * 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); + } + + /** + * [Output Only] Type of resource.Always compute#nodeGroupAggregatedList for aggregated lists of node groups. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupAutoscalingPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupAutoscalingPolicy.php new file mode 100644 index 000000000000..6ea6106f330b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupAutoscalingPolicy.php @@ -0,0 +1,168 @@ +google.cloud.compute.v1.NodeGroupAutoscalingPolicy + */ +class NodeGroupAutoscalingPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * The maximum number of nodes that the group should have. Must be set if autoscaling is enabled. Maximum value allowed is 100. + * + * Generated from protobuf field optional int32 max_nodes = 297762838; + */ + protected $max_nodes = null; + /** + * The minimum number of nodes that the group should have. + * + * Generated from protobuf field optional int32 min_nodes = 533370500; + */ + protected $min_nodes = null; + /** + * The autoscaling mode. Set to one of: ON, OFF, or ONLY_SCALE_OUT. For more information, see Autoscaler modes. + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + */ + protected $mode = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $max_nodes + * The maximum number of nodes that the group should have. Must be set if autoscaling is enabled. Maximum value allowed is 100. + * @type int $min_nodes + * The minimum number of nodes that the group should have. + * @type string $mode + * The autoscaling mode. Set to one of: ON, OFF, or ONLY_SCALE_OUT. For more information, see Autoscaler modes. + * Check the Mode enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The maximum number of nodes that the group should have. Must be set if autoscaling is enabled. Maximum value allowed is 100. + * + * Generated from protobuf field optional int32 max_nodes = 297762838; + * @return int + */ + public function getMaxNodes() + { + return isset($this->max_nodes) ? $this->max_nodes : 0; + } + + public function hasMaxNodes() + { + return isset($this->max_nodes); + } + + public function clearMaxNodes() + { + unset($this->max_nodes); + } + + /** + * The maximum number of nodes that the group should have. Must be set if autoscaling is enabled. Maximum value allowed is 100. + * + * Generated from protobuf field optional int32 max_nodes = 297762838; + * @param int $var + * @return $this + */ + public function setMaxNodes($var) + { + GPBUtil::checkInt32($var); + $this->max_nodes = $var; + + return $this; + } + + /** + * The minimum number of nodes that the group should have. + * + * Generated from protobuf field optional int32 min_nodes = 533370500; + * @return int + */ + public function getMinNodes() + { + return isset($this->min_nodes) ? $this->min_nodes : 0; + } + + public function hasMinNodes() + { + return isset($this->min_nodes); + } + + public function clearMinNodes() + { + unset($this->min_nodes); + } + + /** + * The minimum number of nodes that the group should have. + * + * Generated from protobuf field optional int32 min_nodes = 533370500; + * @param int $var + * @return $this + */ + public function setMinNodes($var) + { + GPBUtil::checkInt32($var); + $this->min_nodes = $var; + + return $this; + } + + /** + * The autoscaling mode. Set to one of: ON, OFF, or ONLY_SCALE_OUT. For more information, see Autoscaler modes. + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + * @return string + */ + public function getMode() + { + return isset($this->mode) ? $this->mode : ''; + } + + public function hasMode() + { + return isset($this->mode); + } + + public function clearMode() + { + unset($this->mode); + } + + /** + * The autoscaling mode. Set to one of: ON, OFF, or ONLY_SCALE_OUT. For more information, see Autoscaler modes. + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + * @param string $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkString($var, True); + $this->mode = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupAutoscalingPolicy/Mode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupAutoscalingPolicy/Mode.php new file mode 100644 index 000000000000..84d8685b2b7e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupAutoscalingPolicy/Mode.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.NodeGroupAutoscalingPolicy.Mode + */ +class Mode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MODE = 0; + */ + const UNDEFINED_MODE = 0; + /** + * Generated from protobuf enum MODE_UNSPECIFIED = 371348091; + */ + const MODE_UNSPECIFIED = 371348091; + /** + * Autoscaling is disabled. + * + * Generated from protobuf enum OFF = 78159; + */ + const OFF = 78159; + /** + * Autocaling is fully enabled. + * + * Generated from protobuf enum ON = 2527; + */ + const ON = 2527; + /** + * Autoscaling will only scale out and will not remove nodes. + * + * Generated from protobuf enum ONLY_SCALE_OUT = 152713670; + */ + const ONLY_SCALE_OUT = 152713670; + + private static $valueToName = [ + self::UNDEFINED_MODE => 'UNDEFINED_MODE', + self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED', + self::OFF => 'OFF', + self::ON => 'ON', + self::ONLY_SCALE_OUT => 'ONLY_SCALE_OUT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Mode::class, \Google\Cloud\Compute\V1\NodeGroupAutoscalingPolicy_Mode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupList.php new file mode 100644 index 000000000000..c0856d85ddaf --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.NodeGroupList + */ +class NodeGroupList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of NodeGroup resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NodeGroup items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource.Always compute#nodeGroupList for lists of node groups. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\NodeGroup>|\Google\Protobuf\Internal\RepeatedField $items + * A list of NodeGroup resources. + * @type string $kind + * [Output Only] Type of resource.Always compute#nodeGroupList for lists of node groups. + * @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 NodeGroup resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NodeGroup items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of NodeGroup resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NodeGroup items = 100526016; + * @param array<\Google\Cloud\Compute\V1\NodeGroup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NodeGroup::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource.Always compute#nodeGroupList for lists of node groups. + * + * 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); + } + + /** + * [Output Only] Type of resource.Always compute#nodeGroupList for lists of node groups. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupMaintenanceWindow.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupMaintenanceWindow.php new file mode 100644 index 000000000000..b52b69bb2502 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupMaintenanceWindow.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.NodeGroupMaintenanceWindow + */ +class NodeGroupMaintenanceWindow extends \Google\Protobuf\Internal\Message +{ + /** + * [Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration maintenance_duration = 525291840; + */ + protected $maintenance_duration = null; + /** + * Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid. + * + * Generated from protobuf field optional string start_time = 37467274; + */ + protected $start_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\Duration $maintenance_duration + * [Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario. + * @type string $start_time + * Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration maintenance_duration = 525291840; + * @return \Google\Cloud\Compute\V1\Duration|null + */ + public function getMaintenanceDuration() + { + return $this->maintenance_duration; + } + + public function hasMaintenanceDuration() + { + return isset($this->maintenance_duration); + } + + public function clearMaintenanceDuration() + { + unset($this->maintenance_duration); + } + + /** + * [Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration maintenance_duration = 525291840; + * @param \Google\Cloud\Compute\V1\Duration $var + * @return $this + */ + public function setMaintenanceDuration($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Duration::class); + $this->maintenance_duration = $var; + + return $this; + } + + /** + * Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid. + * + * Generated from protobuf field optional string start_time = 37467274; + * @return string + */ + public function getStartTime() + { + return isset($this->start_time) ? $this->start_time : ''; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid. + * + * Generated from protobuf field optional string start_time = 37467274; + * @param string $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkString($var, True); + $this->start_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupNode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupNode.php new file mode 100644 index 000000000000..edb86b7b4e94 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupNode.php @@ -0,0 +1,616 @@ +google.cloud.compute.v1.NodeGroupNode + */ +class NodeGroupNode extends \Google\Protobuf\Internal\Message +{ + /** + * Accelerators for this node. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig accelerators = 269577064; + */ + private $accelerators; + /** + * Node resources that are reserved by all instances. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceConsumptionInfo consumed_resources = 334527118; + */ + protected $consumed_resources = null; + /** + * CPU overcommit. + * Check the CpuOvercommitType enum for the list of possible values. + * + * Generated from protobuf field optional string cpu_overcommit_type = 247727959; + */ + protected $cpu_overcommit_type = null; + /** + * Local disk configurations. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.LocalDisk disks = 95594102; + */ + private $disks; + /** + * Instance data that shows consumed resources on the node. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceConsumptionData instance_consumption_data = 84715576; + */ + private $instance_consumption_data; + /** + * Instances scheduled on this node. + * + * Generated from protobuf field repeated string instances = 29097598; + */ + private $instances; + /** + * The name of the node. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * The type of this node. + * + * Generated from protobuf field optional string node_type = 465832791; + */ + protected $node_type = null; + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + */ + protected $satisfies_pzs = null; + /** + * Binding properties for the physical server. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ServerBinding server_binding = 208179593; + */ + protected $server_binding = null; + /** + * Server ID associated with this node. + * + * Generated from protobuf field optional string server_id = 339433367; + */ + protected $server_id = null; + /** + * + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + /** + * Total amount of available resources on the node. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceConsumptionInfo total_resources = 97406698; + */ + protected $total_resources = null; + /** + * [Output Only] The information about an upcoming maintenance event. + * + * Generated from protobuf field optional .google.cloud.compute.v1.UpcomingMaintenance upcoming_maintenance = 227348592; + */ + protected $upcoming_maintenance = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $accelerators + * Accelerators for this node. + * @type \Google\Cloud\Compute\V1\InstanceConsumptionInfo $consumed_resources + * Node resources that are reserved by all instances. + * @type string $cpu_overcommit_type + * CPU overcommit. + * Check the CpuOvercommitType enum for the list of possible values. + * @type array<\Google\Cloud\Compute\V1\LocalDisk>|\Google\Protobuf\Internal\RepeatedField $disks + * Local disk configurations. + * @type array<\Google\Cloud\Compute\V1\InstanceConsumptionData>|\Google\Protobuf\Internal\RepeatedField $instance_consumption_data + * Instance data that shows consumed resources on the node. + * @type array|\Google\Protobuf\Internal\RepeatedField $instances + * Instances scheduled on this node. + * @type string $name + * The name of the node. + * @type string $node_type + * The type of this node. + * @type bool $satisfies_pzs + * [Output Only] Reserved for future use. + * @type \Google\Cloud\Compute\V1\ServerBinding $server_binding + * Binding properties for the physical server. + * @type string $server_id + * Server ID associated with this node. + * @type string $status + * + * Check the Status enum for the list of possible values. + * @type \Google\Cloud\Compute\V1\InstanceConsumptionInfo $total_resources + * Total amount of available resources on the node. + * @type \Google\Cloud\Compute\V1\UpcomingMaintenance $upcoming_maintenance + * [Output Only] The information about an upcoming maintenance event. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Accelerators for this node. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig accelerators = 269577064; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAccelerators() + { + return $this->accelerators; + } + + /** + * Accelerators for this node. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig accelerators = 269577064; + * @param array<\Google\Cloud\Compute\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAccelerators($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AcceleratorConfig::class); + $this->accelerators = $arr; + + return $this; + } + + /** + * Node resources that are reserved by all instances. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceConsumptionInfo consumed_resources = 334527118; + * @return \Google\Cloud\Compute\V1\InstanceConsumptionInfo|null + */ + public function getConsumedResources() + { + return $this->consumed_resources; + } + + public function hasConsumedResources() + { + return isset($this->consumed_resources); + } + + public function clearConsumedResources() + { + unset($this->consumed_resources); + } + + /** + * Node resources that are reserved by all instances. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceConsumptionInfo consumed_resources = 334527118; + * @param \Google\Cloud\Compute\V1\InstanceConsumptionInfo $var + * @return $this + */ + public function setConsumedResources($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceConsumptionInfo::class); + $this->consumed_resources = $var; + + return $this; + } + + /** + * CPU overcommit. + * Check the CpuOvercommitType enum for the list of possible values. + * + * Generated from protobuf field optional string cpu_overcommit_type = 247727959; + * @return string + */ + public function getCpuOvercommitType() + { + return isset($this->cpu_overcommit_type) ? $this->cpu_overcommit_type : ''; + } + + public function hasCpuOvercommitType() + { + return isset($this->cpu_overcommit_type); + } + + public function clearCpuOvercommitType() + { + unset($this->cpu_overcommit_type); + } + + /** + * CPU overcommit. + * Check the CpuOvercommitType enum for the list of possible values. + * + * Generated from protobuf field optional string cpu_overcommit_type = 247727959; + * @param string $var + * @return $this + */ + public function setCpuOvercommitType($var) + { + GPBUtil::checkString($var, True); + $this->cpu_overcommit_type = $var; + + return $this; + } + + /** + * Local disk configurations. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.LocalDisk disks = 95594102; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisks() + { + return $this->disks; + } + + /** + * Local disk configurations. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.LocalDisk disks = 95594102; + * @param array<\Google\Cloud\Compute\V1\LocalDisk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\LocalDisk::class); + $this->disks = $arr; + + return $this; + } + + /** + * Instance data that shows consumed resources on the node. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceConsumptionData instance_consumption_data = 84715576; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstanceConsumptionData() + { + return $this->instance_consumption_data; + } + + /** + * Instance data that shows consumed resources on the node. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceConsumptionData instance_consumption_data = 84715576; + * @param array<\Google\Cloud\Compute\V1\InstanceConsumptionData>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstanceConsumptionData($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstanceConsumptionData::class); + $this->instance_consumption_data = $arr; + + return $this; + } + + /** + * Instances scheduled on this node. + * + * Generated from protobuf field repeated string instances = 29097598; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * Instances scheduled on this node. + * + * Generated from protobuf field repeated string instances = 29097598; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->instances = $arr; + + return $this; + } + + /** + * The name of the node. + * + * 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 of the node. + * + * 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; + } + + /** + * The type of this node. + * + * Generated from protobuf field optional string node_type = 465832791; + * @return string + */ + public function getNodeType() + { + return isset($this->node_type) ? $this->node_type : ''; + } + + public function hasNodeType() + { + return isset($this->node_type); + } + + public function clearNodeType() + { + unset($this->node_type); + } + + /** + * The type of this node. + * + * Generated from protobuf field optional string node_type = 465832791; + * @param string $var + * @return $this + */ + public function setNodeType($var) + { + GPBUtil::checkString($var, True); + $this->node_type = $var; + + return $this; + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + * @return bool + */ + public function getSatisfiesPzs() + { + return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; + } + + public function hasSatisfiesPzs() + { + return isset($this->satisfies_pzs); + } + + public function clearSatisfiesPzs() + { + unset($this->satisfies_pzs); + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * Binding properties for the physical server. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ServerBinding server_binding = 208179593; + * @return \Google\Cloud\Compute\V1\ServerBinding|null + */ + public function getServerBinding() + { + return $this->server_binding; + } + + public function hasServerBinding() + { + return isset($this->server_binding); + } + + public function clearServerBinding() + { + unset($this->server_binding); + } + + /** + * Binding properties for the physical server. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ServerBinding server_binding = 208179593; + * @param \Google\Cloud\Compute\V1\ServerBinding $var + * @return $this + */ + public function setServerBinding($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ServerBinding::class); + $this->server_binding = $var; + + return $this; + } + + /** + * Server ID associated with this node. + * + * Generated from protobuf field optional string server_id = 339433367; + * @return string + */ + public function getServerId() + { + return isset($this->server_id) ? $this->server_id : ''; + } + + public function hasServerId() + { + return isset($this->server_id); + } + + public function clearServerId() + { + unset($this->server_id); + } + + /** + * Server ID associated with this node. + * + * Generated from protobuf field optional string server_id = 339433367; + * @param string $var + * @return $this + */ + public function setServerId($var) + { + GPBUtil::checkString($var, True); + $this->server_id = $var; + + return $this; + } + + /** + * + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + + /** + * Total amount of available resources on the node. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceConsumptionInfo total_resources = 97406698; + * @return \Google\Cloud\Compute\V1\InstanceConsumptionInfo|null + */ + public function getTotalResources() + { + return $this->total_resources; + } + + public function hasTotalResources() + { + return isset($this->total_resources); + } + + public function clearTotalResources() + { + unset($this->total_resources); + } + + /** + * Total amount of available resources on the node. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceConsumptionInfo total_resources = 97406698; + * @param \Google\Cloud\Compute\V1\InstanceConsumptionInfo $var + * @return $this + */ + public function setTotalResources($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceConsumptionInfo::class); + $this->total_resources = $var; + + return $this; + } + + /** + * [Output Only] The information about an upcoming maintenance event. + * + * Generated from protobuf field optional .google.cloud.compute.v1.UpcomingMaintenance upcoming_maintenance = 227348592; + * @return \Google\Cloud\Compute\V1\UpcomingMaintenance|null + */ + public function getUpcomingMaintenance() + { + return $this->upcoming_maintenance; + } + + public function hasUpcomingMaintenance() + { + return isset($this->upcoming_maintenance); + } + + public function clearUpcomingMaintenance() + { + unset($this->upcoming_maintenance); + } + + /** + * [Output Only] The information about an upcoming maintenance event. + * + * Generated from protobuf field optional .google.cloud.compute.v1.UpcomingMaintenance upcoming_maintenance = 227348592; + * @param \Google\Cloud\Compute\V1\UpcomingMaintenance $var + * @return $this + */ + public function setUpcomingMaintenance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\UpcomingMaintenance::class); + $this->upcoming_maintenance = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupNode/CpuOvercommitType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupNode/CpuOvercommitType.php new file mode 100644 index 000000000000..f14fd095f41a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupNode/CpuOvercommitType.php @@ -0,0 +1,65 @@ +google.cloud.compute.v1.NodeGroupNode.CpuOvercommitType + */ +class CpuOvercommitType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_CPU_OVERCOMMIT_TYPE = 0; + */ + const UNDEFINED_CPU_OVERCOMMIT_TYPE = 0; + /** + * Generated from protobuf enum CPU_OVERCOMMIT_TYPE_UNSPECIFIED = 520665615; + */ + const CPU_OVERCOMMIT_TYPE_UNSPECIFIED = 520665615; + /** + * Generated from protobuf enum ENABLED = 182130465; + */ + const ENABLED = 182130465; + /** + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + + private static $valueToName = [ + self::UNDEFINED_CPU_OVERCOMMIT_TYPE => 'UNDEFINED_CPU_OVERCOMMIT_TYPE', + self::CPU_OVERCOMMIT_TYPE_UNSPECIFIED => 'CPU_OVERCOMMIT_TYPE_UNSPECIFIED', + self::ENABLED => 'ENABLED', + self::NONE => 'NONE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CpuOvercommitType::class, \Google\Cloud\Compute\V1\NodeGroupNode_CpuOvercommitType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupNode/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupNode/Status.php new file mode 100644 index 000000000000..107fe0a5916b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupNode/Status.php @@ -0,0 +1,74 @@ +google.cloud.compute.v1.NodeGroupNode.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * Generated from protobuf enum CREATING = 455564985; + */ + const CREATING = 455564985; + /** + * Generated from protobuf enum DELETING = 528602024; + */ + const DELETING = 528602024; + /** + * Generated from protobuf enum INVALID = 530283991; + */ + const INVALID = 530283991; + /** + * Generated from protobuf enum READY = 77848963; + */ + const READY = 77848963; + /** + * Generated from protobuf enum REPAIRING = 413483285; + */ + const REPAIRING = 413483285; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::CREATING => 'CREATING', + self::DELETING => 'DELETING', + self::INVALID => 'INVALID', + self::READY => 'READY', + self::REPAIRING => 'REPAIRING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\NodeGroupNode_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsAddNodesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsAddNodesRequest.php new file mode 100644 index 000000000000..cf42c2bd19b1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsAddNodesRequest.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.NodeGroupsAddNodesRequest + */ +class NodeGroupsAddNodesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Count of additional nodes to be added to the node group. + * + * Generated from protobuf field optional int32 additional_node_count = 134997930; + */ + protected $additional_node_count = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $additional_node_count + * Count of additional nodes to be added to the node group. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Count of additional nodes to be added to the node group. + * + * Generated from protobuf field optional int32 additional_node_count = 134997930; + * @return int + */ + public function getAdditionalNodeCount() + { + return isset($this->additional_node_count) ? $this->additional_node_count : 0; + } + + public function hasAdditionalNodeCount() + { + return isset($this->additional_node_count); + } + + public function clearAdditionalNodeCount() + { + unset($this->additional_node_count); + } + + /** + * Count of additional nodes to be added to the node group. + * + * Generated from protobuf field optional int32 additional_node_count = 134997930; + * @param int $var + * @return $this + */ + public function setAdditionalNodeCount($var) + { + GPBUtil::checkInt32($var); + $this->additional_node_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsDeleteNodesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsDeleteNodesRequest.php new file mode 100644 index 000000000000..be18a89eacd5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsDeleteNodesRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.NodeGroupsDeleteNodesRequest + */ +class NodeGroupsDeleteNodesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Names of the nodes to delete. + * + * Generated from protobuf field repeated string nodes = 104993457; + */ + private $nodes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $nodes + * Names of the nodes to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Names of the nodes to delete. + * + * Generated from protobuf field repeated string nodes = 104993457; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNodes() + { + return $this->nodes; + } + + /** + * Names of the nodes to delete. + * + * Generated from protobuf field repeated string nodes = 104993457; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->nodes = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsListNodes.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsListNodes.php new file mode 100644 index 000000000000..d88d789c58d4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsListNodes.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.NodeGroupsListNodes + */ +class NodeGroupsListNodes extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of Node resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NodeGroupNode items = 100526016; + */ + private $items; + /** + * [Output Only] The resource type, which is always compute.nodeGroupsListNodes for the list of nodes in the specified node group. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\NodeGroupNode>|\Google\Protobuf\Internal\RepeatedField $items + * A list of Node resources. + * @type string $kind + * [Output Only] The resource type, which is always compute.nodeGroupsListNodes for the list of nodes in the specified node group. + * @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 Node resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NodeGroupNode items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of Node resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NodeGroupNode items = 100526016; + * @param array<\Google\Cloud\Compute\V1\NodeGroupNode>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NodeGroupNode::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] The resource type, which is always compute.nodeGroupsListNodes for the list of nodes in the specified node group. + * + * 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); + } + + /** + * [Output Only] The resource type, which is always compute.nodeGroupsListNodes for the list of nodes in the specified node group. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsPerformMaintenanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsPerformMaintenanceRequest.php new file mode 100644 index 000000000000..234dc8196998 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsPerformMaintenanceRequest.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.NodeGroupsPerformMaintenanceRequest + */ +class NodeGroupsPerformMaintenanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * [Required] List of nodes affected by the call. + * + * Generated from protobuf field repeated string nodes = 104993457; + */ + private $nodes; + /** + * The start time of the schedule. The timestamp is an RFC3339 string. + * + * Generated from protobuf field optional string start_time = 37467274; + */ + protected $start_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $nodes + * [Required] List of nodes affected by the call. + * @type string $start_time + * The start time of the schedule. The timestamp is an RFC3339 string. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Required] List of nodes affected by the call. + * + * Generated from protobuf field repeated string nodes = 104993457; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNodes() + { + return $this->nodes; + } + + /** + * [Required] List of nodes affected by the call. + * + * Generated from protobuf field repeated string nodes = 104993457; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->nodes = $arr; + + return $this; + } + + /** + * The start time of the schedule. The timestamp is an RFC3339 string. + * + * Generated from protobuf field optional string start_time = 37467274; + * @return string + */ + public function getStartTime() + { + return isset($this->start_time) ? $this->start_time : ''; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * The start time of the schedule. The timestamp is an RFC3339 string. + * + * Generated from protobuf field optional string start_time = 37467274; + * @param string $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkString($var, True); + $this->start_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsScopedList.php new file mode 100644 index 000000000000..702c8f1d16cf --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.NodeGroupsScopedList + */ +class NodeGroupsScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A list of node groups contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NodeGroup node_groups = 73188017; + */ + private $node_groups; + /** + * [Output Only] An informational warning that appears when the nodeGroup list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\NodeGroup>|\Google\Protobuf\Internal\RepeatedField $node_groups + * [Output Only] A list of node groups contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] An informational warning that appears when the nodeGroup list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] A list of node groups contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NodeGroup node_groups = 73188017; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNodeGroups() + { + return $this->node_groups; + } + + /** + * [Output Only] A list of node groups contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NodeGroup node_groups = 73188017; + * @param array<\Google\Cloud\Compute\V1\NodeGroup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNodeGroups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NodeGroup::class); + $this->node_groups = $arr; + + return $this; + } + + /** + * [Output Only] An informational warning that appears when the nodeGroup 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 appears when the nodeGroup 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsSetNodeTemplateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsSetNodeTemplateRequest.php new file mode 100644 index 000000000000..48a0478774a4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsSetNodeTemplateRequest.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest + */ +class NodeGroupsSetNodeTemplateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Full or partial URL of the node template resource to be updated for this node group. + * + * Generated from protobuf field optional string node_template = 323154455; + */ + protected $node_template = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $node_template + * Full or partial URL of the node template resource to be updated for this node group. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Full or partial URL of the node template resource to be updated for this node group. + * + * Generated from protobuf field optional string node_template = 323154455; + * @return string + */ + public function getNodeTemplate() + { + return isset($this->node_template) ? $this->node_template : ''; + } + + public function hasNodeTemplate() + { + return isset($this->node_template); + } + + public function clearNodeTemplate() + { + unset($this->node_template); + } + + /** + * Full or partial URL of the node template resource to be updated for this node group. + * + * Generated from protobuf field optional string node_template = 323154455; + * @param string $var + * @return $this + */ + public function setNodeTemplate($var) + { + GPBUtil::checkString($var, True); + $this->node_template = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsSimulateMaintenanceEventRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsSimulateMaintenanceEventRequest.php new file mode 100644 index 000000000000..212a93eb22bf --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeGroupsSimulateMaintenanceEventRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest + */ +class NodeGroupsSimulateMaintenanceEventRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Names of the nodes to go under maintenance simulation. + * + * Generated from protobuf field repeated string nodes = 104993457; + */ + private $nodes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $nodes + * Names of the nodes to go under maintenance simulation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Names of the nodes to go under maintenance simulation. + * + * Generated from protobuf field repeated string nodes = 104993457; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNodes() + { + return $this->nodes; + } + + /** + * Names of the nodes to go under maintenance simulation. + * + * Generated from protobuf field repeated string nodes = 104993457; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->nodes = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplate.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplate.php new file mode 100644 index 000000000000..067c1e33dc32 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplate.php @@ -0,0 +1,701 @@ +google.cloud.compute.v1.NodeTemplate + */ +class NodeTemplate extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig accelerators = 269577064; + */ + private $accelerators; + /** + * CPU overcommit. + * Check the CpuOvercommitType enum for the list of possible values. + * + * Generated from protobuf field optional string cpu_overcommit_type = 247727959; + */ + protected $cpu_overcommit_type = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.LocalDisk disks = 95594102; + */ + private $disks; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] The type of the resource. Always compute#nodeTemplate for node templates. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Labels to use for node affinity, which will be used in instance scheduling. + * + * Generated from protobuf field map node_affinity_labels = 339007161; + */ + private $node_affinity_labels; + /** + * The node type to use for nodes group that are created from this template. + * + * Generated from protobuf field optional string node_type = 465832791; + */ + protected $node_type = null; + /** + * Do not use. Instead, use the node_type property. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility node_type_flexibility = 315257905; + */ + protected $node_type_flexibility = null; + /** + * [Output Only] The name of the region where the node template resides, such as us-central1. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * Sets the binding properties for the physical server. Valid values include: - *[Default]* RESTART_NODE_ON_ANY_SERVER: Restarts VMs on any available physical server - RESTART_NODE_ON_MINIMAL_SERVER: Restarts VMs on the same physical server whenever possible See Sole-tenant node options for more information. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ServerBinding server_binding = 208179593; + */ + protected $server_binding = null; + /** + * [Output Only] The status of the node template. One of the following values: CREATING, READY, and DELETING. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + /** + * [Output Only] An optional, human-readable explanation of the status. + * + * Generated from protobuf field optional string status_message = 297428154; + */ + protected $status_message = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $accelerators + * @type string $cpu_overcommit_type + * CPU overcommit. + * Check the CpuOvercommitType enum for the list of possible values. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type array<\Google\Cloud\Compute\V1\LocalDisk>|\Google\Protobuf\Internal\RepeatedField $disks + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] The type of the resource. Always compute#nodeTemplate for node templates. + * @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 $node_affinity_labels + * Labels to use for node affinity, which will be used in instance scheduling. + * @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 + * 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 + * [Output Only] Server-defined URL for the resource. + * @type \Google\Cloud\Compute\V1\ServerBinding $server_binding + * Sets the binding properties for the physical server. Valid values include: - *[Default]* RESTART_NODE_ON_ANY_SERVER: Restarts VMs on any available physical server - RESTART_NODE_ON_MINIMAL_SERVER: Restarts VMs on the same physical server whenever possible See Sole-tenant node options for more information. + * @type string $status + * [Output Only] The status of the node template. One of the following values: CREATING, READY, and DELETING. + * Check the Status enum for the list of possible values. + * @type string $status_message + * [Output Only] An optional, human-readable explanation of the status. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig accelerators = 269577064; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAccelerators() + { + return $this->accelerators; + } + + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig accelerators = 269577064; + * @param array<\Google\Cloud\Compute\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAccelerators($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AcceleratorConfig::class); + $this->accelerators = $arr; + + return $this; + } + + /** + * CPU overcommit. + * Check the CpuOvercommitType enum for the list of possible values. + * + * Generated from protobuf field optional string cpu_overcommit_type = 247727959; + * @return string + */ + public function getCpuOvercommitType() + { + return isset($this->cpu_overcommit_type) ? $this->cpu_overcommit_type : ''; + } + + public function hasCpuOvercommitType() + { + return isset($this->cpu_overcommit_type); + } + + public function clearCpuOvercommitType() + { + unset($this->cpu_overcommit_type); + } + + /** + * CPU overcommit. + * Check the CpuOvercommitType enum for the list of possible values. + * + * Generated from protobuf field optional string cpu_overcommit_type = 247727959; + * @param string $var + * @return $this + */ + public function setCpuOvercommitType($var) + { + GPBUtil::checkString($var, True); + $this->cpu_overcommit_type = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.LocalDisk disks = 95594102; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisks() + { + return $this->disks; + } + + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.LocalDisk disks = 95594102; + * @param array<\Google\Cloud\Compute\V1\LocalDisk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\LocalDisk::class); + $this->disks = $arr; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] The type of the resource. Always compute#nodeTemplate for node templates. + * + * 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); + } + + /** + * [Output Only] The type of the resource. Always compute#nodeTemplate for node templates. + * + * 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; + } + + /** + * 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. + * + * 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 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. + * + * 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; + } + + /** + * Labels to use for node affinity, which will be used in instance scheduling. + * + * Generated from protobuf field map node_affinity_labels = 339007161; + * @return \Google\Protobuf\Internal\MapField + */ + public function getNodeAffinityLabels() + { + return $this->node_affinity_labels; + } + + /** + * Labels to use for node affinity, which will be used in instance scheduling. + * + * Generated from protobuf field map node_affinity_labels = 339007161; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setNodeAffinityLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->node_affinity_labels = $arr; + + return $this; + } + + /** + * The node type to use for nodes group that are created from this template. + * + * Generated from protobuf field optional string node_type = 465832791; + * @return string + */ + public function getNodeType() + { + return isset($this->node_type) ? $this->node_type : ''; + } + + public function hasNodeType() + { + return isset($this->node_type); + } + + public function clearNodeType() + { + unset($this->node_type); + } + + /** + * The node type to use for nodes group that are created from this template. + * + * Generated from protobuf field optional string node_type = 465832791; + * @param string $var + * @return $this + */ + public function setNodeType($var) + { + GPBUtil::checkString($var, True); + $this->node_type = $var; + + return $this; + } + + /** + * 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 + */ + public function getNodeTypeFlexibility() + { + return $this->node_type_flexibility; + } + + public function hasNodeTypeFlexibility() + { + return isset($this->node_type_flexibility); + } + + public function clearNodeTypeFlexibility() + { + unset($this->node_type_flexibility); + } + + /** + * 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 + * @return $this + */ + public function setNodeTypeFlexibility($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NodeTemplateNodeTypeFlexibility::class); + $this->node_type_flexibility = $var; + + return $this; + } + + /** + * [Output Only] The name of the region where the node template resides, such as us-central1. + * + * 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] The name of the region where the node template resides, such as us-central1. + * + * 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] Server-defined URL for the 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 the 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; + } + + /** + * Sets the binding properties for the physical server. Valid values include: - *[Default]* RESTART_NODE_ON_ANY_SERVER: Restarts VMs on any available physical server - RESTART_NODE_ON_MINIMAL_SERVER: Restarts VMs on the same physical server whenever possible See Sole-tenant node options for more information. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ServerBinding server_binding = 208179593; + * @return \Google\Cloud\Compute\V1\ServerBinding|null + */ + public function getServerBinding() + { + return $this->server_binding; + } + + public function hasServerBinding() + { + return isset($this->server_binding); + } + + public function clearServerBinding() + { + unset($this->server_binding); + } + + /** + * Sets the binding properties for the physical server. Valid values include: - *[Default]* RESTART_NODE_ON_ANY_SERVER: Restarts VMs on any available physical server - RESTART_NODE_ON_MINIMAL_SERVER: Restarts VMs on the same physical server whenever possible See Sole-tenant node options for more information. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ServerBinding server_binding = 208179593; + * @param \Google\Cloud\Compute\V1\ServerBinding $var + * @return $this + */ + public function setServerBinding($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ServerBinding::class); + $this->server_binding = $var; + + return $this; + } + + /** + * [Output Only] The status of the node template. One of the following values: CREATING, READY, and DELETING. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] The status of the node template. One of the following values: CREATING, READY, and DELETING. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + + /** + * [Output Only] An optional, human-readable explanation of the status. + * + * Generated from protobuf field optional string status_message = 297428154; + * @return string + */ + public function getStatusMessage() + { + return isset($this->status_message) ? $this->status_message : ''; + } + + public function hasStatusMessage() + { + return isset($this->status_message); + } + + public function clearStatusMessage() + { + unset($this->status_message); + } + + /** + * [Output Only] An optional, human-readable explanation of the status. + * + * Generated from protobuf field optional string status_message = 297428154; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplate/CpuOvercommitType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplate/CpuOvercommitType.php new file mode 100644 index 000000000000..5d0a030fb172 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplate/CpuOvercommitType.php @@ -0,0 +1,65 @@ +google.cloud.compute.v1.NodeTemplate.CpuOvercommitType + */ +class CpuOvercommitType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_CPU_OVERCOMMIT_TYPE = 0; + */ + const UNDEFINED_CPU_OVERCOMMIT_TYPE = 0; + /** + * Generated from protobuf enum CPU_OVERCOMMIT_TYPE_UNSPECIFIED = 520665615; + */ + const CPU_OVERCOMMIT_TYPE_UNSPECIFIED = 520665615; + /** + * Generated from protobuf enum ENABLED = 182130465; + */ + const ENABLED = 182130465; + /** + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + + private static $valueToName = [ + self::UNDEFINED_CPU_OVERCOMMIT_TYPE => 'UNDEFINED_CPU_OVERCOMMIT_TYPE', + self::CPU_OVERCOMMIT_TYPE_UNSPECIFIED => 'CPU_OVERCOMMIT_TYPE_UNSPECIFIED', + self::ENABLED => 'ENABLED', + self::NONE => 'NONE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CpuOvercommitType::class, \Google\Cloud\Compute\V1\NodeTemplate_CpuOvercommitType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplate/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplate/Status.php new file mode 100644 index 000000000000..e15b067e2ba1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplate/Status.php @@ -0,0 +1,78 @@ +google.cloud.compute.v1.NodeTemplate.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * Resources are being allocated. + * + * Generated from protobuf enum CREATING = 455564985; + */ + const CREATING = 455564985; + /** + * The node template is currently being deleted. + * + * Generated from protobuf enum DELETING = 528602024; + */ + const DELETING = 528602024; + /** + * Invalid status. + * + * Generated from protobuf enum INVALID = 530283991; + */ + const INVALID = 530283991; + /** + * The node template is ready. + * + * Generated from protobuf enum READY = 77848963; + */ + const READY = 77848963; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::CREATING => 'CREATING', + self::DELETING => 'DELETING', + self::INVALID => 'INVALID', + self::READY => 'READY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\NodeTemplate_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplateAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplateAggregatedList.php new file mode 100644 index 000000000000..97c487e7efc7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplateAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.NodeTemplateAggregatedList + */ +class NodeTemplateAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of NodeTemplatesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource.Always compute#nodeTemplateAggregatedList for aggregated lists of node templates. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 NodeTemplatesScopedList resources. + * @type string $kind + * [Output Only] Type of resource.Always compute#nodeTemplateAggregatedList for aggregated lists of node templates. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 NodeTemplatesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of NodeTemplatesScopedList 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\NodeTemplatesScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource.Always compute#nodeTemplateAggregatedList for aggregated lists of node templates. + * + * 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); + } + + /** + * [Output Only] Type of resource.Always compute#nodeTemplateAggregatedList for aggregated lists of node templates. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplateList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplateList.php new file mode 100644 index 000000000000..4fd1eb587255 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplateList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.NodeTemplateList + */ +class NodeTemplateList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of NodeTemplate resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NodeTemplate items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource.Always compute#nodeTemplateList for lists of node templates. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\NodeTemplate>|\Google\Protobuf\Internal\RepeatedField $items + * A list of NodeTemplate resources. + * @type string $kind + * [Output Only] Type of resource.Always compute#nodeTemplateList for lists of node templates. + * @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 NodeTemplate resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NodeTemplate items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of NodeTemplate resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NodeTemplate items = 100526016; + * @param array<\Google\Cloud\Compute\V1\NodeTemplate>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NodeTemplate::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource.Always compute#nodeTemplateList for lists of node templates. + * + * 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); + } + + /** + * [Output Only] Type of resource.Always compute#nodeTemplateList for lists of node templates. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplateNodeTypeFlexibility.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplateNodeTypeFlexibility.php new file mode 100644 index 000000000000..ed4ff1e968ed --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplateNodeTypeFlexibility.php @@ -0,0 +1,143 @@ +google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility + */ +class NodeTemplateNodeTypeFlexibility extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string cpus = 3060683; + */ + protected $cpus = null; + /** + * Generated from protobuf field optional string local_ssd = 405741360; + */ + protected $local_ssd = null; + /** + * Generated from protobuf field optional string memory = 532856065; + */ + protected $memory = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $cpus + * @type string $local_ssd + * @type string $memory + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string cpus = 3060683; + * @return string + */ + public function getCpus() + { + return isset($this->cpus) ? $this->cpus : ''; + } + + public function hasCpus() + { + return isset($this->cpus); + } + + public function clearCpus() + { + unset($this->cpus); + } + + /** + * Generated from protobuf field optional string cpus = 3060683; + * @param string $var + * @return $this + */ + public function setCpus($var) + { + GPBUtil::checkString($var, True); + $this->cpus = $var; + + return $this; + } + + /** + * Generated from protobuf field optional string local_ssd = 405741360; + * @return string + */ + public function getLocalSsd() + { + return isset($this->local_ssd) ? $this->local_ssd : ''; + } + + public function hasLocalSsd() + { + return isset($this->local_ssd); + } + + public function clearLocalSsd() + { + unset($this->local_ssd); + } + + /** + * Generated from protobuf field optional string local_ssd = 405741360; + * @param string $var + * @return $this + */ + public function setLocalSsd($var) + { + GPBUtil::checkString($var, True); + $this->local_ssd = $var; + + return $this; + } + + /** + * Generated from protobuf field optional string memory = 532856065; + * @return string + */ + public function getMemory() + { + return isset($this->memory) ? $this->memory : ''; + } + + public function hasMemory() + { + return isset($this->memory); + } + + public function clearMemory() + { + unset($this->memory); + } + + /** + * Generated from protobuf field optional string memory = 532856065; + * @param string $var + * @return $this + */ + public function setMemory($var) + { + GPBUtil::checkString($var, True); + $this->memory = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplatesScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplatesScopedList.php new file mode 100644 index 000000000000..afdca08c4455 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTemplatesScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.NodeTemplatesScopedList + */ +class NodeTemplatesScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A list of node templates contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NodeTemplate node_templates = 354111804; + */ + private $node_templates; + /** + * [Output Only] An informational warning that appears when the node templates list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\NodeTemplate>|\Google\Protobuf\Internal\RepeatedField $node_templates + * [Output Only] A list of node templates contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] An informational warning that appears when the node templates list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] A list of node templates contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NodeTemplate node_templates = 354111804; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNodeTemplates() + { + return $this->node_templates; + } + + /** + * [Output Only] A list of node templates contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NodeTemplate node_templates = 354111804; + * @param array<\Google\Cloud\Compute\V1\NodeTemplate>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNodeTemplates($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NodeTemplate::class); + $this->node_templates = $arr; + + return $this; + } + + /** + * [Output Only] An informational warning that appears when the node templates 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 appears when the node templates 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeType.php new file mode 100644 index 000000000000..c3a0a239996f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeType.php @@ -0,0 +1,561 @@ +google.cloud.compute.v1.NodeType + */ +class NodeType extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The CPU platform used by this node type. + * + * Generated from protobuf field optional string cpu_platform = 410285354; + */ + protected $cpu_platform = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * [Output Only] The deprecation status associated with this node type. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + */ + protected $deprecated = null; + /** + * [Output Only] An optional textual description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The number of virtual CPUs that are available to the node type. + * + * Generated from protobuf field optional int32 guest_cpus = 393356754; + */ + protected $guest_cpus = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] The type of the resource. Always compute#nodeType for node types. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * [Output Only] Local SSD available to the node type, defined in GB. + * + * Generated from protobuf field optional int32 local_ssd_gb = 329237578; + */ + protected $local_ssd_gb = null; + /** + * [Output Only] The amount of physical memory available to the node type, defined in MB. + * + * Generated from protobuf field optional int32 memory_mb = 116001171; + */ + protected $memory_mb = null; + /** + * [Output Only] Name of the resource. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] The name of the zone where the node type resides, such as us-central1-a. + * + * Generated from protobuf field optional string zone = 3744684; + */ + protected $zone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $cpu_platform + * [Output Only] The CPU platform used by this node type. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type \Google\Cloud\Compute\V1\DeprecationStatus $deprecated + * [Output Only] The deprecation status associated with this node type. + * @type string $description + * [Output Only] An optional textual description of the resource. + * @type int $guest_cpus + * [Output Only] The number of virtual CPUs that are available to the node type. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] The type of the resource. Always compute#nodeType for node types. + * @type int $local_ssd_gb + * [Output Only] Local SSD available to the node type, defined in GB. + * @type int $memory_mb + * [Output Only] The amount of physical memory available to the node type, defined in MB. + * @type string $name + * [Output Only] Name of the resource. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $zone + * [Output Only] The name of the zone where the node type resides, such as us-central1-a. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The CPU platform used by this node type. + * + * Generated from protobuf field optional string cpu_platform = 410285354; + * @return string + */ + public function getCpuPlatform() + { + return isset($this->cpu_platform) ? $this->cpu_platform : ''; + } + + public function hasCpuPlatform() + { + return isset($this->cpu_platform); + } + + public function clearCpuPlatform() + { + unset($this->cpu_platform); + } + + /** + * [Output Only] The CPU platform used by this node type. + * + * Generated from protobuf field optional string cpu_platform = 410285354; + * @param string $var + * @return $this + */ + public function setCpuPlatform($var) + { + GPBUtil::checkString($var, True); + $this->cpu_platform = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * [Output Only] The deprecation status associated with this node type. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + * @return \Google\Cloud\Compute\V1\DeprecationStatus|null + */ + public function getDeprecated() + { + return $this->deprecated; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * [Output Only] The deprecation status associated with this node type. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + * @param \Google\Cloud\Compute\V1\DeprecationStatus $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DeprecationStatus::class); + $this->deprecated = $var; + + return $this; + } + + /** + * [Output Only] An optional textual description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * [Output Only] An optional textual description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The number of virtual CPUs that are available to the node type. + * + * Generated from protobuf field optional int32 guest_cpus = 393356754; + * @return int + */ + public function getGuestCpus() + { + return isset($this->guest_cpus) ? $this->guest_cpus : 0; + } + + public function hasGuestCpus() + { + return isset($this->guest_cpus); + } + + public function clearGuestCpus() + { + unset($this->guest_cpus); + } + + /** + * [Output Only] The number of virtual CPUs that are available to the node type. + * + * Generated from protobuf field optional int32 guest_cpus = 393356754; + * @param int $var + * @return $this + */ + public function setGuestCpus($var) + { + GPBUtil::checkInt32($var); + $this->guest_cpus = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] The type of the resource. Always compute#nodeType for node types. + * + * 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); + } + + /** + * [Output Only] The type of the resource. Always compute#nodeType for node types. + * + * 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] Local SSD available to the node type, defined in GB. + * + * Generated from protobuf field optional int32 local_ssd_gb = 329237578; + * @return int + */ + public function getLocalSsdGb() + { + return isset($this->local_ssd_gb) ? $this->local_ssd_gb : 0; + } + + public function hasLocalSsdGb() + { + return isset($this->local_ssd_gb); + } + + public function clearLocalSsdGb() + { + unset($this->local_ssd_gb); + } + + /** + * [Output Only] Local SSD available to the node type, defined in GB. + * + * Generated from protobuf field optional int32 local_ssd_gb = 329237578; + * @param int $var + * @return $this + */ + public function setLocalSsdGb($var) + { + GPBUtil::checkInt32($var); + $this->local_ssd_gb = $var; + + return $this; + } + + /** + * [Output Only] The amount of physical memory available to the node type, defined in MB. + * + * Generated from protobuf field optional int32 memory_mb = 116001171; + * @return int + */ + public function getMemoryMb() + { + return isset($this->memory_mb) ? $this->memory_mb : 0; + } + + public function hasMemoryMb() + { + return isset($this->memory_mb); + } + + public function clearMemoryMb() + { + unset($this->memory_mb); + } + + /** + * [Output Only] The amount of physical memory available to the node type, defined in MB. + * + * Generated from protobuf field optional int32 memory_mb = 116001171; + * @param int $var + * @return $this + */ + public function setMemoryMb($var) + { + GPBUtil::checkInt32($var); + $this->memory_mb = $var; + + return $this; + } + + /** + * [Output Only] Name of the resource. + * + * 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); + } + + /** + * [Output Only] Name of the resource. + * + * 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; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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] The name of the zone where the node type resides, such as us-central1-a. + * + * Generated from protobuf field optional string zone = 3744684; + * @return string + */ + public function getZone() + { + return isset($this->zone) ? $this->zone : ''; + } + + public function hasZone() + { + return isset($this->zone); + } + + public function clearZone() + { + unset($this->zone); + } + + /** + * [Output Only] The name of the zone where the node type resides, such as us-central1-a. + * + * Generated from protobuf field optional string zone = 3744684; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTypeAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTypeAggregatedList.php new file mode 100644 index 000000000000..f4f0ac6dda36 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTypeAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.NodeTypeAggregatedList + */ +class NodeTypeAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of NodeTypesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource.Always compute#nodeTypeAggregatedList for aggregated lists of node types. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 NodeTypesScopedList resources. + * @type string $kind + * [Output Only] Type of resource.Always compute#nodeTypeAggregatedList for aggregated lists of node types. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 NodeTypesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of NodeTypesScopedList 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\NodeTypesScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource.Always compute#nodeTypeAggregatedList for aggregated lists of node types. + * + * 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); + } + + /** + * [Output Only] Type of resource.Always compute#nodeTypeAggregatedList for aggregated lists of node types. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTypeList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTypeList.php new file mode 100644 index 000000000000..d3ad64a3e98a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTypeList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.NodeTypeList + */ +class NodeTypeList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of NodeType resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NodeType items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource.Always compute#nodeTypeList for lists of node types. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\NodeType>|\Google\Protobuf\Internal\RepeatedField $items + * A list of NodeType resources. + * @type string $kind + * [Output Only] Type of resource.Always compute#nodeTypeList for lists of node types. + * @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 NodeType resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NodeType items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of NodeType resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NodeType items = 100526016; + * @param array<\Google\Cloud\Compute\V1\NodeType>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NodeType::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource.Always compute#nodeTypeList for lists of node types. + * + * 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); + } + + /** + * [Output Only] Type of resource.Always compute#nodeTypeList for lists of node types. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTypesScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTypesScopedList.php new file mode 100644 index 000000000000..020655aba4f6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NodeTypesScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.NodeTypesScopedList + */ +class NodeTypesScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A list of node types contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NodeType node_types = 482172924; + */ + private $node_types; + /** + * [Output Only] An informational warning that appears when the node types list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\NodeType>|\Google\Protobuf\Internal\RepeatedField $node_types + * [Output Only] A list of node types contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] An informational warning that appears when the node types list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] A list of node types contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NodeType node_types = 482172924; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNodeTypes() + { + return $this->node_types; + } + + /** + * [Output Only] A list of node types contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NodeType node_types = 482172924; + * @param array<\Google\Cloud\Compute\V1\NodeType>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNodeTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NodeType::class); + $this->node_types = $arr; + + return $this; + } + + /** + * [Output Only] An informational warning that appears when the node types 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 appears when the node types 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NotificationEndpoint.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NotificationEndpoint.php new file mode 100644 index 000000000000..6f2345a2c3d0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NotificationEndpoint.php @@ -0,0 +1,385 @@ +google.cloud.compute.v1.NotificationEndpoint + */ +class NotificationEndpoint extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Settings of the gRPC notification endpoint including the endpoint URL and the retry duration. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NotificationEndpointGrpcSettings grpc_settings = 456139556; + */ + protected $grpc_settings = null; + /** + * [Output Only] A unique identifier for this resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#notificationEndpoint for notification endpoints. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] URL of the region where the notification endpoint resides. This field applies only to the regional resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type \Google\Cloud\Compute\V1\NotificationEndpointGrpcSettings $grpc_settings + * Settings of the gRPC notification endpoint including the endpoint URL and the retry duration. + * @type int|string $id + * [Output Only] A unique identifier for this resource type. The server generates this identifier. + * @type string $kind + * [Output Only] Type of the resource. Always compute#notificationEndpoint for notification endpoints. + * @type string $name + * 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 string $region + * [Output Only] URL of the region where the notification endpoint resides. This field applies only to the regional resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Settings of the gRPC notification endpoint including the endpoint URL and the retry duration. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NotificationEndpointGrpcSettings grpc_settings = 456139556; + * @return \Google\Cloud\Compute\V1\NotificationEndpointGrpcSettings|null + */ + public function getGrpcSettings() + { + return $this->grpc_settings; + } + + public function hasGrpcSettings() + { + return isset($this->grpc_settings); + } + + public function clearGrpcSettings() + { + unset($this->grpc_settings); + } + + /** + * Settings of the gRPC notification endpoint including the endpoint URL and the retry duration. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NotificationEndpointGrpcSettings grpc_settings = 456139556; + * @param \Google\Cloud\Compute\V1\NotificationEndpointGrpcSettings $var + * @return $this + */ + public function setGrpcSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NotificationEndpointGrpcSettings::class); + $this->grpc_settings = $var; + + return $this; + } + + /** + * [Output Only] A unique identifier for this resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] A unique identifier for this resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#notificationEndpoint for notification endpoints. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#notificationEndpoint for notification endpoints. + * + * 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; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * [Output Only] URL of the region where the notification endpoint resides. This field applies only to the regional resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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 notification endpoint resides. This field applies only to the regional resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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] Server-defined URL for the 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 the 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NotificationEndpointGrpcSettings.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NotificationEndpointGrpcSettings.php new file mode 100644 index 000000000000..467ea3be1637 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NotificationEndpointGrpcSettings.php @@ -0,0 +1,253 @@ +google.cloud.compute.v1.NotificationEndpointGrpcSettings + */ +class NotificationEndpointGrpcSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. If specified, this field is used to set the authority header by the sender of notifications. See https://tools.ietf.org/html/rfc7540#section-8.1.2.3 + * + * Generated from protobuf field optional string authority = 401868611; + */ + protected $authority = null; + /** + * Endpoint to which gRPC notifications are sent. This must be a valid gRPCLB DNS name. + * + * Generated from protobuf field optional string endpoint = 130489749; + */ + protected $endpoint = null; + /** + * Optional. If specified, this field is used to populate the "name" field in gRPC requests. + * + * Generated from protobuf field optional string payload_name = 300358300; + */ + protected $payload_name = null; + /** + * Optional. This field is used to configure how often to send a full update of all non-healthy backends. If unspecified, full updates are not sent. If specified, must be in the range between 600 seconds to 3600 seconds. Nanos are disallowed. Can only be set for regional notification endpoints. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration resend_interval = 478288969; + */ + protected $resend_interval = null; + /** + * How much time (in seconds) is spent attempting notification retries until a successful response is received. Default is 30s. Limit is 20m (1200s). Must be a positive number. + * + * Generated from protobuf field optional uint32 retry_duration_sec = 115681117; + */ + protected $retry_duration_sec = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $authority + * Optional. If specified, this field is used to set the authority header by the sender of notifications. See https://tools.ietf.org/html/rfc7540#section-8.1.2.3 + * @type string $endpoint + * Endpoint to which gRPC notifications are sent. This must be a valid gRPCLB DNS name. + * @type string $payload_name + * Optional. If specified, this field is used to populate the "name" field in gRPC requests. + * @type \Google\Cloud\Compute\V1\Duration $resend_interval + * Optional. This field is used to configure how often to send a full update of all non-healthy backends. If unspecified, full updates are not sent. If specified, must be in the range between 600 seconds to 3600 seconds. Nanos are disallowed. Can only be set for regional notification endpoints. + * @type int $retry_duration_sec + * How much time (in seconds) is spent attempting notification retries until a successful response is received. Default is 30s. Limit is 20m (1200s). Must be a positive number. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Optional. If specified, this field is used to set the authority header by the sender of notifications. See https://tools.ietf.org/html/rfc7540#section-8.1.2.3 + * + * Generated from protobuf field optional string authority = 401868611; + * @return string + */ + public function getAuthority() + { + return isset($this->authority) ? $this->authority : ''; + } + + public function hasAuthority() + { + return isset($this->authority); + } + + public function clearAuthority() + { + unset($this->authority); + } + + /** + * Optional. If specified, this field is used to set the authority header by the sender of notifications. See https://tools.ietf.org/html/rfc7540#section-8.1.2.3 + * + * Generated from protobuf field optional string authority = 401868611; + * @param string $var + * @return $this + */ + public function setAuthority($var) + { + GPBUtil::checkString($var, True); + $this->authority = $var; + + return $this; + } + + /** + * Endpoint to which gRPC notifications are sent. This must be a valid gRPCLB DNS name. + * + * Generated from protobuf field optional string endpoint = 130489749; + * @return string + */ + public function getEndpoint() + { + return isset($this->endpoint) ? $this->endpoint : ''; + } + + public function hasEndpoint() + { + return isset($this->endpoint); + } + + public function clearEndpoint() + { + unset($this->endpoint); + } + + /** + * Endpoint to which gRPC notifications are sent. This must be a valid gRPCLB DNS name. + * + * Generated from protobuf field optional string endpoint = 130489749; + * @param string $var + * @return $this + */ + public function setEndpoint($var) + { + GPBUtil::checkString($var, True); + $this->endpoint = $var; + + return $this; + } + + /** + * Optional. If specified, this field is used to populate the "name" field in gRPC requests. + * + * Generated from protobuf field optional string payload_name = 300358300; + * @return string + */ + public function getPayloadName() + { + return isset($this->payload_name) ? $this->payload_name : ''; + } + + public function hasPayloadName() + { + return isset($this->payload_name); + } + + public function clearPayloadName() + { + unset($this->payload_name); + } + + /** + * Optional. If specified, this field is used to populate the "name" field in gRPC requests. + * + * Generated from protobuf field optional string payload_name = 300358300; + * @param string $var + * @return $this + */ + public function setPayloadName($var) + { + GPBUtil::checkString($var, True); + $this->payload_name = $var; + + return $this; + } + + /** + * Optional. This field is used to configure how often to send a full update of all non-healthy backends. If unspecified, full updates are not sent. If specified, must be in the range between 600 seconds to 3600 seconds. Nanos are disallowed. Can only be set for regional notification endpoints. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration resend_interval = 478288969; + * @return \Google\Cloud\Compute\V1\Duration|null + */ + public function getResendInterval() + { + return $this->resend_interval; + } + + public function hasResendInterval() + { + return isset($this->resend_interval); + } + + public function clearResendInterval() + { + unset($this->resend_interval); + } + + /** + * Optional. This field is used to configure how often to send a full update of all non-healthy backends. If unspecified, full updates are not sent. If specified, must be in the range between 600 seconds to 3600 seconds. Nanos are disallowed. Can only be set for regional notification endpoints. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration resend_interval = 478288969; + * @param \Google\Cloud\Compute\V1\Duration $var + * @return $this + */ + public function setResendInterval($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Duration::class); + $this->resend_interval = $var; + + return $this; + } + + /** + * How much time (in seconds) is spent attempting notification retries until a successful response is received. Default is 30s. Limit is 20m (1200s). Must be a positive number. + * + * Generated from protobuf field optional uint32 retry_duration_sec = 115681117; + * @return int + */ + public function getRetryDurationSec() + { + return isset($this->retry_duration_sec) ? $this->retry_duration_sec : 0; + } + + public function hasRetryDurationSec() + { + return isset($this->retry_duration_sec); + } + + public function clearRetryDurationSec() + { + unset($this->retry_duration_sec); + } + + /** + * How much time (in seconds) is spent attempting notification retries until a successful response is received. Default is 30s. Limit is 20m (1200s). Must be a positive number. + * + * Generated from protobuf field optional uint32 retry_duration_sec = 115681117; + * @param int $var + * @return $this + */ + public function setRetryDurationSec($var) + { + GPBUtil::checkUint32($var); + $this->retry_duration_sec = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NotificationEndpointList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NotificationEndpointList.php new file mode 100644 index 000000000000..64012f6c9434 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NotificationEndpointList.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.NotificationEndpointList + */ +class NotificationEndpointList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of NotificationEndpoint resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NotificationEndpoint items = 100526016; + */ + private $items; + /** + * [Output Only] Type of the resource. Always compute#notificationEndpoint for notification endpoints. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\NotificationEndpoint>|\Google\Protobuf\Internal\RepeatedField $items + * A list of NotificationEndpoint resources. + * @type string $kind + * [Output Only] Type of the resource. Always compute#notificationEndpoint for notification endpoints. + * @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 NotificationEndpoint resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NotificationEndpoint items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of NotificationEndpoint resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NotificationEndpoint items = 100526016; + * @param array<\Google\Cloud\Compute\V1\NotificationEndpoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NotificationEndpoint::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#notificationEndpoint for notification endpoints. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#notificationEndpoint for notification endpoints. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Operation.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Operation.php new file mode 100644 index 000000000000..724a64b06c7a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Operation.php @@ -0,0 +1,1160 @@ +google.cloud.compute.v1.Operation + */ +class Operation extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. + * + * Generated from protobuf field optional string client_operation_id = 297240295; + */ + protected $client_operation_id = null; + /** + * [Deprecated] This field is deprecated. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * [Output Only] A textual description of the operation, which is set when the operation is created. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The time that this operation was completed. This value is in RFC3339 text format. + * + * Generated from protobuf field optional string end_time = 114938801; + */ + protected $end_time = null; + /** + * [Output Only] If errors are generated during processing of the operation, this field will be populated. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Error error = 96784904; + */ + protected $error = null; + /** + * [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`. + * + * Generated from protobuf field optional string http_error_message = 202521945 [(.google.cloud.operation_field) = ERROR_MESSAGE]; + */ + protected $http_error_message = null; + /** + * [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found. + * + * Generated from protobuf field optional int32 http_error_status_code = 312345196 [(.google.cloud.operation_field) = ERROR_CODE]; + */ + protected $http_error_status_code = null; + /** + * [Output Only] The unique identifier for the operation. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] The time that this operation was requested. This value is in RFC3339 text format. + * + * Generated from protobuf field optional string insert_time = 433722515; + */ + protected $insert_time = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.InstancesBulkInsertOperationMetadata instances_bulk_insert_operation_metadata = 89146177; + */ + protected $instances_bulk_insert_operation_metadata = null; + /** + * [Output Only] Type of the resource. Always `compute#operation` for Operation resources. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * [Output Only] Name of the operation. + * + * Generated from protobuf field optional string name = 3373707 [(.google.cloud.operation_field) = NAME]; + */ + protected $name = null; + /** + * [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request. + * + * Generated from protobuf field optional string operation_group_id = 40171187; + */ + protected $operation_group_id = null; + /** + * [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on. + * + * Generated from protobuf field optional string operation_type = 177650450; + */ + protected $operation_type = null; + /** + * [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses. + * + * Generated from protobuf field optional int32 progress = 72663597; + */ + protected $progress = null; + /** + * [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] If the operation is for projects.setCommonInstanceMetadata, this field will contain information on all underlying zonal actions and their state. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SetCommonInstanceMetadataOperationMetadata set_common_instance_metadata_operation_metadata = 490378980; + */ + protected $set_common_instance_metadata_operation_metadata = null; + /** + * [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. + * + * Generated from protobuf field optional string start_time = 37467274; + */ + protected $start_time = null; + /** + * [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Operation.Status status = 181260274 [(.google.cloud.operation_field) = STATUS]; + */ + protected $status = null; + /** + * [Output Only] An optional textual description of the current status of the operation. + * + * Generated from protobuf field optional string status_message = 297428154; + */ + protected $status_message = null; + /** + * [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. + * + * Generated from protobuf field optional uint64 target_id = 258165385; + */ + protected $target_id = null; + /** + * [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from. + * + * Generated from protobuf field optional string target_link = 62671336; + */ + protected $target_link = null; + /** + * [Output Only] User who requested the operation, for example: `user@example.com` or `alice_smith_identifier (global/workforcePools/example-com-us-employees)`. + * + * Generated from protobuf field optional string user = 3599307; + */ + protected $user = null; + /** + * [Output Only] If warning messages are generated during processing of the operation, this field will be populated. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Warnings warnings = 498091095; + */ + private $warnings; + /** + * [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. + * + * Generated from protobuf field optional string zone = 3744684; + */ + protected $zone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $client_operation_id + * [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. + * @type string $creation_timestamp + * [Deprecated] This field is deprecated. + * @type string $description + * [Output Only] A textual description of the operation, which is set when the operation is created. + * @type string $end_time + * [Output Only] The time that this operation was completed. This value is in RFC3339 text format. + * @type \Google\Cloud\Compute\V1\Error $error + * [Output Only] If errors are generated during processing of the operation, this field will be populated. + * @type string $http_error_message + * [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`. + * @type int $http_error_status_code + * [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found. + * @type int|string $id + * [Output Only] The unique identifier for the operation. This identifier is defined by the server. + * @type string $insert_time + * [Output Only] The time that this operation was requested. This value is in RFC3339 text format. + * @type \Google\Cloud\Compute\V1\InstancesBulkInsertOperationMetadata $instances_bulk_insert_operation_metadata + * @type string $kind + * [Output Only] Type of the resource. Always `compute#operation` for Operation resources. + * @type string $name + * [Output Only] Name of the operation. + * @type string $operation_group_id + * [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request. + * @type string $operation_type + * [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on. + * @type int $progress + * [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses. + * @type string $region + * [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type \Google\Cloud\Compute\V1\SetCommonInstanceMetadataOperationMetadata $set_common_instance_metadata_operation_metadata + * [Output Only] If the operation is for projects.setCommonInstanceMetadata, this field will contain information on all underlying zonal actions and their state. + * @type string $start_time + * [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. + * @type int $status + * [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`. + * @type string $status_message + * [Output Only] An optional textual description of the current status of the operation. + * @type int|string $target_id + * [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. + * @type string $target_link + * [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from. + * @type string $user + * [Output Only] User who requested the operation, for example: `user@example.com` or `alice_smith_identifier (global/workforcePools/example-com-us-employees)`. + * @type array<\Google\Cloud\Compute\V1\Warnings>|\Google\Protobuf\Internal\RepeatedField $warnings + * [Output Only] If warning messages are generated during processing of the operation, this field will be populated. + * @type string $zone + * [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. + * + * Generated from protobuf field optional string client_operation_id = 297240295; + * @return string + */ + public function getClientOperationId() + { + return isset($this->client_operation_id) ? $this->client_operation_id : ''; + } + + public function hasClientOperationId() + { + return isset($this->client_operation_id); + } + + public function clearClientOperationId() + { + unset($this->client_operation_id); + } + + /** + * [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. + * + * Generated from protobuf field optional string client_operation_id = 297240295; + * @param string $var + * @return $this + */ + public function setClientOperationId($var) + { + GPBUtil::checkString($var, True); + $this->client_operation_id = $var; + + return $this; + } + + /** + * [Deprecated] This field is deprecated. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Deprecated] This field is deprecated. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * [Output Only] A textual description of the operation, which is set when the operation is created. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * [Output Only] A textual description of the operation, which is set when the operation is created. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The time that this operation was completed. This value is in RFC3339 text format. + * + * Generated from protobuf field optional string end_time = 114938801; + * @return string + */ + public function getEndTime() + { + return isset($this->end_time) ? $this->end_time : ''; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * [Output Only] The time that this operation was completed. This value is in RFC3339 text format. + * + * Generated from protobuf field optional string end_time = 114938801; + * @param string $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkString($var, True); + $this->end_time = $var; + + return $this; + } + + /** + * [Output Only] If errors are generated during processing of the operation, this field will be populated. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Error error = 96784904; + * @return \Google\Cloud\Compute\V1\Error|null + */ + public function getError() + { + return $this->error; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * [Output Only] If errors are generated during processing of the operation, this field will be populated. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Error error = 96784904; + * @param \Google\Cloud\Compute\V1\Error $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Error::class); + $this->error = $var; + + return $this; + } + + /** + * [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`. + * + * Generated from protobuf field optional string http_error_message = 202521945 [(.google.cloud.operation_field) = ERROR_MESSAGE]; + * @return string + */ + public function getHttpErrorMessage() + { + return isset($this->http_error_message) ? $this->http_error_message : ''; + } + + public function hasHttpErrorMessage() + { + return isset($this->http_error_message); + } + + public function clearHttpErrorMessage() + { + unset($this->http_error_message); + } + + /** + * [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`. + * + * Generated from protobuf field optional string http_error_message = 202521945 [(.google.cloud.operation_field) = ERROR_MESSAGE]; + * @param string $var + * @return $this + */ + public function setHttpErrorMessage($var) + { + GPBUtil::checkString($var, True); + $this->http_error_message = $var; + + return $this; + } + + /** + * [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found. + * + * Generated from protobuf field optional int32 http_error_status_code = 312345196 [(.google.cloud.operation_field) = ERROR_CODE]; + * @return int + */ + public function getHttpErrorStatusCode() + { + return isset($this->http_error_status_code) ? $this->http_error_status_code : 0; + } + + public function hasHttpErrorStatusCode() + { + return isset($this->http_error_status_code); + } + + public function clearHttpErrorStatusCode() + { + unset($this->http_error_status_code); + } + + /** + * [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found. + * + * Generated from protobuf field optional int32 http_error_status_code = 312345196 [(.google.cloud.operation_field) = ERROR_CODE]; + * @param int $var + * @return $this + */ + public function setHttpErrorStatusCode($var) + { + GPBUtil::checkInt32($var); + $this->http_error_status_code = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the operation. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the operation. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] The time that this operation was requested. This value is in RFC3339 text format. + * + * Generated from protobuf field optional string insert_time = 433722515; + * @return string + */ + public function getInsertTime() + { + return isset($this->insert_time) ? $this->insert_time : ''; + } + + public function hasInsertTime() + { + return isset($this->insert_time); + } + + public function clearInsertTime() + { + unset($this->insert_time); + } + + /** + * [Output Only] The time that this operation was requested. This value is in RFC3339 text format. + * + * Generated from protobuf field optional string insert_time = 433722515; + * @param string $var + * @return $this + */ + public function setInsertTime($var) + { + GPBUtil::checkString($var, True); + $this->insert_time = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.InstancesBulkInsertOperationMetadata instances_bulk_insert_operation_metadata = 89146177; + * @return \Google\Cloud\Compute\V1\InstancesBulkInsertOperationMetadata|null + */ + public function getInstancesBulkInsertOperationMetadata() + { + return $this->instances_bulk_insert_operation_metadata; + } + + public function hasInstancesBulkInsertOperationMetadata() + { + return isset($this->instances_bulk_insert_operation_metadata); + } + + public function clearInstancesBulkInsertOperationMetadata() + { + unset($this->instances_bulk_insert_operation_metadata); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.InstancesBulkInsertOperationMetadata instances_bulk_insert_operation_metadata = 89146177; + * @param \Google\Cloud\Compute\V1\InstancesBulkInsertOperationMetadata $var + * @return $this + */ + public function setInstancesBulkInsertOperationMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstancesBulkInsertOperationMetadata::class); + $this->instances_bulk_insert_operation_metadata = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always `compute#operation` for Operation resources. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always `compute#operation` for Operation resources. + * + * 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] Name of the operation. + * + * Generated from protobuf field optional string name = 3373707 [(.google.cloud.operation_field) = NAME]; + * @return string + */ + public function getName() + { + return isset($this->name) ? $this->name : ''; + } + + public function hasName() + { + return isset($this->name); + } + + public function clearName() + { + unset($this->name); + } + + /** + * [Output Only] Name of the operation. + * + * Generated from protobuf field optional string name = 3373707 [(.google.cloud.operation_field) = NAME]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request. + * + * Generated from protobuf field optional string operation_group_id = 40171187; + * @return string + */ + public function getOperationGroupId() + { + return isset($this->operation_group_id) ? $this->operation_group_id : ''; + } + + public function hasOperationGroupId() + { + return isset($this->operation_group_id); + } + + public function clearOperationGroupId() + { + unset($this->operation_group_id); + } + + /** + * [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request. + * + * Generated from protobuf field optional string operation_group_id = 40171187; + * @param string $var + * @return $this + */ + public function setOperationGroupId($var) + { + GPBUtil::checkString($var, True); + $this->operation_group_id = $var; + + return $this; + } + + /** + * [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on. + * + * Generated from protobuf field optional string operation_type = 177650450; + * @return string + */ + public function getOperationType() + { + return isset($this->operation_type) ? $this->operation_type : ''; + } + + public function hasOperationType() + { + return isset($this->operation_type); + } + + public function clearOperationType() + { + unset($this->operation_type); + } + + /** + * [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on. + * + * Generated from protobuf field optional string operation_type = 177650450; + * @param string $var + * @return $this + */ + public function setOperationType($var) + { + GPBUtil::checkString($var, True); + $this->operation_type = $var; + + return $this; + } + + /** + * [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses. + * + * Generated from protobuf field optional int32 progress = 72663597; + * @return int + */ + public function getProgress() + { + return isset($this->progress) ? $this->progress : 0; + } + + public function hasProgress() + { + return isset($this->progress); + } + + public function clearProgress() + { + unset($this->progress); + } + + /** + * [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses. + * + * Generated from protobuf field optional int32 progress = 72663597; + * @param int $var + * @return $this + */ + public function setProgress($var) + { + GPBUtil::checkInt32($var); + $this->progress = $var; + + return $this; + } + + /** + * [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. + * + * 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] The URL of the region where the operation resides. Only applicable when performing regional operations. + * + * 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] Server-defined URL for the 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 the 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] If the operation is for projects.setCommonInstanceMetadata, this field will contain information on all underlying zonal actions and their state. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SetCommonInstanceMetadataOperationMetadata set_common_instance_metadata_operation_metadata = 490378980; + * @return \Google\Cloud\Compute\V1\SetCommonInstanceMetadataOperationMetadata|null + */ + public function getSetCommonInstanceMetadataOperationMetadata() + { + return $this->set_common_instance_metadata_operation_metadata; + } + + public function hasSetCommonInstanceMetadataOperationMetadata() + { + return isset($this->set_common_instance_metadata_operation_metadata); + } + + public function clearSetCommonInstanceMetadataOperationMetadata() + { + unset($this->set_common_instance_metadata_operation_metadata); + } + + /** + * [Output Only] If the operation is for projects.setCommonInstanceMetadata, this field will contain information on all underlying zonal actions and their state. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SetCommonInstanceMetadataOperationMetadata set_common_instance_metadata_operation_metadata = 490378980; + * @param \Google\Cloud\Compute\V1\SetCommonInstanceMetadataOperationMetadata $var + * @return $this + */ + public function setSetCommonInstanceMetadataOperationMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SetCommonInstanceMetadataOperationMetadata::class); + $this->set_common_instance_metadata_operation_metadata = $var; + + return $this; + } + + /** + * [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. + * + * Generated from protobuf field optional string start_time = 37467274; + * @return string + */ + public function getStartTime() + { + return isset($this->start_time) ? $this->start_time : ''; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. + * + * Generated from protobuf field optional string start_time = 37467274; + * @param string $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkString($var, True); + $this->start_time = $var; + + return $this; + } + + /** + * [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Operation.Status status = 181260274 [(.google.cloud.operation_field) = STATUS]; + * @return int + */ + public function getStatus() + { + return isset($this->status) ? $this->status : 0; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Operation.Status status = 181260274 [(.google.cloud.operation_field) = STATUS]; + * @param int $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Compute\V1\Operation\Status::class); + $this->status = $var; + + return $this; + } + + /** + * [Output Only] An optional textual description of the current status of the operation. + * + * Generated from protobuf field optional string status_message = 297428154; + * @return string + */ + public function getStatusMessage() + { + return isset($this->status_message) ? $this->status_message : ''; + } + + public function hasStatusMessage() + { + return isset($this->status_message); + } + + public function clearStatusMessage() + { + unset($this->status_message); + } + + /** + * [Output Only] An optional textual description of the current status of the operation. + * + * Generated from protobuf field optional string status_message = 297428154; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. + * + * Generated from protobuf field optional uint64 target_id = 258165385; + * @return int|string + */ + public function getTargetId() + { + return isset($this->target_id) ? $this->target_id : 0; + } + + public function hasTargetId() + { + return isset($this->target_id); + } + + public function clearTargetId() + { + unset($this->target_id); + } + + /** + * [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. + * + * Generated from protobuf field optional uint64 target_id = 258165385; + * @param int|string $var + * @return $this + */ + public function setTargetId($var) + { + GPBUtil::checkUint64($var); + $this->target_id = $var; + + return $this; + } + + /** + * [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from. + * + * Generated from protobuf field optional string target_link = 62671336; + * @return string + */ + public function getTargetLink() + { + return isset($this->target_link) ? $this->target_link : ''; + } + + public function hasTargetLink() + { + return isset($this->target_link); + } + + public function clearTargetLink() + { + unset($this->target_link); + } + + /** + * [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from. + * + * Generated from protobuf field optional string target_link = 62671336; + * @param string $var + * @return $this + */ + public function setTargetLink($var) + { + GPBUtil::checkString($var, True); + $this->target_link = $var; + + return $this; + } + + /** + * [Output Only] User who requested the operation, for example: `user@example.com` or `alice_smith_identifier (global/workforcePools/example-com-us-employees)`. + * + * Generated from protobuf field optional string user = 3599307; + * @return string + */ + public function getUser() + { + return isset($this->user) ? $this->user : ''; + } + + public function hasUser() + { + return isset($this->user); + } + + public function clearUser() + { + unset($this->user); + } + + /** + * [Output Only] User who requested the operation, for example: `user@example.com` or `alice_smith_identifier (global/workforcePools/example-com-us-employees)`. + * + * Generated from protobuf field optional string user = 3599307; + * @param string $var + * @return $this + */ + public function setUser($var) + { + GPBUtil::checkString($var, True); + $this->user = $var; + + return $this; + } + + /** + * [Output Only] If warning messages are generated during processing of the operation, this field will be populated. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Warnings warnings = 498091095; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWarnings() + { + return $this->warnings; + } + + /** + * [Output Only] If warning messages are generated during processing of the operation, this field will be populated. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Warnings warnings = 498091095; + * @param array<\Google\Cloud\Compute\V1\Warnings>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWarnings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Warnings::class); + $this->warnings = $arr; + + return $this; + } + + /** + * [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. + * + * Generated from protobuf field optional string zone = 3744684; + * @return string + */ + public function getZone() + { + return isset($this->zone) ? $this->zone : ''; + } + + public function hasZone() + { + return isset($this->zone); + } + + public function clearZone() + { + unset($this->zone); + } + + /** + * [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. + * + * Generated from protobuf field optional string zone = 3744684; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Operation/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Operation/Status.php new file mode 100644 index 000000000000..f977b852c173 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Operation/Status.php @@ -0,0 +1,65 @@ +google.cloud.compute.v1.Operation.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * Generated from protobuf enum DONE = 2104194; + */ + const DONE = 2104194; + /** + * Generated from protobuf enum PENDING = 35394935; + */ + const PENDING = 35394935; + /** + * Generated from protobuf enum RUNNING = 121282975; + */ + const RUNNING = 121282975; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::DONE => 'DONE', + self::PENDING => 'PENDING', + self::RUNNING => 'RUNNING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\Operation_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/OperationAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/OperationAggregatedList.php new file mode 100644 index 000000000000..b8d11d96277f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/OperationAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.OperationAggregatedList + */ +class OperationAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * [Output Only] A map of scoped operation lists. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always `compute#operationAggregatedList` for aggregated lists of operations. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type array|\Google\Protobuf\Internal\MapField $items + * [Output Only] A map of scoped operation lists. + * @type string $kind + * [Output Only] Type of resource. Always `compute#operationAggregatedList` for aggregated lists of operations. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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] The unique identifier for the resource. This identifier is 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] The unique identifier for the resource. This identifier is 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; + } + + /** + * [Output Only] A map of scoped operation lists. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * [Output Only] A map of scoped operation lists. + * + * 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\OperationsScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always `compute#operationAggregatedList` for aggregated lists of operations. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always `compute#operationAggregatedList` for aggregated lists of operations. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/OperationList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/OperationList.php new file mode 100644 index 000000000000..6cdbe3aaed6e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/OperationList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.OperationList + */ +class OperationList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * [Output Only] A list of Operation resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Operation items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always `compute#operations` for Operations resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type array<\Google\Cloud\Compute\V1\Operation>|\Google\Protobuf\Internal\RepeatedField $items + * [Output Only] A list of Operation resources. + * @type string $kind + * [Output Only] Type of resource. Always `compute#operations` for Operations 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] The unique identifier for the resource. This identifier is 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] The unique identifier for the resource. This identifier is 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; + } + + /** + * [Output Only] A list of Operation resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Operation items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * [Output Only] A list of Operation resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Operation items = 100526016; + * @param array<\Google\Cloud\Compute\V1\Operation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Operation::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always `compute#operations` for Operations 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); + } + + /** + * [Output Only] Type of resource. Always `compute#operations` for Operations 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/OperationsScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/OperationsScopedList.php new file mode 100644 index 000000000000..4b6756432425 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/OperationsScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.OperationsScopedList + */ +class OperationsScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A list of operations contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Operation operations = 4184044; + */ + private $operations; + /** + * [Output Only] Informational warning which replaces the list of operations when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\Operation>|\Google\Protobuf\Internal\RepeatedField $operations + * [Output Only] A list of operations contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] Informational warning which replaces the list of operations 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 operations contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Operation operations = 4184044; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOperations() + { + return $this->operations; + } + + /** + * [Output Only] A list of operations contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Operation operations = 4184044; + * @param array<\Google\Cloud\Compute\V1\Operation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOperations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Operation::class); + $this->operations = $arr; + + return $this; + } + + /** + * [Output Only] Informational warning which replaces the list of operations 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] Informational warning which replaces the list of operations 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/OutlierDetection.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/OutlierDetection.php new file mode 100644 index 000000000000..d91a5b4cdbf5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/OutlierDetection.php @@ -0,0 +1,517 @@ +google.cloud.compute.v1.OutlierDetection + */ +class OutlierDetection extends \Google\Protobuf\Internal\Message +{ + /** + * The base time that a backend endpoint is ejected for. Defaults to 30000ms or 30s. After a backend endpoint is returned back to the load balancing pool, it can be ejected again in another ejection analysis. Thus, the total ejection time is equal to the base ejection time multiplied by the number of times the backend endpoint has been ejected. Defaults to 30000ms or 30s. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration base_ejection_time = 80997255; + */ + protected $base_ejection_time = null; + /** + * Number of consecutive errors before a backend endpoint is ejected from the load balancing pool. When the backend endpoint is accessed over HTTP, a 5xx return code qualifies as an error. Defaults to 5. + * + * Generated from protobuf field optional int32 consecutive_errors = 387193248; + */ + protected $consecutive_errors = null; + /** + * The number of consecutive gateway failures (502, 503, 504 status or connection errors that are mapped to one of those status codes) before a consecutive gateway failure ejection occurs. Defaults to 3. + * + * Generated from protobuf field optional int32 consecutive_gateway_failure = 417504250; + */ + protected $consecutive_gateway_failure = null; + /** + * The percentage chance that a backend endpoint will be ejected when an outlier status is detected through consecutive 5xx. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 0. + * + * Generated from protobuf field optional int32 enforcing_consecutive_errors = 213133760; + */ + protected $enforcing_consecutive_errors = null; + /** + * The percentage chance that a backend endpoint will be ejected when an outlier status is detected through consecutive gateway failures. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 100. + * + * Generated from protobuf field optional int32 enforcing_consecutive_gateway_failure = 394440666; + */ + protected $enforcing_consecutive_gateway_failure = null; + /** + * The percentage chance that a backend endpoint will be ejected when an outlier status is detected through success rate statistics. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 100. Not supported when the backend service uses Serverless NEG. + * + * Generated from protobuf field optional int32 enforcing_success_rate = 194508732; + */ + protected $enforcing_success_rate = null; + /** + * Time interval between ejection analysis sweeps. This can result in both new ejections and backend endpoints being returned to service. The interval is equal to the number of seconds as defined in outlierDetection.interval.seconds plus the number of nanoseconds as defined in outlierDetection.interval.nanos. Defaults to 1 second. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration interval = 33547461; + */ + protected $interval = null; + /** + * Maximum percentage of backend endpoints in the load balancing pool for the backend service that can be ejected if the ejection conditions are met. Defaults to 50%. + * + * Generated from protobuf field optional int32 max_ejection_percent = 18436888; + */ + protected $max_ejection_percent = null; + /** + * The number of backend endpoints in the load balancing pool that must have enough request volume to detect success rate outliers. If the number of backend endpoints is fewer than this setting, outlier detection via success rate statistics is not performed for any backend endpoint in the load balancing pool. Defaults to 5. Not supported when the backend service uses Serverless NEG. + * + * Generated from protobuf field optional int32 success_rate_minimum_hosts = 525766903; + */ + protected $success_rate_minimum_hosts = null; + /** + * The minimum number of total requests that must be collected in one interval (as defined by the interval duration above) to include this backend endpoint in success rate based outlier detection. If the volume is lower than this setting, outlier detection via success rate statistics is not performed for that backend endpoint. Defaults to 100. Not supported when the backend service uses Serverless NEG. + * + * Generated from protobuf field optional int32 success_rate_request_volume = 281425357; + */ + protected $success_rate_request_volume = null; + /** + * This factor is used to determine the ejection threshold for success rate outlier ejection. The ejection threshold is the difference between the mean success rate, and the product of this factor and the standard deviation of the mean success rate: mean - (stdev * successRateStdevFactor). This factor is divided by a thousand to get a double. That is, if the desired factor is 1.9, the runtime value should be 1900. Defaults to 1900. Not supported when the backend service uses Serverless NEG. + * + * Generated from protobuf field optional int32 success_rate_stdev_factor = 174735773; + */ + protected $success_rate_stdev_factor = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\Duration $base_ejection_time + * The base time that a backend endpoint is ejected for. Defaults to 30000ms or 30s. After a backend endpoint is returned back to the load balancing pool, it can be ejected again in another ejection analysis. Thus, the total ejection time is equal to the base ejection time multiplied by the number of times the backend endpoint has been ejected. Defaults to 30000ms or 30s. + * @type int $consecutive_errors + * Number of consecutive errors before a backend endpoint is ejected from the load balancing pool. When the backend endpoint is accessed over HTTP, a 5xx return code qualifies as an error. Defaults to 5. + * @type int $consecutive_gateway_failure + * The number of consecutive gateway failures (502, 503, 504 status or connection errors that are mapped to one of those status codes) before a consecutive gateway failure ejection occurs. Defaults to 3. + * @type int $enforcing_consecutive_errors + * The percentage chance that a backend endpoint will be ejected when an outlier status is detected through consecutive 5xx. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 0. + * @type int $enforcing_consecutive_gateway_failure + * The percentage chance that a backend endpoint will be ejected when an outlier status is detected through consecutive gateway failures. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 100. + * @type int $enforcing_success_rate + * The percentage chance that a backend endpoint will be ejected when an outlier status is detected through success rate statistics. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 100. Not supported when the backend service uses Serverless NEG. + * @type \Google\Cloud\Compute\V1\Duration $interval + * Time interval between ejection analysis sweeps. This can result in both new ejections and backend endpoints being returned to service. The interval is equal to the number of seconds as defined in outlierDetection.interval.seconds plus the number of nanoseconds as defined in outlierDetection.interval.nanos. Defaults to 1 second. + * @type int $max_ejection_percent + * Maximum percentage of backend endpoints in the load balancing pool for the backend service that can be ejected if the ejection conditions are met. Defaults to 50%. + * @type int $success_rate_minimum_hosts + * The number of backend endpoints in the load balancing pool that must have enough request volume to detect success rate outliers. If the number of backend endpoints is fewer than this setting, outlier detection via success rate statistics is not performed for any backend endpoint in the load balancing pool. Defaults to 5. Not supported when the backend service uses Serverless NEG. + * @type int $success_rate_request_volume + * The minimum number of total requests that must be collected in one interval (as defined by the interval duration above) to include this backend endpoint in success rate based outlier detection. If the volume is lower than this setting, outlier detection via success rate statistics is not performed for that backend endpoint. Defaults to 100. Not supported when the backend service uses Serverless NEG. + * @type int $success_rate_stdev_factor + * This factor is used to determine the ejection threshold for success rate outlier ejection. The ejection threshold is the difference between the mean success rate, and the product of this factor and the standard deviation of the mean success rate: mean - (stdev * successRateStdevFactor). This factor is divided by a thousand to get a double. That is, if the desired factor is 1.9, the runtime value should be 1900. Defaults to 1900. Not supported when the backend service uses Serverless NEG. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The base time that a backend endpoint is ejected for. Defaults to 30000ms or 30s. After a backend endpoint is returned back to the load balancing pool, it can be ejected again in another ejection analysis. Thus, the total ejection time is equal to the base ejection time multiplied by the number of times the backend endpoint has been ejected. Defaults to 30000ms or 30s. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration base_ejection_time = 80997255; + * @return \Google\Cloud\Compute\V1\Duration|null + */ + public function getBaseEjectionTime() + { + return $this->base_ejection_time; + } + + public function hasBaseEjectionTime() + { + return isset($this->base_ejection_time); + } + + public function clearBaseEjectionTime() + { + unset($this->base_ejection_time); + } + + /** + * The base time that a backend endpoint is ejected for. Defaults to 30000ms or 30s. After a backend endpoint is returned back to the load balancing pool, it can be ejected again in another ejection analysis. Thus, the total ejection time is equal to the base ejection time multiplied by the number of times the backend endpoint has been ejected. Defaults to 30000ms or 30s. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration base_ejection_time = 80997255; + * @param \Google\Cloud\Compute\V1\Duration $var + * @return $this + */ + public function setBaseEjectionTime($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Duration::class); + $this->base_ejection_time = $var; + + return $this; + } + + /** + * Number of consecutive errors before a backend endpoint is ejected from the load balancing pool. When the backend endpoint is accessed over HTTP, a 5xx return code qualifies as an error. Defaults to 5. + * + * Generated from protobuf field optional int32 consecutive_errors = 387193248; + * @return int + */ + public function getConsecutiveErrors() + { + return isset($this->consecutive_errors) ? $this->consecutive_errors : 0; + } + + public function hasConsecutiveErrors() + { + return isset($this->consecutive_errors); + } + + public function clearConsecutiveErrors() + { + unset($this->consecutive_errors); + } + + /** + * Number of consecutive errors before a backend endpoint is ejected from the load balancing pool. When the backend endpoint is accessed over HTTP, a 5xx return code qualifies as an error. Defaults to 5. + * + * Generated from protobuf field optional int32 consecutive_errors = 387193248; + * @param int $var + * @return $this + */ + public function setConsecutiveErrors($var) + { + GPBUtil::checkInt32($var); + $this->consecutive_errors = $var; + + return $this; + } + + /** + * The number of consecutive gateway failures (502, 503, 504 status or connection errors that are mapped to one of those status codes) before a consecutive gateway failure ejection occurs. Defaults to 3. + * + * Generated from protobuf field optional int32 consecutive_gateway_failure = 417504250; + * @return int + */ + public function getConsecutiveGatewayFailure() + { + return isset($this->consecutive_gateway_failure) ? $this->consecutive_gateway_failure : 0; + } + + public function hasConsecutiveGatewayFailure() + { + return isset($this->consecutive_gateway_failure); + } + + public function clearConsecutiveGatewayFailure() + { + unset($this->consecutive_gateway_failure); + } + + /** + * The number of consecutive gateway failures (502, 503, 504 status or connection errors that are mapped to one of those status codes) before a consecutive gateway failure ejection occurs. Defaults to 3. + * + * Generated from protobuf field optional int32 consecutive_gateway_failure = 417504250; + * @param int $var + * @return $this + */ + public function setConsecutiveGatewayFailure($var) + { + GPBUtil::checkInt32($var); + $this->consecutive_gateway_failure = $var; + + return $this; + } + + /** + * The percentage chance that a backend endpoint will be ejected when an outlier status is detected through consecutive 5xx. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 0. + * + * Generated from protobuf field optional int32 enforcing_consecutive_errors = 213133760; + * @return int + */ + public function getEnforcingConsecutiveErrors() + { + return isset($this->enforcing_consecutive_errors) ? $this->enforcing_consecutive_errors : 0; + } + + public function hasEnforcingConsecutiveErrors() + { + return isset($this->enforcing_consecutive_errors); + } + + public function clearEnforcingConsecutiveErrors() + { + unset($this->enforcing_consecutive_errors); + } + + /** + * The percentage chance that a backend endpoint will be ejected when an outlier status is detected through consecutive 5xx. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 0. + * + * Generated from protobuf field optional int32 enforcing_consecutive_errors = 213133760; + * @param int $var + * @return $this + */ + public function setEnforcingConsecutiveErrors($var) + { + GPBUtil::checkInt32($var); + $this->enforcing_consecutive_errors = $var; + + return $this; + } + + /** + * The percentage chance that a backend endpoint will be ejected when an outlier status is detected through consecutive gateway failures. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 100. + * + * Generated from protobuf field optional int32 enforcing_consecutive_gateway_failure = 394440666; + * @return int + */ + public function getEnforcingConsecutiveGatewayFailure() + { + return isset($this->enforcing_consecutive_gateway_failure) ? $this->enforcing_consecutive_gateway_failure : 0; + } + + public function hasEnforcingConsecutiveGatewayFailure() + { + return isset($this->enforcing_consecutive_gateway_failure); + } + + public function clearEnforcingConsecutiveGatewayFailure() + { + unset($this->enforcing_consecutive_gateway_failure); + } + + /** + * The percentage chance that a backend endpoint will be ejected when an outlier status is detected through consecutive gateway failures. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 100. + * + * Generated from protobuf field optional int32 enforcing_consecutive_gateway_failure = 394440666; + * @param int $var + * @return $this + */ + public function setEnforcingConsecutiveGatewayFailure($var) + { + GPBUtil::checkInt32($var); + $this->enforcing_consecutive_gateway_failure = $var; + + return $this; + } + + /** + * The percentage chance that a backend endpoint will be ejected when an outlier status is detected through success rate statistics. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 100. Not supported when the backend service uses Serverless NEG. + * + * Generated from protobuf field optional int32 enforcing_success_rate = 194508732; + * @return int + */ + public function getEnforcingSuccessRate() + { + return isset($this->enforcing_success_rate) ? $this->enforcing_success_rate : 0; + } + + public function hasEnforcingSuccessRate() + { + return isset($this->enforcing_success_rate); + } + + public function clearEnforcingSuccessRate() + { + unset($this->enforcing_success_rate); + } + + /** + * The percentage chance that a backend endpoint will be ejected when an outlier status is detected through success rate statistics. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 100. Not supported when the backend service uses Serverless NEG. + * + * Generated from protobuf field optional int32 enforcing_success_rate = 194508732; + * @param int $var + * @return $this + */ + public function setEnforcingSuccessRate($var) + { + GPBUtil::checkInt32($var); + $this->enforcing_success_rate = $var; + + return $this; + } + + /** + * Time interval between ejection analysis sweeps. This can result in both new ejections and backend endpoints being returned to service. The interval is equal to the number of seconds as defined in outlierDetection.interval.seconds plus the number of nanoseconds as defined in outlierDetection.interval.nanos. Defaults to 1 second. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration interval = 33547461; + * @return \Google\Cloud\Compute\V1\Duration|null + */ + public function getInterval() + { + return $this->interval; + } + + public function hasInterval() + { + return isset($this->interval); + } + + public function clearInterval() + { + unset($this->interval); + } + + /** + * Time interval between ejection analysis sweeps. This can result in both new ejections and backend endpoints being returned to service. The interval is equal to the number of seconds as defined in outlierDetection.interval.seconds plus the number of nanoseconds as defined in outlierDetection.interval.nanos. Defaults to 1 second. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration interval = 33547461; + * @param \Google\Cloud\Compute\V1\Duration $var + * @return $this + */ + public function setInterval($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Duration::class); + $this->interval = $var; + + return $this; + } + + /** + * Maximum percentage of backend endpoints in the load balancing pool for the backend service that can be ejected if the ejection conditions are met. Defaults to 50%. + * + * Generated from protobuf field optional int32 max_ejection_percent = 18436888; + * @return int + */ + public function getMaxEjectionPercent() + { + return isset($this->max_ejection_percent) ? $this->max_ejection_percent : 0; + } + + public function hasMaxEjectionPercent() + { + return isset($this->max_ejection_percent); + } + + public function clearMaxEjectionPercent() + { + unset($this->max_ejection_percent); + } + + /** + * Maximum percentage of backend endpoints in the load balancing pool for the backend service that can be ejected if the ejection conditions are met. Defaults to 50%. + * + * Generated from protobuf field optional int32 max_ejection_percent = 18436888; + * @param int $var + * @return $this + */ + public function setMaxEjectionPercent($var) + { + GPBUtil::checkInt32($var); + $this->max_ejection_percent = $var; + + return $this; + } + + /** + * The number of backend endpoints in the load balancing pool that must have enough request volume to detect success rate outliers. If the number of backend endpoints is fewer than this setting, outlier detection via success rate statistics is not performed for any backend endpoint in the load balancing pool. Defaults to 5. Not supported when the backend service uses Serverless NEG. + * + * Generated from protobuf field optional int32 success_rate_minimum_hosts = 525766903; + * @return int + */ + public function getSuccessRateMinimumHosts() + { + return isset($this->success_rate_minimum_hosts) ? $this->success_rate_minimum_hosts : 0; + } + + public function hasSuccessRateMinimumHosts() + { + return isset($this->success_rate_minimum_hosts); + } + + public function clearSuccessRateMinimumHosts() + { + unset($this->success_rate_minimum_hosts); + } + + /** + * The number of backend endpoints in the load balancing pool that must have enough request volume to detect success rate outliers. If the number of backend endpoints is fewer than this setting, outlier detection via success rate statistics is not performed for any backend endpoint in the load balancing pool. Defaults to 5. Not supported when the backend service uses Serverless NEG. + * + * Generated from protobuf field optional int32 success_rate_minimum_hosts = 525766903; + * @param int $var + * @return $this + */ + public function setSuccessRateMinimumHosts($var) + { + GPBUtil::checkInt32($var); + $this->success_rate_minimum_hosts = $var; + + return $this; + } + + /** + * The minimum number of total requests that must be collected in one interval (as defined by the interval duration above) to include this backend endpoint in success rate based outlier detection. If the volume is lower than this setting, outlier detection via success rate statistics is not performed for that backend endpoint. Defaults to 100. Not supported when the backend service uses Serverless NEG. + * + * Generated from protobuf field optional int32 success_rate_request_volume = 281425357; + * @return int + */ + public function getSuccessRateRequestVolume() + { + return isset($this->success_rate_request_volume) ? $this->success_rate_request_volume : 0; + } + + public function hasSuccessRateRequestVolume() + { + return isset($this->success_rate_request_volume); + } + + public function clearSuccessRateRequestVolume() + { + unset($this->success_rate_request_volume); + } + + /** + * The minimum number of total requests that must be collected in one interval (as defined by the interval duration above) to include this backend endpoint in success rate based outlier detection. If the volume is lower than this setting, outlier detection via success rate statistics is not performed for that backend endpoint. Defaults to 100. Not supported when the backend service uses Serverless NEG. + * + * Generated from protobuf field optional int32 success_rate_request_volume = 281425357; + * @param int $var + * @return $this + */ + public function setSuccessRateRequestVolume($var) + { + GPBUtil::checkInt32($var); + $this->success_rate_request_volume = $var; + + return $this; + } + + /** + * This factor is used to determine the ejection threshold for success rate outlier ejection. The ejection threshold is the difference between the mean success rate, and the product of this factor and the standard deviation of the mean success rate: mean - (stdev * successRateStdevFactor). This factor is divided by a thousand to get a double. That is, if the desired factor is 1.9, the runtime value should be 1900. Defaults to 1900. Not supported when the backend service uses Serverless NEG. + * + * Generated from protobuf field optional int32 success_rate_stdev_factor = 174735773; + * @return int + */ + public function getSuccessRateStdevFactor() + { + return isset($this->success_rate_stdev_factor) ? $this->success_rate_stdev_factor : 0; + } + + public function hasSuccessRateStdevFactor() + { + return isset($this->success_rate_stdev_factor); + } + + public function clearSuccessRateStdevFactor() + { + unset($this->success_rate_stdev_factor); + } + + /** + * This factor is used to determine the ejection threshold for success rate outlier ejection. The ejection threshold is the difference between the mean success rate, and the product of this factor and the standard deviation of the mean success rate: mean - (stdev * successRateStdevFactor). This factor is divided by a thousand to get a double. That is, if the desired factor is 1.9, the runtime value should be 1900. Defaults to 1900. Not supported when the backend service uses Serverless NEG. + * + * Generated from protobuf field optional int32 success_rate_stdev_factor = 174735773; + * @param int $var + * @return $this + */ + public function setSuccessRateStdevFactor($var) + { + GPBUtil::checkInt32($var); + $this->success_rate_stdev_factor = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketIntervals.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketIntervals.php new file mode 100644 index 000000000000..3db89e2bb0a2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketIntervals.php @@ -0,0 +1,305 @@ +google.cloud.compute.v1.PacketIntervals + */ +class PacketIntervals extends \Google\Protobuf\Internal\Message +{ + /** + * Average observed inter-packet interval in milliseconds. + * + * Generated from protobuf field optional int64 avg_ms = 204811827; + */ + protected $avg_ms = null; + /** + * From how long ago in the past these intervals were observed. + * Check the Duration enum for the list of possible values. + * + * Generated from protobuf field optional string duration = 155471252; + */ + protected $duration = null; + /** + * Maximum observed inter-packet interval in milliseconds. + * + * Generated from protobuf field optional int64 max_ms = 529474145; + */ + protected $max_ms = null; + /** + * Minimum observed inter-packet interval in milliseconds. + * + * Generated from protobuf field optional int64 min_ms = 536564403; + */ + protected $min_ms = null; + /** + * Number of inter-packet intervals from which these statistics were derived. + * + * Generated from protobuf field optional int64 num_intervals = 186329813; + */ + protected $num_intervals = null; + /** + * The type of packets for which inter-packet intervals were computed. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $avg_ms + * Average observed inter-packet interval in milliseconds. + * @type string $duration + * From how long ago in the past these intervals were observed. + * Check the Duration enum for the list of possible values. + * @type int|string $max_ms + * Maximum observed inter-packet interval in milliseconds. + * @type int|string $min_ms + * Minimum observed inter-packet interval in milliseconds. + * @type int|string $num_intervals + * Number of inter-packet intervals from which these statistics were derived. + * @type string $type + * The type of packets for which inter-packet intervals were computed. + * Check the Type enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Average observed inter-packet interval in milliseconds. + * + * Generated from protobuf field optional int64 avg_ms = 204811827; + * @return int|string + */ + public function getAvgMs() + { + return isset($this->avg_ms) ? $this->avg_ms : 0; + } + + public function hasAvgMs() + { + return isset($this->avg_ms); + } + + public function clearAvgMs() + { + unset($this->avg_ms); + } + + /** + * Average observed inter-packet interval in milliseconds. + * + * Generated from protobuf field optional int64 avg_ms = 204811827; + * @param int|string $var + * @return $this + */ + public function setAvgMs($var) + { + GPBUtil::checkInt64($var); + $this->avg_ms = $var; + + return $this; + } + + /** + * From how long ago in the past these intervals were observed. + * Check the Duration enum for the list of possible values. + * + * Generated from protobuf field optional string duration = 155471252; + * @return string + */ + public function getDuration() + { + return isset($this->duration) ? $this->duration : ''; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * From how long ago in the past these intervals were observed. + * Check the Duration enum for the list of possible values. + * + * Generated from protobuf field optional string duration = 155471252; + * @param string $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkString($var, True); + $this->duration = $var; + + return $this; + } + + /** + * Maximum observed inter-packet interval in milliseconds. + * + * Generated from protobuf field optional int64 max_ms = 529474145; + * @return int|string + */ + public function getMaxMs() + { + return isset($this->max_ms) ? $this->max_ms : 0; + } + + public function hasMaxMs() + { + return isset($this->max_ms); + } + + public function clearMaxMs() + { + unset($this->max_ms); + } + + /** + * Maximum observed inter-packet interval in milliseconds. + * + * Generated from protobuf field optional int64 max_ms = 529474145; + * @param int|string $var + * @return $this + */ + public function setMaxMs($var) + { + GPBUtil::checkInt64($var); + $this->max_ms = $var; + + return $this; + } + + /** + * Minimum observed inter-packet interval in milliseconds. + * + * Generated from protobuf field optional int64 min_ms = 536564403; + * @return int|string + */ + public function getMinMs() + { + return isset($this->min_ms) ? $this->min_ms : 0; + } + + public function hasMinMs() + { + return isset($this->min_ms); + } + + public function clearMinMs() + { + unset($this->min_ms); + } + + /** + * Minimum observed inter-packet interval in milliseconds. + * + * Generated from protobuf field optional int64 min_ms = 536564403; + * @param int|string $var + * @return $this + */ + public function setMinMs($var) + { + GPBUtil::checkInt64($var); + $this->min_ms = $var; + + return $this; + } + + /** + * Number of inter-packet intervals from which these statistics were derived. + * + * Generated from protobuf field optional int64 num_intervals = 186329813; + * @return int|string + */ + public function getNumIntervals() + { + return isset($this->num_intervals) ? $this->num_intervals : 0; + } + + public function hasNumIntervals() + { + return isset($this->num_intervals); + } + + public function clearNumIntervals() + { + unset($this->num_intervals); + } + + /** + * Number of inter-packet intervals from which these statistics were derived. + * + * Generated from protobuf field optional int64 num_intervals = 186329813; + * @param int|string $var + * @return $this + */ + public function setNumIntervals($var) + { + GPBUtil::checkInt64($var); + $this->num_intervals = $var; + + return $this; + } + + /** + * The type of packets for which inter-packet intervals were computed. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * The type of packets for which inter-packet intervals were computed. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketIntervals/Duration.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketIntervals/Duration.php new file mode 100644 index 000000000000..3e95aa96d6a6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketIntervals/Duration.php @@ -0,0 +1,72 @@ +google.cloud.compute.v1.PacketIntervals.Duration + */ +class Duration +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_DURATION = 0; + */ + const UNDEFINED_DURATION = 0; + /** + * Generated from protobuf enum DURATION_UNSPECIFIED = 529071340; + */ + const DURATION_UNSPECIFIED = 529071340; + /** + * Generated from protobuf enum HOUR = 2223588; + */ + const HOUR = 2223588; + /** + * From BfdSession object creation time. + * + * Generated from protobuf enum MAX = 76100; + */ + const MAX = 76100; + /** + * Generated from protobuf enum MINUTE = 126786068; + */ + const MINUTE = 126786068; + + private static $valueToName = [ + self::UNDEFINED_DURATION => 'UNDEFINED_DURATION', + self::DURATION_UNSPECIFIED => 'DURATION_UNSPECIFIED', + self::HOUR => 'HOUR', + self::MAX => 'MAX', + self::MINUTE => 'MINUTE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Duration::class, \Google\Cloud\Compute\V1\PacketIntervals_Duration::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketIntervals/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketIntervals/Type.php new file mode 100644 index 000000000000..4db22f98d35e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketIntervals/Type.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.PacketIntervals.Type + */ +class Type +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TYPE = 0; + */ + const UNDEFINED_TYPE = 0; + /** + * Only applies to Echo packets. This shows the intervals between sending and receiving the same packet. + * + * Generated from protobuf enum LOOPBACK = 356174219; + */ + const LOOPBACK = 356174219; + /** + * Intervals between received packets. + * + * Generated from protobuf enum RECEIVE = 189660867; + */ + const RECEIVE = 189660867; + /** + * Intervals between transmitted packets. + * + * Generated from protobuf enum TRANSMIT = 452903600; + */ + const TRANSMIT = 452903600; + /** + * Generated from protobuf enum TYPE_UNSPECIFIED = 437714322; + */ + const TYPE_UNSPECIFIED = 437714322; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::LOOPBACK => 'LOOPBACK', + self::RECEIVE => 'RECEIVE', + self::TRANSMIT => 'TRANSMIT', + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Compute\V1\PacketIntervals_Type::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroring.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroring.php new file mode 100644 index 000000000000..c4f4cc52cbce --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroring.php @@ -0,0 +1,609 @@ +google.cloud.compute.v1.PacketMirroring + */ +class PacketMirroring extends \Google\Protobuf\Internal\Message +{ + /** + * The Forwarding Rule resource of type loadBalancingScheme=INTERNAL that will be used as collector for mirrored traffic. The specified forwarding rule must have isMirroringCollector set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.PacketMirroringForwardingRuleInfo collector_ilb = 426607853; + */ + protected $collector_ilb = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Indicates whether or not this packet mirroring takes effect. If set to FALSE, this packet mirroring policy will not be enforced on the network. The default is TRUE. + * Check the Enable enum for the list of possible values. + * + * Generated from protobuf field optional string enable = 311764355; + */ + protected $enable = null; + /** + * Filter for mirrored traffic. If unspecified, all IPv4 traffic is mirrored. + * + * Generated from protobuf field optional .google.cloud.compute.v1.PacketMirroringFilter filter = 336120696; + */ + protected $filter = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#packetMirroring for packet mirrorings. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * PacketMirroring mirroredResourceInfos. MirroredResourceInfo specifies a set of mirrored VM instances, subnetworks and/or tags for which traffic from/to all VM instances will be mirrored. + * + * Generated from protobuf field optional .google.cloud.compute.v1.PacketMirroringMirroredResourceInfo mirrored_resources = 124817348; + */ + protected $mirrored_resources = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Specifies the mirrored VPC network. Only packets in this network will be mirrored. All mirrored VMs should have a NIC in the given network. All mirrored subnetworks should belong to the given network. + * + * Generated from protobuf field optional .google.cloud.compute.v1.PacketMirroringNetworkInfo network = 232872494; + */ + protected $network = null; + /** + * The priority of applying this configuration. Priority is used to break ties in cases where there is more than one matching rule. In the case of two rules that apply for a given Instance, the one with the lowest-numbered priority value wins. Default value is 1000. Valid range is 0 through 65535. + * + * Generated from protobuf field optional uint32 priority = 445151652; + */ + protected $priority = null; + /** + * [Output Only] URI of the region where the packetMirroring resides. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\PacketMirroringForwardingRuleInfo $collector_ilb + * The Forwarding Rule resource of type loadBalancingScheme=INTERNAL that will be used as collector for mirrored traffic. The specified forwarding rule must have isMirroringCollector set to true. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type string $enable + * Indicates whether or not this packet mirroring takes effect. If set to FALSE, this packet mirroring policy will not be enforced on the network. The default is TRUE. + * Check the Enable enum for the list of possible values. + * @type \Google\Cloud\Compute\V1\PacketMirroringFilter $filter + * Filter for mirrored traffic. If unspecified, all IPv4 traffic is mirrored. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of the resource. Always compute#packetMirroring for packet mirrorings. + * @type \Google\Cloud\Compute\V1\PacketMirroringMirroredResourceInfo $mirrored_resources + * PacketMirroring mirroredResourceInfos. MirroredResourceInfo specifies a set of mirrored VM instances, subnetworks and/or tags for which traffic from/to all VM instances will be mirrored. + * @type string $name + * 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\PacketMirroringNetworkInfo $network + * Specifies the mirrored VPC network. Only packets in this network will be mirrored. All mirrored VMs should have a NIC in the given network. All mirrored subnetworks should belong to the given network. + * @type int $priority + * The priority of applying this configuration. Priority is used to break ties in cases where there is more than one matching rule. In the case of two rules that apply for a given Instance, the one with the lowest-numbered priority value wins. Default value is 1000. Valid range is 0 through 65535. + * @type string $region + * [Output Only] URI of the region where the packetMirroring resides. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The Forwarding Rule resource of type loadBalancingScheme=INTERNAL that will be used as collector for mirrored traffic. The specified forwarding rule must have isMirroringCollector set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.PacketMirroringForwardingRuleInfo collector_ilb = 426607853; + * @return \Google\Cloud\Compute\V1\PacketMirroringForwardingRuleInfo|null + */ + public function getCollectorIlb() + { + return $this->collector_ilb; + } + + public function hasCollectorIlb() + { + return isset($this->collector_ilb); + } + + public function clearCollectorIlb() + { + unset($this->collector_ilb); + } + + /** + * The Forwarding Rule resource of type loadBalancingScheme=INTERNAL that will be used as collector for mirrored traffic. The specified forwarding rule must have isMirroringCollector set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.PacketMirroringForwardingRuleInfo collector_ilb = 426607853; + * @param \Google\Cloud\Compute\V1\PacketMirroringForwardingRuleInfo $var + * @return $this + */ + public function setCollectorIlb($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\PacketMirroringForwardingRuleInfo::class); + $this->collector_ilb = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Indicates whether or not this packet mirroring takes effect. If set to FALSE, this packet mirroring policy will not be enforced on the network. The default is TRUE. + * Check the Enable enum for the list of possible values. + * + * Generated from protobuf field optional string enable = 311764355; + * @return string + */ + public function getEnable() + { + return isset($this->enable) ? $this->enable : ''; + } + + public function hasEnable() + { + return isset($this->enable); + } + + public function clearEnable() + { + unset($this->enable); + } + + /** + * Indicates whether or not this packet mirroring takes effect. If set to FALSE, this packet mirroring policy will not be enforced on the network. The default is TRUE. + * Check the Enable enum for the list of possible values. + * + * Generated from protobuf field optional string enable = 311764355; + * @param string $var + * @return $this + */ + public function setEnable($var) + { + GPBUtil::checkString($var, True); + $this->enable = $var; + + return $this; + } + + /** + * Filter for mirrored traffic. If unspecified, all IPv4 traffic is mirrored. + * + * Generated from protobuf field optional .google.cloud.compute.v1.PacketMirroringFilter filter = 336120696; + * @return \Google\Cloud\Compute\V1\PacketMirroringFilter|null + */ + public function getFilter() + { + return $this->filter; + } + + public function hasFilter() + { + return isset($this->filter); + } + + public function clearFilter() + { + unset($this->filter); + } + + /** + * Filter for mirrored traffic. If unspecified, all IPv4 traffic is mirrored. + * + * Generated from protobuf field optional .google.cloud.compute.v1.PacketMirroringFilter filter = 336120696; + * @param \Google\Cloud\Compute\V1\PacketMirroringFilter $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\PacketMirroringFilter::class); + $this->filter = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#packetMirroring for packet mirrorings. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#packetMirroring for packet mirrorings. + * + * 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; + } + + /** + * PacketMirroring mirroredResourceInfos. MirroredResourceInfo specifies a set of mirrored VM instances, subnetworks and/or tags for which traffic from/to all VM instances will be mirrored. + * + * Generated from protobuf field optional .google.cloud.compute.v1.PacketMirroringMirroredResourceInfo mirrored_resources = 124817348; + * @return \Google\Cloud\Compute\V1\PacketMirroringMirroredResourceInfo|null + */ + public function getMirroredResources() + { + return $this->mirrored_resources; + } + + public function hasMirroredResources() + { + return isset($this->mirrored_resources); + } + + public function clearMirroredResources() + { + unset($this->mirrored_resources); + } + + /** + * PacketMirroring mirroredResourceInfos. MirroredResourceInfo specifies a set of mirrored VM instances, subnetworks and/or tags for which traffic from/to all VM instances will be mirrored. + * + * Generated from protobuf field optional .google.cloud.compute.v1.PacketMirroringMirroredResourceInfo mirrored_resources = 124817348; + * @param \Google\Cloud\Compute\V1\PacketMirroringMirroredResourceInfo $var + * @return $this + */ + public function setMirroredResources($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\PacketMirroringMirroredResourceInfo::class); + $this->mirrored_resources = $var; + + return $this; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * Specifies the mirrored VPC network. Only packets in this network will be mirrored. All mirrored VMs should have a NIC in the given network. All mirrored subnetworks should belong to the given network. + * + * Generated from protobuf field optional .google.cloud.compute.v1.PacketMirroringNetworkInfo network = 232872494; + * @return \Google\Cloud\Compute\V1\PacketMirroringNetworkInfo|null + */ + public function getNetwork() + { + return $this->network; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * Specifies the mirrored VPC network. Only packets in this network will be mirrored. All mirrored VMs should have a NIC in the given network. All mirrored subnetworks should belong to the given network. + * + * Generated from protobuf field optional .google.cloud.compute.v1.PacketMirroringNetworkInfo network = 232872494; + * @param \Google\Cloud\Compute\V1\PacketMirroringNetworkInfo $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\PacketMirroringNetworkInfo::class); + $this->network = $var; + + return $this; + } + + /** + * The priority of applying this configuration. Priority is used to break ties in cases where there is more than one matching rule. In the case of two rules that apply for a given Instance, the one with the lowest-numbered priority value wins. Default value is 1000. Valid range is 0 through 65535. + * + * Generated from protobuf field optional uint32 priority = 445151652; + * @return int + */ + public function getPriority() + { + return isset($this->priority) ? $this->priority : 0; + } + + public function hasPriority() + { + return isset($this->priority); + } + + public function clearPriority() + { + unset($this->priority); + } + + /** + * The priority of applying this configuration. Priority is used to break ties in cases where there is more than one matching rule. In the case of two rules that apply for a given Instance, the one with the lowest-numbered priority value wins. Default value is 1000. Valid range is 0 through 65535. + * + * Generated from protobuf field optional uint32 priority = 445151652; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkUint32($var); + $this->priority = $var; + + return $this; + } + + /** + * [Output Only] URI of the region where the packetMirroring resides. + * + * 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] URI of the region where the packetMirroring resides. + * + * 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] Server-defined URL for the 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 the 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroring/Enable.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroring/Enable.php new file mode 100644 index 000000000000..581d1f78cf8e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroring/Enable.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.PacketMirroring.Enable + */ +class Enable +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ENABLE = 0; + */ + const UNDEFINED_ENABLE = 0; + /** + * Generated from protobuf enum FALSE = 66658563; + */ + const FALSE = 66658563; + /** + * Generated from protobuf enum TRUE = 2583950; + */ + const TRUE = 2583950; + + private static $valueToName = [ + self::UNDEFINED_ENABLE => 'UNDEFINED_ENABLE', + self::FALSE => 'FALSE', + self::TRUE => 'TRUE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Enable::class, \Google\Cloud\Compute\V1\PacketMirroring_Enable::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringAggregatedList.php new file mode 100644 index 000000000000..ead643994c1b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringAggregatedList.php @@ -0,0 +1,321 @@ +google.cloud.compute.v1.PacketMirroringAggregatedList + */ +class PacketMirroringAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of PacketMirroring resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 PacketMirroring 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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 PacketMirroring resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of PacketMirroring 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\PacketMirroringsScopedList::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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringFilter.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringFilter.php new file mode 100644 index 000000000000..bf090dbe9469 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringFilter.php @@ -0,0 +1,148 @@ +google.cloud.compute.v1.PacketMirroringFilter + */ +class PacketMirroringFilter extends \Google\Protobuf\Internal\Message +{ + /** + * Protocols that apply as filter on mirrored traffic. If no protocols are specified, all traffic that matches the specified CIDR ranges is mirrored. If neither cidrRanges nor IPProtocols is specified, all IPv4 traffic is mirrored. + * + * Generated from protobuf field repeated string I_p_protocols = 98544854; + */ + private $I_p_protocols; + /** + * One or more IPv4 or IPv6 CIDR ranges that apply as filters on the source (ingress) or destination (egress) IP in the IP header. If no ranges are specified, all IPv4 traffic that matches the specified IPProtocols is mirrored. If neither cidrRanges nor IPProtocols is specified, all IPv4 traffic is mirrored. To mirror all IPv4 and IPv6 traffic, use "0.0.0.0/0,::/0". + * + * Generated from protobuf field repeated string cidr_ranges = 487901697; + */ + private $cidr_ranges; + /** + * Direction of traffic to mirror, either INGRESS, EGRESS, or BOTH. The default is BOTH. + * Check the Direction enum for the list of possible values. + * + * Generated from protobuf field optional string direction = 111150975; + */ + protected $direction = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $I_p_protocols + * Protocols that apply as filter on mirrored traffic. If no protocols are specified, all traffic that matches the specified CIDR ranges is mirrored. If neither cidrRanges nor IPProtocols is specified, all IPv4 traffic is mirrored. + * @type array|\Google\Protobuf\Internal\RepeatedField $cidr_ranges + * One or more IPv4 or IPv6 CIDR ranges that apply as filters on the source (ingress) or destination (egress) IP in the IP header. If no ranges are specified, all IPv4 traffic that matches the specified IPProtocols is mirrored. If neither cidrRanges nor IPProtocols is specified, all IPv4 traffic is mirrored. To mirror all IPv4 and IPv6 traffic, use "0.0.0.0/0,::/0". + * @type string $direction + * Direction of traffic to mirror, either INGRESS, EGRESS, or BOTH. The default is BOTH. + * Check the Direction enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Protocols that apply as filter on mirrored traffic. If no protocols are specified, all traffic that matches the specified CIDR ranges is mirrored. If neither cidrRanges nor IPProtocols is specified, all IPv4 traffic is mirrored. + * + * Generated from protobuf field repeated string I_p_protocols = 98544854; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIPProtocols() + { + return $this->I_p_protocols; + } + + /** + * Protocols that apply as filter on mirrored traffic. If no protocols are specified, all traffic that matches the specified CIDR ranges is mirrored. If neither cidrRanges nor IPProtocols is specified, all IPv4 traffic is mirrored. + * + * Generated from protobuf field repeated string I_p_protocols = 98544854; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIPProtocols($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->I_p_protocols = $arr; + + return $this; + } + + /** + * One or more IPv4 or IPv6 CIDR ranges that apply as filters on the source (ingress) or destination (egress) IP in the IP header. If no ranges are specified, all IPv4 traffic that matches the specified IPProtocols is mirrored. If neither cidrRanges nor IPProtocols is specified, all IPv4 traffic is mirrored. To mirror all IPv4 and IPv6 traffic, use "0.0.0.0/0,::/0". + * + * Generated from protobuf field repeated string cidr_ranges = 487901697; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCidrRanges() + { + return $this->cidr_ranges; + } + + /** + * One or more IPv4 or IPv6 CIDR ranges that apply as filters on the source (ingress) or destination (egress) IP in the IP header. If no ranges are specified, all IPv4 traffic that matches the specified IPProtocols is mirrored. If neither cidrRanges nor IPProtocols is specified, all IPv4 traffic is mirrored. To mirror all IPv4 and IPv6 traffic, use "0.0.0.0/0,::/0". + * + * Generated from protobuf field repeated string cidr_ranges = 487901697; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCidrRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->cidr_ranges = $arr; + + return $this; + } + + /** + * Direction of traffic to mirror, either INGRESS, EGRESS, or BOTH. The default is BOTH. + * Check the Direction enum for the list of possible values. + * + * Generated from protobuf field optional string direction = 111150975; + * @return string + */ + public function getDirection() + { + return isset($this->direction) ? $this->direction : ''; + } + + public function hasDirection() + { + return isset($this->direction); + } + + public function clearDirection() + { + unset($this->direction); + } + + /** + * Direction of traffic to mirror, either INGRESS, EGRESS, or BOTH. The default is BOTH. + * Check the Direction enum for the list of possible values. + * + * Generated from protobuf field optional string direction = 111150975; + * @param string $var + * @return $this + */ + public function setDirection($var) + { + GPBUtil::checkString($var, True); + $this->direction = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringFilter/Direction.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringFilter/Direction.php new file mode 100644 index 000000000000..95ea08fc2fd1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringFilter/Direction.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.PacketMirroringFilter.Direction + */ +class Direction +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_DIRECTION = 0; + */ + const UNDEFINED_DIRECTION = 0; + /** + * Default, both directions are mirrored. + * + * Generated from protobuf enum BOTH = 2044801; + */ + const BOTH = 2044801; + /** + * Only egress traffic is mirrored. + * + * Generated from protobuf enum EGRESS = 432880501; + */ + const EGRESS = 432880501; + /** + * Only ingress traffic is mirrored. + * + * Generated from protobuf enum INGRESS = 516931221; + */ + const INGRESS = 516931221; + + private static $valueToName = [ + self::UNDEFINED_DIRECTION => 'UNDEFINED_DIRECTION', + self::BOTH => 'BOTH', + self::EGRESS => 'EGRESS', + self::INGRESS => 'INGRESS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Direction::class, \Google\Cloud\Compute\V1\PacketMirroringFilter_Direction::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringForwardingRuleInfo.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringForwardingRuleInfo.php new file mode 100644 index 000000000000..85189a4779ab --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringForwardingRuleInfo.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.PacketMirroringForwardingRuleInfo + */ +class PacketMirroringForwardingRuleInfo extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the forwarding rule; defined by the server. + * + * Generated from protobuf field optional string canonical_url = 512294820; + */ + protected $canonical_url = null; + /** + * Resource URL to the forwarding rule representing the ILB configured as destination of the mirrored traffic. + * + * Generated from protobuf field optional string url = 116079; + */ + protected $url = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $canonical_url + * [Output Only] Unique identifier for the forwarding rule; defined by the server. + * @type string $url + * Resource URL to the forwarding rule representing the ILB configured as destination of the mirrored traffic. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Unique identifier for the forwarding rule; defined by the server. + * + * Generated from protobuf field optional string canonical_url = 512294820; + * @return string + */ + public function getCanonicalUrl() + { + return isset($this->canonical_url) ? $this->canonical_url : ''; + } + + public function hasCanonicalUrl() + { + return isset($this->canonical_url); + } + + public function clearCanonicalUrl() + { + unset($this->canonical_url); + } + + /** + * [Output Only] Unique identifier for the forwarding rule; defined by the server. + * + * Generated from protobuf field optional string canonical_url = 512294820; + * @param string $var + * @return $this + */ + public function setCanonicalUrl($var) + { + GPBUtil::checkString($var, True); + $this->canonical_url = $var; + + return $this; + } + + /** + * Resource URL to the forwarding rule representing the ILB configured as destination of the mirrored traffic. + * + * Generated from protobuf field optional string url = 116079; + * @return string + */ + public function getUrl() + { + return isset($this->url) ? $this->url : ''; + } + + public function hasUrl() + { + return isset($this->url); + } + + public function clearUrl() + { + unset($this->url); + } + + /** + * Resource URL to the forwarding rule representing the ILB configured as destination of the mirrored traffic. + * + * Generated from protobuf field optional string url = 116079; + * @param string $var + * @return $this + */ + public function setUrl($var) + { + GPBUtil::checkString($var, True); + $this->url = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringList.php new file mode 100644 index 000000000000..4e86d4f62b01 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.PacketMirroringList + */ +class PacketMirroringList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of PacketMirroring resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PacketMirroring items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#packetMirroring for packetMirrorings. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\PacketMirroring>|\Google\Protobuf\Internal\RepeatedField $items + * A list of PacketMirroring resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#packetMirroring for packetMirrorings. + * @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 PacketMirroring resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PacketMirroring items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of PacketMirroring resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PacketMirroring items = 100526016; + * @param array<\Google\Cloud\Compute\V1\PacketMirroring>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PacketMirroring::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#packetMirroring for packetMirrorings. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#packetMirroring for packetMirrorings. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringMirroredResourceInfo.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringMirroredResourceInfo.php new file mode 100644 index 000000000000..c94629ae85de --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringMirroredResourceInfo.php @@ -0,0 +1,134 @@ +google.cloud.compute.v1.PacketMirroringMirroredResourceInfo + */ +class PacketMirroringMirroredResourceInfo extends \Google\Protobuf\Internal\Message +{ + /** + * A set of virtual machine instances that are being mirrored. They must live in zones contained in the same region as this packetMirroring. Note that this config will apply only to those network interfaces of the Instances that belong to the network specified in this packetMirroring. You may specify a maximum of 50 Instances. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo instances = 29097598; + */ + private $instances; + /** + * A set of subnetworks for which traffic from/to all VM instances will be mirrored. They must live in the same region as this packetMirroring. You may specify a maximum of 5 subnetworks. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo subnetworks = 415853125; + */ + private $subnetworks; + /** + * A set of mirrored tags. Traffic from/to all VM instances that have one or more of these tags will be mirrored. + * + * Generated from protobuf field repeated string tags = 3552281; + */ + private $tags; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\PacketMirroringMirroredResourceInfoInstanceInfo>|\Google\Protobuf\Internal\RepeatedField $instances + * A set of virtual machine instances that are being mirrored. They must live in zones contained in the same region as this packetMirroring. Note that this config will apply only to those network interfaces of the Instances that belong to the network specified in this packetMirroring. You may specify a maximum of 50 Instances. + * @type array<\Google\Cloud\Compute\V1\PacketMirroringMirroredResourceInfoSubnetInfo>|\Google\Protobuf\Internal\RepeatedField $subnetworks + * A set of subnetworks for which traffic from/to all VM instances will be mirrored. They must live in the same region as this packetMirroring. You may specify a maximum of 5 subnetworks. + * @type array|\Google\Protobuf\Internal\RepeatedField $tags + * A set of mirrored tags. Traffic from/to all VM instances that have one or more of these tags will be mirrored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A set of virtual machine instances that are being mirrored. They must live in zones contained in the same region as this packetMirroring. Note that this config will apply only to those network interfaces of the Instances that belong to the network specified in this packetMirroring. You may specify a maximum of 50 Instances. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo instances = 29097598; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * A set of virtual machine instances that are being mirrored. They must live in zones contained in the same region as this packetMirroring. Note that this config will apply only to those network interfaces of the Instances that belong to the network specified in this packetMirroring. You may specify a maximum of 50 Instances. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo instances = 29097598; + * @param array<\Google\Cloud\Compute\V1\PacketMirroringMirroredResourceInfoInstanceInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PacketMirroringMirroredResourceInfoInstanceInfo::class); + $this->instances = $arr; + + return $this; + } + + /** + * A set of subnetworks for which traffic from/to all VM instances will be mirrored. They must live in the same region as this packetMirroring. You may specify a maximum of 5 subnetworks. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo subnetworks = 415853125; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSubnetworks() + { + return $this->subnetworks; + } + + /** + * A set of subnetworks for which traffic from/to all VM instances will be mirrored. They must live in the same region as this packetMirroring. You may specify a maximum of 5 subnetworks. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo subnetworks = 415853125; + * @param array<\Google\Cloud\Compute\V1\PacketMirroringMirroredResourceInfoSubnetInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSubnetworks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PacketMirroringMirroredResourceInfoSubnetInfo::class); + $this->subnetworks = $arr; + + return $this; + } + + /** + * A set of mirrored tags. Traffic from/to all VM instances that have one or more of these tags will be mirrored. + * + * Generated from protobuf field repeated string tags = 3552281; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTags() + { + return $this->tags; + } + + /** + * A set of mirrored tags. Traffic from/to all VM instances that have one or more of these tags will be mirrored. + * + * Generated from protobuf field repeated string tags = 3552281; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->tags = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringMirroredResourceInfoInstanceInfo.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringMirroredResourceInfoInstanceInfo.php new file mode 100644 index 000000000000..04479faa4362 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringMirroredResourceInfoInstanceInfo.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo + */ +class PacketMirroringMirroredResourceInfoInstanceInfo extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the instance; defined by the server. + * + * Generated from protobuf field optional string canonical_url = 512294820; + */ + protected $canonical_url = null; + /** + * Resource URL to the virtual machine instance which is being mirrored. + * + * Generated from protobuf field optional string url = 116079; + */ + protected $url = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $canonical_url + * [Output Only] Unique identifier for the instance; defined by the server. + * @type string $url + * Resource URL to the virtual machine instance which is being mirrored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Unique identifier for the instance; defined by the server. + * + * Generated from protobuf field optional string canonical_url = 512294820; + * @return string + */ + public function getCanonicalUrl() + { + return isset($this->canonical_url) ? $this->canonical_url : ''; + } + + public function hasCanonicalUrl() + { + return isset($this->canonical_url); + } + + public function clearCanonicalUrl() + { + unset($this->canonical_url); + } + + /** + * [Output Only] Unique identifier for the instance; defined by the server. + * + * Generated from protobuf field optional string canonical_url = 512294820; + * @param string $var + * @return $this + */ + public function setCanonicalUrl($var) + { + GPBUtil::checkString($var, True); + $this->canonical_url = $var; + + return $this; + } + + /** + * Resource URL to the virtual machine instance which is being mirrored. + * + * Generated from protobuf field optional string url = 116079; + * @return string + */ + public function getUrl() + { + return isset($this->url) ? $this->url : ''; + } + + public function hasUrl() + { + return isset($this->url); + } + + public function clearUrl() + { + unset($this->url); + } + + /** + * Resource URL to the virtual machine instance which is being mirrored. + * + * Generated from protobuf field optional string url = 116079; + * @param string $var + * @return $this + */ + public function setUrl($var) + { + GPBUtil::checkString($var, True); + $this->url = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringMirroredResourceInfoSubnetInfo.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringMirroredResourceInfoSubnetInfo.php new file mode 100644 index 000000000000..01c43b97e60c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringMirroredResourceInfoSubnetInfo.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo + */ +class PacketMirroringMirroredResourceInfoSubnetInfo extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the subnetwork; defined by the server. + * + * Generated from protobuf field optional string canonical_url = 512294820; + */ + protected $canonical_url = null; + /** + * Resource URL to the subnetwork for which traffic from/to all VM instances will be mirrored. + * + * Generated from protobuf field optional string url = 116079; + */ + protected $url = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $canonical_url + * [Output Only] Unique identifier for the subnetwork; defined by the server. + * @type string $url + * Resource URL to the subnetwork for which traffic from/to all VM instances will be mirrored. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Unique identifier for the subnetwork; defined by the server. + * + * Generated from protobuf field optional string canonical_url = 512294820; + * @return string + */ + public function getCanonicalUrl() + { + return isset($this->canonical_url) ? $this->canonical_url : ''; + } + + public function hasCanonicalUrl() + { + return isset($this->canonical_url); + } + + public function clearCanonicalUrl() + { + unset($this->canonical_url); + } + + /** + * [Output Only] Unique identifier for the subnetwork; defined by the server. + * + * Generated from protobuf field optional string canonical_url = 512294820; + * @param string $var + * @return $this + */ + public function setCanonicalUrl($var) + { + GPBUtil::checkString($var, True); + $this->canonical_url = $var; + + return $this; + } + + /** + * Resource URL to the subnetwork for which traffic from/to all VM instances will be mirrored. + * + * Generated from protobuf field optional string url = 116079; + * @return string + */ + public function getUrl() + { + return isset($this->url) ? $this->url : ''; + } + + public function hasUrl() + { + return isset($this->url); + } + + public function clearUrl() + { + unset($this->url); + } + + /** + * Resource URL to the subnetwork for which traffic from/to all VM instances will be mirrored. + * + * Generated from protobuf field optional string url = 116079; + * @param string $var + * @return $this + */ + public function setUrl($var) + { + GPBUtil::checkString($var, True); + $this->url = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringNetworkInfo.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringNetworkInfo.php new file mode 100644 index 000000000000..f6d592f09fbd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringNetworkInfo.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.PacketMirroringNetworkInfo + */ +class PacketMirroringNetworkInfo extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the network; defined by the server. + * + * Generated from protobuf field optional string canonical_url = 512294820; + */ + protected $canonical_url = null; + /** + * URL of the network resource. + * + * Generated from protobuf field optional string url = 116079; + */ + protected $url = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $canonical_url + * [Output Only] Unique identifier for the network; defined by the server. + * @type string $url + * URL of the network resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Unique identifier for the network; defined by the server. + * + * Generated from protobuf field optional string canonical_url = 512294820; + * @return string + */ + public function getCanonicalUrl() + { + return isset($this->canonical_url) ? $this->canonical_url : ''; + } + + public function hasCanonicalUrl() + { + return isset($this->canonical_url); + } + + public function clearCanonicalUrl() + { + unset($this->canonical_url); + } + + /** + * [Output Only] Unique identifier for the network; defined by the server. + * + * Generated from protobuf field optional string canonical_url = 512294820; + * @param string $var + * @return $this + */ + public function setCanonicalUrl($var) + { + GPBUtil::checkString($var, True); + $this->canonical_url = $var; + + return $this; + } + + /** + * URL of the network resource. + * + * Generated from protobuf field optional string url = 116079; + * @return string + */ + public function getUrl() + { + return isset($this->url) ? $this->url : ''; + } + + public function hasUrl() + { + return isset($this->url); + } + + public function clearUrl() + { + unset($this->url); + } + + /** + * URL of the network resource. + * + * Generated from protobuf field optional string url = 116079; + * @param string $var + * @return $this + */ + public function setUrl($var) + { + GPBUtil::checkString($var, True); + $this->url = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringsScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringsScopedList.php new file mode 100644 index 000000000000..9c846fc0aea5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PacketMirroringsScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.PacketMirroringsScopedList + */ +class PacketMirroringsScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * A list of packetMirrorings contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PacketMirroring packet_mirrorings = 154615079; + */ + private $packet_mirrorings; + /** + * Informational warning which replaces the list of packetMirrorings when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\PacketMirroring>|\Google\Protobuf\Internal\RepeatedField $packet_mirrorings + * A list of packetMirrorings contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * Informational warning which replaces the list of packetMirrorings when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of packetMirrorings contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PacketMirroring packet_mirrorings = 154615079; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPacketMirrorings() + { + return $this->packet_mirrorings; + } + + /** + * A list of packetMirrorings contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PacketMirroring packet_mirrorings = 154615079; + * @param array<\Google\Cloud\Compute\V1\PacketMirroring>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPacketMirrorings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PacketMirroring::class); + $this->packet_mirrorings = $arr; + + return $this; + } + + /** + * Informational warning which replaces the list of packetMirrorings 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); + } + + /** + * Informational warning which replaces the list of packetMirrorings 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchAutoscalerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchAutoscalerRequest.php new file mode 100644 index 000000000000..1492cf44160a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchAutoscalerRequest.php @@ -0,0 +1,250 @@ +google.cloud.compute.v1.PatchAutoscalerRequest + */ +class PatchAutoscalerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the autoscaler to patch. + * + * Generated from protobuf field optional string autoscaler = 517258967; + */ + protected $autoscaler = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Autoscaler autoscaler_resource = 207616118 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $autoscaler_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * 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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone for this request. + * @param \Google\Cloud\Compute\V1\Autoscaler $autoscalerResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchAutoscalerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, \Google\Cloud\Compute\V1\Autoscaler $autoscalerResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setAutoscalerResource($autoscalerResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $autoscaler + * Name of the autoscaler to patch. + * @type \Google\Cloud\Compute\V1\Autoscaler $autoscaler_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 + * Name of the zone for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the autoscaler to patch. + * + * Generated from protobuf field optional string autoscaler = 517258967; + * @return string + */ + public function getAutoscaler() + { + return isset($this->autoscaler) ? $this->autoscaler : ''; + } + + public function hasAutoscaler() + { + return isset($this->autoscaler); + } + + public function clearAutoscaler() + { + unset($this->autoscaler); + } + + /** + * Name of the autoscaler to patch. + * + * Generated from protobuf field optional string autoscaler = 517258967; + * @param string $var + * @return $this + */ + public function setAutoscaler($var) + { + GPBUtil::checkString($var, True); + $this->autoscaler = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Autoscaler autoscaler_resource = 207616118 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Autoscaler|null + */ + public function getAutoscalerResource() + { + return $this->autoscaler_resource; + } + + public function hasAutoscalerResource() + { + return isset($this->autoscaler_resource); + } + + public function clearAutoscalerResource() + { + unset($this->autoscaler_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Autoscaler autoscaler_resource = 207616118 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Autoscaler $var + * @return $this + */ + public function setAutoscalerResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Autoscaler::class); + $this->autoscaler_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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchBackendBucketRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchBackendBucketRequest.php new file mode 100644 index 000000000000..707a3e878675 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchBackendBucketRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.PatchBackendBucketRequest + */ +class PatchBackendBucketRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the BackendBucket resource to patch. + * + * Generated from protobuf field string backend_bucket = 91714037 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_bucket = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendBucket backend_bucket_resource = 380757784 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_bucket_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $backendBucket Name of the BackendBucket resource to patch. + * @param \Google\Cloud\Compute\V1\BackendBucket $backendBucketResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchBackendBucketRequest + * + * @experimental + */ + public static function build(string $project, string $backendBucket, \Google\Cloud\Compute\V1\BackendBucket $backendBucketResource): self + { + return (new self()) + ->setProject($project) + ->setBackendBucket($backendBucket) + ->setBackendBucketResource($backendBucketResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_bucket + * Name of the BackendBucket resource to patch. + * @type \Google\Cloud\Compute\V1\BackendBucket $backend_bucket_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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the BackendBucket resource to patch. + * + * Generated from protobuf field string backend_bucket = 91714037 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackendBucket() + { + return $this->backend_bucket; + } + + /** + * Name of the BackendBucket resource to patch. + * + * Generated from protobuf field string backend_bucket = 91714037 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackendBucket($var) + { + GPBUtil::checkString($var, True); + $this->backend_bucket = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendBucket backend_bucket_resource = 380757784 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\BackendBucket|null + */ + public function getBackendBucketResource() + { + return $this->backend_bucket_resource; + } + + public function hasBackendBucketResource() + { + return isset($this->backend_bucket_resource); + } + + public function clearBackendBucketResource() + { + unset($this->backend_bucket_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendBucket backend_bucket_resource = 380757784 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\BackendBucket $var + * @return $this + */ + public function setBackendBucketResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BackendBucket::class); + $this->backend_bucket_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchBackendServiceRequest.php new file mode 100644 index 000000000000..3354b0bf2612 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchBackendServiceRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.PatchBackendServiceRequest + */ +class PatchBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the BackendService resource to patch. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_service = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendService backend_service_resource = 347586723 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_service_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $backendService Name of the BackendService resource to patch. + * @param \Google\Cloud\Compute\V1\BackendService $backendServiceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, string $backendService, \Google\Cloud\Compute\V1\BackendService $backendServiceResource): self + { + return (new self()) + ->setProject($project) + ->setBackendService($backendService) + ->setBackendServiceResource($backendServiceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_service + * Name of the BackendService resource to patch. + * @type \Google\Cloud\Compute\V1\BackendService $backend_service_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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the BackendService resource to patch. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackendService() + { + return $this->backend_service; + } + + /** + * Name of the BackendService resource to patch. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackendService($var) + { + GPBUtil::checkString($var, True); + $this->backend_service = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendService backend_service_resource = 347586723 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\BackendService|null + */ + public function getBackendServiceResource() + { + return $this->backend_service_resource; + } + + public function hasBackendServiceResource() + { + return isset($this->backend_service_resource); + } + + public function clearBackendServiceResource() + { + unset($this->backend_service_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendService backend_service_resource = 347586723 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\BackendService $var + * @return $this + */ + public function setBackendServiceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BackendService::class); + $this->backend_service_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchFirewallPolicyRequest.php new file mode 100644 index 000000000000..ce349a9b3e8c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchFirewallPolicyRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.PatchFirewallPolicyRequest + */ +class PatchFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicy firewall_policy_resource = 495049532 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $firewallPolicy Name of the firewall policy to update. + * @param \Google\Cloud\Compute\V1\FirewallPolicy $firewallPolicyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $firewallPolicy, \Google\Cloud\Compute\V1\FirewallPolicy $firewallPolicyResource): self + { + return (new self()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyResource($firewallPolicyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to update. + * @type \Google\Cloud\Compute\V1\FirewallPolicy $firewall_policy_resource + * The body resource 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); + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicy firewall_policy_resource = 495049532 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\FirewallPolicy|null + */ + public function getFirewallPolicyResource() + { + return $this->firewall_policy_resource; + } + + public function hasFirewallPolicyResource() + { + return isset($this->firewall_policy_resource); + } + + public function clearFirewallPolicyResource() + { + unset($this->firewall_policy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicy firewall_policy_resource = 495049532 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\FirewallPolicy $var + * @return $this + */ + public function setFirewallPolicyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\FirewallPolicy::class); + $this->firewall_policy_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchFirewallRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchFirewallRequest.php new file mode 100644 index 000000000000..a7e5845c0f77 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchFirewallRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.PatchFirewallRequest + */ +class PatchFirewallRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall rule to patch. + * + * Generated from protobuf field string firewall = 511016192 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Firewall firewall_resource = 41425005 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $firewall Name of the firewall rule to patch. + * @param \Google\Cloud\Compute\V1\Firewall $firewallResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchFirewallRequest + * + * @experimental + */ + public static function build(string $project, string $firewall, \Google\Cloud\Compute\V1\Firewall $firewallResource): self + { + return (new self()) + ->setProject($project) + ->setFirewall($firewall) + ->setFirewallResource($firewallResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall + * Name of the firewall rule to patch. + * @type \Google\Cloud\Compute\V1\Firewall $firewall_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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall rule to patch. + * + * Generated from protobuf field string firewall = 511016192 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewall() + { + return $this->firewall; + } + + /** + * Name of the firewall rule to patch. + * + * Generated from protobuf field string firewall = 511016192 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewall($var) + { + GPBUtil::checkString($var, True); + $this->firewall = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Firewall firewall_resource = 41425005 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Firewall|null + */ + public function getFirewallResource() + { + return $this->firewall_resource; + } + + public function hasFirewallResource() + { + return isset($this->firewall_resource); + } + + public function clearFirewallResource() + { + unset($this->firewall_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Firewall firewall_resource = 41425005 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Firewall $var + * @return $this + */ + public function setFirewallResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Firewall::class); + $this->firewall_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchForwardingRuleRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchForwardingRuleRequest.php new file mode 100644 index 000000000000..2f7a734b7cc4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchForwardingRuleRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.PatchForwardingRuleRequest + */ +class PatchForwardingRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the ForwardingRule resource to patch. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $forwarding_rule = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ForwardingRule forwarding_rule_resource = 301211695 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $forwarding_rule_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"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $forwardingRule Name of the ForwardingRule resource to patch. + * @param \Google\Cloud\Compute\V1\ForwardingRule $forwardingRuleResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchForwardingRuleRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $forwardingRule, \Google\Cloud\Compute\V1\ForwardingRule $forwardingRuleResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setForwardingRule($forwardingRule) + ->setForwardingRuleResource($forwardingRuleResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $forwarding_rule + * Name of the ForwardingRule resource to patch. + * @type \Google\Cloud\Compute\V1\ForwardingRule $forwarding_rule_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the ForwardingRule resource to patch. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getForwardingRule() + { + return $this->forwarding_rule; + } + + /** + * Name of the ForwardingRule resource to patch. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setForwardingRule($var) + { + GPBUtil::checkString($var, True); + $this->forwarding_rule = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ForwardingRule forwarding_rule_resource = 301211695 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ForwardingRule|null + */ + public function getForwardingRuleResource() + { + return $this->forwarding_rule_resource; + } + + public function hasForwardingRuleResource() + { + return isset($this->forwarding_rule_resource); + } + + public function clearForwardingRuleResource() + { + unset($this->forwarding_rule_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ForwardingRule forwarding_rule_resource = 301211695 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ForwardingRule $var + * @return $this + */ + public function setForwardingRuleResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ForwardingRule::class); + $this->forwarding_rule_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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchGlobalForwardingRuleRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchGlobalForwardingRuleRequest.php new file mode 100644 index 000000000000..b1fff7eec1c5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchGlobalForwardingRuleRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.PatchGlobalForwardingRuleRequest + */ +class PatchGlobalForwardingRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the ForwardingRule resource to patch. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $forwarding_rule = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ForwardingRule forwarding_rule_resource = 301211695 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $forwarding_rule_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $forwardingRule Name of the ForwardingRule resource to patch. + * @param \Google\Cloud\Compute\V1\ForwardingRule $forwardingRuleResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchGlobalForwardingRuleRequest + * + * @experimental + */ + public static function build(string $project, string $forwardingRule, \Google\Cloud\Compute\V1\ForwardingRule $forwardingRuleResource): self + { + return (new self()) + ->setProject($project) + ->setForwardingRule($forwardingRule) + ->setForwardingRuleResource($forwardingRuleResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $forwarding_rule + * Name of the ForwardingRule resource to patch. + * @type \Google\Cloud\Compute\V1\ForwardingRule $forwarding_rule_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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the ForwardingRule resource to patch. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getForwardingRule() + { + return $this->forwarding_rule; + } + + /** + * Name of the ForwardingRule resource to patch. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setForwardingRule($var) + { + GPBUtil::checkString($var, True); + $this->forwarding_rule = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ForwardingRule forwarding_rule_resource = 301211695 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ForwardingRule|null + */ + public function getForwardingRuleResource() + { + return $this->forwarding_rule_resource; + } + + public function hasForwardingRuleResource() + { + return isset($this->forwarding_rule_resource); + } + + public function clearForwardingRuleResource() + { + unset($this->forwarding_rule_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ForwardingRule forwarding_rule_resource = 301211695 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ForwardingRule $var + * @return $this + */ + public function setForwardingRuleResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ForwardingRule::class); + $this->forwarding_rule_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchGlobalPublicDelegatedPrefixeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchGlobalPublicDelegatedPrefixeRequest.php new file mode 100644 index 000000000000..6669cf349717 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchGlobalPublicDelegatedPrefixeRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest + */ +class PatchGlobalPublicDelegatedPrefixeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the PublicDelegatedPrefix resource to patch. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $public_delegated_prefix = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PublicDelegatedPrefix public_delegated_prefix_resource = 47594501 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $public_delegated_prefix_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $publicDelegatedPrefix Name of the PublicDelegatedPrefix resource to patch. + * @param \Google\Cloud\Compute\V1\PublicDelegatedPrefix $publicDelegatedPrefixResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchGlobalPublicDelegatedPrefixeRequest + * + * @experimental + */ + public static function build(string $project, string $publicDelegatedPrefix, \Google\Cloud\Compute\V1\PublicDelegatedPrefix $publicDelegatedPrefixResource): self + { + return (new self()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $public_delegated_prefix + * Name of the PublicDelegatedPrefix resource to patch. + * @type \Google\Cloud\Compute\V1\PublicDelegatedPrefix $public_delegated_prefix_resource + * The body resource 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); + } + + /** + * 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; + } + + /** + * Name of the PublicDelegatedPrefix resource to patch. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPublicDelegatedPrefix() + { + return $this->public_delegated_prefix; + } + + /** + * Name of the PublicDelegatedPrefix resource to patch. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPublicDelegatedPrefix($var) + { + GPBUtil::checkString($var, True); + $this->public_delegated_prefix = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PublicDelegatedPrefix public_delegated_prefix_resource = 47594501 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\PublicDelegatedPrefix|null + */ + public function getPublicDelegatedPrefixResource() + { + return $this->public_delegated_prefix_resource; + } + + public function hasPublicDelegatedPrefixResource() + { + return isset($this->public_delegated_prefix_resource); + } + + public function clearPublicDelegatedPrefixResource() + { + unset($this->public_delegated_prefix_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PublicDelegatedPrefix public_delegated_prefix_resource = 47594501 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\PublicDelegatedPrefix $var + * @return $this + */ + public function setPublicDelegatedPrefixResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\PublicDelegatedPrefix::class); + $this->public_delegated_prefix_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchHealthCheckRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchHealthCheckRequest.php new file mode 100644 index 000000000000..45880c48d005 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchHealthCheckRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.PatchHealthCheckRequest + */ +class PatchHealthCheckRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the HealthCheck resource to patch. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $health_check = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.HealthCheck health_check_resource = 201925032 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $health_check_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $healthCheck Name of the HealthCheck resource to patch. + * @param \Google\Cloud\Compute\V1\HealthCheck $healthCheckResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchHealthCheckRequest + * + * @experimental + */ + public static function build(string $project, string $healthCheck, \Google\Cloud\Compute\V1\HealthCheck $healthCheckResource): self + { + return (new self()) + ->setProject($project) + ->setHealthCheck($healthCheck) + ->setHealthCheckResource($healthCheckResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $health_check + * Name of the HealthCheck resource to patch. + * @type \Google\Cloud\Compute\V1\HealthCheck $health_check_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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the HealthCheck resource to patch. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getHealthCheck() + { + return $this->health_check; + } + + /** + * Name of the HealthCheck resource to patch. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setHealthCheck($var) + { + GPBUtil::checkString($var, True); + $this->health_check = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.HealthCheck health_check_resource = 201925032 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\HealthCheck|null + */ + public function getHealthCheckResource() + { + return $this->health_check_resource; + } + + public function hasHealthCheckResource() + { + return isset($this->health_check_resource); + } + + public function clearHealthCheckResource() + { + unset($this->health_check_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.HealthCheck health_check_resource = 201925032 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\HealthCheck $var + * @return $this + */ + public function setHealthCheckResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HealthCheck::class); + $this->health_check_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchImageRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchImageRequest.php new file mode 100644 index 000000000000..2a41a36275c7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchImageRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.PatchImageRequest + */ +class PatchImageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the image resource to patch. + * + * Generated from protobuf field string image = 100313435 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $image = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Image image_resource = 371171954 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $image_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $image Name of the image resource to patch. + * @param \Google\Cloud\Compute\V1\Image $imageResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchImageRequest + * + * @experimental + */ + public static function build(string $project, string $image, \Google\Cloud\Compute\V1\Image $imageResource): self + { + return (new self()) + ->setProject($project) + ->setImage($image) + ->setImageResource($imageResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $image + * Name of the image resource to patch. + * @type \Google\Cloud\Compute\V1\Image $image_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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the image resource to patch. + * + * Generated from protobuf field string image = 100313435 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getImage() + { + return $this->image; + } + + /** + * Name of the image resource to patch. + * + * Generated from protobuf field string image = 100313435 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkString($var, True); + $this->image = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Image image_resource = 371171954 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Image|null + */ + public function getImageResource() + { + return $this->image_resource; + } + + public function hasImageResource() + { + return isset($this->image_resource); + } + + public function clearImageResource() + { + unset($this->image_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Image image_resource = 371171954 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Image $var + * @return $this + */ + public function setImageResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Image::class); + $this->image_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..b1381bef8f5b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.PatchInstanceGroupManagerRequest + */ +class PatchInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the instance group manager. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManager instance_group_manager_resource = 261063946 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the zone where you want to create the managed instance group. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where you want to create the managed instance group. + * @param string $instanceGroupManager The name of the instance group manager. + * @param \Google\Cloud\Compute\V1\InstanceGroupManager $instanceGroupManagerResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager, \Google\Cloud\Compute\V1\InstanceGroupManager $instanceGroupManagerResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagerResource($instanceGroupManagerResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the instance group manager. + * @type \Google\Cloud\Compute\V1\InstanceGroupManager $instance_group_manager_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 where you want to create the managed instance group. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the instance group manager. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the instance group manager. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManager instance_group_manager_resource = 261063946 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupManager|null + */ + public function getInstanceGroupManagerResource() + { + return $this->instance_group_manager_resource; + } + + public function hasInstanceGroupManagerResource() + { + return isset($this->instance_group_manager_resource); + } + + public function clearInstanceGroupManagerResource() + { + unset($this->instance_group_manager_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManager instance_group_manager_resource = 261063946 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupManager $var + * @return $this + */ + public function setInstanceGroupManagerResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManager::class); + $this->instance_group_manager_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 where you want to create the managed instance group. + * + * 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 where you want to create the managed instance group. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchInstanceSettingRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchInstanceSettingRequest.php new file mode 100644 index 000000000000..864daf542411 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchInstanceSettingRequest.php @@ -0,0 +1,250 @@ +google.cloud.compute.v1.PatchInstanceSettingRequest + */ +class PatchInstanceSettingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceSettings instance_settings_resource = 290689920 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_settings_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * update_mask indicates fields to be updated as part of this request. + * + * Generated from protobuf field optional string update_mask = 500079778; + */ + protected $update_mask = null; + /** + * The zone scoping this request. It should conform to RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The zone scoping this request. It should conform to RFC1035. + * @param \Google\Cloud\Compute\V1\InstanceSettings $instanceSettingsResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchInstanceSettingRequest + * + * @experimental + */ + public static function build(string $project, string $zone, \Google\Cloud\Compute\V1\InstanceSettings $instanceSettingsResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceSettingsResource($instanceSettingsResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\InstanceSettings $instance_settings_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 $update_mask + * update_mask indicates fields to be updated as part of this request. + * @type string $zone + * The zone scoping this request. It should conform to RFC1035. + * } + */ + 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.InstanceSettings instance_settings_resource = 290689920 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceSettings|null + */ + public function getInstanceSettingsResource() + { + return $this->instance_settings_resource; + } + + public function hasInstanceSettingsResource() + { + return isset($this->instance_settings_resource); + } + + public function clearInstanceSettingsResource() + { + unset($this->instance_settings_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceSettings instance_settings_resource = 290689920 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceSettings $var + * @return $this + */ + public function setInstanceSettingsResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceSettings::class); + $this->instance_settings_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; + } + + /** + * 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 zone scoping this request. It should conform to RFC1035. + * + * 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 zone scoping this request. It should conform to RFC1035. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchInterconnectAttachmentRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchInterconnectAttachmentRequest.php new file mode 100644 index 000000000000..c8d5c15df398 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchInterconnectAttachmentRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.PatchInterconnectAttachmentRequest + */ +class PatchInterconnectAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the interconnect attachment to patch. + * + * Generated from protobuf field string interconnect_attachment = 308135284 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $interconnect_attachment = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InterconnectAttachment interconnect_attachment_resource = 212341369 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $interconnect_attachment_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"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $interconnectAttachment Name of the interconnect attachment to patch. + * @param \Google\Cloud\Compute\V1\InterconnectAttachment $interconnectAttachmentResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchInterconnectAttachmentRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $interconnectAttachment, \Google\Cloud\Compute\V1\InterconnectAttachment $interconnectAttachmentResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInterconnectAttachment($interconnectAttachment) + ->setInterconnectAttachmentResource($interconnectAttachmentResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $interconnect_attachment + * Name of the interconnect attachment to patch. + * @type \Google\Cloud\Compute\V1\InterconnectAttachment $interconnect_attachment_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the interconnect attachment to patch. + * + * Generated from protobuf field string interconnect_attachment = 308135284 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInterconnectAttachment() + { + return $this->interconnect_attachment; + } + + /** + * Name of the interconnect attachment to patch. + * + * Generated from protobuf field string interconnect_attachment = 308135284 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInterconnectAttachment($var) + { + GPBUtil::checkString($var, True); + $this->interconnect_attachment = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InterconnectAttachment interconnect_attachment_resource = 212341369 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InterconnectAttachment|null + */ + public function getInterconnectAttachmentResource() + { + return $this->interconnect_attachment_resource; + } + + public function hasInterconnectAttachmentResource() + { + return isset($this->interconnect_attachment_resource); + } + + public function clearInterconnectAttachmentResource() + { + unset($this->interconnect_attachment_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InterconnectAttachment interconnect_attachment_resource = 212341369 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InterconnectAttachment $var + * @return $this + */ + public function setInterconnectAttachmentResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InterconnectAttachment::class); + $this->interconnect_attachment_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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchInterconnectRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchInterconnectRequest.php new file mode 100644 index 000000000000..38e58b0a39ca --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchInterconnectRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.PatchInterconnectRequest + */ +class PatchInterconnectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the interconnect to update. + * + * Generated from protobuf field string interconnect = 224601230 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $interconnect = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Interconnect interconnect_resource = 397611167 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $interconnect_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $interconnect Name of the interconnect to update. + * @param \Google\Cloud\Compute\V1\Interconnect $interconnectResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchInterconnectRequest + * + * @experimental + */ + public static function build(string $project, string $interconnect, \Google\Cloud\Compute\V1\Interconnect $interconnectResource): self + { + return (new self()) + ->setProject($project) + ->setInterconnect($interconnect) + ->setInterconnectResource($interconnectResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $interconnect + * Name of the interconnect to update. + * @type \Google\Cloud\Compute\V1\Interconnect $interconnect_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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the interconnect to update. + * + * Generated from protobuf field string interconnect = 224601230 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInterconnect() + { + return $this->interconnect; + } + + /** + * Name of the interconnect to update. + * + * Generated from protobuf field string interconnect = 224601230 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInterconnect($var) + { + GPBUtil::checkString($var, True); + $this->interconnect = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Interconnect interconnect_resource = 397611167 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Interconnect|null + */ + public function getInterconnectResource() + { + return $this->interconnect_resource; + } + + public function hasInterconnectResource() + { + return isset($this->interconnect_resource); + } + + public function clearInterconnectResource() + { + unset($this->interconnect_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Interconnect interconnect_resource = 397611167 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Interconnect $var + * @return $this + */ + public function setInterconnectResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Interconnect::class); + $this->interconnect_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchNetworkAttachmentRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchNetworkAttachmentRequest.php new file mode 100644 index 000000000000..83c50305d289 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchNetworkAttachmentRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.PatchNetworkAttachmentRequest + */ +class PatchNetworkAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the NetworkAttachment resource to patch. + * + * Generated from protobuf field string network_attachment = 224644052 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_attachment = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkAttachment network_attachment_resource = 210974745 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_attachment_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"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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). end_interface: MixerMutationRequestBuilder + * + * Generated from protobuf field optional string request_id = 37109963; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $networkAttachment Name of the NetworkAttachment resource to patch. + * @param \Google\Cloud\Compute\V1\NetworkAttachment $networkAttachmentResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchNetworkAttachmentRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $networkAttachment, \Google\Cloud\Compute\V1\NetworkAttachment $networkAttachmentResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setNetworkAttachment($networkAttachment) + ->setNetworkAttachmentResource($networkAttachmentResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network_attachment + * Name of the NetworkAttachment resource to patch. + * @type \Google\Cloud\Compute\V1\NetworkAttachment $network_attachment_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * 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). end_interface: MixerMutationRequestBuilder + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the NetworkAttachment resource to patch. + * + * Generated from protobuf field string network_attachment = 224644052 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkAttachment() + { + return $this->network_attachment; + } + + /** + * Name of the NetworkAttachment resource to patch. + * + * Generated from protobuf field string network_attachment = 224644052 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkAttachment($var) + { + GPBUtil::checkString($var, True); + $this->network_attachment = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkAttachment network_attachment_resource = 210974745 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NetworkAttachment|null + */ + public function getNetworkAttachmentResource() + { + return $this->network_attachment_resource; + } + + public function hasNetworkAttachmentResource() + { + return isset($this->network_attachment_resource); + } + + public function clearNetworkAttachmentResource() + { + unset($this->network_attachment_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkAttachment network_attachment_resource = 210974745 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NetworkAttachment $var + * @return $this + */ + public function setNetworkAttachmentResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkAttachment::class); + $this->network_attachment_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; + } + + /** + * 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; + } + + /** + * 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). end_interface: MixerMutationRequestBuilder + * + * 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). end_interface: MixerMutationRequestBuilder + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchNetworkEdgeSecurityServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchNetworkEdgeSecurityServiceRequest.php new file mode 100644 index 000000000000..6919f1f5773d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchNetworkEdgeSecurityServiceRequest.php @@ -0,0 +1,323 @@ +google.cloud.compute.v1.PatchNetworkEdgeSecurityServiceRequest + */ +class PatchNetworkEdgeSecurityServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the network edge security service to update. + * + * Generated from protobuf field string network_edge_security_service = 157011879 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_edge_security_service = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkEdgeSecurityService network_edge_security_service_resource = 477548966 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_edge_security_service_resource = null; + /** + * Generated from protobuf field optional string paths = 106438894; + */ + protected $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"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Indicates fields to be updated as part of this request. + * + * Generated from protobuf field optional string update_mask = 500079778; + */ + protected $update_mask = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $networkEdgeSecurityService Name of the network edge security service to update. + * @param \Google\Cloud\Compute\V1\NetworkEdgeSecurityService $networkEdgeSecurityServiceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchNetworkEdgeSecurityServiceRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $networkEdgeSecurityService, \Google\Cloud\Compute\V1\NetworkEdgeSecurityService $networkEdgeSecurityServiceResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setNetworkEdgeSecurityService($networkEdgeSecurityService) + ->setNetworkEdgeSecurityServiceResource($networkEdgeSecurityServiceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network_edge_security_service + * Name of the network edge security service to update. + * @type \Google\Cloud\Compute\V1\NetworkEdgeSecurityService $network_edge_security_service_resource + * The body resource for this request + * @type string $paths + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 + * 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); + } + + /** + * Name of the network edge security service to update. + * + * Generated from protobuf field string network_edge_security_service = 157011879 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkEdgeSecurityService() + { + return $this->network_edge_security_service; + } + + /** + * Name of the network edge security service to update. + * + * Generated from protobuf field string network_edge_security_service = 157011879 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkEdgeSecurityService($var) + { + GPBUtil::checkString($var, True); + $this->network_edge_security_service = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkEdgeSecurityService network_edge_security_service_resource = 477548966 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NetworkEdgeSecurityService|null + */ + public function getNetworkEdgeSecurityServiceResource() + { + return $this->network_edge_security_service_resource; + } + + public function hasNetworkEdgeSecurityServiceResource() + { + return isset($this->network_edge_security_service_resource); + } + + public function clearNetworkEdgeSecurityServiceResource() + { + unset($this->network_edge_security_service_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkEdgeSecurityService network_edge_security_service_resource = 477548966 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NetworkEdgeSecurityService $var + * @return $this + */ + public function setNetworkEdgeSecurityServiceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkEdgeSecurityService::class); + $this->network_edge_security_service_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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * 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); + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..1adc5a6116d4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchNetworkFirewallPolicyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.PatchNetworkFirewallPolicyRequest + */ +class PatchNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicy firewall_policy_resource = 495049532 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $firewallPolicy Name of the firewall policy to update. + * @param \Google\Cloud\Compute\V1\FirewallPolicy $firewallPolicyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $firewallPolicy, \Google\Cloud\Compute\V1\FirewallPolicy $firewallPolicyResource): self + { + return (new self()) + ->setProject($project) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyResource($firewallPolicyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to update. + * @type \Google\Cloud\Compute\V1\FirewallPolicy $firewall_policy_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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicy firewall_policy_resource = 495049532 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\FirewallPolicy|null + */ + public function getFirewallPolicyResource() + { + return $this->firewall_policy_resource; + } + + public function hasFirewallPolicyResource() + { + return isset($this->firewall_policy_resource); + } + + public function clearFirewallPolicyResource() + { + unset($this->firewall_policy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicy firewall_policy_resource = 495049532 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\FirewallPolicy $var + * @return $this + */ + public function setFirewallPolicyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\FirewallPolicy::class); + $this->firewall_policy_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchNetworkRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchNetworkRequest.php new file mode 100644 index 000000000000..566277d28787 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchNetworkRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.PatchNetworkRequest + */ +class PatchNetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the network to update. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Network network_resource = 122105599 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $network Name of the network to update. + * @param \Google\Cloud\Compute\V1\Network $networkResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchNetworkRequest + * + * @experimental + */ + public static function build(string $project, string $network, \Google\Cloud\Compute\V1\Network $networkResource): self + { + return (new self()) + ->setProject($project) + ->setNetwork($network) + ->setNetworkResource($networkResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Name of the network to update. + * @type \Google\Cloud\Compute\V1\Network $network_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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the network to update. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Name of the network to update. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Network network_resource = 122105599 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Network|null + */ + public function getNetworkResource() + { + return $this->network_resource; + } + + public function hasNetworkResource() + { + return isset($this->network_resource); + } + + public function clearNetworkResource() + { + unset($this->network_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Network network_resource = 122105599 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Network $var + * @return $this + */ + public function setNetworkResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Network::class); + $this->network_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchNodeGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchNodeGroupRequest.php new file mode 100644 index 000000000000..c6f5a77ede8c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchNodeGroupRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.PatchNodeGroupRequest + */ +class PatchNodeGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the NodeGroup resource to update. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $node_group = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeGroup node_group_resource = 505321899 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $node_group_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $nodeGroup Name of the NodeGroup resource to update. + * @param \Google\Cloud\Compute\V1\NodeGroup $nodeGroupResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchNodeGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $nodeGroup, \Google\Cloud\Compute\V1\NodeGroup $nodeGroupResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setNodeGroup($nodeGroup) + ->setNodeGroupResource($nodeGroupResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $node_group + * Name of the NodeGroup resource to update. + * @type \Google\Cloud\Compute\V1\NodeGroup $node_group_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); + } + + /** + * Name of the NodeGroup resource to update. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNodeGroup() + { + return $this->node_group; + } + + /** + * Name of the NodeGroup resource to update. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNodeGroup($var) + { + GPBUtil::checkString($var, True); + $this->node_group = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeGroup node_group_resource = 505321899 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NodeGroup|null + */ + public function getNodeGroupResource() + { + return $this->node_group_resource; + } + + public function hasNodeGroupResource() + { + return isset($this->node_group_resource); + } + + public function clearNodeGroupResource() + { + unset($this->node_group_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeGroup node_group_resource = 505321899 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NodeGroup $var + * @return $this + */ + public function setNodeGroupResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NodeGroup::class); + $this->node_group_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchPacketMirroringRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchPacketMirroringRequest.php new file mode 100644 index 000000000000..a9764a6b176e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchPacketMirroringRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.PatchPacketMirroringRequest + */ +class PatchPacketMirroringRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the PacketMirroring resource to patch. + * + * Generated from protobuf field string packet_mirroring = 22305996 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $packet_mirroring = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PacketMirroring packet_mirroring_resource = 493501985 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $packet_mirroring_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"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $packetMirroring Name of the PacketMirroring resource to patch. + * @param \Google\Cloud\Compute\V1\PacketMirroring $packetMirroringResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchPacketMirroringRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $packetMirroring, \Google\Cloud\Compute\V1\PacketMirroring $packetMirroringResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setPacketMirroring($packetMirroring) + ->setPacketMirroringResource($packetMirroringResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $packet_mirroring + * Name of the PacketMirroring resource to patch. + * @type \Google\Cloud\Compute\V1\PacketMirroring $packet_mirroring_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * 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); + } + + /** + * Name of the PacketMirroring resource to patch. + * + * Generated from protobuf field string packet_mirroring = 22305996 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPacketMirroring() + { + return $this->packet_mirroring; + } + + /** + * Name of the PacketMirroring resource to patch. + * + * Generated from protobuf field string packet_mirroring = 22305996 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPacketMirroring($var) + { + GPBUtil::checkString($var, True); + $this->packet_mirroring = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PacketMirroring packet_mirroring_resource = 493501985 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\PacketMirroring|null + */ + public function getPacketMirroringResource() + { + return $this->packet_mirroring_resource; + } + + public function hasPacketMirroringResource() + { + return isset($this->packet_mirroring_resource); + } + + public function clearPacketMirroringResource() + { + unset($this->packet_mirroring_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PacketMirroring packet_mirroring_resource = 493501985 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\PacketMirroring $var + * @return $this + */ + public function setPacketMirroringResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\PacketMirroring::class); + $this->packet_mirroring_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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchPerInstanceConfigsInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchPerInstanceConfigsInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..15a8f7d8f243 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchPerInstanceConfigsInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest + */ +class PatchPerInstanceConfigsInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq instance_group_managers_patch_per_instance_configs_req_resource = 356650495 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_managers_patch_per_instance_configs_req_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @param string $instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersPatchPerInstanceConfigsReq $instanceGroupManagersPatchPerInstanceConfigsReqResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchPerInstanceConfigsInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager, \Google\Cloud\Compute\V1\InstanceGroupManagersPatchPerInstanceConfigsReq $instanceGroupManagersPatchPerInstanceConfigsReqResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersPatchPerInstanceConfigsReqResource($instanceGroupManagersPatchPerInstanceConfigsReqResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group. It should conform to RFC1035. + * @type \Google\Cloud\Compute\V1\InstanceGroupManagersPatchPerInstanceConfigsReq $instance_group_managers_patch_per_instance_configs_req_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 where the managed instance group is located. It should conform to RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq instance_group_managers_patch_per_instance_configs_req_resource = 356650495 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagersPatchPerInstanceConfigsReq|null + */ + public function getInstanceGroupManagersPatchPerInstanceConfigsReqResource() + { + return $this->instance_group_managers_patch_per_instance_configs_req_resource; + } + + public function hasInstanceGroupManagersPatchPerInstanceConfigsReqResource() + { + return isset($this->instance_group_managers_patch_per_instance_configs_req_resource); + } + + public function clearInstanceGroupManagersPatchPerInstanceConfigsReqResource() + { + unset($this->instance_group_managers_patch_per_instance_configs_req_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq instance_group_managers_patch_per_instance_configs_req_resource = 356650495 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersPatchPerInstanceConfigsReq $var + * @return $this + */ + public function setInstanceGroupManagersPatchPerInstanceConfigsReqResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagersPatchPerInstanceConfigsReq::class); + $this->instance_group_managers_patch_per_instance_configs_req_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 where the managed instance group is located. It should conform to RFC1035. + * + * 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 where the managed instance group is located. It should conform to RFC1035. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..5b4e5e3cfd81 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + */ +class PatchPerInstanceConfigsRegionInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request, should conform to RFC1035. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq region_instance_group_manager_patch_instance_config_req_resource = 197682890 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_instance_group_manager_patch_instance_config_req_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request, should conform to RFC1035. + * @param string $instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagerPatchInstanceConfigReq $regionInstanceGroupManagerPatchInstanceConfigReqResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroupManager, \Google\Cloud\Compute\V1\RegionInstanceGroupManagerPatchInstanceConfigReq $regionInstanceGroupManagerPatchInstanceConfigReqResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroupManager($instanceGroupManager) + ->setRegionInstanceGroupManagerPatchInstanceConfigReqResource($regionInstanceGroupManagerPatchInstanceConfigReqResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group. It should conform to RFC1035. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request, should conform to RFC1035. + * @type \Google\Cloud\Compute\V1\RegionInstanceGroupManagerPatchInstanceConfigReq $region_instance_group_manager_patch_instance_config_req_resource + * The body resource 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 managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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; + } + + /** + * Name of the region scoping this request, should conform to RFC1035. + * + * 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; + } + + /** + * Name of the region scoping this request, should conform to RFC1035. + * + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq region_instance_group_manager_patch_instance_config_req_resource = 197682890 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionInstanceGroupManagerPatchInstanceConfigReq|null + */ + public function getRegionInstanceGroupManagerPatchInstanceConfigReqResource() + { + return $this->region_instance_group_manager_patch_instance_config_req_resource; + } + + public function hasRegionInstanceGroupManagerPatchInstanceConfigReqResource() + { + return isset($this->region_instance_group_manager_patch_instance_config_req_resource); + } + + public function clearRegionInstanceGroupManagerPatchInstanceConfigReqResource() + { + unset($this->region_instance_group_manager_patch_instance_config_req_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq region_instance_group_manager_patch_instance_config_req_resource = 197682890 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagerPatchInstanceConfigReq $var + * @return $this + */ + public function setRegionInstanceGroupManagerPatchInstanceConfigReqResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionInstanceGroupManagerPatchInstanceConfigReq::class); + $this->region_instance_group_manager_patch_instance_config_req_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchPublicAdvertisedPrefixeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchPublicAdvertisedPrefixeRequest.php new file mode 100644 index 000000000000..9d9ae5eff171 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchPublicAdvertisedPrefixeRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest + */ +class PatchPublicAdvertisedPrefixeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the PublicAdvertisedPrefix resource to patch. + * + * Generated from protobuf field string public_advertised_prefix = 101874590 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $public_advertised_prefix = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PublicAdvertisedPrefix public_advertised_prefix_resource = 233614223 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $public_advertised_prefix_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $publicAdvertisedPrefix Name of the PublicAdvertisedPrefix resource to patch. + * @param \Google\Cloud\Compute\V1\PublicAdvertisedPrefix $publicAdvertisedPrefixResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchPublicAdvertisedPrefixeRequest + * + * @experimental + */ + public static function build(string $project, string $publicAdvertisedPrefix, \Google\Cloud\Compute\V1\PublicAdvertisedPrefix $publicAdvertisedPrefixResource): self + { + return (new self()) + ->setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix) + ->setPublicAdvertisedPrefixResource($publicAdvertisedPrefixResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $public_advertised_prefix + * Name of the PublicAdvertisedPrefix resource to patch. + * @type \Google\Cloud\Compute\V1\PublicAdvertisedPrefix $public_advertised_prefix_resource + * The body resource 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); + } + + /** + * 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; + } + + /** + * Name of the PublicAdvertisedPrefix resource to patch. + * + * Generated from protobuf field string public_advertised_prefix = 101874590 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPublicAdvertisedPrefix() + { + return $this->public_advertised_prefix; + } + + /** + * Name of the PublicAdvertisedPrefix resource to patch. + * + * Generated from protobuf field string public_advertised_prefix = 101874590 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPublicAdvertisedPrefix($var) + { + GPBUtil::checkString($var, True); + $this->public_advertised_prefix = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PublicAdvertisedPrefix public_advertised_prefix_resource = 233614223 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\PublicAdvertisedPrefix|null + */ + public function getPublicAdvertisedPrefixResource() + { + return $this->public_advertised_prefix_resource; + } + + public function hasPublicAdvertisedPrefixResource() + { + return isset($this->public_advertised_prefix_resource); + } + + public function clearPublicAdvertisedPrefixResource() + { + unset($this->public_advertised_prefix_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PublicAdvertisedPrefix public_advertised_prefix_resource = 233614223 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\PublicAdvertisedPrefix $var + * @return $this + */ + public function setPublicAdvertisedPrefixResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\PublicAdvertisedPrefix::class); + $this->public_advertised_prefix_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchPublicDelegatedPrefixeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchPublicDelegatedPrefixeRequest.php new file mode 100644 index 000000000000..c491ea01e575 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchPublicDelegatedPrefixeRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest + */ +class PatchPublicDelegatedPrefixeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the PublicDelegatedPrefix resource to patch. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $public_delegated_prefix = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PublicDelegatedPrefix public_delegated_prefix_resource = 47594501 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $public_delegated_prefix_resource = null; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $publicDelegatedPrefix Name of the PublicDelegatedPrefix resource to patch. + * @param \Google\Cloud\Compute\V1\PublicDelegatedPrefix $publicDelegatedPrefixResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchPublicDelegatedPrefixeRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $publicDelegatedPrefix, \Google\Cloud\Compute\V1\PublicDelegatedPrefix $publicDelegatedPrefixResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $public_delegated_prefix + * Name of the PublicDelegatedPrefix resource to patch. + * @type \Google\Cloud\Compute\V1\PublicDelegatedPrefix $public_delegated_prefix_resource + * The body resource for this request + * @type string $region + * 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); + } + + /** + * 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; + } + + /** + * Name of the PublicDelegatedPrefix resource to patch. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPublicDelegatedPrefix() + { + return $this->public_delegated_prefix; + } + + /** + * Name of the PublicDelegatedPrefix resource to patch. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPublicDelegatedPrefix($var) + { + GPBUtil::checkString($var, True); + $this->public_delegated_prefix = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PublicDelegatedPrefix public_delegated_prefix_resource = 47594501 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\PublicDelegatedPrefix|null + */ + public function getPublicDelegatedPrefixResource() + { + return $this->public_delegated_prefix_resource; + } + + public function hasPublicDelegatedPrefixResource() + { + return isset($this->public_delegated_prefix_resource); + } + + public function clearPublicDelegatedPrefixResource() + { + unset($this->public_delegated_prefix_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.PublicDelegatedPrefix public_delegated_prefix_resource = 47594501 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\PublicDelegatedPrefix $var + * @return $this + */ + public function setPublicDelegatedPrefixResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\PublicDelegatedPrefix::class); + $this->public_delegated_prefix_resource = $var; + + return $this; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionAutoscalerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionAutoscalerRequest.php new file mode 100644 index 000000000000..8ac1b4aaa6d0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionAutoscalerRequest.php @@ -0,0 +1,250 @@ +google.cloud.compute.v1.PatchRegionAutoscalerRequest + */ +class PatchRegionAutoscalerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the autoscaler to patch. + * + * Generated from protobuf field optional string autoscaler = 517258967; + */ + protected $autoscaler = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Autoscaler autoscaler_resource = 207616118 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $autoscaler_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"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param \Google\Cloud\Compute\V1\Autoscaler $autoscalerResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchRegionAutoscalerRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\Autoscaler $autoscalerResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setAutoscalerResource($autoscalerResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $autoscaler + * Name of the autoscaler to patch. + * @type \Google\Cloud\Compute\V1\Autoscaler $autoscaler_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the autoscaler to patch. + * + * Generated from protobuf field optional string autoscaler = 517258967; + * @return string + */ + public function getAutoscaler() + { + return isset($this->autoscaler) ? $this->autoscaler : ''; + } + + public function hasAutoscaler() + { + return isset($this->autoscaler); + } + + public function clearAutoscaler() + { + unset($this->autoscaler); + } + + /** + * Name of the autoscaler to patch. + * + * Generated from protobuf field optional string autoscaler = 517258967; + * @param string $var + * @return $this + */ + public function setAutoscaler($var) + { + GPBUtil::checkString($var, True); + $this->autoscaler = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Autoscaler autoscaler_resource = 207616118 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Autoscaler|null + */ + public function getAutoscalerResource() + { + return $this->autoscaler_resource; + } + + public function hasAutoscalerResource() + { + return isset($this->autoscaler_resource); + } + + public function clearAutoscalerResource() + { + unset($this->autoscaler_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Autoscaler autoscaler_resource = 207616118 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Autoscaler $var + * @return $this + */ + public function setAutoscalerResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Autoscaler::class); + $this->autoscaler_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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionBackendServiceRequest.php new file mode 100644 index 000000000000..8f0ca79539c5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionBackendServiceRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.PatchRegionBackendServiceRequest + */ +class PatchRegionBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the BackendService resource to patch. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_service = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendService backend_service_resource = 347586723 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_service_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"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $backendService Name of the BackendService resource to patch. + * @param \Google\Cloud\Compute\V1\BackendService $backendServiceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchRegionBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $backendService, \Google\Cloud\Compute\V1\BackendService $backendServiceResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setBackendService($backendService) + ->setBackendServiceResource($backendServiceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_service + * Name of the BackendService resource to patch. + * @type \Google\Cloud\Compute\V1\BackendService $backend_service_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the BackendService resource to patch. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackendService() + { + return $this->backend_service; + } + + /** + * Name of the BackendService resource to patch. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackendService($var) + { + GPBUtil::checkString($var, True); + $this->backend_service = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendService backend_service_resource = 347586723 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\BackendService|null + */ + public function getBackendServiceResource() + { + return $this->backend_service_resource; + } + + public function hasBackendServiceResource() + { + return isset($this->backend_service_resource); + } + + public function clearBackendServiceResource() + { + unset($this->backend_service_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendService backend_service_resource = 347586723 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\BackendService $var + * @return $this + */ + public function setBackendServiceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BackendService::class); + $this->backend_service_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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionHealthCheckRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionHealthCheckRequest.php new file mode 100644 index 000000000000..bfa319156d75 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionHealthCheckRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.PatchRegionHealthCheckRequest + */ +class PatchRegionHealthCheckRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the HealthCheck resource to patch. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $health_check = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.HealthCheck health_check_resource = 201925032 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $health_check_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"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $healthCheck Name of the HealthCheck resource to patch. + * @param \Google\Cloud\Compute\V1\HealthCheck $healthCheckResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchRegionHealthCheckRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $healthCheck, \Google\Cloud\Compute\V1\HealthCheck $healthCheckResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setHealthCheck($healthCheck) + ->setHealthCheckResource($healthCheckResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $health_check + * Name of the HealthCheck resource to patch. + * @type \Google\Cloud\Compute\V1\HealthCheck $health_check_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the HealthCheck resource to patch. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getHealthCheck() + { + return $this->health_check; + } + + /** + * Name of the HealthCheck resource to patch. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setHealthCheck($var) + { + GPBUtil::checkString($var, True); + $this->health_check = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.HealthCheck health_check_resource = 201925032 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\HealthCheck|null + */ + public function getHealthCheckResource() + { + return $this->health_check_resource; + } + + public function hasHealthCheckResource() + { + return isset($this->health_check_resource); + } + + public function clearHealthCheckResource() + { + unset($this->health_check_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.HealthCheck health_check_resource = 201925032 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\HealthCheck $var + * @return $this + */ + public function setHealthCheckResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HealthCheck::class); + $this->health_check_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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionHealthCheckServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionHealthCheckServiceRequest.php new file mode 100644 index 000000000000..37c5400938de --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionHealthCheckServiceRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest + */ +class PatchRegionHealthCheckServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string health_check_service = 408374747 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $health_check_service = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.HealthCheckService health_check_service_resource = 477367794 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $health_check_service_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"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $healthCheckService Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035. + * @param \Google\Cloud\Compute\V1\HealthCheckService $healthCheckServiceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchRegionHealthCheckServiceRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $healthCheckService, \Google\Cloud\Compute\V1\HealthCheckService $healthCheckServiceResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setHealthCheckService($healthCheckService) + ->setHealthCheckServiceResource($healthCheckServiceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $health_check_service + * Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035. + * @type \Google\Cloud\Compute\V1\HealthCheckService $health_check_service_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string health_check_service = 408374747 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getHealthCheckService() + { + return $this->health_check_service; + } + + /** + * Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string health_check_service = 408374747 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setHealthCheckService($var) + { + GPBUtil::checkString($var, True); + $this->health_check_service = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.HealthCheckService health_check_service_resource = 477367794 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\HealthCheckService|null + */ + public function getHealthCheckServiceResource() + { + return $this->health_check_service_resource; + } + + public function hasHealthCheckServiceResource() + { + return isset($this->health_check_service_resource); + } + + public function clearHealthCheckServiceResource() + { + unset($this->health_check_service_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.HealthCheckService health_check_service_resource = 477367794 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\HealthCheckService $var + * @return $this + */ + public function setHealthCheckServiceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HealthCheckService::class); + $this->health_check_service_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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..b2ea9d2f7e82 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest + */ +class PatchRegionInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the instance group manager. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManager instance_group_manager_resource = 261063946 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager_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"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $instanceGroupManager The name of the instance group manager. + * @param \Google\Cloud\Compute\V1\InstanceGroupManager $instanceGroupManagerResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchRegionInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroupManager, \Google\Cloud\Compute\V1\InstanceGroupManager $instanceGroupManagerResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagerResource($instanceGroupManagerResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the instance group manager. + * @type \Google\Cloud\Compute\V1\InstanceGroupManager $instance_group_manager_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 group manager. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the instance group manager. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManager instance_group_manager_resource = 261063946 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupManager|null + */ + public function getInstanceGroupManagerResource() + { + return $this->instance_group_manager_resource; + } + + public function hasInstanceGroupManagerResource() + { + return isset($this->instance_group_manager_resource); + } + + public function clearInstanceGroupManagerResource() + { + unset($this->instance_group_manager_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManager instance_group_manager_resource = 261063946 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupManager $var + * @return $this + */ + public function setInstanceGroupManagerResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManager::class); + $this->instance_group_manager_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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..acec419ffbdc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionNetworkFirewallPolicyRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.PatchRegionNetworkFirewallPolicyRequest + */ +class PatchRegionNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicy firewall_policy_resource = 495049532 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy_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"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $firewallPolicy Name of the firewall policy to update. + * @param \Google\Cloud\Compute\V1\FirewallPolicy $firewallPolicyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchRegionNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $firewallPolicy, \Google\Cloud\Compute\V1\FirewallPolicy $firewallPolicyResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyResource($firewallPolicyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to update. + * @type \Google\Cloud\Compute\V1\FirewallPolicy $firewall_policy_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicy firewall_policy_resource = 495049532 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\FirewallPolicy|null + */ + public function getFirewallPolicyResource() + { + return $this->firewall_policy_resource; + } + + public function hasFirewallPolicyResource() + { + return isset($this->firewall_policy_resource); + } + + public function clearFirewallPolicyResource() + { + unset($this->firewall_policy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicy firewall_policy_resource = 495049532 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\FirewallPolicy $var + * @return $this + */ + public function setFirewallPolicyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\FirewallPolicy::class); + $this->firewall_policy_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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionSecurityPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionSecurityPolicyRequest.php new file mode 100644 index 000000000000..072b5d22d11d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionSecurityPolicyRequest.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.PatchRegionSecurityPolicyRequest + */ +class PatchRegionSecurityPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicy security_policy_resource = 216159612 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy_resource = null; + /** + * Indicates fields to be cleared as part of this request. + * + * Generated from protobuf field optional string update_mask = 500079778; + */ + protected $update_mask = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $securityPolicy Name of the security policy to update. + * @param \Google\Cloud\Compute\V1\SecurityPolicy $securityPolicyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchRegionSecurityPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $securityPolicy, \Google\Cloud\Compute\V1\SecurityPolicy $securityPolicyResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyResource($securityPolicyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 $security_policy + * Name of the security policy to update. + * @type \Google\Cloud\Compute\V1\SecurityPolicy $security_policy_resource + * The body resource for this request + * @type string $update_mask + * Indicates fields to be cleared as part of this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSecurityPolicy() + { + return $this->security_policy; + } + + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->security_policy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicy security_policy_resource = 216159612 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SecurityPolicy|null + */ + public function getSecurityPolicyResource() + { + return $this->security_policy_resource; + } + + public function hasSecurityPolicyResource() + { + return isset($this->security_policy_resource); + } + + public function clearSecurityPolicyResource() + { + unset($this->security_policy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicy security_policy_resource = 216159612 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SecurityPolicy $var + * @return $this + */ + public function setSecurityPolicyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicy::class); + $this->security_policy_resource = $var; + + return $this; + } + + /** + * Indicates fields to be cleared 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); + } + + /** + * Indicates fields to be cleared 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionSslPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionSslPolicyRequest.php new file mode 100644 index 000000000000..6a29b5612717 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionSslPolicyRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.PatchRegionSslPolicyRequest + */ +class PatchRegionSslPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string ssl_policy = 295190213 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ssl_policy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslPolicy ssl_policy_resource = 274891848 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ssl_policy_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * @param \Google\Cloud\Compute\V1\SslPolicy $sslPolicyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchRegionSslPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $sslPolicy, \Google\Cloud\Compute\V1\SslPolicy $sslPolicyResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setSslPolicy($sslPolicy) + ->setSslPolicyResource($sslPolicyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 $ssl_policy + * Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * @type \Google\Cloud\Compute\V1\SslPolicy $ssl_policy_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string ssl_policy = 295190213 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSslPolicy() + { + return $this->ssl_policy; + } + + /** + * Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string ssl_policy = 295190213 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSslPolicy($var) + { + GPBUtil::checkString($var, True); + $this->ssl_policy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslPolicy ssl_policy_resource = 274891848 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SslPolicy|null + */ + public function getSslPolicyResource() + { + return $this->ssl_policy_resource; + } + + public function hasSslPolicyResource() + { + return isset($this->ssl_policy_resource); + } + + public function clearSslPolicyResource() + { + unset($this->ssl_policy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslPolicy ssl_policy_resource = 274891848 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SslPolicy $var + * @return $this + */ + public function setSslPolicyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SslPolicy::class); + $this->ssl_policy_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionTargetHttpsProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionTargetHttpsProxyRequest.php new file mode 100644 index 000000000000..acc635712e9a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionTargetHttpsProxyRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.PatchRegionTargetHttpsProxyRequest + */ +class PatchRegionTargetHttpsProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the TargetHttpsProxy resource to patch. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_https_proxy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpsProxy target_https_proxy_resource = 433657473 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_https_proxy_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource to patch. + * @param \Google\Cloud\Compute\V1\TargetHttpsProxy $targetHttpsProxyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchRegionTargetHttpsProxyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $targetHttpsProxy, \Google\Cloud\Compute\V1\TargetHttpsProxy $targetHttpsProxyResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setTargetHttpsProxyResource($targetHttpsProxyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * 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 $target_https_proxy + * Name of the TargetHttpsProxy resource to patch. + * @type \Google\Cloud\Compute\V1\TargetHttpsProxy $target_https_proxy_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Name of the TargetHttpsProxy resource to patch. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetHttpsProxy() + { + return $this->target_https_proxy; + } + + /** + * Name of the TargetHttpsProxy resource to patch. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetHttpsProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_https_proxy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpsProxy target_https_proxy_resource = 433657473 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetHttpsProxy|null + */ + public function getTargetHttpsProxyResource() + { + return $this->target_https_proxy_resource; + } + + public function hasTargetHttpsProxyResource() + { + return isset($this->target_https_proxy_resource); + } + + public function clearTargetHttpsProxyResource() + { + unset($this->target_https_proxy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpsProxy target_https_proxy_resource = 433657473 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetHttpsProxy $var + * @return $this + */ + public function setTargetHttpsProxyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetHttpsProxy::class); + $this->target_https_proxy_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionUrlMapRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionUrlMapRequest.php new file mode 100644 index 000000000000..88da7e5b91fe --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRegionUrlMapRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.PatchRegionUrlMapRequest + */ +class PatchRegionUrlMapRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * + * Generated from protobuf field optional string request_id = 37109963; + */ + protected $request_id = null; + /** + * Name of the UrlMap resource to patch. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url_map = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMap url_map_resource = 168675425 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url_map_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $urlMap Name of the UrlMap resource to patch. + * @param \Google\Cloud\Compute\V1\UrlMap $urlMapResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchRegionUrlMapRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $urlMap, \Google\Cloud\Compute\V1\UrlMap $urlMapResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setUrlMap($urlMap) + ->setUrlMapResource($urlMapResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type string $request_id + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * @type string $url_map + * Name of the UrlMap resource to patch. + * @type \Google\Cloud\Compute\V1\UrlMap $url_map_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * + * 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); + } + + /** + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * + * 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; + } + + /** + * Name of the UrlMap resource to patch. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUrlMap() + { + return $this->url_map; + } + + /** + * Name of the UrlMap resource to patch. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUrlMap($var) + { + GPBUtil::checkString($var, True); + $this->url_map = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMap url_map_resource = 168675425 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\UrlMap|null + */ + public function getUrlMapResource() + { + return $this->url_map_resource; + } + + public function hasUrlMapResource() + { + return isset($this->url_map_resource); + } + + public function clearUrlMapResource() + { + unset($this->url_map_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMap url_map_resource = 168675425 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\UrlMap $var + * @return $this + */ + public function setUrlMapResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\UrlMap::class); + $this->url_map_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchResourcePolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchResourcePolicyRequest.php new file mode 100644 index 000000000000..78c668025f25 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchResourcePolicyRequest.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.PatchResourcePolicyRequest + */ +class PatchResourcePolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Id of the resource policy to patch. + * + * Generated from protobuf field string resource_policy = 159240835 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource_policy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ResourcePolicy resource_policy_resource = 76826186 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource_policy_resource = null; + /** + * update_mask indicates fields to be updated as part of this request. + * + * Generated from protobuf field optional string update_mask = 500079778; + */ + protected $update_mask = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $resourcePolicy Id of the resource policy to patch. + * @param \Google\Cloud\Compute\V1\ResourcePolicy $resourcePolicyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchResourcePolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resourcePolicy, \Google\Cloud\Compute\V1\ResourcePolicy $resourcePolicyResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResourcePolicy($resourcePolicy) + ->setResourcePolicyResource($resourcePolicyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * 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 $resource_policy + * Id of the resource policy to patch. + * @type \Google\Cloud\Compute\V1\ResourcePolicy $resource_policy_resource + * The body resource for this request + * @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); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Id of the resource policy to patch. + * + * Generated from protobuf field string resource_policy = 159240835 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResourcePolicy() + { + return $this->resource_policy; + } + + /** + * Id of the resource policy to patch. + * + * Generated from protobuf field string resource_policy = 159240835 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResourcePolicy($var) + { + GPBUtil::checkString($var, True); + $this->resource_policy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ResourcePolicy resource_policy_resource = 76826186 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ResourcePolicy|null + */ + public function getResourcePolicyResource() + { + return $this->resource_policy_resource; + } + + public function hasResourcePolicyResource() + { + return isset($this->resource_policy_resource); + } + + public function clearResourcePolicyResource() + { + unset($this->resource_policy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ResourcePolicy resource_policy_resource = 76826186 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ResourcePolicy $var + * @return $this + */ + public function setResourcePolicyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ResourcePolicy::class); + $this->resource_policy_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRouterRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRouterRequest.php new file mode 100644 index 000000000000..e3bdcd3c4e89 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRouterRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.PatchRouterRequest + */ +class PatchRouterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the Router resource to patch. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $router = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Router router_resource = 155222084 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $router_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $router Name of the Router resource to patch. + * @param \Google\Cloud\Compute\V1\Router $routerResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchRouterRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $router, \Google\Cloud\Compute\V1\Router $routerResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router) + ->setRouterResource($routerResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * 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 $router + * Name of the Router resource to patch. + * @type \Google\Cloud\Compute\V1\Router $router_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Name of the Router resource to patch. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRouter() + { + return $this->router; + } + + /** + * Name of the Router resource to patch. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRouter($var) + { + GPBUtil::checkString($var, True); + $this->router = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Router router_resource = 155222084 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Router|null + */ + public function getRouterResource() + { + return $this->router_resource; + } + + public function hasRouterResource() + { + return isset($this->router_resource); + } + + public function clearRouterResource() + { + unset($this->router_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Router router_resource = 155222084 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Router $var + * @return $this + */ + public function setRouterResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Router::class); + $this->router_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRuleFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRuleFirewallPolicyRequest.php new file mode 100644 index 000000000000..24cb334fd0ed --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRuleFirewallPolicyRequest.php @@ -0,0 +1,214 @@ +google.cloud.compute.v1.PatchRuleFirewallPolicyRequest + */ +class PatchRuleFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyRule firewall_policy_rule_resource = 250523523 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy_rule_resource = null; + /** + * The priority of the rule to patch. + * + * Generated from protobuf field optional int32 priority = 445151652; + */ + protected $priority = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $firewallPolicy Name of the firewall policy to update. + * @param \Google\Cloud\Compute\V1\FirewallPolicyRule $firewallPolicyRuleResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchRuleFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $firewallPolicy, \Google\Cloud\Compute\V1\FirewallPolicyRule $firewallPolicyRuleResource): self + { + return (new self()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to update. + * @type \Google\Cloud\Compute\V1\FirewallPolicyRule $firewall_policy_rule_resource + * The body resource for this request + * @type int $priority + * The priority of the rule to patch. + * @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); + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyRule firewall_policy_rule_resource = 250523523 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\FirewallPolicyRule|null + */ + public function getFirewallPolicyRuleResource() + { + return $this->firewall_policy_rule_resource; + } + + public function hasFirewallPolicyRuleResource() + { + return isset($this->firewall_policy_rule_resource); + } + + public function clearFirewallPolicyRuleResource() + { + unset($this->firewall_policy_rule_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyRule firewall_policy_rule_resource = 250523523 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\FirewallPolicyRule $var + * @return $this + */ + public function setFirewallPolicyRuleResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\FirewallPolicyRule::class); + $this->firewall_policy_rule_resource = $var; + + return $this; + } + + /** + * The priority of the rule to patch. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @return int + */ + public function getPriority() + { + return isset($this->priority) ? $this->priority : 0; + } + + public function hasPriority() + { + return isset($this->priority); + } + + public function clearPriority() + { + unset($this->priority); + } + + /** + * The priority of the rule to patch. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt32($var); + $this->priority = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRuleNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRuleNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..343492b71d4d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRuleNetworkFirewallPolicyRequest.php @@ -0,0 +1,250 @@ +google.cloud.compute.v1.PatchRuleNetworkFirewallPolicyRequest + */ +class PatchRuleNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyRule firewall_policy_rule_resource = 250523523 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy_rule_resource = null; + /** + * The priority of the rule to patch. + * + * Generated from protobuf field optional int32 priority = 445151652; + */ + protected $priority = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $firewallPolicy Name of the firewall policy to update. + * @param \Google\Cloud\Compute\V1\FirewallPolicyRule $firewallPolicyRuleResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchRuleNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $firewallPolicy, \Google\Cloud\Compute\V1\FirewallPolicyRule $firewallPolicyRuleResource): self + { + return (new self()) + ->setProject($project) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to update. + * @type \Google\Cloud\Compute\V1\FirewallPolicyRule $firewall_policy_rule_resource + * The body resource for this request + * @type int $priority + * The priority of the rule to patch. + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyRule firewall_policy_rule_resource = 250523523 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\FirewallPolicyRule|null + */ + public function getFirewallPolicyRuleResource() + { + return $this->firewall_policy_rule_resource; + } + + public function hasFirewallPolicyRuleResource() + { + return isset($this->firewall_policy_rule_resource); + } + + public function clearFirewallPolicyRuleResource() + { + unset($this->firewall_policy_rule_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyRule firewall_policy_rule_resource = 250523523 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\FirewallPolicyRule $var + * @return $this + */ + public function setFirewallPolicyRuleResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\FirewallPolicyRule::class); + $this->firewall_policy_rule_resource = $var; + + return $this; + } + + /** + * The priority of the rule to patch. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @return int + */ + public function getPriority() + { + return isset($this->priority) ? $this->priority : 0; + } + + public function hasPriority() + { + return isset($this->priority); + } + + public function clearPriority() + { + unset($this->priority); + } + + /** + * The priority of the rule to patch. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt32($var); + $this->priority = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRuleRegionNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRuleRegionNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..0633be72eef7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRuleRegionNetworkFirewallPolicyRequest.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.PatchRuleRegionNetworkFirewallPolicyRequest + */ +class PatchRuleRegionNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyRule firewall_policy_rule_resource = 250523523 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy_rule_resource = null; + /** + * The priority of the rule to patch. + * + * Generated from protobuf field optional int32 priority = 445151652; + */ + protected $priority = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $firewallPolicy Name of the firewall policy to update. + * @param \Google\Cloud\Compute\V1\FirewallPolicyRule $firewallPolicyRuleResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchRuleRegionNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $firewallPolicy, \Google\Cloud\Compute\V1\FirewallPolicyRule $firewallPolicyRuleResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to update. + * @type \Google\Cloud\Compute\V1\FirewallPolicyRule $firewall_policy_rule_resource + * The body resource for this request + * @type int $priority + * The priority of the rule to patch. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyRule firewall_policy_rule_resource = 250523523 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\FirewallPolicyRule|null + */ + public function getFirewallPolicyRuleResource() + { + return $this->firewall_policy_rule_resource; + } + + public function hasFirewallPolicyRuleResource() + { + return isset($this->firewall_policy_rule_resource); + } + + public function clearFirewallPolicyRuleResource() + { + unset($this->firewall_policy_rule_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.FirewallPolicyRule firewall_policy_rule_resource = 250523523 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\FirewallPolicyRule $var + * @return $this + */ + public function setFirewallPolicyRuleResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\FirewallPolicyRule::class); + $this->firewall_policy_rule_resource = $var; + + return $this; + } + + /** + * The priority of the rule to patch. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @return int + */ + public function getPriority() + { + return isset($this->priority) ? $this->priority : 0; + } + + public function hasPriority() + { + return isset($this->priority); + } + + public function clearPriority() + { + unset($this->priority); + } + + /** + * The priority of the rule to patch. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt32($var); + $this->priority = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRuleRegionSecurityPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRuleRegionSecurityPolicyRequest.php new file mode 100644 index 000000000000..9fc3827e5071 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRuleRegionSecurityPolicyRequest.php @@ -0,0 +1,330 @@ +google.cloud.compute.v1.PatchRuleRegionSecurityPolicyRequest + */ +class PatchRuleRegionSecurityPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The priority of the rule to patch. + * + * Generated from protobuf field optional int32 priority = 445151652; + */ + protected $priority = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyRule security_policy_rule_resource = 402693443 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy_rule_resource = null; + /** + * Indicates fields to be cleared as part of this request. + * + * Generated from protobuf field optional string update_mask = 500079778; + */ + protected $update_mask = null; + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + */ + protected $validate_only = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $securityPolicy Name of the security policy to update. + * @param \Google\Cloud\Compute\V1\SecurityPolicyRule $securityPolicyRuleResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchRuleRegionSecurityPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $securityPolicy, \Google\Cloud\Compute\V1\SecurityPolicyRule $securityPolicyRuleResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyRuleResource($securityPolicyRuleResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $priority + * The priority of the rule to patch. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type string $security_policy + * Name of the security policy to update. + * @type \Google\Cloud\Compute\V1\SecurityPolicyRule $security_policy_rule_resource + * The body resource for this request + * @type string $update_mask + * Indicates fields to be cleared as part of this request. + * @type bool $validate_only + * If true, the request will not be committed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The priority of the rule to patch. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @return int + */ + public function getPriority() + { + return isset($this->priority) ? $this->priority : 0; + } + + public function hasPriority() + { + return isset($this->priority); + } + + public function clearPriority() + { + unset($this->priority); + } + + /** + * The priority of the rule to patch. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt32($var); + $this->priority = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSecurityPolicy() + { + return $this->security_policy; + } + + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->security_policy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyRule security_policy_rule_resource = 402693443 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SecurityPolicyRule|null + */ + public function getSecurityPolicyRuleResource() + { + return $this->security_policy_rule_resource; + } + + public function hasSecurityPolicyRuleResource() + { + return isset($this->security_policy_rule_resource); + } + + public function clearSecurityPolicyRuleResource() + { + unset($this->security_policy_rule_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyRule security_policy_rule_resource = 402693443 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SecurityPolicyRule $var + * @return $this + */ + public function setSecurityPolicyRuleResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyRule::class); + $this->security_policy_rule_resource = $var; + + return $this; + } + + /** + * Indicates fields to be cleared 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); + } + + /** + * Indicates fields to be cleared 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; + } + + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + * @return bool + */ + public function getValidateOnly() + { + return isset($this->validate_only) ? $this->validate_only : false; + } + + public function hasValidateOnly() + { + return isset($this->validate_only); + } + + public function clearValidateOnly() + { + unset($this->validate_only); + } + + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRuleSecurityPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRuleSecurityPolicyRequest.php new file mode 100644 index 000000000000..53780ac4fa43 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchRuleSecurityPolicyRequest.php @@ -0,0 +1,294 @@ +google.cloud.compute.v1.PatchRuleSecurityPolicyRequest + */ +class PatchRuleSecurityPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The priority of the rule to patch. + * + * Generated from protobuf field optional int32 priority = 445151652; + */ + protected $priority = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyRule security_policy_rule_resource = 402693443 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy_rule_resource = null; + /** + * Indicates fields to be cleared as part of this request. + * + * Generated from protobuf field optional string update_mask = 500079778; + */ + protected $update_mask = null; + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + */ + protected $validate_only = null; + + /** + * @param string $project Project ID for this request. + * @param string $securityPolicy Name of the security policy to update. + * @param \Google\Cloud\Compute\V1\SecurityPolicyRule $securityPolicyRuleResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchRuleSecurityPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $securityPolicy, \Google\Cloud\Compute\V1\SecurityPolicyRule $securityPolicyRuleResource): self + { + return (new self()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyRuleResource($securityPolicyRuleResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $priority + * The priority of the rule to patch. + * @type string $project + * Project ID for this request. + * @type string $security_policy + * Name of the security policy to update. + * @type \Google\Cloud\Compute\V1\SecurityPolicyRule $security_policy_rule_resource + * The body resource for this request + * @type string $update_mask + * Indicates fields to be cleared as part of this request. + * @type bool $validate_only + * If true, the request will not be committed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The priority of the rule to patch. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @return int + */ + public function getPriority() + { + return isset($this->priority) ? $this->priority : 0; + } + + public function hasPriority() + { + return isset($this->priority); + } + + public function clearPriority() + { + unset($this->priority); + } + + /** + * The priority of the rule to patch. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt32($var); + $this->priority = $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; + } + + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSecurityPolicy() + { + return $this->security_policy; + } + + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->security_policy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyRule security_policy_rule_resource = 402693443 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SecurityPolicyRule|null + */ + public function getSecurityPolicyRuleResource() + { + return $this->security_policy_rule_resource; + } + + public function hasSecurityPolicyRuleResource() + { + return isset($this->security_policy_rule_resource); + } + + public function clearSecurityPolicyRuleResource() + { + unset($this->security_policy_rule_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyRule security_policy_rule_resource = 402693443 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SecurityPolicyRule $var + * @return $this + */ + public function setSecurityPolicyRuleResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyRule::class); + $this->security_policy_rule_resource = $var; + + return $this; + } + + /** + * Indicates fields to be cleared 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); + } + + /** + * Indicates fields to be cleared 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; + } + + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + * @return bool + */ + public function getValidateOnly() + { + return isset($this->validate_only) ? $this->validate_only : false; + } + + public function hasValidateOnly() + { + return isset($this->validate_only); + } + + public function clearValidateOnly() + { + unset($this->validate_only); + } + + /** + * If true, the request will not be committed. + * + * Generated from protobuf field optional bool validate_only = 242744629; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchSecurityPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchSecurityPolicyRequest.php new file mode 100644 index 000000000000..0bc6b218bc3e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchSecurityPolicyRequest.php @@ -0,0 +1,250 @@ +google.cloud.compute.v1.PatchSecurityPolicyRequest + */ +class PatchSecurityPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicy security_policy_resource = 216159612 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy_resource = null; + /** + * Indicates fields to be cleared as part of this request. + * + * Generated from protobuf field optional string update_mask = 500079778; + */ + protected $update_mask = null; + + /** + * @param string $project Project ID for this request. + * @param string $securityPolicy Name of the security policy to update. + * @param \Google\Cloud\Compute\V1\SecurityPolicy $securityPolicyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchSecurityPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $securityPolicy, \Google\Cloud\Compute\V1\SecurityPolicy $securityPolicyResource): self + { + return (new self()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyResource($securityPolicyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $security_policy + * Name of the security policy to update. + * @type \Google\Cloud\Compute\V1\SecurityPolicy $security_policy_resource + * The body resource for this request + * @type string $update_mask + * Indicates fields to be cleared as part of this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSecurityPolicy() + { + return $this->security_policy; + } + + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->security_policy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicy security_policy_resource = 216159612 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SecurityPolicy|null + */ + public function getSecurityPolicyResource() + { + return $this->security_policy_resource; + } + + public function hasSecurityPolicyResource() + { + return isset($this->security_policy_resource); + } + + public function clearSecurityPolicyResource() + { + unset($this->security_policy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicy security_policy_resource = 216159612 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SecurityPolicy $var + * @return $this + */ + public function setSecurityPolicyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicy::class); + $this->security_policy_resource = $var; + + return $this; + } + + /** + * Indicates fields to be cleared 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); + } + + /** + * Indicates fields to be cleared 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchServiceAttachmentRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchServiceAttachmentRequest.php new file mode 100644 index 000000000000..60edd1a33114 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchServiceAttachmentRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.PatchServiceAttachmentRequest + */ +class PatchServiceAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The region scoping this request and should conform to RFC1035. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The resource id of the ServiceAttachment to patch. It should conform to RFC1035 resource name or be a string form on an unsigned long number. + * + * Generated from protobuf field string service_attachment = 338957549 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service_attachment = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ServiceAttachment service_attachment_resource = 472980256 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service_attachment_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The region scoping this request and should conform to RFC1035. + * @param string $serviceAttachment The resource id of the ServiceAttachment to patch. It should conform to RFC1035 resource name or be a string form on an unsigned long number. + * @param \Google\Cloud\Compute\V1\ServiceAttachment $serviceAttachmentResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchServiceAttachmentRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $serviceAttachment, \Google\Cloud\Compute\V1\ServiceAttachment $serviceAttachmentResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setServiceAttachment($serviceAttachment) + ->setServiceAttachmentResource($serviceAttachmentResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The region scoping this request and should conform to RFC1035. + * @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 $service_attachment + * The resource id of the ServiceAttachment to patch. It should conform to RFC1035 resource name or be a string form on an unsigned long number. + * @type \Google\Cloud\Compute\V1\ServiceAttachment $service_attachment_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 region scoping this request and should conform to RFC1035. + * + * 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 region scoping this request and should conform to RFC1035. + * + * 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; + } + + /** + * The resource id of the ServiceAttachment to patch. It should conform to RFC1035 resource name or be a string form on an unsigned long number. + * + * Generated from protobuf field string service_attachment = 338957549 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getServiceAttachment() + { + return $this->service_attachment; + } + + /** + * The resource id of the ServiceAttachment to patch. It should conform to RFC1035 resource name or be a string form on an unsigned long number. + * + * Generated from protobuf field string service_attachment = 338957549 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setServiceAttachment($var) + { + GPBUtil::checkString($var, True); + $this->service_attachment = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ServiceAttachment service_attachment_resource = 472980256 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ServiceAttachment|null + */ + public function getServiceAttachmentResource() + { + return $this->service_attachment_resource; + } + + public function hasServiceAttachmentResource() + { + return isset($this->service_attachment_resource); + } + + public function clearServiceAttachmentResource() + { + unset($this->service_attachment_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ServiceAttachment service_attachment_resource = 472980256 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ServiceAttachment $var + * @return $this + */ + public function setServiceAttachmentResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ServiceAttachment::class); + $this->service_attachment_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchSnapshotSettingRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchSnapshotSettingRequest.php new file mode 100644 index 000000000000..ed475c73285a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchSnapshotSettingRequest.php @@ -0,0 +1,214 @@ +google.cloud.compute.v1.PatchSnapshotSettingRequest + */ +class PatchSnapshotSettingRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SnapshotSettings snapshot_settings_resource = 357664495 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $snapshot_settings_resource = null; + /** + * update_mask indicates fields to be updated as part of this request. + * + * Generated from protobuf field optional string update_mask = 500079778; + */ + protected $update_mask = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\SnapshotSettings $snapshotSettingsResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchSnapshotSettingRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\SnapshotSettings $snapshotSettingsResource): self + { + return (new self()) + ->setProject($project) + ->setSnapshotSettingsResource($snapshotSettingsResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\SnapshotSettings $snapshot_settings_resource + * The body resource for this request + * @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); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SnapshotSettings snapshot_settings_resource = 357664495 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SnapshotSettings|null + */ + public function getSnapshotSettingsResource() + { + return $this->snapshot_settings_resource; + } + + public function hasSnapshotSettingsResource() + { + return isset($this->snapshot_settings_resource); + } + + public function clearSnapshotSettingsResource() + { + unset($this->snapshot_settings_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SnapshotSettings snapshot_settings_resource = 357664495 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SnapshotSettings $var + * @return $this + */ + public function setSnapshotSettingsResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SnapshotSettings::class); + $this->snapshot_settings_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchSslPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchSslPolicyRequest.php new file mode 100644 index 000000000000..ac80a12205ac --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchSslPolicyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.PatchSslPolicyRequest + */ +class PatchSslPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string ssl_policy = 295190213 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ssl_policy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslPolicy ssl_policy_resource = 274891848 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ssl_policy_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * @param \Google\Cloud\Compute\V1\SslPolicy $sslPolicyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchSslPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $sslPolicy, \Google\Cloud\Compute\V1\SslPolicy $sslPolicyResource): self + { + return (new self()) + ->setProject($project) + ->setSslPolicy($sslPolicy) + ->setSslPolicyResource($sslPolicyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $ssl_policy + * Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * @type \Google\Cloud\Compute\V1\SslPolicy $ssl_policy_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string ssl_policy = 295190213 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSslPolicy() + { + return $this->ssl_policy; + } + + /** + * Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string ssl_policy = 295190213 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSslPolicy($var) + { + GPBUtil::checkString($var, True); + $this->ssl_policy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslPolicy ssl_policy_resource = 274891848 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SslPolicy|null + */ + public function getSslPolicyResource() + { + return $this->ssl_policy_resource; + } + + public function hasSslPolicyResource() + { + return isset($this->ssl_policy_resource); + } + + public function clearSslPolicyResource() + { + unset($this->ssl_policy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslPolicy ssl_policy_resource = 274891848 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SslPolicy $var + * @return $this + */ + public function setSslPolicyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SslPolicy::class); + $this->ssl_policy_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchSubnetworkRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchSubnetworkRequest.php new file mode 100644 index 000000000000..2a1c3e36484d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchSubnetworkRequest.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.PatchSubnetworkRequest + */ +class PatchSubnetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The drain timeout specifies the upper bound in seconds on the amount of time allowed to drain connections from the current ACTIVE subnetwork to the current BACKUP subnetwork. The drain timeout is only applicable when the following conditions are true: - the subnetwork being patched has purpose = INTERNAL_HTTPS_LOAD_BALANCER - the subnetwork being patched has role = BACKUP - the patch request is setting the role to ACTIVE. Note that after this patch operation the roles of the ACTIVE and BACKUP subnetworks will be swapped. + * + * Generated from protobuf field optional int32 drain_timeout_seconds = 357707098; + */ + protected $drain_timeout_seconds = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the Subnetwork resource to patch. + * + * Generated from protobuf field string subnetwork = 307827694 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $subnetwork = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Subnetwork subnetwork_resource = 42233151 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $subnetwork_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $subnetwork Name of the Subnetwork resource to patch. + * @param \Google\Cloud\Compute\V1\Subnetwork $subnetworkResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchSubnetworkRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $subnetwork, \Google\Cloud\Compute\V1\Subnetwork $subnetworkResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork) + ->setSubnetworkResource($subnetworkResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $drain_timeout_seconds + * The drain timeout specifies the upper bound in seconds on the amount of time allowed to drain connections from the current ACTIVE subnetwork to the current BACKUP subnetwork. The drain timeout is only applicable when the following conditions are true: - the subnetwork being patched has purpose = INTERNAL_HTTPS_LOAD_BALANCER - the subnetwork being patched has role = BACKUP - the patch request is setting the role to ACTIVE. Note that after this patch operation the roles of the ACTIVE and BACKUP subnetworks will be swapped. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 $subnetwork + * Name of the Subnetwork resource to patch. + * @type \Google\Cloud\Compute\V1\Subnetwork $subnetwork_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The drain timeout specifies the upper bound in seconds on the amount of time allowed to drain connections from the current ACTIVE subnetwork to the current BACKUP subnetwork. The drain timeout is only applicable when the following conditions are true: - the subnetwork being patched has purpose = INTERNAL_HTTPS_LOAD_BALANCER - the subnetwork being patched has role = BACKUP - the patch request is setting the role to ACTIVE. Note that after this patch operation the roles of the ACTIVE and BACKUP subnetworks will be swapped. + * + * Generated from protobuf field optional int32 drain_timeout_seconds = 357707098; + * @return int + */ + public function getDrainTimeoutSeconds() + { + return isset($this->drain_timeout_seconds) ? $this->drain_timeout_seconds : 0; + } + + public function hasDrainTimeoutSeconds() + { + return isset($this->drain_timeout_seconds); + } + + public function clearDrainTimeoutSeconds() + { + unset($this->drain_timeout_seconds); + } + + /** + * The drain timeout specifies the upper bound in seconds on the amount of time allowed to drain connections from the current ACTIVE subnetwork to the current BACKUP subnetwork. The drain timeout is only applicable when the following conditions are true: - the subnetwork being patched has purpose = INTERNAL_HTTPS_LOAD_BALANCER - the subnetwork being patched has role = BACKUP - the patch request is setting the role to ACTIVE. Note that after this patch operation the roles of the ACTIVE and BACKUP subnetworks will be swapped. + * + * Generated from protobuf field optional int32 drain_timeout_seconds = 357707098; + * @param int $var + * @return $this + */ + public function setDrainTimeoutSeconds($var) + { + GPBUtil::checkInt32($var); + $this->drain_timeout_seconds = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the Subnetwork resource to patch. + * + * Generated from protobuf field string subnetwork = 307827694 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSubnetwork() + { + return $this->subnetwork; + } + + /** + * Name of the Subnetwork resource to patch. + * + * Generated from protobuf field string subnetwork = 307827694 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Subnetwork subnetwork_resource = 42233151 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Subnetwork|null + */ + public function getSubnetworkResource() + { + return $this->subnetwork_resource; + } + + public function hasSubnetworkResource() + { + return isset($this->subnetwork_resource); + } + + public function clearSubnetworkResource() + { + unset($this->subnetwork_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Subnetwork subnetwork_resource = 42233151 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Subnetwork $var + * @return $this + */ + public function setSubnetworkResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Subnetwork::class); + $this->subnetwork_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchTargetGrpcProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchTargetGrpcProxyRequest.php new file mode 100644 index 000000000000..f022fba38f8e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchTargetGrpcProxyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.PatchTargetGrpcProxyRequest + */ +class PatchTargetGrpcProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the TargetGrpcProxy resource to patch. + * + * Generated from protobuf field string target_grpc_proxy = 5020283 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_grpc_proxy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetGrpcProxy target_grpc_proxy_resource = 328922450 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_grpc_proxy_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $targetGrpcProxy Name of the TargetGrpcProxy resource to patch. + * @param \Google\Cloud\Compute\V1\TargetGrpcProxy $targetGrpcProxyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchTargetGrpcProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetGrpcProxy, \Google\Cloud\Compute\V1\TargetGrpcProxy $targetGrpcProxyResource): self + { + return (new self()) + ->setProject($project) + ->setTargetGrpcProxy($targetGrpcProxy) + ->setTargetGrpcProxyResource($targetGrpcProxyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $target_grpc_proxy + * Name of the TargetGrpcProxy resource to patch. + * @type \Google\Cloud\Compute\V1\TargetGrpcProxy $target_grpc_proxy_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the TargetGrpcProxy resource to patch. + * + * Generated from protobuf field string target_grpc_proxy = 5020283 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetGrpcProxy() + { + return $this->target_grpc_proxy; + } + + /** + * Name of the TargetGrpcProxy resource to patch. + * + * Generated from protobuf field string target_grpc_proxy = 5020283 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetGrpcProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_grpc_proxy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetGrpcProxy target_grpc_proxy_resource = 328922450 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetGrpcProxy|null + */ + public function getTargetGrpcProxyResource() + { + return $this->target_grpc_proxy_resource; + } + + public function hasTargetGrpcProxyResource() + { + return isset($this->target_grpc_proxy_resource); + } + + public function clearTargetGrpcProxyResource() + { + unset($this->target_grpc_proxy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetGrpcProxy target_grpc_proxy_resource = 328922450 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetGrpcProxy $var + * @return $this + */ + public function setTargetGrpcProxyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetGrpcProxy::class); + $this->target_grpc_proxy_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchTargetHttpProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchTargetHttpProxyRequest.php new file mode 100644 index 000000000000..23b3b49fa078 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchTargetHttpProxyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.PatchTargetHttpProxyRequest + */ +class PatchTargetHttpProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the TargetHttpProxy resource to patch. + * + * Generated from protobuf field string target_http_proxy = 206872421 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_http_proxy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpProxy target_http_proxy_resource = 24696744 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_http_proxy_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $targetHttpProxy Name of the TargetHttpProxy resource to patch. + * @param \Google\Cloud\Compute\V1\TargetHttpProxy $targetHttpProxyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchTargetHttpProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetHttpProxy, \Google\Cloud\Compute\V1\TargetHttpProxy $targetHttpProxyResource): self + { + return (new self()) + ->setProject($project) + ->setTargetHttpProxy($targetHttpProxy) + ->setTargetHttpProxyResource($targetHttpProxyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $target_http_proxy + * Name of the TargetHttpProxy resource to patch. + * @type \Google\Cloud\Compute\V1\TargetHttpProxy $target_http_proxy_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the TargetHttpProxy resource to patch. + * + * Generated from protobuf field string target_http_proxy = 206872421 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetHttpProxy() + { + return $this->target_http_proxy; + } + + /** + * Name of the TargetHttpProxy resource to patch. + * + * Generated from protobuf field string target_http_proxy = 206872421 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetHttpProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_http_proxy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpProxy target_http_proxy_resource = 24696744 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetHttpProxy|null + */ + public function getTargetHttpProxyResource() + { + return $this->target_http_proxy_resource; + } + + public function hasTargetHttpProxyResource() + { + return isset($this->target_http_proxy_resource); + } + + public function clearTargetHttpProxyResource() + { + unset($this->target_http_proxy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpProxy target_http_proxy_resource = 24696744 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetHttpProxy $var + * @return $this + */ + public function setTargetHttpProxyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetHttpProxy::class); + $this->target_http_proxy_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchTargetHttpsProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchTargetHttpsProxyRequest.php new file mode 100644 index 000000000000..48ffb74e8fad --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchTargetHttpsProxyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.PatchTargetHttpsProxyRequest + */ +class PatchTargetHttpsProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the TargetHttpsProxy resource to patch. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_https_proxy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpsProxy target_https_proxy_resource = 433657473 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_https_proxy_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource to patch. + * @param \Google\Cloud\Compute\V1\TargetHttpsProxy $targetHttpsProxyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchTargetHttpsProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetHttpsProxy, \Google\Cloud\Compute\V1\TargetHttpsProxy $targetHttpsProxyResource): self + { + return (new self()) + ->setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setTargetHttpsProxyResource($targetHttpsProxyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $target_https_proxy + * Name of the TargetHttpsProxy resource to patch. + * @type \Google\Cloud\Compute\V1\TargetHttpsProxy $target_https_proxy_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the TargetHttpsProxy resource to patch. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetHttpsProxy() + { + return $this->target_https_proxy; + } + + /** + * Name of the TargetHttpsProxy resource to patch. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetHttpsProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_https_proxy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpsProxy target_https_proxy_resource = 433657473 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetHttpsProxy|null + */ + public function getTargetHttpsProxyResource() + { + return $this->target_https_proxy_resource; + } + + public function hasTargetHttpsProxyResource() + { + return isset($this->target_https_proxy_resource); + } + + public function clearTargetHttpsProxyResource() + { + unset($this->target_https_proxy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpsProxy target_https_proxy_resource = 433657473 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetHttpsProxy $var + * @return $this + */ + public function setTargetHttpsProxyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetHttpsProxy::class); + $this->target_https_proxy_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchUrlMapRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchUrlMapRequest.php new file mode 100644 index 000000000000..74477f81941c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PatchUrlMapRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.PatchUrlMapRequest + */ +class PatchUrlMapRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the UrlMap resource to patch. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url_map = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMap url_map_resource = 168675425 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url_map_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $urlMap Name of the UrlMap resource to patch. + * @param \Google\Cloud\Compute\V1\UrlMap $urlMapResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PatchUrlMapRequest + * + * @experimental + */ + public static function build(string $project, string $urlMap, \Google\Cloud\Compute\V1\UrlMap $urlMapResource): self + { + return (new self()) + ->setProject($project) + ->setUrlMap($urlMap) + ->setUrlMapResource($urlMapResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $url_map + * Name of the UrlMap resource to patch. + * @type \Google\Cloud\Compute\V1\UrlMap $url_map_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the UrlMap resource to patch. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUrlMap() + { + return $this->url_map; + } + + /** + * Name of the UrlMap resource to patch. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUrlMap($var) + { + GPBUtil::checkString($var, True); + $this->url_map = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMap url_map_resource = 168675425 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\UrlMap|null + */ + public function getUrlMapResource() + { + return $this->url_map_resource; + } + + public function hasUrlMapResource() + { + return isset($this->url_map_resource); + } + + public function clearUrlMapResource() + { + unset($this->url_map_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMap url_map_resource = 168675425 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\UrlMap $var + * @return $this + */ + public function setUrlMapResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\UrlMap::class); + $this->url_map_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PathMatcher.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PathMatcher.php new file mode 100644 index 000000000000..bbbb5b25e82a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PathMatcher.php @@ -0,0 +1,365 @@ +google.cloud.compute.v1.PathMatcher + */ +class PathMatcher extends \Google\Protobuf\Internal\Message +{ + /** + * defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. If defaultRouteAction is specified, don't set defaultUrlRedirect. If defaultRouteAction.weightedBackendServices is specified, don't set defaultService. URL maps for classic Application Load Balancers only support the urlRewrite action within a path matcher's defaultRouteAction. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRouteAction default_route_action = 378919466; + */ + protected $default_route_action = null; + /** + * The full or partial URL to the BackendService resource. This URL is used if none of the pathRules or routeRules defined by this PathMatcher are matched. For example, the following are all valid URLs to a BackendService resource: - https://www.googleapis.com/compute/v1/projects/project /global/backendServices/backendService - compute/v1/projects/project/global/backendServices/backendService - global/backendServices/backendService If defaultRouteAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if defaultRouteAction specifies any weightedBackendServices, defaultService must not be specified. If defaultService is specified, then set either defaultUrlRedirect or defaultRouteAction.weightedBackendService. Don't set both. Authorization requires one or more of the following Google IAM permissions on the specified resource default_service: - compute.backendBuckets.use - compute.backendServices.use + * + * Generated from protobuf field optional string default_service = 370242231; + */ + protected $default_service = null; + /** + * When none of the specified pathRules or routeRules match, the request is redirected to a URL specified by defaultUrlRedirect. If defaultUrlRedirect is specified, then set either defaultService or defaultRouteAction. Don't set both. Not supported when the URL map is bound to a target gRPC proxy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRedirectAction default_url_redirect = 359503338; + */ + protected $default_url_redirect = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Specifies changes to request and response headers that need to take effect for the selected backend service. HeaderAction specified here are applied after the matching HttpRouteRule HeaderAction and before the HeaderAction in the UrlMap HeaderAction is not supported for load balancers that have their loadBalancingScheme set to EXTERNAL. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352; + */ + protected $header_action = null; + /** + * The name to which this PathMatcher is referred by the HostRule. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * The list of path rules. Use this list instead of routeRules when routing based on simple path matching is all that's required. The order by which path rules are specified does not matter. Matches are always done on the longest-path-first basis. For example: a pathRule with a path /a/b/c/* will match before /a/b/* irrespective of the order in which those paths appear in this list. Within a given pathMatcher, only one of pathRules or routeRules must be set. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PathRule path_rules = 104439901; + */ + private $path_rules; + /** + * The list of HTTP route rules. Use this list instead of pathRules when advanced route matching and routing actions are desired. routeRules are evaluated in order of priority, from the lowest to highest number. Within a given pathMatcher, you can set only one of pathRules or routeRules. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HttpRouteRule route_rules = 376292225; + */ + private $route_rules; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\HttpRouteAction $default_route_action + * defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. If defaultRouteAction is specified, don't set defaultUrlRedirect. If defaultRouteAction.weightedBackendServices is specified, don't set defaultService. URL maps for classic Application Load Balancers only support the urlRewrite action within a path matcher's defaultRouteAction. + * @type string $default_service + * The full or partial URL to the BackendService resource. This URL is used if none of the pathRules or routeRules defined by this PathMatcher are matched. For example, the following are all valid URLs to a BackendService resource: - https://www.googleapis.com/compute/v1/projects/project /global/backendServices/backendService - compute/v1/projects/project/global/backendServices/backendService - global/backendServices/backendService If defaultRouteAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if defaultRouteAction specifies any weightedBackendServices, defaultService must not be specified. If defaultService is specified, then set either defaultUrlRedirect or defaultRouteAction.weightedBackendService. Don't set both. Authorization requires one or more of the following Google IAM permissions on the specified resource default_service: - compute.backendBuckets.use - compute.backendServices.use + * @type \Google\Cloud\Compute\V1\HttpRedirectAction $default_url_redirect + * When none of the specified pathRules or routeRules match, the request is redirected to a URL specified by defaultUrlRedirect. If defaultUrlRedirect is specified, then set either defaultService or defaultRouteAction. Don't set both. Not supported when the URL map is bound to a target gRPC proxy. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type \Google\Cloud\Compute\V1\HttpHeaderAction $header_action + * Specifies changes to request and response headers that need to take effect for the selected backend service. HeaderAction specified here are applied after the matching HttpRouteRule HeaderAction and before the HeaderAction in the UrlMap HeaderAction is not supported for load balancers that have their loadBalancingScheme set to EXTERNAL. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * @type string $name + * The name to which this PathMatcher is referred by the HostRule. + * @type array<\Google\Cloud\Compute\V1\PathRule>|\Google\Protobuf\Internal\RepeatedField $path_rules + * The list of path rules. Use this list instead of routeRules when routing based on simple path matching is all that's required. The order by which path rules are specified does not matter. Matches are always done on the longest-path-first basis. For example: a pathRule with a path /a/b/c/* will match before /a/b/* irrespective of the order in which those paths appear in this list. Within a given pathMatcher, only one of pathRules or routeRules must be set. + * @type array<\Google\Cloud\Compute\V1\HttpRouteRule>|\Google\Protobuf\Internal\RepeatedField $route_rules + * The list of HTTP route rules. Use this list instead of pathRules when advanced route matching and routing actions are desired. routeRules are evaluated in order of priority, from the lowest to highest number. Within a given pathMatcher, you can set only one of pathRules or routeRules. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. If defaultRouteAction is specified, don't set defaultUrlRedirect. If defaultRouteAction.weightedBackendServices is specified, don't set defaultService. URL maps for classic Application Load Balancers only support the urlRewrite action within a path matcher's defaultRouteAction. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRouteAction default_route_action = 378919466; + * @return \Google\Cloud\Compute\V1\HttpRouteAction|null + */ + public function getDefaultRouteAction() + { + return $this->default_route_action; + } + + public function hasDefaultRouteAction() + { + return isset($this->default_route_action); + } + + public function clearDefaultRouteAction() + { + unset($this->default_route_action); + } + + /** + * defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. If defaultRouteAction is specified, don't set defaultUrlRedirect. If defaultRouteAction.weightedBackendServices is specified, don't set defaultService. URL maps for classic Application Load Balancers only support the urlRewrite action within a path matcher's defaultRouteAction. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRouteAction default_route_action = 378919466; + * @param \Google\Cloud\Compute\V1\HttpRouteAction $var + * @return $this + */ + public function setDefaultRouteAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HttpRouteAction::class); + $this->default_route_action = $var; + + return $this; + } + + /** + * The full or partial URL to the BackendService resource. This URL is used if none of the pathRules or routeRules defined by this PathMatcher are matched. For example, the following are all valid URLs to a BackendService resource: - https://www.googleapis.com/compute/v1/projects/project /global/backendServices/backendService - compute/v1/projects/project/global/backendServices/backendService - global/backendServices/backendService If defaultRouteAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if defaultRouteAction specifies any weightedBackendServices, defaultService must not be specified. If defaultService is specified, then set either defaultUrlRedirect or defaultRouteAction.weightedBackendService. Don't set both. Authorization requires one or more of the following Google IAM permissions on the specified resource default_service: - compute.backendBuckets.use - compute.backendServices.use + * + * Generated from protobuf field optional string default_service = 370242231; + * @return string + */ + public function getDefaultService() + { + return isset($this->default_service) ? $this->default_service : ''; + } + + public function hasDefaultService() + { + return isset($this->default_service); + } + + public function clearDefaultService() + { + unset($this->default_service); + } + + /** + * The full or partial URL to the BackendService resource. This URL is used if none of the pathRules or routeRules defined by this PathMatcher are matched. For example, the following are all valid URLs to a BackendService resource: - https://www.googleapis.com/compute/v1/projects/project /global/backendServices/backendService - compute/v1/projects/project/global/backendServices/backendService - global/backendServices/backendService If defaultRouteAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if defaultRouteAction specifies any weightedBackendServices, defaultService must not be specified. If defaultService is specified, then set either defaultUrlRedirect or defaultRouteAction.weightedBackendService. Don't set both. Authorization requires one or more of the following Google IAM permissions on the specified resource default_service: - compute.backendBuckets.use - compute.backendServices.use + * + * Generated from protobuf field optional string default_service = 370242231; + * @param string $var + * @return $this + */ + public function setDefaultService($var) + { + GPBUtil::checkString($var, True); + $this->default_service = $var; + + return $this; + } + + /** + * When none of the specified pathRules or routeRules match, the request is redirected to a URL specified by defaultUrlRedirect. If defaultUrlRedirect is specified, then set either defaultService or defaultRouteAction. Don't set both. Not supported when the URL map is bound to a target gRPC proxy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRedirectAction default_url_redirect = 359503338; + * @return \Google\Cloud\Compute\V1\HttpRedirectAction|null + */ + public function getDefaultUrlRedirect() + { + return $this->default_url_redirect; + } + + public function hasDefaultUrlRedirect() + { + return isset($this->default_url_redirect); + } + + public function clearDefaultUrlRedirect() + { + unset($this->default_url_redirect); + } + + /** + * When none of the specified pathRules or routeRules match, the request is redirected to a URL specified by defaultUrlRedirect. If defaultUrlRedirect is specified, then set either defaultService or defaultRouteAction. Don't set both. Not supported when the URL map is bound to a target gRPC proxy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRedirectAction default_url_redirect = 359503338; + * @param \Google\Cloud\Compute\V1\HttpRedirectAction $var + * @return $this + */ + public function setDefaultUrlRedirect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HttpRedirectAction::class); + $this->default_url_redirect = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Specifies changes to request and response headers that need to take effect for the selected backend service. HeaderAction specified here are applied after the matching HttpRouteRule HeaderAction and before the HeaderAction in the UrlMap HeaderAction is not supported for load balancers that have their loadBalancingScheme set to EXTERNAL. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352; + * @return \Google\Cloud\Compute\V1\HttpHeaderAction|null + */ + public function getHeaderAction() + { + return $this->header_action; + } + + public function hasHeaderAction() + { + return isset($this->header_action); + } + + public function clearHeaderAction() + { + unset($this->header_action); + } + + /** + * Specifies changes to request and response headers that need to take effect for the selected backend service. HeaderAction specified here are applied after the matching HttpRouteRule HeaderAction and before the HeaderAction in the UrlMap HeaderAction is not supported for load balancers that have their loadBalancingScheme set to EXTERNAL. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352; + * @param \Google\Cloud\Compute\V1\HttpHeaderAction $var + * @return $this + */ + public function setHeaderAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HttpHeaderAction::class); + $this->header_action = $var; + + return $this; + } + + /** + * The name to which this PathMatcher is referred by the HostRule. + * + * 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 which this PathMatcher is referred by the HostRule. + * + * 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; + } + + /** + * The list of path rules. Use this list instead of routeRules when routing based on simple path matching is all that's required. The order by which path rules are specified does not matter. Matches are always done on the longest-path-first basis. For example: a pathRule with a path /a/b/c/* will match before /a/b/* irrespective of the order in which those paths appear in this list. Within a given pathMatcher, only one of pathRules or routeRules must be set. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PathRule path_rules = 104439901; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPathRules() + { + return $this->path_rules; + } + + /** + * The list of path rules. Use this list instead of routeRules when routing based on simple path matching is all that's required. The order by which path rules are specified does not matter. Matches are always done on the longest-path-first basis. For example: a pathRule with a path /a/b/c/* will match before /a/b/* irrespective of the order in which those paths appear in this list. Within a given pathMatcher, only one of pathRules or routeRules must be set. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PathRule path_rules = 104439901; + * @param array<\Google\Cloud\Compute\V1\PathRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPathRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PathRule::class); + $this->path_rules = $arr; + + return $this; + } + + /** + * The list of HTTP route rules. Use this list instead of pathRules when advanced route matching and routing actions are desired. routeRules are evaluated in order of priority, from the lowest to highest number. Within a given pathMatcher, you can set only one of pathRules or routeRules. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HttpRouteRule route_rules = 376292225; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRouteRules() + { + return $this->route_rules; + } + + /** + * The list of HTTP route rules. Use this list instead of pathRules when advanced route matching and routing actions are desired. routeRules are evaluated in order of priority, from the lowest to highest number. Within a given pathMatcher, you can set only one of pathRules or routeRules. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HttpRouteRule route_rules = 376292225; + * @param array<\Google\Cloud\Compute\V1\HttpRouteRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRouteRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\HttpRouteRule::class); + $this->route_rules = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PathRule.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PathRule.php new file mode 100644 index 000000000000..32ec46bd1c21 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PathRule.php @@ -0,0 +1,199 @@ +google.cloud.compute.v1.PathRule + */ +class PathRule extends \Google\Protobuf\Internal\Message +{ + /** + * The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here. + * + * Generated from protobuf field repeated string paths = 106438894; + */ + private $paths; + /** + * In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within a path rule's routeAction. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948; + */ + protected $route_action = null; + /** + * The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set. + * + * Generated from protobuf field optional string service = 373540533; + */ + protected $service = null; + /** + * When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820; + */ + protected $url_redirect = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $paths + * The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here. + * @type \Google\Cloud\Compute\V1\HttpRouteAction $route_action + * In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within a path rule's routeAction. + * @type string $service + * The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set. + * @type \Google\Cloud\Compute\V1\HttpRedirectAction $url_redirect + * When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here. + * + * Generated from protobuf field repeated string paths = 106438894; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPaths() + { + return $this->paths; + } + + /** + * The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here. + * + * Generated from protobuf field repeated string paths = 106438894; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPaths($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->paths = $arr; + + return $this; + } + + /** + * In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within a path rule's routeAction. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948; + * @return \Google\Cloud\Compute\V1\HttpRouteAction|null + */ + public function getRouteAction() + { + return $this->route_action; + } + + public function hasRouteAction() + { + return isset($this->route_action); + } + + public function clearRouteAction() + { + unset($this->route_action); + } + + /** + * In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within a path rule's routeAction. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRouteAction route_action = 424563948; + * @param \Google\Cloud\Compute\V1\HttpRouteAction $var + * @return $this + */ + public function setRouteAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HttpRouteAction::class); + $this->route_action = $var; + + return $this; + } + + /** + * The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set. + * + * Generated from protobuf field optional string service = 373540533; + * @return string + */ + public function getService() + { + return isset($this->service) ? $this->service : ''; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set. + * + * Generated from protobuf field optional string service = 373540533; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820; + * @return \Google\Cloud\Compute\V1\HttpRedirectAction|null + */ + public function getUrlRedirect() + { + return $this->url_redirect; + } + + public function hasUrlRedirect() + { + return isset($this->url_redirect); + } + + public function clearUrlRedirect() + { + unset($this->url_redirect); + } + + /** + * When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRedirectAction url_redirect = 405147820; + * @param \Google\Cloud\Compute\V1\HttpRedirectAction $var + * @return $this + */ + public function setUrlRedirect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HttpRedirectAction::class); + $this->url_redirect = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PerInstanceConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PerInstanceConfig.php new file mode 100644 index 000000000000..81f19d57c10d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PerInstanceConfig.php @@ -0,0 +1,212 @@ +google.cloud.compute.v1.PerInstanceConfig + */ +class PerInstanceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Fingerprint of this per-instance config. This field can be used in optimistic locking. It is ignored when inserting a per-instance config. An up-to-date fingerprint must be provided in order to update an existing per-instance configuration or the field needs to be unset. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * The name of a per-instance configuration and its corresponding instance. Serves as a merge key during UpdatePerInstanceConfigs operations, that is, if a per-instance configuration with the same name exists then it will be updated, otherwise a new one will be created for the VM instance with the same name. An attempt to create a per-instance configconfiguration for a VM instance that either doesn't exist or is not part of the group will result in an error. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * The intended preserved state for the given instance. Does not contain preserved state generated from a stateful policy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.PreservedState preserved_state = 2634026; + */ + protected $preserved_state = null; + /** + * The status of applying this per-instance configuration on the corresponding managed instance. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $fingerprint + * Fingerprint of this per-instance config. This field can be used in optimistic locking. It is ignored when inserting a per-instance config. An up-to-date fingerprint must be provided in order to update an existing per-instance configuration or the field needs to be unset. + * @type string $name + * The name of a per-instance configuration and its corresponding instance. Serves as a merge key during UpdatePerInstanceConfigs operations, that is, if a per-instance configuration with the same name exists then it will be updated, otherwise a new one will be created for the VM instance with the same name. An attempt to create a per-instance configconfiguration for a VM instance that either doesn't exist or is not part of the group will result in an error. + * @type \Google\Cloud\Compute\V1\PreservedState $preserved_state + * The intended preserved state for the given instance. Does not contain preserved state generated from a stateful policy. + * @type string $status + * The status of applying this per-instance configuration on the corresponding managed instance. + * Check the Status enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Fingerprint of this per-instance config. This field can be used in optimistic locking. It is ignored when inserting a per-instance config. An up-to-date fingerprint must be provided in order to update an existing per-instance configuration or the field needs to be unset. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Fingerprint of this per-instance config. This field can be used in optimistic locking. It is ignored when inserting a per-instance config. An up-to-date fingerprint must be provided in order to update an existing per-instance configuration or the field needs to be unset. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * The name of a per-instance configuration and its corresponding instance. Serves as a merge key during UpdatePerInstanceConfigs operations, that is, if a per-instance configuration with the same name exists then it will be updated, otherwise a new one will be created for the VM instance with the same name. An attempt to create a per-instance configconfiguration for a VM instance that either doesn't exist or is not part of the group will result in an error. + * + * 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 of a per-instance configuration and its corresponding instance. Serves as a merge key during UpdatePerInstanceConfigs operations, that is, if a per-instance configuration with the same name exists then it will be updated, otherwise a new one will be created for the VM instance with the same name. An attempt to create a per-instance configconfiguration for a VM instance that either doesn't exist or is not part of the group will result in an error. + * + * 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; + } + + /** + * The intended preserved state for the given instance. Does not contain preserved state generated from a stateful policy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.PreservedState preserved_state = 2634026; + * @return \Google\Cloud\Compute\V1\PreservedState|null + */ + public function getPreservedState() + { + return $this->preserved_state; + } + + public function hasPreservedState() + { + return isset($this->preserved_state); + } + + public function clearPreservedState() + { + unset($this->preserved_state); + } + + /** + * The intended preserved state for the given instance. Does not contain preserved state generated from a stateful policy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.PreservedState preserved_state = 2634026; + * @param \Google\Cloud\Compute\V1\PreservedState $var + * @return $this + */ + public function setPreservedState($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\PreservedState::class); + $this->preserved_state = $var; + + return $this; + } + + /** + * The status of applying this per-instance configuration on the corresponding managed instance. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * The status of applying this per-instance configuration on the corresponding managed instance. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PerInstanceConfig/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PerInstanceConfig/Status.php new file mode 100644 index 000000000000..199f37464aeb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PerInstanceConfig/Status.php @@ -0,0 +1,92 @@ +google.cloud.compute.v1.PerInstanceConfig.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * The per-instance configuration is being applied to the instance, but is not yet effective, possibly waiting for the instance to, for example, REFRESH. + * + * Generated from protobuf enum APPLYING = 352003508; + */ + const APPLYING = 352003508; + /** + * The per-instance configuration deletion is being applied on the instance, possibly waiting for the instance to, for example, REFRESH. + * + * Generated from protobuf enum DELETING = 528602024; + */ + const DELETING = 528602024; + /** + * The per-instance configuration is effective on the instance, meaning that all disks, ips and metadata specified in this configuration are attached or set on the instance. + * + * Generated from protobuf enum EFFECTIVE = 244201863; + */ + const EFFECTIVE = 244201863; + /** + * *[Default]* The default status, when no per-instance configuration exists. + * + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + /** + * The per-instance configuration is set on an instance but not been applied yet. + * + * Generated from protobuf enum UNAPPLIED = 483935140; + */ + const UNAPPLIED = 483935140; + /** + * The per-instance configuration has been deleted, but the deletion is not yet applied. + * + * Generated from protobuf enum UNAPPLIED_DELETION = 313956873; + */ + const UNAPPLIED_DELETION = 313956873; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::APPLYING => 'APPLYING', + self::DELETING => 'DELETING', + self::EFFECTIVE => 'EFFECTIVE', + self::NONE => 'NONE', + self::UNAPPLIED => 'UNAPPLIED', + self::UNAPPLIED_DELETION => 'UNAPPLIED_DELETION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\PerInstanceConfig_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PerformMaintenanceInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PerformMaintenanceInstanceRequest.php new file mode 100644 index 000000000000..5da61208f55c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PerformMaintenanceInstanceRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.PerformMaintenanceInstanceRequest + */ +class PerformMaintenanceInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance scoping this request. + * + * @return \Google\Cloud\Compute\V1\PerformMaintenanceInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name of the instance scoping 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); + } + + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance scoping 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PerformMaintenanceNodeGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PerformMaintenanceNodeGroupRequest.php new file mode 100644 index 000000000000..e19e485989c9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PerformMaintenanceNodeGroupRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.PerformMaintenanceNodeGroupRequest + */ +class PerformMaintenanceNodeGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the node group scoping this request. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $node_group = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeGroupsPerformMaintenanceRequest node_groups_perform_maintenance_request_resource = 185310294 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $node_groups_perform_maintenance_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $nodeGroup Name of the node group scoping this request. + * @param \Google\Cloud\Compute\V1\NodeGroupsPerformMaintenanceRequest $nodeGroupsPerformMaintenanceRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PerformMaintenanceNodeGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $nodeGroup, \Google\Cloud\Compute\V1\NodeGroupsPerformMaintenanceRequest $nodeGroupsPerformMaintenanceRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setNodeGroup($nodeGroup) + ->setNodeGroupsPerformMaintenanceRequestResource($nodeGroupsPerformMaintenanceRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $node_group + * Name of the node group scoping this request. + * @type \Google\Cloud\Compute\V1\NodeGroupsPerformMaintenanceRequest $node_groups_perform_maintenance_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); + } + + /** + * Name of the node group scoping this request. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNodeGroup() + { + return $this->node_group; + } + + /** + * Name of the node group scoping this request. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNodeGroup($var) + { + GPBUtil::checkString($var, True); + $this->node_group = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeGroupsPerformMaintenanceRequest node_groups_perform_maintenance_request_resource = 185310294 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NodeGroupsPerformMaintenanceRequest|null + */ + public function getNodeGroupsPerformMaintenanceRequestResource() + { + return $this->node_groups_perform_maintenance_request_resource; + } + + public function hasNodeGroupsPerformMaintenanceRequestResource() + { + return isset($this->node_groups_perform_maintenance_request_resource); + } + + public function clearNodeGroupsPerformMaintenanceRequestResource() + { + unset($this->node_groups_perform_maintenance_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeGroupsPerformMaintenanceRequest node_groups_perform_maintenance_request_resource = 185310294 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NodeGroupsPerformMaintenanceRequest $var + * @return $this + */ + public function setNodeGroupsPerformMaintenanceRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NodeGroupsPerformMaintenanceRequest::class); + $this->node_groups_perform_maintenance_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Policy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Policy.php new file mode 100644 index 000000000000..22c879af3831 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Policy.php @@ -0,0 +1,260 @@ +google.cloud.compute.v1.Policy + */ +class Policy extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies cloud audit logging configuration for this policy. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653; + */ + private $audit_configs; + /** + * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Binding bindings = 403251854; + */ + private $bindings; + /** + * `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. + * + * Generated from protobuf field optional string etag = 3123477; + */ + protected $etag = null; + /** + * Generated from protobuf field optional bool iam_owned = 450566203; + */ + protected $iam_owned = null; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Rule rules = 108873975; + */ + private $rules; + /** + * Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + * + * Generated from protobuf field optional int32 version = 351608024; + */ + protected $version = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\AuditConfig>|\Google\Protobuf\Internal\RepeatedField $audit_configs + * Specifies cloud audit logging configuration for this policy. + * @type array<\Google\Cloud\Compute\V1\Binding>|\Google\Protobuf\Internal\RepeatedField $bindings + * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. + * @type string $etag + * `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. + * @type bool $iam_owned + * @type array<\Google\Cloud\Compute\V1\Rule>|\Google\Protobuf\Internal\RepeatedField $rules + * This is deprecated and has no effect. Do not use. + * @type int $version + * Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies cloud audit logging configuration for this policy. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAuditConfigs() + { + return $this->audit_configs; + } + + /** + * Specifies cloud audit logging configuration for this policy. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AuditConfig audit_configs = 328080653; + * @param array<\Google\Cloud\Compute\V1\AuditConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAuditConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AuditConfig::class); + $this->audit_configs = $arr; + + return $this; + } + + /** + * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Binding bindings = 403251854; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBindings() + { + return $this->bindings; + } + + /** + * Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Binding bindings = 403251854; + * @param array<\Google\Cloud\Compute\V1\Binding>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBindings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Binding::class); + $this->bindings = $arr; + + return $this; + } + + /** + * `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. + * + * Generated from protobuf field optional string etag = 3123477; + * @return string + */ + public function getEtag() + { + return isset($this->etag) ? $this->etag : ''; + } + + public function hasEtag() + { + return isset($this->etag); + } + + public function clearEtag() + { + unset($this->etag); + } + + /** + * `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. + * + * Generated from protobuf field optional string etag = 3123477; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Generated from protobuf field optional bool iam_owned = 450566203; + * @return bool + */ + public function getIamOwned() + { + return isset($this->iam_owned) ? $this->iam_owned : false; + } + + public function hasIamOwned() + { + return isset($this->iam_owned); + } + + public function clearIamOwned() + { + unset($this->iam_owned); + } + + /** + * Generated from protobuf field optional bool iam_owned = 450566203; + * @param bool $var + * @return $this + */ + public function setIamOwned($var) + { + GPBUtil::checkBool($var); + $this->iam_owned = $var; + + return $this; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Rule rules = 108873975; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Rule rules = 108873975; + * @param array<\Google\Cloud\Compute\V1\Rule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Rule::class); + $this->rules = $arr; + + return $this; + } + + /** + * Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + * + * Generated from protobuf field optional int32 version = 351608024; + * @return int + */ + public function getVersion() + { + return isset($this->version) ? $this->version : 0; + } + + public function hasVersion() + { + return isset($this->version); + } + + public function clearVersion() + { + unset($this->version); + } + + /** + * Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + * + * Generated from protobuf field optional int32 version = 351608024; + * @param int $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkInt32($var); + $this->version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreconfiguredWafSet.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreconfiguredWafSet.php new file mode 100644 index 000000000000..e486d783a340 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreconfiguredWafSet.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.PreconfiguredWafSet + */ +class PreconfiguredWafSet extends \Google\Protobuf\Internal\Message +{ + /** + * List of entities that are currently supported for WAF rules. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.WafExpressionSet expression_sets = 474011032; + */ + private $expression_sets; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\WafExpressionSet>|\Google\Protobuf\Internal\RepeatedField $expression_sets + * List of entities that are currently supported for WAF rules. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * List of entities that are currently supported for WAF rules. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.WafExpressionSet expression_sets = 474011032; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExpressionSets() + { + return $this->expression_sets; + } + + /** + * List of entities that are currently supported for WAF rules. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.WafExpressionSet expression_sets = 474011032; + * @param array<\Google\Cloud\Compute\V1\WafExpressionSet>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExpressionSets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\WafExpressionSet::class); + $this->expression_sets = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedState.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedState.php new file mode 100644 index 000000000000..9257496ab89a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedState.php @@ -0,0 +1,169 @@ +google.cloud.compute.v1.PreservedState + */ +class PreservedState extends \Google\Protobuf\Internal\Message +{ + /** + * Preserved disks defined for this instance. This map is keyed with the device names of the disks. + * + * Generated from protobuf field map disks = 95594102; + */ + private $disks; + /** + * Preserved external IPs defined for this instance. This map is keyed with the name of the network interface. + * + * Generated from protobuf field map external_i_ps = 532687245; + */ + private $external_i_ps; + /** + * Preserved internal IPs defined for this instance. This map is keyed with the name of the network interface. + * + * Generated from protobuf field map internal_i_ps = 215731675; + */ + private $internal_i_ps; + /** + * Preserved metadata defined for this instance. + * + * Generated from protobuf field map metadata = 86866735; + */ + private $metadata; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $disks + * Preserved disks defined for this instance. This map is keyed with the device names of the disks. + * @type array|\Google\Protobuf\Internal\MapField $external_i_ps + * Preserved external IPs defined for this instance. This map is keyed with the name of the network interface. + * @type array|\Google\Protobuf\Internal\MapField $internal_i_ps + * Preserved internal IPs defined for this instance. This map is keyed with the name of the network interface. + * @type array|\Google\Protobuf\Internal\MapField $metadata + * Preserved metadata defined for this instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Preserved disks defined for this instance. This map is keyed with the device names of the disks. + * + * Generated from protobuf field map disks = 95594102; + * @return \Google\Protobuf\Internal\MapField + */ + public function getDisks() + { + return $this->disks; + } + + /** + * Preserved disks defined for this instance. This map is keyed with the device names of the disks. + * + * Generated from protobuf field map disks = 95594102; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setDisks($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PreservedStatePreservedDisk::class); + $this->disks = $arr; + + return $this; + } + + /** + * Preserved external IPs defined for this instance. This map is keyed with the name of the network interface. + * + * Generated from protobuf field map external_i_ps = 532687245; + * @return \Google\Protobuf\Internal\MapField + */ + public function getExternalIPs() + { + return $this->external_i_ps; + } + + /** + * Preserved external IPs defined for this instance. This map is keyed with the name of the network interface. + * + * Generated from protobuf field map external_i_ps = 532687245; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setExternalIPs($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PreservedStatePreservedNetworkIp::class); + $this->external_i_ps = $arr; + + return $this; + } + + /** + * Preserved internal IPs defined for this instance. This map is keyed with the name of the network interface. + * + * Generated from protobuf field map internal_i_ps = 215731675; + * @return \Google\Protobuf\Internal\MapField + */ + public function getInternalIPs() + { + return $this->internal_i_ps; + } + + /** + * Preserved internal IPs defined for this instance. This map is keyed with the name of the network interface. + * + * Generated from protobuf field map internal_i_ps = 215731675; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setInternalIPs($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PreservedStatePreservedNetworkIp::class); + $this->internal_i_ps = $arr; + + return $this; + } + + /** + * Preserved metadata defined for this instance. + * + * Generated from protobuf field map metadata = 86866735; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * Preserved metadata defined for this instance. + * + * Generated from protobuf field map metadata = 86866735; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadata = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedDisk.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedDisk.php new file mode 100644 index 000000000000..e3fede3c005b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedDisk.php @@ -0,0 +1,172 @@ +google.cloud.compute.v1.PreservedStatePreservedDisk + */ +class PreservedStatePreservedDisk extends \Google\Protobuf\Internal\Message +{ + /** + * These stateful disks will never be deleted during autohealing, update, instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole MIG is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted. + * Check the AutoDelete enum for the list of possible values. + * + * Generated from protobuf field optional string auto_delete = 464761403; + */ + protected $auto_delete = null; + /** + * The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + */ + protected $mode = null; + /** + * The URL of the disk resource that is stateful and should be attached to the VM instance. + * + * Generated from protobuf field optional string source = 177235995; + */ + protected $source = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $auto_delete + * These stateful disks will never be deleted during autohealing, update, instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole MIG is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted. + * Check the AutoDelete enum for the list of possible values. + * @type string $mode + * The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. + * Check the Mode enum for the list of possible values. + * @type string $source + * The URL of the disk resource that is stateful and should be attached to the VM instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * These stateful disks will never be deleted during autohealing, update, instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole MIG is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted. + * Check the AutoDelete enum for the list of possible values. + * + * Generated from protobuf field optional string auto_delete = 464761403; + * @return string + */ + public function getAutoDelete() + { + return isset($this->auto_delete) ? $this->auto_delete : ''; + } + + public function hasAutoDelete() + { + return isset($this->auto_delete); + } + + public function clearAutoDelete() + { + unset($this->auto_delete); + } + + /** + * These stateful disks will never be deleted during autohealing, update, instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole MIG is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted. + * Check the AutoDelete enum for the list of possible values. + * + * Generated from protobuf field optional string auto_delete = 464761403; + * @param string $var + * @return $this + */ + public function setAutoDelete($var) + { + GPBUtil::checkString($var, True); + $this->auto_delete = $var; + + return $this; + } + + /** + * The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + * @return string + */ + public function getMode() + { + return isset($this->mode) ? $this->mode : ''; + } + + public function hasMode() + { + return isset($this->mode); + } + + public function clearMode() + { + unset($this->mode); + } + + /** + * The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + * @param string $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkString($var, True); + $this->mode = $var; + + return $this; + } + + /** + * The URL of the disk resource that is stateful and should be attached to the VM instance. + * + * Generated from protobuf field optional string source = 177235995; + * @return string + */ + public function getSource() + { + return isset($this->source) ? $this->source : ''; + } + + public function hasSource() + { + return isset($this->source); + } + + public function clearSource() + { + unset($this->source); + } + + /** + * The URL of the disk resource that is stateful and should be attached to the VM instance. + * + * Generated from protobuf field optional string source = 177235995; + * @param string $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkString($var, True); + $this->source = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedDisk/AutoDelete.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedDisk/AutoDelete.php new file mode 100644 index 000000000000..39f3b9f0d658 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedDisk/AutoDelete.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.PreservedStatePreservedDisk.AutoDelete + */ +class AutoDelete +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_AUTO_DELETE = 0; + */ + const UNDEFINED_AUTO_DELETE = 0; + /** + * Generated from protobuf enum NEVER = 74175084; + */ + const NEVER = 74175084; + /** + * Generated from protobuf enum ON_PERMANENT_INSTANCE_DELETION = 95727719; + */ + const ON_PERMANENT_INSTANCE_DELETION = 95727719; + + private static $valueToName = [ + self::UNDEFINED_AUTO_DELETE => 'UNDEFINED_AUTO_DELETE', + self::NEVER => 'NEVER', + self::ON_PERMANENT_INSTANCE_DELETION => 'ON_PERMANENT_INSTANCE_DELETION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AutoDelete::class, \Google\Cloud\Compute\V1\PreservedStatePreservedDisk_AutoDelete::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedDisk/Mode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedDisk/Mode.php new file mode 100644 index 000000000000..15f8d0aa7417 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedDisk/Mode.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.PreservedStatePreservedDisk.Mode + */ +class Mode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MODE = 0; + */ + const UNDEFINED_MODE = 0; + /** + * Attaches this disk in read-only mode. Multiple VM instances can use a disk in READ_ONLY mode at a time. + * + * Generated from protobuf enum READ_ONLY = 91950261; + */ + const READ_ONLY = 91950261; + /** + * *[Default]* Attaches this disk in READ_WRITE mode. Only one VM instance at a time can be attached to a disk in READ_WRITE mode. + * + * Generated from protobuf enum READ_WRITE = 173607894; + */ + const READ_WRITE = 173607894; + + private static $valueToName = [ + self::UNDEFINED_MODE => 'UNDEFINED_MODE', + self::READ_ONLY => 'READ_ONLY', + self::READ_WRITE => 'READ_WRITE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Mode::class, \Google\Cloud\Compute\V1\PreservedStatePreservedDisk_Mode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedNetworkIp.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedNetworkIp.php new file mode 100644 index 000000000000..935223c0f9a7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedNetworkIp.php @@ -0,0 +1,124 @@ +google.cloud.compute.v1.PreservedStatePreservedNetworkIp + */ +class PreservedStatePreservedNetworkIp extends \Google\Protobuf\Internal\Message +{ + /** + * These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. + * Check the AutoDelete enum for the list of possible values. + * + * Generated from protobuf field optional string auto_delete = 464761403; + */ + protected $auto_delete = null; + /** + * Ip address representation + * + * Generated from protobuf field optional .google.cloud.compute.v1.PreservedStatePreservedNetworkIpIpAddress ip_address = 406272220; + */ + protected $ip_address = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $auto_delete + * These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. + * Check the AutoDelete enum for the list of possible values. + * @type \Google\Cloud\Compute\V1\PreservedStatePreservedNetworkIpIpAddress $ip_address + * Ip address representation + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. + * Check the AutoDelete enum for the list of possible values. + * + * Generated from protobuf field optional string auto_delete = 464761403; + * @return string + */ + public function getAutoDelete() + { + return isset($this->auto_delete) ? $this->auto_delete : ''; + } + + public function hasAutoDelete() + { + return isset($this->auto_delete); + } + + public function clearAutoDelete() + { + unset($this->auto_delete); + } + + /** + * These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. + * Check the AutoDelete enum for the list of possible values. + * + * Generated from protobuf field optional string auto_delete = 464761403; + * @param string $var + * @return $this + */ + public function setAutoDelete($var) + { + GPBUtil::checkString($var, True); + $this->auto_delete = $var; + + return $this; + } + + /** + * Ip address representation + * + * Generated from protobuf field optional .google.cloud.compute.v1.PreservedStatePreservedNetworkIpIpAddress ip_address = 406272220; + * @return \Google\Cloud\Compute\V1\PreservedStatePreservedNetworkIpIpAddress|null + */ + public function getIpAddress() + { + return $this->ip_address; + } + + public function hasIpAddress() + { + return isset($this->ip_address); + } + + public function clearIpAddress() + { + unset($this->ip_address); + } + + /** + * Ip address representation + * + * Generated from protobuf field optional .google.cloud.compute.v1.PreservedStatePreservedNetworkIpIpAddress ip_address = 406272220; + * @param \Google\Cloud\Compute\V1\PreservedStatePreservedNetworkIpIpAddress $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\PreservedStatePreservedNetworkIpIpAddress::class); + $this->ip_address = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedNetworkIp/AutoDelete.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedNetworkIp/AutoDelete.php new file mode 100644 index 000000000000..36171ddee9cc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedNetworkIp/AutoDelete.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.PreservedStatePreservedNetworkIp.AutoDelete + */ +class AutoDelete +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_AUTO_DELETE = 0; + */ + const UNDEFINED_AUTO_DELETE = 0; + /** + * Generated from protobuf enum NEVER = 74175084; + */ + const NEVER = 74175084; + /** + * Generated from protobuf enum ON_PERMANENT_INSTANCE_DELETION = 95727719; + */ + const ON_PERMANENT_INSTANCE_DELETION = 95727719; + + private static $valueToName = [ + self::UNDEFINED_AUTO_DELETE => 'UNDEFINED_AUTO_DELETE', + self::NEVER => 'NEVER', + self::ON_PERMANENT_INSTANCE_DELETION => 'ON_PERMANENT_INSTANCE_DELETION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AutoDelete::class, \Google\Cloud\Compute\V1\PreservedStatePreservedNetworkIp_AutoDelete::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedNetworkIpIpAddress.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedNetworkIpIpAddress.php new file mode 100644 index 000000000000..68afad8b1709 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreservedStatePreservedNetworkIpIpAddress.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.PreservedStatePreservedNetworkIpIpAddress + */ +class PreservedStatePreservedNetworkIpIpAddress extends \Google\Protobuf\Internal\Message +{ + /** + * The URL of the reservation for this IP address. + * + * Generated from protobuf field optional string address = 462920692; + */ + protected $address = null; + /** + * An IPv4 internal network address to assign to the instance for this network interface. + * + * Generated from protobuf field optional string literal = 182460591; + */ + protected $literal = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $address + * The URL of the reservation for this IP address. + * @type string $literal + * An IPv4 internal network address to assign to the instance for this network interface. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The URL of the reservation for this IP address. + * + * Generated from protobuf field optional string address = 462920692; + * @return string + */ + public function getAddress() + { + return isset($this->address) ? $this->address : ''; + } + + public function hasAddress() + { + return isset($this->address); + } + + public function clearAddress() + { + unset($this->address); + } + + /** + * The URL of the reservation for this IP address. + * + * Generated from protobuf field optional string address = 462920692; + * @param string $var + * @return $this + */ + public function setAddress($var) + { + GPBUtil::checkString($var, True); + $this->address = $var; + + return $this; + } + + /** + * An IPv4 internal network address to assign to the instance for this network interface. + * + * Generated from protobuf field optional string literal = 182460591; + * @return string + */ + public function getLiteral() + { + return isset($this->literal) ? $this->literal : ''; + } + + public function hasLiteral() + { + return isset($this->literal); + } + + public function clearLiteral() + { + unset($this->literal); + } + + /** + * An IPv4 internal network address to assign to the instance for this network interface. + * + * Generated from protobuf field optional string literal = 182460591; + * @param string $var + * @return $this + */ + public function setLiteral($var) + { + GPBUtil::checkString($var, True); + $this->literal = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreviewRouterRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreviewRouterRequest.php new file mode 100644 index 000000000000..abfbbb0df249 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PreviewRouterRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.PreviewRouterRequest + */ +class PreviewRouterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name of the Router resource to query. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $router = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Router router_resource = 155222084 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $router_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $router Name of the Router resource to query. + * @param \Google\Cloud\Compute\V1\Router $routerResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\PreviewRouterRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $router, \Google\Cloud\Compute\V1\Router $routerResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router) + ->setRouterResource($routerResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region for this request. + * @type string $router + * Name of the Router resource to query. + * @type \Google\Cloud\Compute\V1\Router $router_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Name of the Router resource to query. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRouter() + { + return $this->router; + } + + /** + * Name of the Router resource to query. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRouter($var) + { + GPBUtil::checkString($var, True); + $this->router = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Router router_resource = 155222084 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Router|null + */ + public function getRouterResource() + { + return $this->router_resource; + } + + public function hasRouterResource() + { + return isset($this->router_resource); + } + + public function clearRouterResource() + { + unset($this->router_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Router router_resource = 155222084 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Router $var + * @return $this + */ + public function setRouterResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Router::class); + $this->router_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Project.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Project.php new file mode 100644 index 000000000000..a98de4ef6667 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Project.php @@ -0,0 +1,689 @@ +google.cloud.compute.v1.Project + */ +class Project extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The Cloud Armor tier for this project. It can be one of the following values: CA_STANDARD, CA_ENTERPRISE_PAYGO. If this field is not specified, it is assumed to be CA_STANDARD. + * Check the CloudArmorTier enum for the list of possible values. + * + * Generated from protobuf field optional string cloud_armor_tier = 4427052; + */ + protected $cloud_armor_tier = null; + /** + * Metadata key/value pairs available to all instances contained in this project. See Custom metadata for more information. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Metadata common_instance_metadata = 185794117; + */ + protected $common_instance_metadata = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * This signifies the default network tier used for configuring resources of the project and can only take the following values: PREMIUM, STANDARD. Initially the default network tier is PREMIUM. + * Check the DefaultNetworkTier enum for the list of possible values. + * + * Generated from protobuf field optional string default_network_tier = 471753361; + */ + protected $default_network_tier = null; + /** + * [Output Only] Default service account used by VMs running in this project. + * + * Generated from protobuf field optional string default_service_account = 298712229; + */ + protected $default_service_account = null; + /** + * An optional textual description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Restricted features enabled for use on this project. + * + * Generated from protobuf field repeated string enabled_features = 469017467; + */ + private $enabled_features; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. This is *not* the project ID, and is just a unique ID used by Compute Engine to identify resources. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#project for projects. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * The project ID. For example: my-example-project. Use the project ID to make requests to Compute Engine. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] Quotas assigned to this project. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Quota quotas = 125341947; + */ + private $quotas; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * The naming prefix for daily usage reports and the Google Cloud Storage bucket where they are stored. + * + * Generated from protobuf field optional .google.cloud.compute.v1.UsageExportLocation usage_export_location = 347543874; + */ + protected $usage_export_location = null; + /** + * [Output Only] Default internal DNS setting used by VMs running in this project. + * Check the VmDnsSetting enum for the list of possible values. + * + * Generated from protobuf field optional string vm_dns_setting = 58856370; + */ + protected $vm_dns_setting = null; + /** + * [Output Only] The role this project has in a shared VPC configuration. Currently, only projects with the host role, which is specified by the value HOST, are differentiated. + * Check the XpnProjectStatus enum for the list of possible values. + * + * Generated from protobuf field optional string xpn_project_status = 228419265; + */ + protected $xpn_project_status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $cloud_armor_tier + * [Output Only] The Cloud Armor tier for this project. It can be one of the following values: CA_STANDARD, CA_ENTERPRISE_PAYGO. If this field is not specified, it is assumed to be CA_STANDARD. + * Check the CloudArmorTier enum for the list of possible values. + * @type \Google\Cloud\Compute\V1\Metadata $common_instance_metadata + * Metadata key/value pairs available to all instances contained in this project. See Custom metadata for more information. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $default_network_tier + * This signifies the default network tier used for configuring resources of the project and can only take the following values: PREMIUM, STANDARD. Initially the default network tier is PREMIUM. + * Check the DefaultNetworkTier enum for the list of possible values. + * @type string $default_service_account + * [Output Only] Default service account used by VMs running in this project. + * @type string $description + * An optional textual description of the resource. + * @type array|\Google\Protobuf\Internal\RepeatedField $enabled_features + * Restricted features enabled for use on this project. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. This is *not* the project ID, and is just a unique ID used by Compute Engine to identify resources. + * @type string $kind + * [Output Only] Type of the resource. Always compute#project for projects. + * @type string $name + * The project ID. For example: my-example-project. Use the project ID to make requests to Compute Engine. + * @type array<\Google\Cloud\Compute\V1\Quota>|\Google\Protobuf\Internal\RepeatedField $quotas + * [Output Only] Quotas assigned to this project. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type \Google\Cloud\Compute\V1\UsageExportLocation $usage_export_location + * The naming prefix for daily usage reports and the Google Cloud Storage bucket where they are stored. + * @type string $vm_dns_setting + * [Output Only] Default internal DNS setting used by VMs running in this project. + * Check the VmDnsSetting enum for the list of possible values. + * @type string $xpn_project_status + * [Output Only] The role this project has in a shared VPC configuration. Currently, only projects with the host role, which is specified by the value HOST, are differentiated. + * Check the XpnProjectStatus enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The Cloud Armor tier for this project. It can be one of the following values: CA_STANDARD, CA_ENTERPRISE_PAYGO. If this field is not specified, it is assumed to be CA_STANDARD. + * Check the CloudArmorTier enum for the list of possible values. + * + * Generated from protobuf field optional string cloud_armor_tier = 4427052; + * @return string + */ + public function getCloudArmorTier() + { + return isset($this->cloud_armor_tier) ? $this->cloud_armor_tier : ''; + } + + public function hasCloudArmorTier() + { + return isset($this->cloud_armor_tier); + } + + public function clearCloudArmorTier() + { + unset($this->cloud_armor_tier); + } + + /** + * [Output Only] The Cloud Armor tier for this project. It can be one of the following values: CA_STANDARD, CA_ENTERPRISE_PAYGO. If this field is not specified, it is assumed to be CA_STANDARD. + * Check the CloudArmorTier enum for the list of possible values. + * + * Generated from protobuf field optional string cloud_armor_tier = 4427052; + * @param string $var + * @return $this + */ + public function setCloudArmorTier($var) + { + GPBUtil::checkString($var, True); + $this->cloud_armor_tier = $var; + + return $this; + } + + /** + * Metadata key/value pairs available to all instances contained in this project. See Custom metadata for more information. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Metadata common_instance_metadata = 185794117; + * @return \Google\Cloud\Compute\V1\Metadata|null + */ + public function getCommonInstanceMetadata() + { + return $this->common_instance_metadata; + } + + public function hasCommonInstanceMetadata() + { + return isset($this->common_instance_metadata); + } + + public function clearCommonInstanceMetadata() + { + unset($this->common_instance_metadata); + } + + /** + * Metadata key/value pairs available to all instances contained in this project. See Custom metadata for more information. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Metadata common_instance_metadata = 185794117; + * @param \Google\Cloud\Compute\V1\Metadata $var + * @return $this + */ + public function setCommonInstanceMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Metadata::class); + $this->common_instance_metadata = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * This signifies the default network tier used for configuring resources of the project and can only take the following values: PREMIUM, STANDARD. Initially the default network tier is PREMIUM. + * Check the DefaultNetworkTier enum for the list of possible values. + * + * Generated from protobuf field optional string default_network_tier = 471753361; + * @return string + */ + public function getDefaultNetworkTier() + { + return isset($this->default_network_tier) ? $this->default_network_tier : ''; + } + + public function hasDefaultNetworkTier() + { + return isset($this->default_network_tier); + } + + public function clearDefaultNetworkTier() + { + unset($this->default_network_tier); + } + + /** + * This signifies the default network tier used for configuring resources of the project and can only take the following values: PREMIUM, STANDARD. Initially the default network tier is PREMIUM. + * Check the DefaultNetworkTier enum for the list of possible values. + * + * Generated from protobuf field optional string default_network_tier = 471753361; + * @param string $var + * @return $this + */ + public function setDefaultNetworkTier($var) + { + GPBUtil::checkString($var, True); + $this->default_network_tier = $var; + + return $this; + } + + /** + * [Output Only] Default service account used by VMs running in this project. + * + * Generated from protobuf field optional string default_service_account = 298712229; + * @return string + */ + public function getDefaultServiceAccount() + { + return isset($this->default_service_account) ? $this->default_service_account : ''; + } + + public function hasDefaultServiceAccount() + { + return isset($this->default_service_account); + } + + public function clearDefaultServiceAccount() + { + unset($this->default_service_account); + } + + /** + * [Output Only] Default service account used by VMs running in this project. + * + * Generated from protobuf field optional string default_service_account = 298712229; + * @param string $var + * @return $this + */ + public function setDefaultServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->default_service_account = $var; + + return $this; + } + + /** + * An optional textual description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional textual description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Restricted features enabled for use on this project. + * + * Generated from protobuf field repeated string enabled_features = 469017467; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEnabledFeatures() + { + return $this->enabled_features; + } + + /** + * Restricted features enabled for use on this project. + * + * Generated from protobuf field repeated string enabled_features = 469017467; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEnabledFeatures($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->enabled_features = $arr; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. This is *not* the project ID, and is just a unique ID used by Compute Engine to identify resources. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. This is *not* the project ID, and is just a unique ID used by Compute Engine to identify resources. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#project for projects. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#project for projects. + * + * 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; + } + + /** + * The project ID. For example: my-example-project. Use the project ID to make requests to Compute Engine. + * + * 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 project ID. For example: my-example-project. Use the project ID to make requests to Compute Engine. + * + * 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; + } + + /** + * [Output Only] Quotas assigned to this project. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Quota quotas = 125341947; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQuotas() + { + return $this->quotas; + } + + /** + * [Output Only] Quotas assigned to this project. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Quota quotas = 125341947; + * @param array<\Google\Cloud\Compute\V1\Quota>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQuotas($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Quota::class); + $this->quotas = $arr; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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; + } + + /** + * The naming prefix for daily usage reports and the Google Cloud Storage bucket where they are stored. + * + * Generated from protobuf field optional .google.cloud.compute.v1.UsageExportLocation usage_export_location = 347543874; + * @return \Google\Cloud\Compute\V1\UsageExportLocation|null + */ + public function getUsageExportLocation() + { + return $this->usage_export_location; + } + + public function hasUsageExportLocation() + { + return isset($this->usage_export_location); + } + + public function clearUsageExportLocation() + { + unset($this->usage_export_location); + } + + /** + * The naming prefix for daily usage reports and the Google Cloud Storage bucket where they are stored. + * + * Generated from protobuf field optional .google.cloud.compute.v1.UsageExportLocation usage_export_location = 347543874; + * @param \Google\Cloud\Compute\V1\UsageExportLocation $var + * @return $this + */ + public function setUsageExportLocation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\UsageExportLocation::class); + $this->usage_export_location = $var; + + return $this; + } + + /** + * [Output Only] Default internal DNS setting used by VMs running in this project. + * Check the VmDnsSetting enum for the list of possible values. + * + * Generated from protobuf field optional string vm_dns_setting = 58856370; + * @return string + */ + public function getVmDnsSetting() + { + return isset($this->vm_dns_setting) ? $this->vm_dns_setting : ''; + } + + public function hasVmDnsSetting() + { + return isset($this->vm_dns_setting); + } + + public function clearVmDnsSetting() + { + unset($this->vm_dns_setting); + } + + /** + * [Output Only] Default internal DNS setting used by VMs running in this project. + * Check the VmDnsSetting enum for the list of possible values. + * + * Generated from protobuf field optional string vm_dns_setting = 58856370; + * @param string $var + * @return $this + */ + public function setVmDnsSetting($var) + { + GPBUtil::checkString($var, True); + $this->vm_dns_setting = $var; + + return $this; + } + + /** + * [Output Only] The role this project has in a shared VPC configuration. Currently, only projects with the host role, which is specified by the value HOST, are differentiated. + * Check the XpnProjectStatus enum for the list of possible values. + * + * Generated from protobuf field optional string xpn_project_status = 228419265; + * @return string + */ + public function getXpnProjectStatus() + { + return isset($this->xpn_project_status) ? $this->xpn_project_status : ''; + } + + public function hasXpnProjectStatus() + { + return isset($this->xpn_project_status); + } + + public function clearXpnProjectStatus() + { + unset($this->xpn_project_status); + } + + /** + * [Output Only] The role this project has in a shared VPC configuration. Currently, only projects with the host role, which is specified by the value HOST, are differentiated. + * Check the XpnProjectStatus enum for the list of possible values. + * + * Generated from protobuf field optional string xpn_project_status = 228419265; + * @param string $var + * @return $this + */ + public function setXpnProjectStatus($var) + { + GPBUtil::checkString($var, True); + $this->xpn_project_status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Project/CloudArmorTier.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Project/CloudArmorTier.php new file mode 100644 index 000000000000..91f1aec85eb3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Project/CloudArmorTier.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.Project.CloudArmorTier + */ +class CloudArmorTier +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_CLOUD_ARMOR_TIER = 0; + */ + const UNDEFINED_CLOUD_ARMOR_TIER = 0; + /** + * Enterprise tier protection billed annually. + * + * Generated from protobuf enum CA_ENTERPRISE_ANNUAL = 219921116; + */ + const CA_ENTERPRISE_ANNUAL = 219921116; + /** + * Enterprise tier protection billed monthly. + * + * Generated from protobuf enum CA_ENTERPRISE_PAYGO = 453530323; + */ + const CA_ENTERPRISE_PAYGO = 453530323; + /** + * Standard protection. + * + * Generated from protobuf enum CA_STANDARD = 13156734; + */ + const CA_STANDARD = 13156734; + + private static $valueToName = [ + self::UNDEFINED_CLOUD_ARMOR_TIER => 'UNDEFINED_CLOUD_ARMOR_TIER', + self::CA_ENTERPRISE_ANNUAL => 'CA_ENTERPRISE_ANNUAL', + self::CA_ENTERPRISE_PAYGO => 'CA_ENTERPRISE_PAYGO', + self::CA_STANDARD => 'CA_STANDARD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CloudArmorTier::class, \Google\Cloud\Compute\V1\Project_CloudArmorTier::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Project/DefaultNetworkTier.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Project/DefaultNetworkTier.php new file mode 100644 index 000000000000..6f8b632c9e2d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Project/DefaultNetworkTier.php @@ -0,0 +1,78 @@ +google.cloud.compute.v1.Project.DefaultNetworkTier + */ +class DefaultNetworkTier +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_DEFAULT_NETWORK_TIER = 0; + */ + const UNDEFINED_DEFAULT_NETWORK_TIER = 0; + /** + * Public internet quality with fixed bandwidth. + * + * Generated from protobuf enum FIXED_STANDARD = 310464328; + */ + const FIXED_STANDARD = 310464328; + /** + * High quality, Google-grade network tier, support for all networking products. + * + * Generated from protobuf enum PREMIUM = 399530551; + */ + const PREMIUM = 399530551; + /** + * Public internet quality, only limited support for other networking products. + * + * Generated from protobuf enum STANDARD = 484642493; + */ + const STANDARD = 484642493; + /** + * (Output only) Temporary tier for FIXED_STANDARD when fixed standard tier is expired or not configured. + * + * Generated from protobuf enum STANDARD_OVERRIDES_FIXED_STANDARD = 465847234; + */ + const STANDARD_OVERRIDES_FIXED_STANDARD = 465847234; + + private static $valueToName = [ + self::UNDEFINED_DEFAULT_NETWORK_TIER => 'UNDEFINED_DEFAULT_NETWORK_TIER', + self::FIXED_STANDARD => 'FIXED_STANDARD', + self::PREMIUM => 'PREMIUM', + self::STANDARD => 'STANDARD', + self::STANDARD_OVERRIDES_FIXED_STANDARD => 'STANDARD_OVERRIDES_FIXED_STANDARD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DefaultNetworkTier::class, \Google\Cloud\Compute\V1\Project_DefaultNetworkTier::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Project/VmDnsSetting.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Project/VmDnsSetting.php new file mode 100644 index 000000000000..c657a96055c5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Project/VmDnsSetting.php @@ -0,0 +1,70 @@ +google.cloud.compute.v1.Project.VmDnsSetting + */ +class VmDnsSetting +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_VM_DNS_SETTING = 0; + */ + const UNDEFINED_VM_DNS_SETTING = 0; + /** + * Generated from protobuf enum GLOBAL_DEFAULT = 345419141; + */ + const GLOBAL_DEFAULT = 345419141; + /** + * Generated from protobuf enum UNSPECIFIED_VM_DNS_SETTING = 35691930; + */ + const UNSPECIFIED_VM_DNS_SETTING = 35691930; + /** + * Generated from protobuf enum ZONAL_DEFAULT = 368475782; + */ + const ZONAL_DEFAULT = 368475782; + /** + * Generated from protobuf enum ZONAL_ONLY = 521198951; + */ + const ZONAL_ONLY = 521198951; + + private static $valueToName = [ + self::UNDEFINED_VM_DNS_SETTING => 'UNDEFINED_VM_DNS_SETTING', + self::GLOBAL_DEFAULT => 'GLOBAL_DEFAULT', + self::UNSPECIFIED_VM_DNS_SETTING => 'UNSPECIFIED_VM_DNS_SETTING', + self::ZONAL_DEFAULT => 'ZONAL_DEFAULT', + self::ZONAL_ONLY => 'ZONAL_ONLY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(VmDnsSetting::class, \Google\Cloud\Compute\V1\Project_VmDnsSetting::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Project/XpnProjectStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Project/XpnProjectStatus.php new file mode 100644 index 000000000000..4a563bb1b92f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Project/XpnProjectStatus.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.Project.XpnProjectStatus + */ +class XpnProjectStatus +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_XPN_PROJECT_STATUS = 0; + */ + const UNDEFINED_XPN_PROJECT_STATUS = 0; + /** + * Generated from protobuf enum HOST = 2223528; + */ + const HOST = 2223528; + /** + * Generated from protobuf enum UNSPECIFIED_XPN_PROJECT_STATUS = 340393257; + */ + const UNSPECIFIED_XPN_PROJECT_STATUS = 340393257; + + private static $valueToName = [ + self::UNDEFINED_XPN_PROJECT_STATUS => 'UNDEFINED_XPN_PROJECT_STATUS', + self::HOST => 'HOST', + self::UNSPECIFIED_XPN_PROJECT_STATUS => 'UNSPECIFIED_XPN_PROJECT_STATUS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(XpnProjectStatus::class, \Google\Cloud\Compute\V1\Project_XpnProjectStatus::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsDisableXpnResourceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsDisableXpnResourceRequest.php new file mode 100644 index 000000000000..e3dc8fee072b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsDisableXpnResourceRequest.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.ProjectsDisableXpnResourceRequest + */ +class ProjectsDisableXpnResourceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Service resource (a.k.a service project) ID. + * + * Generated from protobuf field optional .google.cloud.compute.v1.XpnResourceId xpn_resource = 133384631; + */ + protected $xpn_resource = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\XpnResourceId $xpn_resource + * Service resource (a.k.a service project) ID. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Service resource (a.k.a service project) ID. + * + * Generated from protobuf field optional .google.cloud.compute.v1.XpnResourceId xpn_resource = 133384631; + * @return \Google\Cloud\Compute\V1\XpnResourceId|null + */ + public function getXpnResource() + { + return $this->xpn_resource; + } + + public function hasXpnResource() + { + return isset($this->xpn_resource); + } + + public function clearXpnResource() + { + unset($this->xpn_resource); + } + + /** + * Service resource (a.k.a service project) ID. + * + * Generated from protobuf field optional .google.cloud.compute.v1.XpnResourceId xpn_resource = 133384631; + * @param \Google\Cloud\Compute\V1\XpnResourceId $var + * @return $this + */ + public function setXpnResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\XpnResourceId::class); + $this->xpn_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsEnableXpnResourceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsEnableXpnResourceRequest.php new file mode 100644 index 000000000000..09f996544384 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsEnableXpnResourceRequest.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.ProjectsEnableXpnResourceRequest + */ +class ProjectsEnableXpnResourceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Service resource (a.k.a service project) ID. + * + * Generated from protobuf field optional .google.cloud.compute.v1.XpnResourceId xpn_resource = 133384631; + */ + protected $xpn_resource = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\XpnResourceId $xpn_resource + * Service resource (a.k.a service project) ID. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Service resource (a.k.a service project) ID. + * + * Generated from protobuf field optional .google.cloud.compute.v1.XpnResourceId xpn_resource = 133384631; + * @return \Google\Cloud\Compute\V1\XpnResourceId|null + */ + public function getXpnResource() + { + return $this->xpn_resource; + } + + public function hasXpnResource() + { + return isset($this->xpn_resource); + } + + public function clearXpnResource() + { + unset($this->xpn_resource); + } + + /** + * Service resource (a.k.a service project) ID. + * + * Generated from protobuf field optional .google.cloud.compute.v1.XpnResourceId xpn_resource = 133384631; + * @param \Google\Cloud\Compute\V1\XpnResourceId $var + * @return $this + */ + public function setXpnResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\XpnResourceId::class); + $this->xpn_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsGetXpnResources.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsGetXpnResources.php new file mode 100644 index 000000000000..5bbc5990d129 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsGetXpnResources.php @@ -0,0 +1,154 @@ +google.cloud.compute.v1.ProjectsGetXpnResources + */ +class ProjectsGetXpnResources extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Type of resource. Always compute#projectsGetXpnResources for lists of service resources (a.k.a service projects) + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * Service resources (a.k.a service projects) attached to this project as their shared VPC host. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.XpnResourceId resources = 164412965; + */ + private $resources; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $kind + * [Output Only] Type of resource. Always compute#projectsGetXpnResources for lists of service resources (a.k.a service projects) + * @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 array<\Google\Cloud\Compute\V1\XpnResourceId>|\Google\Protobuf\Internal\RepeatedField $resources + * Service resources (a.k.a service projects) attached to this project as their shared VPC host. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Type of resource. Always compute#projectsGetXpnResources for lists of service resources (a.k.a service projects) + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#projectsGetXpnResources for lists of service resources (a.k.a service projects) + * + * 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; + } + + /** + * Service resources (a.k.a service projects) attached to this project as their shared VPC host. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.XpnResourceId resources = 164412965; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResources() + { + return $this->resources; + } + + /** + * Service resources (a.k.a service projects) attached to this project as their shared VPC host. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.XpnResourceId resources = 164412965; + * @param array<\Google\Cloud\Compute\V1\XpnResourceId>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\XpnResourceId::class); + $this->resources = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsListXpnHostsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsListXpnHostsRequest.php new file mode 100644 index 000000000000..375063e9ac3d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsListXpnHostsRequest.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.ProjectsListXpnHostsRequest + */ +class ProjectsListXpnHostsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional organization ID managed by Cloud Resource Manager, for which to list shared VPC host projects. If not specified, the organization will be inferred from the project. + * + * Generated from protobuf field optional string organization = 105180467; + */ + protected $organization = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $organization + * Optional organization ID managed by Cloud Resource Manager, for which to list shared VPC host projects. If not specified, the organization will be inferred from the project. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Optional organization ID managed by Cloud Resource Manager, for which to list shared VPC host projects. If not specified, the organization will be inferred from the project. + * + * Generated from protobuf field optional string organization = 105180467; + * @return string + */ + public function getOrganization() + { + return isset($this->organization) ? $this->organization : ''; + } + + public function hasOrganization() + { + return isset($this->organization); + } + + public function clearOrganization() + { + unset($this->organization); + } + + /** + * Optional organization ID managed by Cloud Resource Manager, for which to list shared VPC host projects. If not specified, the organization will be inferred from the project. + * + * Generated from protobuf field optional string organization = 105180467; + * @param string $var + * @return $this + */ + public function setOrganization($var) + { + GPBUtil::checkString($var, True); + $this->organization = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsSetCloudArmorTierRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsSetCloudArmorTierRequest.php new file mode 100644 index 000000000000..4cdc40393d33 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsSetCloudArmorTierRequest.php @@ -0,0 +1,80 @@ +google.cloud.compute.v1.ProjectsSetCloudArmorTierRequest + */ +class ProjectsSetCloudArmorTierRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Managed protection tier to be set. + * Check the CloudArmorTier enum for the list of possible values. + * + * Generated from protobuf field optional string cloud_armor_tier = 4427052; + */ + protected $cloud_armor_tier = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $cloud_armor_tier + * Managed protection tier to be set. + * Check the CloudArmorTier enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Managed protection tier to be set. + * Check the CloudArmorTier enum for the list of possible values. + * + * Generated from protobuf field optional string cloud_armor_tier = 4427052; + * @return string + */ + public function getCloudArmorTier() + { + return isset($this->cloud_armor_tier) ? $this->cloud_armor_tier : ''; + } + + public function hasCloudArmorTier() + { + return isset($this->cloud_armor_tier); + } + + public function clearCloudArmorTier() + { + unset($this->cloud_armor_tier); + } + + /** + * Managed protection tier to be set. + * Check the CloudArmorTier enum for the list of possible values. + * + * Generated from protobuf field optional string cloud_armor_tier = 4427052; + * @param string $var + * @return $this + */ + public function setCloudArmorTier($var) + { + GPBUtil::checkString($var, True); + $this->cloud_armor_tier = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsSetCloudArmorTierRequest/CloudArmorTier.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsSetCloudArmorTierRequest/CloudArmorTier.php new file mode 100644 index 000000000000..f886082eb6c5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsSetCloudArmorTierRequest/CloudArmorTier.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.ProjectsSetCloudArmorTierRequest.CloudArmorTier + */ +class CloudArmorTier +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_CLOUD_ARMOR_TIER = 0; + */ + const UNDEFINED_CLOUD_ARMOR_TIER = 0; + /** + * Enterprise tier protection billed annually. + * + * Generated from protobuf enum CA_ENTERPRISE_ANNUAL = 219921116; + */ + const CA_ENTERPRISE_ANNUAL = 219921116; + /** + * Enterprise tier protection billed monthly. + * + * Generated from protobuf enum CA_ENTERPRISE_PAYGO = 453530323; + */ + const CA_ENTERPRISE_PAYGO = 453530323; + /** + * Standard protection. + * + * Generated from protobuf enum CA_STANDARD = 13156734; + */ + const CA_STANDARD = 13156734; + + private static $valueToName = [ + self::UNDEFINED_CLOUD_ARMOR_TIER => 'UNDEFINED_CLOUD_ARMOR_TIER', + self::CA_ENTERPRISE_ANNUAL => 'CA_ENTERPRISE_ANNUAL', + self::CA_ENTERPRISE_PAYGO => 'CA_ENTERPRISE_PAYGO', + self::CA_STANDARD => 'CA_STANDARD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CloudArmorTier::class, \Google\Cloud\Compute\V1\ProjectsSetCloudArmorTierRequest_CloudArmorTier::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsSetDefaultNetworkTierRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsSetDefaultNetworkTierRequest.php new file mode 100644 index 000000000000..fdfc56d38aab --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsSetDefaultNetworkTierRequest.php @@ -0,0 +1,80 @@ +google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest + */ +class ProjectsSetDefaultNetworkTierRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Default network tier to be set. + * Check the NetworkTier enum for the list of possible values. + * + * Generated from protobuf field optional string network_tier = 517397843; + */ + protected $network_tier = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network_tier + * Default network tier to be set. + * Check the NetworkTier enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Default network tier to be set. + * Check the NetworkTier enum for the list of possible values. + * + * Generated from protobuf field optional string network_tier = 517397843; + * @return string + */ + public function getNetworkTier() + { + return isset($this->network_tier) ? $this->network_tier : ''; + } + + public function hasNetworkTier() + { + return isset($this->network_tier); + } + + public function clearNetworkTier() + { + unset($this->network_tier); + } + + /** + * Default network tier to be set. + * Check the NetworkTier enum for the list of possible values. + * + * Generated from protobuf field optional string network_tier = 517397843; + * @param string $var + * @return $this + */ + public function setNetworkTier($var) + { + GPBUtil::checkString($var, True); + $this->network_tier = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsSetDefaultNetworkTierRequest/NetworkTier.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsSetDefaultNetworkTierRequest/NetworkTier.php new file mode 100644 index 000000000000..ca538419fdf4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ProjectsSetDefaultNetworkTierRequest/NetworkTier.php @@ -0,0 +1,78 @@ +google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest.NetworkTier + */ +class NetworkTier +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_NETWORK_TIER = 0; + */ + const UNDEFINED_NETWORK_TIER = 0; + /** + * Public internet quality with fixed bandwidth. + * + * Generated from protobuf enum FIXED_STANDARD = 310464328; + */ + const FIXED_STANDARD = 310464328; + /** + * High quality, Google-grade network tier, support for all networking products. + * + * Generated from protobuf enum PREMIUM = 399530551; + */ + const PREMIUM = 399530551; + /** + * Public internet quality, only limited support for other networking products. + * + * Generated from protobuf enum STANDARD = 484642493; + */ + const STANDARD = 484642493; + /** + * (Output only) Temporary tier for FIXED_STANDARD when fixed standard tier is expired or not configured. + * + * Generated from protobuf enum STANDARD_OVERRIDES_FIXED_STANDARD = 465847234; + */ + const STANDARD_OVERRIDES_FIXED_STANDARD = 465847234; + + private static $valueToName = [ + self::UNDEFINED_NETWORK_TIER => 'UNDEFINED_NETWORK_TIER', + self::FIXED_STANDARD => 'FIXED_STANDARD', + self::PREMIUM => 'PREMIUM', + self::STANDARD => 'STANDARD', + self::STANDARD_OVERRIDES_FIXED_STANDARD => 'STANDARD_OVERRIDES_FIXED_STANDARD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NetworkTier::class, \Google\Cloud\Compute\V1\ProjectsSetDefaultNetworkTierRequest_NetworkTier::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefix.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefix.php new file mode 100644 index 000000000000..7a9b4f9e40db --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefix.php @@ -0,0 +1,651 @@ +google.cloud.compute.v1.PublicAdvertisedPrefix + */ +class PublicAdvertisedPrefix extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The version of BYOIP API. + * Check the ByoipApiVersion enum for the list of possible values. + * + * Generated from protobuf field optional string byoip_api_version = 162683283; + */ + protected $byoip_api_version = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * The address to be used for reverse DNS verification. + * + * Generated from protobuf field optional string dns_verification_ip = 241011381; + */ + protected $dns_verification_ip = null; + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a new PublicAdvertisedPrefix. An up-to-date fingerprint must be provided in order to update the PublicAdvertisedPrefix, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a PublicAdvertisedPrefix. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * [Output Only] The unique identifier for the resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * The address range, in CIDR format, represented by this public advertised prefix. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + */ + protected $ip_cidr_range = null; + /** + * [Output Only] Type of the resource. Always compute#publicAdvertisedPrefix for public advertised prefixes. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Specifies how child public delegated prefix will be scoped. It could be one of following values: - `REGIONAL`: The public delegated prefix is regional only. The provisioning will take a few minutes. - `GLOBAL`: The public delegated prefix is global only. The provisioning will take ~4 weeks. - `GLOBAL_AND_REGIONAL` [output only]: The public delegated prefixes is BYOIP V1 legacy prefix. This is output only value and no longer supported in BYOIP V2. + * Check the PdpScope enum for the list of possible values. + * + * Generated from protobuf field optional string pdp_scope = 524264785; + */ + protected $pdp_scope = null; + /** + * [Output Only] The list of public delegated prefixes that exist for this public advertised prefix. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix public_delegated_prefixs = 425811723; + */ + private $public_delegated_prefixs; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] The shared secret to be used for reverse DNS verification. + * + * Generated from protobuf field optional string shared_secret = 381932490; + */ + protected $shared_secret = null; + /** + * The status of the public advertised prefix. Possible values include: - `INITIAL`: RPKI validation is complete. - `PTR_CONFIGURED`: User has configured the PTR. - `VALIDATED`: Reverse DNS lookup is successful. - `REVERSE_DNS_LOOKUP_FAILED`: Reverse DNS lookup failed. - `PREFIX_CONFIGURATION_IN_PROGRESS`: The prefix is being configured. - `PREFIX_CONFIGURATION_COMPLETE`: The prefix is fully configured. - `PREFIX_REMOVAL_IN_PROGRESS`: The prefix is being removed. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $byoip_api_version + * [Output Only] The version of BYOIP API. + * Check the ByoipApiVersion enum for the list of possible values. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type string $dns_verification_ip + * The address to be used for reverse DNS verification. + * @type string $fingerprint + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a new PublicAdvertisedPrefix. An up-to-date fingerprint must be provided in order to update the PublicAdvertisedPrefix, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a PublicAdvertisedPrefix. + * @type int|string $id + * [Output Only] The unique identifier for the resource type. The server generates this identifier. + * @type string $ip_cidr_range + * The address range, in CIDR format, represented by this public advertised prefix. + * @type string $kind + * [Output Only] Type of the resource. Always compute#publicAdvertisedPrefix for public advertised prefixes. + * @type string $name + * 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 string $pdp_scope + * Specifies how child public delegated prefix will be scoped. It could be one of following values: - `REGIONAL`: The public delegated prefix is regional only. The provisioning will take a few minutes. - `GLOBAL`: The public delegated prefix is global only. The provisioning will take ~4 weeks. - `GLOBAL_AND_REGIONAL` [output only]: The public delegated prefixes is BYOIP V1 legacy prefix. This is output only value and no longer supported in BYOIP V2. + * Check the PdpScope enum for the list of possible values. + * @type array<\Google\Cloud\Compute\V1\PublicAdvertisedPrefixPublicDelegatedPrefix>|\Google\Protobuf\Internal\RepeatedField $public_delegated_prefixs + * [Output Only] The list of public delegated prefixes that exist for this public advertised prefix. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $shared_secret + * [Output Only] The shared secret to be used for reverse DNS verification. + * @type string $status + * The status of the public advertised prefix. Possible values include: - `INITIAL`: RPKI validation is complete. - `PTR_CONFIGURED`: User has configured the PTR. - `VALIDATED`: Reverse DNS lookup is successful. - `REVERSE_DNS_LOOKUP_FAILED`: Reverse DNS lookup failed. - `PREFIX_CONFIGURATION_IN_PROGRESS`: The prefix is being configured. - `PREFIX_CONFIGURATION_COMPLETE`: The prefix is fully configured. - `PREFIX_REMOVAL_IN_PROGRESS`: The prefix is being removed. + * Check the Status enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The version of BYOIP API. + * Check the ByoipApiVersion enum for the list of possible values. + * + * Generated from protobuf field optional string byoip_api_version = 162683283; + * @return string + */ + public function getByoipApiVersion() + { + return isset($this->byoip_api_version) ? $this->byoip_api_version : ''; + } + + public function hasByoipApiVersion() + { + return isset($this->byoip_api_version); + } + + public function clearByoipApiVersion() + { + unset($this->byoip_api_version); + } + + /** + * [Output Only] The version of BYOIP API. + * Check the ByoipApiVersion enum for the list of possible values. + * + * Generated from protobuf field optional string byoip_api_version = 162683283; + * @param string $var + * @return $this + */ + public function setByoipApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->byoip_api_version = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The address to be used for reverse DNS verification. + * + * Generated from protobuf field optional string dns_verification_ip = 241011381; + * @return string + */ + public function getDnsVerificationIp() + { + return isset($this->dns_verification_ip) ? $this->dns_verification_ip : ''; + } + + public function hasDnsVerificationIp() + { + return isset($this->dns_verification_ip); + } + + public function clearDnsVerificationIp() + { + unset($this->dns_verification_ip); + } + + /** + * The address to be used for reverse DNS verification. + * + * Generated from protobuf field optional string dns_verification_ip = 241011381; + * @param string $var + * @return $this + */ + public function setDnsVerificationIp($var) + { + GPBUtil::checkString($var, True); + $this->dns_verification_ip = $var; + + return $this; + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a new PublicAdvertisedPrefix. An up-to-date fingerprint must be provided in order to update the PublicAdvertisedPrefix, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a PublicAdvertisedPrefix. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a new PublicAdvertisedPrefix. An up-to-date fingerprint must be provided in order to update the PublicAdvertisedPrefix, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a PublicAdvertisedPrefix. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * The address range, in CIDR format, represented by this public advertised prefix. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + * @return string + */ + public function getIpCidrRange() + { + return isset($this->ip_cidr_range) ? $this->ip_cidr_range : ''; + } + + public function hasIpCidrRange() + { + return isset($this->ip_cidr_range); + } + + public function clearIpCidrRange() + { + unset($this->ip_cidr_range); + } + + /** + * The address range, in CIDR format, represented by this public advertised prefix. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + * @param string $var + * @return $this + */ + public function setIpCidrRange($var) + { + GPBUtil::checkString($var, True); + $this->ip_cidr_range = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#publicAdvertisedPrefix for public advertised prefixes. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#publicAdvertisedPrefix for public advertised prefixes. + * + * 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; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * Specifies how child public delegated prefix will be scoped. It could be one of following values: - `REGIONAL`: The public delegated prefix is regional only. The provisioning will take a few minutes. - `GLOBAL`: The public delegated prefix is global only. The provisioning will take ~4 weeks. - `GLOBAL_AND_REGIONAL` [output only]: The public delegated prefixes is BYOIP V1 legacy prefix. This is output only value and no longer supported in BYOIP V2. + * Check the PdpScope enum for the list of possible values. + * + * Generated from protobuf field optional string pdp_scope = 524264785; + * @return string + */ + public function getPdpScope() + { + return isset($this->pdp_scope) ? $this->pdp_scope : ''; + } + + public function hasPdpScope() + { + return isset($this->pdp_scope); + } + + public function clearPdpScope() + { + unset($this->pdp_scope); + } + + /** + * Specifies how child public delegated prefix will be scoped. It could be one of following values: - `REGIONAL`: The public delegated prefix is regional only. The provisioning will take a few minutes. - `GLOBAL`: The public delegated prefix is global only. The provisioning will take ~4 weeks. - `GLOBAL_AND_REGIONAL` [output only]: The public delegated prefixes is BYOIP V1 legacy prefix. This is output only value and no longer supported in BYOIP V2. + * Check the PdpScope enum for the list of possible values. + * + * Generated from protobuf field optional string pdp_scope = 524264785; + * @param string $var + * @return $this + */ + public function setPdpScope($var) + { + GPBUtil::checkString($var, True); + $this->pdp_scope = $var; + + return $this; + } + + /** + * [Output Only] The list of public delegated prefixes that exist for this public advertised prefix. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix public_delegated_prefixs = 425811723; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPublicDelegatedPrefixs() + { + return $this->public_delegated_prefixs; + } + + /** + * [Output Only] The list of public delegated prefixes that exist for this public advertised prefix. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix public_delegated_prefixs = 425811723; + * @param array<\Google\Cloud\Compute\V1\PublicAdvertisedPrefixPublicDelegatedPrefix>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPublicDelegatedPrefixs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PublicAdvertisedPrefixPublicDelegatedPrefix::class); + $this->public_delegated_prefixs = $arr; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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] The shared secret to be used for reverse DNS verification. + * + * Generated from protobuf field optional string shared_secret = 381932490; + * @return string + */ + public function getSharedSecret() + { + return isset($this->shared_secret) ? $this->shared_secret : ''; + } + + public function hasSharedSecret() + { + return isset($this->shared_secret); + } + + public function clearSharedSecret() + { + unset($this->shared_secret); + } + + /** + * [Output Only] The shared secret to be used for reverse DNS verification. + * + * Generated from protobuf field optional string shared_secret = 381932490; + * @param string $var + * @return $this + */ + public function setSharedSecret($var) + { + GPBUtil::checkString($var, True); + $this->shared_secret = $var; + + return $this; + } + + /** + * The status of the public advertised prefix. Possible values include: - `INITIAL`: RPKI validation is complete. - `PTR_CONFIGURED`: User has configured the PTR. - `VALIDATED`: Reverse DNS lookup is successful. - `REVERSE_DNS_LOOKUP_FAILED`: Reverse DNS lookup failed. - `PREFIX_CONFIGURATION_IN_PROGRESS`: The prefix is being configured. - `PREFIX_CONFIGURATION_COMPLETE`: The prefix is fully configured. - `PREFIX_REMOVAL_IN_PROGRESS`: The prefix is being removed. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * The status of the public advertised prefix. Possible values include: - `INITIAL`: RPKI validation is complete. - `PTR_CONFIGURED`: User has configured the PTR. - `VALIDATED`: Reverse DNS lookup is successful. - `REVERSE_DNS_LOOKUP_FAILED`: Reverse DNS lookup failed. - `PREFIX_CONFIGURATION_IN_PROGRESS`: The prefix is being configured. - `PREFIX_CONFIGURATION_COMPLETE`: The prefix is fully configured. - `PREFIX_REMOVAL_IN_PROGRESS`: The prefix is being removed. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefix/ByoipApiVersion.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefix/ByoipApiVersion.php new file mode 100644 index 000000000000..e8348800029f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefix/ByoipApiVersion.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.PublicAdvertisedPrefix.ByoipApiVersion + */ +class ByoipApiVersion +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_BYOIP_API_VERSION = 0; + */ + const UNDEFINED_BYOIP_API_VERSION = 0; + /** + * This public advertised prefix can be used to create both regional and global public delegated prefixes. It usually takes 4 weeks to create or delete a public delegated prefix. The BGP status cannot be changed. + * + * Generated from protobuf enum V1 = 2715; + */ + const V1 = 2715; + /** + * This public advertised prefix can only be used to create regional public delegated prefixes. Public delegated prefix creation and deletion takes minutes and the BGP status can be modified. + * + * Generated from protobuf enum V2 = 2716; + */ + const V2 = 2716; + + private static $valueToName = [ + self::UNDEFINED_BYOIP_API_VERSION => 'UNDEFINED_BYOIP_API_VERSION', + self::V1 => 'V1', + self::V2 => 'V2', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ByoipApiVersion::class, \Google\Cloud\Compute\V1\PublicAdvertisedPrefix_ByoipApiVersion::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefix/PdpScope.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefix/PdpScope.php new file mode 100644 index 000000000000..1d6e99618c2c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefix/PdpScope.php @@ -0,0 +1,75 @@ +google.cloud.compute.v1.PublicAdvertisedPrefix.PdpScope + */ +class PdpScope +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PDP_SCOPE = 0; + */ + const UNDEFINED_PDP_SCOPE = 0; + /** + * The public delegated prefix is global only. The provisioning will take ~4 weeks. + * + * Generated from protobuf enum GLOBAL = 494663587; + */ + const PBGLOBAL = 494663587; + /** + * The public delegated prefixes is BYOIP V1 legacy prefix. This is output only value and no longer supported in BYOIP V2. + * + * Generated from protobuf enum GLOBAL_AND_REGIONAL = 318053059; + */ + const GLOBAL_AND_REGIONAL = 318053059; + /** + * The public delegated prefix is regional only. The provisioning will take a few minutes. + * + * Generated from protobuf enum REGIONAL = 92288543; + */ + const REGIONAL = 92288543; + + private static $valueToName = [ + self::UNDEFINED_PDP_SCOPE => 'UNDEFINED_PDP_SCOPE', + self::PBGLOBAL => 'GLOBAL', + self::GLOBAL_AND_REGIONAL => 'GLOBAL_AND_REGIONAL', + self::REGIONAL => 'REGIONAL', + ]; + + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PdpScope::class, \Google\Cloud\Compute\V1\PublicAdvertisedPrefix_PdpScope::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefix/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefix/Status.php new file mode 100644 index 000000000000..5e1107ae1a29 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefix/Status.php @@ -0,0 +1,113 @@ +google.cloud.compute.v1.PublicAdvertisedPrefix.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * The prefix is announced to Internet. + * + * Generated from protobuf enum ANNOUNCED_TO_INTERNET = 177880897; + */ + const ANNOUNCED_TO_INTERNET = 177880897; + /** + * RPKI validation is complete. + * + * Generated from protobuf enum INITIAL = 518841124; + */ + const INITIAL = 518841124; + /** + * The prefix is fully configured. + * + * Generated from protobuf enum PREFIX_CONFIGURATION_COMPLETE = 480889551; + */ + const PREFIX_CONFIGURATION_COMPLETE = 480889551; + /** + * The prefix is being configured. + * + * Generated from protobuf enum PREFIX_CONFIGURATION_IN_PROGRESS = 378550961; + */ + const PREFIX_CONFIGURATION_IN_PROGRESS = 378550961; + /** + * The prefix is being removed. + * + * Generated from protobuf enum PREFIX_REMOVAL_IN_PROGRESS = 284375783; + */ + const PREFIX_REMOVAL_IN_PROGRESS = 284375783; + /** + * User has configured the PTR. + * + * Generated from protobuf enum PTR_CONFIGURED = 513497167; + */ + const PTR_CONFIGURED = 513497167; + /** + * The prefix is currently withdrawn but ready to be announced. + * + * Generated from protobuf enum READY_TO_ANNOUNCE = 64641265; + */ + const READY_TO_ANNOUNCE = 64641265; + /** + * Reverse DNS lookup failed. + * + * Generated from protobuf enum REVERSE_DNS_LOOKUP_FAILED = 295755183; + */ + const REVERSE_DNS_LOOKUP_FAILED = 295755183; + /** + * Reverse DNS lookup is successful. + * + * Generated from protobuf enum VALIDATED = 66197998; + */ + const VALIDATED = 66197998; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::ANNOUNCED_TO_INTERNET => 'ANNOUNCED_TO_INTERNET', + self::INITIAL => 'INITIAL', + self::PREFIX_CONFIGURATION_COMPLETE => 'PREFIX_CONFIGURATION_COMPLETE', + self::PREFIX_CONFIGURATION_IN_PROGRESS => 'PREFIX_CONFIGURATION_IN_PROGRESS', + self::PREFIX_REMOVAL_IN_PROGRESS => 'PREFIX_REMOVAL_IN_PROGRESS', + self::PTR_CONFIGURED => 'PTR_CONFIGURED', + self::READY_TO_ANNOUNCE => 'READY_TO_ANNOUNCE', + self::REVERSE_DNS_LOOKUP_FAILED => 'REVERSE_DNS_LOOKUP_FAILED', + self::VALIDATED => 'VALIDATED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\PublicAdvertisedPrefix_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefixList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefixList.php new file mode 100644 index 000000000000..2fcad75d830c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefixList.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.PublicAdvertisedPrefixList + */ +class PublicAdvertisedPrefixList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of PublicAdvertisedPrefix resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PublicAdvertisedPrefix items = 100526016; + */ + private $items; + /** + * [Output Only] Type of the resource. Always compute#publicAdvertisedPrefix for public advertised prefixes. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\PublicAdvertisedPrefix>|\Google\Protobuf\Internal\RepeatedField $items + * A list of PublicAdvertisedPrefix resources. + * @type string $kind + * [Output Only] Type of the resource. Always compute#publicAdvertisedPrefix for public advertised prefixes. + * @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 PublicAdvertisedPrefix resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PublicAdvertisedPrefix items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of PublicAdvertisedPrefix resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PublicAdvertisedPrefix items = 100526016; + * @param array<\Google\Cloud\Compute\V1\PublicAdvertisedPrefix>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PublicAdvertisedPrefix::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#publicAdvertisedPrefix for public advertised prefixes. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#publicAdvertisedPrefix for public advertised prefixes. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefixPublicDelegatedPrefix.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefixPublicDelegatedPrefix.php new file mode 100644 index 000000000000..9255ed5a3132 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicAdvertisedPrefixPublicDelegatedPrefix.php @@ -0,0 +1,253 @@ +google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix + */ +class PublicAdvertisedPrefixPublicDelegatedPrefix extends \Google\Protobuf\Internal\Message +{ + /** + * The IP address range of the public delegated prefix + * + * Generated from protobuf field optional string ip_range = 145092645; + */ + protected $ip_range = null; + /** + * The name of the public delegated prefix + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * The project number of the public delegated prefix + * + * Generated from protobuf field optional string project = 227560217; + */ + protected $project = null; + /** + * The region of the public delegated prefix if it is regional. If absent, the prefix is global. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * The status of the public delegated prefix. Possible values are: INITIALIZING: The public delegated prefix is being initialized and addresses cannot be created yet. ANNOUNCED: The public delegated prefix is active. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ip_range + * The IP address range of the public delegated prefix + * @type string $name + * The name of the public delegated prefix + * @type string $project + * The project number of the public delegated prefix + * @type string $region + * The region of the public delegated prefix if it is regional. If absent, the prefix is global. + * @type string $status + * The status of the public delegated prefix. Possible values are: INITIALIZING: The public delegated prefix is being initialized and addresses cannot be created yet. ANNOUNCED: The public delegated prefix is active. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The IP address range of the public delegated prefix + * + * Generated from protobuf field optional string ip_range = 145092645; + * @return string + */ + public function getIpRange() + { + return isset($this->ip_range) ? $this->ip_range : ''; + } + + public function hasIpRange() + { + return isset($this->ip_range); + } + + public function clearIpRange() + { + unset($this->ip_range); + } + + /** + * The IP address range of the public delegated prefix + * + * Generated from protobuf field optional string ip_range = 145092645; + * @param string $var + * @return $this + */ + public function setIpRange($var) + { + GPBUtil::checkString($var, True); + $this->ip_range = $var; + + return $this; + } + + /** + * The name of the public delegated prefix + * + * 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 of the public delegated prefix + * + * 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; + } + + /** + * The project number of the public delegated prefix + * + * Generated from protobuf field optional string project = 227560217; + * @return string + */ + public function getProject() + { + return isset($this->project) ? $this->project : ''; + } + + public function hasProject() + { + return isset($this->project); + } + + public function clearProject() + { + unset($this->project); + } + + /** + * The project number of the public delegated prefix + * + * Generated from protobuf field optional string project = 227560217; + * @param string $var + * @return $this + */ + public function setProject($var) + { + GPBUtil::checkString($var, True); + $this->project = $var; + + return $this; + } + + /** + * The region of the public delegated prefix if it is regional. If absent, the prefix is global. + * + * 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); + } + + /** + * The region of the public delegated prefix if it is regional. If absent, the prefix is global. + * + * 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; + } + + /** + * The status of the public delegated prefix. Possible values are: INITIALIZING: The public delegated prefix is being initialized and addresses cannot be created yet. ANNOUNCED: The public delegated prefix is active. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * The status of the public delegated prefix. Possible values are: INITIALIZING: The public delegated prefix is being initialized and addresses cannot be created yet. ANNOUNCED: The public delegated prefix is active. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefix.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefix.php new file mode 100644 index 000000000000..537e635e8808 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefix.php @@ -0,0 +1,739 @@ +google.cloud.compute.v1.PublicDelegatedPrefix + */ +class PublicDelegatedPrefix extends \Google\Protobuf\Internal\Message +{ + /** + * The allocatable prefix length supported by this public delegated prefix. This field is optional and cannot be set for prefixes in DELEGATION mode. It cannot be set for IPv4 prefixes either, and it always defaults to 32. + * + * Generated from protobuf field optional int32 allocatable_prefix_length = 38427446; + */ + protected $allocatable_prefix_length = null; + /** + * [Output Only] The version of BYOIP API. + * Check the ByoipApiVersion enum for the list of possible values. + * + * Generated from protobuf field optional string byoip_api_version = 162683283; + */ + protected $byoip_api_version = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a new PublicDelegatedPrefix. An up-to-date fingerprint must be provided in order to update the PublicDelegatedPrefix, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a PublicDelegatedPrefix. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * [Output Only] The unique identifier for the resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * The IP address range, in CIDR format, represented by this public delegated prefix. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + */ + protected $ip_cidr_range = null; + /** + * If true, the prefix will be live migrated. + * + * Generated from protobuf field optional bool is_live_migration = 511823856; + */ + protected $is_live_migration = null; + /** + * [Output Only] Type of the resource. Always compute#publicDelegatedPrefix for public delegated prefixes. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * The public delegated prefix mode for IPv6 only. + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + */ + protected $mode = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix. + * + * Generated from protobuf field optional string parent_prefix = 15233991; + */ + protected $parent_prefix = null; + /** + * The list of sub public delegated prefixes that exist for this public delegated prefix. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix public_delegated_sub_prefixs = 188940044; + */ + private $public_delegated_sub_prefixs; + /** + * [Output Only] URL of the region where the public delegated prefix resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] The status of the public delegated prefix, which can be one of following values: - `INITIALIZING` The public delegated prefix is being initialized and addresses cannot be created yet. - `READY_TO_ANNOUNCE` The public delegated prefix is a live migration prefix and is active. - `ANNOUNCED` The public delegated prefix is active. - `DELETING` The public delegated prefix is being deprovsioned. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $allocatable_prefix_length + * The allocatable prefix length supported by this public delegated prefix. This field is optional and cannot be set for prefixes in DELEGATION mode. It cannot be set for IPv4 prefixes either, and it always defaults to 32. + * @type string $byoip_api_version + * [Output Only] The version of BYOIP API. + * Check the ByoipApiVersion enum for the list of possible values. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type string $fingerprint + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a new PublicDelegatedPrefix. An up-to-date fingerprint must be provided in order to update the PublicDelegatedPrefix, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a PublicDelegatedPrefix. + * @type int|string $id + * [Output Only] The unique identifier for the resource type. The server generates this identifier. + * @type string $ip_cidr_range + * The IP address range, in CIDR format, represented by this public delegated prefix. + * @type bool $is_live_migration + * If true, the prefix will be live migrated. + * @type string $kind + * [Output Only] Type of the resource. Always compute#publicDelegatedPrefix for public delegated prefixes. + * @type string $mode + * The public delegated prefix mode for IPv6 only. + * Check the Mode enum for the list of possible values. + * @type string $name + * 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 string $parent_prefix + * The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix. + * @type array<\Google\Cloud\Compute\V1\PublicDelegatedPrefixPublicDelegatedSubPrefix>|\Google\Protobuf\Internal\RepeatedField $public_delegated_sub_prefixs + * The list of sub public delegated prefixes that exist for this public delegated prefix. + * @type string $region + * [Output Only] URL of the region where the public delegated prefix resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $status + * [Output Only] The status of the public delegated prefix, which can be one of following values: - `INITIALIZING` The public delegated prefix is being initialized and addresses cannot be created yet. - `READY_TO_ANNOUNCE` The public delegated prefix is a live migration prefix and is active. - `ANNOUNCED` The public delegated prefix is active. - `DELETING` The public delegated prefix is being deprovsioned. + * Check the Status enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The allocatable prefix length supported by this public delegated prefix. This field is optional and cannot be set for prefixes in DELEGATION mode. It cannot be set for IPv4 prefixes either, and it always defaults to 32. + * + * Generated from protobuf field optional int32 allocatable_prefix_length = 38427446; + * @return int + */ + public function getAllocatablePrefixLength() + { + return isset($this->allocatable_prefix_length) ? $this->allocatable_prefix_length : 0; + } + + public function hasAllocatablePrefixLength() + { + return isset($this->allocatable_prefix_length); + } + + public function clearAllocatablePrefixLength() + { + unset($this->allocatable_prefix_length); + } + + /** + * The allocatable prefix length supported by this public delegated prefix. This field is optional and cannot be set for prefixes in DELEGATION mode. It cannot be set for IPv4 prefixes either, and it always defaults to 32. + * + * Generated from protobuf field optional int32 allocatable_prefix_length = 38427446; + * @param int $var + * @return $this + */ + public function setAllocatablePrefixLength($var) + { + GPBUtil::checkInt32($var); + $this->allocatable_prefix_length = $var; + + return $this; + } + + /** + * [Output Only] The version of BYOIP API. + * Check the ByoipApiVersion enum for the list of possible values. + * + * Generated from protobuf field optional string byoip_api_version = 162683283; + * @return string + */ + public function getByoipApiVersion() + { + return isset($this->byoip_api_version) ? $this->byoip_api_version : ''; + } + + public function hasByoipApiVersion() + { + return isset($this->byoip_api_version); + } + + public function clearByoipApiVersion() + { + unset($this->byoip_api_version); + } + + /** + * [Output Only] The version of BYOIP API. + * Check the ByoipApiVersion enum for the list of possible values. + * + * Generated from protobuf field optional string byoip_api_version = 162683283; + * @param string $var + * @return $this + */ + public function setByoipApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->byoip_api_version = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a new PublicDelegatedPrefix. An up-to-date fingerprint must be provided in order to update the PublicDelegatedPrefix, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a PublicDelegatedPrefix. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a new PublicDelegatedPrefix. An up-to-date fingerprint must be provided in order to update the PublicDelegatedPrefix, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a PublicDelegatedPrefix. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * The IP address range, in CIDR format, represented by this public delegated prefix. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + * @return string + */ + public function getIpCidrRange() + { + return isset($this->ip_cidr_range) ? $this->ip_cidr_range : ''; + } + + public function hasIpCidrRange() + { + return isset($this->ip_cidr_range); + } + + public function clearIpCidrRange() + { + unset($this->ip_cidr_range); + } + + /** + * The IP address range, in CIDR format, represented by this public delegated prefix. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + * @param string $var + * @return $this + */ + public function setIpCidrRange($var) + { + GPBUtil::checkString($var, True); + $this->ip_cidr_range = $var; + + return $this; + } + + /** + * If true, the prefix will be live migrated. + * + * Generated from protobuf field optional bool is_live_migration = 511823856; + * @return bool + */ + public function getIsLiveMigration() + { + return isset($this->is_live_migration) ? $this->is_live_migration : false; + } + + public function hasIsLiveMigration() + { + return isset($this->is_live_migration); + } + + public function clearIsLiveMigration() + { + unset($this->is_live_migration); + } + + /** + * If true, the prefix will be live migrated. + * + * Generated from protobuf field optional bool is_live_migration = 511823856; + * @param bool $var + * @return $this + */ + public function setIsLiveMigration($var) + { + GPBUtil::checkBool($var); + $this->is_live_migration = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#publicDelegatedPrefix for public delegated prefixes. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#publicDelegatedPrefix for public delegated prefixes. + * + * 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; + } + + /** + * The public delegated prefix mode for IPv6 only. + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + * @return string + */ + public function getMode() + { + return isset($this->mode) ? $this->mode : ''; + } + + public function hasMode() + { + return isset($this->mode); + } + + public function clearMode() + { + unset($this->mode); + } + + /** + * The public delegated prefix mode for IPv6 only. + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + * @param string $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkString($var, True); + $this->mode = $var; + + return $this; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix. + * + * Generated from protobuf field optional string parent_prefix = 15233991; + * @return string + */ + public function getParentPrefix() + { + return isset($this->parent_prefix) ? $this->parent_prefix : ''; + } + + public function hasParentPrefix() + { + return isset($this->parent_prefix); + } + + public function clearParentPrefix() + { + unset($this->parent_prefix); + } + + /** + * The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix. + * + * Generated from protobuf field optional string parent_prefix = 15233991; + * @param string $var + * @return $this + */ + public function setParentPrefix($var) + { + GPBUtil::checkString($var, True); + $this->parent_prefix = $var; + + return $this; + } + + /** + * The list of sub public delegated prefixes that exist for this public delegated prefix. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix public_delegated_sub_prefixs = 188940044; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPublicDelegatedSubPrefixs() + { + return $this->public_delegated_sub_prefixs; + } + + /** + * The list of sub public delegated prefixes that exist for this public delegated prefix. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix public_delegated_sub_prefixs = 188940044; + * @param array<\Google\Cloud\Compute\V1\PublicDelegatedPrefixPublicDelegatedSubPrefix>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPublicDelegatedSubPrefixs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PublicDelegatedPrefixPublicDelegatedSubPrefix::class); + $this->public_delegated_sub_prefixs = $arr; + + return $this; + } + + /** + * [Output Only] URL of the region where the public delegated prefix resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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 public delegated prefix resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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] Server-defined URL for the 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 the 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] The status of the public delegated prefix, which can be one of following values: - `INITIALIZING` The public delegated prefix is being initialized and addresses cannot be created yet. - `READY_TO_ANNOUNCE` The public delegated prefix is a live migration prefix and is active. - `ANNOUNCED` The public delegated prefix is active. - `DELETING` The public delegated prefix is being deprovsioned. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] The status of the public delegated prefix, which can be one of following values: - `INITIALIZING` The public delegated prefix is being initialized and addresses cannot be created yet. - `READY_TO_ANNOUNCE` The public delegated prefix is a live migration prefix and is active. - `ANNOUNCED` The public delegated prefix is active. - `DELETING` The public delegated prefix is being deprovsioned. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefix/ByoipApiVersion.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefix/ByoipApiVersion.php new file mode 100644 index 000000000000..967786d4ee16 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefix/ByoipApiVersion.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.PublicDelegatedPrefix.ByoipApiVersion + */ +class ByoipApiVersion +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_BYOIP_API_VERSION = 0; + */ + const UNDEFINED_BYOIP_API_VERSION = 0; + /** + * This public delegated prefix usually takes 4 weeks to delete, and the BGP status cannot be changed. Announce and Withdraw APIs can not be used on this prefix. + * + * Generated from protobuf enum V1 = 2715; + */ + const V1 = 2715; + /** + * This public delegated prefix takes minutes to delete. Announce and Withdraw APIs can be used on this prefix to change the BGP status. + * + * Generated from protobuf enum V2 = 2716; + */ + const V2 = 2716; + + private static $valueToName = [ + self::UNDEFINED_BYOIP_API_VERSION => 'UNDEFINED_BYOIP_API_VERSION', + self::V1 => 'V1', + self::V2 => 'V2', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ByoipApiVersion::class, \Google\Cloud\Compute\V1\PublicDelegatedPrefix_ByoipApiVersion::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefix/Mode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefix/Mode.php new file mode 100644 index 000000000000..d0eff35f68f9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefix/Mode.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.PublicDelegatedPrefix.Mode + */ +class Mode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MODE = 0; + */ + const UNDEFINED_MODE = 0; + /** + * The public delegated prefix is used for further sub-delegation only. Such prefixes cannot set allocatablePrefixLength. + * + * Generated from protobuf enum DELEGATION = 264149288; + */ + const DELEGATION = 264149288; + /** + * The public delegated prefix is used for creating forwarding rules only. Such prefixes cannot set publicDelegatedSubPrefixes. + * + * Generated from protobuf enum EXTERNAL_IPV6_FORWARDING_RULE_CREATION = 398684356; + */ + const EXTERNAL_IPV6_FORWARDING_RULE_CREATION = 398684356; + + private static $valueToName = [ + self::UNDEFINED_MODE => 'UNDEFINED_MODE', + self::DELEGATION => 'DELEGATION', + self::EXTERNAL_IPV6_FORWARDING_RULE_CREATION => 'EXTERNAL_IPV6_FORWARDING_RULE_CREATION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Mode::class, \Google\Cloud\Compute\V1\PublicDelegatedPrefix_Mode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefix/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefix/Status.php new file mode 100644 index 000000000000..f6c56f32ba96 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefix/Status.php @@ -0,0 +1,92 @@ +google.cloud.compute.v1.PublicDelegatedPrefix.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * The public delegated prefix is active. + * + * Generated from protobuf enum ANNOUNCED = 365103355; + */ + const ANNOUNCED = 365103355; + /** + * The prefix is announced within Google network. + * + * Generated from protobuf enum ANNOUNCED_TO_GOOGLE = 454875705; + */ + const ANNOUNCED_TO_GOOGLE = 454875705; + /** + * The prefix is announced to Internet and within Google. + * + * Generated from protobuf enum ANNOUNCED_TO_INTERNET = 177880897; + */ + const ANNOUNCED_TO_INTERNET = 177880897; + /** + * The public delegated prefix is being deprovsioned. + * + * Generated from protobuf enum DELETING = 528602024; + */ + const DELETING = 528602024; + /** + * The public delegated prefix is being initialized and addresses cannot be created yet. + * + * Generated from protobuf enum INITIALIZING = 306588749; + */ + const INITIALIZING = 306588749; + /** + * The public delegated prefix is currently withdrawn but ready to be announced. + * + * Generated from protobuf enum READY_TO_ANNOUNCE = 64641265; + */ + const READY_TO_ANNOUNCE = 64641265; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::ANNOUNCED => 'ANNOUNCED', + self::ANNOUNCED_TO_GOOGLE => 'ANNOUNCED_TO_GOOGLE', + self::ANNOUNCED_TO_INTERNET => 'ANNOUNCED_TO_INTERNET', + self::DELETING => 'DELETING', + self::INITIALIZING => 'INITIALIZING', + self::READY_TO_ANNOUNCE => 'READY_TO_ANNOUNCE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\PublicDelegatedPrefix_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixAggregatedList.php new file mode 100644 index 000000000000..c6d5cc05bc1b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList + */ +class PublicDelegatedPrefixAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of PublicDelegatedPrefixesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of the resource. Always compute#publicDelegatedPrefixAggregatedList for aggregated lists of public delegated prefixes. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 PublicDelegatedPrefixesScopedList resources. + * @type string $kind + * [Output Only] Type of the resource. Always compute#publicDelegatedPrefixAggregatedList for aggregated lists of public delegated prefixes. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 PublicDelegatedPrefixesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of PublicDelegatedPrefixesScopedList 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\PublicDelegatedPrefixesScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#publicDelegatedPrefixAggregatedList for aggregated lists of public delegated prefixes. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#publicDelegatedPrefixAggregatedList for aggregated lists of public delegated prefixes. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixList.php new file mode 100644 index 000000000000..552872b69308 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixList.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.PublicDelegatedPrefixList + */ +class PublicDelegatedPrefixList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of PublicDelegatedPrefix resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PublicDelegatedPrefix items = 100526016; + */ + private $items; + /** + * [Output Only] Type of the resource. Always compute#publicDelegatedPrefixList for public delegated prefixes. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\PublicDelegatedPrefix>|\Google\Protobuf\Internal\RepeatedField $items + * A list of PublicDelegatedPrefix resources. + * @type string $kind + * [Output Only] Type of the resource. Always compute#publicDelegatedPrefixList for public delegated prefixes. + * @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 PublicDelegatedPrefix resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PublicDelegatedPrefix items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of PublicDelegatedPrefix resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PublicDelegatedPrefix items = 100526016; + * @param array<\Google\Cloud\Compute\V1\PublicDelegatedPrefix>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PublicDelegatedPrefix::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#publicDelegatedPrefixList for public delegated prefixes. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#publicDelegatedPrefixList for public delegated prefixes. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixPublicDelegatedSubPrefix.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixPublicDelegatedSubPrefix.php new file mode 100644 index 000000000000..8f930c25c806 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixPublicDelegatedSubPrefix.php @@ -0,0 +1,437 @@ +google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + */ +class PublicDelegatedPrefixPublicDelegatedSubPrefix extends \Google\Protobuf\Internal\Message +{ + /** + * The allocatable prefix length supported by this PublicDelegatedSubPrefix. + * + * Generated from protobuf field optional int32 allocatable_prefix_length = 38427446; + */ + protected $allocatable_prefix_length = null; + /** + * Name of the project scoping this PublicDelegatedSubPrefix. + * + * Generated from protobuf field optional string delegatee_project = 414860634; + */ + protected $delegatee_project = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * The IP address range, in CIDR format, represented by this sub public delegated prefix. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + */ + protected $ip_cidr_range = null; + /** + * Whether the sub prefix is delegated to create Address resources in the delegatee project. + * + * Generated from protobuf field optional bool is_address = 352617951; + */ + protected $is_address = null; + /** + * The PublicDelegatedSubPrefix mode for IPv6 only. + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + */ + protected $mode = null; + /** + * The name of the sub public delegated prefix. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] The region of the sub public delegated prefix if it is regional. If absent, the sub prefix is global. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] The status of the sub public delegated prefix. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $allocatable_prefix_length + * The allocatable prefix length supported by this PublicDelegatedSubPrefix. + * @type string $delegatee_project + * Name of the project scoping this PublicDelegatedSubPrefix. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type string $ip_cidr_range + * The IP address range, in CIDR format, represented by this sub public delegated prefix. + * @type bool $is_address + * Whether the sub prefix is delegated to create Address resources in the delegatee project. + * @type string $mode + * The PublicDelegatedSubPrefix mode for IPv6 only. + * Check the Mode enum for the list of possible values. + * @type string $name + * The name of the sub public delegated prefix. + * @type string $region + * [Output Only] The region of the sub public delegated prefix if it is regional. If absent, the sub prefix is global. + * @type string $status + * [Output Only] The status of the sub public delegated prefix. + * Check the Status enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The allocatable prefix length supported by this PublicDelegatedSubPrefix. + * + * Generated from protobuf field optional int32 allocatable_prefix_length = 38427446; + * @return int + */ + public function getAllocatablePrefixLength() + { + return isset($this->allocatable_prefix_length) ? $this->allocatable_prefix_length : 0; + } + + public function hasAllocatablePrefixLength() + { + return isset($this->allocatable_prefix_length); + } + + public function clearAllocatablePrefixLength() + { + unset($this->allocatable_prefix_length); + } + + /** + * The allocatable prefix length supported by this PublicDelegatedSubPrefix. + * + * Generated from protobuf field optional int32 allocatable_prefix_length = 38427446; + * @param int $var + * @return $this + */ + public function setAllocatablePrefixLength($var) + { + GPBUtil::checkInt32($var); + $this->allocatable_prefix_length = $var; + + return $this; + } + + /** + * Name of the project scoping this PublicDelegatedSubPrefix. + * + * Generated from protobuf field optional string delegatee_project = 414860634; + * @return string + */ + public function getDelegateeProject() + { + return isset($this->delegatee_project) ? $this->delegatee_project : ''; + } + + public function hasDelegateeProject() + { + return isset($this->delegatee_project); + } + + public function clearDelegateeProject() + { + unset($this->delegatee_project); + } + + /** + * Name of the project scoping this PublicDelegatedSubPrefix. + * + * Generated from protobuf field optional string delegatee_project = 414860634; + * @param string $var + * @return $this + */ + public function setDelegateeProject($var) + { + GPBUtil::checkString($var, True); + $this->delegatee_project = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The IP address range, in CIDR format, represented by this sub public delegated prefix. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + * @return string + */ + public function getIpCidrRange() + { + return isset($this->ip_cidr_range) ? $this->ip_cidr_range : ''; + } + + public function hasIpCidrRange() + { + return isset($this->ip_cidr_range); + } + + public function clearIpCidrRange() + { + unset($this->ip_cidr_range); + } + + /** + * The IP address range, in CIDR format, represented by this sub public delegated prefix. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + * @param string $var + * @return $this + */ + public function setIpCidrRange($var) + { + GPBUtil::checkString($var, True); + $this->ip_cidr_range = $var; + + return $this; + } + + /** + * Whether the sub prefix is delegated to create Address resources in the delegatee project. + * + * Generated from protobuf field optional bool is_address = 352617951; + * @return bool + */ + public function getIsAddress() + { + return isset($this->is_address) ? $this->is_address : false; + } + + public function hasIsAddress() + { + return isset($this->is_address); + } + + public function clearIsAddress() + { + unset($this->is_address); + } + + /** + * Whether the sub prefix is delegated to create Address resources in the delegatee project. + * + * Generated from protobuf field optional bool is_address = 352617951; + * @param bool $var + * @return $this + */ + public function setIsAddress($var) + { + GPBUtil::checkBool($var); + $this->is_address = $var; + + return $this; + } + + /** + * The PublicDelegatedSubPrefix mode for IPv6 only. + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + * @return string + */ + public function getMode() + { + return isset($this->mode) ? $this->mode : ''; + } + + public function hasMode() + { + return isset($this->mode); + } + + public function clearMode() + { + unset($this->mode); + } + + /** + * The PublicDelegatedSubPrefix mode for IPv6 only. + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + * @param string $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkString($var, True); + $this->mode = $var; + + return $this; + } + + /** + * The name of the sub public delegated prefix. + * + * 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 of the sub public delegated prefix. + * + * 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; + } + + /** + * [Output Only] The region of the sub public delegated prefix if it is regional. If absent, the sub prefix is global. + * + * 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] The region of the sub public delegated prefix if it is regional. If absent, the sub prefix is global. + * + * 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 status of the sub public delegated prefix. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] The status of the sub public delegated prefix. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixPublicDelegatedSubPrefix/Mode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixPublicDelegatedSubPrefix/Mode.php new file mode 100644 index 000000000000..e1ffe4947ccd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixPublicDelegatedSubPrefix/Mode.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix.Mode + */ +class Mode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MODE = 0; + */ + const UNDEFINED_MODE = 0; + /** + * The public delegated prefix is used for further sub-delegation only. Such prefixes cannot set allocatablePrefixLength. + * + * Generated from protobuf enum DELEGATION = 264149288; + */ + const DELEGATION = 264149288; + /** + * The public delegated prefix is used for creating forwarding rules only. Such prefixes cannot set publicDelegatedSubPrefixes. + * + * Generated from protobuf enum EXTERNAL_IPV6_FORWARDING_RULE_CREATION = 398684356; + */ + const EXTERNAL_IPV6_FORWARDING_RULE_CREATION = 398684356; + + private static $valueToName = [ + self::UNDEFINED_MODE => 'UNDEFINED_MODE', + self::DELEGATION => 'DELEGATION', + self::EXTERNAL_IPV6_FORWARDING_RULE_CREATION => 'EXTERNAL_IPV6_FORWARDING_RULE_CREATION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Mode::class, \Google\Cloud\Compute\V1\PublicDelegatedPrefixPublicDelegatedSubPrefix_Mode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixPublicDelegatedSubPrefix/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixPublicDelegatedSubPrefix/Status.php new file mode 100644 index 000000000000..3c6fa0bbe18b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixPublicDelegatedSubPrefix/Status.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * Generated from protobuf enum ACTIVE = 314733318; + */ + const ACTIVE = 314733318; + /** + * Generated from protobuf enum INACTIVE = 270421099; + */ + const INACTIVE = 270421099; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::ACTIVE => 'ACTIVE', + self::INACTIVE => 'INACTIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\PublicDelegatedPrefixPublicDelegatedSubPrefix_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixesScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixesScopedList.php new file mode 100644 index 000000000000..afea79b56c0d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PublicDelegatedPrefixesScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.PublicDelegatedPrefixesScopedList + */ +class PublicDelegatedPrefixesScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A list of PublicDelegatedPrefixes contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PublicDelegatedPrefix public_delegated_prefixes = 315261206; + */ + private $public_delegated_prefixes; + /** + * [Output Only] Informational warning which replaces the list of public delegated prefixes when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\PublicDelegatedPrefix>|\Google\Protobuf\Internal\RepeatedField $public_delegated_prefixes + * [Output Only] A list of PublicDelegatedPrefixes contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] Informational warning which replaces the list of public delegated prefixes 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 PublicDelegatedPrefixes contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PublicDelegatedPrefix public_delegated_prefixes = 315261206; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPublicDelegatedPrefixes() + { + return $this->public_delegated_prefixes; + } + + /** + * [Output Only] A list of PublicDelegatedPrefixes contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PublicDelegatedPrefix public_delegated_prefixes = 315261206; + * @param array<\Google\Cloud\Compute\V1\PublicDelegatedPrefix>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPublicDelegatedPrefixes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PublicDelegatedPrefix::class); + $this->public_delegated_prefixes = $arr; + + return $this; + } + + /** + * [Output Only] Informational warning which replaces the list of public delegated prefixes 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] Informational warning which replaces the list of public delegated prefixes 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Quota.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Quota.php new file mode 100644 index 000000000000..0d72201cecde --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Quota.php @@ -0,0 +1,213 @@ +google.cloud.compute.v1.Quota + */ +class Quota extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Quota limit for this metric. + * + * Generated from protobuf field optional double limit = 102976443; + */ + protected $limit = null; + /** + * [Output Only] Name of the quota metric. + * Check the Metric enum for the list of possible values. + * + * Generated from protobuf field optional string metric = 533067184; + */ + protected $metric = null; + /** + * [Output Only] Owning resource. This is the resource on which this quota is applied. + * + * Generated from protobuf field optional string owner = 106164915; + */ + protected $owner = null; + /** + * [Output Only] Current usage of this metric. + * + * Generated from protobuf field optional double usage = 111574433; + */ + protected $usage = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $limit + * [Output Only] Quota limit for this metric. + * @type string $metric + * [Output Only] Name of the quota metric. + * Check the Metric enum for the list of possible values. + * @type string $owner + * [Output Only] Owning resource. This is the resource on which this quota is applied. + * @type float $usage + * [Output Only] Current usage of this metric. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Quota limit for this metric. + * + * Generated from protobuf field optional double limit = 102976443; + * @return float + */ + public function getLimit() + { + return isset($this->limit) ? $this->limit : 0.0; + } + + public function hasLimit() + { + return isset($this->limit); + } + + public function clearLimit() + { + unset($this->limit); + } + + /** + * [Output Only] Quota limit for this metric. + * + * Generated from protobuf field optional double limit = 102976443; + * @param float $var + * @return $this + */ + public function setLimit($var) + { + GPBUtil::checkDouble($var); + $this->limit = $var; + + return $this; + } + + /** + * [Output Only] Name of the quota metric. + * Check the Metric enum for the list of possible values. + * + * Generated from protobuf field optional string metric = 533067184; + * @return string + */ + public function getMetric() + { + return isset($this->metric) ? $this->metric : ''; + } + + public function hasMetric() + { + return isset($this->metric); + } + + public function clearMetric() + { + unset($this->metric); + } + + /** + * [Output Only] Name of the quota metric. + * Check the Metric enum for the list of possible values. + * + * Generated from protobuf field optional string metric = 533067184; + * @param string $var + * @return $this + */ + public function setMetric($var) + { + GPBUtil::checkString($var, True); + $this->metric = $var; + + return $this; + } + + /** + * [Output Only] Owning resource. This is the resource on which this quota is applied. + * + * Generated from protobuf field optional string owner = 106164915; + * @return string + */ + public function getOwner() + { + return isset($this->owner) ? $this->owner : ''; + } + + public function hasOwner() + { + return isset($this->owner); + } + + public function clearOwner() + { + unset($this->owner); + } + + /** + * [Output Only] Owning resource. This is the resource on which this quota is applied. + * + * Generated from protobuf field optional string owner = 106164915; + * @param string $var + * @return $this + */ + public function setOwner($var) + { + GPBUtil::checkString($var, True); + $this->owner = $var; + + return $this; + } + + /** + * [Output Only] Current usage of this metric. + * + * Generated from protobuf field optional double usage = 111574433; + * @return float + */ + public function getUsage() + { + return isset($this->usage) ? $this->usage : 0.0; + } + + public function hasUsage() + { + return isset($this->usage); + } + + public function clearUsage() + { + unset($this->usage); + } + + /** + * [Output Only] Current usage of this metric. + * + * Generated from protobuf field optional double usage = 111574433; + * @param float $var + * @return $this + */ + public function setUsage($var) + { + GPBUtil::checkDouble($var); + $this->usage = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Quota/Metric.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Quota/Metric.php new file mode 100644 index 000000000000..62224e8f944b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Quota/Metric.php @@ -0,0 +1,869 @@ +google.cloud.compute.v1.Quota.Metric + */ +class Metric +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_METRIC = 0; + */ + const UNDEFINED_METRIC = 0; + /** + * Generated from protobuf enum A2_CPUS = 153206585; + */ + const A2_CPUS = 153206585; + /** + * Generated from protobuf enum AFFINITY_GROUPS = 108303563; + */ + const AFFINITY_GROUPS = 108303563; + /** + * Generated from protobuf enum AUTOSCALERS = 471248988; + */ + const AUTOSCALERS = 471248988; + /** + * Generated from protobuf enum BACKEND_BUCKETS = 137626846; + */ + const BACKEND_BUCKETS = 137626846; + /** + * Generated from protobuf enum BACKEND_SERVICES = 269623753; + */ + const BACKEND_SERVICES = 269623753; + /** + * Generated from protobuf enum C2D_CPUS = 508182517; + */ + const C2D_CPUS = 508182517; + /** + * Generated from protobuf enum C2_CPUS = 317601211; + */ + const C2_CPUS = 317601211; + /** + * Generated from protobuf enum C3_CPUS = 346230362; + */ + const C3_CPUS = 346230362; + /** + * Generated from protobuf enum COMMITMENTS = 456141790; + */ + const COMMITMENTS = 456141790; + /** + * Generated from protobuf enum COMMITTED_A2_CPUS = 59330902; + */ + const COMMITTED_A2_CPUS = 59330902; + /** + * Generated from protobuf enum COMMITTED_C2D_CPUS = 282390904; + */ + const COMMITTED_C2D_CPUS = 282390904; + /** + * Generated from protobuf enum COMMITTED_C2_CPUS = 223725528; + */ + const COMMITTED_C2_CPUS = 223725528; + /** + * Generated from protobuf enum COMMITTED_C3_CPUS = 252354679; + */ + const COMMITTED_C3_CPUS = 252354679; + /** + * Generated from protobuf enum COMMITTED_CPUS = 292394702; + */ + const COMMITTED_CPUS = 292394702; + /** + * Generated from protobuf enum COMMITTED_E2_CPUS = 388120154; + */ + const COMMITTED_E2_CPUS = 388120154; + /** + * Generated from protobuf enum COMMITTED_LICENSES = 357606869; + */ + const COMMITTED_LICENSES = 357606869; + /** + * Generated from protobuf enum COMMITTED_LOCAL_SSD_TOTAL_GB = 308393480; + */ + const COMMITTED_LOCAL_SSD_TOTAL_GB = 308393480; + /** + * Generated from protobuf enum COMMITTED_M3_CPUS = 585985; + */ + const COMMITTED_M3_CPUS = 585985; + /** + * Generated from protobuf enum COMMITTED_MEMORY_OPTIMIZED_CPUS = 489057886; + */ + const COMMITTED_MEMORY_OPTIMIZED_CPUS = 489057886; + /** + * Generated from protobuf enum COMMITTED_N2A_CPUS = 40064304; + */ + const COMMITTED_N2A_CPUS = 40064304; + /** + * Generated from protobuf enum COMMITTED_N2D_CPUS = 125951757; + */ + const COMMITTED_N2D_CPUS = 125951757; + /** + * Generated from protobuf enum COMMITTED_N2_CPUS = 322589603; + */ + const COMMITTED_N2_CPUS = 322589603; + /** + * Generated from protobuf enum COMMITTED_NVIDIA_A100_80GB_GPUS = 464326565; + */ + const COMMITTED_NVIDIA_A100_80GB_GPUS = 464326565; + /** + * Generated from protobuf enum COMMITTED_NVIDIA_A100_GPUS = 375799445; + */ + const COMMITTED_NVIDIA_A100_GPUS = 375799445; + /** + * Generated from protobuf enum COMMITTED_NVIDIA_H100_GPUS = 71649180; + */ + const COMMITTED_NVIDIA_H100_GPUS = 71649180; + /** + * Generated from protobuf enum COMMITTED_NVIDIA_K80_GPUS = 3857188; + */ + const COMMITTED_NVIDIA_K80_GPUS = 3857188; + /** + * Generated from protobuf enum COMMITTED_NVIDIA_L4_GPUS = 19163645; + */ + const COMMITTED_NVIDIA_L4_GPUS = 19163645; + /** + * Generated from protobuf enum COMMITTED_NVIDIA_P100_GPUS = 107528100; + */ + const COMMITTED_NVIDIA_P100_GPUS = 107528100; + /** + * Generated from protobuf enum COMMITTED_NVIDIA_P4_GPUS = 347952897; + */ + const COMMITTED_NVIDIA_P4_GPUS = 347952897; + /** + * Generated from protobuf enum COMMITTED_NVIDIA_T4_GPUS = 139871237; + */ + const COMMITTED_NVIDIA_T4_GPUS = 139871237; + /** + * Generated from protobuf enum COMMITTED_NVIDIA_V100_GPUS = 219562; + */ + const COMMITTED_NVIDIA_V100_GPUS = 219562; + /** + * Generated from protobuf enum COMMITTED_T2A_CPUS = 296378986; + */ + const COMMITTED_T2A_CPUS = 296378986; + /** + * Generated from protobuf enum COMMITTED_T2D_CPUS = 382266439; + */ + const COMMITTED_T2D_CPUS = 382266439; + /** + * Generated from protobuf enum COMMITTED_Z3_CPUS = 263844686; + */ + const COMMITTED_Z3_CPUS = 263844686; + /** + * Guest CPUs + * + * Generated from protobuf enum CPUS = 2075595; + */ + const CPUS = 2075595; + /** + * Generated from protobuf enum CPUS_ALL_REGIONS = 470911149; + */ + const CPUS_ALL_REGIONS = 470911149; + /** + * Generated from protobuf enum DISKS_TOTAL_GB = 353520543; + */ + const DISKS_TOTAL_GB = 353520543; + /** + * Generated from protobuf enum E2_CPUS = 481995837; + */ + const E2_CPUS = 481995837; + /** + * Generated from protobuf enum EXTERNAL_MANAGED_FORWARDING_RULES = 150790089; + */ + const EXTERNAL_MANAGED_FORWARDING_RULES = 150790089; + /** + * Generated from protobuf enum EXTERNAL_NETWORK_LB_FORWARDING_RULES = 374298265; + */ + const EXTERNAL_NETWORK_LB_FORWARDING_RULES = 374298265; + /** + * Generated from protobuf enum EXTERNAL_PROTOCOL_FORWARDING_RULES = 63478888; + */ + const EXTERNAL_PROTOCOL_FORWARDING_RULES = 63478888; + /** + * Generated from protobuf enum EXTERNAL_VPN_GATEWAYS = 272457134; + */ + const EXTERNAL_VPN_GATEWAYS = 272457134; + /** + * Generated from protobuf enum FIREWALLS = 374485843; + */ + const FIREWALLS = 374485843; + /** + * Generated from protobuf enum FORWARDING_RULES = 432668949; + */ + const FORWARDING_RULES = 432668949; + /** + * Generated from protobuf enum GLOBAL_EXTERNAL_MANAGED_BACKEND_SERVICES = 164566753; + */ + const GLOBAL_EXTERNAL_MANAGED_BACKEND_SERVICES = 164566753; + /** + * Generated from protobuf enum GLOBAL_EXTERNAL_MANAGED_FORWARDING_RULES = 327611949; + */ + const GLOBAL_EXTERNAL_MANAGED_FORWARDING_RULES = 327611949; + /** + * Generated from protobuf enum GLOBAL_EXTERNAL_PROXY_LB_BACKEND_SERVICES = 400256169; + */ + const GLOBAL_EXTERNAL_PROXY_LB_BACKEND_SERVICES = 400256169; + /** + * Generated from protobuf enum GLOBAL_INTERNAL_ADDRESSES = 42738332; + */ + const GLOBAL_INTERNAL_ADDRESSES = 42738332; + /** + * Generated from protobuf enum GLOBAL_INTERNAL_MANAGED_BACKEND_SERVICES = 256608303; + */ + const GLOBAL_INTERNAL_MANAGED_BACKEND_SERVICES = 256608303; + /** + * Generated from protobuf enum GLOBAL_INTERNAL_TRAFFIC_DIRECTOR_BACKEND_SERVICES = 323514196; + */ + const GLOBAL_INTERNAL_TRAFFIC_DIRECTOR_BACKEND_SERVICES = 323514196; + /** + * Generated from protobuf enum GPUS_ALL_REGIONS = 39387177; + */ + const GPUS_ALL_REGIONS = 39387177; + /** + * Generated from protobuf enum HDB_TOTAL_GB = 319316271; + */ + const HDB_TOTAL_GB = 319316271; + /** + * Generated from protobuf enum HDB_TOTAL_IOPS = 309720317; + */ + const HDB_TOTAL_IOPS = 309720317; + /** + * Generated from protobuf enum HDB_TOTAL_THROUGHPUT = 20981374; + */ + const HDB_TOTAL_THROUGHPUT = 20981374; + /** + * Generated from protobuf enum HEALTH_CHECKS = 289347502; + */ + const HEALTH_CHECKS = 289347502; + /** + * Generated from protobuf enum IMAGES = 15562360; + */ + const IMAGES = 15562360; + /** + * Generated from protobuf enum INSTANCES = 131337822; + */ + const INSTANCES = 131337822; + /** + * Generated from protobuf enum INSTANCE_GROUPS = 355919038; + */ + const INSTANCE_GROUPS = 355919038; + /** + * Generated from protobuf enum INSTANCE_GROUP_MANAGERS = 101798192; + */ + const INSTANCE_GROUP_MANAGERS = 101798192; + /** + * Generated from protobuf enum INSTANCE_TEMPLATES = 226188271; + */ + const INSTANCE_TEMPLATES = 226188271; + /** + * Generated from protobuf enum INTERCONNECTS = 415204741; + */ + const INTERCONNECTS = 415204741; + /** + * Generated from protobuf enum INTERCONNECT_ATTACHMENTS_PER_REGION = 159968086; + */ + const INTERCONNECT_ATTACHMENTS_PER_REGION = 159968086; + /** + * Generated from protobuf enum INTERCONNECT_ATTACHMENTS_TOTAL_MBPS = 425090419; + */ + const INTERCONNECT_ATTACHMENTS_TOTAL_MBPS = 425090419; + /** + * Generated from protobuf enum INTERCONNECT_TOTAL_GBPS = 285341866; + */ + const INTERCONNECT_TOTAL_GBPS = 285341866; + /** + * Generated from protobuf enum INTERNAL_ADDRESSES = 197899392; + */ + const INTERNAL_ADDRESSES = 197899392; + /** + * Generated from protobuf enum INTERNAL_TRAFFIC_DIRECTOR_FORWARDING_RULES = 266433668; + */ + const INTERNAL_TRAFFIC_DIRECTOR_FORWARDING_RULES = 266433668; + /** + * Generated from protobuf enum IN_PLACE_SNAPSHOTS = 151359133; + */ + const IN_PLACE_SNAPSHOTS = 151359133; + /** + * Generated from protobuf enum IN_USE_ADDRESSES = 402125072; + */ + const IN_USE_ADDRESSES = 402125072; + /** + * Generated from protobuf enum IN_USE_BACKUP_SCHEDULES = 32786705; + */ + const IN_USE_BACKUP_SCHEDULES = 32786705; + /** + * Generated from protobuf enum IN_USE_SNAPSHOT_SCHEDULES = 462104083; + */ + const IN_USE_SNAPSHOT_SCHEDULES = 462104083; + /** + * Generated from protobuf enum LOCAL_SSD_TOTAL_GB = 330878021; + */ + const LOCAL_SSD_TOTAL_GB = 330878021; + /** + * Generated from protobuf enum M1_CPUS = 37203366; + */ + const M1_CPUS = 37203366; + /** + * Generated from protobuf enum M2_CPUS = 65832517; + */ + const M2_CPUS = 65832517; + /** + * Generated from protobuf enum M3_CPUS = 94461668; + */ + const M3_CPUS = 94461668; + /** + * Generated from protobuf enum MACHINE_IMAGES = 446986640; + */ + const MACHINE_IMAGES = 446986640; + /** + * Generated from protobuf enum N2A_CPUS = 265855917; + */ + const N2A_CPUS = 265855917; + /** + * Generated from protobuf enum N2D_CPUS = 351743370; + */ + const N2D_CPUS = 351743370; + /** + * Generated from protobuf enum N2_CPUS = 416465286; + */ + const N2_CPUS = 416465286; + /** + * 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; + */ + const NETWORK_ENDPOINT_GROUPS = 102144909; + /** + * Generated from protobuf enum NETWORK_FIREWALL_POLICIES = 101117374; + */ + const NETWORK_FIREWALL_POLICIES = 101117374; + /** + * Generated from protobuf enum NET_LB_SECURITY_POLICIES_PER_REGION = 157892269; + */ + const NET_LB_SECURITY_POLICIES_PER_REGION = 157892269; + /** + * Generated from protobuf enum NET_LB_SECURITY_POLICY_RULES_PER_REGION = 356090931; + */ + const NET_LB_SECURITY_POLICY_RULES_PER_REGION = 356090931; + /** + * Generated from protobuf enum NET_LB_SECURITY_POLICY_RULE_ATTRIBUTES_PER_REGION = 311243888; + */ + const NET_LB_SECURITY_POLICY_RULE_ATTRIBUTES_PER_REGION = 311243888; + /** + * Generated from protobuf enum NODE_GROUPS = 24624817; + */ + const NODE_GROUPS = 24624817; + /** + * Generated from protobuf enum NODE_TEMPLATES = 474896668; + */ + const NODE_TEMPLATES = 474896668; + /** + * Generated from protobuf enum NVIDIA_A100_80GB_GPUS = 286389320; + */ + const NVIDIA_A100_80GB_GPUS = 286389320; + /** + * Generated from protobuf enum NVIDIA_A100_GPUS = 504872978; + */ + const NVIDIA_A100_GPUS = 504872978; + /** + * Generated from protobuf enum NVIDIA_K80_GPUS = 163886599; + */ + const NVIDIA_K80_GPUS = 163886599; + /** + * Generated from protobuf enum NVIDIA_L4_GPUS = 491923130; + */ + const NVIDIA_L4_GPUS = 491923130; + /** + * Generated from protobuf enum NVIDIA_P100_GPUS = 236601633; + */ + const NVIDIA_P100_GPUS = 236601633; + /** + * Generated from protobuf enum NVIDIA_P100_VWS_GPUS = 213970574; + */ + const NVIDIA_P100_VWS_GPUS = 213970574; + /** + * Generated from protobuf enum NVIDIA_P4_GPUS = 283841470; + */ + const NVIDIA_P4_GPUS = 283841470; + /** + * Generated from protobuf enum NVIDIA_P4_VWS_GPUS = 528296619; + */ + const NVIDIA_P4_VWS_GPUS = 528296619; + /** + * Generated from protobuf enum NVIDIA_T4_GPUS = 75759810; + */ + const NVIDIA_T4_GPUS = 75759810; + /** + * Generated from protobuf enum NVIDIA_T4_VWS_GPUS = 319813039; + */ + const NVIDIA_T4_VWS_GPUS = 319813039; + /** + * Generated from protobuf enum NVIDIA_V100_GPUS = 129293095; + */ + const NVIDIA_V100_GPUS = 129293095; + /** + * Generated from protobuf enum PACKET_MIRRORINGS = 15578407; + */ + const PACKET_MIRRORINGS = 15578407; + /** + * Generated from protobuf enum PD_EXTREME_TOTAL_PROVISIONED_IOPS = 69593965; + */ + const PD_EXTREME_TOTAL_PROVISIONED_IOPS = 69593965; + /** + * Generated from protobuf enum PREEMPTIBLE_CPUS = 251184841; + */ + const PREEMPTIBLE_CPUS = 251184841; + /** + * Generated from protobuf enum PREEMPTIBLE_LOCAL_SSD_GB = 260819336; + */ + const PREEMPTIBLE_LOCAL_SSD_GB = 260819336; + /** + * Generated from protobuf enum PREEMPTIBLE_NVIDIA_A100_80GB_GPUS = 151942410; + */ + const PREEMPTIBLE_NVIDIA_A100_80GB_GPUS = 151942410; + /** + * Generated from protobuf enum PREEMPTIBLE_NVIDIA_A100_GPUS = 68832784; + */ + const PREEMPTIBLE_NVIDIA_A100_GPUS = 68832784; + /** + * Generated from protobuf enum PREEMPTIBLE_NVIDIA_H100_GPUS = 301553431; + */ + const PREEMPTIBLE_NVIDIA_H100_GPUS = 301553431; + /** + * Generated from protobuf enum PREEMPTIBLE_NVIDIA_K80_GPUS = 374960201; + */ + const PREEMPTIBLE_NVIDIA_K80_GPUS = 374960201; + /** + * Generated from protobuf enum PREEMPTIBLE_NVIDIA_L4_GPUS = 100408376; + */ + const PREEMPTIBLE_NVIDIA_L4_GPUS = 100408376; + /** + * Generated from protobuf enum PREEMPTIBLE_NVIDIA_P100_GPUS = 337432351; + */ + const PREEMPTIBLE_NVIDIA_P100_GPUS = 337432351; + /** + * Generated from protobuf enum PREEMPTIBLE_NVIDIA_P100_VWS_GPUS = 313544076; + */ + const PREEMPTIBLE_NVIDIA_P100_VWS_GPUS = 313544076; + /** + * Generated from protobuf enum PREEMPTIBLE_NVIDIA_P4_GPUS = 429197628; + */ + const PREEMPTIBLE_NVIDIA_P4_GPUS = 429197628; + /** + * Generated from protobuf enum PREEMPTIBLE_NVIDIA_P4_VWS_GPUS = 252981545; + */ + const PREEMPTIBLE_NVIDIA_P4_VWS_GPUS = 252981545; + /** + * Generated from protobuf enum PREEMPTIBLE_NVIDIA_T4_GPUS = 221115968; + */ + const PREEMPTIBLE_NVIDIA_T4_GPUS = 221115968; + /** + * Generated from protobuf enum PREEMPTIBLE_NVIDIA_T4_VWS_GPUS = 44497965; + */ + const PREEMPTIBLE_NVIDIA_T4_VWS_GPUS = 44497965; + /** + * Generated from protobuf enum PREEMPTIBLE_NVIDIA_V100_GPUS = 230123813; + */ + const PREEMPTIBLE_NVIDIA_V100_GPUS = 230123813; + /** + * Generated from protobuf enum PREEMPTIBLE_TPU_LITE_DEVICE_V5 = 174262523; + */ + const PREEMPTIBLE_TPU_LITE_DEVICE_V5 = 174262523; + /** + * Generated from protobuf enum PREEMPTIBLE_TPU_LITE_PODSLICE_V5 = 112281796; + */ + const PREEMPTIBLE_TPU_LITE_PODSLICE_V5 = 112281796; + /** + * Generated from protobuf enum PREEMPTIBLE_TPU_PODSLICE_V4 = 425541132; + */ + const PREEMPTIBLE_TPU_PODSLICE_V4 = 425541132; + /** + * Generated from protobuf enum PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK = 231164291; + */ + const PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK = 231164291; + /** + * Generated from protobuf enum PSC_INTERNAL_LB_FORWARDING_RULES = 169005435; + */ + const PSC_INTERNAL_LB_FORWARDING_RULES = 169005435; + /** + * Generated from protobuf enum PUBLIC_ADVERTISED_PREFIXES = 471371980; + */ + const PUBLIC_ADVERTISED_PREFIXES = 471371980; + /** + * Generated from protobuf enum PUBLIC_DELEGATED_PREFIXES = 532465974; + */ + const PUBLIC_DELEGATED_PREFIXES = 532465974; + /** + * Generated from protobuf enum REGIONAL_AUTOSCALERS = 29363772; + */ + const REGIONAL_AUTOSCALERS = 29363772; + /** + * Generated from protobuf enum REGIONAL_EXTERNAL_MANAGED_BACKEND_SERVICES = 4240989; + */ + const REGIONAL_EXTERNAL_MANAGED_BACKEND_SERVICES = 4240989; + /** + * Generated from protobuf enum REGIONAL_EXTERNAL_NETWORK_LB_BACKEND_SERVICES = 409564525; + */ + const REGIONAL_EXTERNAL_NETWORK_LB_BACKEND_SERVICES = 409564525; + /** + * Generated from protobuf enum REGIONAL_INSTANCE_GROUP_MANAGERS = 37543696; + */ + const REGIONAL_INSTANCE_GROUP_MANAGERS = 37543696; + /** + * Generated from protobuf enum REGIONAL_INTERNAL_LB_BACKEND_SERVICES = 137983760; + */ + const REGIONAL_INTERNAL_LB_BACKEND_SERVICES = 137983760; + /** + * Generated from protobuf enum REGIONAL_INTERNAL_MANAGED_BACKEND_SERVICES = 96282539; + */ + const REGIONAL_INTERNAL_MANAGED_BACKEND_SERVICES = 96282539; + /** + * Generated from protobuf enum REGIONAL_INTERNAL_TRAFFIC_DIRECTOR_BACKEND_SERVICES = 483162968; + */ + const REGIONAL_INTERNAL_TRAFFIC_DIRECTOR_BACKEND_SERVICES = 483162968; + /** + * Generated from protobuf enum RESERVATIONS = 32644647; + */ + const RESERVATIONS = 32644647; + /** + * Generated from protobuf enum RESOURCE_POLICIES = 83955297; + */ + const RESOURCE_POLICIES = 83955297; + /** + * Generated from protobuf enum ROUTERS = 493018666; + */ + const ROUTERS = 493018666; + /** + * Generated from protobuf enum ROUTES = 275680074; + */ + const ROUTES = 275680074; + /** + * Generated from protobuf enum SECURITY_POLICIES = 189518703; + */ + const SECURITY_POLICIES = 189518703; + /** + * Generated from protobuf enum SECURITY_POLICIES_PER_REGION = 249041734; + */ + const SECURITY_POLICIES_PER_REGION = 249041734; + /** + * Generated from protobuf enum SECURITY_POLICY_ADVANCED_RULES_PER_REGION = 371815341; + */ + const SECURITY_POLICY_ADVANCED_RULES_PER_REGION = 371815341; + /** + * Generated from protobuf enum SECURITY_POLICY_CEVAL_RULES = 470815689; + */ + const SECURITY_POLICY_CEVAL_RULES = 470815689; + /** + * Generated from protobuf enum SECURITY_POLICY_RULES = 203549225; + */ + const SECURITY_POLICY_RULES = 203549225; + /** + * Generated from protobuf enum SECURITY_POLICY_RULES_PER_REGION = 126510156; + */ + const SECURITY_POLICY_RULES_PER_REGION = 126510156; + /** + * Generated from protobuf enum SERVICE_ATTACHMENTS = 471521510; + */ + const SERVICE_ATTACHMENTS = 471521510; + /** + * The total number of snapshots allowed for a single project. + * + * Generated from protobuf enum SNAPSHOTS = 343405327; + */ + const SNAPSHOTS = 343405327; + /** + * Generated from protobuf enum SSD_TOTAL_GB = 161732561; + */ + const SSD_TOTAL_GB = 161732561; + /** + * Generated from protobuf enum SSL_CERTIFICATES = 378372399; + */ + const SSL_CERTIFICATES = 378372399; + /** + * Generated from protobuf enum SSL_POLICIES = 523254339; + */ + const SSL_POLICIES = 523254339; + /** + * Generated from protobuf enum STATIC_ADDRESSES = 93624049; + */ + const STATIC_ADDRESSES = 93624049; + /** + * Generated from protobuf enum STATIC_BYOIP_ADDRESSES = 275809649; + */ + const STATIC_BYOIP_ADDRESSES = 275809649; + /** + * Generated from protobuf enum STATIC_EXTERNAL_IPV6_ADDRESS_RANGES = 472346774; + */ + const STATIC_EXTERNAL_IPV6_ADDRESS_RANGES = 472346774; + /** + * Generated from protobuf enum SUBNETWORKS = 421330469; + */ + const SUBNETWORKS = 421330469; + /** + * Generated from protobuf enum T2A_CPUS = 522170599; + */ + const T2A_CPUS = 522170599; + /** + * Generated from protobuf enum T2D_CPUS = 71187140; + */ + const T2D_CPUS = 71187140; + /** + * Generated from protobuf enum TARGET_HTTPS_PROXIES = 219522506; + */ + const TARGET_HTTPS_PROXIES = 219522506; + /** + * Generated from protobuf enum TARGET_HTTP_PROXIES = 164117155; + */ + const TARGET_HTTP_PROXIES = 164117155; + /** + * Generated from protobuf enum TARGET_INSTANCES = 284519728; + */ + const TARGET_INSTANCES = 284519728; + /** + * Generated from protobuf enum TARGET_POOLS = 348261257; + */ + const TARGET_POOLS = 348261257; + /** + * Generated from protobuf enum TARGET_SSL_PROXIES = 159216235; + */ + const TARGET_SSL_PROXIES = 159216235; + /** + * Generated from protobuf enum TARGET_TCP_PROXIES = 182243136; + */ + const TARGET_TCP_PROXIES = 182243136; + /** + * Generated from protobuf enum TARGET_VPN_GATEWAYS = 75029928; + */ + const TARGET_VPN_GATEWAYS = 75029928; + /** + * Generated from protobuf enum TPU_LITE_DEVICE_V5 = 449577597; + */ + const TPU_LITE_DEVICE_V5 = 449577597; + /** + * Generated from protobuf enum TPU_LITE_PODSLICE_V5 = 12708294; + */ + const TPU_LITE_PODSLICE_V5 = 12708294; + /** + * Generated from protobuf enum TPU_PODSLICE_V4 = 214467530; + */ + const TPU_PODSLICE_V4 = 214467530; + /** + * Generated from protobuf enum URL_MAPS = 378660743; + */ + const URL_MAPS = 378660743; + /** + * Generated from protobuf enum VPN_GATEWAYS = 35620282; + */ + const VPN_GATEWAYS = 35620282; + /** + * Generated from protobuf enum VPN_TUNNELS = 104327296; + */ + const VPN_TUNNELS = 104327296; + /** + * Generated from protobuf enum XPN_SERVICE_PROJECTS = 95191981; + */ + const XPN_SERVICE_PROJECTS = 95191981; + + private static $valueToName = [ + self::UNDEFINED_METRIC => 'UNDEFINED_METRIC', + self::A2_CPUS => 'A2_CPUS', + self::AFFINITY_GROUPS => 'AFFINITY_GROUPS', + self::AUTOSCALERS => 'AUTOSCALERS', + self::BACKEND_BUCKETS => 'BACKEND_BUCKETS', + self::BACKEND_SERVICES => 'BACKEND_SERVICES', + self::C2D_CPUS => 'C2D_CPUS', + self::C2_CPUS => 'C2_CPUS', + self::C3_CPUS => 'C3_CPUS', + self::COMMITMENTS => 'COMMITMENTS', + self::COMMITTED_A2_CPUS => 'COMMITTED_A2_CPUS', + self::COMMITTED_C2D_CPUS => 'COMMITTED_C2D_CPUS', + self::COMMITTED_C2_CPUS => 'COMMITTED_C2_CPUS', + self::COMMITTED_C3_CPUS => 'COMMITTED_C3_CPUS', + self::COMMITTED_CPUS => 'COMMITTED_CPUS', + self::COMMITTED_E2_CPUS => 'COMMITTED_E2_CPUS', + self::COMMITTED_LICENSES => 'COMMITTED_LICENSES', + self::COMMITTED_LOCAL_SSD_TOTAL_GB => 'COMMITTED_LOCAL_SSD_TOTAL_GB', + self::COMMITTED_M3_CPUS => 'COMMITTED_M3_CPUS', + self::COMMITTED_MEMORY_OPTIMIZED_CPUS => 'COMMITTED_MEMORY_OPTIMIZED_CPUS', + self::COMMITTED_N2A_CPUS => 'COMMITTED_N2A_CPUS', + self::COMMITTED_N2D_CPUS => 'COMMITTED_N2D_CPUS', + self::COMMITTED_N2_CPUS => 'COMMITTED_N2_CPUS', + self::COMMITTED_NVIDIA_A100_80GB_GPUS => 'COMMITTED_NVIDIA_A100_80GB_GPUS', + self::COMMITTED_NVIDIA_A100_GPUS => 'COMMITTED_NVIDIA_A100_GPUS', + self::COMMITTED_NVIDIA_H100_GPUS => 'COMMITTED_NVIDIA_H100_GPUS', + self::COMMITTED_NVIDIA_K80_GPUS => 'COMMITTED_NVIDIA_K80_GPUS', + self::COMMITTED_NVIDIA_L4_GPUS => 'COMMITTED_NVIDIA_L4_GPUS', + self::COMMITTED_NVIDIA_P100_GPUS => 'COMMITTED_NVIDIA_P100_GPUS', + self::COMMITTED_NVIDIA_P4_GPUS => 'COMMITTED_NVIDIA_P4_GPUS', + self::COMMITTED_NVIDIA_T4_GPUS => 'COMMITTED_NVIDIA_T4_GPUS', + self::COMMITTED_NVIDIA_V100_GPUS => 'COMMITTED_NVIDIA_V100_GPUS', + self::COMMITTED_T2A_CPUS => 'COMMITTED_T2A_CPUS', + self::COMMITTED_T2D_CPUS => 'COMMITTED_T2D_CPUS', + self::COMMITTED_Z3_CPUS => 'COMMITTED_Z3_CPUS', + self::CPUS => 'CPUS', + self::CPUS_ALL_REGIONS => 'CPUS_ALL_REGIONS', + self::DISKS_TOTAL_GB => 'DISKS_TOTAL_GB', + self::E2_CPUS => 'E2_CPUS', + self::EXTERNAL_MANAGED_FORWARDING_RULES => 'EXTERNAL_MANAGED_FORWARDING_RULES', + self::EXTERNAL_NETWORK_LB_FORWARDING_RULES => 'EXTERNAL_NETWORK_LB_FORWARDING_RULES', + self::EXTERNAL_PROTOCOL_FORWARDING_RULES => 'EXTERNAL_PROTOCOL_FORWARDING_RULES', + self::EXTERNAL_VPN_GATEWAYS => 'EXTERNAL_VPN_GATEWAYS', + self::FIREWALLS => 'FIREWALLS', + self::FORWARDING_RULES => 'FORWARDING_RULES', + self::GLOBAL_EXTERNAL_MANAGED_BACKEND_SERVICES => 'GLOBAL_EXTERNAL_MANAGED_BACKEND_SERVICES', + self::GLOBAL_EXTERNAL_MANAGED_FORWARDING_RULES => 'GLOBAL_EXTERNAL_MANAGED_FORWARDING_RULES', + self::GLOBAL_EXTERNAL_PROXY_LB_BACKEND_SERVICES => 'GLOBAL_EXTERNAL_PROXY_LB_BACKEND_SERVICES', + self::GLOBAL_INTERNAL_ADDRESSES => 'GLOBAL_INTERNAL_ADDRESSES', + self::GLOBAL_INTERNAL_MANAGED_BACKEND_SERVICES => 'GLOBAL_INTERNAL_MANAGED_BACKEND_SERVICES', + self::GLOBAL_INTERNAL_TRAFFIC_DIRECTOR_BACKEND_SERVICES => 'GLOBAL_INTERNAL_TRAFFIC_DIRECTOR_BACKEND_SERVICES', + self::GPUS_ALL_REGIONS => 'GPUS_ALL_REGIONS', + self::HDB_TOTAL_GB => 'HDB_TOTAL_GB', + self::HDB_TOTAL_IOPS => 'HDB_TOTAL_IOPS', + self::HDB_TOTAL_THROUGHPUT => 'HDB_TOTAL_THROUGHPUT', + self::HEALTH_CHECKS => 'HEALTH_CHECKS', + self::IMAGES => 'IMAGES', + self::INSTANCES => 'INSTANCES', + self::INSTANCE_GROUPS => 'INSTANCE_GROUPS', + self::INSTANCE_GROUP_MANAGERS => 'INSTANCE_GROUP_MANAGERS', + self::INSTANCE_TEMPLATES => 'INSTANCE_TEMPLATES', + self::INTERCONNECTS => 'INTERCONNECTS', + self::INTERCONNECT_ATTACHMENTS_PER_REGION => 'INTERCONNECT_ATTACHMENTS_PER_REGION', + self::INTERCONNECT_ATTACHMENTS_TOTAL_MBPS => 'INTERCONNECT_ATTACHMENTS_TOTAL_MBPS', + self::INTERCONNECT_TOTAL_GBPS => 'INTERCONNECT_TOTAL_GBPS', + self::INTERNAL_ADDRESSES => 'INTERNAL_ADDRESSES', + self::INTERNAL_TRAFFIC_DIRECTOR_FORWARDING_RULES => 'INTERNAL_TRAFFIC_DIRECTOR_FORWARDING_RULES', + self::IN_PLACE_SNAPSHOTS => 'IN_PLACE_SNAPSHOTS', + self::IN_USE_ADDRESSES => 'IN_USE_ADDRESSES', + self::IN_USE_BACKUP_SCHEDULES => 'IN_USE_BACKUP_SCHEDULES', + self::IN_USE_SNAPSHOT_SCHEDULES => 'IN_USE_SNAPSHOT_SCHEDULES', + self::LOCAL_SSD_TOTAL_GB => 'LOCAL_SSD_TOTAL_GB', + self::M1_CPUS => 'M1_CPUS', + self::M2_CPUS => 'M2_CPUS', + self::M3_CPUS => 'M3_CPUS', + self::MACHINE_IMAGES => 'MACHINE_IMAGES', + self::N2A_CPUS => 'N2A_CPUS', + 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::NET_LB_SECURITY_POLICIES_PER_REGION => 'NET_LB_SECURITY_POLICIES_PER_REGION', + self::NET_LB_SECURITY_POLICY_RULES_PER_REGION => 'NET_LB_SECURITY_POLICY_RULES_PER_REGION', + self::NET_LB_SECURITY_POLICY_RULE_ATTRIBUTES_PER_REGION => 'NET_LB_SECURITY_POLICY_RULE_ATTRIBUTES_PER_REGION', + self::NODE_GROUPS => 'NODE_GROUPS', + self::NODE_TEMPLATES => 'NODE_TEMPLATES', + self::NVIDIA_A100_80GB_GPUS => 'NVIDIA_A100_80GB_GPUS', + self::NVIDIA_A100_GPUS => 'NVIDIA_A100_GPUS', + self::NVIDIA_K80_GPUS => 'NVIDIA_K80_GPUS', + self::NVIDIA_L4_GPUS => 'NVIDIA_L4_GPUS', + self::NVIDIA_P100_GPUS => 'NVIDIA_P100_GPUS', + self::NVIDIA_P100_VWS_GPUS => 'NVIDIA_P100_VWS_GPUS', + self::NVIDIA_P4_GPUS => 'NVIDIA_P4_GPUS', + self::NVIDIA_P4_VWS_GPUS => 'NVIDIA_P4_VWS_GPUS', + self::NVIDIA_T4_GPUS => 'NVIDIA_T4_GPUS', + self::NVIDIA_T4_VWS_GPUS => 'NVIDIA_T4_VWS_GPUS', + self::NVIDIA_V100_GPUS => 'NVIDIA_V100_GPUS', + self::PACKET_MIRRORINGS => 'PACKET_MIRRORINGS', + self::PD_EXTREME_TOTAL_PROVISIONED_IOPS => 'PD_EXTREME_TOTAL_PROVISIONED_IOPS', + self::PREEMPTIBLE_CPUS => 'PREEMPTIBLE_CPUS', + self::PREEMPTIBLE_LOCAL_SSD_GB => 'PREEMPTIBLE_LOCAL_SSD_GB', + self::PREEMPTIBLE_NVIDIA_A100_80GB_GPUS => 'PREEMPTIBLE_NVIDIA_A100_80GB_GPUS', + self::PREEMPTIBLE_NVIDIA_A100_GPUS => 'PREEMPTIBLE_NVIDIA_A100_GPUS', + self::PREEMPTIBLE_NVIDIA_H100_GPUS => 'PREEMPTIBLE_NVIDIA_H100_GPUS', + self::PREEMPTIBLE_NVIDIA_K80_GPUS => 'PREEMPTIBLE_NVIDIA_K80_GPUS', + self::PREEMPTIBLE_NVIDIA_L4_GPUS => 'PREEMPTIBLE_NVIDIA_L4_GPUS', + self::PREEMPTIBLE_NVIDIA_P100_GPUS => 'PREEMPTIBLE_NVIDIA_P100_GPUS', + self::PREEMPTIBLE_NVIDIA_P100_VWS_GPUS => 'PREEMPTIBLE_NVIDIA_P100_VWS_GPUS', + self::PREEMPTIBLE_NVIDIA_P4_GPUS => 'PREEMPTIBLE_NVIDIA_P4_GPUS', + self::PREEMPTIBLE_NVIDIA_P4_VWS_GPUS => 'PREEMPTIBLE_NVIDIA_P4_VWS_GPUS', + self::PREEMPTIBLE_NVIDIA_T4_GPUS => 'PREEMPTIBLE_NVIDIA_T4_GPUS', + self::PREEMPTIBLE_NVIDIA_T4_VWS_GPUS => 'PREEMPTIBLE_NVIDIA_T4_VWS_GPUS', + self::PREEMPTIBLE_NVIDIA_V100_GPUS => 'PREEMPTIBLE_NVIDIA_V100_GPUS', + self::PREEMPTIBLE_TPU_LITE_DEVICE_V5 => 'PREEMPTIBLE_TPU_LITE_DEVICE_V5', + self::PREEMPTIBLE_TPU_LITE_PODSLICE_V5 => 'PREEMPTIBLE_TPU_LITE_PODSLICE_V5', + self::PREEMPTIBLE_TPU_PODSLICE_V4 => 'PREEMPTIBLE_TPU_PODSLICE_V4', + self::PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK => 'PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK', + self::PSC_INTERNAL_LB_FORWARDING_RULES => 'PSC_INTERNAL_LB_FORWARDING_RULES', + self::PUBLIC_ADVERTISED_PREFIXES => 'PUBLIC_ADVERTISED_PREFIXES', + self::PUBLIC_DELEGATED_PREFIXES => 'PUBLIC_DELEGATED_PREFIXES', + self::REGIONAL_AUTOSCALERS => 'REGIONAL_AUTOSCALERS', + self::REGIONAL_EXTERNAL_MANAGED_BACKEND_SERVICES => 'REGIONAL_EXTERNAL_MANAGED_BACKEND_SERVICES', + self::REGIONAL_EXTERNAL_NETWORK_LB_BACKEND_SERVICES => 'REGIONAL_EXTERNAL_NETWORK_LB_BACKEND_SERVICES', + self::REGIONAL_INSTANCE_GROUP_MANAGERS => 'REGIONAL_INSTANCE_GROUP_MANAGERS', + self::REGIONAL_INTERNAL_LB_BACKEND_SERVICES => 'REGIONAL_INTERNAL_LB_BACKEND_SERVICES', + self::REGIONAL_INTERNAL_MANAGED_BACKEND_SERVICES => 'REGIONAL_INTERNAL_MANAGED_BACKEND_SERVICES', + self::REGIONAL_INTERNAL_TRAFFIC_DIRECTOR_BACKEND_SERVICES => 'REGIONAL_INTERNAL_TRAFFIC_DIRECTOR_BACKEND_SERVICES', + self::RESERVATIONS => 'RESERVATIONS', + self::RESOURCE_POLICIES => 'RESOURCE_POLICIES', + self::ROUTERS => 'ROUTERS', + self::ROUTES => 'ROUTES', + self::SECURITY_POLICIES => 'SECURITY_POLICIES', + self::SECURITY_POLICIES_PER_REGION => 'SECURITY_POLICIES_PER_REGION', + self::SECURITY_POLICY_ADVANCED_RULES_PER_REGION => 'SECURITY_POLICY_ADVANCED_RULES_PER_REGION', + self::SECURITY_POLICY_CEVAL_RULES => 'SECURITY_POLICY_CEVAL_RULES', + self::SECURITY_POLICY_RULES => 'SECURITY_POLICY_RULES', + self::SECURITY_POLICY_RULES_PER_REGION => 'SECURITY_POLICY_RULES_PER_REGION', + self::SERVICE_ATTACHMENTS => 'SERVICE_ATTACHMENTS', + self::SNAPSHOTS => 'SNAPSHOTS', + self::SSD_TOTAL_GB => 'SSD_TOTAL_GB', + self::SSL_CERTIFICATES => 'SSL_CERTIFICATES', + self::SSL_POLICIES => 'SSL_POLICIES', + self::STATIC_ADDRESSES => 'STATIC_ADDRESSES', + self::STATIC_BYOIP_ADDRESSES => 'STATIC_BYOIP_ADDRESSES', + self::STATIC_EXTERNAL_IPV6_ADDRESS_RANGES => 'STATIC_EXTERNAL_IPV6_ADDRESS_RANGES', + self::SUBNETWORKS => 'SUBNETWORKS', + self::T2A_CPUS => 'T2A_CPUS', + self::T2D_CPUS => 'T2D_CPUS', + self::TARGET_HTTPS_PROXIES => 'TARGET_HTTPS_PROXIES', + self::TARGET_HTTP_PROXIES => 'TARGET_HTTP_PROXIES', + self::TARGET_INSTANCES => 'TARGET_INSTANCES', + self::TARGET_POOLS => 'TARGET_POOLS', + self::TARGET_SSL_PROXIES => 'TARGET_SSL_PROXIES', + self::TARGET_TCP_PROXIES => 'TARGET_TCP_PROXIES', + self::TARGET_VPN_GATEWAYS => 'TARGET_VPN_GATEWAYS', + self::TPU_LITE_DEVICE_V5 => 'TPU_LITE_DEVICE_V5', + self::TPU_LITE_PODSLICE_V5 => 'TPU_LITE_PODSLICE_V5', + self::TPU_PODSLICE_V4 => 'TPU_PODSLICE_V4', + self::URL_MAPS => 'URL_MAPS', + self::VPN_GATEWAYS => 'VPN_GATEWAYS', + self::VPN_TUNNELS => 'VPN_TUNNELS', + self::XPN_SERVICE_PROJECTS => 'XPN_SERVICE_PROJECTS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Metric::class, \Google\Cloud\Compute\V1\Quota_Metric::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/QuotaExceededInfo.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/QuotaExceededInfo.php new file mode 100644 index 000000000000..874d78e3202a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/QuotaExceededInfo.php @@ -0,0 +1,291 @@ +google.cloud.compute.v1.QuotaExceededInfo + */ +class QuotaExceededInfo extends \Google\Protobuf\Internal\Message +{ + /** + * The map holding related quota dimensions. + * + * Generated from protobuf field map dimensions = 414334925; + */ + private $dimensions; + /** + * Future quota limit being rolled out. The limit's unit depends on the quota type or metric. + * + * Generated from protobuf field optional double future_limit = 456564287; + */ + protected $future_limit = null; + /** + * Current effective quota limit. The limit's unit depends on the quota type or metric. + * + * Generated from protobuf field optional double limit = 102976443; + */ + protected $limit = null; + /** + * The name of the quota limit. + * + * Generated from protobuf field optional string limit_name = 398197903; + */ + protected $limit_name = null; + /** + * The Compute Engine quota metric name. + * + * Generated from protobuf field optional string metric_name = 409881530; + */ + protected $metric_name = null; + /** + * Rollout status of the future quota limit. + * Check the RolloutStatus enum for the list of possible values. + * + * Generated from protobuf field optional string rollout_status = 476426816; + */ + protected $rollout_status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $dimensions + * The map holding related quota dimensions. + * @type float $future_limit + * Future quota limit being rolled out. The limit's unit depends on the quota type or metric. + * @type float $limit + * Current effective quota limit. The limit's unit depends on the quota type or metric. + * @type string $limit_name + * The name of the quota limit. + * @type string $metric_name + * The Compute Engine quota metric name. + * @type string $rollout_status + * Rollout status of the future quota limit. + * Check the RolloutStatus enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The map holding related quota dimensions. + * + * Generated from protobuf field map dimensions = 414334925; + * @return \Google\Protobuf\Internal\MapField + */ + public function getDimensions() + { + return $this->dimensions; + } + + /** + * The map holding related quota dimensions. + * + * Generated from protobuf field map dimensions = 414334925; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setDimensions($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->dimensions = $arr; + + return $this; + } + + /** + * Future quota limit being rolled out. The limit's unit depends on the quota type or metric. + * + * Generated from protobuf field optional double future_limit = 456564287; + * @return float + */ + public function getFutureLimit() + { + return isset($this->future_limit) ? $this->future_limit : 0.0; + } + + public function hasFutureLimit() + { + return isset($this->future_limit); + } + + public function clearFutureLimit() + { + unset($this->future_limit); + } + + /** + * Future quota limit being rolled out. The limit's unit depends on the quota type or metric. + * + * Generated from protobuf field optional double future_limit = 456564287; + * @param float $var + * @return $this + */ + public function setFutureLimit($var) + { + GPBUtil::checkDouble($var); + $this->future_limit = $var; + + return $this; + } + + /** + * Current effective quota limit. The limit's unit depends on the quota type or metric. + * + * Generated from protobuf field optional double limit = 102976443; + * @return float + */ + public function getLimit() + { + return isset($this->limit) ? $this->limit : 0.0; + } + + public function hasLimit() + { + return isset($this->limit); + } + + public function clearLimit() + { + unset($this->limit); + } + + /** + * Current effective quota limit. The limit's unit depends on the quota type or metric. + * + * Generated from protobuf field optional double limit = 102976443; + * @param float $var + * @return $this + */ + public function setLimit($var) + { + GPBUtil::checkDouble($var); + $this->limit = $var; + + return $this; + } + + /** + * The name of the quota limit. + * + * Generated from protobuf field optional string limit_name = 398197903; + * @return string + */ + public function getLimitName() + { + return isset($this->limit_name) ? $this->limit_name : ''; + } + + public function hasLimitName() + { + return isset($this->limit_name); + } + + public function clearLimitName() + { + unset($this->limit_name); + } + + /** + * The name of the quota limit. + * + * Generated from protobuf field optional string limit_name = 398197903; + * @param string $var + * @return $this + */ + public function setLimitName($var) + { + GPBUtil::checkString($var, True); + $this->limit_name = $var; + + return $this; + } + + /** + * The Compute Engine quota metric name. + * + * Generated from protobuf field optional string metric_name = 409881530; + * @return string + */ + public function getMetricName() + { + return isset($this->metric_name) ? $this->metric_name : ''; + } + + public function hasMetricName() + { + return isset($this->metric_name); + } + + public function clearMetricName() + { + unset($this->metric_name); + } + + /** + * The Compute Engine quota metric name. + * + * Generated from protobuf field optional string metric_name = 409881530; + * @param string $var + * @return $this + */ + public function setMetricName($var) + { + GPBUtil::checkString($var, True); + $this->metric_name = $var; + + return $this; + } + + /** + * Rollout status of the future quota limit. + * Check the RolloutStatus enum for the list of possible values. + * + * Generated from protobuf field optional string rollout_status = 476426816; + * @return string + */ + public function getRolloutStatus() + { + return isset($this->rollout_status) ? $this->rollout_status : ''; + } + + public function hasRolloutStatus() + { + return isset($this->rollout_status); + } + + public function clearRolloutStatus() + { + unset($this->rollout_status); + } + + /** + * Rollout status of the future quota limit. + * Check the RolloutStatus enum for the list of possible values. + * + * Generated from protobuf field optional string rollout_status = 476426816; + * @param string $var + * @return $this + */ + public function setRolloutStatus($var) + { + GPBUtil::checkString($var, True); + $this->rollout_status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/QuotaExceededInfo/RolloutStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/QuotaExceededInfo/RolloutStatus.php new file mode 100644 index 000000000000..bfe78670fb09 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/QuotaExceededInfo/RolloutStatus.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.QuotaExceededInfo.RolloutStatus + */ +class RolloutStatus +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ROLLOUT_STATUS = 0; + */ + const UNDEFINED_ROLLOUT_STATUS = 0; + /** + * IN_PROGRESS - A rollout is in process which will change the limit value to future limit. + * + * Generated from protobuf enum IN_PROGRESS = 469193735; + */ + const IN_PROGRESS = 469193735; + /** + * ROLLOUT_STATUS_UNSPECIFIED - Rollout status is not specified. The default value. + * + * Generated from protobuf enum ROLLOUT_STATUS_UNSPECIFIED = 26864568; + */ + const ROLLOUT_STATUS_UNSPECIFIED = 26864568; + + private static $valueToName = [ + self::UNDEFINED_ROLLOUT_STATUS => 'UNDEFINED_ROLLOUT_STATUS', + self::IN_PROGRESS => 'IN_PROGRESS', + self::ROLLOUT_STATUS_UNSPECIFIED => 'ROLLOUT_STATUS_UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RolloutStatus::class, \Google\Cloud\Compute\V1\QuotaExceededInfo_RolloutStatus::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/QuotaStatusWarning.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/QuotaStatusWarning.php new file mode 100644 index 000000000000..b81ed5ff0f6d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/QuotaStatusWarning.php @@ -0,0 +1,159 @@ +google.cloud.compute.v1.QuotaStatusWarning + */ +class QuotaStatusWarning extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + * Check the Code enum for the list of possible values. + * + * Generated from protobuf field optional string code = 3059181; + */ + protected $code = null; + /** + * [Output Only] Metadata about this warning in key: value format. For example: "data": [ { "key": "scope", "value": "zones/us-east1-d" } + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Data data = 3076010; + */ + private $data; + /** + * [Output Only] A human-readable description of the warning code. + * + * Generated from protobuf field optional string message = 418054151; + */ + protected $message = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $code + * [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + * Check the Code enum for the list of possible values. + * @type array<\Google\Cloud\Compute\V1\Data>|\Google\Protobuf\Internal\RepeatedField $data + * [Output Only] Metadata about this warning in key: value format. For example: "data": [ { "key": "scope", "value": "zones/us-east1-d" } + * @type string $message + * [Output Only] A human-readable description of the warning code. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + * Check the Code enum for the list of possible values. + * + * Generated from protobuf field optional string code = 3059181; + * @return string + */ + public function getCode() + { + return isset($this->code) ? $this->code : ''; + } + + public function hasCode() + { + return isset($this->code); + } + + public function clearCode() + { + unset($this->code); + } + + /** + * [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + * Check the Code enum for the list of possible values. + * + * Generated from protobuf field optional string code = 3059181; + * @param string $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkString($var, True); + $this->code = $var; + + return $this; + } + + /** + * [Output Only] Metadata about this warning in key: value format. For example: "data": [ { "key": "scope", "value": "zones/us-east1-d" } + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Data data = 3076010; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getData() + { + return $this->data; + } + + /** + * [Output Only] Metadata about this warning in key: value format. For example: "data": [ { "key": "scope", "value": "zones/us-east1-d" } + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Data data = 3076010; + * @param array<\Google\Cloud\Compute\V1\Data>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setData($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Data::class); + $this->data = $arr; + + return $this; + } + + /** + * [Output Only] A human-readable description of the warning code. + * + * Generated from protobuf field optional string message = 418054151; + * @return string + */ + public function getMessage() + { + return isset($this->message) ? $this->message : ''; + } + + public function hasMessage() + { + return isset($this->message); + } + + public function clearMessage() + { + unset($this->message); + } + + /** + * [Output Only] A human-readable description of the warning code. + * + * Generated from protobuf field optional string message = 418054151; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/QuotaStatusWarning/Code.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/QuotaStatusWarning/Code.php new file mode 100644 index 000000000000..b4cffefba0eb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/QuotaStatusWarning/Code.php @@ -0,0 +1,246 @@ +google.cloud.compute.v1.QuotaStatusWarning.Code + */ +class Code +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_CODE = 0; + */ + const UNDEFINED_CODE = 0; + /** + * Warning about failed cleanup of transient changes made by a failed operation. + * + * Generated from protobuf enum CLEANUP_FAILED = 150308440; + */ + const CLEANUP_FAILED = 150308440; + /** + * A link to a deprecated resource was created. + * + * Generated from protobuf enum DEPRECATED_RESOURCE_USED = 391835586; + */ + const DEPRECATED_RESOURCE_USED = 391835586; + /** + * When deploying and at least one of the resources has a type marked as deprecated + * + * Generated from protobuf enum DEPRECATED_TYPE_USED = 346526230; + */ + const DEPRECATED_TYPE_USED = 346526230; + /** + * The user created a boot disk that is larger than image size. + * + * Generated from protobuf enum DISK_SIZE_LARGER_THAN_IMAGE_SIZE = 369442967; + */ + const DISK_SIZE_LARGER_THAN_IMAGE_SIZE = 369442967; + /** + * When deploying and at least one of the resources has a type marked as experimental + * + * Generated from protobuf enum EXPERIMENTAL_TYPE_USED = 451954443; + */ + const EXPERIMENTAL_TYPE_USED = 451954443; + /** + * Warning that is present in an external api call + * + * Generated from protobuf enum EXTERNAL_API_WARNING = 175546307; + */ + const EXTERNAL_API_WARNING = 175546307; + /** + * Warning that value of a field has been overridden. Deprecated unused field. + * + * Generated from protobuf enum FIELD_VALUE_OVERRIDEN = 329669423; + */ + const FIELD_VALUE_OVERRIDEN = 329669423; + /** + * The operation involved use of an injected kernel, which is deprecated. + * + * Generated from protobuf enum INJECTED_KERNELS_DEPRECATED = 417377419; + */ + const INJECTED_KERNELS_DEPRECATED = 417377419; + /** + * A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2. + * + * Generated from protobuf enum INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB = 401542606; + */ + const INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB = 401542606; + /** + * When deploying a deployment with a exceedingly large number of resources + * + * Generated from protobuf enum LARGE_DEPLOYMENT_WARNING = 481440678; + */ + const LARGE_DEPLOYMENT_WARNING = 481440678; + /** + * Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter. + * + * Generated from protobuf enum LIST_OVERHEAD_QUOTA_EXCEED = 47618117; + */ + const LIST_OVERHEAD_QUOTA_EXCEED = 47618117; + /** + * A resource depends on a missing type + * + * Generated from protobuf enum MISSING_TYPE_DEPENDENCY = 344505463; + */ + const MISSING_TYPE_DEPENDENCY = 344505463; + /** + * The route's nextHopIp address is not assigned to an instance on the network. + * + * Generated from protobuf enum NEXT_HOP_ADDRESS_NOT_ASSIGNED = 324964999; + */ + const NEXT_HOP_ADDRESS_NOT_ASSIGNED = 324964999; + /** + * The route's next hop instance cannot ip forward. + * + * Generated from protobuf enum NEXT_HOP_CANNOT_IP_FORWARD = 383382887; + */ + const NEXT_HOP_CANNOT_IP_FORWARD = 383382887; + /** + * The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route. + * + * Generated from protobuf enum NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE = 146748434; + */ + const NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE = 146748434; + /** + * The route's nextHopInstance URL refers to an instance that does not exist. + * + * Generated from protobuf enum NEXT_HOP_INSTANCE_NOT_FOUND = 464250446; + */ + const NEXT_HOP_INSTANCE_NOT_FOUND = 464250446; + /** + * The route's nextHopInstance URL refers to an instance that is not on the same network as the route. + * + * Generated from protobuf enum NEXT_HOP_INSTANCE_NOT_ON_NETWORK = 243758146; + */ + const NEXT_HOP_INSTANCE_NOT_ON_NETWORK = 243758146; + /** + * The route's next hop instance does not have a status of RUNNING. + * + * Generated from protobuf enum NEXT_HOP_NOT_RUNNING = 417081265; + */ + const NEXT_HOP_NOT_RUNNING = 417081265; + /** + * Error which is not critical. We decided to continue the process despite the mentioned error. + * + * Generated from protobuf enum NOT_CRITICAL_ERROR = 105763924; + */ + const NOT_CRITICAL_ERROR = 105763924; + /** + * No results are present on a particular list page. + * + * Generated from protobuf enum NO_RESULTS_ON_PAGE = 30036744; + */ + const NO_RESULTS_ON_PAGE = 30036744; + /** + * Success is reported, but some results may be missing due to errors + * + * Generated from protobuf enum PARTIAL_SUCCESS = 39966469; + */ + const PARTIAL_SUCCESS = 39966469; + /** + * The user attempted to use a resource that requires a TOS they have not accepted. + * + * Generated from protobuf enum REQUIRED_TOS_AGREEMENT = 3745539; + */ + const REQUIRED_TOS_AGREEMENT = 3745539; + /** + * Warning that a resource is in use. + * + * Generated from protobuf enum RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING = 496728641; + */ + const RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING = 496728641; + /** + * One or more of the resources set to auto-delete could not be deleted because they were in use. + * + * Generated from protobuf enum RESOURCE_NOT_DELETED = 168598460; + */ + const RESOURCE_NOT_DELETED = 168598460; + /** + * When a resource schema validation is ignored. + * + * Generated from protobuf enum SCHEMA_VALIDATION_IGNORED = 275245642; + */ + const SCHEMA_VALIDATION_IGNORED = 275245642; + /** + * Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group. + * + * Generated from protobuf enum SINGLE_INSTANCE_PROPERTY_TEMPLATE = 268305617; + */ + const SINGLE_INSTANCE_PROPERTY_TEMPLATE = 268305617; + /** + * When undeclared properties in the schema are present + * + * Generated from protobuf enum UNDECLARED_PROPERTIES = 390513439; + */ + const UNDECLARED_PROPERTIES = 390513439; + /** + * A given scope cannot be reached. + * + * Generated from protobuf enum UNREACHABLE = 13328052; + */ + const UNREACHABLE = 13328052; + + private static $valueToName = [ + self::UNDEFINED_CODE => 'UNDEFINED_CODE', + self::CLEANUP_FAILED => 'CLEANUP_FAILED', + self::DEPRECATED_RESOURCE_USED => 'DEPRECATED_RESOURCE_USED', + self::DEPRECATED_TYPE_USED => 'DEPRECATED_TYPE_USED', + self::DISK_SIZE_LARGER_THAN_IMAGE_SIZE => 'DISK_SIZE_LARGER_THAN_IMAGE_SIZE', + self::EXPERIMENTAL_TYPE_USED => 'EXPERIMENTAL_TYPE_USED', + self::EXTERNAL_API_WARNING => 'EXTERNAL_API_WARNING', + self::FIELD_VALUE_OVERRIDEN => 'FIELD_VALUE_OVERRIDEN', + self::INJECTED_KERNELS_DEPRECATED => 'INJECTED_KERNELS_DEPRECATED', + self::INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB => 'INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB', + self::LARGE_DEPLOYMENT_WARNING => 'LARGE_DEPLOYMENT_WARNING', + self::LIST_OVERHEAD_QUOTA_EXCEED => 'LIST_OVERHEAD_QUOTA_EXCEED', + self::MISSING_TYPE_DEPENDENCY => 'MISSING_TYPE_DEPENDENCY', + self::NEXT_HOP_ADDRESS_NOT_ASSIGNED => 'NEXT_HOP_ADDRESS_NOT_ASSIGNED', + self::NEXT_HOP_CANNOT_IP_FORWARD => 'NEXT_HOP_CANNOT_IP_FORWARD', + self::NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE => 'NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE', + self::NEXT_HOP_INSTANCE_NOT_FOUND => 'NEXT_HOP_INSTANCE_NOT_FOUND', + self::NEXT_HOP_INSTANCE_NOT_ON_NETWORK => 'NEXT_HOP_INSTANCE_NOT_ON_NETWORK', + self::NEXT_HOP_NOT_RUNNING => 'NEXT_HOP_NOT_RUNNING', + self::NOT_CRITICAL_ERROR => 'NOT_CRITICAL_ERROR', + self::NO_RESULTS_ON_PAGE => 'NO_RESULTS_ON_PAGE', + self::PARTIAL_SUCCESS => 'PARTIAL_SUCCESS', + self::REQUIRED_TOS_AGREEMENT => 'REQUIRED_TOS_AGREEMENT', + self::RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING => 'RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING', + self::RESOURCE_NOT_DELETED => 'RESOURCE_NOT_DELETED', + self::SCHEMA_VALIDATION_IGNORED => 'SCHEMA_VALIDATION_IGNORED', + self::SINGLE_INSTANCE_PROPERTY_TEMPLATE => 'SINGLE_INSTANCE_PROPERTY_TEMPLATE', + self::UNDECLARED_PROPERTIES => 'UNDECLARED_PROPERTIES', + self::UNREACHABLE => 'UNREACHABLE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Code::class, \Google\Cloud\Compute\V1\QuotaStatusWarning_Code::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RawDisk.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RawDisk.php new file mode 100644 index 000000000000..c06a523602f8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RawDisk.php @@ -0,0 +1,169 @@ +google.cloud.compute.v1.RawDisk + */ +class RawDisk extends \Google\Protobuf\Internal\Message +{ + /** + * The format used to encode and transmit the block device, which should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created. + * Check the ContainerType enum for the list of possible values. + * + * Generated from protobuf field optional string container_type = 318809144; + */ + protected $container_type = null; + /** + * [Deprecated] This field is deprecated. An optional SHA1 checksum of the disk image before unpackaging provided by the client when the disk image is created. + * + * Generated from protobuf field optional string sha1_checksum = 314444349; + */ + protected $sha1_checksum = null; + /** + * The full Google Cloud Storage URL where the raw disk image archive is stored. The following are valid formats for the URL: - https://storage.googleapis.com/bucket_name/image_archive_name - https://storage.googleapis.com/bucket_name/folder_name/ image_archive_name In order to create an image, you must provide the full or partial URL of one of the following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL + * + * Generated from protobuf field optional string source = 177235995; + */ + protected $source = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $container_type + * The format used to encode and transmit the block device, which should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created. + * Check the ContainerType enum for the list of possible values. + * @type string $sha1_checksum + * [Deprecated] This field is deprecated. An optional SHA1 checksum of the disk image before unpackaging provided by the client when the disk image is created. + * @type string $source + * The full Google Cloud Storage URL where the raw disk image archive is stored. The following are valid formats for the URL: - https://storage.googleapis.com/bucket_name/image_archive_name - https://storage.googleapis.com/bucket_name/folder_name/ image_archive_name In order to create an image, you must provide the full or partial URL of one of the following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The format used to encode and transmit the block device, which should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created. + * Check the ContainerType enum for the list of possible values. + * + * Generated from protobuf field optional string container_type = 318809144; + * @return string + */ + public function getContainerType() + { + return isset($this->container_type) ? $this->container_type : ''; + } + + public function hasContainerType() + { + return isset($this->container_type); + } + + public function clearContainerType() + { + unset($this->container_type); + } + + /** + * The format used to encode and transmit the block device, which should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created. + * Check the ContainerType enum for the list of possible values. + * + * Generated from protobuf field optional string container_type = 318809144; + * @param string $var + * @return $this + */ + public function setContainerType($var) + { + GPBUtil::checkString($var, True); + $this->container_type = $var; + + return $this; + } + + /** + * [Deprecated] This field is deprecated. An optional SHA1 checksum of the disk image before unpackaging provided by the client when the disk image is created. + * + * Generated from protobuf field optional string sha1_checksum = 314444349; + * @return string + */ + public function getSha1Checksum() + { + return isset($this->sha1_checksum) ? $this->sha1_checksum : ''; + } + + public function hasSha1Checksum() + { + return isset($this->sha1_checksum); + } + + public function clearSha1Checksum() + { + unset($this->sha1_checksum); + } + + /** + * [Deprecated] This field is deprecated. An optional SHA1 checksum of the disk image before unpackaging provided by the client when the disk image is created. + * + * Generated from protobuf field optional string sha1_checksum = 314444349; + * @param string $var + * @return $this + */ + public function setSha1Checksum($var) + { + GPBUtil::checkString($var, True); + $this->sha1_checksum = $var; + + return $this; + } + + /** + * The full Google Cloud Storage URL where the raw disk image archive is stored. The following are valid formats for the URL: - https://storage.googleapis.com/bucket_name/image_archive_name - https://storage.googleapis.com/bucket_name/folder_name/ image_archive_name In order to create an image, you must provide the full or partial URL of one of the following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL + * + * Generated from protobuf field optional string source = 177235995; + * @return string + */ + public function getSource() + { + return isset($this->source) ? $this->source : ''; + } + + public function hasSource() + { + return isset($this->source); + } + + public function clearSource() + { + unset($this->source); + } + + /** + * The full Google Cloud Storage URL where the raw disk image archive is stored. The following are valid formats for the URL: - https://storage.googleapis.com/bucket_name/image_archive_name - https://storage.googleapis.com/bucket_name/folder_name/ image_archive_name In order to create an image, you must provide the full or partial URL of one of the following: - The rawDisk.source URL - The sourceDisk URL - The sourceImage URL - The sourceSnapshot URL + * + * Generated from protobuf field optional string source = 177235995; + * @param string $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkString($var, True); + $this->source = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RawDisk/ContainerType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RawDisk/ContainerType.php new file mode 100644 index 000000000000..54a236125b32 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RawDisk/ContainerType.php @@ -0,0 +1,55 @@ +google.cloud.compute.v1.RawDisk.ContainerType + */ +class ContainerType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_CONTAINER_TYPE = 0; + */ + const UNDEFINED_CONTAINER_TYPE = 0; + /** + * Generated from protobuf enum TAR = 82821; + */ + const TAR = 82821; + + private static $valueToName = [ + self::UNDEFINED_CONTAINER_TYPE => 'UNDEFINED_CONTAINER_TYPE', + self::TAR => 'TAR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ContainerType::class, \Google\Cloud\Compute\V1\RawDisk_ContainerType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RecreateInstancesInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RecreateInstancesInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..9c0d61e74ecd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RecreateInstancesInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest + */ +class RecreateInstancesInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest instance_group_managers_recreate_instances_request_resource = 21405952 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_managers_recreate_instances_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the zone where the managed instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. + * @param string $instanceGroupManager The name of the managed instance group. + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersRecreateInstancesRequest $instanceGroupManagersRecreateInstancesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\RecreateInstancesInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager, \Google\Cloud\Compute\V1\InstanceGroupManagersRecreateInstancesRequest $instanceGroupManagersRecreateInstancesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersRecreateInstancesRequestResource($instanceGroupManagersRecreateInstancesRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group. + * @type \Google\Cloud\Compute\V1\InstanceGroupManagersRecreateInstancesRequest $instance_group_managers_recreate_instances_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 where the managed instance group is located. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest instance_group_managers_recreate_instances_request_resource = 21405952 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagersRecreateInstancesRequest|null + */ + public function getInstanceGroupManagersRecreateInstancesRequestResource() + { + return $this->instance_group_managers_recreate_instances_request_resource; + } + + public function hasInstanceGroupManagersRecreateInstancesRequestResource() + { + return isset($this->instance_group_managers_recreate_instances_request_resource); + } + + public function clearInstanceGroupManagersRecreateInstancesRequestResource() + { + unset($this->instance_group_managers_recreate_instances_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest instance_group_managers_recreate_instances_request_resource = 21405952 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersRecreateInstancesRequest $var + * @return $this + */ + public function setInstanceGroupManagersRecreateInstancesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagersRecreateInstancesRequest::class); + $this->instance_group_managers_recreate_instances_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 where the managed instance group is located. + * + * 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 where the managed instance group is located. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RecreateInstancesRegionInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RecreateInstancesRegionInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..2e63e0860acc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RecreateInstancesRegionInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest + */ +class RecreateInstancesRegionInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest region_instance_group_managers_recreate_request_resource = 170999316 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_instance_group_managers_recreate_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $instanceGroupManager Name of the managed instance group. + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagersRecreateRequest $regionInstanceGroupManagersRecreateRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\RecreateInstancesRegionInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroupManager, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersRecreateRequest $regionInstanceGroupManagersRecreateRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroupManager($instanceGroupManager) + ->setRegionInstanceGroupManagersRecreateRequestResource($regionInstanceGroupManagersRecreateRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * Name of the managed instance group. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type \Google\Cloud\Compute\V1\RegionInstanceGroupManagersRecreateRequest $region_instance_group_managers_recreate_request_resource + * The body resource 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); + } + + /** + * Name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * Name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest region_instance_group_managers_recreate_request_resource = 170999316 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionInstanceGroupManagersRecreateRequest|null + */ + public function getRegionInstanceGroupManagersRecreateRequestResource() + { + return $this->region_instance_group_managers_recreate_request_resource; + } + + public function hasRegionInstanceGroupManagersRecreateRequestResource() + { + return isset($this->region_instance_group_managers_recreate_request_resource); + } + + public function clearRegionInstanceGroupManagersRecreateRequestResource() + { + unset($this->region_instance_group_managers_recreate_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest region_instance_group_managers_recreate_request_resource = 170999316 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagersRecreateRequest $var + * @return $this + */ + public function setRegionInstanceGroupManagersRecreateRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersRecreateRequest::class); + $this->region_instance_group_managers_recreate_request_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Reference.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Reference.php new file mode 100644 index 000000000000..827285c61f87 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Reference.php @@ -0,0 +1,209 @@ +google.cloud.compute.v1.Reference + */ +class Reference extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Type of the resource. Always compute#reference for references. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * A description of the reference type with no implied semantics. Possible values include: 1. MEMBER_OF + * + * Generated from protobuf field optional string reference_type = 247521198; + */ + protected $reference_type = null; + /** + * URL of the resource which refers to the target. + * + * Generated from protobuf field optional string referrer = 351173663; + */ + protected $referrer = null; + /** + * URL of the resource to which this reference points. + * + * Generated from protobuf field optional string target = 192835985; + */ + protected $target = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $kind + * [Output Only] Type of the resource. Always compute#reference for references. + * @type string $reference_type + * A description of the reference type with no implied semantics. Possible values include: 1. MEMBER_OF + * @type string $referrer + * URL of the resource which refers to the target. + * @type string $target + * URL of the resource to which this reference points. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Type of the resource. Always compute#reference for references. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#reference for references. + * + * 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; + } + + /** + * A description of the reference type with no implied semantics. Possible values include: 1. MEMBER_OF + * + * Generated from protobuf field optional string reference_type = 247521198; + * @return string + */ + public function getReferenceType() + { + return isset($this->reference_type) ? $this->reference_type : ''; + } + + public function hasReferenceType() + { + return isset($this->reference_type); + } + + public function clearReferenceType() + { + unset($this->reference_type); + } + + /** + * A description of the reference type with no implied semantics. Possible values include: 1. MEMBER_OF + * + * Generated from protobuf field optional string reference_type = 247521198; + * @param string $var + * @return $this + */ + public function setReferenceType($var) + { + GPBUtil::checkString($var, True); + $this->reference_type = $var; + + return $this; + } + + /** + * URL of the resource which refers to the target. + * + * Generated from protobuf field optional string referrer = 351173663; + * @return string + */ + public function getReferrer() + { + return isset($this->referrer) ? $this->referrer : ''; + } + + public function hasReferrer() + { + return isset($this->referrer); + } + + public function clearReferrer() + { + unset($this->referrer); + } + + /** + * URL of the resource which refers to the target. + * + * Generated from protobuf field optional string referrer = 351173663; + * @param string $var + * @return $this + */ + public function setReferrer($var) + { + GPBUtil::checkString($var, True); + $this->referrer = $var; + + return $this; + } + + /** + * URL of the resource to which this reference points. + * + * Generated from protobuf field optional string target = 192835985; + * @return string + */ + public function getTarget() + { + return isset($this->target) ? $this->target : ''; + } + + public function hasTarget() + { + return isset($this->target); + } + + public function clearTarget() + { + unset($this->target); + } + + /** + * URL of the resource to which this reference points. + * + * Generated from protobuf field optional string target = 192835985; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Region.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Region.php new file mode 100644 index 000000000000..5e8f8b4bacbd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Region.php @@ -0,0 +1,545 @@ +google.cloud.compute.v1.Region + */ +class Region extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * [Output Only] The deprecation status associated with this region. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + */ + protected $deprecated = null; + /** + * [Output Only] Textual description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#region for regions. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * [Output Only] Name of the resource. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] Warning of fetching the `quotas` field for this region. This field is populated only if fetching of the `quotas` field fails. + * + * Generated from protobuf field optional .google.cloud.compute.v1.QuotaStatusWarning quota_status_warning = 302941430; + */ + protected $quota_status_warning = null; + /** + * [Output Only] Quotas assigned to this region. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Quota quotas = 125341947; + */ + private $quotas; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Status of the region, either UP or DOWN. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool supports_pzs = 83983214; + */ + protected $supports_pzs = null; + /** + * [Output Only] A list of zones available in this region, in the form of resource URLs. + * + * Generated from protobuf field repeated string zones = 116085319; + */ + private $zones; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type \Google\Cloud\Compute\V1\DeprecationStatus $deprecated + * [Output Only] The deprecation status associated with this region. + * @type string $description + * [Output Only] Textual description of the resource. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of the resource. Always compute#region for regions. + * @type string $name + * [Output Only] Name of the resource. + * @type \Google\Cloud\Compute\V1\QuotaStatusWarning $quota_status_warning + * [Output Only] Warning of fetching the `quotas` field for this region. This field is populated only if fetching of the `quotas` field fails. + * @type array<\Google\Cloud\Compute\V1\Quota>|\Google\Protobuf\Internal\RepeatedField $quotas + * [Output Only] Quotas assigned to this region. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $status + * [Output Only] Status of the region, either UP or DOWN. + * Check the Status enum for the list of possible values. + * @type bool $supports_pzs + * [Output Only] Reserved for future use. + * @type array|\Google\Protobuf\Internal\RepeatedField $zones + * [Output Only] A list of zones available in this region, in the form of resource URLs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * [Output Only] The deprecation status associated with this region. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + * @return \Google\Cloud\Compute\V1\DeprecationStatus|null + */ + public function getDeprecated() + { + return $this->deprecated; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * [Output Only] The deprecation status associated with this region. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + * @param \Google\Cloud\Compute\V1\DeprecationStatus $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DeprecationStatus::class); + $this->deprecated = $var; + + return $this; + } + + /** + * [Output Only] Textual description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * [Output Only] Textual description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#region for regions. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#region for regions. + * + * 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] Name of the resource. + * + * 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); + } + + /** + * [Output Only] Name of the resource. + * + * 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; + } + + /** + * [Output Only] Warning of fetching the `quotas` field for this region. This field is populated only if fetching of the `quotas` field fails. + * + * Generated from protobuf field optional .google.cloud.compute.v1.QuotaStatusWarning quota_status_warning = 302941430; + * @return \Google\Cloud\Compute\V1\QuotaStatusWarning|null + */ + public function getQuotaStatusWarning() + { + return $this->quota_status_warning; + } + + public function hasQuotaStatusWarning() + { + return isset($this->quota_status_warning); + } + + public function clearQuotaStatusWarning() + { + unset($this->quota_status_warning); + } + + /** + * [Output Only] Warning of fetching the `quotas` field for this region. This field is populated only if fetching of the `quotas` field fails. + * + * Generated from protobuf field optional .google.cloud.compute.v1.QuotaStatusWarning quota_status_warning = 302941430; + * @param \Google\Cloud\Compute\V1\QuotaStatusWarning $var + * @return $this + */ + public function setQuotaStatusWarning($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\QuotaStatusWarning::class); + $this->quota_status_warning = $var; + + return $this; + } + + /** + * [Output Only] Quotas assigned to this region. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Quota quotas = 125341947; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getQuotas() + { + return $this->quotas; + } + + /** + * [Output Only] Quotas assigned to this region. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Quota quotas = 125341947; + * @param array<\Google\Cloud\Compute\V1\Quota>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setQuotas($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Quota::class); + $this->quotas = $arr; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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] Status of the region, either UP or DOWN. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] Status of the region, either UP or DOWN. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool supports_pzs = 83983214; + * @return bool + */ + public function getSupportsPzs() + { + return isset($this->supports_pzs) ? $this->supports_pzs : false; + } + + public function hasSupportsPzs() + { + return isset($this->supports_pzs); + } + + public function clearSupportsPzs() + { + unset($this->supports_pzs); + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool supports_pzs = 83983214; + * @param bool $var + * @return $this + */ + public function setSupportsPzs($var) + { + GPBUtil::checkBool($var); + $this->supports_pzs = $var; + + return $this; + } + + /** + * [Output Only] A list of zones available in this region, in the form of resource URLs. + * + * Generated from protobuf field repeated string zones = 116085319; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getZones() + { + return $this->zones; + } + + /** + * [Output Only] A list of zones available in this region, in the form of resource URLs. + * + * Generated from protobuf field repeated string zones = 116085319; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setZones($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->zones = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Region/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Region/Status.php new file mode 100644 index 000000000000..4a13c9fd60e6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Region/Status.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.Region.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * Generated from protobuf enum DOWN = 2104482; + */ + const DOWN = 2104482; + /** + * Generated from protobuf enum UP = 2715; + */ + const UP = 2715; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::DOWN => 'DOWN', + self::UP => 'UP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\Region_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionAddressesMoveRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionAddressesMoveRequest.php new file mode 100644 index 000000000000..d036b2d45d6c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionAddressesMoveRequest.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.RegionAddressesMoveRequest + */ +class RegionAddressesMoveRequest extends \Google\Protobuf\Internal\Message +{ + /** + * An optional destination address description if intended to be different from the source. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * The URL of the destination address to move to. This can be a full or partial URL. For example, the following are all valid URLs to a address: - https://www.googleapis.com/compute/v1/projects/project/regions/region /addresses/address - projects/project/regions/region/addresses/address Note that destination project must be different from the source project. So /regions/region/addresses/address is not valid partial url. + * + * Generated from protobuf field optional string destination_address = 371693763; + */ + protected $destination_address = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $description + * An optional destination address description if intended to be different from the source. + * @type string $destination_address + * The URL of the destination address to move to. This can be a full or partial URL. For example, the following are all valid URLs to a address: - https://www.googleapis.com/compute/v1/projects/project/regions/region /addresses/address - projects/project/regions/region/addresses/address Note that destination project must be different from the source project. So /regions/region/addresses/address is not valid partial url. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * An optional destination address description if intended to be different from the source. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional destination address description if intended to be different from the source. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The URL of the destination address to move to. This can be a full or partial URL. For example, the following are all valid URLs to a address: - https://www.googleapis.com/compute/v1/projects/project/regions/region /addresses/address - projects/project/regions/region/addresses/address Note that destination project must be different from the source project. So /regions/region/addresses/address is not valid partial url. + * + * Generated from protobuf field optional string destination_address = 371693763; + * @return string + */ + public function getDestinationAddress() + { + return isset($this->destination_address) ? $this->destination_address : ''; + } + + public function hasDestinationAddress() + { + return isset($this->destination_address); + } + + public function clearDestinationAddress() + { + unset($this->destination_address); + } + + /** + * The URL of the destination address to move to. This can be a full or partial URL. For example, the following are all valid URLs to a address: - https://www.googleapis.com/compute/v1/projects/project/regions/region /addresses/address - projects/project/regions/region/addresses/address Note that destination project must be different from the source project. So /regions/region/addresses/address is not valid partial url. + * + * Generated from protobuf field optional string destination_address = 371693763; + * @param string $var + * @return $this + */ + public function setDestinationAddress($var) + { + GPBUtil::checkString($var, True); + $this->destination_address = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionAutoscalerList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionAutoscalerList.php new file mode 100644 index 000000000000..205e8bab92b2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionAutoscalerList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.RegionAutoscalerList + */ +class RegionAutoscalerList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of Autoscaler resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Autoscaler items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\Autoscaler>|\Google\Protobuf\Internal\RepeatedField $items + * A list of Autoscaler 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 Autoscaler resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Autoscaler items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of Autoscaler resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Autoscaler items = 100526016; + * @param array<\Google\Cloud\Compute\V1\Autoscaler>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Autoscaler::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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionDiskTypeList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionDiskTypeList.php new file mode 100644 index 000000000000..a762f6f83408 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionDiskTypeList.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.RegionDiskTypeList + */ +class RegionDiskTypeList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of DiskType resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.DiskType items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#regionDiskTypeList for region disk types. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\DiskType>|\Google\Protobuf\Internal\RepeatedField $items + * A list of DiskType resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#regionDiskTypeList for region disk types. + * @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 DiskType resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.DiskType items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of DiskType resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.DiskType items = 100526016; + * @param array<\Google\Cloud\Compute\V1\DiskType>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\DiskType::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#regionDiskTypeList for region disk types. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#regionDiskTypeList for region disk types. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionDisksAddResourcePoliciesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionDisksAddResourcePoliciesRequest.php new file mode 100644 index 000000000000..527496e09312 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionDisksAddResourcePoliciesRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest + */ +class RegionDisksAddResourcePoliciesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Resource policies to be added to this disk. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + */ + private $resource_policies; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $resource_policies + * Resource policies to be added to this disk. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Resource policies to be added to this disk. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourcePolicies() + { + return $this->resource_policies; + } + + /** + * Resource policies to be added to this disk. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourcePolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_policies = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionDisksRemoveResourcePoliciesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionDisksRemoveResourcePoliciesRequest.php new file mode 100644 index 000000000000..b1602347adb1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionDisksRemoveResourcePoliciesRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest + */ +class RegionDisksRemoveResourcePoliciesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Resource policies to be removed from this disk. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + */ + private $resource_policies; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $resource_policies + * Resource policies to be removed from this disk. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Resource policies to be removed from this disk. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourcePolicies() + { + return $this->resource_policies; + } + + /** + * Resource policies to be removed from this disk. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourcePolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_policies = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionDisksResizeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionDisksResizeRequest.php new file mode 100644 index 000000000000..ea0f62c6d86b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionDisksResizeRequest.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.RegionDisksResizeRequest + */ +class RegionDisksResizeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The new size of the regional persistent disk, which is specified in GB. + * + * Generated from protobuf field optional int64 size_gb = 494929369; + */ + protected $size_gb = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $size_gb + * The new size of the regional persistent disk, which is specified in GB. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The new size of the regional persistent disk, which is specified in GB. + * + * Generated from protobuf field optional int64 size_gb = 494929369; + * @return int|string + */ + public function getSizeGb() + { + return isset($this->size_gb) ? $this->size_gb : 0; + } + + public function hasSizeGb() + { + return isset($this->size_gb); + } + + public function clearSizeGb() + { + unset($this->size_gb); + } + + /** + * The new size of the regional persistent disk, which is specified in GB. + * + * Generated from protobuf field optional int64 size_gb = 494929369; + * @param int|string $var + * @return $this + */ + public function setSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->size_gb = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionDisksStartAsyncReplicationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionDisksStartAsyncReplicationRequest.php new file mode 100644 index 000000000000..8e7f39cbbe6a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionDisksStartAsyncReplicationRequest.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.RegionDisksStartAsyncReplicationRequest + */ +class RegionDisksStartAsyncReplicationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The secondary disk to start asynchronous replication to. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - https://www.googleapis.com/compute/v1/projects/project/regions/region /disks/disk - projects/project/zones/zone/disks/disk - projects/project/regions/region/disks/disk - zones/zone/disks/disk - regions/region/disks/disk + * + * Generated from protobuf field optional string async_secondary_disk = 131645867; + */ + protected $async_secondary_disk = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $async_secondary_disk + * The secondary disk to start asynchronous replication to. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - https://www.googleapis.com/compute/v1/projects/project/regions/region /disks/disk - projects/project/zones/zone/disks/disk - projects/project/regions/region/disks/disk - zones/zone/disks/disk - regions/region/disks/disk + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The secondary disk to start asynchronous replication to. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - https://www.googleapis.com/compute/v1/projects/project/regions/region /disks/disk - projects/project/zones/zone/disks/disk - projects/project/regions/region/disks/disk - zones/zone/disks/disk - regions/region/disks/disk + * + * Generated from protobuf field optional string async_secondary_disk = 131645867; + * @return string + */ + public function getAsyncSecondaryDisk() + { + return isset($this->async_secondary_disk) ? $this->async_secondary_disk : ''; + } + + public function hasAsyncSecondaryDisk() + { + return isset($this->async_secondary_disk); + } + + public function clearAsyncSecondaryDisk() + { + unset($this->async_secondary_disk); + } + + /** + * The secondary disk to start asynchronous replication to. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - https://www.googleapis.com/compute/v1/projects/project/regions/region /disks/disk - projects/project/zones/zone/disks/disk - projects/project/regions/region/disks/disk - zones/zone/disks/disk - regions/region/disks/disk + * + * Generated from protobuf field optional string async_secondary_disk = 131645867; + * @param string $var + * @return $this + */ + public function setAsyncSecondaryDisk($var) + { + GPBUtil::checkString($var, True); + $this->async_secondary_disk = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupList.php new file mode 100644 index 000000000000..77556fec9040 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.RegionInstanceGroupList + */ +class RegionInstanceGroupList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of InstanceGroup resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroup items = 100526016; + */ + private $items; + /** + * The resource type. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\InstanceGroup>|\Google\Protobuf\Internal\RepeatedField $items + * A list of InstanceGroup resources. + * @type string $kind + * The resource type. + * @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 InstanceGroup resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroup items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of InstanceGroup resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroup items = 100526016; + * @param array<\Google\Cloud\Compute\V1\InstanceGroup>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstanceGroup::class); + $this->items = $arr; + + return $this; + } + + /** + * The resource type. + * + * 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); + } + + /** + * The resource type. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagerDeleteInstanceConfigReq.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagerDeleteInstanceConfigReq.php new file mode 100644 index 000000000000..bc3f9495aa28 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagerDeleteInstanceConfigReq.php @@ -0,0 +1,67 @@ +google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq + */ +class RegionInstanceGroupManagerDeleteInstanceConfigReq extends \Google\Protobuf\Internal\Message +{ + /** + * The list of instance names for which we want to delete per-instance configs on this managed instance group. + * + * Generated from protobuf field repeated string names = 104585032; + */ + private $names; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $names + * The list of instance names for which we want to delete per-instance configs on this managed instance group. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The list of instance names for which we want to delete per-instance configs on this managed instance group. + * + * Generated from protobuf field repeated string names = 104585032; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNames() + { + return $this->names; + } + + /** + * The list of instance names for which we want to delete per-instance configs on this managed instance group. + * + * Generated from protobuf field repeated string names = 104585032; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->names = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagerList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagerList.php new file mode 100644 index 000000000000..26f1e9443f40 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagerList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.RegionInstanceGroupManagerList + */ +class RegionInstanceGroupManagerList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of InstanceGroupManager resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroupManager items = 100526016; + */ + private $items; + /** + * [Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups that exist in th regional scope. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\InstanceGroupManager>|\Google\Protobuf\Internal\RepeatedField $items + * A list of InstanceGroupManager resources. + * @type string $kind + * [Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups that exist in th regional scope. + * @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 InstanceGroupManager resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroupManager items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of InstanceGroupManager resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceGroupManager items = 100526016; + * @param array<\Google\Cloud\Compute\V1\InstanceGroupManager>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstanceGroupManager::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups that exist in th regional scope. + * + * 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); + } + + /** + * [Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups that exist in th regional scope. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagerPatchInstanceConfigReq.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagerPatchInstanceConfigReq.php new file mode 100644 index 000000000000..76d33d674b8f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagerPatchInstanceConfigReq.php @@ -0,0 +1,67 @@ +google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq + */ +class RegionInstanceGroupManagerPatchInstanceConfigReq extends \Google\Protobuf\Internal\Message +{ + /** + * The list of per-instance configurations to insert or patch on this managed instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig per_instance_configs = 526265001; + */ + private $per_instance_configs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\PerInstanceConfig>|\Google\Protobuf\Internal\RepeatedField $per_instance_configs + * The list of per-instance configurations to insert or patch on this managed instance group. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The list of per-instance configurations to insert or patch on this managed instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig per_instance_configs = 526265001; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPerInstanceConfigs() + { + return $this->per_instance_configs; + } + + /** + * The list of per-instance configurations to insert or patch on this managed instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig per_instance_configs = 526265001; + * @param array<\Google\Cloud\Compute\V1\PerInstanceConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPerInstanceConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PerInstanceConfig::class); + $this->per_instance_configs = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagerUpdateInstanceConfigReq.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagerUpdateInstanceConfigReq.php new file mode 100644 index 000000000000..c49aa6fb803d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagerUpdateInstanceConfigReq.php @@ -0,0 +1,67 @@ +google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq + */ +class RegionInstanceGroupManagerUpdateInstanceConfigReq extends \Google\Protobuf\Internal\Message +{ + /** + * The list of per-instance configurations to insert or patch on this managed instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig per_instance_configs = 526265001; + */ + private $per_instance_configs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\PerInstanceConfig>|\Google\Protobuf\Internal\RepeatedField $per_instance_configs + * The list of per-instance configurations to insert or patch on this managed instance group. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The list of per-instance configurations to insert or patch on this managed instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig per_instance_configs = 526265001; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPerInstanceConfigs() + { + return $this->per_instance_configs; + } + + /** + * The list of per-instance configurations to insert or patch on this managed instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig per_instance_configs = 526265001; + * @param array<\Google\Cloud\Compute\V1\PerInstanceConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPerInstanceConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PerInstanceConfig::class); + $this->per_instance_configs = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersAbandonInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersAbandonInstancesRequest.php new file mode 100644 index 000000000000..1b2ed19a5c8b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersAbandonInstancesRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest + */ +class RegionInstanceGroupManagersAbandonInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The URLs of one or more instances to abandon. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + * + * Generated from protobuf field repeated string instances = 29097598; + */ + private $instances; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $instances + * The URLs of one or more instances to abandon. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The URLs of one or more instances to abandon. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + * + * Generated from protobuf field repeated string instances = 29097598; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * The URLs of one or more instances to abandon. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + * + * Generated from protobuf field repeated string instances = 29097598; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->instances = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersApplyUpdatesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersApplyUpdatesRequest.php new file mode 100644 index 000000000000..54e83fafea99 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersApplyUpdatesRequest.php @@ -0,0 +1,207 @@ +google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest + */ +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. + * + * Generated from protobuf field optional bool all_instances = 403676512; + */ + protected $all_instances = null; + /** + * 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]. + * + * Generated from protobuf field repeated string instances = 29097598; + */ + private $instances; + /** + * The minimal action that you want to perform on each instance during the update: - REPLACE: At minimum, delete the instance and create it again. - RESTART: Stop the instance and start it again. - REFRESH: Do not stop the instance and limit disruption as much as possible. - NONE: Do not disrupt the instance at all. By default, the minimum action is NONE. If your update requires a more disruptive action than you set with this flag, the necessary action is performed to execute the update. + * Check the MinimalAction enum for the list of possible values. + * + * Generated from protobuf field optional string minimal_action = 270567060; + */ + protected $minimal_action = null; + /** + * The most disruptive action that you want to perform on each instance during the update: - REPLACE: Delete the instance and create it again. - RESTART: Stop the instance and start it again. - REFRESH: Do not stop the instance and limit disruption as much as possible. - NONE: Do not disrupt the instance at all. By default, the most disruptive allowed action is REPLACE. If your update requires a more disruptive action than you set with this flag, the update request will fail. + * Check the MostDisruptiveAllowedAction enum for the list of possible values. + * + * Generated from protobuf field optional string most_disruptive_allowed_action = 66103053; + */ + protected $most_disruptive_allowed_action = null; + + /** + * Constructor. + * + * @param array $data { + * 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. + * @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 + * The minimal action that you want to perform on each instance during the update: - REPLACE: At minimum, delete the instance and create it again. - RESTART: Stop the instance and start it again. - REFRESH: Do not stop the instance and limit disruption as much as possible. - NONE: Do not disrupt the instance at all. By default, the minimum action is NONE. If your update requires a more disruptive action than you set with this flag, the necessary action is performed to execute the update. + * Check the MinimalAction enum for the list of possible values. + * @type string $most_disruptive_allowed_action + * The most disruptive action that you want to perform on each instance during the update: - REPLACE: Delete the instance and create it again. - RESTART: Stop the instance and start it again. - REFRESH: Do not stop the instance and limit disruption as much as possible. - NONE: Do not disrupt the instance at all. By default, the most disruptive allowed action is REPLACE. If your update requires a more disruptive action than you set with this flag, the update request will fail. + * Check the MostDisruptiveAllowedAction enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 + */ + public function getAllInstances() + { + return isset($this->all_instances) ? $this->all_instances : false; + } + + public function hasAllInstances() + { + return isset($this->all_instances); + } + + public function clearAllInstances() + { + unset($this->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. + * + * Generated from protobuf field optional bool all_instances = 403676512; + * @param bool $var + * @return $this + */ + public function setAllInstances($var) + { + GPBUtil::checkBool($var); + $this->all_instances = $var; + + return $this; + } + + /** + * 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]. + * + * Generated from protobuf field repeated string instances = 29097598; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->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]. + * + * Generated from protobuf field repeated string instances = 29097598; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->instances = $arr; + + return $this; + } + + /** + * The minimal action that you want to perform on each instance during the update: - REPLACE: At minimum, delete the instance and create it again. - RESTART: Stop the instance and start it again. - REFRESH: Do not stop the instance and limit disruption as much as possible. - NONE: Do not disrupt the instance at all. By default, the minimum action is NONE. If your update requires a more disruptive action than you set with this flag, the necessary action is performed to execute the update. + * Check the MinimalAction enum for the list of possible values. + * + * Generated from protobuf field optional string minimal_action = 270567060; + * @return string + */ + public function getMinimalAction() + { + return isset($this->minimal_action) ? $this->minimal_action : ''; + } + + public function hasMinimalAction() + { + return isset($this->minimal_action); + } + + public function clearMinimalAction() + { + unset($this->minimal_action); + } + + /** + * The minimal action that you want to perform on each instance during the update: - REPLACE: At minimum, delete the instance and create it again. - RESTART: Stop the instance and start it again. - REFRESH: Do not stop the instance and limit disruption as much as possible. - NONE: Do not disrupt the instance at all. By default, the minimum action is NONE. If your update requires a more disruptive action than you set with this flag, the necessary action is performed to execute the update. + * Check the MinimalAction enum for the list of possible values. + * + * Generated from protobuf field optional string minimal_action = 270567060; + * @param string $var + * @return $this + */ + public function setMinimalAction($var) + { + GPBUtil::checkString($var, True); + $this->minimal_action = $var; + + return $this; + } + + /** + * The most disruptive action that you want to perform on each instance during the update: - REPLACE: Delete the instance and create it again. - RESTART: Stop the instance and start it again. - REFRESH: Do not stop the instance and limit disruption as much as possible. - NONE: Do not disrupt the instance at all. By default, the most disruptive allowed action is REPLACE. If your update requires a more disruptive action than you set with this flag, the update request will fail. + * Check the MostDisruptiveAllowedAction enum for the list of possible values. + * + * Generated from protobuf field optional string most_disruptive_allowed_action = 66103053; + * @return string + */ + public function getMostDisruptiveAllowedAction() + { + return isset($this->most_disruptive_allowed_action) ? $this->most_disruptive_allowed_action : ''; + } + + public function hasMostDisruptiveAllowedAction() + { + return isset($this->most_disruptive_allowed_action); + } + + public function clearMostDisruptiveAllowedAction() + { + unset($this->most_disruptive_allowed_action); + } + + /** + * The most disruptive action that you want to perform on each instance during the update: - REPLACE: Delete the instance and create it again. - RESTART: Stop the instance and start it again. - REFRESH: Do not stop the instance and limit disruption as much as possible. - NONE: Do not disrupt the instance at all. By default, the most disruptive allowed action is REPLACE. If your update requires a more disruptive action than you set with this flag, the update request will fail. + * Check the MostDisruptiveAllowedAction enum for the list of possible values. + * + * Generated from protobuf field optional string most_disruptive_allowed_action = 66103053; + * @param string $var + * @return $this + */ + public function setMostDisruptiveAllowedAction($var) + { + GPBUtil::checkString($var, True); + $this->most_disruptive_allowed_action = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersApplyUpdatesRequest/MinimalAction.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersApplyUpdatesRequest/MinimalAction.php new file mode 100644 index 000000000000..7ba8bb3a8881 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersApplyUpdatesRequest/MinimalAction.php @@ -0,0 +1,55 @@ +google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest.MinimalAction + */ +class MinimalAction +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MINIMAL_ACTION = 0; + */ + const UNDEFINED_MINIMAL_ACTION = 0; + + private static $valueToName = [ + self::UNDEFINED_MINIMAL_ACTION => 'UNDEFINED_MINIMAL_ACTION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MinimalAction::class, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersApplyUpdatesRequest_MinimalAction::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersApplyUpdatesRequest/MostDisruptiveAllowedAction.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersApplyUpdatesRequest/MostDisruptiveAllowedAction.php new file mode 100644 index 000000000000..802a2cc7c114 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersApplyUpdatesRequest/MostDisruptiveAllowedAction.php @@ -0,0 +1,55 @@ +google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest.MostDisruptiveAllowedAction + */ +class MostDisruptiveAllowedAction +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MOST_DISRUPTIVE_ALLOWED_ACTION = 0; + */ + const UNDEFINED_MOST_DISRUPTIVE_ALLOWED_ACTION = 0; + + private static $valueToName = [ + self::UNDEFINED_MOST_DISRUPTIVE_ALLOWED_ACTION => 'UNDEFINED_MOST_DISRUPTIVE_ALLOWED_ACTION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MostDisruptiveAllowedAction::class, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersApplyUpdatesRequest_MostDisruptiveAllowedAction::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersCreateInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersCreateInstancesRequest.php new file mode 100644 index 000000000000..14260e85da7b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersCreateInstancesRequest.php @@ -0,0 +1,67 @@ +google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest + */ +class RegionInstanceGroupManagersCreateInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * [Required] List of specifications of per-instance configs. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig instances = 29097598; + */ + private $instances; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\PerInstanceConfig>|\Google\Protobuf\Internal\RepeatedField $instances + * [Required] List of specifications of per-instance configs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Required] List of specifications of per-instance configs. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig instances = 29097598; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * [Required] List of specifications of per-instance configs. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig instances = 29097598; + * @param array<\Google\Cloud\Compute\V1\PerInstanceConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PerInstanceConfig::class); + $this->instances = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersDeleteInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersDeleteInstancesRequest.php new file mode 100644 index 000000000000..15137be41cd5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersDeleteInstancesRequest.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest + */ +class RegionInstanceGroupManagersDeleteInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The URLs of one or more instances to delete. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + * + * Generated from protobuf field repeated string instances = 29097598; + */ + private $instances; + /** + * Specifies whether the request should proceed despite the inclusion of instances that are not members of the group or that are already in the process of being deleted or abandoned. If this field is set to `false` and such an instance is specified in the request, the operation fails. The operation always fails if the request contains a malformed instance URL or a reference to an instance that exists in a zone or region other than the group's zone or region. + * + * Generated from protobuf field optional bool skip_instances_on_validation_error = 40631073; + */ + protected $skip_instances_on_validation_error = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $instances + * The URLs of one or more instances to delete. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + * @type bool $skip_instances_on_validation_error + * Specifies whether the request should proceed despite the inclusion of instances that are not members of the group or that are already in the process of being deleted or abandoned. If this field is set to `false` and such an instance is specified in the request, the operation fails. The operation always fails if the request contains a malformed instance URL or a reference to an instance that exists in a zone or region other than the group's zone or region. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The URLs of one or more instances to delete. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + * + * Generated from protobuf field repeated string instances = 29097598; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * The URLs of one or more instances to delete. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + * + * Generated from protobuf field repeated string instances = 29097598; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->instances = $arr; + + return $this; + } + + /** + * Specifies whether the request should proceed despite the inclusion of instances that are not members of the group or that are already in the process of being deleted or abandoned. If this field is set to `false` and such an instance is specified in the request, the operation fails. The operation always fails if the request contains a malformed instance URL or a reference to an instance that exists in a zone or region other than the group's zone or region. + * + * Generated from protobuf field optional bool skip_instances_on_validation_error = 40631073; + * @return bool + */ + public function getSkipInstancesOnValidationError() + { + return isset($this->skip_instances_on_validation_error) ? $this->skip_instances_on_validation_error : false; + } + + public function hasSkipInstancesOnValidationError() + { + return isset($this->skip_instances_on_validation_error); + } + + public function clearSkipInstancesOnValidationError() + { + unset($this->skip_instances_on_validation_error); + } + + /** + * Specifies whether the request should proceed despite the inclusion of instances that are not members of the group or that are already in the process of being deleted or abandoned. If this field is set to `false` and such an instance is specified in the request, the operation fails. The operation always fails if the request contains a malformed instance URL or a reference to an instance that exists in a zone or region other than the group's zone or region. + * + * Generated from protobuf field optional bool skip_instances_on_validation_error = 40631073; + * @param bool $var + * @return $this + */ + public function setSkipInstancesOnValidationError($var) + { + GPBUtil::checkBool($var); + $this->skip_instances_on_validation_error = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersListErrorsResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersListErrorsResponse.php new file mode 100644 index 000000000000..370441e2c3db --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersListErrorsResponse.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse + */ +class RegionInstanceGroupManagersListErrorsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The list of errors of the managed instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceManagedByIgmError items = 100526016; + */ + private $items; + /** + * [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; + */ + protected $next_page_token = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\InstanceManagedByIgmError>|\Google\Protobuf\Internal\RepeatedField $items + * [Output Only] The list of errors of the managed instance group. + * @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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The list of errors of the managed instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceManagedByIgmError items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * [Output Only] The list of errors of the managed instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceManagedByIgmError items = 100526016; + * @param array<\Google\Cloud\Compute\V1\InstanceManagedByIgmError>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstanceManagedByIgmError::class); + $this->items = $arr; + + 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersListInstanceConfigsResp.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersListInstanceConfigsResp.php new file mode 100644 index 000000000000..38237c01f464 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersListInstanceConfigsResp.php @@ -0,0 +1,154 @@ +google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp + */ +class RegionInstanceGroupManagersListInstanceConfigsResp extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The list of PerInstanceConfig. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig items = 100526016; + */ + private $items; + /** + * [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; + */ + protected $next_page_token = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\PerInstanceConfig>|\Google\Protobuf\Internal\RepeatedField $items + * [Output Only] The list of PerInstanceConfig. + * @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 \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] The list of PerInstanceConfig. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * [Output Only] The list of PerInstanceConfig. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PerInstanceConfig items = 100526016; + * @param array<\Google\Cloud\Compute\V1\PerInstanceConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PerInstanceConfig::class); + $this->items = $arr; + + 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] 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersListInstancesResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersListInstancesResponse.php new file mode 100644 index 000000000000..802317a23179 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersListInstancesResponse.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse + */ +class RegionInstanceGroupManagersListInstancesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A list of managed instances. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ManagedInstance managed_instances = 336219614; + */ + private $managed_instances; + /** + * [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; + */ + protected $next_page_token = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\ManagedInstance>|\Google\Protobuf\Internal\RepeatedField $managed_instances + * A list of managed instances. + * @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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of managed instances. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ManagedInstance managed_instances = 336219614; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getManagedInstances() + { + return $this->managed_instances; + } + + /** + * A list of managed instances. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ManagedInstance managed_instances = 336219614; + * @param array<\Google\Cloud\Compute\V1\ManagedInstance>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setManagedInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ManagedInstance::class); + $this->managed_instances = $arr; + + 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersRecreateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersRecreateRequest.php new file mode 100644 index 000000000000..b6aa209696d5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersRecreateRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest + */ +class RegionInstanceGroupManagersRecreateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The URLs of one or more instances to recreate. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + * + * Generated from protobuf field repeated string instances = 29097598; + */ + private $instances; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $instances + * The URLs of one or more instances to recreate. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The URLs of one or more instances to recreate. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + * + * Generated from protobuf field repeated string instances = 29097598; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * The URLs of one or more instances to recreate. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + * + * Generated from protobuf field repeated string instances = 29097598; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->instances = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersSetTargetPoolsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersSetTargetPoolsRequest.php new file mode 100644 index 000000000000..ab169af46cd0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersSetTargetPoolsRequest.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest + */ +class RegionInstanceGroupManagersSetTargetPoolsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Fingerprint of the target pools information, which is a hash of the contents. This field is used for optimistic locking when you update the target pool entries. This field is optional. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * The URL of all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group. + * + * Generated from protobuf field repeated string target_pools = 336072617; + */ + private $target_pools; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $fingerprint + * Fingerprint of the target pools information, which is a hash of the contents. This field is used for optimistic locking when you update the target pool entries. This field is optional. + * @type array|\Google\Protobuf\Internal\RepeatedField $target_pools + * The URL of all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Fingerprint of the target pools information, which is a hash of the contents. This field is used for optimistic locking when you update the target pool entries. This field is optional. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Fingerprint of the target pools information, which is a hash of the contents. This field is used for optimistic locking when you update the target pool entries. This field is optional. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * The URL of all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group. + * + * Generated from protobuf field repeated string target_pools = 336072617; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetPools() + { + return $this->target_pools; + } + + /** + * The URL of all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group. + * + * Generated from protobuf field repeated string target_pools = 336072617; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetPools($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->target_pools = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersSetTemplateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersSetTemplateRequest.php new file mode 100644 index 000000000000..814b33e4649f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersSetTemplateRequest.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest + */ +class RegionInstanceGroupManagersSetTemplateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * URL of the InstanceTemplate resource from which all new instances will be created. + * + * Generated from protobuf field optional string instance_template = 309248228; + */ + protected $instance_template = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_template + * URL of the InstanceTemplate resource from which all new instances will be created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * URL of the InstanceTemplate resource from which all new instances will be created. + * + * Generated from protobuf field optional string instance_template = 309248228; + * @return string + */ + public function getInstanceTemplate() + { + return isset($this->instance_template) ? $this->instance_template : ''; + } + + public function hasInstanceTemplate() + { + return isset($this->instance_template); + } + + public function clearInstanceTemplate() + { + unset($this->instance_template); + } + + /** + * URL of the InstanceTemplate resource from which all new instances will be created. + * + * Generated from protobuf field optional string instance_template = 309248228; + * @param string $var + * @return $this + */ + public function setInstanceTemplate($var) + { + GPBUtil::checkString($var, True); + $this->instance_template = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupsListInstances.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupsListInstances.php new file mode 100644 index 000000000000..e0a1ba1117d6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupsListInstances.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.RegionInstanceGroupsListInstances + */ +class RegionInstanceGroupsListInstances extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of InstanceWithNamedPorts resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceWithNamedPorts items = 100526016; + */ + private $items; + /** + * The resource type. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\InstanceWithNamedPorts>|\Google\Protobuf\Internal\RepeatedField $items + * A list of InstanceWithNamedPorts resources. + * @type string $kind + * The resource type. + * @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 InstanceWithNamedPorts resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceWithNamedPorts items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of InstanceWithNamedPorts resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceWithNamedPorts items = 100526016; + * @param array<\Google\Cloud\Compute\V1\InstanceWithNamedPorts>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstanceWithNamedPorts::class); + $this->items = $arr; + + return $this; + } + + /** + * The resource type. + * + * 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); + } + + /** + * The resource type. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupsListInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupsListInstancesRequest.php new file mode 100644 index 000000000000..9ccc34502461 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupsListInstancesRequest.php @@ -0,0 +1,124 @@ +google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest + */ +class RegionInstanceGroupsListInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Instances in which state should be returned. Valid options are: 'ALL', 'RUNNING'. By default, it lists all instances. + * Check the InstanceState enum for the list of possible values. + * + * Generated from protobuf field optional string instance_state = 92223591; + */ + protected $instance_state = null; + /** + * Name of port user is interested in. It is optional. If it is set, only information about this ports will be returned. If it is not set, all the named ports will be returned. Always lists all instances. + * + * Generated from protobuf field optional string port_name = 41534345; + */ + protected $port_name = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_state + * Instances in which state should be returned. Valid options are: 'ALL', 'RUNNING'. By default, it lists all instances. + * Check the InstanceState enum for the list of possible values. + * @type string $port_name + * Name of port user is interested in. It is optional. If it is set, only information about this ports will be returned. If it is not set, all the named ports will be returned. Always lists all instances. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Instances in which state should be returned. Valid options are: 'ALL', 'RUNNING'. By default, it lists all instances. + * Check the InstanceState enum for the list of possible values. + * + * Generated from protobuf field optional string instance_state = 92223591; + * @return string + */ + public function getInstanceState() + { + return isset($this->instance_state) ? $this->instance_state : ''; + } + + public function hasInstanceState() + { + return isset($this->instance_state); + } + + public function clearInstanceState() + { + unset($this->instance_state); + } + + /** + * Instances in which state should be returned. Valid options are: 'ALL', 'RUNNING'. By default, it lists all instances. + * Check the InstanceState enum for the list of possible values. + * + * Generated from protobuf field optional string instance_state = 92223591; + * @param string $var + * @return $this + */ + public function setInstanceState($var) + { + GPBUtil::checkString($var, True); + $this->instance_state = $var; + + return $this; + } + + /** + * Name of port user is interested in. It is optional. If it is set, only information about this ports will be returned. If it is not set, all the named ports will be returned. Always lists all instances. + * + * Generated from protobuf field optional string port_name = 41534345; + * @return string + */ + public function getPortName() + { + return isset($this->port_name) ? $this->port_name : ''; + } + + public function hasPortName() + { + return isset($this->port_name); + } + + public function clearPortName() + { + unset($this->port_name); + } + + /** + * Name of port user is interested in. It is optional. If it is set, only information about this ports will be returned. If it is not set, all the named ports will be returned. Always lists all instances. + * + * Generated from protobuf field optional string port_name = 41534345; + * @param string $var + * @return $this + */ + public function setPortName($var) + { + GPBUtil::checkString($var, True); + $this->port_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupsListInstancesRequest/InstanceState.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupsListInstancesRequest/InstanceState.php new file mode 100644 index 000000000000..734f52e1011e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupsListInstancesRequest/InstanceState.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest.InstanceState + */ +class InstanceState +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_INSTANCE_STATE = 0; + */ + const UNDEFINED_INSTANCE_STATE = 0; + /** + * Matches any status of the instances, running, non-running and others. + * + * Generated from protobuf enum ALL = 64897; + */ + const ALL = 64897; + /** + * Instance is in RUNNING state if it is running. + * + * Generated from protobuf enum RUNNING = 121282975; + */ + const RUNNING = 121282975; + + private static $valueToName = [ + self::UNDEFINED_INSTANCE_STATE => 'UNDEFINED_INSTANCE_STATE', + self::ALL => 'ALL', + self::RUNNING => 'RUNNING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(InstanceState::class, \Google\Cloud\Compute\V1\RegionInstanceGroupsListInstancesRequest_InstanceState::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupsSetNamedPortsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupsSetNamedPortsRequest.php new file mode 100644 index 000000000000..6bcf0fabd915 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupsSetNamedPortsRequest.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest + */ +class RegionInstanceGroupsSetNamedPortsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The fingerprint of the named ports information for this instance group. Use this optional property to prevent conflicts when multiple users change the named ports settings concurrently. Obtain the fingerprint with the instanceGroups.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * The list of named ports to set for this instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NamedPort named_ports = 427598732; + */ + private $named_ports; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $fingerprint + * The fingerprint of the named ports information for this instance group. Use this optional property to prevent conflicts when multiple users change the named ports settings concurrently. Obtain the fingerprint with the instanceGroups.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request. + * @type array<\Google\Cloud\Compute\V1\NamedPort>|\Google\Protobuf\Internal\RepeatedField $named_ports + * The list of named ports to set for this instance group. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The fingerprint of the named ports information for this instance group. Use this optional property to prevent conflicts when multiple users change the named ports settings concurrently. Obtain the fingerprint with the instanceGroups.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * The fingerprint of the named ports information for this instance group. Use this optional property to prevent conflicts when multiple users change the named ports settings concurrently. Obtain the fingerprint with the instanceGroups.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * The list of named ports to set for this instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NamedPort named_ports = 427598732; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNamedPorts() + { + return $this->named_ports; + } + + /** + * The list of named ports to set for this instance group. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NamedPort named_ports = 427598732; + * @param array<\Google\Cloud\Compute\V1\NamedPort>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNamedPorts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NamedPort::class); + $this->named_ports = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionList.php new file mode 100644 index 000000000000..5fc04b3ec34f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.RegionList + */ +class RegionList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of Region resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Region items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#regionList for lists of regions. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\Region>|\Google\Protobuf\Internal\RepeatedField $items + * A list of Region resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#regionList for lists of regions. + * @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 Region resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Region items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of Region resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Region items = 100526016; + * @param array<\Google\Cloud\Compute\V1\Region>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Region::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#regionList for lists of regions. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#regionList for lists of regions. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionNetworkEndpointGroupsAttachEndpointsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionNetworkEndpointGroupsAttachEndpointsRequest.php new file mode 100644 index 000000000000..128ae61c258a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionNetworkEndpointGroupsAttachEndpointsRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.RegionNetworkEndpointGroupsAttachEndpointsRequest + */ +class RegionNetworkEndpointGroupsAttachEndpointsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The list of network endpoints to be attached. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpoint network_endpoints = 149850285; + */ + private $network_endpoints; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\NetworkEndpoint>|\Google\Protobuf\Internal\RepeatedField $network_endpoints + * The list of network endpoints to be attached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The list of network endpoints to be attached. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpoint network_endpoints = 149850285; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkEndpoints() + { + return $this->network_endpoints; + } + + /** + * The list of network endpoints to be attached. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpoint network_endpoints = 149850285; + * @param array<\Google\Cloud\Compute\V1\NetworkEndpoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkEndpoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NetworkEndpoint::class); + $this->network_endpoints = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionNetworkEndpointGroupsDetachEndpointsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionNetworkEndpointGroupsDetachEndpointsRequest.php new file mode 100644 index 000000000000..05b7679a7cd2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionNetworkEndpointGroupsDetachEndpointsRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.RegionNetworkEndpointGroupsDetachEndpointsRequest + */ +class RegionNetworkEndpointGroupsDetachEndpointsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The list of network endpoints to be detached. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpoint network_endpoints = 149850285; + */ + private $network_endpoints; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\NetworkEndpoint>|\Google\Protobuf\Internal\RepeatedField $network_endpoints + * The list of network endpoints to be detached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The list of network endpoints to be detached. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpoint network_endpoints = 149850285; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkEndpoints() + { + return $this->network_endpoints; + } + + /** + * The list of network endpoints to be detached. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkEndpoint network_endpoints = 149850285; + * @param array<\Google\Cloud\Compute\V1\NetworkEndpoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkEndpoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NetworkEndpoint::class); + $this->network_endpoints = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse.php new file mode 100644 index 000000000000..bc85f35dc197 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse.php @@ -0,0 +1,100 @@ +google.cloud.compute.v1.RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse + */ +class RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Effective firewalls from firewall policy. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy firewall_policys = 410985794; + */ + private $firewall_policys; + /** + * Effective firewalls on the network. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Firewall firewalls = 272245619; + */ + private $firewalls; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy>|\Google\Protobuf\Internal\RepeatedField $firewall_policys + * Effective firewalls from firewall policy. + * @type array<\Google\Cloud\Compute\V1\Firewall>|\Google\Protobuf\Internal\RepeatedField $firewalls + * Effective firewalls on the network. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Effective firewalls from firewall policy. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy firewall_policys = 410985794; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFirewallPolicys() + { + return $this->firewall_policys; + } + + /** + * Effective firewalls from firewall policy. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy firewall_policys = 410985794; + * @param array<\Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFirewallPolicys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy::class); + $this->firewall_policys = $arr; + + return $this; + } + + /** + * Effective firewalls on the network. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Firewall firewalls = 272245619; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFirewalls() + { + return $this->firewalls; + } + + /** + * Effective firewalls on the network. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Firewall firewalls = 272245619; + * @param array<\Google\Cloud\Compute\V1\Firewall>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFirewalls($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Firewall::class); + $this->firewalls = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.php new file mode 100644 index 000000000000..b4c425984988 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.php @@ -0,0 +1,202 @@ +google.cloud.compute.v1.RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + */ +class RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The display name of the firewall policy. + * + * Generated from protobuf field optional string display_name = 4473832; + */ + protected $display_name = null; + /** + * [Output Only] The name of the firewall policy. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * The rules that apply to the network. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyRule rules = 108873975; + */ + private $rules; + /** + * [Output Only] The type of the firewall policy. Can be one of HIERARCHY, NETWORK, NETWORK_REGIONAL, SYSTEM_GLOBAL, SYSTEM_REGIONAL. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $display_name + * [Output Only] The display name of the firewall policy. + * @type string $name + * [Output Only] The name of the firewall policy. + * @type array<\Google\Cloud\Compute\V1\FirewallPolicyRule>|\Google\Protobuf\Internal\RepeatedField $rules + * The rules that apply to the network. + * @type string $type + * [Output Only] The type of the firewall policy. Can be one of HIERARCHY, NETWORK, NETWORK_REGIONAL, SYSTEM_GLOBAL, SYSTEM_REGIONAL. + * Check the Type enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The display name of the firewall policy. + * + * Generated from protobuf field optional string display_name = 4473832; + * @return string + */ + public function getDisplayName() + { + return isset($this->display_name) ? $this->display_name : ''; + } + + public function hasDisplayName() + { + return isset($this->display_name); + } + + public function clearDisplayName() + { + unset($this->display_name); + } + + /** + * [Output Only] The display name of the firewall policy. + * + * Generated from protobuf field optional string display_name = 4473832; + * @param string $var + * @return $this + */ + public function setDisplayName($var) + { + GPBUtil::checkString($var, True); + $this->display_name = $var; + + return $this; + } + + /** + * [Output Only] The name of the firewall policy. + * + * 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); + } + + /** + * [Output Only] The name of the firewall policy. + * + * 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; + } + + /** + * The rules that apply to the network. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyRule rules = 108873975; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * The rules that apply to the network. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyRule rules = 108873975; + * @param array<\Google\Cloud\Compute\V1\FirewallPolicyRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\FirewallPolicyRule::class); + $this->rules = $arr; + + return $this; + } + + /** + * [Output Only] The type of the firewall policy. Can be one of HIERARCHY, NETWORK, NETWORK_REGIONAL, SYSTEM_GLOBAL, SYSTEM_REGIONAL. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * [Output Only] The type of the firewall policy. Can be one of HIERARCHY, NETWORK, NETWORK_REGIONAL, SYSTEM_GLOBAL, SYSTEM_REGIONAL. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy/Type.php new file mode 100644 index 000000000000..9122cb923804 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy/Type.php @@ -0,0 +1,70 @@ +google.cloud.compute.v1.RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.Type + */ +class Type +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TYPE = 0; + */ + const UNDEFINED_TYPE = 0; + /** + * Generated from protobuf enum HIERARCHY = 69902869; + */ + const HIERARCHY = 69902869; + /** + * Generated from protobuf enum NETWORK = 413984270; + */ + const NETWORK = 413984270; + /** + * Generated from protobuf enum NETWORK_REGIONAL = 190804272; + */ + const NETWORK_REGIONAL = 190804272; + /** + * Generated from protobuf enum UNSPECIFIED = 526786327; + */ + const UNSPECIFIED = 526786327; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::HIERARCHY => 'HIERARCHY', + self::NETWORK => 'NETWORK', + self::NETWORK_REGIONAL => 'NETWORK_REGIONAL', + self::UNSPECIFIED => 'UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy_Type::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionSetLabelsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionSetLabelsRequest.php new file mode 100644 index 000000000000..70a97e1faf49 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionSetLabelsRequest.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.RegionSetLabelsRequest + */ +class RegionSetLabelsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The fingerprint of the previous set of labels for this resource, used to detect conflicts. 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. Make a get() request to the resource to get the latest fingerprint. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + */ + protected $label_fingerprint = null; + /** + * The labels to set for this resource. + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $label_fingerprint + * The fingerprint of the previous set of labels for this resource, used to detect conflicts. 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. Make a get() request to the resource to get the latest fingerprint. + * @type array|\Google\Protobuf\Internal\MapField $labels + * The labels to set for this resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The fingerprint of the previous set of labels for this resource, used to detect conflicts. 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. Make a get() request to the resource to get the latest fingerprint. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @return string + */ + public function getLabelFingerprint() + { + return isset($this->label_fingerprint) ? $this->label_fingerprint : ''; + } + + public function hasLabelFingerprint() + { + return isset($this->label_fingerprint); + } + + public function clearLabelFingerprint() + { + unset($this->label_fingerprint); + } + + /** + * The fingerprint of the previous set of labels for this resource, used to detect conflicts. 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. Make a get() request to the resource to get the latest fingerprint. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @param string $var + * @return $this + */ + public function setLabelFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->label_fingerprint = $var; + + return $this; + } + + /** + * The labels to set for this resource. + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * The labels to set for this resource. + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionSetPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionSetPolicyRequest.php new file mode 100644 index 000000000000..e94a987b507d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionSetPolicyRequest.php @@ -0,0 +1,154 @@ +google.cloud.compute.v1.RegionSetPolicyRequest + */ +class RegionSetPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use 'policy' to specify bindings. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Binding bindings = 403251854; + */ + private $bindings; + /** + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + * + * Generated from protobuf field optional string etag = 3123477; + */ + protected $etag = null; + /** + * REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Policy policy = 91071794; + */ + protected $policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\Binding>|\Google\Protobuf\Internal\RepeatedField $bindings + * Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use 'policy' to specify bindings. + * @type string $etag + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + * @type \Google\Cloud\Compute\V1\Policy $policy + * REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use 'policy' to specify bindings. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Binding bindings = 403251854; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBindings() + { + return $this->bindings; + } + + /** + * Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use 'policy' to specify bindings. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Binding bindings = 403251854; + * @param array<\Google\Cloud\Compute\V1\Binding>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBindings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Binding::class); + $this->bindings = $arr; + + return $this; + } + + /** + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + * + * Generated from protobuf field optional string etag = 3123477; + * @return string + */ + public function getEtag() + { + return isset($this->etag) ? $this->etag : ''; + } + + public function hasEtag() + { + return isset($this->etag); + } + + public function clearEtag() + { + unset($this->etag); + } + + /** + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + * + * Generated from protobuf field optional string etag = 3123477; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Policy policy = 91071794; + * @return \Google\Cloud\Compute\V1\Policy|null + */ + public function getPolicy() + { + return $this->policy; + } + + public function hasPolicy() + { + return isset($this->policy); + } + + public function clearPolicy() + { + unset($this->policy); + } + + /** + * REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Policy policy = 91071794; + * @param \Google\Cloud\Compute\V1\Policy $var + * @return $this + */ + public function setPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Policy::class); + $this->policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionTargetHttpsProxiesSetSslCertificatesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionTargetHttpsProxiesSetSslCertificatesRequest.php new file mode 100644 index 000000000000..82f363bf881e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionTargetHttpsProxiesSetSslCertificatesRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest + */ +class RegionTargetHttpsProxiesSetSslCertificatesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * New set of SslCertificate resources to associate with this TargetHttpsProxy resource. + * + * Generated from protobuf field repeated string ssl_certificates = 366006543; + */ + private $ssl_certificates; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $ssl_certificates + * New set of SslCertificate resources to associate with this TargetHttpsProxy resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * New set of SslCertificate resources to associate with this TargetHttpsProxy resource. + * + * Generated from protobuf field repeated string ssl_certificates = 366006543; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSslCertificates() + { + return $this->ssl_certificates; + } + + /** + * New set of SslCertificate resources to associate with this TargetHttpsProxy resource. + * + * Generated from protobuf field repeated string ssl_certificates = 366006543; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSslCertificates($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ssl_certificates = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionUrlMapsValidateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionUrlMapsValidateRequest.php new file mode 100644 index 000000000000..8cfb439af703 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionUrlMapsValidateRequest.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.RegionUrlMapsValidateRequest + */ +class RegionUrlMapsValidateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Content of the UrlMap to be validated. + * + * Generated from protobuf field optional .google.cloud.compute.v1.UrlMap resource = 195806222; + */ + protected $resource = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\UrlMap $resource + * Content of the UrlMap to be validated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Content of the UrlMap to be validated. + * + * Generated from protobuf field optional .google.cloud.compute.v1.UrlMap resource = 195806222; + * @return \Google\Cloud\Compute\V1\UrlMap|null + */ + public function getResource() + { + return $this->resource; + } + + public function hasResource() + { + return isset($this->resource); + } + + public function clearResource() + { + unset($this->resource); + } + + /** + * Content of the UrlMap to be validated. + * + * Generated from protobuf field optional .google.cloud.compute.v1.UrlMap resource = 195806222; + * @param \Google\Cloud\Compute\V1\UrlMap $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\UrlMap::class); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveAssociationFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveAssociationFirewallPolicyRequest.php new file mode 100644 index 000000000000..03e2b6d5e9d0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveAssociationFirewallPolicyRequest.php @@ -0,0 +1,168 @@ +google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest + */ +class RemoveAssociationFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * Name for the attachment that will be removed. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $firewallPolicy Name of the firewall policy to update. + * + * @return \Google\Cloud\Compute\V1\RemoveAssociationFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $firewallPolicy): self + { + return (new self()) + ->setFirewallPolicy($firewallPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to update. + * @type string $name + * Name for the attachment that will be removed. + * @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); + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * Name for the attachment that will be removed. + * + * 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); + } + + /** + * Name for the attachment that will be removed. + * + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveAssociationNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveAssociationNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..fdc0ca3fbaac --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveAssociationNetworkFirewallPolicyRequest.php @@ -0,0 +1,204 @@ +google.cloud.compute.v1.RemoveAssociationNetworkFirewallPolicyRequest + */ +class RemoveAssociationNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * Name for the attachment that will be removed. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $firewallPolicy Name of the firewall policy to update. + * + * @return \Google\Cloud\Compute\V1\RemoveAssociationNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $firewallPolicy): self + { + return (new self()) + ->setProject($project) + ->setFirewallPolicy($firewallPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to update. + * @type string $name + * Name for the attachment that will be removed. + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * Name for the attachment that will be removed. + * + * 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); + } + + /** + * Name for the attachment that will be removed. + * + * 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; + } + + /** + * 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveAssociationRegionNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveAssociationRegionNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..79c3e3d27bd1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveAssociationRegionNetworkFirewallPolicyRequest.php @@ -0,0 +1,240 @@ +google.cloud.compute.v1.RemoveAssociationRegionNetworkFirewallPolicyRequest + */ +class RemoveAssociationRegionNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * Name for the association that will be removed. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $firewallPolicy Name of the firewall policy to update. + * + * @return \Google\Cloud\Compute\V1\RemoveAssociationRegionNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $firewallPolicy): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setFirewallPolicy($firewallPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to update. + * @type string $name + * Name for the association that will be removed. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * Name for the association that will be removed. + * + * 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); + } + + /** + * Name for the association that will be removed. + * + * 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; + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveHealthCheckTargetPoolRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveHealthCheckTargetPoolRequest.php new file mode 100644 index 000000000000..7a7643ddd26f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveHealthCheckTargetPoolRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest + */ +class RemoveHealthCheckTargetPoolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the target pool to remove health checks from. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_pool = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest target_pools_remove_health_check_request_resource = 304985011 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_pools_remove_health_check_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $targetPool Name of the target pool to remove health checks from. + * @param \Google\Cloud\Compute\V1\TargetPoolsRemoveHealthCheckRequest $targetPoolsRemoveHealthCheckRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\RemoveHealthCheckTargetPoolRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $targetPool, \Google\Cloud\Compute\V1\TargetPoolsRemoveHealthCheckRequest $targetPoolsRemoveHealthCheckRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetPoolsRemoveHealthCheckRequestResource($targetPoolsRemoveHealthCheckRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * 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 $target_pool + * Name of the target pool to remove health checks from. + * @type \Google\Cloud\Compute\V1\TargetPoolsRemoveHealthCheckRequest $target_pools_remove_health_check_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Name of the target pool to remove health checks from. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetPool() + { + return $this->target_pool; + } + + /** + * Name of the target pool to remove health checks from. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetPool($var) + { + GPBUtil::checkString($var, True); + $this->target_pool = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest target_pools_remove_health_check_request_resource = 304985011 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetPoolsRemoveHealthCheckRequest|null + */ + public function getTargetPoolsRemoveHealthCheckRequestResource() + { + return $this->target_pools_remove_health_check_request_resource; + } + + public function hasTargetPoolsRemoveHealthCheckRequestResource() + { + return isset($this->target_pools_remove_health_check_request_resource); + } + + public function clearTargetPoolsRemoveHealthCheckRequestResource() + { + unset($this->target_pools_remove_health_check_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest target_pools_remove_health_check_request_resource = 304985011 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetPoolsRemoveHealthCheckRequest $var + * @return $this + */ + public function setTargetPoolsRemoveHealthCheckRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetPoolsRemoveHealthCheckRequest::class); + $this->target_pools_remove_health_check_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveInstanceTargetPoolRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveInstanceTargetPoolRequest.php new file mode 100644 index 000000000000..6cbe66e2cf0b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveInstanceTargetPoolRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.RemoveInstanceTargetPoolRequest + */ +class RemoveInstanceTargetPoolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the TargetPool resource to remove instances from. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_pool = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest target_pools_remove_instance_request_resource = 29548547 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_pools_remove_instance_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetPool Name of the TargetPool resource to remove instances from. + * @param \Google\Cloud\Compute\V1\TargetPoolsRemoveInstanceRequest $targetPoolsRemoveInstanceRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\RemoveInstanceTargetPoolRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $targetPool, \Google\Cloud\Compute\V1\TargetPoolsRemoveInstanceRequest $targetPoolsRemoveInstanceRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetPoolsRemoveInstanceRequestResource($targetPoolsRemoveInstanceRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 $target_pool + * Name of the TargetPool resource to remove instances from. + * @type \Google\Cloud\Compute\V1\TargetPoolsRemoveInstanceRequest $target_pools_remove_instance_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the TargetPool resource to remove instances from. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetPool() + { + return $this->target_pool; + } + + /** + * Name of the TargetPool resource to remove instances from. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetPool($var) + { + GPBUtil::checkString($var, True); + $this->target_pool = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest target_pools_remove_instance_request_resource = 29548547 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetPoolsRemoveInstanceRequest|null + */ + public function getTargetPoolsRemoveInstanceRequestResource() + { + return $this->target_pools_remove_instance_request_resource; + } + + public function hasTargetPoolsRemoveInstanceRequestResource() + { + return isset($this->target_pools_remove_instance_request_resource); + } + + public function clearTargetPoolsRemoveInstanceRequestResource() + { + unset($this->target_pools_remove_instance_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest target_pools_remove_instance_request_resource = 29548547 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetPoolsRemoveInstanceRequest $var + * @return $this + */ + public function setTargetPoolsRemoveInstanceRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetPoolsRemoveInstanceRequest::class); + $this->target_pools_remove_instance_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveInstancesInstanceGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveInstancesInstanceGroupRequest.php new file mode 100644 index 000000000000..6ee2acd66154 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveInstancesInstanceGroupRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest + */ +class RemoveInstancesInstanceGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the instance group where the specified instances will be removed. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest instance_groups_remove_instances_request_resource = 390981817 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_groups_remove_instances_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the zone where the instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the instance group is located. + * @param string $instanceGroup The name of the instance group where the specified instances will be removed. + * @param \Google\Cloud\Compute\V1\InstanceGroupsRemoveInstancesRequest $instanceGroupsRemoveInstancesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\RemoveInstancesInstanceGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroup, \Google\Cloud\Compute\V1\InstanceGroupsRemoveInstancesRequest $instanceGroupsRemoveInstancesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroup($instanceGroup) + ->setInstanceGroupsRemoveInstancesRequestResource($instanceGroupsRemoveInstancesRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group + * The name of the instance group where the specified instances will be removed. + * @type \Google\Cloud\Compute\V1\InstanceGroupsRemoveInstancesRequest $instance_groups_remove_instances_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 where the instance group is located. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the instance group where the specified instances will be removed. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroup() + { + return $this->instance_group; + } + + /** + * The name of the instance group where the specified instances will be removed. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroup($var) + { + GPBUtil::checkString($var, True); + $this->instance_group = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest instance_groups_remove_instances_request_resource = 390981817 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupsRemoveInstancesRequest|null + */ + public function getInstanceGroupsRemoveInstancesRequestResource() + { + return $this->instance_groups_remove_instances_request_resource; + } + + public function hasInstanceGroupsRemoveInstancesRequestResource() + { + return isset($this->instance_groups_remove_instances_request_resource); + } + + public function clearInstanceGroupsRemoveInstancesRequestResource() + { + unset($this->instance_groups_remove_instances_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest instance_groups_remove_instances_request_resource = 390981817 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupsRemoveInstancesRequest $var + * @return $this + */ + public function setInstanceGroupsRemoveInstancesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupsRemoveInstancesRequest::class); + $this->instance_groups_remove_instances_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 where the instance group is located. + * + * 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 where the instance group is located. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemovePeeringNetworkRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemovePeeringNetworkRequest.php new file mode 100644 index 000000000000..9006c03e0405 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemovePeeringNetworkRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.RemovePeeringNetworkRequest + */ +class RemovePeeringNetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the network resource to remove peering from. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworksRemovePeeringRequest networks_remove_peering_request_resource = 421162494 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $networks_remove_peering_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $network Name of the network resource to remove peering from. + * @param \Google\Cloud\Compute\V1\NetworksRemovePeeringRequest $networksRemovePeeringRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\RemovePeeringNetworkRequest + * + * @experimental + */ + public static function build(string $project, string $network, \Google\Cloud\Compute\V1\NetworksRemovePeeringRequest $networksRemovePeeringRequestResource): self + { + return (new self()) + ->setProject($project) + ->setNetwork($network) + ->setNetworksRemovePeeringRequestResource($networksRemovePeeringRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Name of the network resource to remove peering from. + * @type \Google\Cloud\Compute\V1\NetworksRemovePeeringRequest $networks_remove_peering_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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the network resource to remove peering from. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Name of the network resource to remove peering from. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworksRemovePeeringRequest networks_remove_peering_request_resource = 421162494 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NetworksRemovePeeringRequest|null + */ + public function getNetworksRemovePeeringRequestResource() + { + return $this->networks_remove_peering_request_resource; + } + + public function hasNetworksRemovePeeringRequestResource() + { + return isset($this->networks_remove_peering_request_resource); + } + + public function clearNetworksRemovePeeringRequestResource() + { + unset($this->networks_remove_peering_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworksRemovePeeringRequest networks_remove_peering_request_resource = 421162494 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NetworksRemovePeeringRequest $var + * @return $this + */ + public function setNetworksRemovePeeringRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworksRemovePeeringRequest::class); + $this->networks_remove_peering_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveResourcePoliciesDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveResourcePoliciesDiskRequest.php new file mode 100644 index 000000000000..af2f38f54426 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveResourcePoliciesDiskRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest + */ +class RemoveResourcePoliciesDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The disk name for this request. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest disks_remove_resource_policies_request_resource = 436756718 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disks_remove_resource_policies_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $disk The disk name for this request. + * @param \Google\Cloud\Compute\V1\DisksRemoveResourcePoliciesRequest $disksRemoveResourcePoliciesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\RemoveResourcePoliciesDiskRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $disk, \Google\Cloud\Compute\V1\DisksRemoveResourcePoliciesRequest $disksRemoveResourcePoliciesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setDisk($disk) + ->setDisksRemoveResourcePoliciesRequestResource($disksRemoveResourcePoliciesRequestResource); + } + + /** + * 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\DisksRemoveResourcePoliciesRequest $disks_remove_resource_policies_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 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.DisksRemoveResourcePoliciesRequest disks_remove_resource_policies_request_resource = 436756718 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\DisksRemoveResourcePoliciesRequest|null + */ + public function getDisksRemoveResourcePoliciesRequestResource() + { + return $this->disks_remove_resource_policies_request_resource; + } + + public function hasDisksRemoveResourcePoliciesRequestResource() + { + return isset($this->disks_remove_resource_policies_request_resource); + } + + public function clearDisksRemoveResourcePoliciesRequestResource() + { + unset($this->disks_remove_resource_policies_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest disks_remove_resource_policies_request_resource = 436756718 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\DisksRemoveResourcePoliciesRequest $var + * @return $this + */ + public function setDisksRemoveResourcePoliciesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DisksRemoveResourcePoliciesRequest::class); + $this->disks_remove_resource_policies_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveResourcePoliciesInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveResourcePoliciesInstanceRequest.php new file mode 100644 index 000000000000..ac89343c48d5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveResourcePoliciesInstanceRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest + */ +class RemoveResourcePoliciesInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The instance name for this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest instances_remove_resource_policies_request_resource = 49229558 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instances_remove_resource_policies_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance The instance name for this request. + * @param \Google\Cloud\Compute\V1\InstancesRemoveResourcePoliciesRequest $instancesRemoveResourcePoliciesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\RemoveResourcePoliciesInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, \Google\Cloud\Compute\V1\InstancesRemoveResourcePoliciesRequest $instancesRemoveResourcePoliciesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setInstancesRemoveResourcePoliciesRequestResource($instancesRemoveResourcePoliciesRequestResource); + } + + /** + * 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\InstancesRemoveResourcePoliciesRequest $instances_remove_resource_policies_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.InstancesRemoveResourcePoliciesRequest instances_remove_resource_policies_request_resource = 49229558 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstancesRemoveResourcePoliciesRequest|null + */ + public function getInstancesRemoveResourcePoliciesRequestResource() + { + return $this->instances_remove_resource_policies_request_resource; + } + + public function hasInstancesRemoveResourcePoliciesRequestResource() + { + return isset($this->instances_remove_resource_policies_request_resource); + } + + public function clearInstancesRemoveResourcePoliciesRequestResource() + { + unset($this->instances_remove_resource_policies_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest instances_remove_resource_policies_request_resource = 49229558 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstancesRemoveResourcePoliciesRequest $var + * @return $this + */ + public function setInstancesRemoveResourcePoliciesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstancesRemoveResourcePoliciesRequest::class); + $this->instances_remove_resource_policies_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveResourcePoliciesRegionDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveResourcePoliciesRegionDiskRequest.php new file mode 100644 index 000000000000..35d27067d021 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveResourcePoliciesRegionDiskRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest + */ +class RemoveResourcePoliciesRegionDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The disk name for this request. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest region_disks_remove_resource_policies_request_resource = 8741283 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_disks_remove_resource_policies_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $disk The disk name for this request. + * @param \Google\Cloud\Compute\V1\RegionDisksRemoveResourcePoliciesRequest $regionDisksRemoveResourcePoliciesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\RemoveResourcePoliciesRegionDiskRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $disk, \Google\Cloud\Compute\V1\RegionDisksRemoveResourcePoliciesRequest $regionDisksRemoveResourcePoliciesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setDisk($disk) + ->setRegionDisksRemoveResourcePoliciesRequestResource($regionDisksRemoveResourcePoliciesRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $disk + * The disk name for this request. + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type \Google\Cloud\Compute\V1\RegionDisksRemoveResourcePoliciesRequest $region_disks_remove_resource_policies_request_resource + * The body resource 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 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; + } + + /** + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest region_disks_remove_resource_policies_request_resource = 8741283 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionDisksRemoveResourcePoliciesRequest|null + */ + public function getRegionDisksRemoveResourcePoliciesRequestResource() + { + return $this->region_disks_remove_resource_policies_request_resource; + } + + public function hasRegionDisksRemoveResourcePoliciesRequestResource() + { + return isset($this->region_disks_remove_resource_policies_request_resource); + } + + public function clearRegionDisksRemoveResourcePoliciesRequestResource() + { + unset($this->region_disks_remove_resource_policies_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest region_disks_remove_resource_policies_request_resource = 8741283 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionDisksRemoveResourcePoliciesRequest $var + * @return $this + */ + public function setRegionDisksRemoveResourcePoliciesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionDisksRemoveResourcePoliciesRequest::class); + $this->region_disks_remove_resource_policies_request_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveRuleFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveRuleFirewallPolicyRequest.php new file mode 100644 index 000000000000..608dec586b82 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveRuleFirewallPolicyRequest.php @@ -0,0 +1,168 @@ +google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest + */ +class RemoveRuleFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * The priority of the rule to remove from the firewall policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + */ + protected $priority = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $firewallPolicy Name of the firewall policy to update. + * + * @return \Google\Cloud\Compute\V1\RemoveRuleFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $firewallPolicy): self + { + return (new self()) + ->setFirewallPolicy($firewallPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to update. + * @type int $priority + * The priority of the rule to remove from the firewall policy. + * @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); + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * The priority of the rule to remove from the firewall policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @return int + */ + public function getPriority() + { + return isset($this->priority) ? $this->priority : 0; + } + + public function hasPriority() + { + return isset($this->priority); + } + + public function clearPriority() + { + unset($this->priority); + } + + /** + * The priority of the rule to remove from the firewall policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt32($var); + $this->priority = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveRuleNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveRuleNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..e6e2ad879431 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveRuleNetworkFirewallPolicyRequest.php @@ -0,0 +1,204 @@ +google.cloud.compute.v1.RemoveRuleNetworkFirewallPolicyRequest + */ +class RemoveRuleNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * The priority of the rule to remove from the firewall policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + */ + protected $priority = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $firewallPolicy Name of the firewall policy to update. + * + * @return \Google\Cloud\Compute\V1\RemoveRuleNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $firewallPolicy): self + { + return (new self()) + ->setProject($project) + ->setFirewallPolicy($firewallPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to update. + * @type int $priority + * The priority of the rule to remove from the firewall policy. + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * The priority of the rule to remove from the firewall policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @return int + */ + public function getPriority() + { + return isset($this->priority) ? $this->priority : 0; + } + + public function hasPriority() + { + return isset($this->priority); + } + + public function clearPriority() + { + unset($this->priority); + } + + /** + * The priority of the rule to remove from the firewall policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt32($var); + $this->priority = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveRuleRegionNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveRuleRegionNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..7a998a24ccd1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveRuleRegionNetworkFirewallPolicyRequest.php @@ -0,0 +1,240 @@ +google.cloud.compute.v1.RemoveRuleRegionNetworkFirewallPolicyRequest + */ +class RemoveRuleRegionNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_policy = ''; + /** + * The priority of the rule to remove from the firewall policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + */ + protected $priority = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $firewallPolicy Name of the firewall policy to update. + * + * @return \Google\Cloud\Compute\V1\RemoveRuleRegionNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $firewallPolicy): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setFirewallPolicy($firewallPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall_policy + * Name of the firewall policy to update. + * @type int $priority + * The priority of the rule to remove from the firewall policy. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewallPolicy() + { + return $this->firewall_policy; + } + + /** + * Name of the firewall policy to update. + * + * Generated from protobuf field string firewall_policy = 498173265 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewallPolicy($var) + { + GPBUtil::checkString($var, True); + $this->firewall_policy = $var; + + return $this; + } + + /** + * The priority of the rule to remove from the firewall policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @return int + */ + public function getPriority() + { + return isset($this->priority) ? $this->priority : 0; + } + + public function hasPriority() + { + return isset($this->priority); + } + + public function clearPriority() + { + unset($this->priority); + } + + /** + * The priority of the rule to remove from the firewall policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt32($var); + $this->priority = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveRuleRegionSecurityPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveRuleRegionSecurityPolicyRequest.php new file mode 100644 index 000000000000..f800fd967994 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveRuleRegionSecurityPolicyRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.RemoveRuleRegionSecurityPolicyRequest + */ +class RemoveRuleRegionSecurityPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The priority of the rule to remove from the security policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + */ + protected $priority = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $securityPolicy Name of the security policy to update. + * + * @return \Google\Cloud\Compute\V1\RemoveRuleRegionSecurityPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $securityPolicy): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $priority + * The priority of the rule to remove from the security policy. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type string $security_policy + * Name of the security policy to update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The priority of the rule to remove from the security policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @return int + */ + public function getPriority() + { + return isset($this->priority) ? $this->priority : 0; + } + + public function hasPriority() + { + return isset($this->priority); + } + + public function clearPriority() + { + unset($this->priority); + } + + /** + * The priority of the rule to remove from the security policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt32($var); + $this->priority = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSecurityPolicy() + { + return $this->security_policy; + } + + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->security_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveRuleSecurityPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveRuleSecurityPolicyRequest.php new file mode 100644 index 000000000000..8922e0e0a93c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RemoveRuleSecurityPolicyRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest + */ +class RemoveRuleSecurityPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The priority of the rule to remove from the security policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + */ + protected $priority = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $securityPolicy Name of the security policy to update. + * + * @return \Google\Cloud\Compute\V1\RemoveRuleSecurityPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $securityPolicy): self + { + return (new self()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $priority + * The priority of the rule to remove from the security policy. + * @type string $project + * Project ID for this request. + * @type string $security_policy + * Name of the security policy to update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The priority of the rule to remove from the security policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @return int + */ + public function getPriority() + { + return isset($this->priority) ? $this->priority : 0; + } + + public function hasPriority() + { + return isset($this->priority); + } + + public function clearPriority() + { + unset($this->priority); + } + + /** + * The priority of the rule to remove from the security policy. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt32($var); + $this->priority = $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; + } + + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSecurityPolicy() + { + return $this->security_policy; + } + + /** + * Name of the security policy to update. + * + * Generated from protobuf field string security_policy = 171082513 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->security_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RequestMirrorPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RequestMirrorPolicy.php new file mode 100644 index 000000000000..edc422264709 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RequestMirrorPolicy.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.RequestMirrorPolicy + */ +class RequestMirrorPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * The full or partial URL to the BackendService resource being mirrored to. The backend service configured for a mirroring policy must reference backends that are of the same type as the original backend service matched in the URL map. Serverless NEG backends are not currently supported as a mirrored backend service. + * + * Generated from protobuf field optional string backend_service = 306946058; + */ + protected $backend_service = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_service + * The full or partial URL to the BackendService resource being mirrored to. The backend service configured for a mirroring policy must reference backends that are of the same type as the original backend service matched in the URL map. Serverless NEG backends are not currently supported as a mirrored backend service. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The full or partial URL to the BackendService resource being mirrored to. The backend service configured for a mirroring policy must reference backends that are of the same type as the original backend service matched in the URL map. Serverless NEG backends are not currently supported as a mirrored backend service. + * + * Generated from protobuf field optional string backend_service = 306946058; + * @return string + */ + public function getBackendService() + { + return isset($this->backend_service) ? $this->backend_service : ''; + } + + public function hasBackendService() + { + return isset($this->backend_service); + } + + public function clearBackendService() + { + unset($this->backend_service); + } + + /** + * The full or partial URL to the BackendService resource being mirrored to. The backend service configured for a mirroring policy must reference backends that are of the same type as the original backend service matched in the URL map. Serverless NEG backends are not currently supported as a mirrored backend service. + * + * Generated from protobuf field optional string backend_service = 306946058; + * @param string $var + * @return $this + */ + public function setBackendService($var) + { + GPBUtil::checkString($var, True); + $this->backend_service = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Reservation.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Reservation.php new file mode 100644 index 000000000000..170d044fa038 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Reservation.php @@ -0,0 +1,731 @@ +google.cloud.compute.v1.Reservation + */ +class Reservation extends \Google\Protobuf\Internal\Message +{ + /** + * Reservation for aggregated resources, providing shape flexibility. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AllocationAggregateReservation aggregate_reservation = 291567948; + */ + protected $aggregate_reservation = null; + /** + * [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment. + * + * Generated from protobuf field optional string commitment = 482134805; + */ + protected $commitment = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#reservations for reservations. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * 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; + */ + private $resource_policies; + /** + * [Output Only] Status information for Reservation resource. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AllocationResourceStatus resource_status = 249429315; + */ + protected $resource_status = null; + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + */ + protected $satisfies_pzs = null; + /** + * [Output Only] Server-defined fully-qualified URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * Specify share-settings to create a shared reservation. This property is optional. For more information about the syntax and options for this field and its subfields, see the guide for creating a shared reservation. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ShareSettings share_settings = 266668163; + */ + protected $share_settings = null; + /** + * Reservation for instances with specific machine shapes. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AllocationSpecificSKUReservation specific_reservation = 404901951; + */ + protected $specific_reservation = null; + /** + * Indicates whether the reservation can be consumed by VMs with affinity for "any" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation. + * + * Generated from protobuf field optional bool specific_reservation_required = 226550687; + */ + protected $specific_reservation_required = null; + /** + * [Output Only] The status of the reservation. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + /** + * Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment. + * + * Generated from protobuf field optional string zone = 3744684; + */ + protected $zone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\AllocationAggregateReservation $aggregate_reservation + * Reservation for aggregated resources, providing shape flexibility. + * @type string $commitment + * [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of the resource. Always compute#reservations for reservations. + * @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 + * [Output Only] Reserved for future use. + * @type string $self_link + * [Output Only] Server-defined fully-qualified URL for this resource. + * @type \Google\Cloud\Compute\V1\ShareSettings $share_settings + * Specify share-settings to create a shared reservation. This property is optional. For more information about the syntax and options for this field and its subfields, see the guide for creating a shared reservation. + * @type \Google\Cloud\Compute\V1\AllocationSpecificSKUReservation $specific_reservation + * Reservation for instances with specific machine shapes. + * @type bool $specific_reservation_required + * Indicates whether the reservation can be consumed by VMs with affinity for "any" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation. + * @type string $status + * [Output Only] The status of the reservation. + * Check the Status enum for the list of possible values. + * @type string $zone + * Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Reservation for aggregated resources, providing shape flexibility. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AllocationAggregateReservation aggregate_reservation = 291567948; + * @return \Google\Cloud\Compute\V1\AllocationAggregateReservation|null + */ + public function getAggregateReservation() + { + return $this->aggregate_reservation; + } + + public function hasAggregateReservation() + { + return isset($this->aggregate_reservation); + } + + public function clearAggregateReservation() + { + unset($this->aggregate_reservation); + } + + /** + * Reservation for aggregated resources, providing shape flexibility. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AllocationAggregateReservation aggregate_reservation = 291567948; + * @param \Google\Cloud\Compute\V1\AllocationAggregateReservation $var + * @return $this + */ + public function setAggregateReservation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\AllocationAggregateReservation::class); + $this->aggregate_reservation = $var; + + return $this; + } + + /** + * [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment. + * + * Generated from protobuf field optional string commitment = 482134805; + * @return string + */ + public function getCommitment() + { + return isset($this->commitment) ? $this->commitment : ''; + } + + public function hasCommitment() + { + return isset($this->commitment); + } + + public function clearCommitment() + { + unset($this->commitment); + } + + /** + * [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment. + * + * Generated from protobuf field optional string commitment = 482134805; + * @param string $var + * @return $this + */ + public function setCommitment($var) + { + GPBUtil::checkString($var, True); + $this->commitment = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#reservations for reservations. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#reservations for reservations. + * + * 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; + } + + /** + * 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. + * + * 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 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. + * + * 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; + } + + /** + * 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 + */ + public function getResourcePolicies() + { + return $this->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. + * + * Generated from protobuf field map resource_policies = 22220385; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setResourcePolicies($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_policies = $arr; + + return $this; + } + + /** + * [Output Only] Status information for Reservation resource. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AllocationResourceStatus resource_status = 249429315; + * @return \Google\Cloud\Compute\V1\AllocationResourceStatus|null + */ + public function getResourceStatus() + { + return $this->resource_status; + } + + public function hasResourceStatus() + { + return isset($this->resource_status); + } + + public function clearResourceStatus() + { + unset($this->resource_status); + } + + /** + * [Output Only] Status information for Reservation resource. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AllocationResourceStatus resource_status = 249429315; + * @param \Google\Cloud\Compute\V1\AllocationResourceStatus $var + * @return $this + */ + public function setResourceStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\AllocationResourceStatus::class); + $this->resource_status = $var; + + return $this; + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + * @return bool + */ + public function getSatisfiesPzs() + { + return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; + } + + public function hasSatisfiesPzs() + { + return isset($this->satisfies_pzs); + } + + public function clearSatisfiesPzs() + { + unset($this->satisfies_pzs); + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * [Output Only] Server-defined fully-qualified 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 fully-qualified 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; + } + + /** + * Specify share-settings to create a shared reservation. This property is optional. For more information about the syntax and options for this field and its subfields, see the guide for creating a shared reservation. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ShareSettings share_settings = 266668163; + * @return \Google\Cloud\Compute\V1\ShareSettings|null + */ + public function getShareSettings() + { + return $this->share_settings; + } + + public function hasShareSettings() + { + return isset($this->share_settings); + } + + public function clearShareSettings() + { + unset($this->share_settings); + } + + /** + * Specify share-settings to create a shared reservation. This property is optional. For more information about the syntax and options for this field and its subfields, see the guide for creating a shared reservation. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ShareSettings share_settings = 266668163; + * @param \Google\Cloud\Compute\V1\ShareSettings $var + * @return $this + */ + public function setShareSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ShareSettings::class); + $this->share_settings = $var; + + return $this; + } + + /** + * Reservation for instances with specific machine shapes. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AllocationSpecificSKUReservation specific_reservation = 404901951; + * @return \Google\Cloud\Compute\V1\AllocationSpecificSKUReservation|null + */ + public function getSpecificReservation() + { + return $this->specific_reservation; + } + + public function hasSpecificReservation() + { + return isset($this->specific_reservation); + } + + public function clearSpecificReservation() + { + unset($this->specific_reservation); + } + + /** + * Reservation for instances with specific machine shapes. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AllocationSpecificSKUReservation specific_reservation = 404901951; + * @param \Google\Cloud\Compute\V1\AllocationSpecificSKUReservation $var + * @return $this + */ + public function setSpecificReservation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\AllocationSpecificSKUReservation::class); + $this->specific_reservation = $var; + + return $this; + } + + /** + * Indicates whether the reservation can be consumed by VMs with affinity for "any" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation. + * + * Generated from protobuf field optional bool specific_reservation_required = 226550687; + * @return bool + */ + public function getSpecificReservationRequired() + { + return isset($this->specific_reservation_required) ? $this->specific_reservation_required : false; + } + + public function hasSpecificReservationRequired() + { + return isset($this->specific_reservation_required); + } + + public function clearSpecificReservationRequired() + { + unset($this->specific_reservation_required); + } + + /** + * Indicates whether the reservation can be consumed by VMs with affinity for "any" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation. + * + * Generated from protobuf field optional bool specific_reservation_required = 226550687; + * @param bool $var + * @return $this + */ + public function setSpecificReservationRequired($var) + { + GPBUtil::checkBool($var); + $this->specific_reservation_required = $var; + + return $this; + } + + /** + * [Output Only] The status of the reservation. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] The status of the reservation. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + + /** + * Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment. + * + * Generated from protobuf field optional string zone = 3744684; + * @return string + */ + public function getZone() + { + return isset($this->zone) ? $this->zone : ''; + } + + public function hasZone() + { + return isset($this->zone); + } + + public function clearZone() + { + unset($this->zone); + } + + /** + * Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment. + * + * Generated from protobuf field optional string zone = 3744684; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Reservation/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Reservation/Status.php new file mode 100644 index 000000000000..c4647fe5f55f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Reservation/Status.php @@ -0,0 +1,83 @@ +google.cloud.compute.v1.Reservation.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * Resources are being allocated for the reservation. + * + * Generated from protobuf enum CREATING = 455564985; + */ + const CREATING = 455564985; + /** + * Reservation is currently being deleted. + * + * Generated from protobuf enum DELETING = 528602024; + */ + const DELETING = 528602024; + /** + * Generated from protobuf enum INVALID = 530283991; + */ + const INVALID = 530283991; + /** + * Reservation has allocated all its resources. + * + * Generated from protobuf enum READY = 77848963; + */ + const READY = 77848963; + /** + * Reservation is currently being resized. + * + * Generated from protobuf enum UPDATING = 494614342; + */ + const UPDATING = 494614342; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::CREATING => 'CREATING', + self::DELETING => 'DELETING', + self::INVALID => 'INVALID', + self::READY => 'READY', + self::UPDATING => 'UPDATING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\Reservation_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationAffinity.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationAffinity.php new file mode 100644 index 000000000000..0a525929069e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationAffinity.php @@ -0,0 +1,159 @@ +google.cloud.compute.v1.ReservationAffinity + */ +class ReservationAffinity extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies the type of reservation from which this instance can consume resources: ANY_RESERVATION (default), SPECIFIC_RESERVATION, or NO_RESERVATION. See Consuming reserved instances for examples. + * Check the ConsumeReservationType enum for the list of possible values. + * + * Generated from protobuf field optional string consume_reservation_type = 300736944; + */ + protected $consume_reservation_type = null; + /** + * Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify googleapis.com/reservation-name as the key and specify the name of your reservation as its value. + * + * Generated from protobuf field optional string key = 106079; + */ + protected $key = null; + /** + * Corresponds to the label values of a reservation resource. This can be either a name to a reservation in the same project or "projects/different-project/reservations/some-reservation-name" to target a shared reservation in the same zone but in a different project. + * + * Generated from protobuf field repeated string values = 249928994; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $consume_reservation_type + * Specifies the type of reservation from which this instance can consume resources: ANY_RESERVATION (default), SPECIFIC_RESERVATION, or NO_RESERVATION. See Consuming reserved instances for examples. + * Check the ConsumeReservationType enum for the list of possible values. + * @type string $key + * Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify googleapis.com/reservation-name as the key and specify the name of your reservation as its value. + * @type array|\Google\Protobuf\Internal\RepeatedField $values + * Corresponds to the label values of a reservation resource. This can be either a name to a reservation in the same project or "projects/different-project/reservations/some-reservation-name" to target a shared reservation in the same zone but in a different project. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies the type of reservation from which this instance can consume resources: ANY_RESERVATION (default), SPECIFIC_RESERVATION, or NO_RESERVATION. See Consuming reserved instances for examples. + * Check the ConsumeReservationType enum for the list of possible values. + * + * Generated from protobuf field optional string consume_reservation_type = 300736944; + * @return string + */ + public function getConsumeReservationType() + { + return isset($this->consume_reservation_type) ? $this->consume_reservation_type : ''; + } + + public function hasConsumeReservationType() + { + return isset($this->consume_reservation_type); + } + + public function clearConsumeReservationType() + { + unset($this->consume_reservation_type); + } + + /** + * Specifies the type of reservation from which this instance can consume resources: ANY_RESERVATION (default), SPECIFIC_RESERVATION, or NO_RESERVATION. See Consuming reserved instances for examples. + * Check the ConsumeReservationType enum for the list of possible values. + * + * Generated from protobuf field optional string consume_reservation_type = 300736944; + * @param string $var + * @return $this + */ + public function setConsumeReservationType($var) + { + GPBUtil::checkString($var, True); + $this->consume_reservation_type = $var; + + return $this; + } + + /** + * Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify googleapis.com/reservation-name as the key and specify the name of your reservation as its value. + * + * Generated from protobuf field optional string key = 106079; + * @return string + */ + public function getKey() + { + return isset($this->key) ? $this->key : ''; + } + + public function hasKey() + { + return isset($this->key); + } + + public function clearKey() + { + unset($this->key); + } + + /** + * Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify googleapis.com/reservation-name as the key and specify the name of your reservation as its value. + * + * Generated from protobuf field optional string key = 106079; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Corresponds to the label values of a reservation resource. This can be either a name to a reservation in the same project or "projects/different-project/reservations/some-reservation-name" to target a shared reservation in the same zone but in a different project. + * + * Generated from protobuf field repeated string values = 249928994; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * Corresponds to the label values of a reservation resource. This can be either a name to a reservation in the same project or "projects/different-project/reservations/some-reservation-name" to target a shared reservation in the same zone but in a different project. + * + * Generated from protobuf field repeated string values = 249928994; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->values = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationAffinity/ConsumeReservationType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationAffinity/ConsumeReservationType.php new file mode 100644 index 000000000000..bb4cdbb57945 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationAffinity/ConsumeReservationType.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.ReservationAffinity.ConsumeReservationType + */ +class ConsumeReservationType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_CONSUME_RESERVATION_TYPE = 0; + */ + const UNDEFINED_CONSUME_RESERVATION_TYPE = 0; + /** + * Consume any allocation available. + * + * Generated from protobuf enum ANY_RESERVATION = 200008121; + */ + const ANY_RESERVATION = 200008121; + /** + * Do not consume from any allocated capacity. + * + * Generated from protobuf enum NO_RESERVATION = 169322030; + */ + const NO_RESERVATION = 169322030; + /** + * Must consume from a specific reservation. Must specify key value fields for specifying the reservations. + * + * Generated from protobuf enum SPECIFIC_RESERVATION = 229889055; + */ + const SPECIFIC_RESERVATION = 229889055; + /** + * Generated from protobuf enum UNSPECIFIED = 526786327; + */ + const UNSPECIFIED = 526786327; + + private static $valueToName = [ + self::UNDEFINED_CONSUME_RESERVATION_TYPE => 'UNDEFINED_CONSUME_RESERVATION_TYPE', + self::ANY_RESERVATION => 'ANY_RESERVATION', + self::NO_RESERVATION => 'NO_RESERVATION', + self::SPECIFIC_RESERVATION => 'SPECIFIC_RESERVATION', + self::UNSPECIFIED => 'UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConsumeReservationType::class, \Google\Cloud\Compute\V1\ReservationAffinity_ConsumeReservationType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationAggregatedList.php new file mode 100644 index 000000000000..aa0b65ccb707 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationAggregatedList.php @@ -0,0 +1,321 @@ +google.cloud.compute.v1.ReservationAggregatedList + */ +class ReservationAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of Allocation resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 Allocation 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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 Allocation resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of Allocation 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\ReservationsScopedList::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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationList.php new file mode 100644 index 000000000000..e7bb76bcb3d0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationList.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.ReservationList + */ +class ReservationList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * [Output Only] A list of Allocation resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Reservation items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource.Always compute#reservationsList for listsof reservations + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type array<\Google\Cloud\Compute\V1\Reservation>|\Google\Protobuf\Internal\RepeatedField $items + * [Output Only] A list of Allocation resources. + * @type string $kind + * [Output Only] Type of resource.Always compute#reservationsList for listsof reservations + * @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] The unique identifier for the resource. This identifier is 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] The unique identifier for the resource. This identifier is 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; + } + + /** + * [Output Only] A list of Allocation resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Reservation items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * [Output Only] A list of Allocation resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Reservation items = 100526016; + * @param array<\Google\Cloud\Compute\V1\Reservation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Reservation::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource.Always compute#reservationsList for listsof reservations + * + * 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); + } + + /** + * [Output Only] Type of resource.Always compute#reservationsList for listsof reservations + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationsResizeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationsResizeRequest.php new file mode 100644 index 000000000000..f84252697816 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationsResizeRequest.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.ReservationsResizeRequest + */ +class ReservationsResizeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Number of allocated resources can be resized with minimum = 1 and maximum = 1000. + * + * Generated from protobuf field optional int64 specific_sku_count = 13890720; + */ + protected $specific_sku_count = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $specific_sku_count + * Number of allocated resources can be resized with minimum = 1 and maximum = 1000. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Number of allocated resources can be resized with minimum = 1 and maximum = 1000. + * + * Generated from protobuf field optional int64 specific_sku_count = 13890720; + * @return int|string + */ + public function getSpecificSkuCount() + { + return isset($this->specific_sku_count) ? $this->specific_sku_count : 0; + } + + public function hasSpecificSkuCount() + { + return isset($this->specific_sku_count); + } + + public function clearSpecificSkuCount() + { + unset($this->specific_sku_count); + } + + /** + * Number of allocated resources can be resized with minimum = 1 and maximum = 1000. + * + * Generated from protobuf field optional int64 specific_sku_count = 13890720; + * @param int|string $var + * @return $this + */ + public function setSpecificSkuCount($var) + { + GPBUtil::checkInt64($var); + $this->specific_sku_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationsScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationsScopedList.php new file mode 100644 index 000000000000..3ecfc5b7366e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ReservationsScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.ReservationsScopedList + */ +class ReservationsScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * A list of reservations contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Reservation reservations = 399717927; + */ + private $reservations; + /** + * Informational warning which replaces the list of reservations when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\Reservation>|\Google\Protobuf\Internal\RepeatedField $reservations + * A list of reservations contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * Informational warning which replaces the list of reservations when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of reservations contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Reservation reservations = 399717927; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReservations() + { + return $this->reservations; + } + + /** + * A list of reservations contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Reservation reservations = 399717927; + * @param array<\Google\Cloud\Compute\V1\Reservation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReservations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Reservation::class); + $this->reservations = $arr; + + return $this; + } + + /** + * Informational warning which replaces the list of reservations 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); + } + + /** + * Informational warning which replaces the list of reservations 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResetInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResetInstanceRequest.php new file mode 100644 index 000000000000..3f3656eea366 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResetInstanceRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.ResetInstanceRequest + */ +class ResetInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance scoping this request. + * + * @return \Google\Cloud\Compute\V1\ResetInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name of the instance scoping 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); + } + + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance scoping 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResizeDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResizeDiskRequest.php new file mode 100644 index 000000000000..0eec8d34cc90 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResizeDiskRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.ResizeDiskRequest + */ +class ResizeDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the persistent disk. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.DisksResizeRequest disks_resize_request_resource = 78307616 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disks_resize_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $disk The name of the persistent disk. + * @param \Google\Cloud\Compute\V1\DisksResizeRequest $disksResizeRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\ResizeDiskRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $disk, \Google\Cloud\Compute\V1\DisksResizeRequest $disksResizeRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setDisk($disk) + ->setDisksResizeRequestResource($disksResizeRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $disk + * The name of the persistent disk. + * @type \Google\Cloud\Compute\V1\DisksResizeRequest $disks_resize_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 name of the persistent disk. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisk() + { + return $this->disk; + } + + /** + * The name of the persistent disk. + * + * 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.DisksResizeRequest disks_resize_request_resource = 78307616 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\DisksResizeRequest|null + */ + public function getDisksResizeRequestResource() + { + return $this->disks_resize_request_resource; + } + + public function hasDisksResizeRequestResource() + { + return isset($this->disks_resize_request_resource); + } + + public function clearDisksResizeRequestResource() + { + unset($this->disks_resize_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.DisksResizeRequest disks_resize_request_resource = 78307616 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\DisksResizeRequest $var + * @return $this + */ + public function setDisksResizeRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DisksResizeRequest::class); + $this->disks_resize_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResizeInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResizeInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..8b7cf3db5873 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResizeInstanceGroupManagerRequest.php @@ -0,0 +1,232 @@ +google.cloud.compute.v1.ResizeInstanceGroupManagerRequest + */ +class ResizeInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. + * + * Generated from protobuf field int32 size = 3530753 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $size = 0; + /** + * The name of the zone where the managed instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. + * @param string $instanceGroupManager The name of the managed instance group. + * @param int $size The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. + * + * @return \Google\Cloud\Compute\V1\ResizeInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager, int $size): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager) + ->setSize($size); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group. + * @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 int $size + * The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. + * @type string $zone + * The name of the zone where the managed instance group is located. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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 number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. + * + * Generated from protobuf field int32 size = 3530753 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getSize() + { + return $this->size; + } + + /** + * The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. + * + * Generated from protobuf field int32 size = 3530753 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setSize($var) + { + GPBUtil::checkInt32($var); + $this->size = $var; + + return $this; + } + + /** + * The name of the zone where the managed instance group is located. + * + * 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 where the managed instance group is located. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResizeRegionDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResizeRegionDiskRequest.php new file mode 100644 index 000000000000..e23e57614f51 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResizeRegionDiskRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.ResizeRegionDiskRequest + */ +class ResizeRegionDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the regional persistent disk. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk = ''; + /** + * The project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionDisksResizeRequest region_disks_resize_request_resource = 446633237 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_disks_resize_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project The project ID for this request. + * @param string $region Name of the region for this request. + * @param string $disk Name of the regional persistent disk. + * @param \Google\Cloud\Compute\V1\RegionDisksResizeRequest $regionDisksResizeRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\ResizeRegionDiskRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $disk, \Google\Cloud\Compute\V1\RegionDisksResizeRequest $regionDisksResizeRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setDisk($disk) + ->setRegionDisksResizeRequestResource($regionDisksResizeRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $disk + * Name of the regional persistent disk. + * @type string $project + * The project ID for this request. + * @type string $region + * Name of the region for this request. + * @type \Google\Cloud\Compute\V1\RegionDisksResizeRequest $region_disks_resize_request_resource + * The body resource 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); + } + + /** + * Name of the regional persistent disk. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisk() + { + return $this->disk; + } + + /** + * Name of the regional persistent disk. + * + * 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 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; + } + + /** + * The 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionDisksResizeRequest region_disks_resize_request_resource = 446633237 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionDisksResizeRequest|null + */ + public function getRegionDisksResizeRequestResource() + { + return $this->region_disks_resize_request_resource; + } + + public function hasRegionDisksResizeRequestResource() + { + return isset($this->region_disks_resize_request_resource); + } + + public function clearRegionDisksResizeRequestResource() + { + unset($this->region_disks_resize_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionDisksResizeRequest region_disks_resize_request_resource = 446633237 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionDisksResizeRequest $var + * @return $this + */ + public function setRegionDisksResizeRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionDisksResizeRequest::class); + $this->region_disks_resize_request_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResizeRegionInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResizeRegionInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..e6567906116a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResizeRegionInstanceGroupManagerRequest.php @@ -0,0 +1,232 @@ +google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest + */ +class ResizeRegionInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Number of instances that should exist in this instance group manager. + * + * Generated from protobuf field int32 size = 3530753 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $size = 0; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $instanceGroupManager Name of the managed instance group. + * @param int $size Number of instances that should exist in this instance group manager. + * + * @return \Google\Cloud\Compute\V1\ResizeRegionInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroupManager, int $size): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroupManager($instanceGroupManager) + ->setSize($size); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * Name of the managed instance group. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 int $size + * Number of instances that should exist in this instance group manager. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * Name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Number of instances that should exist in this instance group manager. + * + * Generated from protobuf field int32 size = 3530753 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getSize() + { + return $this->size; + } + + /** + * Number of instances that should exist in this instance group manager. + * + * Generated from protobuf field int32 size = 3530753 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setSize($var) + { + GPBUtil::checkInt32($var); + $this->size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResizeReservationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResizeReservationRequest.php new file mode 100644 index 000000000000..eab76acb0c59 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResizeReservationRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.ResizeReservationRequest + */ +class ResizeReservationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the reservation to update. + * + * Generated from protobuf field string reservation = 47530956 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $reservation = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ReservationsResizeRequest reservations_resize_request_resource = 389262801 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $reservations_resize_request_resource = null; + /** + * 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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone for this request. + * @param string $reservation Name of the reservation to update. + * @param \Google\Cloud\Compute\V1\ReservationsResizeRequest $reservationsResizeRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\ResizeReservationRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $reservation, \Google\Cloud\Compute\V1\ReservationsResizeRequest $reservationsResizeRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setReservation($reservation) + ->setReservationsResizeRequestResource($reservationsResizeRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $reservation + * Name of the reservation to update. + * @type \Google\Cloud\Compute\V1\ReservationsResizeRequest $reservations_resize_request_resource + * The body resource for this request + * @type string $zone + * Name of the zone for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the reservation to update. + * + * Generated from protobuf field string reservation = 47530956 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getReservation() + { + return $this->reservation; + } + + /** + * Name of the reservation to update. + * + * Generated from protobuf field string reservation = 47530956 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setReservation($var) + { + GPBUtil::checkString($var, True); + $this->reservation = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ReservationsResizeRequest reservations_resize_request_resource = 389262801 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ReservationsResizeRequest|null + */ + public function getReservationsResizeRequestResource() + { + return $this->reservations_resize_request_resource; + } + + public function hasReservationsResizeRequestResource() + { + return isset($this->reservations_resize_request_resource); + } + + public function clearReservationsResizeRequestResource() + { + unset($this->reservations_resize_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ReservationsResizeRequest reservations_resize_request_resource = 389262801 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ReservationsResizeRequest $var + * @return $this + */ + public function setReservationsResizeRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ReservationsResizeRequest::class); + $this->reservations_resize_request_resource = $var; + + return $this; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourceCommitment.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourceCommitment.php new file mode 100644 index 000000000000..95ea5a9395d3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourceCommitment.php @@ -0,0 +1,169 @@ +google.cloud.compute.v1.ResourceCommitment + */ +class ResourceCommitment extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the accelerator type resource. Applicable only when the type is ACCELERATOR. + * + * Generated from protobuf field optional string accelerator_type = 138031246; + */ + protected $accelerator_type = null; + /** + * The amount of the resource purchased (in a type-dependent unit, such as bytes). For vCPUs, this can just be an integer. For memory, this must be provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of memory per every vCPU. + * + * Generated from protobuf field optional int64 amount = 196759640; + */ + protected $amount = null; + /** + * Type of resource for which this commitment applies. Possible values are VCPU, MEMORY, LOCAL_SSD, and ACCELERATOR. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $accelerator_type + * Name of the accelerator type resource. Applicable only when the type is ACCELERATOR. + * @type int|string $amount + * The amount of the resource purchased (in a type-dependent unit, such as bytes). For vCPUs, this can just be an integer. For memory, this must be provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of memory per every vCPU. + * @type string $type + * Type of resource for which this commitment applies. Possible values are VCPU, MEMORY, LOCAL_SSD, and ACCELERATOR. + * Check the Type enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the accelerator type resource. Applicable only when the type is ACCELERATOR. + * + * Generated from protobuf field optional string accelerator_type = 138031246; + * @return string + */ + public function getAcceleratorType() + { + return isset($this->accelerator_type) ? $this->accelerator_type : ''; + } + + public function hasAcceleratorType() + { + return isset($this->accelerator_type); + } + + public function clearAcceleratorType() + { + unset($this->accelerator_type); + } + + /** + * Name of the accelerator type resource. Applicable only when the type is ACCELERATOR. + * + * Generated from protobuf field optional string accelerator_type = 138031246; + * @param string $var + * @return $this + */ + public function setAcceleratorType($var) + { + GPBUtil::checkString($var, True); + $this->accelerator_type = $var; + + return $this; + } + + /** + * The amount of the resource purchased (in a type-dependent unit, such as bytes). For vCPUs, this can just be an integer. For memory, this must be provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of memory per every vCPU. + * + * Generated from protobuf field optional int64 amount = 196759640; + * @return int|string + */ + public function getAmount() + { + return isset($this->amount) ? $this->amount : 0; + } + + public function hasAmount() + { + return isset($this->amount); + } + + public function clearAmount() + { + unset($this->amount); + } + + /** + * The amount of the resource purchased (in a type-dependent unit, such as bytes). For vCPUs, this can just be an integer. For memory, this must be provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of memory per every vCPU. + * + * Generated from protobuf field optional int64 amount = 196759640; + * @param int|string $var + * @return $this + */ + public function setAmount($var) + { + GPBUtil::checkInt64($var); + $this->amount = $var; + + return $this; + } + + /** + * Type of resource for which this commitment applies. Possible values are VCPU, MEMORY, LOCAL_SSD, and ACCELERATOR. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * Type of resource for which this commitment applies. Possible values are VCPU, MEMORY, LOCAL_SSD, and ACCELERATOR. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourceCommitment/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourceCommitment/Type.php new file mode 100644 index 000000000000..a01499618ce8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourceCommitment/Type.php @@ -0,0 +1,75 @@ +google.cloud.compute.v1.ResourceCommitment.Type + */ +class Type +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TYPE = 0; + */ + const UNDEFINED_TYPE = 0; + /** + * Generated from protobuf enum ACCELERATOR = 429815371; + */ + const ACCELERATOR = 429815371; + /** + * Generated from protobuf enum LOCAL_SSD = 508934896; + */ + const LOCAL_SSD = 508934896; + /** + * Generated from protobuf enum MEMORY = 123056385; + */ + const MEMORY = 123056385; + /** + * Generated from protobuf enum UNSPECIFIED = 526786327; + */ + const UNSPECIFIED = 526786327; + /** + * Generated from protobuf enum VCPU = 2628978; + */ + const VCPU = 2628978; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::ACCELERATOR => 'ACCELERATOR', + self::LOCAL_SSD => 'LOCAL_SSD', + self::MEMORY => 'MEMORY', + self::UNSPECIFIED => 'UNSPECIFIED', + self::VCPU => 'VCPU', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Compute\V1\ResourceCommitment_Type::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourceGroupReference.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourceGroupReference.php new file mode 100644 index 000000000000..d325aa351c9c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourceGroupReference.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.ResourceGroupReference + */ +class ResourceGroupReference extends \Google\Protobuf\Internal\Message +{ + /** + * A URI referencing one of the instance groups or network endpoint groups listed in the backend service. + * + * Generated from protobuf field optional string group = 98629247; + */ + protected $group = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $group + * A URI referencing one of the instance groups or network endpoint groups listed in the backend service. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A URI referencing one of the instance groups or network endpoint groups listed in the backend service. + * + * Generated from protobuf field optional string group = 98629247; + * @return string + */ + public function getGroup() + { + return isset($this->group) ? $this->group : ''; + } + + public function hasGroup() + { + return isset($this->group); + } + + public function clearGroup() + { + unset($this->group); + } + + /** + * A URI referencing one of the instance groups or network endpoint groups listed in the backend service. + * + * Generated from protobuf field optional string group = 98629247; + * @param string $var + * @return $this + */ + public function setGroup($var) + { + GPBUtil::checkString($var, True); + $this->group = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePoliciesScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePoliciesScopedList.php new file mode 100644 index 000000000000..9e3e7d8009dc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePoliciesScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.ResourcePoliciesScopedList + */ +class ResourcePoliciesScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * A list of resourcePolicies contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ResourcePolicy resource_policies = 22220385; + */ + private $resource_policies; + /** + * Informational warning which replaces the list of resourcePolicies when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\ResourcePolicy>|\Google\Protobuf\Internal\RepeatedField $resource_policies + * A list of resourcePolicies contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * Informational warning which replaces the list of resourcePolicies when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of resourcePolicies contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ResourcePolicy resource_policies = 22220385; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourcePolicies() + { + return $this->resource_policies; + } + + /** + * A list of resourcePolicies contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ResourcePolicy resource_policies = 22220385; + * @param array<\Google\Cloud\Compute\V1\ResourcePolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourcePolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ResourcePolicy::class); + $this->resource_policies = $arr; + + return $this; + } + + /** + * Informational warning which replaces the list of resourcePolicies 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); + } + + /** + * Informational warning which replaces the list of resourcePolicies 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicy.php new file mode 100644 index 000000000000..f24ad9e1ad08 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicy.php @@ -0,0 +1,595 @@ +google.cloud.compute.v1.ResourcePolicy + */ +class ResourcePolicy extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Resource policy for disk consistency groups. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyDiskConsistencyGroupPolicy disk_consistency_group_policy = 473727515; + */ + protected $disk_consistency_group_policy = null; + /** + * Resource policy for instances for placement configuration. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy group_placement_policy = 10931596; + */ + protected $group_placement_policy = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * Resource policy for scheduling instance operations. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy instance_schedule_policy = 344877104; + */ + protected $instance_schedule_policy = null; + /** + * [Output Only] Type of the resource. Always compute#resource_policies for resource policies. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] The system status of the resource policy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyResourceStatus resource_status = 249429315; + */ + protected $resource_status = null; + /** + * [Output Only] Server-defined fully-qualified URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * Resource policy for persistent disks for creating snapshots. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy snapshot_schedule_policy = 218131295; + */ + protected $snapshot_schedule_policy = null; + /** + * [Output Only] The status of resource policy creation. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * @type \Google\Cloud\Compute\V1\ResourcePolicyDiskConsistencyGroupPolicy $disk_consistency_group_policy + * Resource policy for disk consistency groups. + * @type \Google\Cloud\Compute\V1\ResourcePolicyGroupPlacementPolicy $group_placement_policy + * Resource policy for instances for placement configuration. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type \Google\Cloud\Compute\V1\ResourcePolicyInstanceSchedulePolicy $instance_schedule_policy + * Resource policy for scheduling instance operations. + * @type string $kind + * [Output Only] Type of the resource. Always compute#resource_policies for resource policies. + * @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 string $region + * @type \Google\Cloud\Compute\V1\ResourcePolicyResourceStatus $resource_status + * [Output Only] The system status of the resource policy. + * @type string $self_link + * [Output Only] Server-defined fully-qualified URL for this resource. + * @type \Google\Cloud\Compute\V1\ResourcePolicySnapshotSchedulePolicy $snapshot_schedule_policy + * Resource policy for persistent disks for creating snapshots. + * @type string $status + * [Output Only] The status of resource policy creation. + * Check the Status enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Resource policy for disk consistency groups. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyDiskConsistencyGroupPolicy disk_consistency_group_policy = 473727515; + * @return \Google\Cloud\Compute\V1\ResourcePolicyDiskConsistencyGroupPolicy|null + */ + public function getDiskConsistencyGroupPolicy() + { + return $this->disk_consistency_group_policy; + } + + public function hasDiskConsistencyGroupPolicy() + { + return isset($this->disk_consistency_group_policy); + } + + public function clearDiskConsistencyGroupPolicy() + { + unset($this->disk_consistency_group_policy); + } + + /** + * Resource policy for disk consistency groups. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyDiskConsistencyGroupPolicy disk_consistency_group_policy = 473727515; + * @param \Google\Cloud\Compute\V1\ResourcePolicyDiskConsistencyGroupPolicy $var + * @return $this + */ + public function setDiskConsistencyGroupPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ResourcePolicyDiskConsistencyGroupPolicy::class); + $this->disk_consistency_group_policy = $var; + + return $this; + } + + /** + * Resource policy for instances for placement configuration. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy group_placement_policy = 10931596; + * @return \Google\Cloud\Compute\V1\ResourcePolicyGroupPlacementPolicy|null + */ + public function getGroupPlacementPolicy() + { + return $this->group_placement_policy; + } + + public function hasGroupPlacementPolicy() + { + return isset($this->group_placement_policy); + } + + public function clearGroupPlacementPolicy() + { + unset($this->group_placement_policy); + } + + /** + * Resource policy for instances for placement configuration. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy group_placement_policy = 10931596; + * @param \Google\Cloud\Compute\V1\ResourcePolicyGroupPlacementPolicy $var + * @return $this + */ + public function setGroupPlacementPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ResourcePolicyGroupPlacementPolicy::class); + $this->group_placement_policy = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * Resource policy for scheduling instance operations. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy instance_schedule_policy = 344877104; + * @return \Google\Cloud\Compute\V1\ResourcePolicyInstanceSchedulePolicy|null + */ + public function getInstanceSchedulePolicy() + { + return $this->instance_schedule_policy; + } + + public function hasInstanceSchedulePolicy() + { + return isset($this->instance_schedule_policy); + } + + public function clearInstanceSchedulePolicy() + { + unset($this->instance_schedule_policy); + } + + /** + * Resource policy for scheduling instance operations. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy instance_schedule_policy = 344877104; + * @param \Google\Cloud\Compute\V1\ResourcePolicyInstanceSchedulePolicy $var + * @return $this + */ + public function setInstanceSchedulePolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ResourcePolicyInstanceSchedulePolicy::class); + $this->instance_schedule_policy = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#resource_policies for resource policies. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#resource_policies for resource policies. + * + * 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; + } + + /** + * 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. + * + * 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 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. + * + * 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; + } + + /** + * 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); + } + + /** + * 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 system status of the resource policy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyResourceStatus resource_status = 249429315; + * @return \Google\Cloud\Compute\V1\ResourcePolicyResourceStatus|null + */ + public function getResourceStatus() + { + return $this->resource_status; + } + + public function hasResourceStatus() + { + return isset($this->resource_status); + } + + public function clearResourceStatus() + { + unset($this->resource_status); + } + + /** + * [Output Only] The system status of the resource policy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyResourceStatus resource_status = 249429315; + * @param \Google\Cloud\Compute\V1\ResourcePolicyResourceStatus $var + * @return $this + */ + public function setResourceStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ResourcePolicyResourceStatus::class); + $this->resource_status = $var; + + return $this; + } + + /** + * [Output Only] Server-defined fully-qualified 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 fully-qualified 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; + } + + /** + * Resource policy for persistent disks for creating snapshots. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy snapshot_schedule_policy = 218131295; + * @return \Google\Cloud\Compute\V1\ResourcePolicySnapshotSchedulePolicy|null + */ + public function getSnapshotSchedulePolicy() + { + return $this->snapshot_schedule_policy; + } + + public function hasSnapshotSchedulePolicy() + { + return isset($this->snapshot_schedule_policy); + } + + public function clearSnapshotSchedulePolicy() + { + unset($this->snapshot_schedule_policy); + } + + /** + * Resource policy for persistent disks for creating snapshots. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy snapshot_schedule_policy = 218131295; + * @param \Google\Cloud\Compute\V1\ResourcePolicySnapshotSchedulePolicy $var + * @return $this + */ + public function setSnapshotSchedulePolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ResourcePolicySnapshotSchedulePolicy::class); + $this->snapshot_schedule_policy = $var; + + return $this; + } + + /** + * [Output Only] The status of resource policy creation. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] The status of resource policy creation. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicy/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicy/Status.php new file mode 100644 index 000000000000..a59378e45f04 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicy/Status.php @@ -0,0 +1,83 @@ +google.cloud.compute.v1.ResourcePolicy.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * Resource policy is being created. + * + * Generated from protobuf enum CREATING = 455564985; + */ + const CREATING = 455564985; + /** + * Resource policy is being deleted. + * + * Generated from protobuf enum DELETING = 528602024; + */ + const DELETING = 528602024; + /** + * Resource policy is expired and will not run again. + * + * Generated from protobuf enum EXPIRED = 482489093; + */ + const EXPIRED = 482489093; + /** + * Generated from protobuf enum INVALID = 530283991; + */ + const INVALID = 530283991; + /** + * Resource policy is ready to be used. + * + * Generated from protobuf enum READY = 77848963; + */ + const READY = 77848963; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::CREATING => 'CREATING', + self::DELETING => 'DELETING', + self::EXPIRED => 'EXPIRED', + self::INVALID => 'INVALID', + self::READY => 'READY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\ResourcePolicy_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyAggregatedList.php new file mode 100644 index 000000000000..ed4b0e4da048 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyAggregatedList.php @@ -0,0 +1,358 @@ +google.cloud.compute.v1.ResourcePolicyAggregatedList + */ +class ResourcePolicyAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string etag = 3123477; + */ + protected $etag = null; + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of ResourcePolicy resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $etag + * @type string $id + * [Output Only] Unique identifier for the resource; defined by the server. + * @type array|\Google\Protobuf\Internal\MapField $items + * A list of ResourcePolicy 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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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); + } + + /** + * Generated from protobuf field optional string etag = 3123477; + * @return string + */ + public function getEtag() + { + return isset($this->etag) ? $this->etag : ''; + } + + public function hasEtag() + { + return isset($this->etag); + } + + public function clearEtag() + { + unset($this->etag); + } + + /** + * Generated from protobuf field optional string etag = 3123477; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * [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 ResourcePolicy resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of ResourcePolicy 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\ResourcePoliciesScopedList::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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyDailyCycle.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyDailyCycle.php new file mode 100644 index 000000000000..300c1a9174e5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyDailyCycle.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.ResourcePolicyDailyCycle + */ +class ResourcePolicyDailyCycle extends \Google\Protobuf\Internal\Message +{ + /** + * Defines a schedule with units measured in days. The value determines how many days pass between the start of each cycle. + * + * Generated from protobuf field optional int32 days_in_cycle = 369790004; + */ + protected $days_in_cycle = null; + /** + * [Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario. + * + * Generated from protobuf field optional string duration = 155471252; + */ + protected $duration = null; + /** + * Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid. + * + * Generated from protobuf field optional string start_time = 37467274; + */ + protected $start_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $days_in_cycle + * Defines a schedule with units measured in days. The value determines how many days pass between the start of each cycle. + * @type string $duration + * [Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario. + * @type string $start_time + * Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Defines a schedule with units measured in days. The value determines how many days pass between the start of each cycle. + * + * Generated from protobuf field optional int32 days_in_cycle = 369790004; + * @return int + */ + public function getDaysInCycle() + { + return isset($this->days_in_cycle) ? $this->days_in_cycle : 0; + } + + public function hasDaysInCycle() + { + return isset($this->days_in_cycle); + } + + public function clearDaysInCycle() + { + unset($this->days_in_cycle); + } + + /** + * Defines a schedule with units measured in days. The value determines how many days pass between the start of each cycle. + * + * Generated from protobuf field optional int32 days_in_cycle = 369790004; + * @param int $var + * @return $this + */ + public function setDaysInCycle($var) + { + GPBUtil::checkInt32($var); + $this->days_in_cycle = $var; + + return $this; + } + + /** + * [Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario. + * + * Generated from protobuf field optional string duration = 155471252; + * @return string + */ + public function getDuration() + { + return isset($this->duration) ? $this->duration : ''; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * [Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario. + * + * Generated from protobuf field optional string duration = 155471252; + * @param string $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkString($var, True); + $this->duration = $var; + + return $this; + } + + /** + * Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid. + * + * Generated from protobuf field optional string start_time = 37467274; + * @return string + */ + public function getStartTime() + { + return isset($this->start_time) ? $this->start_time : ''; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid. + * + * Generated from protobuf field optional string start_time = 37467274; + * @param string $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkString($var, True); + $this->start_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyDiskConsistencyGroupPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyDiskConsistencyGroupPolicy.php new file mode 100644 index 000000000000..26ab3e127374 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyDiskConsistencyGroupPolicy.php @@ -0,0 +1,33 @@ +google.cloud.compute.v1.ResourcePolicyDiskConsistencyGroupPolicy + */ +class ResourcePolicyDiskConsistencyGroupPolicy extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyGroupPlacementPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyGroupPlacementPolicy.php new file mode 100644 index 000000000000..250bebcff648 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyGroupPlacementPolicy.php @@ -0,0 +1,169 @@ +google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy + */ +class ResourcePolicyGroupPlacementPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * The number of availability domains to spread instances across. If two instances are in different availability domain, they are not in the same low latency network. + * + * Generated from protobuf field optional int32 availability_domain_count = 12453432; + */ + protected $availability_domain_count = null; + /** + * Specifies network collocation + * Check the Collocation enum for the list of possible values. + * + * Generated from protobuf field optional string collocation = 511156533; + */ + protected $collocation = null; + /** + * Number of VMs in this placement group. Google does not recommend that you use this field unless you use a compact policy and you want your policy to work only if it contains this exact number of VMs. + * + * Generated from protobuf field optional int32 vm_count = 261463431; + */ + protected $vm_count = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $availability_domain_count + * The number of availability domains to spread instances across. If two instances are in different availability domain, they are not in the same low latency network. + * @type string $collocation + * Specifies network collocation + * Check the Collocation enum for the list of possible values. + * @type int $vm_count + * Number of VMs in this placement group. Google does not recommend that you use this field unless you use a compact policy and you want your policy to work only if it contains this exact number of VMs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The number of availability domains to spread instances across. If two instances are in different availability domain, they are not in the same low latency network. + * + * Generated from protobuf field optional int32 availability_domain_count = 12453432; + * @return int + */ + public function getAvailabilityDomainCount() + { + return isset($this->availability_domain_count) ? $this->availability_domain_count : 0; + } + + public function hasAvailabilityDomainCount() + { + return isset($this->availability_domain_count); + } + + public function clearAvailabilityDomainCount() + { + unset($this->availability_domain_count); + } + + /** + * The number of availability domains to spread instances across. If two instances are in different availability domain, they are not in the same low latency network. + * + * Generated from protobuf field optional int32 availability_domain_count = 12453432; + * @param int $var + * @return $this + */ + public function setAvailabilityDomainCount($var) + { + GPBUtil::checkInt32($var); + $this->availability_domain_count = $var; + + return $this; + } + + /** + * Specifies network collocation + * Check the Collocation enum for the list of possible values. + * + * Generated from protobuf field optional string collocation = 511156533; + * @return string + */ + public function getCollocation() + { + return isset($this->collocation) ? $this->collocation : ''; + } + + public function hasCollocation() + { + return isset($this->collocation); + } + + public function clearCollocation() + { + unset($this->collocation); + } + + /** + * Specifies network collocation + * Check the Collocation enum for the list of possible values. + * + * Generated from protobuf field optional string collocation = 511156533; + * @param string $var + * @return $this + */ + public function setCollocation($var) + { + GPBUtil::checkString($var, True); + $this->collocation = $var; + + return $this; + } + + /** + * Number of VMs in this placement group. Google does not recommend that you use this field unless you use a compact policy and you want your policy to work only if it contains this exact number of VMs. + * + * Generated from protobuf field optional int32 vm_count = 261463431; + * @return int + */ + public function getVmCount() + { + return isset($this->vm_count) ? $this->vm_count : 0; + } + + public function hasVmCount() + { + return isset($this->vm_count); + } + + public function clearVmCount() + { + unset($this->vm_count); + } + + /** + * Number of VMs in this placement group. Google does not recommend that you use this field unless you use a compact policy and you want your policy to work only if it contains this exact number of VMs. + * + * Generated from protobuf field optional int32 vm_count = 261463431; + * @param int $var + * @return $this + */ + public function setVmCount($var) + { + GPBUtil::checkInt32($var); + $this->vm_count = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyGroupPlacementPolicy/Collocation.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyGroupPlacementPolicy/Collocation.php new file mode 100644 index 000000000000..aa5409d833bf --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyGroupPlacementPolicy/Collocation.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy.Collocation + */ +class Collocation +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_COLLOCATION = 0; + */ + const UNDEFINED_COLLOCATION = 0; + /** + * Generated from protobuf enum COLLOCATED = 103257554; + */ + const COLLOCATED = 103257554; + /** + * Generated from protobuf enum UNSPECIFIED_COLLOCATION = 464308205; + */ + const UNSPECIFIED_COLLOCATION = 464308205; + + private static $valueToName = [ + self::UNDEFINED_COLLOCATION => 'UNDEFINED_COLLOCATION', + self::COLLOCATED => 'COLLOCATED', + self::UNSPECIFIED_COLLOCATION => 'UNSPECIFIED_COLLOCATION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Collocation::class, \Google\Cloud\Compute\V1\ResourcePolicyGroupPlacementPolicy_Collocation::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyHourlyCycle.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyHourlyCycle.php new file mode 100644 index 000000000000..41eb52b02c39 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyHourlyCycle.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.ResourcePolicyHourlyCycle + */ +class ResourcePolicyHourlyCycle extends \Google\Protobuf\Internal\Message +{ + /** + * [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario. + * + * Generated from protobuf field optional string duration = 155471252; + */ + protected $duration = null; + /** + * Defines a schedule with units measured in hours. The value determines how many hours pass between the start of each cycle. + * + * Generated from protobuf field optional int32 hours_in_cycle = 526763132; + */ + protected $hours_in_cycle = null; + /** + * Time within the window to start the operations. It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. + * + * Generated from protobuf field optional string start_time = 37467274; + */ + protected $start_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $duration + * [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario. + * @type int $hours_in_cycle + * Defines a schedule with units measured in hours. The value determines how many hours pass between the start of each cycle. + * @type string $start_time + * Time within the window to start the operations. It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario. + * + * Generated from protobuf field optional string duration = 155471252; + * @return string + */ + public function getDuration() + { + return isset($this->duration) ? $this->duration : ''; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario. + * + * Generated from protobuf field optional string duration = 155471252; + * @param string $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkString($var, True); + $this->duration = $var; + + return $this; + } + + /** + * Defines a schedule with units measured in hours. The value determines how many hours pass between the start of each cycle. + * + * Generated from protobuf field optional int32 hours_in_cycle = 526763132; + * @return int + */ + public function getHoursInCycle() + { + return isset($this->hours_in_cycle) ? $this->hours_in_cycle : 0; + } + + public function hasHoursInCycle() + { + return isset($this->hours_in_cycle); + } + + public function clearHoursInCycle() + { + unset($this->hours_in_cycle); + } + + /** + * Defines a schedule with units measured in hours. The value determines how many hours pass between the start of each cycle. + * + * Generated from protobuf field optional int32 hours_in_cycle = 526763132; + * @param int $var + * @return $this + */ + public function setHoursInCycle($var) + { + GPBUtil::checkInt32($var); + $this->hours_in_cycle = $var; + + return $this; + } + + /** + * Time within the window to start the operations. It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. + * + * Generated from protobuf field optional string start_time = 37467274; + * @return string + */ + public function getStartTime() + { + return isset($this->start_time) ? $this->start_time : ''; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Time within the window to start the operations. It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. + * + * Generated from protobuf field optional string start_time = 37467274; + * @param string $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkString($var, True); + $this->start_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyInstanceSchedulePolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyInstanceSchedulePolicy.php new file mode 100644 index 000000000000..1cf826e3b7e5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyInstanceSchedulePolicy.php @@ -0,0 +1,253 @@ +google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy + */ +class ResourcePolicyInstanceSchedulePolicy extends \Google\Protobuf\Internal\Message +{ + /** + * The expiration time of the schedule. The timestamp is an RFC3339 string. + * + * Generated from protobuf field optional string expiration_time = 230299229; + */ + protected $expiration_time = null; + /** + * The start time of the schedule. The timestamp is an RFC3339 string. + * + * Generated from protobuf field optional string start_time = 37467274; + */ + protected $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: https://wikipedia.org/wiki/Tz_database. + * + * Generated from protobuf field optional string time_zone = 36848094; + */ + protected $time_zone = null; + /** + * Specifies the schedule for starting instances. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule vm_start_schedule = 17762396; + */ + protected $vm_start_schedule = null; + /** + * Specifies the schedule for stopping instances. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule vm_stop_schedule = 426242732; + */ + protected $vm_stop_schedule = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $expiration_time + * The expiration time of the schedule. The timestamp is an RFC3339 string. + * @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: 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 + * Specifies the schedule for stopping instances. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The expiration time of the schedule. The timestamp is an RFC3339 string. + * + * Generated from protobuf field optional string expiration_time = 230299229; + * @return string + */ + public function getExpirationTime() + { + return isset($this->expiration_time) ? $this->expiration_time : ''; + } + + public function hasExpirationTime() + { + return isset($this->expiration_time); + } + + public function clearExpirationTime() + { + unset($this->expiration_time); + } + + /** + * The expiration time of the schedule. The timestamp is an RFC3339 string. + * + * Generated from protobuf field optional string expiration_time = 230299229; + * @param string $var + * @return $this + */ + public function setExpirationTime($var) + { + GPBUtil::checkString($var, True); + $this->expiration_time = $var; + + return $this; + } + + /** + * The start time of the schedule. The timestamp is an RFC3339 string. + * + * Generated from protobuf field optional string start_time = 37467274; + * @return string + */ + public function getStartTime() + { + return isset($this->start_time) ? $this->start_time : ''; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * The start time of the schedule. The timestamp is an RFC3339 string. + * + * Generated from protobuf field optional string start_time = 37467274; + * @param string $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkString($var, True); + $this->start_time = $var; + + return $this; + } + + /** + * 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 + */ + public function getTimeZone() + { + return isset($this->time_zone) ? $this->time_zone : ''; + } + + public function hasTimeZone() + { + return isset($this->time_zone); + } + + public function clearTimeZone() + { + unset($this->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: https://wikipedia.org/wiki/Tz_database. + * + * Generated from protobuf field optional string time_zone = 36848094; + * @param string $var + * @return $this + */ + public function setTimeZone($var) + { + GPBUtil::checkString($var, True); + $this->time_zone = $var; + + return $this; + } + + /** + * Specifies the schedule for starting instances. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule vm_start_schedule = 17762396; + * @return \Google\Cloud\Compute\V1\ResourcePolicyInstanceSchedulePolicySchedule|null + */ + public function getVmStartSchedule() + { + return $this->vm_start_schedule; + } + + public function hasVmStartSchedule() + { + return isset($this->vm_start_schedule); + } + + public function clearVmStartSchedule() + { + unset($this->vm_start_schedule); + } + + /** + * Specifies the schedule for starting instances. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule vm_start_schedule = 17762396; + * @param \Google\Cloud\Compute\V1\ResourcePolicyInstanceSchedulePolicySchedule $var + * @return $this + */ + public function setVmStartSchedule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ResourcePolicyInstanceSchedulePolicySchedule::class); + $this->vm_start_schedule = $var; + + return $this; + } + + /** + * Specifies the schedule for stopping instances. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule vm_stop_schedule = 426242732; + * @return \Google\Cloud\Compute\V1\ResourcePolicyInstanceSchedulePolicySchedule|null + */ + public function getVmStopSchedule() + { + return $this->vm_stop_schedule; + } + + public function hasVmStopSchedule() + { + return isset($this->vm_stop_schedule); + } + + public function clearVmStopSchedule() + { + unset($this->vm_stop_schedule); + } + + /** + * Specifies the schedule for stopping instances. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule vm_stop_schedule = 426242732; + * @param \Google\Cloud\Compute\V1\ResourcePolicyInstanceSchedulePolicySchedule $var + * @return $this + */ + public function setVmStopSchedule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ResourcePolicyInstanceSchedulePolicySchedule::class); + $this->vm_stop_schedule = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyInstanceSchedulePolicySchedule.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyInstanceSchedulePolicySchedule.php new file mode 100644 index 000000000000..3e7557145722 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyInstanceSchedulePolicySchedule.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule + */ +class ResourcePolicyInstanceSchedulePolicySchedule extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies the frequency for the operation, using the unix-cron format. + * + * Generated from protobuf field optional string schedule = 375820951; + */ + protected $schedule = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $schedule + * Specifies the frequency for the operation, using the unix-cron format. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies the frequency for the operation, using the unix-cron format. + * + * Generated from protobuf field optional string schedule = 375820951; + * @return string + */ + public function getSchedule() + { + return isset($this->schedule) ? $this->schedule : ''; + } + + public function hasSchedule() + { + return isset($this->schedule); + } + + public function clearSchedule() + { + unset($this->schedule); + } + + /** + * Specifies the frequency for the operation, using the unix-cron format. + * + * Generated from protobuf field optional string schedule = 375820951; + * @param string $var + * @return $this + */ + public function setSchedule($var) + { + GPBUtil::checkString($var, True); + $this->schedule = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyList.php new file mode 100644 index 000000000000..e0b77c79dbff --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyList.php @@ -0,0 +1,323 @@ +google.cloud.compute.v1.ResourcePolicyList + */ +class ResourcePolicyList extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string etag = 3123477; + */ + protected $etag = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * [Output Only] A list of ResourcePolicy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ResourcePolicy items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource.Always compute#resourcePoliciesList for listsof resourcePolicies + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $etag + * @type string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type array<\Google\Cloud\Compute\V1\ResourcePolicy>|\Google\Protobuf\Internal\RepeatedField $items + * [Output Only] A list of ResourcePolicy resources. + * @type string $kind + * [Output Only] Type of resource.Always compute#resourcePoliciesList for listsof resourcePolicies + * @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); + } + + /** + * Generated from protobuf field optional string etag = 3123477; + * @return string + */ + public function getEtag() + { + return isset($this->etag) ? $this->etag : ''; + } + + public function hasEtag() + { + return isset($this->etag); + } + + public function clearEtag() + { + unset($this->etag); + } + + /** + * Generated from protobuf field optional string etag = 3123477; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is 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] The unique identifier for the resource. This identifier is 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; + } + + /** + * [Output Only] A list of ResourcePolicy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ResourcePolicy items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * [Output Only] A list of ResourcePolicy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ResourcePolicy items = 100526016; + * @param array<\Google\Cloud\Compute\V1\ResourcePolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ResourcePolicy::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource.Always compute#resourcePoliciesList for listsof resourcePolicies + * + * 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); + } + + /** + * [Output Only] Type of resource.Always compute#resourcePoliciesList for listsof resourcePolicies + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyResourceStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyResourceStatus.php new file mode 100644 index 000000000000..73bf28ee62e7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyResourceStatus.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.ResourcePolicyResourceStatus + */ +class ResourcePolicyResourceStatus extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Specifies a set of output values reffering to the instance_schedule_policy system status. This field should have the same name as corresponding policy field. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus instance_schedule_policy = 344877104; + */ + protected $instance_schedule_policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\ResourcePolicyResourceStatusInstanceSchedulePolicyStatus $instance_schedule_policy + * [Output Only] Specifies a set of output values reffering to the instance_schedule_policy system status. This field should have the same name as corresponding policy field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Specifies a set of output values reffering to the instance_schedule_policy system status. This field should have the same name as corresponding policy field. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus instance_schedule_policy = 344877104; + * @return \Google\Cloud\Compute\V1\ResourcePolicyResourceStatusInstanceSchedulePolicyStatus|null + */ + public function getInstanceSchedulePolicy() + { + return $this->instance_schedule_policy; + } + + public function hasInstanceSchedulePolicy() + { + return isset($this->instance_schedule_policy); + } + + public function clearInstanceSchedulePolicy() + { + unset($this->instance_schedule_policy); + } + + /** + * [Output Only] Specifies a set of output values reffering to the instance_schedule_policy system status. This field should have the same name as corresponding policy field. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus instance_schedule_policy = 344877104; + * @param \Google\Cloud\Compute\V1\ResourcePolicyResourceStatusInstanceSchedulePolicyStatus $var + * @return $this + */ + public function setInstanceSchedulePolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ResourcePolicyResourceStatusInstanceSchedulePolicyStatus::class); + $this->instance_schedule_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.php new file mode 100644 index 000000000000..be74f034b615 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus + */ +class ResourcePolicyResourceStatusInstanceSchedulePolicyStatus extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The last time the schedule successfully ran. The timestamp is an RFC3339 string. + * + * Generated from protobuf field optional string last_run_start_time = 303069063; + */ + protected $last_run_start_time = null; + /** + * [Output Only] The next time the schedule is planned to run. The actual time might be slightly different. The timestamp is an RFC3339 string. + * + * Generated from protobuf field optional string next_run_start_time = 318642570; + */ + protected $next_run_start_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $last_run_start_time + * [Output Only] The last time the schedule successfully ran. The timestamp is an RFC3339 string. + * @type string $next_run_start_time + * [Output Only] The next time the schedule is planned to run. The actual time might be slightly different. The timestamp is an RFC3339 string. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The last time the schedule successfully ran. The timestamp is an RFC3339 string. + * + * Generated from protobuf field optional string last_run_start_time = 303069063; + * @return string + */ + public function getLastRunStartTime() + { + return isset($this->last_run_start_time) ? $this->last_run_start_time : ''; + } + + public function hasLastRunStartTime() + { + return isset($this->last_run_start_time); + } + + public function clearLastRunStartTime() + { + unset($this->last_run_start_time); + } + + /** + * [Output Only] The last time the schedule successfully ran. The timestamp is an RFC3339 string. + * + * Generated from protobuf field optional string last_run_start_time = 303069063; + * @param string $var + * @return $this + */ + public function setLastRunStartTime($var) + { + GPBUtil::checkString($var, True); + $this->last_run_start_time = $var; + + return $this; + } + + /** + * [Output Only] The next time the schedule is planned to run. The actual time might be slightly different. The timestamp is an RFC3339 string. + * + * Generated from protobuf field optional string next_run_start_time = 318642570; + * @return string + */ + public function getNextRunStartTime() + { + return isset($this->next_run_start_time) ? $this->next_run_start_time : ''; + } + + public function hasNextRunStartTime() + { + return isset($this->next_run_start_time); + } + + public function clearNextRunStartTime() + { + unset($this->next_run_start_time); + } + + /** + * [Output Only] The next time the schedule is planned to run. The actual time might be slightly different. The timestamp is an RFC3339 string. + * + * Generated from protobuf field optional string next_run_start_time = 318642570; + * @param string $var + * @return $this + */ + public function setNextRunStartTime($var) + { + GPBUtil::checkString($var, True); + $this->next_run_start_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicySnapshotSchedulePolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicySnapshotSchedulePolicy.php new file mode 100644 index 000000000000..f858d6ad9a75 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicySnapshotSchedulePolicy.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy + */ +class ResourcePolicySnapshotSchedulePolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Retention policy applied to snapshots created by this resource policy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy retention_policy = 68625779; + */ + protected $retention_policy = null; + /** + * A Vm Maintenance Policy specifies what kind of infrastructure maintenance we are allowed to perform on this VM and when. Schedule that is applied to disks covered by this policy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule schedule = 375820951; + */ + protected $schedule = null; + /** + * Properties with which snapshots are created such as labels, encryption keys. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties snapshot_properties = 185371278; + */ + protected $snapshot_properties = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\ResourcePolicySnapshotSchedulePolicyRetentionPolicy $retention_policy + * Retention policy applied to snapshots created by this resource policy. + * @type \Google\Cloud\Compute\V1\ResourcePolicySnapshotSchedulePolicySchedule $schedule + * A Vm Maintenance Policy specifies what kind of infrastructure maintenance we are allowed to perform on this VM and when. Schedule that is applied to disks covered by this policy. + * @type \Google\Cloud\Compute\V1\ResourcePolicySnapshotSchedulePolicySnapshotProperties $snapshot_properties + * Properties with which snapshots are created such as labels, encryption keys. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Retention policy applied to snapshots created by this resource policy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy retention_policy = 68625779; + * @return \Google\Cloud\Compute\V1\ResourcePolicySnapshotSchedulePolicyRetentionPolicy|null + */ + public function getRetentionPolicy() + { + return $this->retention_policy; + } + + public function hasRetentionPolicy() + { + return isset($this->retention_policy); + } + + public function clearRetentionPolicy() + { + unset($this->retention_policy); + } + + /** + * Retention policy applied to snapshots created by this resource policy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy retention_policy = 68625779; + * @param \Google\Cloud\Compute\V1\ResourcePolicySnapshotSchedulePolicyRetentionPolicy $var + * @return $this + */ + public function setRetentionPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ResourcePolicySnapshotSchedulePolicyRetentionPolicy::class); + $this->retention_policy = $var; + + return $this; + } + + /** + * A Vm Maintenance Policy specifies what kind of infrastructure maintenance we are allowed to perform on this VM and when. Schedule that is applied to disks covered by this policy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule schedule = 375820951; + * @return \Google\Cloud\Compute\V1\ResourcePolicySnapshotSchedulePolicySchedule|null + */ + public function getSchedule() + { + return $this->schedule; + } + + public function hasSchedule() + { + return isset($this->schedule); + } + + public function clearSchedule() + { + unset($this->schedule); + } + + /** + * A Vm Maintenance Policy specifies what kind of infrastructure maintenance we are allowed to perform on this VM and when. Schedule that is applied to disks covered by this policy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule schedule = 375820951; + * @param \Google\Cloud\Compute\V1\ResourcePolicySnapshotSchedulePolicySchedule $var + * @return $this + */ + public function setSchedule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ResourcePolicySnapshotSchedulePolicySchedule::class); + $this->schedule = $var; + + return $this; + } + + /** + * Properties with which snapshots are created such as labels, encryption keys. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties snapshot_properties = 185371278; + * @return \Google\Cloud\Compute\V1\ResourcePolicySnapshotSchedulePolicySnapshotProperties|null + */ + public function getSnapshotProperties() + { + return $this->snapshot_properties; + } + + public function hasSnapshotProperties() + { + return isset($this->snapshot_properties); + } + + public function clearSnapshotProperties() + { + unset($this->snapshot_properties); + } + + /** + * Properties with which snapshots are created such as labels, encryption keys. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties snapshot_properties = 185371278; + * @param \Google\Cloud\Compute\V1\ResourcePolicySnapshotSchedulePolicySnapshotProperties $var + * @return $this + */ + public function setSnapshotProperties($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ResourcePolicySnapshotSchedulePolicySnapshotProperties::class); + $this->snapshot_properties = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicySnapshotSchedulePolicyRetentionPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicySnapshotSchedulePolicyRetentionPolicy.php new file mode 100644 index 000000000000..4a91189d7faf --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicySnapshotSchedulePolicyRetentionPolicy.php @@ -0,0 +1,125 @@ +google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy + */ +class ResourcePolicySnapshotSchedulePolicyRetentionPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Maximum age of the snapshot that is allowed to be kept. + * + * Generated from protobuf field optional int32 max_retention_days = 324296979; + */ + protected $max_retention_days = null; + /** + * Specifies the behavior to apply to scheduled snapshots when the source disk is deleted. + * Check the OnSourceDiskDelete enum for the list of possible values. + * + * Generated from protobuf field optional string on_source_disk_delete = 321955529; + */ + protected $on_source_disk_delete = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $max_retention_days + * Maximum age of the snapshot that is allowed to be kept. + * @type string $on_source_disk_delete + * Specifies the behavior to apply to scheduled snapshots when the source disk is deleted. + * Check the OnSourceDiskDelete enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Maximum age of the snapshot that is allowed to be kept. + * + * Generated from protobuf field optional int32 max_retention_days = 324296979; + * @return int + */ + public function getMaxRetentionDays() + { + return isset($this->max_retention_days) ? $this->max_retention_days : 0; + } + + public function hasMaxRetentionDays() + { + return isset($this->max_retention_days); + } + + public function clearMaxRetentionDays() + { + unset($this->max_retention_days); + } + + /** + * Maximum age of the snapshot that is allowed to be kept. + * + * Generated from protobuf field optional int32 max_retention_days = 324296979; + * @param int $var + * @return $this + */ + public function setMaxRetentionDays($var) + { + GPBUtil::checkInt32($var); + $this->max_retention_days = $var; + + return $this; + } + + /** + * Specifies the behavior to apply to scheduled snapshots when the source disk is deleted. + * Check the OnSourceDiskDelete enum for the list of possible values. + * + * Generated from protobuf field optional string on_source_disk_delete = 321955529; + * @return string + */ + public function getOnSourceDiskDelete() + { + return isset($this->on_source_disk_delete) ? $this->on_source_disk_delete : ''; + } + + public function hasOnSourceDiskDelete() + { + return isset($this->on_source_disk_delete); + } + + public function clearOnSourceDiskDelete() + { + unset($this->on_source_disk_delete); + } + + /** + * Specifies the behavior to apply to scheduled snapshots when the source disk is deleted. + * Check the OnSourceDiskDelete enum for the list of possible values. + * + * Generated from protobuf field optional string on_source_disk_delete = 321955529; + * @param string $var + * @return $this + */ + public function setOnSourceDiskDelete($var) + { + GPBUtil::checkString($var, True); + $this->on_source_disk_delete = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicySnapshotSchedulePolicyRetentionPolicy/OnSourceDiskDelete.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicySnapshotSchedulePolicyRetentionPolicy/OnSourceDiskDelete.php new file mode 100644 index 000000000000..f631ba59abec --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicySnapshotSchedulePolicyRetentionPolicy/OnSourceDiskDelete.php @@ -0,0 +1,65 @@ +google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy.OnSourceDiskDelete + */ +class OnSourceDiskDelete +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ON_SOURCE_DISK_DELETE = 0; + */ + const UNDEFINED_ON_SOURCE_DISK_DELETE = 0; + /** + * Generated from protobuf enum APPLY_RETENTION_POLICY = 535071332; + */ + const APPLY_RETENTION_POLICY = 535071332; + /** + * Generated from protobuf enum KEEP_AUTO_SNAPSHOTS = 258925689; + */ + const KEEP_AUTO_SNAPSHOTS = 258925689; + /** + * Generated from protobuf enum UNSPECIFIED_ON_SOURCE_DISK_DELETE = 239140769; + */ + const UNSPECIFIED_ON_SOURCE_DISK_DELETE = 239140769; + + private static $valueToName = [ + self::UNDEFINED_ON_SOURCE_DISK_DELETE => 'UNDEFINED_ON_SOURCE_DISK_DELETE', + self::APPLY_RETENTION_POLICY => 'APPLY_RETENTION_POLICY', + self::KEEP_AUTO_SNAPSHOTS => 'KEEP_AUTO_SNAPSHOTS', + self::UNSPECIFIED_ON_SOURCE_DISK_DELETE => 'UNSPECIFIED_ON_SOURCE_DISK_DELETE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(OnSourceDiskDelete::class, \Google\Cloud\Compute\V1\ResourcePolicySnapshotSchedulePolicyRetentionPolicy_OnSourceDiskDelete::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicySnapshotSchedulePolicySchedule.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicySnapshotSchedulePolicySchedule.php new file mode 100644 index 000000000000..ad9c65433731 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicySnapshotSchedulePolicySchedule.php @@ -0,0 +1,144 @@ +google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule + */ +class ResourcePolicySnapshotSchedulePolicySchedule extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyDailyCycle daily_schedule = 86159869; + */ + protected $daily_schedule = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyHourlyCycle hourly_schedule = 38328485; + */ + protected $hourly_schedule = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyWeeklyCycle weekly_schedule = 359548053; + */ + protected $weekly_schedule = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\ResourcePolicyDailyCycle $daily_schedule + * @type \Google\Cloud\Compute\V1\ResourcePolicyHourlyCycle $hourly_schedule + * @type \Google\Cloud\Compute\V1\ResourcePolicyWeeklyCycle $weekly_schedule + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyDailyCycle daily_schedule = 86159869; + * @return \Google\Cloud\Compute\V1\ResourcePolicyDailyCycle|null + */ + public function getDailySchedule() + { + return $this->daily_schedule; + } + + public function hasDailySchedule() + { + return isset($this->daily_schedule); + } + + public function clearDailySchedule() + { + unset($this->daily_schedule); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyDailyCycle daily_schedule = 86159869; + * @param \Google\Cloud\Compute\V1\ResourcePolicyDailyCycle $var + * @return $this + */ + public function setDailySchedule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ResourcePolicyDailyCycle::class); + $this->daily_schedule = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyHourlyCycle hourly_schedule = 38328485; + * @return \Google\Cloud\Compute\V1\ResourcePolicyHourlyCycle|null + */ + public function getHourlySchedule() + { + return $this->hourly_schedule; + } + + public function hasHourlySchedule() + { + return isset($this->hourly_schedule); + } + + public function clearHourlySchedule() + { + unset($this->hourly_schedule); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyHourlyCycle hourly_schedule = 38328485; + * @param \Google\Cloud\Compute\V1\ResourcePolicyHourlyCycle $var + * @return $this + */ + public function setHourlySchedule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ResourcePolicyHourlyCycle::class); + $this->hourly_schedule = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyWeeklyCycle weekly_schedule = 359548053; + * @return \Google\Cloud\Compute\V1\ResourcePolicyWeeklyCycle|null + */ + public function getWeeklySchedule() + { + return $this->weekly_schedule; + } + + public function hasWeeklySchedule() + { + return isset($this->weekly_schedule); + } + + public function clearWeeklySchedule() + { + unset($this->weekly_schedule); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ResourcePolicyWeeklyCycle weekly_schedule = 359548053; + * @param \Google\Cloud\Compute\V1\ResourcePolicyWeeklyCycle $var + * @return $this + */ + public function setWeeklySchedule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ResourcePolicyWeeklyCycle::class); + $this->weekly_schedule = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicySnapshotSchedulePolicySnapshotProperties.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicySnapshotSchedulePolicySnapshotProperties.php new file mode 100644 index 000000000000..b510adb6ba78 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicySnapshotSchedulePolicySnapshotProperties.php @@ -0,0 +1,189 @@ +google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties + */ +class ResourcePolicySnapshotSchedulePolicySnapshotProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Chain name that the snapshot is created in. + * + * Generated from protobuf field optional string chain_name = 68644169; + */ + protected $chain_name = null; + /** + * Indication to perform a 'guest aware' snapshot. + * + * Generated from protobuf field optional bool guest_flush = 385550813; + */ + protected $guest_flush = null; + /** + * Labels to apply to scheduled snapshots. These can be later modified by the setLabels method. Label values may be empty. + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + /** + * Cloud Storage bucket storage location of the auto snapshot (regional or multi-regional). + * + * Generated from protobuf field repeated string storage_locations = 328005274; + */ + private $storage_locations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $chain_name + * Chain name that the snapshot is created in. + * @type bool $guest_flush + * Indication to perform a 'guest aware' snapshot. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels to apply to scheduled snapshots. These can be later modified by the setLabels method. Label values may be empty. + * @type array|\Google\Protobuf\Internal\RepeatedField $storage_locations + * Cloud Storage bucket storage location of the auto snapshot (regional or multi-regional). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Chain name that the snapshot is created in. + * + * Generated from protobuf field optional string chain_name = 68644169; + * @return string + */ + public function getChainName() + { + return isset($this->chain_name) ? $this->chain_name : ''; + } + + public function hasChainName() + { + return isset($this->chain_name); + } + + public function clearChainName() + { + unset($this->chain_name); + } + + /** + * Chain name that the snapshot is created in. + * + * Generated from protobuf field optional string chain_name = 68644169; + * @param string $var + * @return $this + */ + public function setChainName($var) + { + GPBUtil::checkString($var, True); + $this->chain_name = $var; + + return $this; + } + + /** + * Indication to perform a 'guest aware' snapshot. + * + * Generated from protobuf field optional bool guest_flush = 385550813; + * @return bool + */ + public function getGuestFlush() + { + return isset($this->guest_flush) ? $this->guest_flush : false; + } + + public function hasGuestFlush() + { + return isset($this->guest_flush); + } + + public function clearGuestFlush() + { + unset($this->guest_flush); + } + + /** + * Indication to perform a 'guest aware' snapshot. + * + * Generated from protobuf field optional bool guest_flush = 385550813; + * @param bool $var + * @return $this + */ + public function setGuestFlush($var) + { + GPBUtil::checkBool($var); + $this->guest_flush = $var; + + return $this; + } + + /** + * Labels to apply to scheduled snapshots. These can be later modified by the setLabels method. Label values may be empty. + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels to apply to scheduled snapshots. These can be later modified by the setLabels method. Label values may be empty. + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Cloud Storage bucket storage location of the auto snapshot (regional or multi-regional). + * + * Generated from protobuf field repeated string storage_locations = 328005274; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStorageLocations() + { + return $this->storage_locations; + } + + /** + * Cloud Storage bucket storage location of the auto snapshot (regional or multi-regional). + * + * Generated from protobuf field repeated string storage_locations = 328005274; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStorageLocations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->storage_locations = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyWeeklyCycle.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyWeeklyCycle.php new file mode 100644 index 000000000000..41e10105ea3e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyWeeklyCycle.php @@ -0,0 +1,67 @@ +google.cloud.compute.v1.ResourcePolicyWeeklyCycle + */ +class ResourcePolicyWeeklyCycle extends \Google\Protobuf\Internal\Message +{ + /** + * Up to 7 intervals/windows, one for each day of the week. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek day_of_weeks = 257871834; + */ + private $day_of_weeks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\ResourcePolicyWeeklyCycleDayOfWeek>|\Google\Protobuf\Internal\RepeatedField $day_of_weeks + * Up to 7 intervals/windows, one for each day of the week. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Up to 7 intervals/windows, one for each day of the week. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek day_of_weeks = 257871834; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDayOfWeeks() + { + return $this->day_of_weeks; + } + + /** + * Up to 7 intervals/windows, one for each day of the week. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek day_of_weeks = 257871834; + * @param array<\Google\Cloud\Compute\V1\ResourcePolicyWeeklyCycleDayOfWeek>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDayOfWeeks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ResourcePolicyWeeklyCycleDayOfWeek::class); + $this->day_of_weeks = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyWeeklyCycleDayOfWeek.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyWeeklyCycleDayOfWeek.php new file mode 100644 index 000000000000..7b7ab06ed0d0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyWeeklyCycleDayOfWeek.php @@ -0,0 +1,168 @@ +google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek + */ +class ResourcePolicyWeeklyCycleDayOfWeek extends \Google\Protobuf\Internal\Message +{ + /** + * Defines a schedule that runs on specific days of the week. Specify one or more days. The following options are available: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY. + * Check the Day enum for the list of possible values. + * + * Generated from protobuf field optional string day = 99228; + */ + protected $day = null; + /** + * [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario. + * + * Generated from protobuf field optional string duration = 155471252; + */ + protected $duration = null; + /** + * Time within the window to start the operations. It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. + * + * Generated from protobuf field optional string start_time = 37467274; + */ + protected $start_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $day + * Defines a schedule that runs on specific days of the week. Specify one or more days. The following options are available: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY. + * Check the Day enum for the list of possible values. + * @type string $duration + * [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario. + * @type string $start_time + * Time within the window to start the operations. It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Defines a schedule that runs on specific days of the week. Specify one or more days. The following options are available: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY. + * Check the Day enum for the list of possible values. + * + * Generated from protobuf field optional string day = 99228; + * @return string + */ + public function getDay() + { + return isset($this->day) ? $this->day : ''; + } + + public function hasDay() + { + return isset($this->day); + } + + public function clearDay() + { + unset($this->day); + } + + /** + * Defines a schedule that runs on specific days of the week. Specify one or more days. The following options are available: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY. + * Check the Day enum for the list of possible values. + * + * Generated from protobuf field optional string day = 99228; + * @param string $var + * @return $this + */ + public function setDay($var) + { + GPBUtil::checkString($var, True); + $this->day = $var; + + return $this; + } + + /** + * [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario. + * + * Generated from protobuf field optional string duration = 155471252; + * @return string + */ + public function getDuration() + { + return isset($this->duration) ? $this->duration : ''; + } + + public function hasDuration() + { + return isset($this->duration); + } + + public function clearDuration() + { + unset($this->duration); + } + + /** + * [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario. + * + * Generated from protobuf field optional string duration = 155471252; + * @param string $var + * @return $this + */ + public function setDuration($var) + { + GPBUtil::checkString($var, True); + $this->duration = $var; + + return $this; + } + + /** + * Time within the window to start the operations. It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. + * + * Generated from protobuf field optional string start_time = 37467274; + * @return string + */ + public function getStartTime() + { + return isset($this->start_time) ? $this->start_time : ''; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Time within the window to start the operations. It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. + * + * Generated from protobuf field optional string start_time = 37467274; + * @param string $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkString($var, True); + $this->start_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyWeeklyCycleDayOfWeek/Day.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyWeeklyCycleDayOfWeek/Day.php new file mode 100644 index 000000000000..ac306b28cc56 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourcePolicyWeeklyCycleDayOfWeek/Day.php @@ -0,0 +1,90 @@ +google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek.Day + */ +class Day +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_DAY = 0; + */ + const UNDEFINED_DAY = 0; + /** + * Generated from protobuf enum FRIDAY = 471398751; + */ + const FRIDAY = 471398751; + /** + * Generated from protobuf enum INVALID = 530283991; + */ + const INVALID = 530283991; + /** + * Generated from protobuf enum MONDAY = 132310288; + */ + const MONDAY = 132310288; + /** + * Generated from protobuf enum SATURDAY = 279037881; + */ + const SATURDAY = 279037881; + /** + * Generated from protobuf enum SUNDAY = 309626320; + */ + const SUNDAY = 309626320; + /** + * Generated from protobuf enum THURSDAY = 207198682; + */ + const THURSDAY = 207198682; + /** + * Generated from protobuf enum TUESDAY = 277509677; + */ + const TUESDAY = 277509677; + /** + * Generated from protobuf enum WEDNESDAY = 422029110; + */ + const WEDNESDAY = 422029110; + + private static $valueToName = [ + self::UNDEFINED_DAY => 'UNDEFINED_DAY', + self::FRIDAY => 'FRIDAY', + self::INVALID => 'INVALID', + self::MONDAY => 'MONDAY', + self::SATURDAY => 'SATURDAY', + self::SUNDAY => 'SUNDAY', + self::THURSDAY => 'THURSDAY', + self::TUESDAY => 'TUESDAY', + self::WEDNESDAY => 'WEDNESDAY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Day::class, \Google\Cloud\Compute\V1\ResourcePolicyWeeklyCycleDayOfWeek_Day::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourceStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourceStatus.php new file mode 100644 index 000000000000..6122bd19f131 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourceStatus.php @@ -0,0 +1,114 @@ +google.cloud.compute.v1.ResourceStatus + */ +class ResourceStatus extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] An opaque ID of the host on which the VM is running. + * + * Generated from protobuf field optional string physical_host = 464370704; + */ + protected $physical_host = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.UpcomingMaintenance upcoming_maintenance = 227348592; + */ + protected $upcoming_maintenance = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $physical_host + * [Output Only] An opaque ID of the host on which the VM is running. + * @type \Google\Cloud\Compute\V1\UpcomingMaintenance $upcoming_maintenance + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] An opaque ID of the host on which the VM is running. + * + * Generated from protobuf field optional string physical_host = 464370704; + * @return string + */ + public function getPhysicalHost() + { + return isset($this->physical_host) ? $this->physical_host : ''; + } + + public function hasPhysicalHost() + { + return isset($this->physical_host); + } + + public function clearPhysicalHost() + { + unset($this->physical_host); + } + + /** + * [Output Only] An opaque ID of the host on which the VM is running. + * + * Generated from protobuf field optional string physical_host = 464370704; + * @param string $var + * @return $this + */ + public function setPhysicalHost($var) + { + GPBUtil::checkString($var, True); + $this->physical_host = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.UpcomingMaintenance upcoming_maintenance = 227348592; + * @return \Google\Cloud\Compute\V1\UpcomingMaintenance|null + */ + public function getUpcomingMaintenance() + { + return $this->upcoming_maintenance; + } + + public function hasUpcomingMaintenance() + { + return isset($this->upcoming_maintenance); + } + + public function clearUpcomingMaintenance() + { + unset($this->upcoming_maintenance); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.UpcomingMaintenance upcoming_maintenance = 227348592; + * @param \Google\Cloud\Compute\V1\UpcomingMaintenance $var + * @return $this + */ + public function setUpcomingMaintenance($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\UpcomingMaintenance::class); + $this->upcoming_maintenance = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResumeInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResumeInstanceRequest.php new file mode 100644 index 000000000000..c1d529d70f66 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResumeInstanceRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.ResumeInstanceRequest + */ +class ResumeInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the instance resource to resume. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance resource to resume. + * + * @return \Google\Cloud\Compute\V1\ResumeInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name of the instance resource to resume. + * @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); + } + + /** + * Name of the instance resource to resume. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance resource to resume. + * + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Route.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Route.php new file mode 100644 index 000000000000..df575ae1dccc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Route.php @@ -0,0 +1,979 @@ +google.cloud.compute.v1.Route + */ +class Route extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] AS path. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouteAsPath as_paths = 137568929; + */ + private $as_paths; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this field when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * The destination range of outgoing packets that this route applies to. Both IPv4 and IPv6 are supported. Must specify an IPv4 range (e.g. 192.0.2.0/24) or an IPv6 range in RFC 4291 format (e.g. 2001:db8::/32). IPv6 range will be displayed using RFC 5952 compressed format. + * + * Generated from protobuf field optional string dest_range = 381327712; + */ + protected $dest_range = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of this resource. Always compute#routes for Route resources. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * 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])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Fully-qualified URL of the network that this route applies to. + * + * Generated from protobuf field optional string network = 232872494; + */ + protected $network = null; + /** + * The URL to a gateway that should handle matching packets. You can only specify the internet gateway using a full or partial valid URL: projects/ project/global/gateways/default-internet-gateway + * + * Generated from protobuf field optional string next_hop_gateway = 377175298; + */ + protected $next_hop_gateway = null; + /** + * [Output Only] The full resource name of the Network Connectivity Center hub that will handle matching packets. + * + * Generated from protobuf field optional string next_hop_hub = 198679219; + */ + protected $next_hop_hub = null; + /** + * The URL to a forwarding rule of type loadBalancingScheme=INTERNAL that should handle matching packets or the IP address of the forwarding Rule. For example, the following are all valid URLs: - 10.128.0.56 - https://www.googleapis.com/compute/v1/projects/project/regions/region /forwardingRules/forwardingRule - regions/region/forwardingRules/forwardingRule + * + * Generated from protobuf field optional string next_hop_ilb = 198679901; + */ + protected $next_hop_ilb = null; + /** + * The URL to an instance that should handle matching packets. You can specify this as a full or partial URL. For example: https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/ + * + * Generated from protobuf field optional string next_hop_instance = 393508247; + */ + protected $next_hop_instance = null; + /** + * The network IP address of an instance that should handle matching packets. Both IPv6 address and IPv4 addresses are supported. Must specify an IPv4 address in dot-decimal notation (e.g. 192.0.2.99) or an IPv6 address in RFC 4291 format (e.g. 2001:db8::2d9:51:0:0 or 2001:db8:0:0:2d9:51:0:0). IPv6 addresses will be displayed using RFC 5952 compressed format (e.g. 2001:db8::2d9:51:0:0). Should never be an IPv4-mapped IPv6 address. + * + * Generated from protobuf field optional string next_hop_ip = 110319529; + */ + protected $next_hop_ip = null; + /** + * The URL of the local network if it should handle matching packets. + * + * Generated from protobuf field optional string next_hop_network = 262295788; + */ + protected $next_hop_network = null; + /** + * [Output Only] The network peering name that should handle matching packets, which should conform to RFC1035. + * + * Generated from protobuf field optional string next_hop_peering = 412682750; + */ + protected $next_hop_peering = null; + /** + * The URL to a VpnTunnel that should handle matching packets. + * + * Generated from protobuf field optional string next_hop_vpn_tunnel = 519844501; + */ + protected $next_hop_vpn_tunnel = null; + /** + * The priority of this route. Priority is used to break ties in cases where there is more than one matching route of equal prefix length. In cases where multiple routes have equal prefix length, the one with the lowest-numbered priority value wins. The default value is `1000`. The priority value must be from `0` to `65535`, inclusive. + * + * Generated from protobuf field optional uint32 priority = 445151652; + */ + protected $priority = null; + /** + * [Output only] The status of the route. + * Check the RouteStatus enum for the list of possible values. + * + * Generated from protobuf field optional string route_status = 418162344; + */ + protected $route_status = null; + /** + * [Output Only] The type of this route, which can be one of the following values: - 'TRANSIT' for a transit route that this router learned from another Cloud Router and will readvertise to one of its BGP peers - 'SUBNET' for a route from a subnet of the VPC - 'BGP' for a route learned from a BGP peer of this router - 'STATIC' for a static route + * Check the RouteType enum for the list of possible values. + * + * Generated from protobuf field optional string route_type = 375888752; + */ + protected $route_type = null; + /** + * [Output Only] Server-defined fully-qualified URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * A list of instance tags to which this route applies. + * + * Generated from protobuf field repeated string tags = 3552281; + */ + private $tags; + /** + * [Output Only] If potential misconfigurations are detected for this route, this field will be populated with warning messages. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Warnings warnings = 498091095; + */ + private $warnings; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\RouteAsPath>|\Google\Protobuf\Internal\RepeatedField $as_paths + * [Output Only] AS path. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this field when you create the resource. + * @type string $dest_range + * The destination range of outgoing packets that this route applies to. Both IPv4 and IPv6 are supported. Must specify an IPv4 range (e.g. 192.0.2.0/24) or an IPv6 range in RFC 4291 format (e.g. 2001:db8::/32). IPv6 range will be displayed using RFC 5952 compressed format. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of this resource. Always compute#routes for Route resources. + * @type string $name + * 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])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. + * @type string $network + * Fully-qualified URL of the network that this route applies to. + * @type string $next_hop_gateway + * The URL to a gateway that should handle matching packets. You can only specify the internet gateway using a full or partial valid URL: projects/ project/global/gateways/default-internet-gateway + * @type string $next_hop_hub + * [Output Only] The full resource name of the Network Connectivity Center hub that will handle matching packets. + * @type string $next_hop_ilb + * The URL to a forwarding rule of type loadBalancingScheme=INTERNAL that should handle matching packets or the IP address of the forwarding Rule. For example, the following are all valid URLs: - 10.128.0.56 - https://www.googleapis.com/compute/v1/projects/project/regions/region /forwardingRules/forwardingRule - regions/region/forwardingRules/forwardingRule + * @type string $next_hop_instance + * The URL to an instance that should handle matching packets. You can specify this as a full or partial URL. For example: https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/ + * @type string $next_hop_ip + * The network IP address of an instance that should handle matching packets. Both IPv6 address and IPv4 addresses are supported. Must specify an IPv4 address in dot-decimal notation (e.g. 192.0.2.99) or an IPv6 address in RFC 4291 format (e.g. 2001:db8::2d9:51:0:0 or 2001:db8:0:0:2d9:51:0:0). IPv6 addresses will be displayed using RFC 5952 compressed format (e.g. 2001:db8::2d9:51:0:0). Should never be an IPv4-mapped IPv6 address. + * @type string $next_hop_network + * The URL of the local network if it should handle matching packets. + * @type string $next_hop_peering + * [Output Only] The network peering name that should handle matching packets, which should conform to RFC1035. + * @type string $next_hop_vpn_tunnel + * The URL to a VpnTunnel that should handle matching packets. + * @type int $priority + * The priority of this route. Priority is used to break ties in cases where there is more than one matching route of equal prefix length. In cases where multiple routes have equal prefix length, the one with the lowest-numbered priority value wins. The default value is `1000`. The priority value must be from `0` to `65535`, inclusive. + * @type string $route_status + * [Output only] The status of the route. + * Check the RouteStatus enum for the list of possible values. + * @type string $route_type + * [Output Only] The type of this route, which can be one of the following values: - 'TRANSIT' for a transit route that this router learned from another Cloud Router and will readvertise to one of its BGP peers - 'SUBNET' for a route from a subnet of the VPC - 'BGP' for a route learned from a BGP peer of this router - 'STATIC' for a static route + * Check the RouteType enum for the list of possible values. + * @type string $self_link + * [Output Only] Server-defined fully-qualified URL for this resource. + * @type array|\Google\Protobuf\Internal\RepeatedField $tags + * A list of instance tags to which this route applies. + * @type array<\Google\Cloud\Compute\V1\Warnings>|\Google\Protobuf\Internal\RepeatedField $warnings + * [Output Only] If potential misconfigurations are detected for this route, this field will be populated with warning messages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] AS path. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouteAsPath as_paths = 137568929; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAsPaths() + { + return $this->as_paths; + } + + /** + * [Output Only] AS path. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouteAsPath as_paths = 137568929; + * @param array<\Google\Cloud\Compute\V1\RouteAsPath>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAsPaths($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\RouteAsPath::class); + $this->as_paths = $arr; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this field when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this field when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The destination range of outgoing packets that this route applies to. Both IPv4 and IPv6 are supported. Must specify an IPv4 range (e.g. 192.0.2.0/24) or an IPv6 range in RFC 4291 format (e.g. 2001:db8::/32). IPv6 range will be displayed using RFC 5952 compressed format. + * + * Generated from protobuf field optional string dest_range = 381327712; + * @return string + */ + public function getDestRange() + { + return isset($this->dest_range) ? $this->dest_range : ''; + } + + public function hasDestRange() + { + return isset($this->dest_range); + } + + public function clearDestRange() + { + unset($this->dest_range); + } + + /** + * The destination range of outgoing packets that this route applies to. Both IPv4 and IPv6 are supported. Must specify an IPv4 range (e.g. 192.0.2.0/24) or an IPv6 range in RFC 4291 format (e.g. 2001:db8::/32). IPv6 range will be displayed using RFC 5952 compressed format. + * + * Generated from protobuf field optional string dest_range = 381327712; + * @param string $var + * @return $this + */ + public function setDestRange($var) + { + GPBUtil::checkString($var, True); + $this->dest_range = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of this resource. Always compute#routes for Route resources. + * + * 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); + } + + /** + * [Output Only] Type of this resource. Always compute#routes for Route resources. + * + * 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; + } + + /** + * 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])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. + * + * 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); + } + + /** + * 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])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. + * + * 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; + } + + /** + * Fully-qualified URL of the network that this route applies to. + * + * Generated from protobuf field optional string network = 232872494; + * @return string + */ + public function getNetwork() + { + return isset($this->network) ? $this->network : ''; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * Fully-qualified URL of the network that this route applies to. + * + * Generated from protobuf field optional string network = 232872494; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * The URL to a gateway that should handle matching packets. You can only specify the internet gateway using a full or partial valid URL: projects/ project/global/gateways/default-internet-gateway + * + * Generated from protobuf field optional string next_hop_gateway = 377175298; + * @return string + */ + public function getNextHopGateway() + { + return isset($this->next_hop_gateway) ? $this->next_hop_gateway : ''; + } + + public function hasNextHopGateway() + { + return isset($this->next_hop_gateway); + } + + public function clearNextHopGateway() + { + unset($this->next_hop_gateway); + } + + /** + * The URL to a gateway that should handle matching packets. You can only specify the internet gateway using a full or partial valid URL: projects/ project/global/gateways/default-internet-gateway + * + * Generated from protobuf field optional string next_hop_gateway = 377175298; + * @param string $var + * @return $this + */ + public function setNextHopGateway($var) + { + GPBUtil::checkString($var, True); + $this->next_hop_gateway = $var; + + return $this; + } + + /** + * [Output Only] The full resource name of the Network Connectivity Center hub that will handle matching packets. + * + * Generated from protobuf field optional string next_hop_hub = 198679219; + * @return string + */ + public function getNextHopHub() + { + return isset($this->next_hop_hub) ? $this->next_hop_hub : ''; + } + + public function hasNextHopHub() + { + return isset($this->next_hop_hub); + } + + public function clearNextHopHub() + { + unset($this->next_hop_hub); + } + + /** + * [Output Only] The full resource name of the Network Connectivity Center hub that will handle matching packets. + * + * Generated from protobuf field optional string next_hop_hub = 198679219; + * @param string $var + * @return $this + */ + public function setNextHopHub($var) + { + GPBUtil::checkString($var, True); + $this->next_hop_hub = $var; + + return $this; + } + + /** + * The URL to a forwarding rule of type loadBalancingScheme=INTERNAL that should handle matching packets or the IP address of the forwarding Rule. For example, the following are all valid URLs: - 10.128.0.56 - https://www.googleapis.com/compute/v1/projects/project/regions/region /forwardingRules/forwardingRule - regions/region/forwardingRules/forwardingRule + * + * Generated from protobuf field optional string next_hop_ilb = 198679901; + * @return string + */ + public function getNextHopIlb() + { + return isset($this->next_hop_ilb) ? $this->next_hop_ilb : ''; + } + + public function hasNextHopIlb() + { + return isset($this->next_hop_ilb); + } + + public function clearNextHopIlb() + { + unset($this->next_hop_ilb); + } + + /** + * The URL to a forwarding rule of type loadBalancingScheme=INTERNAL that should handle matching packets or the IP address of the forwarding Rule. For example, the following are all valid URLs: - 10.128.0.56 - https://www.googleapis.com/compute/v1/projects/project/regions/region /forwardingRules/forwardingRule - regions/region/forwardingRules/forwardingRule + * + * Generated from protobuf field optional string next_hop_ilb = 198679901; + * @param string $var + * @return $this + */ + public function setNextHopIlb($var) + { + GPBUtil::checkString($var, True); + $this->next_hop_ilb = $var; + + return $this; + } + + /** + * The URL to an instance that should handle matching packets. You can specify this as a full or partial URL. For example: https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/ + * + * Generated from protobuf field optional string next_hop_instance = 393508247; + * @return string + */ + public function getNextHopInstance() + { + return isset($this->next_hop_instance) ? $this->next_hop_instance : ''; + } + + public function hasNextHopInstance() + { + return isset($this->next_hop_instance); + } + + public function clearNextHopInstance() + { + unset($this->next_hop_instance); + } + + /** + * The URL to an instance that should handle matching packets. You can specify this as a full or partial URL. For example: https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/ + * + * Generated from protobuf field optional string next_hop_instance = 393508247; + * @param string $var + * @return $this + */ + public function setNextHopInstance($var) + { + GPBUtil::checkString($var, True); + $this->next_hop_instance = $var; + + return $this; + } + + /** + * The network IP address of an instance that should handle matching packets. Both IPv6 address and IPv4 addresses are supported. Must specify an IPv4 address in dot-decimal notation (e.g. 192.0.2.99) or an IPv6 address in RFC 4291 format (e.g. 2001:db8::2d9:51:0:0 or 2001:db8:0:0:2d9:51:0:0). IPv6 addresses will be displayed using RFC 5952 compressed format (e.g. 2001:db8::2d9:51:0:0). Should never be an IPv4-mapped IPv6 address. + * + * Generated from protobuf field optional string next_hop_ip = 110319529; + * @return string + */ + public function getNextHopIp() + { + return isset($this->next_hop_ip) ? $this->next_hop_ip : ''; + } + + public function hasNextHopIp() + { + return isset($this->next_hop_ip); + } + + public function clearNextHopIp() + { + unset($this->next_hop_ip); + } + + /** + * The network IP address of an instance that should handle matching packets. Both IPv6 address and IPv4 addresses are supported. Must specify an IPv4 address in dot-decimal notation (e.g. 192.0.2.99) or an IPv6 address in RFC 4291 format (e.g. 2001:db8::2d9:51:0:0 or 2001:db8:0:0:2d9:51:0:0). IPv6 addresses will be displayed using RFC 5952 compressed format (e.g. 2001:db8::2d9:51:0:0). Should never be an IPv4-mapped IPv6 address. + * + * Generated from protobuf field optional string next_hop_ip = 110319529; + * @param string $var + * @return $this + */ + public function setNextHopIp($var) + { + GPBUtil::checkString($var, True); + $this->next_hop_ip = $var; + + return $this; + } + + /** + * The URL of the local network if it should handle matching packets. + * + * Generated from protobuf field optional string next_hop_network = 262295788; + * @return string + */ + public function getNextHopNetwork() + { + return isset($this->next_hop_network) ? $this->next_hop_network : ''; + } + + public function hasNextHopNetwork() + { + return isset($this->next_hop_network); + } + + public function clearNextHopNetwork() + { + unset($this->next_hop_network); + } + + /** + * The URL of the local network if it should handle matching packets. + * + * Generated from protobuf field optional string next_hop_network = 262295788; + * @param string $var + * @return $this + */ + public function setNextHopNetwork($var) + { + GPBUtil::checkString($var, True); + $this->next_hop_network = $var; + + return $this; + } + + /** + * [Output Only] The network peering name that should handle matching packets, which should conform to RFC1035. + * + * Generated from protobuf field optional string next_hop_peering = 412682750; + * @return string + */ + public function getNextHopPeering() + { + return isset($this->next_hop_peering) ? $this->next_hop_peering : ''; + } + + public function hasNextHopPeering() + { + return isset($this->next_hop_peering); + } + + public function clearNextHopPeering() + { + unset($this->next_hop_peering); + } + + /** + * [Output Only] The network peering name that should handle matching packets, which should conform to RFC1035. + * + * Generated from protobuf field optional string next_hop_peering = 412682750; + * @param string $var + * @return $this + */ + public function setNextHopPeering($var) + { + GPBUtil::checkString($var, True); + $this->next_hop_peering = $var; + + return $this; + } + + /** + * The URL to a VpnTunnel that should handle matching packets. + * + * Generated from protobuf field optional string next_hop_vpn_tunnel = 519844501; + * @return string + */ + public function getNextHopVpnTunnel() + { + return isset($this->next_hop_vpn_tunnel) ? $this->next_hop_vpn_tunnel : ''; + } + + public function hasNextHopVpnTunnel() + { + return isset($this->next_hop_vpn_tunnel); + } + + public function clearNextHopVpnTunnel() + { + unset($this->next_hop_vpn_tunnel); + } + + /** + * The URL to a VpnTunnel that should handle matching packets. + * + * Generated from protobuf field optional string next_hop_vpn_tunnel = 519844501; + * @param string $var + * @return $this + */ + public function setNextHopVpnTunnel($var) + { + GPBUtil::checkString($var, True); + $this->next_hop_vpn_tunnel = $var; + + return $this; + } + + /** + * The priority of this route. Priority is used to break ties in cases where there is more than one matching route of equal prefix length. In cases where multiple routes have equal prefix length, the one with the lowest-numbered priority value wins. The default value is `1000`. The priority value must be from `0` to `65535`, inclusive. + * + * Generated from protobuf field optional uint32 priority = 445151652; + * @return int + */ + public function getPriority() + { + return isset($this->priority) ? $this->priority : 0; + } + + public function hasPriority() + { + return isset($this->priority); + } + + public function clearPriority() + { + unset($this->priority); + } + + /** + * The priority of this route. Priority is used to break ties in cases where there is more than one matching route of equal prefix length. In cases where multiple routes have equal prefix length, the one with the lowest-numbered priority value wins. The default value is `1000`. The priority value must be from `0` to `65535`, inclusive. + * + * Generated from protobuf field optional uint32 priority = 445151652; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkUint32($var); + $this->priority = $var; + + return $this; + } + + /** + * [Output only] The status of the route. + * Check the RouteStatus enum for the list of possible values. + * + * Generated from protobuf field optional string route_status = 418162344; + * @return string + */ + public function getRouteStatus() + { + return isset($this->route_status) ? $this->route_status : ''; + } + + public function hasRouteStatus() + { + return isset($this->route_status); + } + + public function clearRouteStatus() + { + unset($this->route_status); + } + + /** + * [Output only] The status of the route. + * Check the RouteStatus enum for the list of possible values. + * + * Generated from protobuf field optional string route_status = 418162344; + * @param string $var + * @return $this + */ + public function setRouteStatus($var) + { + GPBUtil::checkString($var, True); + $this->route_status = $var; + + return $this; + } + + /** + * [Output Only] The type of this route, which can be one of the following values: - 'TRANSIT' for a transit route that this router learned from another Cloud Router and will readvertise to one of its BGP peers - 'SUBNET' for a route from a subnet of the VPC - 'BGP' for a route learned from a BGP peer of this router - 'STATIC' for a static route + * Check the RouteType enum for the list of possible values. + * + * Generated from protobuf field optional string route_type = 375888752; + * @return string + */ + public function getRouteType() + { + return isset($this->route_type) ? $this->route_type : ''; + } + + public function hasRouteType() + { + return isset($this->route_type); + } + + public function clearRouteType() + { + unset($this->route_type); + } + + /** + * [Output Only] The type of this route, which can be one of the following values: - 'TRANSIT' for a transit route that this router learned from another Cloud Router and will readvertise to one of its BGP peers - 'SUBNET' for a route from a subnet of the VPC - 'BGP' for a route learned from a BGP peer of this router - 'STATIC' for a static route + * Check the RouteType enum for the list of possible values. + * + * Generated from protobuf field optional string route_type = 375888752; + * @param string $var + * @return $this + */ + public function setRouteType($var) + { + GPBUtil::checkString($var, True); + $this->route_type = $var; + + return $this; + } + + /** + * [Output Only] Server-defined fully-qualified 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 fully-qualified 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; + } + + /** + * A list of instance tags to which this route applies. + * + * Generated from protobuf field repeated string tags = 3552281; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTags() + { + return $this->tags; + } + + /** + * A list of instance tags to which this route applies. + * + * Generated from protobuf field repeated string tags = 3552281; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->tags = $arr; + + return $this; + } + + /** + * [Output Only] If potential misconfigurations are detected for this route, this field will be populated with warning messages. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Warnings warnings = 498091095; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWarnings() + { + return $this->warnings; + } + + /** + * [Output Only] If potential misconfigurations are detected for this route, this field will be populated with warning messages. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Warnings warnings = 498091095; + * @param array<\Google\Cloud\Compute\V1\Warnings>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWarnings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Warnings::class); + $this->warnings = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Route/RouteStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Route/RouteStatus.php new file mode 100644 index 000000000000..eb0ea51c1af8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Route/RouteStatus.php @@ -0,0 +1,78 @@ +google.cloud.compute.v1.Route.RouteStatus + */ +class RouteStatus +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ROUTE_STATUS = 0; + */ + const UNDEFINED_ROUTE_STATUS = 0; + /** + * This route is processed and active. + * + * Generated from protobuf enum ACTIVE = 314733318; + */ + const ACTIVE = 314733318; + /** + * The route is dropped due to the VPC exceeding the dynamic route limit. For dynamic route limit, please refer to the Learned route example + * + * Generated from protobuf enum DROPPED = 496235424; + */ + const DROPPED = 496235424; + /** + * This route is processed but inactive due to failure from the backend. The backend may have rejected the route + * + * Generated from protobuf enum INACTIVE = 270421099; + */ + const INACTIVE = 270421099; + /** + * This route is being processed internally. The status will change once processed. + * + * Generated from protobuf enum PENDING = 35394935; + */ + const PENDING = 35394935; + + private static $valueToName = [ + self::UNDEFINED_ROUTE_STATUS => 'UNDEFINED_ROUTE_STATUS', + self::ACTIVE => 'ACTIVE', + self::DROPPED => 'DROPPED', + self::INACTIVE => 'INACTIVE', + self::PENDING => 'PENDING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RouteStatus::class, \Google\Cloud\Compute\V1\Route_RouteStatus::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Route/RouteType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Route/RouteType.php new file mode 100644 index 000000000000..e1d71450d499 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Route/RouteType.php @@ -0,0 +1,74 @@ +google.cloud.compute.v1.Route.RouteType + */ +class RouteType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ROUTE_TYPE = 0; + */ + const UNDEFINED_ROUTE_TYPE = 0; + /** + * Generated from protobuf enum BGP = 65707; + */ + const BGP = 65707; + /** + * Generated from protobuf enum STATIC = 308331118; + */ + const PBSTATIC = 308331118; + /** + * Generated from protobuf enum SUBNET = 309278557; + */ + const SUBNET = 309278557; + /** + * Generated from protobuf enum TRANSIT = 187793843; + */ + const TRANSIT = 187793843; + + private static $valueToName = [ + self::UNDEFINED_ROUTE_TYPE => 'UNDEFINED_ROUTE_TYPE', + self::BGP => 'BGP', + self::PBSTATIC => 'STATIC', + self::SUBNET => 'SUBNET', + self::TRANSIT => 'TRANSIT', + ]; + + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RouteType::class, \Google\Cloud\Compute\V1\Route_RouteType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouteAsPath.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouteAsPath.php new file mode 100644 index 000000000000..a015c1712546 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouteAsPath.php @@ -0,0 +1,114 @@ +google.cloud.compute.v1.RouteAsPath + */ +class RouteAsPath extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The AS numbers of the AS Path. + * + * Generated from protobuf field repeated uint32 as_lists = 134112584; + */ + private $as_lists; + /** + * [Output Only] The type of the AS Path, which can be one of the following values: - 'AS_SET': unordered set of autonomous systems that the route in has traversed - 'AS_SEQUENCE': ordered set of autonomous systems that the route has traversed - 'AS_CONFED_SEQUENCE': ordered set of Member Autonomous Systems in the local confederation that the route has traversed - 'AS_CONFED_SET': unordered set of Member Autonomous Systems in the local confederation that the route has traversed + * Check the PathSegmentType enum for the list of possible values. + * + * Generated from protobuf field optional string path_segment_type = 513464992; + */ + protected $path_segment_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $as_lists + * [Output Only] The AS numbers of the AS Path. + * @type string $path_segment_type + * [Output Only] The type of the AS Path, which can be one of the following values: - 'AS_SET': unordered set of autonomous systems that the route in has traversed - 'AS_SEQUENCE': ordered set of autonomous systems that the route has traversed - 'AS_CONFED_SEQUENCE': ordered set of Member Autonomous Systems in the local confederation that the route has traversed - 'AS_CONFED_SET': unordered set of Member Autonomous Systems in the local confederation that the route has traversed + * Check the PathSegmentType enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The AS numbers of the AS Path. + * + * Generated from protobuf field repeated uint32 as_lists = 134112584; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAsLists() + { + return $this->as_lists; + } + + /** + * [Output Only] The AS numbers of the AS Path. + * + * Generated from protobuf field repeated uint32 as_lists = 134112584; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAsLists($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::UINT32); + $this->as_lists = $arr; + + return $this; + } + + /** + * [Output Only] The type of the AS Path, which can be one of the following values: - 'AS_SET': unordered set of autonomous systems that the route in has traversed - 'AS_SEQUENCE': ordered set of autonomous systems that the route has traversed - 'AS_CONFED_SEQUENCE': ordered set of Member Autonomous Systems in the local confederation that the route has traversed - 'AS_CONFED_SET': unordered set of Member Autonomous Systems in the local confederation that the route has traversed + * Check the PathSegmentType enum for the list of possible values. + * + * Generated from protobuf field optional string path_segment_type = 513464992; + * @return string + */ + public function getPathSegmentType() + { + return isset($this->path_segment_type) ? $this->path_segment_type : ''; + } + + public function hasPathSegmentType() + { + return isset($this->path_segment_type); + } + + public function clearPathSegmentType() + { + unset($this->path_segment_type); + } + + /** + * [Output Only] The type of the AS Path, which can be one of the following values: - 'AS_SET': unordered set of autonomous systems that the route in has traversed - 'AS_SEQUENCE': ordered set of autonomous systems that the route has traversed - 'AS_CONFED_SEQUENCE': ordered set of Member Autonomous Systems in the local confederation that the route has traversed - 'AS_CONFED_SET': unordered set of Member Autonomous Systems in the local confederation that the route has traversed + * Check the PathSegmentType enum for the list of possible values. + * + * Generated from protobuf field optional string path_segment_type = 513464992; + * @param string $var + * @return $this + */ + public function setPathSegmentType($var) + { + GPBUtil::checkString($var, True); + $this->path_segment_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouteAsPath/PathSegmentType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouteAsPath/PathSegmentType.php new file mode 100644 index 000000000000..5b6ecae4f923 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouteAsPath/PathSegmentType.php @@ -0,0 +1,70 @@ +google.cloud.compute.v1.RouteAsPath.PathSegmentType + */ +class PathSegmentType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PATH_SEGMENT_TYPE = 0; + */ + const UNDEFINED_PATH_SEGMENT_TYPE = 0; + /** + * Generated from protobuf enum AS_CONFED_SEQUENCE = 222152624; + */ + const AS_CONFED_SEQUENCE = 222152624; + /** + * Generated from protobuf enum AS_CONFED_SET = 374040307; + */ + const AS_CONFED_SET = 374040307; + /** + * Generated from protobuf enum AS_SEQUENCE = 106735918; + */ + const AS_SEQUENCE = 106735918; + /** + * Generated from protobuf enum AS_SET = 329846453; + */ + const AS_SET = 329846453; + + private static $valueToName = [ + self::UNDEFINED_PATH_SEGMENT_TYPE => 'UNDEFINED_PATH_SEGMENT_TYPE', + self::AS_CONFED_SEQUENCE => 'AS_CONFED_SEQUENCE', + self::AS_CONFED_SET => 'AS_CONFED_SET', + self::AS_SEQUENCE => 'AS_SEQUENCE', + self::AS_SET => 'AS_SET', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PathSegmentType::class, \Google\Cloud\Compute\V1\RouteAsPath_PathSegmentType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouteList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouteList.php new file mode 100644 index 000000000000..d2c7249caf4f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouteList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.RouteList + */ +class RouteList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of Route resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Route items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\Route>|\Google\Protobuf\Internal\RepeatedField $items + * A list of Route 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 Route resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Route items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of Route resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Route items = 100526016; + * @param array<\Google\Cloud\Compute\V1\Route>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Route::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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Router.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Router.php new file mode 100644 index 000000000000..2917e472a554 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Router.php @@ -0,0 +1,609 @@ +google.cloud.compute.v1.Router + */ +class Router extends \Google\Protobuf\Internal\Message +{ + /** + * BGP information specific to this router. + * + * Generated from protobuf field optional .google.cloud.compute.v1.RouterBgp bgp = 97483; + */ + protected $bgp = null; + /** + * BGP information that must be configured into the routing stack to establish BGP peering. This information must specify the peer ASN and either the interface name, IP address, or peer IP address. Please refer to RFC4273. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterBgpPeer bgp_peers = 452695773; + */ + private $bgp_peers; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments). + * + * Generated from protobuf field optional bool encrypted_interconnect_router = 297996575; + */ + protected $encrypted_interconnect_router = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * Router interfaces. To create a BGP peer that uses a router interface, the interface must have one of the following fields specified: - linkedVpnTunnel - linkedInterconnectAttachment - subnetwork You can create a router interface without any of these fields specified. However, you cannot create a BGP peer that uses that interface. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterInterface interfaces = 12073562; + */ + private $interfaces; + /** + * [Output Only] Type of resource. Always compute#router for routers. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * Keys used for MD5 authentication. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterMd5AuthenticationKey md5_authentication_keys = 71063322; + */ + private $md5_authentication_keys; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * A list of NAT services created in this router. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterNat nats = 3373938; + */ + private $nats; + /** + * URI of the network to which this router belongs. + * + * Generated from protobuf field optional string network = 232872494; + */ + protected $network = null; + /** + * [Output Only] URI of the region where the router resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\RouterBgp $bgp + * BGP information specific to this router. + * @type array<\Google\Cloud\Compute\V1\RouterBgpPeer>|\Google\Protobuf\Internal\RepeatedField $bgp_peers + * BGP information that must be configured into the routing stack to establish BGP peering. This information must specify the peer ASN and either the interface name, IP address, or peer IP address. Please refer to RFC4273. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type bool $encrypted_interconnect_router + * Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments). + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type array<\Google\Cloud\Compute\V1\RouterInterface>|\Google\Protobuf\Internal\RepeatedField $interfaces + * Router interfaces. To create a BGP peer that uses a router interface, the interface must have one of the following fields specified: - linkedVpnTunnel - linkedInterconnectAttachment - subnetwork You can create a router interface without any of these fields specified. However, you cannot create a BGP peer that uses that interface. + * @type string $kind + * [Output Only] Type of resource. Always compute#router for routers. + * @type array<\Google\Cloud\Compute\V1\RouterMd5AuthenticationKey>|\Google\Protobuf\Internal\RepeatedField $md5_authentication_keys + * Keys used for MD5 authentication. + * @type string $name + * 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 array<\Google\Cloud\Compute\V1\RouterNat>|\Google\Protobuf\Internal\RepeatedField $nats + * A list of NAT services created in this router. + * @type string $network + * URI of the network to which this router belongs. + * @type string $region + * [Output Only] URI of the region where the router resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * BGP information specific to this router. + * + * Generated from protobuf field optional .google.cloud.compute.v1.RouterBgp bgp = 97483; + * @return \Google\Cloud\Compute\V1\RouterBgp|null + */ + public function getBgp() + { + return $this->bgp; + } + + public function hasBgp() + { + return isset($this->bgp); + } + + public function clearBgp() + { + unset($this->bgp); + } + + /** + * BGP information specific to this router. + * + * Generated from protobuf field optional .google.cloud.compute.v1.RouterBgp bgp = 97483; + * @param \Google\Cloud\Compute\V1\RouterBgp $var + * @return $this + */ + public function setBgp($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RouterBgp::class); + $this->bgp = $var; + + return $this; + } + + /** + * BGP information that must be configured into the routing stack to establish BGP peering. This information must specify the peer ASN and either the interface name, IP address, or peer IP address. Please refer to RFC4273. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterBgpPeer bgp_peers = 452695773; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBgpPeers() + { + return $this->bgp_peers; + } + + /** + * BGP information that must be configured into the routing stack to establish BGP peering. This information must specify the peer ASN and either the interface name, IP address, or peer IP address. Please refer to RFC4273. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterBgpPeer bgp_peers = 452695773; + * @param array<\Google\Cloud\Compute\V1\RouterBgpPeer>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBgpPeers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\RouterBgpPeer::class); + $this->bgp_peers = $arr; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments). + * + * Generated from protobuf field optional bool encrypted_interconnect_router = 297996575; + * @return bool + */ + public function getEncryptedInterconnectRouter() + { + return isset($this->encrypted_interconnect_router) ? $this->encrypted_interconnect_router : false; + } + + public function hasEncryptedInterconnectRouter() + { + return isset($this->encrypted_interconnect_router); + } + + public function clearEncryptedInterconnectRouter() + { + unset($this->encrypted_interconnect_router); + } + + /** + * Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments). + * + * Generated from protobuf field optional bool encrypted_interconnect_router = 297996575; + * @param bool $var + * @return $this + */ + public function setEncryptedInterconnectRouter($var) + { + GPBUtil::checkBool($var); + $this->encrypted_interconnect_router = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * Router interfaces. To create a BGP peer that uses a router interface, the interface must have one of the following fields specified: - linkedVpnTunnel - linkedInterconnectAttachment - subnetwork You can create a router interface without any of these fields specified. However, you cannot create a BGP peer that uses that interface. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterInterface interfaces = 12073562; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInterfaces() + { + return $this->interfaces; + } + + /** + * Router interfaces. To create a BGP peer that uses a router interface, the interface must have one of the following fields specified: - linkedVpnTunnel - linkedInterconnectAttachment - subnetwork You can create a router interface without any of these fields specified. However, you cannot create a BGP peer that uses that interface. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterInterface interfaces = 12073562; + * @param array<\Google\Cloud\Compute\V1\RouterInterface>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInterfaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\RouterInterface::class); + $this->interfaces = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#router for routers. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#router for routers. + * + * 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; + } + + /** + * Keys used for MD5 authentication. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterMd5AuthenticationKey md5_authentication_keys = 71063322; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMd5AuthenticationKeys() + { + return $this->md5_authentication_keys; + } + + /** + * Keys used for MD5 authentication. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterMd5AuthenticationKey md5_authentication_keys = 71063322; + * @param array<\Google\Cloud\Compute\V1\RouterMd5AuthenticationKey>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMd5AuthenticationKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\RouterMd5AuthenticationKey::class); + $this->md5_authentication_keys = $arr; + + return $this; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * A list of NAT services created in this router. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterNat nats = 3373938; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNats() + { + return $this->nats; + } + + /** + * A list of NAT services created in this router. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterNat nats = 3373938; + * @param array<\Google\Cloud\Compute\V1\RouterNat>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNats($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\RouterNat::class); + $this->nats = $arr; + + return $this; + } + + /** + * URI of the network to which this router belongs. + * + * Generated from protobuf field optional string network = 232872494; + * @return string + */ + public function getNetwork() + { + return isset($this->network) ? $this->network : ''; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * URI of the network to which this router belongs. + * + * Generated from protobuf field optional string network = 232872494; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * [Output Only] URI of the region where the router resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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] URI of the region where the router resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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] Server-defined URL for the 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 the 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterAdvertisedIpRange.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterAdvertisedIpRange.php new file mode 100644 index 000000000000..0fa31914818b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterAdvertisedIpRange.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.RouterAdvertisedIpRange + */ +class RouterAdvertisedIpRange extends \Google\Protobuf\Internal\Message +{ + /** + * User-specified description for the IP range. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * The IP range to advertise. The value must be a CIDR-formatted string. + * + * Generated from protobuf field optional string range = 108280125; + */ + protected $range = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $description + * User-specified description for the IP range. + * @type string $range + * The IP range to advertise. The value must be a CIDR-formatted string. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * User-specified description for the IP range. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * User-specified description for the IP range. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The IP range to advertise. The value must be a CIDR-formatted string. + * + * Generated from protobuf field optional string range = 108280125; + * @return string + */ + public function getRange() + { + return isset($this->range) ? $this->range : ''; + } + + public function hasRange() + { + return isset($this->range); + } + + public function clearRange() + { + unset($this->range); + } + + /** + * The IP range to advertise. The value must be a CIDR-formatted string. + * + * Generated from protobuf field optional string range = 108280125; + * @param string $var + * @return $this + */ + public function setRange($var) + { + GPBUtil::checkString($var, True); + $this->range = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterAggregatedList.php new file mode 100644 index 000000000000..172d4c1f8b53 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterAggregatedList.php @@ -0,0 +1,321 @@ +google.cloud.compute.v1.RouterAggregatedList + */ +class RouterAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of Router resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 Router 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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 Router resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of Router 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\RoutersScopedList::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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgp.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgp.php new file mode 100644 index 000000000000..d1a2b0fdce2f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgp.php @@ -0,0 +1,284 @@ +google.cloud.compute.v1.RouterBgp + */ +class RouterBgp extends \Google\Protobuf\Internal\Message +{ + /** + * User-specified flag to indicate which mode to use for advertisement. The options are DEFAULT or CUSTOM. + * Check the AdvertiseMode enum for the list of possible values. + * + * Generated from protobuf field optional string advertise_mode = 312134331; + */ + protected $advertise_mode = null; + /** + * User-specified list of prefix groups to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and is advertised to all peers of the router. These groups will be 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; + */ + private $advertised_groups; + /** + * User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and is advertised to all peers of the router. These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterAdvertisedIpRange advertised_ip_ranges = 35449932; + */ + private $advertised_ip_ranges; + /** + * Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN. + * + * Generated from protobuf field optional uint32 asn = 96892; + */ + protected $asn = null; + /** + * Explicitly specifies a range of valid BGP Identifiers for this Router. It is provided as a link-local IPv4 range (from 169.254.0.0/16), of size at least /30, even if the BGP sessions are over IPv6. It must not overlap with any IPv4 BGP session ranges. Other vendors commonly call this "router ID". + * + * Generated from protobuf field optional string identifier_range = 501573159; + */ + protected $identifier_range = null; + /** + * The interval in seconds between BGP keepalive messages that are sent to the peer. Hold time is three times the interval at which keepalive messages are sent, and the hold time is the maximum number of seconds allowed to elapse between successive keepalive messages that BGP receives from a peer. BGP will use the smaller of either the local hold time value or the peer's hold time value as the hold time for the BGP connection between the two peers. If set, this value must be between 20 and 60. The default is 20. + * + * Generated from protobuf field optional uint32 keepalive_interval = 276771516; + */ + protected $keepalive_interval = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $advertise_mode + * User-specified flag to indicate which mode to use for advertisement. The options are DEFAULT or CUSTOM. + * 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. This field can only be populated if advertise_mode is CUSTOM and is advertised to all peers of the router. These groups will be 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 is advertised to all peers of the router. These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges. + * @type int $asn + * Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN. + * @type string $identifier_range + * Explicitly specifies a range of valid BGP Identifiers for this Router. It is provided as a link-local IPv4 range (from 169.254.0.0/16), of size at least /30, even if the BGP sessions are over IPv6. It must not overlap with any IPv4 BGP session ranges. Other vendors commonly call this "router ID". + * @type int $keepalive_interval + * The interval in seconds between BGP keepalive messages that are sent to the peer. Hold time is three times the interval at which keepalive messages are sent, and the hold time is the maximum number of seconds allowed to elapse between successive keepalive messages that BGP receives from a peer. BGP will use the smaller of either the local hold time value or the peer's hold time value as the hold time for the BGP connection between the two peers. If set, this value must be between 20 and 60. The default is 20. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * User-specified flag to indicate which mode to use for advertisement. The options are DEFAULT or CUSTOM. + * Check the AdvertiseMode enum for the list of possible values. + * + * Generated from protobuf field optional string advertise_mode = 312134331; + * @return string + */ + public function getAdvertiseMode() + { + return isset($this->advertise_mode) ? $this->advertise_mode : ''; + } + + public function hasAdvertiseMode() + { + return isset($this->advertise_mode); + } + + public function clearAdvertiseMode() + { + unset($this->advertise_mode); + } + + /** + * User-specified flag to indicate which mode to use for advertisement. The options are DEFAULT or CUSTOM. + * Check the AdvertiseMode enum for the list of possible values. + * + * Generated from protobuf field optional string advertise_mode = 312134331; + * @param string $var + * @return $this + */ + public function setAdvertiseMode($var) + { + GPBUtil::checkString($var, True); + $this->advertise_mode = $var; + + return $this; + } + + /** + * User-specified list of prefix groups to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and is advertised to all peers of the router. These groups will be 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; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdvertisedGroups() + { + return $this->advertised_groups; + } + + /** + * User-specified list of prefix groups to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and is advertised to all peers of the router. These groups will be 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; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdvertisedGroups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->advertised_groups = $arr; + + return $this; + } + + /** + * User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and is advertised to all peers of the router. These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterAdvertisedIpRange advertised_ip_ranges = 35449932; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdvertisedIpRanges() + { + return $this->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 is advertised to all peers of the router. These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterAdvertisedIpRange advertised_ip_ranges = 35449932; + * @param array<\Google\Cloud\Compute\V1\RouterAdvertisedIpRange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdvertisedIpRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\RouterAdvertisedIpRange::class); + $this->advertised_ip_ranges = $arr; + + return $this; + } + + /** + * Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN. + * + * Generated from protobuf field optional uint32 asn = 96892; + * @return int + */ + public function getAsn() + { + return isset($this->asn) ? $this->asn : 0; + } + + public function hasAsn() + { + return isset($this->asn); + } + + public function clearAsn() + { + unset($this->asn); + } + + /** + * Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN. + * + * Generated from protobuf field optional uint32 asn = 96892; + * @param int $var + * @return $this + */ + public function setAsn($var) + { + GPBUtil::checkUint32($var); + $this->asn = $var; + + return $this; + } + + /** + * Explicitly specifies a range of valid BGP Identifiers for this Router. It is provided as a link-local IPv4 range (from 169.254.0.0/16), of size at least /30, even if the BGP sessions are over IPv6. It must not overlap with any IPv4 BGP session ranges. Other vendors commonly call this "router ID". + * + * Generated from protobuf field optional string identifier_range = 501573159; + * @return string + */ + public function getIdentifierRange() + { + return isset($this->identifier_range) ? $this->identifier_range : ''; + } + + public function hasIdentifierRange() + { + return isset($this->identifier_range); + } + + public function clearIdentifierRange() + { + unset($this->identifier_range); + } + + /** + * Explicitly specifies a range of valid BGP Identifiers for this Router. It is provided as a link-local IPv4 range (from 169.254.0.0/16), of size at least /30, even if the BGP sessions are over IPv6. It must not overlap with any IPv4 BGP session ranges. Other vendors commonly call this "router ID". + * + * Generated from protobuf field optional string identifier_range = 501573159; + * @param string $var + * @return $this + */ + public function setIdentifierRange($var) + { + GPBUtil::checkString($var, True); + $this->identifier_range = $var; + + return $this; + } + + /** + * The interval in seconds between BGP keepalive messages that are sent to the peer. Hold time is three times the interval at which keepalive messages are sent, and the hold time is the maximum number of seconds allowed to elapse between successive keepalive messages that BGP receives from a peer. BGP will use the smaller of either the local hold time value or the peer's hold time value as the hold time for the BGP connection between the two peers. If set, this value must be between 20 and 60. The default is 20. + * + * Generated from protobuf field optional uint32 keepalive_interval = 276771516; + * @return int + */ + public function getKeepaliveInterval() + { + return isset($this->keepalive_interval) ? $this->keepalive_interval : 0; + } + + public function hasKeepaliveInterval() + { + return isset($this->keepalive_interval); + } + + public function clearKeepaliveInterval() + { + unset($this->keepalive_interval); + } + + /** + * The interval in seconds between BGP keepalive messages that are sent to the peer. Hold time is three times the interval at which keepalive messages are sent, and the hold time is the maximum number of seconds allowed to elapse between successive keepalive messages that BGP receives from a peer. BGP will use the smaller of either the local hold time value or the peer's hold time value as the hold time for the BGP connection between the two peers. If set, this value must be between 20 and 60. The default is 20. + * + * Generated from protobuf field optional uint32 keepalive_interval = 276771516; + * @param int $var + * @return $this + */ + public function setKeepaliveInterval($var) + { + GPBUtil::checkUint32($var); + $this->keepalive_interval = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgp/AdvertiseMode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgp/AdvertiseMode.php new file mode 100644 index 000000000000..9811e10034bb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgp/AdvertiseMode.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.RouterBgp.AdvertiseMode + */ +class AdvertiseMode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ADVERTISE_MODE = 0; + */ + const UNDEFINED_ADVERTISE_MODE = 0; + /** + * Generated from protobuf enum CUSTOM = 388595569; + */ + const CUSTOM = 388595569; + /** + * Generated from protobuf enum DEFAULT = 115302945; + */ + const PBDEFAULT = 115302945; + + private static $valueToName = [ + self::UNDEFINED_ADVERTISE_MODE => 'UNDEFINED_ADVERTISE_MODE', + self::CUSTOM => 'CUSTOM', + self::PBDEFAULT => 'DEFAULT', + ]; + + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AdvertiseMode::class, \Google\Cloud\Compute\V1\RouterBgp_AdvertiseMode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgp/AdvertisedGroups.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgp/AdvertisedGroups.php new file mode 100644 index 000000000000..303839dd6ce6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgp/AdvertisedGroups.php @@ -0,0 +1,56 @@ +google.cloud.compute.v1.RouterBgp.AdvertisedGroups + */ +class AdvertisedGroups +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ADVERTISED_GROUPS = 0; + */ + const UNDEFINED_ADVERTISED_GROUPS = 0; + /** + * Advertise all available subnets (including peer VPC subnets). + * + * Generated from protobuf enum ALL_SUBNETS = 3622872; + */ + const ALL_SUBNETS = 3622872; + + private static $valueToName = [ + self::UNDEFINED_ADVERTISED_GROUPS => 'UNDEFINED_ADVERTISED_GROUPS', + self::ALL_SUBNETS => 'ALL_SUBNETS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AdvertisedGroups::class, \Google\Cloud\Compute\V1\RouterBgp_AdvertisedGroups::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeer.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeer.php new file mode 100644 index 000000000000..a97ebed51388 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeer.php @@ -0,0 +1,1054 @@ +google.cloud.compute.v1.RouterBgpPeer + */ +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. + * + * Generated from protobuf field optional string advertise_mode = 312134331; + */ + protected $advertise_mode = null; + /** + * 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; + */ + private $advertised_groups; + /** + * 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. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterAdvertisedIpRange advertised_ip_ranges = 35449932; + */ + private $advertised_ip_ranges; + /** + * The priority of routes advertised to this BGP peer. Where there is more than one matching route of maximum length, the routes with the lowest priority value win. + * + * Generated from protobuf field optional uint32 advertised_route_priority = 186486332; + */ + protected $advertised_route_priority = null; + /** + * BFD configuration for the BGP peering. + * + * Generated from protobuf field optional .google.cloud.compute.v1.RouterBgpPeerBfd bfd = 97440; + */ + protected $bfd = null; + /** + * A list of user-defined custom learned route IP address ranges for a BGP session. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterBgpPeerCustomLearnedIpRange custom_learned_ip_ranges = 481363012; + */ + private $custom_learned_ip_ranges; + /** + * The user-defined custom learned route priority for a BGP session. This value is applied to all custom learned route ranges for the session. You can choose a value from `0` to `65335`. If you don't provide a value, Google Cloud assigns a priority of `100` to the ranges. + * + * Generated from protobuf field optional int32 custom_learned_route_priority = 330412356; + */ + protected $custom_learned_route_priority = null; + /** + * The status of the BGP peer connection. If set to FALSE, any active session with the peer is terminated and all associated routing information is removed. If set to TRUE, the peer connection can be established with routing information. The default is TRUE. + * Check the Enable enum for the list of possible values. + * + * Generated from protobuf field optional string enable = 311764355; + */ + protected $enable = null; + /** + * Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4. + * + * Generated from protobuf field optional bool enable_ipv4 = 181467937; + */ + protected $enable_ipv4 = null; + /** + * Enable IPv6 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 6. + * + * Generated from protobuf field optional bool enable_ipv6 = 181467939; + */ + protected $enable_ipv6 = null; + /** + * List of export policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type. Note that Route Policies are currently available in preview. Please use Beta API to use Route Policies. + * + * Generated from protobuf field repeated string export_policies = 134084987; + */ + private $export_policies; + /** + * List of import policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type. Note that Route Policies are currently available in preview. Please use Beta API to use Route Policies. + * + * Generated from protobuf field repeated string import_policies = 451147946; + */ + private $import_policies; + /** + * Name of the interface the BGP peer is associated with. + * + * Generated from protobuf field optional string interface_name = 437854673; + */ + protected $interface_name = null; + /** + * IP address of the interface inside Google Cloud Platform. + * + * Generated from protobuf field optional string ip_address = 406272220; + */ + protected $ip_address = null; + /** + * IPv4 address of the interface inside Google Cloud Platform. + * + * Generated from protobuf field optional string ipv4_nexthop_address = 5703377; + */ + protected $ipv4_nexthop_address = null; + /** + * IPv6 address of the interface inside Google Cloud Platform. + * + * Generated from protobuf field optional string ipv6_nexthop_address = 27968211; + */ + protected $ipv6_nexthop_address = null; + /** + * [Output Only] The resource that configures and manages this BGP peer. - MANAGED_BY_USER is the default value and can be managed by you or other users - MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted. + * Check the ManagementType enum for the list of possible values. + * + * Generated from protobuf field optional string management_type = 173703606; + */ + protected $management_type = null; + /** + * Present if MD5 authentication is enabled for the peering. Must be the name of one of the entries in the Router.md5_authentication_keys. The field must comply with RFC1035. + * + * Generated from protobuf field optional string md5_authentication_key_name = 281075345; + */ + protected $md5_authentication_key_name = null; + /** + * Name of this BGP peer. 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value. + * + * Generated from protobuf field optional uint32 peer_asn = 69573151; + */ + protected $peer_asn = null; + /** + * IP address of the BGP interface outside Google Cloud Platform. + * + * Generated from protobuf field optional string peer_ip_address = 207735769; + */ + protected $peer_ip_address = null; + /** + * IPv4 address of the BGP interface outside Google Cloud Platform. + * + * Generated from protobuf field optional string peer_ipv4_nexthop_address = 469221774; + */ + protected $peer_ipv4_nexthop_address = null; + /** + * IPv6 address of the BGP interface outside Google Cloud Platform. + * + * Generated from protobuf field optional string peer_ipv6_nexthop_address = 491486608; + */ + protected $peer_ipv6_nexthop_address = null; + /** + * URI of the VM instance that is used as third-party router appliances such as Next Gen Firewalls, Virtual Routers, or Router Appliances. The VM instance must be located in zones contained in the same region as this Cloud Router. The VM instance is the peer side of the BGP session. + * + * Generated from protobuf field optional string router_appliance_instance = 468312989; + */ + protected $router_appliance_instance = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $advertise_mode + * 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 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. + * @type int $advertised_route_priority + * The priority of routes advertised to this BGP peer. Where there is more than one matching route of maximum length, the routes with the lowest priority value win. + * @type \Google\Cloud\Compute\V1\RouterBgpPeerBfd $bfd + * BFD configuration for the BGP peering. + * @type array<\Google\Cloud\Compute\V1\RouterBgpPeerCustomLearnedIpRange>|\Google\Protobuf\Internal\RepeatedField $custom_learned_ip_ranges + * A list of user-defined custom learned route IP address ranges for a BGP session. + * @type int $custom_learned_route_priority + * The user-defined custom learned route priority for a BGP session. This value is applied to all custom learned route ranges for the session. You can choose a value from `0` to `65335`. If you don't provide a value, Google Cloud assigns a priority of `100` to the ranges. + * @type string $enable + * The status of the BGP peer connection. If set to FALSE, any active session with the peer is terminated and all associated routing information is removed. If set to TRUE, the peer connection can be established with routing information. The default is TRUE. + * Check the Enable enum for the list of possible values. + * @type bool $enable_ipv4 + * Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4. + * @type bool $enable_ipv6 + * Enable IPv6 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 6. + * @type array|\Google\Protobuf\Internal\RepeatedField $export_policies + * List of export policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type. Note that Route Policies are currently available in preview. Please use Beta API to use Route Policies. + * @type array|\Google\Protobuf\Internal\RepeatedField $import_policies + * List of import policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type. Note that Route Policies are currently available in preview. Please use Beta API to use Route Policies. + * @type string $interface_name + * Name of the interface the BGP peer is associated with. + * @type string $ip_address + * IP address of the interface inside Google Cloud Platform. + * @type string $ipv4_nexthop_address + * IPv4 address of the interface inside Google Cloud Platform. + * @type string $ipv6_nexthop_address + * IPv6 address of the interface inside Google Cloud Platform. + * @type string $management_type + * [Output Only] The resource that configures and manages this BGP peer. - MANAGED_BY_USER is the default value and can be managed by you or other users - MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted. + * Check the ManagementType enum for the list of possible values. + * @type string $md5_authentication_key_name + * Present if MD5 authentication is enabled for the peering. Must be the name of one of the entries in the Router.md5_authentication_keys. The field must comply with RFC1035. + * @type string $name + * Name of this BGP peer. 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 int $peer_asn + * Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value. + * @type string $peer_ip_address + * IP address of the BGP interface outside Google Cloud Platform. + * @type string $peer_ipv4_nexthop_address + * IPv4 address of the BGP interface outside Google Cloud Platform. + * @type string $peer_ipv6_nexthop_address + * IPv6 address of the BGP interface outside Google Cloud Platform. + * @type string $router_appliance_instance + * URI of the VM instance that is used as third-party router appliances such as Next Gen Firewalls, Virtual Routers, or Router Appliances. The VM instance must be located in zones contained in the same region as this Cloud Router. The VM instance is the peer side of the BGP session. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * User-specified flag to indicate which mode to use for advertisement. + * Check the AdvertiseMode enum for the list of possible values. + * + * Generated from protobuf field optional string advertise_mode = 312134331; + * @return string + */ + public function getAdvertiseMode() + { + return isset($this->advertise_mode) ? $this->advertise_mode : ''; + } + + public function hasAdvertiseMode() + { + return isset($this->advertise_mode); + } + + public function clearAdvertiseMode() + { + unset($this->advertise_mode); + } + + /** + * User-specified flag to indicate which mode to use for advertisement. + * Check the AdvertiseMode enum for the list of possible values. + * + * Generated from protobuf field optional string advertise_mode = 312134331; + * @param string $var + * @return $this + */ + public function setAdvertiseMode($var) + { + GPBUtil::checkString($var, True); + $this->advertise_mode = $var; + + return $this; + } + + /** + * 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; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdvertisedGroups() + { + return $this->advertised_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; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdvertisedGroups($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->advertised_groups = $arr; + + return $this; + } + + /** + * 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. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterAdvertisedIpRange advertised_ip_ranges = 35449932; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdvertisedIpRanges() + { + return $this->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. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterAdvertisedIpRange advertised_ip_ranges = 35449932; + * @param array<\Google\Cloud\Compute\V1\RouterAdvertisedIpRange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdvertisedIpRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\RouterAdvertisedIpRange::class); + $this->advertised_ip_ranges = $arr; + + return $this; + } + + /** + * The priority of routes advertised to this BGP peer. Where there is more than one matching route of maximum length, the routes with the lowest priority value win. + * + * Generated from protobuf field optional uint32 advertised_route_priority = 186486332; + * @return int + */ + public function getAdvertisedRoutePriority() + { + return isset($this->advertised_route_priority) ? $this->advertised_route_priority : 0; + } + + public function hasAdvertisedRoutePriority() + { + return isset($this->advertised_route_priority); + } + + public function clearAdvertisedRoutePriority() + { + unset($this->advertised_route_priority); + } + + /** + * The priority of routes advertised to this BGP peer. Where there is more than one matching route of maximum length, the routes with the lowest priority value win. + * + * Generated from protobuf field optional uint32 advertised_route_priority = 186486332; + * @param int $var + * @return $this + */ + public function setAdvertisedRoutePriority($var) + { + GPBUtil::checkUint32($var); + $this->advertised_route_priority = $var; + + return $this; + } + + /** + * BFD configuration for the BGP peering. + * + * Generated from protobuf field optional .google.cloud.compute.v1.RouterBgpPeerBfd bfd = 97440; + * @return \Google\Cloud\Compute\V1\RouterBgpPeerBfd|null + */ + public function getBfd() + { + return $this->bfd; + } + + public function hasBfd() + { + return isset($this->bfd); + } + + public function clearBfd() + { + unset($this->bfd); + } + + /** + * BFD configuration for the BGP peering. + * + * Generated from protobuf field optional .google.cloud.compute.v1.RouterBgpPeerBfd bfd = 97440; + * @param \Google\Cloud\Compute\V1\RouterBgpPeerBfd $var + * @return $this + */ + public function setBfd($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RouterBgpPeerBfd::class); + $this->bfd = $var; + + return $this; + } + + /** + * A list of user-defined custom learned route IP address ranges for a BGP session. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterBgpPeerCustomLearnedIpRange custom_learned_ip_ranges = 481363012; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCustomLearnedIpRanges() + { + return $this->custom_learned_ip_ranges; + } + + /** + * A list of user-defined custom learned route IP address ranges for a BGP session. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterBgpPeerCustomLearnedIpRange custom_learned_ip_ranges = 481363012; + * @param array<\Google\Cloud\Compute\V1\RouterBgpPeerCustomLearnedIpRange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCustomLearnedIpRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\RouterBgpPeerCustomLearnedIpRange::class); + $this->custom_learned_ip_ranges = $arr; + + return $this; + } + + /** + * The user-defined custom learned route priority for a BGP session. This value is applied to all custom learned route ranges for the session. You can choose a value from `0` to `65335`. If you don't provide a value, Google Cloud assigns a priority of `100` to the ranges. + * + * Generated from protobuf field optional int32 custom_learned_route_priority = 330412356; + * @return int + */ + public function getCustomLearnedRoutePriority() + { + return isset($this->custom_learned_route_priority) ? $this->custom_learned_route_priority : 0; + } + + public function hasCustomLearnedRoutePriority() + { + return isset($this->custom_learned_route_priority); + } + + public function clearCustomLearnedRoutePriority() + { + unset($this->custom_learned_route_priority); + } + + /** + * The user-defined custom learned route priority for a BGP session. This value is applied to all custom learned route ranges for the session. You can choose a value from `0` to `65335`. If you don't provide a value, Google Cloud assigns a priority of `100` to the ranges. + * + * Generated from protobuf field optional int32 custom_learned_route_priority = 330412356; + * @param int $var + * @return $this + */ + public function setCustomLearnedRoutePriority($var) + { + GPBUtil::checkInt32($var); + $this->custom_learned_route_priority = $var; + + return $this; + } + + /** + * The status of the BGP peer connection. If set to FALSE, any active session with the peer is terminated and all associated routing information is removed. If set to TRUE, the peer connection can be established with routing information. The default is TRUE. + * Check the Enable enum for the list of possible values. + * + * Generated from protobuf field optional string enable = 311764355; + * @return string + */ + public function getEnable() + { + return isset($this->enable) ? $this->enable : ''; + } + + public function hasEnable() + { + return isset($this->enable); + } + + public function clearEnable() + { + unset($this->enable); + } + + /** + * The status of the BGP peer connection. If set to FALSE, any active session with the peer is terminated and all associated routing information is removed. If set to TRUE, the peer connection can be established with routing information. The default is TRUE. + * Check the Enable enum for the list of possible values. + * + * Generated from protobuf field optional string enable = 311764355; + * @param string $var + * @return $this + */ + public function setEnable($var) + { + GPBUtil::checkString($var, True); + $this->enable = $var; + + return $this; + } + + /** + * Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4. + * + * Generated from protobuf field optional bool enable_ipv4 = 181467937; + * @return bool + */ + public function getEnableIpv4() + { + return isset($this->enable_ipv4) ? $this->enable_ipv4 : false; + } + + public function hasEnableIpv4() + { + return isset($this->enable_ipv4); + } + + public function clearEnableIpv4() + { + unset($this->enable_ipv4); + } + + /** + * Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4. + * + * Generated from protobuf field optional bool enable_ipv4 = 181467937; + * @param bool $var + * @return $this + */ + public function setEnableIpv4($var) + { + GPBUtil::checkBool($var); + $this->enable_ipv4 = $var; + + return $this; + } + + /** + * Enable IPv6 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 6. + * + * Generated from protobuf field optional bool enable_ipv6 = 181467939; + * @return bool + */ + public function getEnableIpv6() + { + return isset($this->enable_ipv6) ? $this->enable_ipv6 : false; + } + + public function hasEnableIpv6() + { + return isset($this->enable_ipv6); + } + + public function clearEnableIpv6() + { + unset($this->enable_ipv6); + } + + /** + * Enable IPv6 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 6. + * + * Generated from protobuf field optional bool enable_ipv6 = 181467939; + * @param bool $var + * @return $this + */ + public function setEnableIpv6($var) + { + GPBUtil::checkBool($var); + $this->enable_ipv6 = $var; + + return $this; + } + + /** + * List of export policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type. Note that Route Policies are currently available in preview. Please use Beta API to use Route Policies. + * + * Generated from protobuf field repeated string export_policies = 134084987; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExportPolicies() + { + return $this->export_policies; + } + + /** + * List of export policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type. Note that Route Policies are currently available in preview. Please use Beta API to use Route Policies. + * + * Generated from protobuf field repeated string export_policies = 134084987; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExportPolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->export_policies = $arr; + + return $this; + } + + /** + * List of import policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type. Note that Route Policies are currently available in preview. Please use Beta API to use Route Policies. + * + * Generated from protobuf field repeated string import_policies = 451147946; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getImportPolicies() + { + return $this->import_policies; + } + + /** + * List of import policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type. Note that Route Policies are currently available in preview. Please use Beta API to use Route Policies. + * + * Generated from protobuf field repeated string import_policies = 451147946; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setImportPolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->import_policies = $arr; + + return $this; + } + + /** + * Name of the interface the BGP peer is associated with. + * + * Generated from protobuf field optional string interface_name = 437854673; + * @return string + */ + public function getInterfaceName() + { + return isset($this->interface_name) ? $this->interface_name : ''; + } + + public function hasInterfaceName() + { + return isset($this->interface_name); + } + + public function clearInterfaceName() + { + unset($this->interface_name); + } + + /** + * Name of the interface the BGP peer is associated with. + * + * Generated from protobuf field optional string interface_name = 437854673; + * @param string $var + * @return $this + */ + public function setInterfaceName($var) + { + GPBUtil::checkString($var, True); + $this->interface_name = $var; + + return $this; + } + + /** + * IP address of the interface inside Google Cloud Platform. + * + * Generated from protobuf field optional string ip_address = 406272220; + * @return string + */ + public function getIpAddress() + { + return isset($this->ip_address) ? $this->ip_address : ''; + } + + public function hasIpAddress() + { + return isset($this->ip_address); + } + + public function clearIpAddress() + { + unset($this->ip_address); + } + + /** + * IP address of the interface inside Google Cloud Platform. + * + * Generated from protobuf field optional string ip_address = 406272220; + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + + /** + * IPv4 address of the interface inside Google Cloud Platform. + * + * Generated from protobuf field optional string ipv4_nexthop_address = 5703377; + * @return string + */ + public function getIpv4NexthopAddress() + { + return isset($this->ipv4_nexthop_address) ? $this->ipv4_nexthop_address : ''; + } + + public function hasIpv4NexthopAddress() + { + return isset($this->ipv4_nexthop_address); + } + + public function clearIpv4NexthopAddress() + { + unset($this->ipv4_nexthop_address); + } + + /** + * IPv4 address of the interface inside Google Cloud Platform. + * + * Generated from protobuf field optional string ipv4_nexthop_address = 5703377; + * @param string $var + * @return $this + */ + public function setIpv4NexthopAddress($var) + { + GPBUtil::checkString($var, True); + $this->ipv4_nexthop_address = $var; + + return $this; + } + + /** + * IPv6 address of the interface inside Google Cloud Platform. + * + * Generated from protobuf field optional string ipv6_nexthop_address = 27968211; + * @return string + */ + public function getIpv6NexthopAddress() + { + return isset($this->ipv6_nexthop_address) ? $this->ipv6_nexthop_address : ''; + } + + public function hasIpv6NexthopAddress() + { + return isset($this->ipv6_nexthop_address); + } + + public function clearIpv6NexthopAddress() + { + unset($this->ipv6_nexthop_address); + } + + /** + * IPv6 address of the interface inside Google Cloud Platform. + * + * Generated from protobuf field optional string ipv6_nexthop_address = 27968211; + * @param string $var + * @return $this + */ + public function setIpv6NexthopAddress($var) + { + GPBUtil::checkString($var, True); + $this->ipv6_nexthop_address = $var; + + return $this; + } + + /** + * [Output Only] The resource that configures and manages this BGP peer. - MANAGED_BY_USER is the default value and can be managed by you or other users - MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted. + * Check the ManagementType enum for the list of possible values. + * + * Generated from protobuf field optional string management_type = 173703606; + * @return string + */ + public function getManagementType() + { + return isset($this->management_type) ? $this->management_type : ''; + } + + public function hasManagementType() + { + return isset($this->management_type); + } + + public function clearManagementType() + { + unset($this->management_type); + } + + /** + * [Output Only] The resource that configures and manages this BGP peer. - MANAGED_BY_USER is the default value and can be managed by you or other users - MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted. + * Check the ManagementType enum for the list of possible values. + * + * Generated from protobuf field optional string management_type = 173703606; + * @param string $var + * @return $this + */ + public function setManagementType($var) + { + GPBUtil::checkString($var, True); + $this->management_type = $var; + + return $this; + } + + /** + * Present if MD5 authentication is enabled for the peering. Must be the name of one of the entries in the Router.md5_authentication_keys. The field must comply with RFC1035. + * + * Generated from protobuf field optional string md5_authentication_key_name = 281075345; + * @return string + */ + public function getMd5AuthenticationKeyName() + { + return isset($this->md5_authentication_key_name) ? $this->md5_authentication_key_name : ''; + } + + public function hasMd5AuthenticationKeyName() + { + return isset($this->md5_authentication_key_name); + } + + public function clearMd5AuthenticationKeyName() + { + unset($this->md5_authentication_key_name); + } + + /** + * Present if MD5 authentication is enabled for the peering. Must be the name of one of the entries in the Router.md5_authentication_keys. The field must comply with RFC1035. + * + * Generated from protobuf field optional string md5_authentication_key_name = 281075345; + * @param string $var + * @return $this + */ + public function setMd5AuthenticationKeyName($var) + { + GPBUtil::checkString($var, True); + $this->md5_authentication_key_name = $var; + + return $this; + } + + /** + * Name of this BGP peer. 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. + * + * 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); + } + + /** + * Name of this BGP peer. 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. + * + * 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; + } + + /** + * Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value. + * + * Generated from protobuf field optional uint32 peer_asn = 69573151; + * @return int + */ + public function getPeerAsn() + { + return isset($this->peer_asn) ? $this->peer_asn : 0; + } + + public function hasPeerAsn() + { + return isset($this->peer_asn); + } + + public function clearPeerAsn() + { + unset($this->peer_asn); + } + + /** + * Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value. + * + * Generated from protobuf field optional uint32 peer_asn = 69573151; + * @param int $var + * @return $this + */ + public function setPeerAsn($var) + { + GPBUtil::checkUint32($var); + $this->peer_asn = $var; + + return $this; + } + + /** + * IP address of the BGP interface outside Google Cloud Platform. + * + * Generated from protobuf field optional string peer_ip_address = 207735769; + * @return string + */ + public function getPeerIpAddress() + { + return isset($this->peer_ip_address) ? $this->peer_ip_address : ''; + } + + public function hasPeerIpAddress() + { + return isset($this->peer_ip_address); + } + + public function clearPeerIpAddress() + { + unset($this->peer_ip_address); + } + + /** + * IP address of the BGP interface outside Google Cloud Platform. + * + * Generated from protobuf field optional string peer_ip_address = 207735769; + * @param string $var + * @return $this + */ + public function setPeerIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->peer_ip_address = $var; + + return $this; + } + + /** + * IPv4 address of the BGP interface outside Google Cloud Platform. + * + * Generated from protobuf field optional string peer_ipv4_nexthop_address = 469221774; + * @return string + */ + public function getPeerIpv4NexthopAddress() + { + return isset($this->peer_ipv4_nexthop_address) ? $this->peer_ipv4_nexthop_address : ''; + } + + public function hasPeerIpv4NexthopAddress() + { + return isset($this->peer_ipv4_nexthop_address); + } + + public function clearPeerIpv4NexthopAddress() + { + unset($this->peer_ipv4_nexthop_address); + } + + /** + * IPv4 address of the BGP interface outside Google Cloud Platform. + * + * Generated from protobuf field optional string peer_ipv4_nexthop_address = 469221774; + * @param string $var + * @return $this + */ + public function setPeerIpv4NexthopAddress($var) + { + GPBUtil::checkString($var, True); + $this->peer_ipv4_nexthop_address = $var; + + return $this; + } + + /** + * IPv6 address of the BGP interface outside Google Cloud Platform. + * + * Generated from protobuf field optional string peer_ipv6_nexthop_address = 491486608; + * @return string + */ + public function getPeerIpv6NexthopAddress() + { + return isset($this->peer_ipv6_nexthop_address) ? $this->peer_ipv6_nexthop_address : ''; + } + + public function hasPeerIpv6NexthopAddress() + { + return isset($this->peer_ipv6_nexthop_address); + } + + public function clearPeerIpv6NexthopAddress() + { + unset($this->peer_ipv6_nexthop_address); + } + + /** + * IPv6 address of the BGP interface outside Google Cloud Platform. + * + * Generated from protobuf field optional string peer_ipv6_nexthop_address = 491486608; + * @param string $var + * @return $this + */ + public function setPeerIpv6NexthopAddress($var) + { + GPBUtil::checkString($var, True); + $this->peer_ipv6_nexthop_address = $var; + + return $this; + } + + /** + * URI of the VM instance that is used as third-party router appliances such as Next Gen Firewalls, Virtual Routers, or Router Appliances. The VM instance must be located in zones contained in the same region as this Cloud Router. The VM instance is the peer side of the BGP session. + * + * Generated from protobuf field optional string router_appliance_instance = 468312989; + * @return string + */ + public function getRouterApplianceInstance() + { + return isset($this->router_appliance_instance) ? $this->router_appliance_instance : ''; + } + + public function hasRouterApplianceInstance() + { + return isset($this->router_appliance_instance); + } + + public function clearRouterApplianceInstance() + { + unset($this->router_appliance_instance); + } + + /** + * URI of the VM instance that is used as third-party router appliances such as Next Gen Firewalls, Virtual Routers, or Router Appliances. The VM instance must be located in zones contained in the same region as this Cloud Router. The VM instance is the peer side of the BGP session. + * + * Generated from protobuf field optional string router_appliance_instance = 468312989; + * @param string $var + * @return $this + */ + public function setRouterApplianceInstance($var) + { + GPBUtil::checkString($var, True); + $this->router_appliance_instance = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeer/AdvertiseMode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeer/AdvertiseMode.php new file mode 100644 index 000000000000..eab660bff71f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeer/AdvertiseMode.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.RouterBgpPeer.AdvertiseMode + */ +class AdvertiseMode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ADVERTISE_MODE = 0; + */ + const UNDEFINED_ADVERTISE_MODE = 0; + /** + * Generated from protobuf enum CUSTOM = 388595569; + */ + const CUSTOM = 388595569; + /** + * Generated from protobuf enum DEFAULT = 115302945; + */ + const PBDEFAULT = 115302945; + + private static $valueToName = [ + self::UNDEFINED_ADVERTISE_MODE => 'UNDEFINED_ADVERTISE_MODE', + self::CUSTOM => 'CUSTOM', + self::PBDEFAULT => 'DEFAULT', + ]; + + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AdvertiseMode::class, \Google\Cloud\Compute\V1\RouterBgpPeer_AdvertiseMode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeer/AdvertisedGroups.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeer/AdvertisedGroups.php new file mode 100644 index 000000000000..d9e59be67a70 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeer/AdvertisedGroups.php @@ -0,0 +1,56 @@ +google.cloud.compute.v1.RouterBgpPeer.AdvertisedGroups + */ +class AdvertisedGroups +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ADVERTISED_GROUPS = 0; + */ + const UNDEFINED_ADVERTISED_GROUPS = 0; + /** + * Advertise all available subnets (including peer VPC subnets). + * + * Generated from protobuf enum ALL_SUBNETS = 3622872; + */ + const ALL_SUBNETS = 3622872; + + private static $valueToName = [ + self::UNDEFINED_ADVERTISED_GROUPS => 'UNDEFINED_ADVERTISED_GROUPS', + self::ALL_SUBNETS => 'ALL_SUBNETS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AdvertisedGroups::class, \Google\Cloud\Compute\V1\RouterBgpPeer_AdvertisedGroups::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeer/Enable.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeer/Enable.php new file mode 100644 index 000000000000..a736ce24600d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeer/Enable.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.RouterBgpPeer.Enable + */ +class Enable +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ENABLE = 0; + */ + const UNDEFINED_ENABLE = 0; + /** + * Generated from protobuf enum FALSE = 66658563; + */ + const FALSE = 66658563; + /** + * Generated from protobuf enum TRUE = 2583950; + */ + const TRUE = 2583950; + + private static $valueToName = [ + self::UNDEFINED_ENABLE => 'UNDEFINED_ENABLE', + self::FALSE => 'FALSE', + self::TRUE => 'TRUE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Enable::class, \Google\Cloud\Compute\V1\RouterBgpPeer_Enable::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeer/ManagementType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeer/ManagementType.php new file mode 100644 index 000000000000..6093e0dcb8e5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeer/ManagementType.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.RouterBgpPeer.ManagementType + */ +class ManagementType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MANAGEMENT_TYPE = 0; + */ + const UNDEFINED_MANAGEMENT_TYPE = 0; + /** + * The BGP peer is automatically created for PARTNER type InterconnectAttachment; Google will automatically create/delete this BGP peer when the PARTNER InterconnectAttachment is created/deleted, and Google will update the ipAddress and peerIpAddress when the PARTNER InterconnectAttachment is provisioned. This type of BGP peer cannot be created or deleted, but can be modified for all fields except for name, ipAddress and peerIpAddress. + * + * Generated from protobuf enum MANAGED_BY_ATTACHMENT = 458926411; + */ + const MANAGED_BY_ATTACHMENT = 458926411; + /** + * Default value, the BGP peer is manually created and managed by user. + * + * Generated from protobuf enum MANAGED_BY_USER = 317294067; + */ + const MANAGED_BY_USER = 317294067; + + private static $valueToName = [ + self::UNDEFINED_MANAGEMENT_TYPE => 'UNDEFINED_MANAGEMENT_TYPE', + self::MANAGED_BY_ATTACHMENT => 'MANAGED_BY_ATTACHMENT', + self::MANAGED_BY_USER => 'MANAGED_BY_USER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ManagementType::class, \Google\Cloud\Compute\V1\RouterBgpPeer_ManagementType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeerBfd.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeerBfd.php new file mode 100644 index 000000000000..695d610b06d7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeerBfd.php @@ -0,0 +1,212 @@ +google.cloud.compute.v1.RouterBgpPeerBfd + */ +class RouterBgpPeerBfd extends \Google\Protobuf\Internal\Message +{ + /** + * The minimum interval, in milliseconds, between BFD control packets received from the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the transmit interval of the other router. If set, this value must be between 1000 and 30000. The default is 1000. + * + * Generated from protobuf field optional uint32 min_receive_interval = 186981614; + */ + protected $min_receive_interval = null; + /** + * The minimum interval, in milliseconds, between BFD control packets transmitted to the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the corresponding receive interval of the other router. If set, this value must be between 1000 and 30000. The default is 1000. + * + * Generated from protobuf field optional uint32 min_transmit_interval = 523282631; + */ + protected $min_transmit_interval = null; + /** + * The number of consecutive BFD packets that must be missed before BFD declares that a peer is unavailable. If set, the value must be a value between 5 and 16. The default is 5. + * + * Generated from protobuf field optional uint32 multiplier = 191331777; + */ + protected $multiplier = null; + /** + * The BFD session initialization mode for this BGP peer. If set to ACTIVE, the Cloud Router will initiate the BFD session for this BGP peer. If set to PASSIVE, the Cloud Router will wait for the peer router to initiate the BFD session for this BGP peer. If set to DISABLED, BFD is disabled for this BGP peer. The default is DISABLED. + * Check the SessionInitializationMode enum for the list of possible values. + * + * Generated from protobuf field optional string session_initialization_mode = 105957049; + */ + protected $session_initialization_mode = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $min_receive_interval + * The minimum interval, in milliseconds, between BFD control packets received from the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the transmit interval of the other router. If set, this value must be between 1000 and 30000. The default is 1000. + * @type int $min_transmit_interval + * The minimum interval, in milliseconds, between BFD control packets transmitted to the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the corresponding receive interval of the other router. If set, this value must be between 1000 and 30000. The default is 1000. + * @type int $multiplier + * The number of consecutive BFD packets that must be missed before BFD declares that a peer is unavailable. If set, the value must be a value between 5 and 16. The default is 5. + * @type string $session_initialization_mode + * The BFD session initialization mode for this BGP peer. If set to ACTIVE, the Cloud Router will initiate the BFD session for this BGP peer. If set to PASSIVE, the Cloud Router will wait for the peer router to initiate the BFD session for this BGP peer. If set to DISABLED, BFD is disabled for this BGP peer. The default is DISABLED. + * Check the SessionInitializationMode enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The minimum interval, in milliseconds, between BFD control packets received from the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the transmit interval of the other router. If set, this value must be between 1000 and 30000. The default is 1000. + * + * Generated from protobuf field optional uint32 min_receive_interval = 186981614; + * @return int + */ + public function getMinReceiveInterval() + { + return isset($this->min_receive_interval) ? $this->min_receive_interval : 0; + } + + public function hasMinReceiveInterval() + { + return isset($this->min_receive_interval); + } + + public function clearMinReceiveInterval() + { + unset($this->min_receive_interval); + } + + /** + * The minimum interval, in milliseconds, between BFD control packets received from the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the transmit interval of the other router. If set, this value must be between 1000 and 30000. The default is 1000. + * + * Generated from protobuf field optional uint32 min_receive_interval = 186981614; + * @param int $var + * @return $this + */ + public function setMinReceiveInterval($var) + { + GPBUtil::checkUint32($var); + $this->min_receive_interval = $var; + + return $this; + } + + /** + * The minimum interval, in milliseconds, between BFD control packets transmitted to the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the corresponding receive interval of the other router. If set, this value must be between 1000 and 30000. The default is 1000. + * + * Generated from protobuf field optional uint32 min_transmit_interval = 523282631; + * @return int + */ + public function getMinTransmitInterval() + { + return isset($this->min_transmit_interval) ? $this->min_transmit_interval : 0; + } + + public function hasMinTransmitInterval() + { + return isset($this->min_transmit_interval); + } + + public function clearMinTransmitInterval() + { + unset($this->min_transmit_interval); + } + + /** + * The minimum interval, in milliseconds, between BFD control packets transmitted to the peer router. The actual value is negotiated between the two routers and is equal to the greater of this value and the corresponding receive interval of the other router. If set, this value must be between 1000 and 30000. The default is 1000. + * + * Generated from protobuf field optional uint32 min_transmit_interval = 523282631; + * @param int $var + * @return $this + */ + public function setMinTransmitInterval($var) + { + GPBUtil::checkUint32($var); + $this->min_transmit_interval = $var; + + return $this; + } + + /** + * The number of consecutive BFD packets that must be missed before BFD declares that a peer is unavailable. If set, the value must be a value between 5 and 16. The default is 5. + * + * Generated from protobuf field optional uint32 multiplier = 191331777; + * @return int + */ + public function getMultiplier() + { + return isset($this->multiplier) ? $this->multiplier : 0; + } + + public function hasMultiplier() + { + return isset($this->multiplier); + } + + public function clearMultiplier() + { + unset($this->multiplier); + } + + /** + * The number of consecutive BFD packets that must be missed before BFD declares that a peer is unavailable. If set, the value must be a value between 5 and 16. The default is 5. + * + * Generated from protobuf field optional uint32 multiplier = 191331777; + * @param int $var + * @return $this + */ + public function setMultiplier($var) + { + GPBUtil::checkUint32($var); + $this->multiplier = $var; + + return $this; + } + + /** + * The BFD session initialization mode for this BGP peer. If set to ACTIVE, the Cloud Router will initiate the BFD session for this BGP peer. If set to PASSIVE, the Cloud Router will wait for the peer router to initiate the BFD session for this BGP peer. If set to DISABLED, BFD is disabled for this BGP peer. The default is DISABLED. + * Check the SessionInitializationMode enum for the list of possible values. + * + * Generated from protobuf field optional string session_initialization_mode = 105957049; + * @return string + */ + public function getSessionInitializationMode() + { + return isset($this->session_initialization_mode) ? $this->session_initialization_mode : ''; + } + + public function hasSessionInitializationMode() + { + return isset($this->session_initialization_mode); + } + + public function clearSessionInitializationMode() + { + unset($this->session_initialization_mode); + } + + /** + * The BFD session initialization mode for this BGP peer. If set to ACTIVE, the Cloud Router will initiate the BFD session for this BGP peer. If set to PASSIVE, the Cloud Router will wait for the peer router to initiate the BFD session for this BGP peer. If set to DISABLED, BFD is disabled for this BGP peer. The default is DISABLED. + * Check the SessionInitializationMode enum for the list of possible values. + * + * Generated from protobuf field optional string session_initialization_mode = 105957049; + * @param string $var + * @return $this + */ + public function setSessionInitializationMode($var) + { + GPBUtil::checkString($var, True); + $this->session_initialization_mode = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeerBfd/SessionInitializationMode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeerBfd/SessionInitializationMode.php new file mode 100644 index 000000000000..d958fbb35460 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeerBfd/SessionInitializationMode.php @@ -0,0 +1,65 @@ +google.cloud.compute.v1.RouterBgpPeerBfd.SessionInitializationMode + */ +class SessionInitializationMode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_SESSION_INITIALIZATION_MODE = 0; + */ + const UNDEFINED_SESSION_INITIALIZATION_MODE = 0; + /** + * Generated from protobuf enum ACTIVE = 314733318; + */ + const ACTIVE = 314733318; + /** + * Generated from protobuf enum DISABLED = 516696700; + */ + const DISABLED = 516696700; + /** + * Generated from protobuf enum PASSIVE = 462813959; + */ + const PASSIVE = 462813959; + + private static $valueToName = [ + self::UNDEFINED_SESSION_INITIALIZATION_MODE => 'UNDEFINED_SESSION_INITIALIZATION_MODE', + self::ACTIVE => 'ACTIVE', + self::DISABLED => 'DISABLED', + self::PASSIVE => 'PASSIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SessionInitializationMode::class, \Google\Cloud\Compute\V1\RouterBgpPeerBfd_SessionInitializationMode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeerCustomLearnedIpRange.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeerCustomLearnedIpRange.php new file mode 100644 index 000000000000..7b8974584801 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterBgpPeerCustomLearnedIpRange.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.RouterBgpPeerCustomLearnedIpRange + */ +class RouterBgpPeerCustomLearnedIpRange extends \Google\Protobuf\Internal\Message +{ + /** + * The custom learned route IP address range. Must be a valid CIDR-formatted prefix. If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, a `/32` singular IP address range, and, for IPv6, `/128`. + * + * Generated from protobuf field optional string range = 108280125; + */ + protected $range = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $range + * The custom learned route IP address range. Must be a valid CIDR-formatted prefix. If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, a `/32` singular IP address range, and, for IPv6, `/128`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The custom learned route IP address range. Must be a valid CIDR-formatted prefix. If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, a `/32` singular IP address range, and, for IPv6, `/128`. + * + * Generated from protobuf field optional string range = 108280125; + * @return string + */ + public function getRange() + { + return isset($this->range) ? $this->range : ''; + } + + public function hasRange() + { + return isset($this->range); + } + + public function clearRange() + { + unset($this->range); + } + + /** + * The custom learned route IP address range. Must be a valid CIDR-formatted prefix. If an IP address is provided without a subnet mask, it is interpreted as, for IPv4, a `/32` singular IP address range, and, for IPv6, `/128`. + * + * Generated from protobuf field optional string range = 108280125; + * @param string $var + * @return $this + */ + public function setRange($var) + { + GPBUtil::checkString($var, True); + $this->range = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterInterface.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterInterface.php new file mode 100644 index 000000000000..52c5348ee0ba --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterInterface.php @@ -0,0 +1,436 @@ +google.cloud.compute.v1.RouterInterface + */ +class RouterInterface extends \Google\Protobuf\Internal\Message +{ + /** + * IP address and range of the interface. - For Internet Protocol version 4 (IPv4), the IP range must be in the RFC3927 link-local IP address space. The value must be a CIDR-formatted string, for example, 169.254.0.1/30. Note: Do not truncate the IP address, as it represents the IP address of the interface. - For Internet Protocol version 6 (IPv6), the value must be a unique local address (ULA) range from fdff:1::/64 with a mask length of 126 or less. This value should be a CIDR-formatted string, for example, fc00:0:1:1::1/112. Within the router's VPC, this IPv6 prefix will be reserved exclusively for this connection and cannot be used for any other purpose. + * + * Generated from protobuf field optional string ip_range = 145092645; + */ + protected $ip_range = null; + /** + * IP version of this interface. + * Check the IpVersion enum for the list of possible values. + * + * Generated from protobuf field optional string ip_version = 294959552; + */ + protected $ip_version = null; + /** + * URI of the linked Interconnect attachment. It must be in the same region as the router. Each interface can have one linked resource, which can be a VPN tunnel, an Interconnect attachment, or a subnetwork. + * + * Generated from protobuf field optional string linked_interconnect_attachment = 501085518; + */ + protected $linked_interconnect_attachment = null; + /** + * URI of the linked VPN tunnel, which must be in the same region as the router. Each interface can have one linked resource, which can be a VPN tunnel, an Interconnect attachment, or a subnetwork. + * + * Generated from protobuf field optional string linked_vpn_tunnel = 352296953; + */ + protected $linked_vpn_tunnel = null; + /** + * [Output Only] The resource that configures and manages this interface. - MANAGED_BY_USER is the default value and can be managed directly by users. - MANAGED_BY_ATTACHMENT is an interface that is configured and managed by Cloud Interconnect, specifically, by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of interface when the PARTNER InterconnectAttachment is created, updated, or deleted. + * Check the ManagementType enum for the list of possible values. + * + * Generated from protobuf field optional string management_type = 173703606; + */ + protected $management_type = null; + /** + * Name of this interface entry. 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * The regional private internal IP address that is used to establish BGP sessions to a VM instance acting as a third-party Router Appliance, such as a Next Gen Firewall, a Virtual Router, or an SD-WAN VM. + * + * Generated from protobuf field optional string private_ip_address = 100854040; + */ + protected $private_ip_address = null; + /** + * Name of the interface that will be redundant with the current interface you are creating. The redundantInterface must belong to the same Cloud Router as the interface here. To establish the BGP session to a Router Appliance VM, you must create two BGP peers. The two BGP peers must be attached to two separate interfaces that are redundant with each other. The redundant_interface must be 1-63 characters long, and comply with RFC1035. Specifically, the redundant_interface 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. + * + * Generated from protobuf field optional string redundant_interface = 523187303; + */ + protected $redundant_interface = null; + /** + * The URI of the subnetwork resource that this interface belongs to, which must be in the same region as the Cloud Router. When you establish a BGP session to a VM instance using this interface, the VM instance must belong to the same subnetwork as the subnetwork specified here. + * + * Generated from protobuf field optional string subnetwork = 307827694; + */ + protected $subnetwork = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ip_range + * IP address and range of the interface. - For Internet Protocol version 4 (IPv4), the IP range must be in the RFC3927 link-local IP address space. The value must be a CIDR-formatted string, for example, 169.254.0.1/30. Note: Do not truncate the IP address, as it represents the IP address of the interface. - For Internet Protocol version 6 (IPv6), the value must be a unique local address (ULA) range from fdff:1::/64 with a mask length of 126 or less. This value should be a CIDR-formatted string, for example, fc00:0:1:1::1/112. Within the router's VPC, this IPv6 prefix will be reserved exclusively for this connection and cannot be used for any other purpose. + * @type string $ip_version + * IP version of this interface. + * Check the IpVersion enum for the list of possible values. + * @type string $linked_interconnect_attachment + * URI of the linked Interconnect attachment. It must be in the same region as the router. Each interface can have one linked resource, which can be a VPN tunnel, an Interconnect attachment, or a subnetwork. + * @type string $linked_vpn_tunnel + * URI of the linked VPN tunnel, which must be in the same region as the router. Each interface can have one linked resource, which can be a VPN tunnel, an Interconnect attachment, or a subnetwork. + * @type string $management_type + * [Output Only] The resource that configures and manages this interface. - MANAGED_BY_USER is the default value and can be managed directly by users. - MANAGED_BY_ATTACHMENT is an interface that is configured and managed by Cloud Interconnect, specifically, by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of interface when the PARTNER InterconnectAttachment is created, updated, or deleted. + * Check the ManagementType enum for the list of possible values. + * @type string $name + * Name of this interface entry. 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 string $private_ip_address + * The regional private internal IP address that is used to establish BGP sessions to a VM instance acting as a third-party Router Appliance, such as a Next Gen Firewall, a Virtual Router, or an SD-WAN VM. + * @type string $redundant_interface + * Name of the interface that will be redundant with the current interface you are creating. The redundantInterface must belong to the same Cloud Router as the interface here. To establish the BGP session to a Router Appliance VM, you must create two BGP peers. The two BGP peers must be attached to two separate interfaces that are redundant with each other. The redundant_interface must be 1-63 characters long, and comply with RFC1035. Specifically, the redundant_interface 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 string $subnetwork + * The URI of the subnetwork resource that this interface belongs to, which must be in the same region as the Cloud Router. When you establish a BGP session to a VM instance using this interface, the VM instance must belong to the same subnetwork as the subnetwork specified here. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * IP address and range of the interface. - For Internet Protocol version 4 (IPv4), the IP range must be in the RFC3927 link-local IP address space. The value must be a CIDR-formatted string, for example, 169.254.0.1/30. Note: Do not truncate the IP address, as it represents the IP address of the interface. - For Internet Protocol version 6 (IPv6), the value must be a unique local address (ULA) range from fdff:1::/64 with a mask length of 126 or less. This value should be a CIDR-formatted string, for example, fc00:0:1:1::1/112. Within the router's VPC, this IPv6 prefix will be reserved exclusively for this connection and cannot be used for any other purpose. + * + * Generated from protobuf field optional string ip_range = 145092645; + * @return string + */ + public function getIpRange() + { + return isset($this->ip_range) ? $this->ip_range : ''; + } + + public function hasIpRange() + { + return isset($this->ip_range); + } + + public function clearIpRange() + { + unset($this->ip_range); + } + + /** + * IP address and range of the interface. - For Internet Protocol version 4 (IPv4), the IP range must be in the RFC3927 link-local IP address space. The value must be a CIDR-formatted string, for example, 169.254.0.1/30. Note: Do not truncate the IP address, as it represents the IP address of the interface. - For Internet Protocol version 6 (IPv6), the value must be a unique local address (ULA) range from fdff:1::/64 with a mask length of 126 or less. This value should be a CIDR-formatted string, for example, fc00:0:1:1::1/112. Within the router's VPC, this IPv6 prefix will be reserved exclusively for this connection and cannot be used for any other purpose. + * + * Generated from protobuf field optional string ip_range = 145092645; + * @param string $var + * @return $this + */ + public function setIpRange($var) + { + GPBUtil::checkString($var, True); + $this->ip_range = $var; + + return $this; + } + + /** + * IP version of this interface. + * Check the IpVersion enum for the list of possible values. + * + * Generated from protobuf field optional string ip_version = 294959552; + * @return string + */ + public function getIpVersion() + { + return isset($this->ip_version) ? $this->ip_version : ''; + } + + public function hasIpVersion() + { + return isset($this->ip_version); + } + + public function clearIpVersion() + { + unset($this->ip_version); + } + + /** + * IP version of this interface. + * Check the IpVersion enum for the list of possible values. + * + * Generated from protobuf field optional string ip_version = 294959552; + * @param string $var + * @return $this + */ + public function setIpVersion($var) + { + GPBUtil::checkString($var, True); + $this->ip_version = $var; + + return $this; + } + + /** + * URI of the linked Interconnect attachment. It must be in the same region as the router. Each interface can have one linked resource, which can be a VPN tunnel, an Interconnect attachment, or a subnetwork. + * + * Generated from protobuf field optional string linked_interconnect_attachment = 501085518; + * @return string + */ + public function getLinkedInterconnectAttachment() + { + return isset($this->linked_interconnect_attachment) ? $this->linked_interconnect_attachment : ''; + } + + public function hasLinkedInterconnectAttachment() + { + return isset($this->linked_interconnect_attachment); + } + + public function clearLinkedInterconnectAttachment() + { + unset($this->linked_interconnect_attachment); + } + + /** + * URI of the linked Interconnect attachment. It must be in the same region as the router. Each interface can have one linked resource, which can be a VPN tunnel, an Interconnect attachment, or a subnetwork. + * + * Generated from protobuf field optional string linked_interconnect_attachment = 501085518; + * @param string $var + * @return $this + */ + public function setLinkedInterconnectAttachment($var) + { + GPBUtil::checkString($var, True); + $this->linked_interconnect_attachment = $var; + + return $this; + } + + /** + * URI of the linked VPN tunnel, which must be in the same region as the router. Each interface can have one linked resource, which can be a VPN tunnel, an Interconnect attachment, or a subnetwork. + * + * Generated from protobuf field optional string linked_vpn_tunnel = 352296953; + * @return string + */ + public function getLinkedVpnTunnel() + { + return isset($this->linked_vpn_tunnel) ? $this->linked_vpn_tunnel : ''; + } + + public function hasLinkedVpnTunnel() + { + return isset($this->linked_vpn_tunnel); + } + + public function clearLinkedVpnTunnel() + { + unset($this->linked_vpn_tunnel); + } + + /** + * URI of the linked VPN tunnel, which must be in the same region as the router. Each interface can have one linked resource, which can be a VPN tunnel, an Interconnect attachment, or a subnetwork. + * + * Generated from protobuf field optional string linked_vpn_tunnel = 352296953; + * @param string $var + * @return $this + */ + public function setLinkedVpnTunnel($var) + { + GPBUtil::checkString($var, True); + $this->linked_vpn_tunnel = $var; + + return $this; + } + + /** + * [Output Only] The resource that configures and manages this interface. - MANAGED_BY_USER is the default value and can be managed directly by users. - MANAGED_BY_ATTACHMENT is an interface that is configured and managed by Cloud Interconnect, specifically, by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of interface when the PARTNER InterconnectAttachment is created, updated, or deleted. + * Check the ManagementType enum for the list of possible values. + * + * Generated from protobuf field optional string management_type = 173703606; + * @return string + */ + public function getManagementType() + { + return isset($this->management_type) ? $this->management_type : ''; + } + + public function hasManagementType() + { + return isset($this->management_type); + } + + public function clearManagementType() + { + unset($this->management_type); + } + + /** + * [Output Only] The resource that configures and manages this interface. - MANAGED_BY_USER is the default value and can be managed directly by users. - MANAGED_BY_ATTACHMENT is an interface that is configured and managed by Cloud Interconnect, specifically, by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of interface when the PARTNER InterconnectAttachment is created, updated, or deleted. + * Check the ManagementType enum for the list of possible values. + * + * Generated from protobuf field optional string management_type = 173703606; + * @param string $var + * @return $this + */ + public function setManagementType($var) + { + GPBUtil::checkString($var, True); + $this->management_type = $var; + + return $this; + } + + /** + * Name of this interface entry. 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. + * + * 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); + } + + /** + * Name of this interface entry. 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. + * + * 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; + } + + /** + * The regional private internal IP address that is used to establish BGP sessions to a VM instance acting as a third-party Router Appliance, such as a Next Gen Firewall, a Virtual Router, or an SD-WAN VM. + * + * Generated from protobuf field optional string private_ip_address = 100854040; + * @return string + */ + public function getPrivateIpAddress() + { + return isset($this->private_ip_address) ? $this->private_ip_address : ''; + } + + public function hasPrivateIpAddress() + { + return isset($this->private_ip_address); + } + + public function clearPrivateIpAddress() + { + unset($this->private_ip_address); + } + + /** + * The regional private internal IP address that is used to establish BGP sessions to a VM instance acting as a third-party Router Appliance, such as a Next Gen Firewall, a Virtual Router, or an SD-WAN VM. + * + * Generated from protobuf field optional string private_ip_address = 100854040; + * @param string $var + * @return $this + */ + public function setPrivateIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->private_ip_address = $var; + + return $this; + } + + /** + * Name of the interface that will be redundant with the current interface you are creating. The redundantInterface must belong to the same Cloud Router as the interface here. To establish the BGP session to a Router Appliance VM, you must create two BGP peers. The two BGP peers must be attached to two separate interfaces that are redundant with each other. The redundant_interface must be 1-63 characters long, and comply with RFC1035. Specifically, the redundant_interface 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. + * + * Generated from protobuf field optional string redundant_interface = 523187303; + * @return string + */ + public function getRedundantInterface() + { + return isset($this->redundant_interface) ? $this->redundant_interface : ''; + } + + public function hasRedundantInterface() + { + return isset($this->redundant_interface); + } + + public function clearRedundantInterface() + { + unset($this->redundant_interface); + } + + /** + * Name of the interface that will be redundant with the current interface you are creating. The redundantInterface must belong to the same Cloud Router as the interface here. To establish the BGP session to a Router Appliance VM, you must create two BGP peers. The two BGP peers must be attached to two separate interfaces that are redundant with each other. The redundant_interface must be 1-63 characters long, and comply with RFC1035. Specifically, the redundant_interface 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. + * + * Generated from protobuf field optional string redundant_interface = 523187303; + * @param string $var + * @return $this + */ + public function setRedundantInterface($var) + { + GPBUtil::checkString($var, True); + $this->redundant_interface = $var; + + return $this; + } + + /** + * The URI of the subnetwork resource that this interface belongs to, which must be in the same region as the Cloud Router. When you establish a BGP session to a VM instance using this interface, the VM instance must belong to the same subnetwork as the subnetwork specified here. + * + * Generated from protobuf field optional string subnetwork = 307827694; + * @return string + */ + public function getSubnetwork() + { + return isset($this->subnetwork) ? $this->subnetwork : ''; + } + + public function hasSubnetwork() + { + return isset($this->subnetwork); + } + + public function clearSubnetwork() + { + unset($this->subnetwork); + } + + /** + * The URI of the subnetwork resource that this interface belongs to, which must be in the same region as the Cloud Router. When you establish a BGP session to a VM instance using this interface, the VM instance must belong to the same subnetwork as the subnetwork specified here. + * + * Generated from protobuf field optional string subnetwork = 307827694; + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterInterface/IpVersion.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterInterface/IpVersion.php new file mode 100644 index 000000000000..8f69ca770861 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterInterface/IpVersion.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.RouterInterface.IpVersion + */ +class IpVersion +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_IP_VERSION = 0; + */ + const UNDEFINED_IP_VERSION = 0; + /** + * Generated from protobuf enum IPV4 = 2254341; + */ + const IPV4 = 2254341; + /** + * Generated from protobuf enum IPV6 = 2254343; + */ + const IPV6 = 2254343; + + private static $valueToName = [ + self::UNDEFINED_IP_VERSION => 'UNDEFINED_IP_VERSION', + self::IPV4 => 'IPV4', + self::IPV6 => 'IPV6', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IpVersion::class, \Google\Cloud\Compute\V1\RouterInterface_IpVersion::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterInterface/ManagementType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterInterface/ManagementType.php new file mode 100644 index 000000000000..d01c46155dd8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterInterface/ManagementType.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.RouterInterface.ManagementType + */ +class ManagementType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MANAGEMENT_TYPE = 0; + */ + const UNDEFINED_MANAGEMENT_TYPE = 0; + /** + * The interface is automatically created for PARTNER type InterconnectAttachment, Google will automatically create/update/delete this interface when the PARTNER InterconnectAttachment is created/provisioned/deleted. This type of interface cannot be manually managed by user. + * + * Generated from protobuf enum MANAGED_BY_ATTACHMENT = 458926411; + */ + const MANAGED_BY_ATTACHMENT = 458926411; + /** + * Default value, the interface is manually created and managed by user. + * + * Generated from protobuf enum MANAGED_BY_USER = 317294067; + */ + const MANAGED_BY_USER = 317294067; + + private static $valueToName = [ + self::UNDEFINED_MANAGEMENT_TYPE => 'UNDEFINED_MANAGEMENT_TYPE', + self::MANAGED_BY_ATTACHMENT => 'MANAGED_BY_ATTACHMENT', + self::MANAGED_BY_USER => 'MANAGED_BY_USER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ManagementType::class, \Google\Cloud\Compute\V1\RouterInterface_ManagementType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterList.php new file mode 100644 index 000000000000..988da5d53726 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.RouterList + */ +class RouterList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of Router resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Router items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#router for routers. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\Router>|\Google\Protobuf\Internal\RepeatedField $items + * A list of Router resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#router for routers. + * @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 Router resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Router items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of Router resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Router items = 100526016; + * @param array<\Google\Cloud\Compute\V1\Router>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Router::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#router for routers. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#router for routers. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterMd5AuthenticationKey.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterMd5AuthenticationKey.php new file mode 100644 index 000000000000..45d87cccc2df --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterMd5AuthenticationKey.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.RouterMd5AuthenticationKey + */ +class RouterMd5AuthenticationKey extends \Google\Protobuf\Internal\Message +{ + /** + * [Input only] Value of the key. For patch and update calls, it can be skipped to copy the value from the previous configuration. This is allowed if the key with the same name existed before the operation. Maximum length is 80 characters. Can only contain printable ASCII characters. + * + * Generated from protobuf field optional string key = 106079; + */ + protected $key = null; + /** + * Name used to identify the key. Must be unique within a router. Must be referenced by exactly one bgpPeer. Must comply with RFC1035. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * [Input only] Value of the key. For patch and update calls, it can be skipped to copy the value from the previous configuration. This is allowed if the key with the same name existed before the operation. Maximum length is 80 characters. Can only contain printable ASCII characters. + * @type string $name + * Name used to identify the key. Must be unique within a router. Must be referenced by exactly one bgpPeer. Must comply with RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Input only] Value of the key. For patch and update calls, it can be skipped to copy the value from the previous configuration. This is allowed if the key with the same name existed before the operation. Maximum length is 80 characters. Can only contain printable ASCII characters. + * + * Generated from protobuf field optional string key = 106079; + * @return string + */ + public function getKey() + { + return isset($this->key) ? $this->key : ''; + } + + public function hasKey() + { + return isset($this->key); + } + + public function clearKey() + { + unset($this->key); + } + + /** + * [Input only] Value of the key. For patch and update calls, it can be skipped to copy the value from the previous configuration. This is allowed if the key with the same name existed before the operation. Maximum length is 80 characters. Can only contain printable ASCII characters. + * + * Generated from protobuf field optional string key = 106079; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Name used to identify the key. Must be unique within a router. Must be referenced by exactly one bgpPeer. Must comply with RFC1035. + * + * 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); + } + + /** + * Name used to identify the key. Must be unique within a router. Must be referenced by exactly one bgpPeer. Must comply with RFC1035. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat.php new file mode 100644 index 000000000000..29f8b08368fc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat.php @@ -0,0 +1,876 @@ +google.cloud.compute.v1.RouterNat + */ +class RouterNat extends \Google\Protobuf\Internal\Message +{ + /** + * The network tier to use when automatically reserving NAT IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, then the current project-level default tier is used. + * Check the AutoNetworkTier enum for the list of possible values. + * + * Generated from protobuf field optional string auto_network_tier = 269770211; + */ + protected $auto_network_tier = null; + /** + * A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only. + * + * Generated from protobuf field repeated string drain_nat_ips = 504078535; + */ + private $drain_nat_ips; + /** + * Enable Dynamic Port Allocation. If not specified, it is disabled by default. If set to true, - Dynamic Port Allocation will be enabled on this NAT config. - enableEndpointIndependentMapping cannot be set to true. - If minPorts is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. + * + * Generated from protobuf field optional bool enable_dynamic_port_allocation = 532106402; + */ + protected $enable_dynamic_port_allocation = null; + /** + * Generated from protobuf field optional bool enable_endpoint_independent_mapping = 259441819; + */ + protected $enable_endpoint_independent_mapping = null; + /** + * List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM + * Check the EndpointTypes enum for the list of possible values. + * + * Generated from protobuf field repeated string endpoint_types = 502633807; + */ + private $endpoint_types; + /** + * Timeout (in seconds) for ICMP connections. Defaults to 30s if not set. + * + * Generated from protobuf field optional int32 icmp_idle_timeout_sec = 3647562; + */ + protected $icmp_idle_timeout_sec = null; + /** + * Configure logging on this NAT. + * + * Generated from protobuf field optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741; + */ + protected $log_config = null; + /** + * Maximum number of ports allocated to a VM from this NAT config when Dynamic Port Allocation is enabled. If Dynamic Port Allocation is not enabled, this field has no effect. If Dynamic Port Allocation is enabled, and this field is set, it must be set to a power of two greater than minPortsPerVm, or 64 if minPortsPerVm is not set. If Dynamic Port Allocation is enabled and this field is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. + * + * Generated from protobuf field optional int32 max_ports_per_vm = 250062049; + */ + protected $max_ports_per_vm = null; + /** + * Minimum number of ports allocated to a VM from this NAT config. If not set, a default number of ports is allocated to a VM. This is rounded up to the nearest power of 2. For example, if the value of this field is 50, at least 64 ports are allocated to a VM. + * + * Generated from protobuf field optional int32 min_ports_per_vm = 186193587; + */ + protected $min_ports_per_vm = null; + /** + * Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty. + * Check the NatIpAllocateOption enum for the list of possible values. + * + * Generated from protobuf field optional string nat_ip_allocate_option = 429726845; + */ + protected $nat_ip_allocate_option = null; + /** + * A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project. + * + * Generated from protobuf field repeated string nat_ips = 117635086; + */ + private $nat_ips; + /** + * A list of rules associated with this NAT. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975; + */ + private $rules; + /** + * Specify the Nat option, which can take one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES then there should not be any other Router.Nat section in any Router for this network in this region. + * Check the SourceSubnetworkIpRangesToNat enum for the list of possible values. + * + * Generated from protobuf field optional string source_subnetwork_ip_ranges_to_nat = 252213211; + */ + protected $source_subnetwork_ip_ranges_to_nat = null; + /** + * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125; + */ + private $subnetworks; + /** + * Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set. + * + * Generated from protobuf field optional int32 tcp_established_idle_timeout_sec = 223098349; + */ + protected $tcp_established_idle_timeout_sec = null; + /** + * Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set. + * + * Generated from protobuf field optional int32 tcp_time_wait_timeout_sec = 513596925; + */ + protected $tcp_time_wait_timeout_sec = null; + /** + * Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set. + * + * Generated from protobuf field optional int32 tcp_transitory_idle_timeout_sec = 205028774; + */ + protected $tcp_transitory_idle_timeout_sec = null; + /** + * Indicates whether this NAT is used for public or private IP translation. If unspecified, it defaults to PUBLIC. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + /** + * Timeout (in seconds) for UDP connections. Defaults to 30s if not set. + * + * Generated from protobuf field optional int32 udp_idle_timeout_sec = 64919878; + */ + protected $udp_idle_timeout_sec = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $auto_network_tier + * The network tier to use when automatically reserving NAT IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, then the current project-level default tier is used. + * Check the AutoNetworkTier enum for the list of possible values. + * @type array|\Google\Protobuf\Internal\RepeatedField $drain_nat_ips + * A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only. + * @type bool $enable_dynamic_port_allocation + * Enable Dynamic Port Allocation. If not specified, it is disabled by default. If set to true, - Dynamic Port Allocation will be enabled on this NAT config. - enableEndpointIndependentMapping cannot be set to true. - If minPorts is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. + * @type bool $enable_endpoint_independent_mapping + * @type array|\Google\Protobuf\Internal\RepeatedField $endpoint_types + * List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM + * Check the EndpointTypes enum for the list of possible values. + * @type int $icmp_idle_timeout_sec + * Timeout (in seconds) for ICMP connections. Defaults to 30s if not set. + * @type \Google\Cloud\Compute\V1\RouterNatLogConfig $log_config + * Configure logging on this NAT. + * @type int $max_ports_per_vm + * Maximum number of ports allocated to a VM from this NAT config when Dynamic Port Allocation is enabled. If Dynamic Port Allocation is not enabled, this field has no effect. If Dynamic Port Allocation is enabled, and this field is set, it must be set to a power of two greater than minPortsPerVm, or 64 if minPortsPerVm is not set. If Dynamic Port Allocation is enabled and this field is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. + * @type int $min_ports_per_vm + * Minimum number of ports allocated to a VM from this NAT config. If not set, a default number of ports is allocated to a VM. This is rounded up to the nearest power of 2. For example, if the value of this field is 50, at least 64 ports are allocated to a VM. + * @type string $name + * Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035. + * @type string $nat_ip_allocate_option + * Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty. + * Check the NatIpAllocateOption enum for the list of possible values. + * @type array|\Google\Protobuf\Internal\RepeatedField $nat_ips + * A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project. + * @type array<\Google\Cloud\Compute\V1\RouterNatRule>|\Google\Protobuf\Internal\RepeatedField $rules + * A list of rules associated with this NAT. + * @type string $source_subnetwork_ip_ranges_to_nat + * Specify the Nat option, which can take one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES then there should not be any other Router.Nat section in any Router for this network in this region. + * Check the SourceSubnetworkIpRangesToNat enum for the list of possible values. + * @type array<\Google\Cloud\Compute\V1\RouterNatSubnetworkToNat>|\Google\Protobuf\Internal\RepeatedField $subnetworks + * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above. + * @type int $tcp_established_idle_timeout_sec + * Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set. + * @type int $tcp_time_wait_timeout_sec + * Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set. + * @type int $tcp_transitory_idle_timeout_sec + * Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set. + * @type string $type + * Indicates whether this NAT is used for public or private IP translation. If unspecified, it defaults to PUBLIC. + * Check the Type enum for the list of possible values. + * @type int $udp_idle_timeout_sec + * Timeout (in seconds) for UDP connections. Defaults to 30s if not set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The network tier to use when automatically reserving NAT IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, then the current project-level default tier is used. + * Check the AutoNetworkTier enum for the list of possible values. + * + * Generated from protobuf field optional string auto_network_tier = 269770211; + * @return string + */ + public function getAutoNetworkTier() + { + return isset($this->auto_network_tier) ? $this->auto_network_tier : ''; + } + + public function hasAutoNetworkTier() + { + return isset($this->auto_network_tier); + } + + public function clearAutoNetworkTier() + { + unset($this->auto_network_tier); + } + + /** + * The network tier to use when automatically reserving NAT IP addresses. Must be one of: PREMIUM, STANDARD. If not specified, then the current project-level default tier is used. + * Check the AutoNetworkTier enum for the list of possible values. + * + * Generated from protobuf field optional string auto_network_tier = 269770211; + * @param string $var + * @return $this + */ + public function setAutoNetworkTier($var) + { + GPBUtil::checkString($var, True); + $this->auto_network_tier = $var; + + return $this; + } + + /** + * A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only. + * + * Generated from protobuf field repeated string drain_nat_ips = 504078535; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDrainNatIps() + { + return $this->drain_nat_ips; + } + + /** + * A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only. + * + * Generated from protobuf field repeated string drain_nat_ips = 504078535; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDrainNatIps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->drain_nat_ips = $arr; + + return $this; + } + + /** + * Enable Dynamic Port Allocation. If not specified, it is disabled by default. If set to true, - Dynamic Port Allocation will be enabled on this NAT config. - enableEndpointIndependentMapping cannot be set to true. - If minPorts is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. + * + * Generated from protobuf field optional bool enable_dynamic_port_allocation = 532106402; + * @return bool + */ + public function getEnableDynamicPortAllocation() + { + return isset($this->enable_dynamic_port_allocation) ? $this->enable_dynamic_port_allocation : false; + } + + public function hasEnableDynamicPortAllocation() + { + return isset($this->enable_dynamic_port_allocation); + } + + public function clearEnableDynamicPortAllocation() + { + unset($this->enable_dynamic_port_allocation); + } + + /** + * Enable Dynamic Port Allocation. If not specified, it is disabled by default. If set to true, - Dynamic Port Allocation will be enabled on this NAT config. - enableEndpointIndependentMapping cannot be set to true. - If minPorts is set, minPortsPerVm must be set to a power of two greater than or equal to 32. If minPortsPerVm is not set, a minimum of 32 ports will be allocated to a VM from this NAT config. + * + * Generated from protobuf field optional bool enable_dynamic_port_allocation = 532106402; + * @param bool $var + * @return $this + */ + public function setEnableDynamicPortAllocation($var) + { + GPBUtil::checkBool($var); + $this->enable_dynamic_port_allocation = $var; + + return $this; + } + + /** + * Generated from protobuf field optional bool enable_endpoint_independent_mapping = 259441819; + * @return bool + */ + public function getEnableEndpointIndependentMapping() + { + return isset($this->enable_endpoint_independent_mapping) ? $this->enable_endpoint_independent_mapping : false; + } + + public function hasEnableEndpointIndependentMapping() + { + return isset($this->enable_endpoint_independent_mapping); + } + + public function clearEnableEndpointIndependentMapping() + { + unset($this->enable_endpoint_independent_mapping); + } + + /** + * Generated from protobuf field optional bool enable_endpoint_independent_mapping = 259441819; + * @param bool $var + * @return $this + */ + public function setEnableEndpointIndependentMapping($var) + { + GPBUtil::checkBool($var); + $this->enable_endpoint_independent_mapping = $var; + + return $this; + } + + /** + * List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM + * Check the EndpointTypes enum for the list of possible values. + * + * Generated from protobuf field repeated string endpoint_types = 502633807; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEndpointTypes() + { + return $this->endpoint_types; + } + + /** + * List of NAT-ted endpoint types supported by the Nat Gateway. If the list is empty, then it will be equivalent to include ENDPOINT_TYPE_VM + * Check the EndpointTypes enum for the list of possible values. + * + * Generated from protobuf field repeated string endpoint_types = 502633807; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEndpointTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->endpoint_types = $arr; + + return $this; + } + + /** + * Timeout (in seconds) for ICMP connections. Defaults to 30s if not set. + * + * Generated from protobuf field optional int32 icmp_idle_timeout_sec = 3647562; + * @return int + */ + public function getIcmpIdleTimeoutSec() + { + return isset($this->icmp_idle_timeout_sec) ? $this->icmp_idle_timeout_sec : 0; + } + + public function hasIcmpIdleTimeoutSec() + { + return isset($this->icmp_idle_timeout_sec); + } + + public function clearIcmpIdleTimeoutSec() + { + unset($this->icmp_idle_timeout_sec); + } + + /** + * Timeout (in seconds) for ICMP connections. Defaults to 30s if not set. + * + * Generated from protobuf field optional int32 icmp_idle_timeout_sec = 3647562; + * @param int $var + * @return $this + */ + public function setIcmpIdleTimeoutSec($var) + { + GPBUtil::checkInt32($var); + $this->icmp_idle_timeout_sec = $var; + + return $this; + } + + /** + * Configure logging on this NAT. + * + * Generated from protobuf field optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741; + * @return \Google\Cloud\Compute\V1\RouterNatLogConfig|null + */ + public function getLogConfig() + { + return $this->log_config; + } + + public function hasLogConfig() + { + return isset($this->log_config); + } + + public function clearLogConfig() + { + unset($this->log_config); + } + + /** + * Configure logging on this NAT. + * + * Generated from protobuf field optional .google.cloud.compute.v1.RouterNatLogConfig log_config = 351299741; + * @param \Google\Cloud\Compute\V1\RouterNatLogConfig $var + * @return $this + */ + public function setLogConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RouterNatLogConfig::class); + $this->log_config = $var; + + return $this; + } + + /** + * Maximum number of ports allocated to a VM from this NAT config when Dynamic Port Allocation is enabled. If Dynamic Port Allocation is not enabled, this field has no effect. If Dynamic Port Allocation is enabled, and this field is set, it must be set to a power of two greater than minPortsPerVm, or 64 if minPortsPerVm is not set. If Dynamic Port Allocation is enabled and this field is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. + * + * Generated from protobuf field optional int32 max_ports_per_vm = 250062049; + * @return int + */ + public function getMaxPortsPerVm() + { + return isset($this->max_ports_per_vm) ? $this->max_ports_per_vm : 0; + } + + public function hasMaxPortsPerVm() + { + return isset($this->max_ports_per_vm); + } + + public function clearMaxPortsPerVm() + { + unset($this->max_ports_per_vm); + } + + /** + * Maximum number of ports allocated to a VM from this NAT config when Dynamic Port Allocation is enabled. If Dynamic Port Allocation is not enabled, this field has no effect. If Dynamic Port Allocation is enabled, and this field is set, it must be set to a power of two greater than minPortsPerVm, or 64 if minPortsPerVm is not set. If Dynamic Port Allocation is enabled and this field is not set, a maximum of 65536 ports will be allocated to a VM from this NAT config. + * + * Generated from protobuf field optional int32 max_ports_per_vm = 250062049; + * @param int $var + * @return $this + */ + public function setMaxPortsPerVm($var) + { + GPBUtil::checkInt32($var); + $this->max_ports_per_vm = $var; + + return $this; + } + + /** + * Minimum number of ports allocated to a VM from this NAT config. If not set, a default number of ports is allocated to a VM. This is rounded up to the nearest power of 2. For example, if the value of this field is 50, at least 64 ports are allocated to a VM. + * + * Generated from protobuf field optional int32 min_ports_per_vm = 186193587; + * @return int + */ + public function getMinPortsPerVm() + { + return isset($this->min_ports_per_vm) ? $this->min_ports_per_vm : 0; + } + + public function hasMinPortsPerVm() + { + return isset($this->min_ports_per_vm); + } + + public function clearMinPortsPerVm() + { + unset($this->min_ports_per_vm); + } + + /** + * Minimum number of ports allocated to a VM from this NAT config. If not set, a default number of ports is allocated to a VM. This is rounded up to the nearest power of 2. For example, if the value of this field is 50, at least 64 ports are allocated to a VM. + * + * Generated from protobuf field optional int32 min_ports_per_vm = 186193587; + * @param int $var + * @return $this + */ + public function setMinPortsPerVm($var) + { + GPBUtil::checkInt32($var); + $this->min_ports_per_vm = $var; + + return $this; + } + + /** + * Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035. + * + * 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); + } + + /** + * Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035. + * + * 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; + } + + /** + * Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty. + * Check the NatIpAllocateOption enum for the list of possible values. + * + * Generated from protobuf field optional string nat_ip_allocate_option = 429726845; + * @return string + */ + public function getNatIpAllocateOption() + { + return isset($this->nat_ip_allocate_option) ? $this->nat_ip_allocate_option : ''; + } + + public function hasNatIpAllocateOption() + { + return isset($this->nat_ip_allocate_option); + } + + public function clearNatIpAllocateOption() + { + unset($this->nat_ip_allocate_option); + } + + /** + * Specify the NatIpAllocateOption, which can take one of the following values: - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty. + * Check the NatIpAllocateOption enum for the list of possible values. + * + * Generated from protobuf field optional string nat_ip_allocate_option = 429726845; + * @param string $var + * @return $this + */ + public function setNatIpAllocateOption($var) + { + GPBUtil::checkString($var, True); + $this->nat_ip_allocate_option = $var; + + return $this; + } + + /** + * A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project. + * + * Generated from protobuf field repeated string nat_ips = 117635086; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNatIps() + { + return $this->nat_ips; + } + + /** + * A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project. + * + * Generated from protobuf field repeated string nat_ips = 117635086; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNatIps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->nat_ips = $arr; + + return $this; + } + + /** + * A list of rules associated with this NAT. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * A list of rules associated with this NAT. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterNatRule rules = 108873975; + * @param array<\Google\Cloud\Compute\V1\RouterNatRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\RouterNatRule::class); + $this->rules = $arr; + + return $this; + } + + /** + * Specify the Nat option, which can take one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES then there should not be any other Router.Nat section in any Router for this network in this region. + * Check the SourceSubnetworkIpRangesToNat enum for the list of possible values. + * + * Generated from protobuf field optional string source_subnetwork_ip_ranges_to_nat = 252213211; + * @return string + */ + public function getSourceSubnetworkIpRangesToNat() + { + return isset($this->source_subnetwork_ip_ranges_to_nat) ? $this->source_subnetwork_ip_ranges_to_nat : ''; + } + + public function hasSourceSubnetworkIpRangesToNat() + { + return isset($this->source_subnetwork_ip_ranges_to_nat); + } + + public function clearSourceSubnetworkIpRangesToNat() + { + unset($this->source_subnetwork_ip_ranges_to_nat); + } + + /** + * Specify the Nat option, which can take one of the following values: - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES then there should not be any other Router.Nat section in any Router for this network in this region. + * Check the SourceSubnetworkIpRangesToNat enum for the list of possible values. + * + * Generated from protobuf field optional string source_subnetwork_ip_ranges_to_nat = 252213211; + * @param string $var + * @return $this + */ + public function setSourceSubnetworkIpRangesToNat($var) + { + GPBUtil::checkString($var, True); + $this->source_subnetwork_ip_ranges_to_nat = $var; + + return $this; + } + + /** + * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSubnetworks() + { + return $this->subnetworks; + } + + /** + * A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterNatSubnetworkToNat subnetworks = 415853125; + * @param array<\Google\Cloud\Compute\V1\RouterNatSubnetworkToNat>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSubnetworks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\RouterNatSubnetworkToNat::class); + $this->subnetworks = $arr; + + return $this; + } + + /** + * Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set. + * + * Generated from protobuf field optional int32 tcp_established_idle_timeout_sec = 223098349; + * @return int + */ + public function getTcpEstablishedIdleTimeoutSec() + { + return isset($this->tcp_established_idle_timeout_sec) ? $this->tcp_established_idle_timeout_sec : 0; + } + + public function hasTcpEstablishedIdleTimeoutSec() + { + return isset($this->tcp_established_idle_timeout_sec); + } + + public function clearTcpEstablishedIdleTimeoutSec() + { + unset($this->tcp_established_idle_timeout_sec); + } + + /** + * Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set. + * + * Generated from protobuf field optional int32 tcp_established_idle_timeout_sec = 223098349; + * @param int $var + * @return $this + */ + public function setTcpEstablishedIdleTimeoutSec($var) + { + GPBUtil::checkInt32($var); + $this->tcp_established_idle_timeout_sec = $var; + + return $this; + } + + /** + * Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set. + * + * Generated from protobuf field optional int32 tcp_time_wait_timeout_sec = 513596925; + * @return int + */ + public function getTcpTimeWaitTimeoutSec() + { + return isset($this->tcp_time_wait_timeout_sec) ? $this->tcp_time_wait_timeout_sec : 0; + } + + public function hasTcpTimeWaitTimeoutSec() + { + return isset($this->tcp_time_wait_timeout_sec); + } + + public function clearTcpTimeWaitTimeoutSec() + { + unset($this->tcp_time_wait_timeout_sec); + } + + /** + * Timeout (in seconds) for TCP connections that are in TIME_WAIT state. Defaults to 120s if not set. + * + * Generated from protobuf field optional int32 tcp_time_wait_timeout_sec = 513596925; + * @param int $var + * @return $this + */ + public function setTcpTimeWaitTimeoutSec($var) + { + GPBUtil::checkInt32($var); + $this->tcp_time_wait_timeout_sec = $var; + + return $this; + } + + /** + * Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set. + * + * Generated from protobuf field optional int32 tcp_transitory_idle_timeout_sec = 205028774; + * @return int + */ + public function getTcpTransitoryIdleTimeoutSec() + { + return isset($this->tcp_transitory_idle_timeout_sec) ? $this->tcp_transitory_idle_timeout_sec : 0; + } + + public function hasTcpTransitoryIdleTimeoutSec() + { + return isset($this->tcp_transitory_idle_timeout_sec); + } + + public function clearTcpTransitoryIdleTimeoutSec() + { + unset($this->tcp_transitory_idle_timeout_sec); + } + + /** + * Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set. + * + * Generated from protobuf field optional int32 tcp_transitory_idle_timeout_sec = 205028774; + * @param int $var + * @return $this + */ + public function setTcpTransitoryIdleTimeoutSec($var) + { + GPBUtil::checkInt32($var); + $this->tcp_transitory_idle_timeout_sec = $var; + + return $this; + } + + /** + * Indicates whether this NAT is used for public or private IP translation. If unspecified, it defaults to PUBLIC. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * Indicates whether this NAT is used for public or private IP translation. If unspecified, it defaults to PUBLIC. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * Timeout (in seconds) for UDP connections. Defaults to 30s if not set. + * + * Generated from protobuf field optional int32 udp_idle_timeout_sec = 64919878; + * @return int + */ + public function getUdpIdleTimeoutSec() + { + return isset($this->udp_idle_timeout_sec) ? $this->udp_idle_timeout_sec : 0; + } + + public function hasUdpIdleTimeoutSec() + { + return isset($this->udp_idle_timeout_sec); + } + + public function clearUdpIdleTimeoutSec() + { + unset($this->udp_idle_timeout_sec); + } + + /** + * Timeout (in seconds) for UDP connections. Defaults to 30s if not set. + * + * Generated from protobuf field optional int32 udp_idle_timeout_sec = 64919878; + * @param int $var + * @return $this + */ + public function setUdpIdleTimeoutSec($var) + { + GPBUtil::checkInt32($var); + $this->udp_idle_timeout_sec = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat/AutoNetworkTier.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat/AutoNetworkTier.php new file mode 100644 index 000000000000..800853e673ad --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat/AutoNetworkTier.php @@ -0,0 +1,78 @@ +google.cloud.compute.v1.RouterNat.AutoNetworkTier + */ +class AutoNetworkTier +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_AUTO_NETWORK_TIER = 0; + */ + const UNDEFINED_AUTO_NETWORK_TIER = 0; + /** + * Public internet quality with fixed bandwidth. + * + * Generated from protobuf enum FIXED_STANDARD = 310464328; + */ + const FIXED_STANDARD = 310464328; + /** + * High quality, Google-grade network tier, support for all networking products. + * + * Generated from protobuf enum PREMIUM = 399530551; + */ + const PREMIUM = 399530551; + /** + * Public internet quality, only limited support for other networking products. + * + * Generated from protobuf enum STANDARD = 484642493; + */ + const STANDARD = 484642493; + /** + * (Output only) Temporary tier for FIXED_STANDARD when fixed standard tier is expired or not configured. + * + * Generated from protobuf enum STANDARD_OVERRIDES_FIXED_STANDARD = 465847234; + */ + const STANDARD_OVERRIDES_FIXED_STANDARD = 465847234; + + private static $valueToName = [ + self::UNDEFINED_AUTO_NETWORK_TIER => 'UNDEFINED_AUTO_NETWORK_TIER', + self::FIXED_STANDARD => 'FIXED_STANDARD', + self::PREMIUM => 'PREMIUM', + self::STANDARD => 'STANDARD', + self::STANDARD_OVERRIDES_FIXED_STANDARD => 'STANDARD_OVERRIDES_FIXED_STANDARD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AutoNetworkTier::class, \Google\Cloud\Compute\V1\RouterNat_AutoNetworkTier::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat/EndpointTypes.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat/EndpointTypes.php new file mode 100644 index 000000000000..408c60da5d88 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat/EndpointTypes.php @@ -0,0 +1,70 @@ +google.cloud.compute.v1.RouterNat.EndpointTypes + */ +class EndpointTypes +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ENDPOINT_TYPES = 0; + */ + const UNDEFINED_ENDPOINT_TYPES = 0; + /** + * This is used for regional Application Load Balancers (internal and external) and regional proxy Network Load Balancers (internal and external) endpoints. + * + * Generated from protobuf enum ENDPOINT_TYPE_MANAGED_PROXY_LB = 439196930; + */ + const ENDPOINT_TYPE_MANAGED_PROXY_LB = 439196930; + /** + * This is used for Secure Web Gateway endpoints. + * + * Generated from protobuf enum ENDPOINT_TYPE_SWG = 159344456; + */ + const ENDPOINT_TYPE_SWG = 159344456; + /** + * This is the default. + * + * Generated from protobuf enum ENDPOINT_TYPE_VM = 57095474; + */ + const ENDPOINT_TYPE_VM = 57095474; + + private static $valueToName = [ + self::UNDEFINED_ENDPOINT_TYPES => 'UNDEFINED_ENDPOINT_TYPES', + self::ENDPOINT_TYPE_MANAGED_PROXY_LB => 'ENDPOINT_TYPE_MANAGED_PROXY_LB', + self::ENDPOINT_TYPE_SWG => 'ENDPOINT_TYPE_SWG', + self::ENDPOINT_TYPE_VM => 'ENDPOINT_TYPE_VM', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(EndpointTypes::class, \Google\Cloud\Compute\V1\RouterNat_EndpointTypes::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat/NatIpAllocateOption.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat/NatIpAllocateOption.php new file mode 100644 index 000000000000..929715a3a031 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat/NatIpAllocateOption.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.RouterNat.NatIpAllocateOption + */ +class NatIpAllocateOption +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_NAT_IP_ALLOCATE_OPTION = 0; + */ + const UNDEFINED_NAT_IP_ALLOCATE_OPTION = 0; + /** + * Nat IPs are allocated by GCP; customers can not specify any Nat IPs. + * + * Generated from protobuf enum AUTO_ONLY = 182333500; + */ + const AUTO_ONLY = 182333500; + /** + * Only use Nat IPs provided by customers. When specified Nat IPs are not enough then the Nat service fails for new VMs. + * + * Generated from protobuf enum MANUAL_ONLY = 261251205; + */ + const MANUAL_ONLY = 261251205; + + private static $valueToName = [ + self::UNDEFINED_NAT_IP_ALLOCATE_OPTION => 'UNDEFINED_NAT_IP_ALLOCATE_OPTION', + self::AUTO_ONLY => 'AUTO_ONLY', + self::MANUAL_ONLY => 'MANUAL_ONLY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NatIpAllocateOption::class, \Google\Cloud\Compute\V1\RouterNat_NatIpAllocateOption::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat/SourceSubnetworkIpRangesToNat.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat/SourceSubnetworkIpRangesToNat.php new file mode 100644 index 000000000000..4b31ff89cfd4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat/SourceSubnetworkIpRangesToNat.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.RouterNat.SourceSubnetworkIpRangesToNat + */ +class SourceSubnetworkIpRangesToNat +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_SOURCE_SUBNETWORK_IP_RANGES_TO_NAT = 0; + */ + const UNDEFINED_SOURCE_SUBNETWORK_IP_RANGES_TO_NAT = 0; + /** + * All the IP ranges in every Subnetwork are allowed to Nat. + * + * Generated from protobuf enum ALL_SUBNETWORKS_ALL_IP_RANGES = 179964376; + */ + const ALL_SUBNETWORKS_ALL_IP_RANGES = 179964376; + /** + * All the primary IP ranges in every Subnetwork are allowed to Nat. + * + * Generated from protobuf enum ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES = 185573819; + */ + const ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES = 185573819; + /** + * A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) + * + * Generated from protobuf enum LIST_OF_SUBNETWORKS = 517542270; + */ + const LIST_OF_SUBNETWORKS = 517542270; + + private static $valueToName = [ + self::UNDEFINED_SOURCE_SUBNETWORK_IP_RANGES_TO_NAT => 'UNDEFINED_SOURCE_SUBNETWORK_IP_RANGES_TO_NAT', + self::ALL_SUBNETWORKS_ALL_IP_RANGES => 'ALL_SUBNETWORKS_ALL_IP_RANGES', + self::ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES => 'ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES', + self::LIST_OF_SUBNETWORKS => 'LIST_OF_SUBNETWORKS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SourceSubnetworkIpRangesToNat::class, \Google\Cloud\Compute\V1\RouterNat_SourceSubnetworkIpRangesToNat::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat/Type.php new file mode 100644 index 000000000000..a9227d6691c0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNat/Type.php @@ -0,0 +1,68 @@ +google.cloud.compute.v1.RouterNat.Type + */ +class Type +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TYPE = 0; + */ + const UNDEFINED_TYPE = 0; + /** + * NAT used for private IP translation. + * + * Generated from protobuf enum PRIVATE = 403485027; + */ + const PBPRIVATE = 403485027; + /** + * NAT used for public IP translation. This is the default. + * + * Generated from protobuf enum PUBLIC = 223389289; + */ + const PBPUBLIC = 223389289; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::PBPRIVATE => 'PRIVATE', + self::PBPUBLIC => 'PUBLIC', + ]; + + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Compute\V1\RouterNat_Type::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatLogConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatLogConfig.php new file mode 100644 index 000000000000..648fda471b86 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatLogConfig.php @@ -0,0 +1,125 @@ +google.cloud.compute.v1.RouterNatLogConfig + */ +class RouterNatLogConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates whether or not to export logs. This is false by default. + * + * Generated from protobuf field optional bool enable = 311764355; + */ + protected $enable = null; + /** + * Specify the desired filtering of logs on this NAT. If unspecified, logs are exported for all connections handled by this NAT. This option can take one of the following values: - ERRORS_ONLY: Export logs only for connection failures. - TRANSLATIONS_ONLY: Export logs only for successful connections. - ALL: Export logs for all connections, successful and unsuccessful. + * Check the Filter enum for the list of possible values. + * + * Generated from protobuf field optional string filter = 336120696; + */ + protected $filter = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable + * Indicates whether or not to export logs. This is false by default. + * @type string $filter + * Specify the desired filtering of logs on this NAT. If unspecified, logs are exported for all connections handled by this NAT. This option can take one of the following values: - ERRORS_ONLY: Export logs only for connection failures. - TRANSLATIONS_ONLY: Export logs only for successful connections. - ALL: Export logs for all connections, successful and unsuccessful. + * Check the Filter enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Indicates whether or not to export logs. This is false by default. + * + * Generated from protobuf field optional bool enable = 311764355; + * @return bool + */ + public function getEnable() + { + return isset($this->enable) ? $this->enable : false; + } + + public function hasEnable() + { + return isset($this->enable); + } + + public function clearEnable() + { + unset($this->enable); + } + + /** + * Indicates whether or not to export logs. This is false by default. + * + * Generated from protobuf field optional bool enable = 311764355; + * @param bool $var + * @return $this + */ + public function setEnable($var) + { + GPBUtil::checkBool($var); + $this->enable = $var; + + return $this; + } + + /** + * Specify the desired filtering of logs on this NAT. If unspecified, logs are exported for all connections handled by this NAT. This option can take one of the following values: - ERRORS_ONLY: Export logs only for connection failures. - TRANSLATIONS_ONLY: Export logs only for successful connections. - ALL: Export logs for all connections, successful and unsuccessful. + * Check the Filter enum for the list of possible values. + * + * 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); + } + + /** + * Specify the desired filtering of logs on this NAT. If unspecified, logs are exported for all connections handled by this NAT. This option can take one of the following values: - ERRORS_ONLY: Export logs only for connection failures. - TRANSLATIONS_ONLY: Export logs only for successful connections. - ALL: Export logs for all connections, successful and unsuccessful. + * Check the Filter enum for the list of possible values. + * + * 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatLogConfig/Filter.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatLogConfig/Filter.php new file mode 100644 index 000000000000..4a062b43db00 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatLogConfig/Filter.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.RouterNatLogConfig.Filter + */ +class Filter +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_FILTER = 0; + */ + const UNDEFINED_FILTER = 0; + /** + * Export logs for all (successful and unsuccessful) connections. + * + * Generated from protobuf enum ALL = 64897; + */ + const ALL = 64897; + /** + * Export logs for connection failures only. + * + * Generated from protobuf enum ERRORS_ONLY = 307484672; + */ + const ERRORS_ONLY = 307484672; + /** + * Export logs for successful connections only. + * + * Generated from protobuf enum TRANSLATIONS_ONLY = 357212649; + */ + const TRANSLATIONS_ONLY = 357212649; + + private static $valueToName = [ + self::UNDEFINED_FILTER => 'UNDEFINED_FILTER', + self::ALL => 'ALL', + self::ERRORS_ONLY => 'ERRORS_ONLY', + self::TRANSLATIONS_ONLY => 'TRANSLATIONS_ONLY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Filter::class, \Google\Cloud\Compute\V1\RouterNatLogConfig_Filter::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatRule.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatRule.php new file mode 100644 index 000000000000..3e2ca351ab31 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatRule.php @@ -0,0 +1,208 @@ +google.cloud.compute.v1.RouterNatRule + */ +class RouterNatRule extends \Google\Protobuf\Internal\Message +{ + /** + * The action to be enforced for traffic that matches this rule. + * + * Generated from protobuf field optional .google.cloud.compute.v1.RouterNatRuleAction action = 187661878; + */ + protected $action = null; + /** + * An optional description of this rule. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. If it evaluates to true, the corresponding `action` is enforced. The following examples are valid match expressions for public NAT: "inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')" "destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'" The following example is a valid match expression for private NAT: "nexthop.hub == '//networkconnectivity.googleapis.com/projects/my-project/locations/global/hubs/hub-1'" + * + * Generated from protobuf field optional string match = 103668165; + */ + protected $match = null; + /** + * An integer uniquely identifying a rule in the list. The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT. + * + * Generated from protobuf field optional uint32 rule_number = 535211500; + */ + protected $rule_number = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\RouterNatRuleAction $action + * The action to be enforced for traffic that matches this rule. + * @type string $description + * An optional description of this rule. + * @type string $match + * CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. If it evaluates to true, the corresponding `action` is enforced. The following examples are valid match expressions for public NAT: "inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')" "destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'" The following example is a valid match expression for private NAT: "nexthop.hub == '//networkconnectivity.googleapis.com/projects/my-project/locations/global/hubs/hub-1'" + * @type int $rule_number + * An integer uniquely identifying a rule in the list. The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The action to be enforced for traffic that matches this rule. + * + * Generated from protobuf field optional .google.cloud.compute.v1.RouterNatRuleAction action = 187661878; + * @return \Google\Cloud\Compute\V1\RouterNatRuleAction|null + */ + public function getAction() + { + return $this->action; + } + + public function hasAction() + { + return isset($this->action); + } + + public function clearAction() + { + unset($this->action); + } + + /** + * The action to be enforced for traffic that matches this rule. + * + * Generated from protobuf field optional .google.cloud.compute.v1.RouterNatRuleAction action = 187661878; + * @param \Google\Cloud\Compute\V1\RouterNatRuleAction $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RouterNatRuleAction::class); + $this->action = $var; + + return $this; + } + + /** + * An optional description of this rule. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this rule. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. If it evaluates to true, the corresponding `action` is enforced. The following examples are valid match expressions for public NAT: "inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')" "destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'" The following example is a valid match expression for private NAT: "nexthop.hub == '//networkconnectivity.googleapis.com/projects/my-project/locations/global/hubs/hub-1'" + * + * Generated from protobuf field optional string match = 103668165; + * @return string + */ + public function getMatch() + { + return isset($this->match) ? $this->match : ''; + } + + public function hasMatch() + { + return isset($this->match); + } + + public function clearMatch() + { + unset($this->match); + } + + /** + * CEL expression that specifies the match condition that egress traffic from a VM is evaluated against. If it evaluates to true, the corresponding `action` is enforced. The following examples are valid match expressions for public NAT: "inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')" "destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'" The following example is a valid match expression for private NAT: "nexthop.hub == '//networkconnectivity.googleapis.com/projects/my-project/locations/global/hubs/hub-1'" + * + * Generated from protobuf field optional string match = 103668165; + * @param string $var + * @return $this + */ + public function setMatch($var) + { + GPBUtil::checkString($var, True); + $this->match = $var; + + return $this; + } + + /** + * An integer uniquely identifying a rule in the list. The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT. + * + * Generated from protobuf field optional uint32 rule_number = 535211500; + * @return int + */ + public function getRuleNumber() + { + return isset($this->rule_number) ? $this->rule_number : 0; + } + + public function hasRuleNumber() + { + return isset($this->rule_number); + } + + public function clearRuleNumber() + { + unset($this->rule_number); + } + + /** + * An integer uniquely identifying a rule in the list. The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT. + * + * Generated from protobuf field optional uint32 rule_number = 535211500; + * @param int $var + * @return $this + */ + public function setRuleNumber($var) + { + GPBUtil::checkUint32($var); + $this->rule_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatRuleAction.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatRuleAction.php new file mode 100644 index 000000000000..9df7747c7cde --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatRuleAction.php @@ -0,0 +1,168 @@ +google.cloud.compute.v1.RouterNatRuleAction + */ +class RouterNatRuleAction extends \Google\Protobuf\Internal\Message +{ + /** + * A list of URLs of the IP resources used for this NAT rule. These IP addresses must be valid static external IP addresses assigned to the project. This field is used for public NAT. + * + * Generated from protobuf field repeated string source_nat_active_ips = 210378229; + */ + private $source_nat_active_ips; + /** + * A list of URLs of the subnetworks used as source ranges for this NAT Rule. These subnetworks must have purpose set to PRIVATE_NAT. This field is used for private NAT. + * + * Generated from protobuf field repeated string source_nat_active_ranges = 190556269; + */ + private $source_nat_active_ranges; + /** + * A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT rule only. This field is used for public NAT. + * + * Generated from protobuf field repeated string source_nat_drain_ips = 340812451; + */ + private $source_nat_drain_ips; + /** + * A list of URLs of subnetworks representing source ranges to be drained. This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. This field is used for private NAT. + * + * Generated from protobuf field repeated string source_nat_drain_ranges = 84802815; + */ + private $source_nat_drain_ranges; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $source_nat_active_ips + * A list of URLs of the IP resources used for this NAT rule. These IP addresses must be valid static external IP addresses assigned to the project. This field is used for public NAT. + * @type array|\Google\Protobuf\Internal\RepeatedField $source_nat_active_ranges + * A list of URLs of the subnetworks used as source ranges for this NAT Rule. These subnetworks must have purpose set to PRIVATE_NAT. This field is used for private NAT. + * @type array|\Google\Protobuf\Internal\RepeatedField $source_nat_drain_ips + * A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT rule only. This field is used for public NAT. + * @type array|\Google\Protobuf\Internal\RepeatedField $source_nat_drain_ranges + * A list of URLs of subnetworks representing source ranges to be drained. This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. This field is used for private NAT. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of URLs of the IP resources used for this NAT rule. These IP addresses must be valid static external IP addresses assigned to the project. This field is used for public NAT. + * + * Generated from protobuf field repeated string source_nat_active_ips = 210378229; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSourceNatActiveIps() + { + return $this->source_nat_active_ips; + } + + /** + * A list of URLs of the IP resources used for this NAT rule. These IP addresses must be valid static external IP addresses assigned to the project. This field is used for public NAT. + * + * Generated from protobuf field repeated string source_nat_active_ips = 210378229; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSourceNatActiveIps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->source_nat_active_ips = $arr; + + return $this; + } + + /** + * A list of URLs of the subnetworks used as source ranges for this NAT Rule. These subnetworks must have purpose set to PRIVATE_NAT. This field is used for private NAT. + * + * Generated from protobuf field repeated string source_nat_active_ranges = 190556269; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSourceNatActiveRanges() + { + return $this->source_nat_active_ranges; + } + + /** + * A list of URLs of the subnetworks used as source ranges for this NAT Rule. These subnetworks must have purpose set to PRIVATE_NAT. This field is used for private NAT. + * + * Generated from protobuf field repeated string source_nat_active_ranges = 190556269; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSourceNatActiveRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->source_nat_active_ranges = $arr; + + return $this; + } + + /** + * A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT rule only. This field is used for public NAT. + * + * Generated from protobuf field repeated string source_nat_drain_ips = 340812451; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSourceNatDrainIps() + { + return $this->source_nat_drain_ips; + } + + /** + * A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT rule only. This field is used for public NAT. + * + * Generated from protobuf field repeated string source_nat_drain_ips = 340812451; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSourceNatDrainIps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->source_nat_drain_ips = $arr; + + return $this; + } + + /** + * A list of URLs of subnetworks representing source ranges to be drained. This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. This field is used for private NAT. + * + * Generated from protobuf field repeated string source_nat_drain_ranges = 84802815; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSourceNatDrainRanges() + { + return $this->source_nat_drain_ranges; + } + + /** + * A list of URLs of subnetworks representing source ranges to be drained. This is only supported on patch/update, and these subnetworks must have previously been used as active ranges in this NAT Rule. This field is used for private NAT. + * + * Generated from protobuf field repeated string source_nat_drain_ranges = 84802815; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSourceNatDrainRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->source_nat_drain_ranges = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatSubnetworkToNat.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatSubnetworkToNat.php new file mode 100644 index 000000000000..56e602a397d4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatSubnetworkToNat.php @@ -0,0 +1,149 @@ +google.cloud.compute.v1.RouterNatSubnetworkToNat + */ +class RouterNatSubnetworkToNat extends \Google\Protobuf\Internal\Message +{ + /** + * URL for the subnetwork resource that will use NAT. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * A list of the secondary ranges of the Subnetwork that are allowed to use NAT. This can be populated only if "LIST_OF_SECONDARY_IP_RANGES" is one of the values in source_ip_ranges_to_nat. + * + * Generated from protobuf field repeated string secondary_ip_range_names = 264315097; + */ + private $secondary_ip_range_names; + /** + * Specify the options for NAT ranges in the Subnetwork. All options of a single value are valid except NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid option with multiple values is: ["PRIMARY_IP_RANGE", "LIST_OF_SECONDARY_IP_RANGES"] Default: [ALL_IP_RANGES] + * Check the SourceIpRangesToNat enum for the list of possible values. + * + * Generated from protobuf field repeated string source_ip_ranges_to_nat = 388310386; + */ + private $source_ip_ranges_to_nat; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * URL for the subnetwork resource that will use NAT. + * @type array|\Google\Protobuf\Internal\RepeatedField $secondary_ip_range_names + * A list of the secondary ranges of the Subnetwork that are allowed to use NAT. This can be populated only if "LIST_OF_SECONDARY_IP_RANGES" is one of the values in source_ip_ranges_to_nat. + * @type array|\Google\Protobuf\Internal\RepeatedField $source_ip_ranges_to_nat + * Specify the options for NAT ranges in the Subnetwork. All options of a single value are valid except NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid option with multiple values is: ["PRIMARY_IP_RANGE", "LIST_OF_SECONDARY_IP_RANGES"] Default: [ALL_IP_RANGES] + * Check the SourceIpRangesToNat enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * URL for the subnetwork resource that will use NAT. + * + * 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); + } + + /** + * URL for the subnetwork resource that will use NAT. + * + * 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; + } + + /** + * A list of the secondary ranges of the Subnetwork that are allowed to use NAT. This can be populated only if "LIST_OF_SECONDARY_IP_RANGES" is one of the values in source_ip_ranges_to_nat. + * + * Generated from protobuf field repeated string secondary_ip_range_names = 264315097; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSecondaryIpRangeNames() + { + return $this->secondary_ip_range_names; + } + + /** + * A list of the secondary ranges of the Subnetwork that are allowed to use NAT. This can be populated only if "LIST_OF_SECONDARY_IP_RANGES" is one of the values in source_ip_ranges_to_nat. + * + * Generated from protobuf field repeated string secondary_ip_range_names = 264315097; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSecondaryIpRangeNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->secondary_ip_range_names = $arr; + + return $this; + } + + /** + * Specify the options for NAT ranges in the Subnetwork. All options of a single value are valid except NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid option with multiple values is: ["PRIMARY_IP_RANGE", "LIST_OF_SECONDARY_IP_RANGES"] Default: [ALL_IP_RANGES] + * Check the SourceIpRangesToNat enum for the list of possible values. + * + * Generated from protobuf field repeated string source_ip_ranges_to_nat = 388310386; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSourceIpRangesToNat() + { + return $this->source_ip_ranges_to_nat; + } + + /** + * Specify the options for NAT ranges in the Subnetwork. All options of a single value are valid except NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid option with multiple values is: ["PRIMARY_IP_RANGE", "LIST_OF_SECONDARY_IP_RANGES"] Default: [ALL_IP_RANGES] + * Check the SourceIpRangesToNat enum for the list of possible values. + * + * Generated from protobuf field repeated string source_ip_ranges_to_nat = 388310386; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSourceIpRangesToNat($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->source_ip_ranges_to_nat = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatSubnetworkToNat/SourceIpRangesToNat.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatSubnetworkToNat/SourceIpRangesToNat.php new file mode 100644 index 000000000000..55489f4c3f8e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterNatSubnetworkToNat/SourceIpRangesToNat.php @@ -0,0 +1,70 @@ +google.cloud.compute.v1.RouterNatSubnetworkToNat.SourceIpRangesToNat + */ +class SourceIpRangesToNat +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_SOURCE_IP_RANGES_TO_NAT = 0; + */ + const UNDEFINED_SOURCE_IP_RANGES_TO_NAT = 0; + /** + * The primary and all the secondary ranges are allowed to Nat. + * + * Generated from protobuf enum ALL_IP_RANGES = 35608496; + */ + const ALL_IP_RANGES = 35608496; + /** + * A list of secondary ranges are allowed to Nat. + * + * Generated from protobuf enum LIST_OF_SECONDARY_IP_RANGES = 192289308; + */ + const LIST_OF_SECONDARY_IP_RANGES = 192289308; + /** + * The primary range is allowed to Nat. + * + * Generated from protobuf enum PRIMARY_IP_RANGE = 297109954; + */ + const PRIMARY_IP_RANGE = 297109954; + + private static $valueToName = [ + self::UNDEFINED_SOURCE_IP_RANGES_TO_NAT => 'UNDEFINED_SOURCE_IP_RANGES_TO_NAT', + self::ALL_IP_RANGES => 'ALL_IP_RANGES', + self::LIST_OF_SECONDARY_IP_RANGES => 'LIST_OF_SECONDARY_IP_RANGES', + self::PRIMARY_IP_RANGE => 'PRIMARY_IP_RANGE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SourceIpRangesToNat::class, \Google\Cloud\Compute\V1\RouterNatSubnetworkToNat_SourceIpRangesToNat::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatus.php new file mode 100644 index 000000000000..9c019b5bf4fc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatus.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.RouterStatus + */ +class RouterStatus extends \Google\Protobuf\Internal\Message +{ + /** + * Best routes for this router's network. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Route best_routes = 395826693; + */ + private $best_routes; + /** + * Best routes learned by this router. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Route best_routes_for_router = 119389689; + */ + private $best_routes_for_router; + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterStatusBgpPeerStatus bgp_peer_status = 218459131; + */ + private $bgp_peer_status; + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterStatusNatStatus nat_status = 63098064; + */ + private $nat_status; + /** + * URI of the network to which this router belongs. + * + * Generated from protobuf field optional string network = 232872494; + */ + protected $network = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\Route>|\Google\Protobuf\Internal\RepeatedField $best_routes + * Best routes for this router's network. + * @type array<\Google\Cloud\Compute\V1\Route>|\Google\Protobuf\Internal\RepeatedField $best_routes_for_router + * Best routes learned by this router. + * @type array<\Google\Cloud\Compute\V1\RouterStatusBgpPeerStatus>|\Google\Protobuf\Internal\RepeatedField $bgp_peer_status + * @type array<\Google\Cloud\Compute\V1\RouterStatusNatStatus>|\Google\Protobuf\Internal\RepeatedField $nat_status + * @type string $network + * URI of the network to which this router belongs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Best routes for this router's network. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Route best_routes = 395826693; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBestRoutes() + { + return $this->best_routes; + } + + /** + * Best routes for this router's network. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Route best_routes = 395826693; + * @param array<\Google\Cloud\Compute\V1\Route>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBestRoutes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Route::class); + $this->best_routes = $arr; + + return $this; + } + + /** + * Best routes learned by this router. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Route best_routes_for_router = 119389689; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBestRoutesForRouter() + { + return $this->best_routes_for_router; + } + + /** + * Best routes learned by this router. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Route best_routes_for_router = 119389689; + * @param array<\Google\Cloud\Compute\V1\Route>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBestRoutesForRouter($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Route::class); + $this->best_routes_for_router = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterStatusBgpPeerStatus bgp_peer_status = 218459131; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBgpPeerStatus() + { + return $this->bgp_peer_status; + } + + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterStatusBgpPeerStatus bgp_peer_status = 218459131; + * @param array<\Google\Cloud\Compute\V1\RouterStatusBgpPeerStatus>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBgpPeerStatus($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\RouterStatusBgpPeerStatus::class); + $this->bgp_peer_status = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterStatusNatStatus nat_status = 63098064; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNatStatus() + { + return $this->nat_status; + } + + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterStatusNatStatus nat_status = 63098064; + * @param array<\Google\Cloud\Compute\V1\RouterStatusNatStatus>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNatStatus($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\RouterStatusNatStatus::class); + $this->nat_status = $arr; + + return $this; + } + + /** + * URI of the network to which this router belongs. + * + * Generated from protobuf field optional string network = 232872494; + * @return string + */ + public function getNetwork() + { + return isset($this->network) ? $this->network : ''; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * URI of the network to which this router belongs. + * + * Generated from protobuf field optional string network = 232872494; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusBgpPeerStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusBgpPeerStatus.php new file mode 100644 index 000000000000..d1aa5973107a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusBgpPeerStatus.php @@ -0,0 +1,903 @@ +google.cloud.compute.v1.RouterStatusBgpPeerStatus + */ +class RouterStatusBgpPeerStatus extends \Google\Protobuf\Internal\Message +{ + /** + * Routes that were advertised to the remote BGP peer + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Route advertised_routes = 333393068; + */ + private $advertised_routes; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.BfdStatus bfd_status = 395631729; + */ + protected $bfd_status = null; + /** + * Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4. + * + * Generated from protobuf field optional bool enable_ipv4 = 181467937; + */ + protected $enable_ipv4 = null; + /** + * Enable IPv6 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 6. + * + * Generated from protobuf field optional bool enable_ipv6 = 181467939; + */ + protected $enable_ipv6 = null; + /** + * IP address of the local BGP interface. + * + * Generated from protobuf field optional string ip_address = 406272220; + */ + protected $ip_address = null; + /** + * IPv4 address of the local BGP interface. + * + * Generated from protobuf field optional string ipv4_nexthop_address = 5703377; + */ + protected $ipv4_nexthop_address = null; + /** + * IPv6 address of the local BGP interface. + * + * Generated from protobuf field optional string ipv6_nexthop_address = 27968211; + */ + protected $ipv6_nexthop_address = null; + /** + * URL of the VPN tunnel that this BGP peer controls. + * + * Generated from protobuf field optional string linked_vpn_tunnel = 352296953; + */ + protected $linked_vpn_tunnel = null; + /** + * Informs whether MD5 authentication is enabled on this BGP peer. + * + * Generated from protobuf field optional bool md5_auth_enabled = 451152075; + */ + protected $md5_auth_enabled = null; + /** + * Name of this BGP peer. Unique within the Routers resource. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Number of routes learned from the remote BGP Peer. + * + * Generated from protobuf field optional uint32 num_learned_routes = 135457535; + */ + protected $num_learned_routes = null; + /** + * IP address of the remote BGP interface. + * + * Generated from protobuf field optional string peer_ip_address = 207735769; + */ + protected $peer_ip_address = null; + /** + * IPv4 address of the remote BGP interface. + * + * Generated from protobuf field optional string peer_ipv4_nexthop_address = 469221774; + */ + protected $peer_ipv4_nexthop_address = null; + /** + * IPv6 address of the remote BGP interface. + * + * Generated from protobuf field optional string peer_ipv6_nexthop_address = 491486608; + */ + protected $peer_ipv6_nexthop_address = null; + /** + * [Output only] URI of the VM instance that is used as third-party router appliances such as Next Gen Firewalls, Virtual Routers, or Router Appliances. The VM instance is the peer side of the BGP session. + * + * Generated from protobuf field optional string router_appliance_instance = 468312989; + */ + protected $router_appliance_instance = null; + /** + * The state of the BGP session. For a list of possible values for this field, see BGP session states. + * + * Generated from protobuf field optional string state = 109757585; + */ + protected $state = null; + /** + * Status of the BGP peer: {UP, DOWN} + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + /** + * Indicates why particular status was returned. + * Check the StatusReason enum for the list of possible values. + * + * Generated from protobuf field optional string status_reason = 342706993; + */ + protected $status_reason = null; + /** + * Time this session has been up. Format: 14 years, 51 weeks, 6 days, 23 hours, 59 minutes, 59 seconds + * + * Generated from protobuf field optional string uptime = 235379688; + */ + protected $uptime = null; + /** + * Time this session has been up, in seconds. Format: 145 + * + * Generated from protobuf field optional string uptime_seconds = 104736040; + */ + protected $uptime_seconds = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\Route>|\Google\Protobuf\Internal\RepeatedField $advertised_routes + * Routes that were advertised to the remote BGP peer + * @type \Google\Cloud\Compute\V1\BfdStatus $bfd_status + * @type bool $enable_ipv4 + * Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4. + * @type bool $enable_ipv6 + * Enable IPv6 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 6. + * @type string $ip_address + * IP address of the local BGP interface. + * @type string $ipv4_nexthop_address + * IPv4 address of the local BGP interface. + * @type string $ipv6_nexthop_address + * IPv6 address of the local BGP interface. + * @type string $linked_vpn_tunnel + * URL of the VPN tunnel that this BGP peer controls. + * @type bool $md5_auth_enabled + * Informs whether MD5 authentication is enabled on this BGP peer. + * @type string $name + * Name of this BGP peer. Unique within the Routers resource. + * @type int $num_learned_routes + * Number of routes learned from the remote BGP Peer. + * @type string $peer_ip_address + * IP address of the remote BGP interface. + * @type string $peer_ipv4_nexthop_address + * IPv4 address of the remote BGP interface. + * @type string $peer_ipv6_nexthop_address + * IPv6 address of the remote BGP interface. + * @type string $router_appliance_instance + * [Output only] URI of the VM instance that is used as third-party router appliances such as Next Gen Firewalls, Virtual Routers, or Router Appliances. The VM instance is the peer side of the BGP session. + * @type string $state + * The state of the BGP session. For a list of possible values for this field, see BGP session states. + * @type string $status + * Status of the BGP peer: {UP, DOWN} + * Check the Status enum for the list of possible values. + * @type string $status_reason + * Indicates why particular status was returned. + * Check the StatusReason enum for the list of possible values. + * @type string $uptime + * Time this session has been up. Format: 14 years, 51 weeks, 6 days, 23 hours, 59 minutes, 59 seconds + * @type string $uptime_seconds + * Time this session has been up, in seconds. Format: 145 + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Routes that were advertised to the remote BGP peer + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Route advertised_routes = 333393068; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdvertisedRoutes() + { + return $this->advertised_routes; + } + + /** + * Routes that were advertised to the remote BGP peer + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Route advertised_routes = 333393068; + * @param array<\Google\Cloud\Compute\V1\Route>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdvertisedRoutes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Route::class); + $this->advertised_routes = $arr; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.BfdStatus bfd_status = 395631729; + * @return \Google\Cloud\Compute\V1\BfdStatus|null + */ + public function getBfdStatus() + { + return $this->bfd_status; + } + + public function hasBfdStatus() + { + return isset($this->bfd_status); + } + + public function clearBfdStatus() + { + unset($this->bfd_status); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.BfdStatus bfd_status = 395631729; + * @param \Google\Cloud\Compute\V1\BfdStatus $var + * @return $this + */ + public function setBfdStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BfdStatus::class); + $this->bfd_status = $var; + + return $this; + } + + /** + * Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4. + * + * Generated from protobuf field optional bool enable_ipv4 = 181467937; + * @return bool + */ + public function getEnableIpv4() + { + return isset($this->enable_ipv4) ? $this->enable_ipv4 : false; + } + + public function hasEnableIpv4() + { + return isset($this->enable_ipv4); + } + + public function clearEnableIpv4() + { + unset($this->enable_ipv4); + } + + /** + * Enable IPv4 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 4. + * + * Generated from protobuf field optional bool enable_ipv4 = 181467937; + * @param bool $var + * @return $this + */ + public function setEnableIpv4($var) + { + GPBUtil::checkBool($var); + $this->enable_ipv4 = $var; + + return $this; + } + + /** + * Enable IPv6 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 6. + * + * Generated from protobuf field optional bool enable_ipv6 = 181467939; + * @return bool + */ + public function getEnableIpv6() + { + return isset($this->enable_ipv6) ? $this->enable_ipv6 : false; + } + + public function hasEnableIpv6() + { + return isset($this->enable_ipv6); + } + + public function clearEnableIpv6() + { + unset($this->enable_ipv6); + } + + /** + * Enable IPv6 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 6. + * + * Generated from protobuf field optional bool enable_ipv6 = 181467939; + * @param bool $var + * @return $this + */ + public function setEnableIpv6($var) + { + GPBUtil::checkBool($var); + $this->enable_ipv6 = $var; + + return $this; + } + + /** + * IP address of the local BGP interface. + * + * Generated from protobuf field optional string ip_address = 406272220; + * @return string + */ + public function getIpAddress() + { + return isset($this->ip_address) ? $this->ip_address : ''; + } + + public function hasIpAddress() + { + return isset($this->ip_address); + } + + public function clearIpAddress() + { + unset($this->ip_address); + } + + /** + * IP address of the local BGP interface. + * + * Generated from protobuf field optional string ip_address = 406272220; + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + + /** + * IPv4 address of the local BGP interface. + * + * Generated from protobuf field optional string ipv4_nexthop_address = 5703377; + * @return string + */ + public function getIpv4NexthopAddress() + { + return isset($this->ipv4_nexthop_address) ? $this->ipv4_nexthop_address : ''; + } + + public function hasIpv4NexthopAddress() + { + return isset($this->ipv4_nexthop_address); + } + + public function clearIpv4NexthopAddress() + { + unset($this->ipv4_nexthop_address); + } + + /** + * IPv4 address of the local BGP interface. + * + * Generated from protobuf field optional string ipv4_nexthop_address = 5703377; + * @param string $var + * @return $this + */ + public function setIpv4NexthopAddress($var) + { + GPBUtil::checkString($var, True); + $this->ipv4_nexthop_address = $var; + + return $this; + } + + /** + * IPv6 address of the local BGP interface. + * + * Generated from protobuf field optional string ipv6_nexthop_address = 27968211; + * @return string + */ + public function getIpv6NexthopAddress() + { + return isset($this->ipv6_nexthop_address) ? $this->ipv6_nexthop_address : ''; + } + + public function hasIpv6NexthopAddress() + { + return isset($this->ipv6_nexthop_address); + } + + public function clearIpv6NexthopAddress() + { + unset($this->ipv6_nexthop_address); + } + + /** + * IPv6 address of the local BGP interface. + * + * Generated from protobuf field optional string ipv6_nexthop_address = 27968211; + * @param string $var + * @return $this + */ + public function setIpv6NexthopAddress($var) + { + GPBUtil::checkString($var, True); + $this->ipv6_nexthop_address = $var; + + return $this; + } + + /** + * URL of the VPN tunnel that this BGP peer controls. + * + * Generated from protobuf field optional string linked_vpn_tunnel = 352296953; + * @return string + */ + public function getLinkedVpnTunnel() + { + return isset($this->linked_vpn_tunnel) ? $this->linked_vpn_tunnel : ''; + } + + public function hasLinkedVpnTunnel() + { + return isset($this->linked_vpn_tunnel); + } + + public function clearLinkedVpnTunnel() + { + unset($this->linked_vpn_tunnel); + } + + /** + * URL of the VPN tunnel that this BGP peer controls. + * + * Generated from protobuf field optional string linked_vpn_tunnel = 352296953; + * @param string $var + * @return $this + */ + public function setLinkedVpnTunnel($var) + { + GPBUtil::checkString($var, True); + $this->linked_vpn_tunnel = $var; + + return $this; + } + + /** + * Informs whether MD5 authentication is enabled on this BGP peer. + * + * Generated from protobuf field optional bool md5_auth_enabled = 451152075; + * @return bool + */ + public function getMd5AuthEnabled() + { + return isset($this->md5_auth_enabled) ? $this->md5_auth_enabled : false; + } + + public function hasMd5AuthEnabled() + { + return isset($this->md5_auth_enabled); + } + + public function clearMd5AuthEnabled() + { + unset($this->md5_auth_enabled); + } + + /** + * Informs whether MD5 authentication is enabled on this BGP peer. + * + * Generated from protobuf field optional bool md5_auth_enabled = 451152075; + * @param bool $var + * @return $this + */ + public function setMd5AuthEnabled($var) + { + GPBUtil::checkBool($var); + $this->md5_auth_enabled = $var; + + return $this; + } + + /** + * Name of this BGP peer. Unique within the Routers resource. + * + * 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); + } + + /** + * Name of this BGP peer. Unique within the Routers resource. + * + * 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; + } + + /** + * Number of routes learned from the remote BGP Peer. + * + * Generated from protobuf field optional uint32 num_learned_routes = 135457535; + * @return int + */ + public function getNumLearnedRoutes() + { + return isset($this->num_learned_routes) ? $this->num_learned_routes : 0; + } + + public function hasNumLearnedRoutes() + { + return isset($this->num_learned_routes); + } + + public function clearNumLearnedRoutes() + { + unset($this->num_learned_routes); + } + + /** + * Number of routes learned from the remote BGP Peer. + * + * Generated from protobuf field optional uint32 num_learned_routes = 135457535; + * @param int $var + * @return $this + */ + public function setNumLearnedRoutes($var) + { + GPBUtil::checkUint32($var); + $this->num_learned_routes = $var; + + return $this; + } + + /** + * IP address of the remote BGP interface. + * + * Generated from protobuf field optional string peer_ip_address = 207735769; + * @return string + */ + public function getPeerIpAddress() + { + return isset($this->peer_ip_address) ? $this->peer_ip_address : ''; + } + + public function hasPeerIpAddress() + { + return isset($this->peer_ip_address); + } + + public function clearPeerIpAddress() + { + unset($this->peer_ip_address); + } + + /** + * IP address of the remote BGP interface. + * + * Generated from protobuf field optional string peer_ip_address = 207735769; + * @param string $var + * @return $this + */ + public function setPeerIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->peer_ip_address = $var; + + return $this; + } + + /** + * IPv4 address of the remote BGP interface. + * + * Generated from protobuf field optional string peer_ipv4_nexthop_address = 469221774; + * @return string + */ + public function getPeerIpv4NexthopAddress() + { + return isset($this->peer_ipv4_nexthop_address) ? $this->peer_ipv4_nexthop_address : ''; + } + + public function hasPeerIpv4NexthopAddress() + { + return isset($this->peer_ipv4_nexthop_address); + } + + public function clearPeerIpv4NexthopAddress() + { + unset($this->peer_ipv4_nexthop_address); + } + + /** + * IPv4 address of the remote BGP interface. + * + * Generated from protobuf field optional string peer_ipv4_nexthop_address = 469221774; + * @param string $var + * @return $this + */ + public function setPeerIpv4NexthopAddress($var) + { + GPBUtil::checkString($var, True); + $this->peer_ipv4_nexthop_address = $var; + + return $this; + } + + /** + * IPv6 address of the remote BGP interface. + * + * Generated from protobuf field optional string peer_ipv6_nexthop_address = 491486608; + * @return string + */ + public function getPeerIpv6NexthopAddress() + { + return isset($this->peer_ipv6_nexthop_address) ? $this->peer_ipv6_nexthop_address : ''; + } + + public function hasPeerIpv6NexthopAddress() + { + return isset($this->peer_ipv6_nexthop_address); + } + + public function clearPeerIpv6NexthopAddress() + { + unset($this->peer_ipv6_nexthop_address); + } + + /** + * IPv6 address of the remote BGP interface. + * + * Generated from protobuf field optional string peer_ipv6_nexthop_address = 491486608; + * @param string $var + * @return $this + */ + public function setPeerIpv6NexthopAddress($var) + { + GPBUtil::checkString($var, True); + $this->peer_ipv6_nexthop_address = $var; + + return $this; + } + + /** + * [Output only] URI of the VM instance that is used as third-party router appliances such as Next Gen Firewalls, Virtual Routers, or Router Appliances. The VM instance is the peer side of the BGP session. + * + * Generated from protobuf field optional string router_appliance_instance = 468312989; + * @return string + */ + public function getRouterApplianceInstance() + { + return isset($this->router_appliance_instance) ? $this->router_appliance_instance : ''; + } + + public function hasRouterApplianceInstance() + { + return isset($this->router_appliance_instance); + } + + public function clearRouterApplianceInstance() + { + unset($this->router_appliance_instance); + } + + /** + * [Output only] URI of the VM instance that is used as third-party router appliances such as Next Gen Firewalls, Virtual Routers, or Router Appliances. The VM instance is the peer side of the BGP session. + * + * Generated from protobuf field optional string router_appliance_instance = 468312989; + * @param string $var + * @return $this + */ + public function setRouterApplianceInstance($var) + { + GPBUtil::checkString($var, True); + $this->router_appliance_instance = $var; + + return $this; + } + + /** + * The state of the BGP session. For a list of possible values for this field, see BGP session states. + * + * Generated from protobuf field optional string state = 109757585; + * @return string + */ + public function getState() + { + return isset($this->state) ? $this->state : ''; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * The state of the BGP session. For a list of possible values for this field, see BGP session states. + * + * Generated from protobuf field optional string state = 109757585; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + + /** + * Status of the BGP peer: {UP, DOWN} + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * Status of the BGP peer: {UP, DOWN} + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + + /** + * Indicates why particular status was returned. + * Check the StatusReason enum for the list of possible values. + * + * Generated from protobuf field optional string status_reason = 342706993; + * @return string + */ + public function getStatusReason() + { + return isset($this->status_reason) ? $this->status_reason : ''; + } + + public function hasStatusReason() + { + return isset($this->status_reason); + } + + public function clearStatusReason() + { + unset($this->status_reason); + } + + /** + * Indicates why particular status was returned. + * Check the StatusReason enum for the list of possible values. + * + * Generated from protobuf field optional string status_reason = 342706993; + * @param string $var + * @return $this + */ + public function setStatusReason($var) + { + GPBUtil::checkString($var, True); + $this->status_reason = $var; + + return $this; + } + + /** + * Time this session has been up. Format: 14 years, 51 weeks, 6 days, 23 hours, 59 minutes, 59 seconds + * + * Generated from protobuf field optional string uptime = 235379688; + * @return string + */ + public function getUptime() + { + return isset($this->uptime) ? $this->uptime : ''; + } + + public function hasUptime() + { + return isset($this->uptime); + } + + public function clearUptime() + { + unset($this->uptime); + } + + /** + * Time this session has been up. Format: 14 years, 51 weeks, 6 days, 23 hours, 59 minutes, 59 seconds + * + * Generated from protobuf field optional string uptime = 235379688; + * @param string $var + * @return $this + */ + public function setUptime($var) + { + GPBUtil::checkString($var, True); + $this->uptime = $var; + + return $this; + } + + /** + * Time this session has been up, in seconds. Format: 145 + * + * Generated from protobuf field optional string uptime_seconds = 104736040; + * @return string + */ + public function getUptimeSeconds() + { + return isset($this->uptime_seconds) ? $this->uptime_seconds : ''; + } + + public function hasUptimeSeconds() + { + return isset($this->uptime_seconds); + } + + public function clearUptimeSeconds() + { + unset($this->uptime_seconds); + } + + /** + * Time this session has been up, in seconds. Format: 145 + * + * Generated from protobuf field optional string uptime_seconds = 104736040; + * @param string $var + * @return $this + */ + public function setUptimeSeconds($var) + { + GPBUtil::checkString($var, True); + $this->uptime_seconds = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusBgpPeerStatus/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusBgpPeerStatus/Status.php new file mode 100644 index 000000000000..30b5074d22b9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusBgpPeerStatus/Status.php @@ -0,0 +1,65 @@ +google.cloud.compute.v1.RouterStatusBgpPeerStatus.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * Generated from protobuf enum DOWN = 2104482; + */ + const DOWN = 2104482; + /** + * Generated from protobuf enum UNKNOWN = 433141802; + */ + const UNKNOWN = 433141802; + /** + * Generated from protobuf enum UP = 2715; + */ + const UP = 2715; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::DOWN => 'DOWN', + self::UNKNOWN => 'UNKNOWN', + self::UP => 'UP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\RouterStatusBgpPeerStatus_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusBgpPeerStatus/StatusReason.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusBgpPeerStatus/StatusReason.php new file mode 100644 index 000000000000..ac3391e7089a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusBgpPeerStatus/StatusReason.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.RouterStatusBgpPeerStatus.StatusReason + */ +class StatusReason +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS_REASON = 0; + */ + const UNDEFINED_STATUS_REASON = 0; + /** + * BGP peer disabled because it requires IPv4 but the underlying connection is IPv6-only. + * + * Generated from protobuf enum IPV4_PEER_ON_IPV6_ONLY_CONNECTION = 435936662; + */ + const IPV4_PEER_ON_IPV6_ONLY_CONNECTION = 435936662; + /** + * BGP peer disabled because it requires IPv6 but the underlying connection is IPv4-only. + * + * Generated from protobuf enum IPV6_PEER_ON_IPV4_ONLY_CONNECTION = 436304082; + */ + const IPV6_PEER_ON_IPV4_ONLY_CONNECTION = 436304082; + /** + * Indicates internal problems with configuration of MD5 authentication. This particular reason can only be returned when md5AuthEnabled is true and status is DOWN. + * + * Generated from protobuf enum MD5_AUTH_INTERNAL_PROBLEM = 140462259; + */ + const MD5_AUTH_INTERNAL_PROBLEM = 140462259; + /** + * Generated from protobuf enum STATUS_REASON_UNSPECIFIED = 394331913; + */ + const STATUS_REASON_UNSPECIFIED = 394331913; + + private static $valueToName = [ + self::UNDEFINED_STATUS_REASON => 'UNDEFINED_STATUS_REASON', + self::IPV4_PEER_ON_IPV6_ONLY_CONNECTION => 'IPV4_PEER_ON_IPV6_ONLY_CONNECTION', + self::IPV6_PEER_ON_IPV4_ONLY_CONNECTION => 'IPV6_PEER_ON_IPV4_ONLY_CONNECTION', + self::MD5_AUTH_INTERNAL_PROBLEM => 'MD5_AUTH_INTERNAL_PROBLEM', + self::STATUS_REASON_UNSPECIFIED => 'STATUS_REASON_UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StatusReason::class, \Google\Cloud\Compute\V1\RouterStatusBgpPeerStatus_StatusReason::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusNatStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusNatStatus.php new file mode 100644 index 000000000000..d47bcb8a9334 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusNatStatus.php @@ -0,0 +1,369 @@ +google.cloud.compute.v1.RouterStatusNatStatus + */ +class RouterStatusNatStatus extends \Google\Protobuf\Internal\Message +{ + /** + * A list of IPs auto-allocated for NAT. Example: ["1.1.1.1", "129.2.16.89"] + * + * Generated from protobuf field repeated string auto_allocated_nat_ips = 510794246; + */ + private $auto_allocated_nat_ips; + /** + * A list of IPs auto-allocated for NAT that are in drain mode. Example: ["1.1.1.1", "179.12.26.133"]. + * + * Generated from protobuf field repeated string drain_auto_allocated_nat_ips = 309184557; + */ + private $drain_auto_allocated_nat_ips; + /** + * A list of IPs user-allocated for NAT that are in drain mode. Example: ["1.1.1.1", "179.12.26.133"]. + * + * Generated from protobuf field repeated string drain_user_allocated_nat_ips = 305268553; + */ + private $drain_user_allocated_nat_ips; + /** + * The number of extra IPs to allocate. This will be greater than 0 only if user-specified IPs are NOT enough to allow all configured VMs to use NAT. This value is meaningful only when auto-allocation of NAT IPs is *not* used. + * + * Generated from protobuf field optional int32 min_extra_nat_ips_needed = 365786338; + */ + protected $min_extra_nat_ips_needed = null; + /** + * Unique name of this NAT. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Number of VM endpoints (i.e., Nics) that can use NAT. + * + * Generated from protobuf field optional int32 num_vm_endpoints_with_nat_mappings = 512367468; + */ + protected $num_vm_endpoints_with_nat_mappings = null; + /** + * Status of rules in this NAT. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterStatusNatStatusNatRuleStatus rule_status = 140223125; + */ + private $rule_status; + /** + * A list of fully qualified URLs of reserved IP address resources. + * + * Generated from protobuf field repeated string user_allocated_nat_ip_resources = 212776151; + */ + private $user_allocated_nat_ip_resources; + /** + * A list of IPs user-allocated for NAT. They will be raw IP strings like "179.12.26.133". + * + * Generated from protobuf field repeated string user_allocated_nat_ips = 506878242; + */ + private $user_allocated_nat_ips; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $auto_allocated_nat_ips + * A list of IPs auto-allocated for NAT. Example: ["1.1.1.1", "129.2.16.89"] + * @type array|\Google\Protobuf\Internal\RepeatedField $drain_auto_allocated_nat_ips + * A list of IPs auto-allocated for NAT that are in drain mode. Example: ["1.1.1.1", "179.12.26.133"]. + * @type array|\Google\Protobuf\Internal\RepeatedField $drain_user_allocated_nat_ips + * A list of IPs user-allocated for NAT that are in drain mode. Example: ["1.1.1.1", "179.12.26.133"]. + * @type int $min_extra_nat_ips_needed + * The number of extra IPs to allocate. This will be greater than 0 only if user-specified IPs are NOT enough to allow all configured VMs to use NAT. This value is meaningful only when auto-allocation of NAT IPs is *not* used. + * @type string $name + * Unique name of this NAT. + * @type int $num_vm_endpoints_with_nat_mappings + * Number of VM endpoints (i.e., Nics) that can use NAT. + * @type array<\Google\Cloud\Compute\V1\RouterStatusNatStatusNatRuleStatus>|\Google\Protobuf\Internal\RepeatedField $rule_status + * Status of rules in this NAT. + * @type array|\Google\Protobuf\Internal\RepeatedField $user_allocated_nat_ip_resources + * A list of fully qualified URLs of reserved IP address resources. + * @type array|\Google\Protobuf\Internal\RepeatedField $user_allocated_nat_ips + * A list of IPs user-allocated for NAT. They will be raw IP strings like "179.12.26.133". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of IPs auto-allocated for NAT. Example: ["1.1.1.1", "129.2.16.89"] + * + * Generated from protobuf field repeated string auto_allocated_nat_ips = 510794246; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAutoAllocatedNatIps() + { + return $this->auto_allocated_nat_ips; + } + + /** + * A list of IPs auto-allocated for NAT. Example: ["1.1.1.1", "129.2.16.89"] + * + * Generated from protobuf field repeated string auto_allocated_nat_ips = 510794246; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAutoAllocatedNatIps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->auto_allocated_nat_ips = $arr; + + return $this; + } + + /** + * A list of IPs auto-allocated for NAT that are in drain mode. Example: ["1.1.1.1", "179.12.26.133"]. + * + * Generated from protobuf field repeated string drain_auto_allocated_nat_ips = 309184557; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDrainAutoAllocatedNatIps() + { + return $this->drain_auto_allocated_nat_ips; + } + + /** + * A list of IPs auto-allocated for NAT that are in drain mode. Example: ["1.1.1.1", "179.12.26.133"]. + * + * Generated from protobuf field repeated string drain_auto_allocated_nat_ips = 309184557; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDrainAutoAllocatedNatIps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->drain_auto_allocated_nat_ips = $arr; + + return $this; + } + + /** + * A list of IPs user-allocated for NAT that are in drain mode. Example: ["1.1.1.1", "179.12.26.133"]. + * + * Generated from protobuf field repeated string drain_user_allocated_nat_ips = 305268553; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDrainUserAllocatedNatIps() + { + return $this->drain_user_allocated_nat_ips; + } + + /** + * A list of IPs user-allocated for NAT that are in drain mode. Example: ["1.1.1.1", "179.12.26.133"]. + * + * Generated from protobuf field repeated string drain_user_allocated_nat_ips = 305268553; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDrainUserAllocatedNatIps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->drain_user_allocated_nat_ips = $arr; + + return $this; + } + + /** + * The number of extra IPs to allocate. This will be greater than 0 only if user-specified IPs are NOT enough to allow all configured VMs to use NAT. This value is meaningful only when auto-allocation of NAT IPs is *not* used. + * + * Generated from protobuf field optional int32 min_extra_nat_ips_needed = 365786338; + * @return int + */ + public function getMinExtraNatIpsNeeded() + { + return isset($this->min_extra_nat_ips_needed) ? $this->min_extra_nat_ips_needed : 0; + } + + public function hasMinExtraNatIpsNeeded() + { + return isset($this->min_extra_nat_ips_needed); + } + + public function clearMinExtraNatIpsNeeded() + { + unset($this->min_extra_nat_ips_needed); + } + + /** + * The number of extra IPs to allocate. This will be greater than 0 only if user-specified IPs are NOT enough to allow all configured VMs to use NAT. This value is meaningful only when auto-allocation of NAT IPs is *not* used. + * + * Generated from protobuf field optional int32 min_extra_nat_ips_needed = 365786338; + * @param int $var + * @return $this + */ + public function setMinExtraNatIpsNeeded($var) + { + GPBUtil::checkInt32($var); + $this->min_extra_nat_ips_needed = $var; + + return $this; + } + + /** + * Unique name of this NAT. + * + * 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); + } + + /** + * Unique name of this NAT. + * + * 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; + } + + /** + * Number of VM endpoints (i.e., Nics) that can use NAT. + * + * Generated from protobuf field optional int32 num_vm_endpoints_with_nat_mappings = 512367468; + * @return int + */ + public function getNumVmEndpointsWithNatMappings() + { + return isset($this->num_vm_endpoints_with_nat_mappings) ? $this->num_vm_endpoints_with_nat_mappings : 0; + } + + public function hasNumVmEndpointsWithNatMappings() + { + return isset($this->num_vm_endpoints_with_nat_mappings); + } + + public function clearNumVmEndpointsWithNatMappings() + { + unset($this->num_vm_endpoints_with_nat_mappings); + } + + /** + * Number of VM endpoints (i.e., Nics) that can use NAT. + * + * Generated from protobuf field optional int32 num_vm_endpoints_with_nat_mappings = 512367468; + * @param int $var + * @return $this + */ + public function setNumVmEndpointsWithNatMappings($var) + { + GPBUtil::checkInt32($var); + $this->num_vm_endpoints_with_nat_mappings = $var; + + return $this; + } + + /** + * Status of rules in this NAT. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterStatusNatStatusNatRuleStatus rule_status = 140223125; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRuleStatus() + { + return $this->rule_status; + } + + /** + * Status of rules in this NAT. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.RouterStatusNatStatusNatRuleStatus rule_status = 140223125; + * @param array<\Google\Cloud\Compute\V1\RouterStatusNatStatusNatRuleStatus>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRuleStatus($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\RouterStatusNatStatusNatRuleStatus::class); + $this->rule_status = $arr; + + return $this; + } + + /** + * A list of fully qualified URLs of reserved IP address resources. + * + * Generated from protobuf field repeated string user_allocated_nat_ip_resources = 212776151; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUserAllocatedNatIpResources() + { + return $this->user_allocated_nat_ip_resources; + } + + /** + * A list of fully qualified URLs of reserved IP address resources. + * + * Generated from protobuf field repeated string user_allocated_nat_ip_resources = 212776151; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUserAllocatedNatIpResources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->user_allocated_nat_ip_resources = $arr; + + return $this; + } + + /** + * A list of IPs user-allocated for NAT. They will be raw IP strings like "179.12.26.133". + * + * Generated from protobuf field repeated string user_allocated_nat_ips = 506878242; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUserAllocatedNatIps() + { + return $this->user_allocated_nat_ips; + } + + /** + * A list of IPs user-allocated for NAT. They will be raw IP strings like "179.12.26.133". + * + * Generated from protobuf field repeated string user_allocated_nat_ips = 506878242; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUserAllocatedNatIps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->user_allocated_nat_ips = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusNatStatusNatRuleStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusNatStatusNatRuleStatus.php new file mode 100644 index 000000000000..c05fa60b5885 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusNatStatusNatRuleStatus.php @@ -0,0 +1,233 @@ +google.cloud.compute.v1.RouterStatusNatStatusNatRuleStatus + */ +class RouterStatusNatStatusNatRuleStatus extends \Google\Protobuf\Internal\Message +{ + /** + * A list of active IPs for NAT. Example: ["1.1.1.1", "179.12.26.133"]. + * + * Generated from protobuf field repeated string active_nat_ips = 208517077; + */ + private $active_nat_ips; + /** + * A list of IPs for NAT that are in drain mode. Example: ["1.1.1.1", "179.12.26.133"]. + * + * Generated from protobuf field repeated string drain_nat_ips = 504078535; + */ + private $drain_nat_ips; + /** + * The number of extra IPs to allocate. This will be greater than 0 only if the existing IPs in this NAT Rule are NOT enough to allow all configured VMs to use NAT. + * + * Generated from protobuf field optional int32 min_extra_ips_needed = 353002756; + */ + protected $min_extra_ips_needed = null; + /** + * Number of VM endpoints (i.e., NICs) that have NAT Mappings from this NAT Rule. + * + * Generated from protobuf field optional int32 num_vm_endpoints_with_nat_mappings = 512367468; + */ + protected $num_vm_endpoints_with_nat_mappings = null; + /** + * Rule number of the rule. + * + * Generated from protobuf field optional int32 rule_number = 535211500; + */ + protected $rule_number = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $active_nat_ips + * A list of active IPs for NAT. Example: ["1.1.1.1", "179.12.26.133"]. + * @type array|\Google\Protobuf\Internal\RepeatedField $drain_nat_ips + * A list of IPs for NAT that are in drain mode. Example: ["1.1.1.1", "179.12.26.133"]. + * @type int $min_extra_ips_needed + * The number of extra IPs to allocate. This will be greater than 0 only if the existing IPs in this NAT Rule are NOT enough to allow all configured VMs to use NAT. + * @type int $num_vm_endpoints_with_nat_mappings + * Number of VM endpoints (i.e., NICs) that have NAT Mappings from this NAT Rule. + * @type int $rule_number + * Rule number of the rule. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of active IPs for NAT. Example: ["1.1.1.1", "179.12.26.133"]. + * + * Generated from protobuf field repeated string active_nat_ips = 208517077; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getActiveNatIps() + { + return $this->active_nat_ips; + } + + /** + * A list of active IPs for NAT. Example: ["1.1.1.1", "179.12.26.133"]. + * + * Generated from protobuf field repeated string active_nat_ips = 208517077; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setActiveNatIps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->active_nat_ips = $arr; + + return $this; + } + + /** + * A list of IPs for NAT that are in drain mode. Example: ["1.1.1.1", "179.12.26.133"]. + * + * Generated from protobuf field repeated string drain_nat_ips = 504078535; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDrainNatIps() + { + return $this->drain_nat_ips; + } + + /** + * A list of IPs for NAT that are in drain mode. Example: ["1.1.1.1", "179.12.26.133"]. + * + * Generated from protobuf field repeated string drain_nat_ips = 504078535; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDrainNatIps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->drain_nat_ips = $arr; + + return $this; + } + + /** + * The number of extra IPs to allocate. This will be greater than 0 only if the existing IPs in this NAT Rule are NOT enough to allow all configured VMs to use NAT. + * + * Generated from protobuf field optional int32 min_extra_ips_needed = 353002756; + * @return int + */ + public function getMinExtraIpsNeeded() + { + return isset($this->min_extra_ips_needed) ? $this->min_extra_ips_needed : 0; + } + + public function hasMinExtraIpsNeeded() + { + return isset($this->min_extra_ips_needed); + } + + public function clearMinExtraIpsNeeded() + { + unset($this->min_extra_ips_needed); + } + + /** + * The number of extra IPs to allocate. This will be greater than 0 only if the existing IPs in this NAT Rule are NOT enough to allow all configured VMs to use NAT. + * + * Generated from protobuf field optional int32 min_extra_ips_needed = 353002756; + * @param int $var + * @return $this + */ + public function setMinExtraIpsNeeded($var) + { + GPBUtil::checkInt32($var); + $this->min_extra_ips_needed = $var; + + return $this; + } + + /** + * Number of VM endpoints (i.e., NICs) that have NAT Mappings from this NAT Rule. + * + * Generated from protobuf field optional int32 num_vm_endpoints_with_nat_mappings = 512367468; + * @return int + */ + public function getNumVmEndpointsWithNatMappings() + { + return isset($this->num_vm_endpoints_with_nat_mappings) ? $this->num_vm_endpoints_with_nat_mappings : 0; + } + + public function hasNumVmEndpointsWithNatMappings() + { + return isset($this->num_vm_endpoints_with_nat_mappings); + } + + public function clearNumVmEndpointsWithNatMappings() + { + unset($this->num_vm_endpoints_with_nat_mappings); + } + + /** + * Number of VM endpoints (i.e., NICs) that have NAT Mappings from this NAT Rule. + * + * Generated from protobuf field optional int32 num_vm_endpoints_with_nat_mappings = 512367468; + * @param int $var + * @return $this + */ + public function setNumVmEndpointsWithNatMappings($var) + { + GPBUtil::checkInt32($var); + $this->num_vm_endpoints_with_nat_mappings = $var; + + return $this; + } + + /** + * Rule number of the rule. + * + * Generated from protobuf field optional int32 rule_number = 535211500; + * @return int + */ + public function getRuleNumber() + { + return isset($this->rule_number) ? $this->rule_number : 0; + } + + public function hasRuleNumber() + { + return isset($this->rule_number); + } + + public function clearRuleNumber() + { + unset($this->rule_number); + } + + /** + * Rule number of the rule. + * + * Generated from protobuf field optional int32 rule_number = 535211500; + * @param int $var + * @return $this + */ + public function setRuleNumber($var) + { + GPBUtil::checkInt32($var); + $this->rule_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusResponse.php new file mode 100644 index 000000000000..13e3aaaaf134 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RouterStatusResponse.php @@ -0,0 +1,113 @@ +google.cloud.compute.v1.RouterStatusResponse + */ +class RouterStatusResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.RouterStatus result = 139315229; + */ + protected $result = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $kind + * Type of resource. + * @type \Google\Cloud\Compute\V1\RouterStatus $result + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.RouterStatus result = 139315229; + * @return \Google\Cloud\Compute\V1\RouterStatus|null + */ + public function getResult() + { + return $this->result; + } + + public function hasResult() + { + return isset($this->result); + } + + public function clearResult() + { + unset($this->result); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.RouterStatus result = 139315229; + * @param \Google\Cloud\Compute\V1\RouterStatus $var + * @return $this + */ + public function setResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RouterStatus::class); + $this->result = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RoutersPreviewResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RoutersPreviewResponse.php new file mode 100644 index 000000000000..43fa47a49ddb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RoutersPreviewResponse.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.RoutersPreviewResponse + */ +class RoutersPreviewResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Preview of given router. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Router resource = 195806222; + */ + protected $resource = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\Router $resource + * Preview of given router. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Preview of given router. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Router resource = 195806222; + * @return \Google\Cloud\Compute\V1\Router|null + */ + public function getResource() + { + return $this->resource; + } + + public function hasResource() + { + return isset($this->resource); + } + + public function clearResource() + { + unset($this->resource); + } + + /** + * Preview of given router. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Router resource = 195806222; + * @param \Google\Cloud\Compute\V1\Router $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Router::class); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RoutersScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RoutersScopedList.php new file mode 100644 index 000000000000..cc74b19b17aa --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RoutersScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.RoutersScopedList + */ +class RoutersScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * A list of routers contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Router routers = 311906890; + */ + private $routers; + /** + * Informational warning which replaces the list of routers when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\Router>|\Google\Protobuf\Internal\RepeatedField $routers + * A list of routers contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * Informational warning which replaces the list of routers when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of routers contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Router routers = 311906890; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRouters() + { + return $this->routers; + } + + /** + * A list of routers contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Router routers = 311906890; + * @param array<\Google\Cloud\Compute\V1\Router>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRouters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Router::class); + $this->routers = $arr; + + return $this; + } + + /** + * Informational warning which replaces the list of routers 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); + } + + /** + * Informational warning which replaces the list of routers 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Rule.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Rule.php new file mode 100644 index 000000000000..30d50808b57f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Rule.php @@ -0,0 +1,295 @@ +google.cloud.compute.v1.Rule + */ +class Rule extends \Google\Protobuf\Internal\Message +{ + /** + * This is deprecated and has no effect. Do not use. + * Check the Action enum for the list of possible values. + * + * Generated from protobuf field optional string action = 187661878; + */ + protected $action = null; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Condition conditions = 142882488; + */ + private $conditions; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated string ins = 104430; + */ + private $ins; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.LogConfig log_configs = 152873846; + */ + private $log_configs; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated string not_ins = 518443138; + */ + private $not_ins; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated string permissions = 59962500; + */ + private $permissions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $action + * This is deprecated and has no effect. Do not use. + * Check the Action enum for the list of possible values. + * @type array<\Google\Cloud\Compute\V1\Condition>|\Google\Protobuf\Internal\RepeatedField $conditions + * This is deprecated and has no effect. Do not use. + * @type string $description + * This is deprecated and has no effect. Do not use. + * @type array|\Google\Protobuf\Internal\RepeatedField $ins + * This is deprecated and has no effect. Do not use. + * @type array<\Google\Cloud\Compute\V1\LogConfig>|\Google\Protobuf\Internal\RepeatedField $log_configs + * This is deprecated and has no effect. Do not use. + * @type array|\Google\Protobuf\Internal\RepeatedField $not_ins + * This is deprecated and has no effect. Do not use. + * @type array|\Google\Protobuf\Internal\RepeatedField $permissions + * This is deprecated and has no effect. Do not use. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * This is deprecated and has no effect. Do not use. + * Check the Action enum for the list of possible values. + * + * Generated from protobuf field optional string action = 187661878; + * @return string + */ + public function getAction() + { + return isset($this->action) ? $this->action : ''; + } + + public function hasAction() + { + return isset($this->action); + } + + public function clearAction() + { + unset($this->action); + } + + /** + * This is deprecated and has no effect. Do not use. + * Check the Action enum for the list of possible values. + * + * Generated from protobuf field optional string action = 187661878; + * @param string $var + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkString($var, True); + $this->action = $var; + + return $this; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Condition conditions = 142882488; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConditions() + { + return $this->conditions; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Condition conditions = 142882488; + * @param array<\Google\Cloud\Compute\V1\Condition>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConditions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Condition::class); + $this->conditions = $arr; + + return $this; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated string ins = 104430; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIns() + { + return $this->ins; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated string ins = 104430; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ins = $arr; + + return $this; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.LogConfig log_configs = 152873846; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLogConfigs() + { + return $this->log_configs; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.LogConfig log_configs = 152873846; + * @param array<\Google\Cloud\Compute\V1\LogConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLogConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\LogConfig::class); + $this->log_configs = $arr; + + return $this; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated string not_ins = 518443138; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNotIns() + { + return $this->not_ins; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated string not_ins = 518443138; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNotIns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->not_ins = $arr; + + return $this; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated string permissions = 59962500; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPermissions() + { + return $this->permissions; + } + + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf field repeated string permissions = 59962500; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPermissions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->permissions = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Rule/Action.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Rule/Action.php new file mode 100644 index 000000000000..a599e6575427 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Rule/Action.php @@ -0,0 +1,92 @@ +google.cloud.compute.v1.Rule.Action + */ +class Action +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ACTION = 0; + */ + const UNDEFINED_ACTION = 0; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum ALLOW = 62368553; + */ + const ALLOW = 62368553; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum ALLOW_WITH_LOG = 76034177; + */ + const ALLOW_WITH_LOG = 76034177; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum DENY = 2094604; + */ + const DENY = 2094604; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum DENY_WITH_LOG = 351433982; + */ + const DENY_WITH_LOG = 351433982; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum LOG = 75556; + */ + const LOG = 75556; + /** + * This is deprecated and has no effect. Do not use. + * + * Generated from protobuf enum NO_ACTION = 260643444; + */ + const NO_ACTION = 260643444; + + private static $valueToName = [ + self::UNDEFINED_ACTION => 'UNDEFINED_ACTION', + self::ALLOW => 'ALLOW', + self::ALLOW_WITH_LOG => 'ALLOW_WITH_LOG', + self::DENY => 'DENY', + self::DENY_WITH_LOG => 'DENY_WITH_LOG', + self::LOG => 'LOG', + self::NO_ACTION => 'NO_ACTION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Action::class, \Google\Cloud\Compute\V1\Rule_Action::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SSLHealthCheck.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SSLHealthCheck.php new file mode 100644 index 000000000000..b9ffc1a0ddbb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SSLHealthCheck.php @@ -0,0 +1,304 @@ +google.cloud.compute.v1.SSLHealthCheck + */ +class SSLHealthCheck extends \Google\Protobuf\Internal\Message +{ + /** + * The TCP port number to which the health check prober sends packets. The default value is 443. Valid values are 1 through 65535. + * + * Generated from protobuf field optional int32 port = 3446913; + */ + protected $port = null; + /** + * Not supported. + * + * Generated from protobuf field optional string port_name = 41534345; + */ + protected $port_name = null; + /** + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * + * Generated from protobuf field optional string port_specification = 51590597; + */ + protected $port_specification = null; + /** + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + */ + protected $proxy_header = null; + /** + * Instructs the health check prober to send this exact ASCII string, up to 1024 bytes in length, after establishing the TCP connection and SSL handshake. + * + * Generated from protobuf field optional string request = 21951119; + */ + protected $request = null; + /** + * Creates a content-based SSL health check. In addition to establishing a TCP connection and the TLS handshake, you can configure the health check to pass only when the backend sends this exact response ASCII string, up to 1024 bytes in length. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-ssl-tcp + * + * Generated from protobuf field optional string response = 196547649; + */ + protected $response = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $port + * The TCP port number to which the health check prober sends packets. The default value is 443. Valid values are 1 through 65535. + * @type string $port_name + * Not supported. + * @type string $port_specification + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * @type string $proxy_header + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * @type string $request + * Instructs the health check prober to send this exact ASCII string, up to 1024 bytes in length, after establishing the TCP connection and SSL handshake. + * @type string $response + * Creates a content-based SSL health check. In addition to establishing a TCP connection and the TLS handshake, you can configure the health check to pass only when the backend sends this exact response ASCII string, up to 1024 bytes in length. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-ssl-tcp + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The TCP port number to which the health check prober sends packets. The default value is 443. Valid values are 1 through 65535. + * + * Generated from protobuf field optional int32 port = 3446913; + * @return int + */ + public function getPort() + { + return isset($this->port) ? $this->port : 0; + } + + public function hasPort() + { + return isset($this->port); + } + + public function clearPort() + { + unset($this->port); + } + + /** + * The TCP port number to which the health check prober sends packets. The default value is 443. Valid values are 1 through 65535. + * + * Generated from protobuf field optional int32 port = 3446913; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + + /** + * Not supported. + * + * Generated from protobuf field optional string port_name = 41534345; + * @return string + */ + public function getPortName() + { + return isset($this->port_name) ? $this->port_name : ''; + } + + public function hasPortName() + { + return isset($this->port_name); + } + + public function clearPortName() + { + unset($this->port_name); + } + + /** + * Not supported. + * + * Generated from protobuf field optional string port_name = 41534345; + * @param string $var + * @return $this + */ + public function setPortName($var) + { + GPBUtil::checkString($var, True); + $this->port_name = $var; + + return $this; + } + + /** + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * + * Generated from protobuf field optional string port_specification = 51590597; + * @return string + */ + public function getPortSpecification() + { + return isset($this->port_specification) ? $this->port_specification : ''; + } + + public function hasPortSpecification() + { + return isset($this->port_specification); + } + + public function clearPortSpecification() + { + unset($this->port_specification); + } + + /** + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * + * Generated from protobuf field optional string port_specification = 51590597; + * @param string $var + * @return $this + */ + public function setPortSpecification($var) + { + GPBUtil::checkString($var, True); + $this->port_specification = $var; + + return $this; + } + + /** + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + * @return string + */ + public function getProxyHeader() + { + return isset($this->proxy_header) ? $this->proxy_header : ''; + } + + public function hasProxyHeader() + { + return isset($this->proxy_header); + } + + public function clearProxyHeader() + { + unset($this->proxy_header); + } + + /** + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + * @param string $var + * @return $this + */ + public function setProxyHeader($var) + { + GPBUtil::checkString($var, True); + $this->proxy_header = $var; + + return $this; + } + + /** + * Instructs the health check prober to send this exact ASCII string, up to 1024 bytes in length, after establishing the TCP connection and SSL handshake. + * + * Generated from protobuf field optional string request = 21951119; + * @return string + */ + public function getRequest() + { + return isset($this->request) ? $this->request : ''; + } + + public function hasRequest() + { + return isset($this->request); + } + + public function clearRequest() + { + unset($this->request); + } + + /** + * Instructs the health check prober to send this exact ASCII string, up to 1024 bytes in length, after establishing the TCP connection and SSL handshake. + * + * Generated from protobuf field optional string request = 21951119; + * @param string $var + * @return $this + */ + public function setRequest($var) + { + GPBUtil::checkString($var, True); + $this->request = $var; + + return $this; + } + + /** + * Creates a content-based SSL health check. In addition to establishing a TCP connection and the TLS handshake, you can configure the health check to pass only when the backend sends this exact response ASCII string, up to 1024 bytes in length. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-ssl-tcp + * + * Generated from protobuf field optional string response = 196547649; + * @return string + */ + public function getResponse() + { + return isset($this->response) ? $this->response : ''; + } + + public function hasResponse() + { + return isset($this->response); + } + + public function clearResponse() + { + unset($this->response); + } + + /** + * Creates a content-based SSL health check. In addition to establishing a TCP connection and the TLS handshake, you can configure the health check to pass only when the backend sends this exact response ASCII string, up to 1024 bytes in length. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-ssl-tcp + * + * Generated from protobuf field optional string response = 196547649; + * @param string $var + * @return $this + */ + public function setResponse($var) + { + GPBUtil::checkString($var, True); + $this->response = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SSLHealthCheck/PortSpecification.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SSLHealthCheck/PortSpecification.php new file mode 100644 index 000000000000..b3fb3697a0a7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SSLHealthCheck/PortSpecification.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.SSLHealthCheck.PortSpecification + */ +class PortSpecification +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PORT_SPECIFICATION = 0; + */ + const UNDEFINED_PORT_SPECIFICATION = 0; + /** + * The port number in the health check's port is used for health checking. Applies to network endpoint group and instance group backends. + * + * Generated from protobuf enum USE_FIXED_PORT = 190235748; + */ + const USE_FIXED_PORT = 190235748; + /** + * Not supported. + * + * Generated from protobuf enum USE_NAMED_PORT = 349300671; + */ + const USE_NAMED_PORT = 349300671; + /** + * For network endpoint group backends, the health check uses the port number specified on each endpoint in the network endpoint group. For instance group backends, the health check uses the port number specified for the backend service's named port defined in the instance group's named ports. + * + * Generated from protobuf enum USE_SERVING_PORT = 362637516; + */ + const USE_SERVING_PORT = 362637516; + + private static $valueToName = [ + self::UNDEFINED_PORT_SPECIFICATION => 'UNDEFINED_PORT_SPECIFICATION', + self::USE_FIXED_PORT => 'USE_FIXED_PORT', + self::USE_NAMED_PORT => 'USE_NAMED_PORT', + self::USE_SERVING_PORT => 'USE_SERVING_PORT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PortSpecification::class, \Google\Cloud\Compute\V1\SSLHealthCheck_PortSpecification::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SSLHealthCheck/ProxyHeader.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SSLHealthCheck/ProxyHeader.php new file mode 100644 index 000000000000..9730f63cbf4f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SSLHealthCheck/ProxyHeader.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.SSLHealthCheck.ProxyHeader + */ +class ProxyHeader +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PROXY_HEADER = 0; + */ + const UNDEFINED_PROXY_HEADER = 0; + /** + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + /** + * Generated from protobuf enum PROXY_V1 = 334352940; + */ + const PROXY_V1 = 334352940; + + private static $valueToName = [ + self::UNDEFINED_PROXY_HEADER => 'UNDEFINED_PROXY_HEADER', + self::NONE => 'NONE', + self::PROXY_V1 => 'PROXY_V1', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ProxyHeader::class, \Google\Cloud\Compute\V1\SSLHealthCheck_ProxyHeader::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedAttachedDisk.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedAttachedDisk.php new file mode 100644 index 000000000000..da0531ba2aa3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedAttachedDisk.php @@ -0,0 +1,733 @@ +google.cloud.compute.v1.SavedAttachedDisk + */ +class SavedAttachedDisk extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance). + * + * Generated from protobuf field optional bool auto_delete = 464761403; + */ + protected $auto_delete = null; + /** + * Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem. + * + * Generated from protobuf field optional bool boot = 3029746; + */ + protected $boot = null; + /** + * Specifies the name of the disk attached to the source instance. + * + * Generated from protobuf field optional string device_name = 67541716; + */ + protected $device_name = null; + /** + * The encryption key for the disk. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677; + */ + protected $disk_encryption_key = null; + /** + * The size of the disk in base-2 GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 316263735; + */ + protected $disk_size_gb = null; + /** + * [Output Only] URL of the disk type resource. For example: projects/project /zones/zone/diskTypes/pd-standard or pd-ssd + * + * Generated from protobuf field optional string disk_type = 93009052; + */ + protected $disk_type = null; + /** + * A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545; + */ + private $guest_os_features; + /** + * Specifies zero-based index of the disk that is attached to the source instance. + * + * Generated from protobuf field optional int32 index = 100346066; + */ + protected $index = null; + /** + * Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. + * Check the Interface enum for the list of possible values. + * + * Generated from protobuf field optional string interface = 502623545; + */ + protected $interface = null; + /** + * [Output Only] Type of the resource. Always compute#attachedDisk for attached disks. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * [Output Only] Any valid publicly visible licenses. + * + * Generated from protobuf field repeated string licenses = 337642578; + */ + private $licenses; + /** + * The mode in which this disk is attached to the source instance, either READ_WRITE or READ_ONLY. + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + */ + protected $mode = null; + /** + * Specifies a URL of the disk attached to the source instance. + * + * Generated from protobuf field optional string source = 177235995; + */ + protected $source = null; + /** + * [Output Only] A size of the storage used by the disk's snapshot by this machine image. + * + * Generated from protobuf field optional int64 storage_bytes = 424631719; + */ + protected $storage_bytes = null; + /** + * [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. + * Check the StorageBytesStatus enum for the list of possible values. + * + * Generated from protobuf field optional string storage_bytes_status = 490739082; + */ + protected $storage_bytes_status = null; + /** + * Specifies the type of the attached disk, either SCRATCH or PERSISTENT. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $auto_delete + * Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance). + * @type bool $boot + * Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem. + * @type string $device_name + * Specifies the name of the disk attached to the source instance. + * @type \Google\Cloud\Compute\V1\CustomerEncryptionKey $disk_encryption_key + * The encryption key for the disk. + * @type int|string $disk_size_gb + * The size of the disk in base-2 GB. + * @type string $disk_type + * [Output Only] URL of the disk type resource. For example: projects/project /zones/zone/diskTypes/pd-standard or pd-ssd + * @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. Read Enabling guest operating system features to see a list of available options. + * @type int $index + * Specifies zero-based index of the disk that is attached to the source instance. + * @type string $interface + * Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. + * Check the Interface enum for the list of possible values. + * @type string $kind + * [Output Only] Type of the resource. Always compute#attachedDisk for attached disks. + * @type array|\Google\Protobuf\Internal\RepeatedField $licenses + * [Output Only] Any valid publicly visible licenses. + * @type string $mode + * The mode in which this disk is attached to the source instance, either READ_WRITE or READ_ONLY. + * Check the Mode enum for the list of possible values. + * @type string $source + * Specifies a URL of the disk attached to the source instance. + * @type int|string $storage_bytes + * [Output Only] A size of the storage used by the disk's snapshot by this machine image. + * @type string $storage_bytes_status + * [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. + * Check the StorageBytesStatus enum for the list of possible values. + * @type string $type + * Specifies the type of the attached disk, either SCRATCH or PERSISTENT. + * Check the Type enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance). + * + * Generated from protobuf field optional bool auto_delete = 464761403; + * @return bool + */ + public function getAutoDelete() + { + return isset($this->auto_delete) ? $this->auto_delete : false; + } + + public function hasAutoDelete() + { + return isset($this->auto_delete); + } + + public function clearAutoDelete() + { + unset($this->auto_delete); + } + + /** + * Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance). + * + * Generated from protobuf field optional bool auto_delete = 464761403; + * @param bool $var + * @return $this + */ + public function setAutoDelete($var) + { + GPBUtil::checkBool($var); + $this->auto_delete = $var; + + return $this; + } + + /** + * Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem. + * + * Generated from protobuf field optional bool boot = 3029746; + * @return bool + */ + public function getBoot() + { + return isset($this->boot) ? $this->boot : false; + } + + public function hasBoot() + { + return isset($this->boot); + } + + public function clearBoot() + { + unset($this->boot); + } + + /** + * Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem. + * + * Generated from protobuf field optional bool boot = 3029746; + * @param bool $var + * @return $this + */ + public function setBoot($var) + { + GPBUtil::checkBool($var); + $this->boot = $var; + + return $this; + } + + /** + * Specifies the name of the disk attached to the source instance. + * + * Generated from protobuf field optional string device_name = 67541716; + * @return string + */ + public function getDeviceName() + { + return isset($this->device_name) ? $this->device_name : ''; + } + + public function hasDeviceName() + { + return isset($this->device_name); + } + + public function clearDeviceName() + { + unset($this->device_name); + } + + /** + * Specifies the name of the disk attached to the source instance. + * + * Generated from protobuf field optional string device_name = 67541716; + * @param string $var + * @return $this + */ + public function setDeviceName($var) + { + GPBUtil::checkString($var, True); + $this->device_name = $var; + + return $this; + } + + /** + * The encryption key for the disk. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677; + * @return \Google\Cloud\Compute\V1\CustomerEncryptionKey|null + */ + public function getDiskEncryptionKey() + { + return $this->disk_encryption_key; + } + + public function hasDiskEncryptionKey() + { + return isset($this->disk_encryption_key); + } + + public function clearDiskEncryptionKey() + { + unset($this->disk_encryption_key); + } + + /** + * The encryption key for the disk. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677; + * @param \Google\Cloud\Compute\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setDiskEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomerEncryptionKey::class); + $this->disk_encryption_key = $var; + + return $this; + } + + /** + * The size of the disk in base-2 GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 316263735; + * @return int|string + */ + public function getDiskSizeGb() + { + return isset($this->disk_size_gb) ? $this->disk_size_gb : 0; + } + + public function hasDiskSizeGb() + { + return isset($this->disk_size_gb); + } + + public function clearDiskSizeGb() + { + unset($this->disk_size_gb); + } + + /** + * The size of the disk in base-2 GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 316263735; + * @param int|string $var + * @return $this + */ + public function setDiskSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->disk_size_gb = $var; + + return $this; + } + + /** + * [Output Only] URL of the disk type resource. For example: projects/project /zones/zone/diskTypes/pd-standard or pd-ssd + * + * Generated from protobuf field optional string disk_type = 93009052; + * @return string + */ + public function getDiskType() + { + return isset($this->disk_type) ? $this->disk_type : ''; + } + + public function hasDiskType() + { + return isset($this->disk_type); + } + + public function clearDiskType() + { + unset($this->disk_type); + } + + /** + * [Output Only] URL of the disk type resource. For example: projects/project /zones/zone/diskTypes/pd-standard or pd-ssd + * + * Generated from protobuf field optional string disk_type = 93009052; + * @param string $var + * @return $this + */ + public function setDiskType($var) + { + GPBUtil::checkString($var, True); + $this->disk_type = $var; + + return $this; + } + + /** + * A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGuestOsFeatures() + { + return $this->guest_os_features; + } + + /** + * A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545; + * @param array<\Google\Cloud\Compute\V1\GuestOsFeature>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGuestOsFeatures($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\GuestOsFeature::class); + $this->guest_os_features = $arr; + + return $this; + } + + /** + * Specifies zero-based index of the disk that is attached to the source instance. + * + * Generated from protobuf field optional int32 index = 100346066; + * @return int + */ + public function getIndex() + { + return isset($this->index) ? $this->index : 0; + } + + public function hasIndex() + { + return isset($this->index); + } + + public function clearIndex() + { + unset($this->index); + } + + /** + * Specifies zero-based index of the disk that is attached to the source instance. + * + * Generated from protobuf field optional int32 index = 100346066; + * @param int $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkInt32($var); + $this->index = $var; + + return $this; + } + + /** + * Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. + * Check the Interface enum for the list of possible values. + * + * Generated from protobuf field optional string interface = 502623545; + * @return string + */ + public function getInterface() + { + return isset($this->interface) ? $this->interface : ''; + } + + public function hasInterface() + { + return isset($this->interface); + } + + public function clearInterface() + { + unset($this->interface); + } + + /** + * Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. + * Check the Interface enum for the list of possible values. + * + * Generated from protobuf field optional string interface = 502623545; + * @param string $var + * @return $this + */ + public function setInterface($var) + { + GPBUtil::checkString($var, True); + $this->interface = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#attachedDisk for attached disks. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#attachedDisk for attached disks. + * + * 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] Any valid publicly visible licenses. + * + * Generated from protobuf field repeated string licenses = 337642578; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLicenses() + { + return $this->licenses; + } + + /** + * [Output Only] Any valid publicly visible licenses. + * + * Generated from protobuf field repeated string licenses = 337642578; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLicenses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->licenses = $arr; + + return $this; + } + + /** + * The mode in which this disk is attached to the source instance, either READ_WRITE or READ_ONLY. + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + * @return string + */ + public function getMode() + { + return isset($this->mode) ? $this->mode : ''; + } + + public function hasMode() + { + return isset($this->mode); + } + + public function clearMode() + { + unset($this->mode); + } + + /** + * The mode in which this disk is attached to the source instance, either READ_WRITE or READ_ONLY. + * Check the Mode enum for the list of possible values. + * + * Generated from protobuf field optional string mode = 3357091; + * @param string $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkString($var, True); + $this->mode = $var; + + return $this; + } + + /** + * Specifies a URL of the disk attached to the source instance. + * + * Generated from protobuf field optional string source = 177235995; + * @return string + */ + public function getSource() + { + return isset($this->source) ? $this->source : ''; + } + + public function hasSource() + { + return isset($this->source); + } + + public function clearSource() + { + unset($this->source); + } + + /** + * Specifies a URL of the disk attached to the source instance. + * + * Generated from protobuf field optional string source = 177235995; + * @param string $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkString($var, True); + $this->source = $var; + + return $this; + } + + /** + * [Output Only] A size of the storage used by the disk's snapshot by this machine image. + * + * Generated from protobuf field optional int64 storage_bytes = 424631719; + * @return int|string + */ + public function getStorageBytes() + { + return isset($this->storage_bytes) ? $this->storage_bytes : 0; + } + + public function hasStorageBytes() + { + return isset($this->storage_bytes); + } + + public function clearStorageBytes() + { + unset($this->storage_bytes); + } + + /** + * [Output Only] A size of the storage used by the disk's snapshot by this machine image. + * + * Generated from protobuf field optional int64 storage_bytes = 424631719; + * @param int|string $var + * @return $this + */ + public function setStorageBytes($var) + { + GPBUtil::checkInt64($var); + $this->storage_bytes = $var; + + return $this; + } + + /** + * [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. + * Check the StorageBytesStatus enum for the list of possible values. + * + * Generated from protobuf field optional string storage_bytes_status = 490739082; + * @return string + */ + public function getStorageBytesStatus() + { + return isset($this->storage_bytes_status) ? $this->storage_bytes_status : ''; + } + + public function hasStorageBytesStatus() + { + return isset($this->storage_bytes_status); + } + + public function clearStorageBytesStatus() + { + unset($this->storage_bytes_status); + } + + /** + * [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. + * Check the StorageBytesStatus enum for the list of possible values. + * + * Generated from protobuf field optional string storage_bytes_status = 490739082; + * @param string $var + * @return $this + */ + public function setStorageBytesStatus($var) + { + GPBUtil::checkString($var, True); + $this->storage_bytes_status = $var; + + return $this; + } + + /** + * Specifies the type of the attached disk, either SCRATCH or PERSISTENT. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * Specifies the type of the attached disk, either SCRATCH or PERSISTENT. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedAttachedDisk/Mode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedAttachedDisk/Mode.php new file mode 100644 index 000000000000..dc84303b6764 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedAttachedDisk/Mode.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.SavedAttachedDisk.Mode + */ +class Mode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MODE = 0; + */ + const UNDEFINED_MODE = 0; + /** + * Attaches this disk in read-only mode. Multiple virtual machines can use a disk in read-only mode at a time. + * + * Generated from protobuf enum READ_ONLY = 91950261; + */ + const READ_ONLY = 91950261; + /** + * *[Default]* Attaches this disk in read-write mode. Only one virtual machine at a time can be attached to a disk in read-write mode. + * + * Generated from protobuf enum READ_WRITE = 173607894; + */ + const READ_WRITE = 173607894; + + private static $valueToName = [ + self::UNDEFINED_MODE => 'UNDEFINED_MODE', + self::READ_ONLY => 'READ_ONLY', + self::READ_WRITE => 'READ_WRITE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Mode::class, \Google\Cloud\Compute\V1\SavedAttachedDisk_Mode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedAttachedDisk/PBInterface.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedAttachedDisk/PBInterface.php new file mode 100644 index 000000000000..1f45d2c8aa72 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedAttachedDisk/PBInterface.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.SavedAttachedDisk.Interface + */ +class PBInterface +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_INTERFACE = 0; + */ + const UNDEFINED_INTERFACE = 0; + /** + * Generated from protobuf enum NVME = 2408800; + */ + const NVME = 2408800; + /** + * Generated from protobuf enum SCSI = 2539686; + */ + const SCSI = 2539686; + + private static $valueToName = [ + self::UNDEFINED_INTERFACE => 'UNDEFINED_INTERFACE', + self::NVME => 'NVME', + self::SCSI => 'SCSI', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PBInterface::class, \Google\Cloud\Compute\V1\SavedAttachedDisk_Interface::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedAttachedDisk/StorageBytesStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedAttachedDisk/StorageBytesStatus.php new file mode 100644 index 000000000000..07088edf67ea --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedAttachedDisk/StorageBytesStatus.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.SavedAttachedDisk.StorageBytesStatus + */ +class StorageBytesStatus +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STORAGE_BYTES_STATUS = 0; + */ + const UNDEFINED_STORAGE_BYTES_STATUS = 0; + /** + * Generated from protobuf enum UPDATING = 494614342; + */ + const UPDATING = 494614342; + /** + * Generated from protobuf enum UP_TO_DATE = 101306702; + */ + const UP_TO_DATE = 101306702; + + private static $valueToName = [ + self::UNDEFINED_STORAGE_BYTES_STATUS => 'UNDEFINED_STORAGE_BYTES_STATUS', + self::UPDATING => 'UPDATING', + self::UP_TO_DATE => 'UP_TO_DATE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StorageBytesStatus::class, \Google\Cloud\Compute\V1\SavedAttachedDisk_StorageBytesStatus::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedAttachedDisk/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedAttachedDisk/Type.php new file mode 100644 index 000000000000..49edbe6c8149 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedAttachedDisk/Type.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.SavedAttachedDisk.Type + */ +class Type +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TYPE = 0; + */ + const UNDEFINED_TYPE = 0; + /** + * Generated from protobuf enum PERSISTENT = 460683927; + */ + const PERSISTENT = 460683927; + /** + * Generated from protobuf enum SCRATCH = 496778970; + */ + const SCRATCH = 496778970; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::PERSISTENT => 'PERSISTENT', + self::SCRATCH => 'SCRATCH', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Compute\V1\SavedAttachedDisk_Type::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedDisk.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedDisk.php new file mode 100644 index 000000000000..483ecf737ad0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedDisk.php @@ -0,0 +1,261 @@ +google.cloud.compute.v1.SavedDisk + */ +class SavedDisk extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The architecture of the attached disk. + * Check the Architecture enum for the list of possible values. + * + * Generated from protobuf field optional string architecture = 302803283; + */ + protected $architecture = null; + /** + * [Output Only] Type of the resource. Always compute#savedDisk for attached disks. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * Specifies a URL of the disk attached to the source instance. + * + * Generated from protobuf field optional string source_disk = 451753793; + */ + protected $source_disk = null; + /** + * [Output Only] Size of the individual disk snapshot used by this machine image. + * + * Generated from protobuf field optional int64 storage_bytes = 424631719; + */ + protected $storage_bytes = null; + /** + * [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. + * Check the StorageBytesStatus enum for the list of possible values. + * + * Generated from protobuf field optional string storage_bytes_status = 490739082; + */ + protected $storage_bytes_status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $architecture + * [Output Only] The architecture of the attached disk. + * Check the Architecture enum for the list of possible values. + * @type string $kind + * [Output Only] Type of the resource. Always compute#savedDisk for attached disks. + * @type string $source_disk + * Specifies a URL of the disk attached to the source instance. + * @type int|string $storage_bytes + * [Output Only] Size of the individual disk snapshot used by this machine image. + * @type string $storage_bytes_status + * [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. + * Check the StorageBytesStatus enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The architecture of the attached disk. + * Check the Architecture enum for the list of possible values. + * + * Generated from protobuf field optional string architecture = 302803283; + * @return string + */ + public function getArchitecture() + { + return isset($this->architecture) ? $this->architecture : ''; + } + + public function hasArchitecture() + { + return isset($this->architecture); + } + + public function clearArchitecture() + { + unset($this->architecture); + } + + /** + * [Output Only] The architecture of the attached disk. + * Check the Architecture enum for the list of possible values. + * + * Generated from protobuf field optional string architecture = 302803283; + * @param string $var + * @return $this + */ + public function setArchitecture($var) + { + GPBUtil::checkString($var, True); + $this->architecture = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#savedDisk for attached disks. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#savedDisk for attached disks. + * + * 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; + } + + /** + * Specifies a URL of the disk attached to the source instance. + * + * Generated from protobuf field optional string source_disk = 451753793; + * @return string + */ + public function getSourceDisk() + { + return isset($this->source_disk) ? $this->source_disk : ''; + } + + public function hasSourceDisk() + { + return isset($this->source_disk); + } + + public function clearSourceDisk() + { + unset($this->source_disk); + } + + /** + * Specifies a URL of the disk attached to the source instance. + * + * Generated from protobuf field optional string source_disk = 451753793; + * @param string $var + * @return $this + */ + public function setSourceDisk($var) + { + GPBUtil::checkString($var, True); + $this->source_disk = $var; + + return $this; + } + + /** + * [Output Only] Size of the individual disk snapshot used by this machine image. + * + * Generated from protobuf field optional int64 storage_bytes = 424631719; + * @return int|string + */ + public function getStorageBytes() + { + return isset($this->storage_bytes) ? $this->storage_bytes : 0; + } + + public function hasStorageBytes() + { + return isset($this->storage_bytes); + } + + public function clearStorageBytes() + { + unset($this->storage_bytes); + } + + /** + * [Output Only] Size of the individual disk snapshot used by this machine image. + * + * Generated from protobuf field optional int64 storage_bytes = 424631719; + * @param int|string $var + * @return $this + */ + public function setStorageBytes($var) + { + GPBUtil::checkInt64($var); + $this->storage_bytes = $var; + + return $this; + } + + /** + * [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. + * Check the StorageBytesStatus enum for the list of possible values. + * + * Generated from protobuf field optional string storage_bytes_status = 490739082; + * @return string + */ + public function getStorageBytesStatus() + { + return isset($this->storage_bytes_status) ? $this->storage_bytes_status : ''; + } + + public function hasStorageBytesStatus() + { + return isset($this->storage_bytes_status); + } + + public function clearStorageBytesStatus() + { + unset($this->storage_bytes_status); + } + + /** + * [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. + * Check the StorageBytesStatus enum for the list of possible values. + * + * Generated from protobuf field optional string storage_bytes_status = 490739082; + * @param string $var + * @return $this + */ + public function setStorageBytesStatus($var) + { + GPBUtil::checkString($var, True); + $this->storage_bytes_status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedDisk/Architecture.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedDisk/Architecture.php new file mode 100644 index 000000000000..d168f7d480ec --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedDisk/Architecture.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.SavedDisk.Architecture + */ +class Architecture +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ARCHITECTURE = 0; + */ + const UNDEFINED_ARCHITECTURE = 0; + /** + * Default value indicating Architecture is not set. + * + * Generated from protobuf enum ARCHITECTURE_UNSPECIFIED = 394750507; + */ + const ARCHITECTURE_UNSPECIFIED = 394750507; + /** + * Machines with architecture ARM64 + * + * Generated from protobuf enum ARM64 = 62547450; + */ + const ARM64 = 62547450; + /** + * Machines with architecture X86_64 + * + * Generated from protobuf enum X86_64 = 425300551; + */ + const X86_64 = 425300551; + + private static $valueToName = [ + self::UNDEFINED_ARCHITECTURE => 'UNDEFINED_ARCHITECTURE', + self::ARCHITECTURE_UNSPECIFIED => 'ARCHITECTURE_UNSPECIFIED', + self::ARM64 => 'ARM64', + self::X86_64 => 'X86_64', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Architecture::class, \Google\Cloud\Compute\V1\SavedDisk_Architecture::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedDisk/StorageBytesStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedDisk/StorageBytesStatus.php new file mode 100644 index 000000000000..b5e7ddf6b8e1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SavedDisk/StorageBytesStatus.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.SavedDisk.StorageBytesStatus + */ +class StorageBytesStatus +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STORAGE_BYTES_STATUS = 0; + */ + const UNDEFINED_STORAGE_BYTES_STATUS = 0; + /** + * Generated from protobuf enum UPDATING = 494614342; + */ + const UPDATING = 494614342; + /** + * Generated from protobuf enum UP_TO_DATE = 101306702; + */ + const UP_TO_DATE = 101306702; + + private static $valueToName = [ + self::UNDEFINED_STORAGE_BYTES_STATUS => 'UNDEFINED_STORAGE_BYTES_STATUS', + self::UPDATING => 'UPDATING', + self::UP_TO_DATE => 'UP_TO_DATE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StorageBytesStatus::class, \Google\Cloud\Compute\V1\SavedDisk_StorageBytesStatus::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ScalingScheduleStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ScalingScheduleStatus.php new file mode 100644 index 000000000000..eaceb3778795 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ScalingScheduleStatus.php @@ -0,0 +1,168 @@ +google.cloud.compute.v1.ScalingScheduleStatus + */ +class ScalingScheduleStatus extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The last time the scaling schedule became active. Note: this is a timestamp when a schedule actually became active, not when it was planned to do so. The timestamp is in RFC3339 text format. + * + * Generated from protobuf field optional string last_start_time = 34545107; + */ + protected $last_start_time = null; + /** + * [Output Only] The next time the scaling schedule is to become active. Note: this is a timestamp when a schedule is planned to run, but the actual time might be slightly different. The timestamp is in RFC3339 text format. + * + * Generated from protobuf field optional string next_start_time = 97270102; + */ + protected $next_start_time = null; + /** + * [Output Only] The current state of a scaling schedule. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + */ + protected $state = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $last_start_time + * [Output Only] The last time the scaling schedule became active. Note: this is a timestamp when a schedule actually became active, not when it was planned to do so. The timestamp is in RFC3339 text format. + * @type string $next_start_time + * [Output Only] The next time the scaling schedule is to become active. Note: this is a timestamp when a schedule is planned to run, but the actual time might be slightly different. The timestamp is in RFC3339 text format. + * @type string $state + * [Output Only] The current state of a scaling schedule. + * Check the State enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The last time the scaling schedule became active. Note: this is a timestamp when a schedule actually became active, not when it was planned to do so. The timestamp is in RFC3339 text format. + * + * Generated from protobuf field optional string last_start_time = 34545107; + * @return string + */ + public function getLastStartTime() + { + return isset($this->last_start_time) ? $this->last_start_time : ''; + } + + public function hasLastStartTime() + { + return isset($this->last_start_time); + } + + public function clearLastStartTime() + { + unset($this->last_start_time); + } + + /** + * [Output Only] The last time the scaling schedule became active. Note: this is a timestamp when a schedule actually became active, not when it was planned to do so. The timestamp is in RFC3339 text format. + * + * Generated from protobuf field optional string last_start_time = 34545107; + * @param string $var + * @return $this + */ + public function setLastStartTime($var) + { + GPBUtil::checkString($var, True); + $this->last_start_time = $var; + + return $this; + } + + /** + * [Output Only] The next time the scaling schedule is to become active. Note: this is a timestamp when a schedule is planned to run, but the actual time might be slightly different. The timestamp is in RFC3339 text format. + * + * Generated from protobuf field optional string next_start_time = 97270102; + * @return string + */ + public function getNextStartTime() + { + return isset($this->next_start_time) ? $this->next_start_time : ''; + } + + public function hasNextStartTime() + { + return isset($this->next_start_time); + } + + public function clearNextStartTime() + { + unset($this->next_start_time); + } + + /** + * [Output Only] The next time the scaling schedule is to become active. Note: this is a timestamp when a schedule is planned to run, but the actual time might be slightly different. The timestamp is in RFC3339 text format. + * + * Generated from protobuf field optional string next_start_time = 97270102; + * @param string $var + * @return $this + */ + public function setNextStartTime($var) + { + GPBUtil::checkString($var, True); + $this->next_start_time = $var; + + return $this; + } + + /** + * [Output Only] The current state of a scaling schedule. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @return string + */ + public function getState() + { + return isset($this->state) ? $this->state : ''; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * [Output Only] The current state of a scaling schedule. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ScalingScheduleStatus/State.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ScalingScheduleStatus/State.php new file mode 100644 index 000000000000..7b96a5f3039d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ScalingScheduleStatus/State.php @@ -0,0 +1,78 @@ +google.cloud.compute.v1.ScalingScheduleStatus.State + */ +class State +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATE = 0; + */ + const UNDEFINED_STATE = 0; + /** + * The current autoscaling recommendation is influenced by this scaling schedule. + * + * Generated from protobuf enum ACTIVE = 314733318; + */ + const ACTIVE = 314733318; + /** + * This scaling schedule has been disabled by the user. + * + * Generated from protobuf enum DISABLED = 516696700; + */ + const DISABLED = 516696700; + /** + * This scaling schedule will never become active again. + * + * Generated from protobuf enum OBSOLETE = 66532761; + */ + const OBSOLETE = 66532761; + /** + * The current autoscaling recommendation is not influenced by this scaling schedule. + * + * Generated from protobuf enum READY = 77848963; + */ + const READY = 77848963; + + private static $valueToName = [ + self::UNDEFINED_STATE => 'UNDEFINED_STATE', + self::ACTIVE => 'ACTIVE', + self::DISABLED => 'DISABLED', + self::OBSOLETE => 'OBSOLETE', + self::READY => 'READY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Compute\V1\ScalingScheduleStatus_State::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Scheduling.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Scheduling.php new file mode 100644 index 000000000000..debe8f29ecd7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Scheduling.php @@ -0,0 +1,431 @@ +google.cloud.compute.v1.Scheduling + */ +class Scheduling extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances. Preemptible instances cannot be automatically restarted. By default, this is set to true so an instance is automatically restarted if it is terminated by Compute Engine. + * + * Generated from protobuf field optional bool automatic_restart = 350821371; + */ + protected $automatic_restart = null; + /** + * Specifies the termination action for the instance. + * Check the InstanceTerminationAction enum for the list of possible values. + * + * Generated from protobuf field optional string instance_termination_action = 107380667; + */ + protected $instance_termination_action = null; + /** + * Specifies the maximum amount of time a Local Ssd Vm should wait while recovery of the Local Ssd state is attempted. Its value should be in between 0 and 168 hours with hour granularity and the default value being 1 hour. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration local_ssd_recovery_timeout = 268015590; + */ + protected $local_ssd_recovery_timeout = null; + /** + * An opaque location hint used to place the instance close to other resources. This field is for use by internal tools that use the public API. + * + * Generated from protobuf field optional string location_hint = 350519505; + */ + protected $location_hint = null; + /** + * The minimum number of virtual CPUs this instance will consume when running on a sole-tenant node. + * + * Generated from protobuf field optional int32 min_node_cpus = 317231675; + */ + protected $min_node_cpus = null; + /** + * A set of node affinity and anti-affinity configurations. Refer to Configuring node affinity for more information. Overrides reservationAffinity. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971; + */ + private $node_affinities; + /** + * Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Set VM host maintenance policy. + * Check the OnHostMaintenance enum for the list of possible values. + * + * Generated from protobuf field optional string on_host_maintenance = 64616796; + */ + protected $on_host_maintenance = null; + /** + * Defines whether the instance is preemptible. This can only be set during instance creation or while the instance is stopped and therefore, in a `TERMINATED` state. See Instance Life Cycle for more information on the possible instance states. + * + * Generated from protobuf field optional bool preemptible = 324203169; + */ + protected $preemptible = null; + /** + * Specifies the provisioning model of the instance. + * Check the ProvisioningModel enum for the list of possible values. + * + * Generated from protobuf field optional string provisioning_model = 494423; + */ + protected $provisioning_model = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $automatic_restart + * Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances. Preemptible instances cannot be automatically restarted. By default, this is set to true so an instance is automatically restarted if it is terminated by Compute Engine. + * @type string $instance_termination_action + * Specifies the termination action for the instance. + * Check the InstanceTerminationAction enum for the list of possible values. + * @type \Google\Cloud\Compute\V1\Duration $local_ssd_recovery_timeout + * Specifies the maximum amount of time a Local Ssd Vm should wait while recovery of the Local Ssd state is attempted. Its value should be in between 0 and 168 hours with hour granularity and the default value being 1 hour. + * @type string $location_hint + * An opaque location hint used to place the instance close to other resources. This field is for use by internal tools that use the public API. + * @type int $min_node_cpus + * The minimum number of virtual CPUs this instance will consume when running on a sole-tenant node. + * @type array<\Google\Cloud\Compute\V1\SchedulingNodeAffinity>|\Google\Protobuf\Internal\RepeatedField $node_affinities + * A set of node affinity and anti-affinity configurations. Refer to Configuring node affinity for more information. Overrides reservationAffinity. + * @type string $on_host_maintenance + * Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Set VM host maintenance policy. + * Check the OnHostMaintenance enum for the list of possible values. + * @type bool $preemptible + * Defines whether the instance is preemptible. This can only be set during instance creation or while the instance is stopped and therefore, in a `TERMINATED` state. See Instance Life Cycle for more information on the possible instance states. + * @type string $provisioning_model + * Specifies the provisioning model of the instance. + * Check the ProvisioningModel enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances. Preemptible instances cannot be automatically restarted. By default, this is set to true so an instance is automatically restarted if it is terminated by Compute Engine. + * + * Generated from protobuf field optional bool automatic_restart = 350821371; + * @return bool + */ + public function getAutomaticRestart() + { + return isset($this->automatic_restart) ? $this->automatic_restart : false; + } + + public function hasAutomaticRestart() + { + return isset($this->automatic_restart); + } + + public function clearAutomaticRestart() + { + unset($this->automatic_restart); + } + + /** + * Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances. Preemptible instances cannot be automatically restarted. By default, this is set to true so an instance is automatically restarted if it is terminated by Compute Engine. + * + * Generated from protobuf field optional bool automatic_restart = 350821371; + * @param bool $var + * @return $this + */ + public function setAutomaticRestart($var) + { + GPBUtil::checkBool($var); + $this->automatic_restart = $var; + + return $this; + } + + /** + * Specifies the termination action for the instance. + * Check the InstanceTerminationAction enum for the list of possible values. + * + * Generated from protobuf field optional string instance_termination_action = 107380667; + * @return string + */ + public function getInstanceTerminationAction() + { + return isset($this->instance_termination_action) ? $this->instance_termination_action : ''; + } + + public function hasInstanceTerminationAction() + { + return isset($this->instance_termination_action); + } + + public function clearInstanceTerminationAction() + { + unset($this->instance_termination_action); + } + + /** + * Specifies the termination action for the instance. + * Check the InstanceTerminationAction enum for the list of possible values. + * + * Generated from protobuf field optional string instance_termination_action = 107380667; + * @param string $var + * @return $this + */ + public function setInstanceTerminationAction($var) + { + GPBUtil::checkString($var, True); + $this->instance_termination_action = $var; + + return $this; + } + + /** + * Specifies the maximum amount of time a Local Ssd Vm should wait while recovery of the Local Ssd state is attempted. Its value should be in between 0 and 168 hours with hour granularity and the default value being 1 hour. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration local_ssd_recovery_timeout = 268015590; + * @return \Google\Cloud\Compute\V1\Duration|null + */ + public function getLocalSsdRecoveryTimeout() + { + return $this->local_ssd_recovery_timeout; + } + + public function hasLocalSsdRecoveryTimeout() + { + return isset($this->local_ssd_recovery_timeout); + } + + public function clearLocalSsdRecoveryTimeout() + { + unset($this->local_ssd_recovery_timeout); + } + + /** + * Specifies the maximum amount of time a Local Ssd Vm should wait while recovery of the Local Ssd state is attempted. Its value should be in between 0 and 168 hours with hour granularity and the default value being 1 hour. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration local_ssd_recovery_timeout = 268015590; + * @param \Google\Cloud\Compute\V1\Duration $var + * @return $this + */ + public function setLocalSsdRecoveryTimeout($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Duration::class); + $this->local_ssd_recovery_timeout = $var; + + return $this; + } + + /** + * An opaque location hint used to place the instance close to other resources. This field is for use by internal tools that use the public API. + * + * Generated from protobuf field optional string location_hint = 350519505; + * @return string + */ + public function getLocationHint() + { + return isset($this->location_hint) ? $this->location_hint : ''; + } + + public function hasLocationHint() + { + return isset($this->location_hint); + } + + public function clearLocationHint() + { + unset($this->location_hint); + } + + /** + * An opaque location hint used to place the instance close to other resources. This field is for use by internal tools that use the public API. + * + * Generated from protobuf field optional string location_hint = 350519505; + * @param string $var + * @return $this + */ + public function setLocationHint($var) + { + GPBUtil::checkString($var, True); + $this->location_hint = $var; + + return $this; + } + + /** + * The minimum number of virtual CPUs this instance will consume when running on a sole-tenant node. + * + * Generated from protobuf field optional int32 min_node_cpus = 317231675; + * @return int + */ + public function getMinNodeCpus() + { + return isset($this->min_node_cpus) ? $this->min_node_cpus : 0; + } + + public function hasMinNodeCpus() + { + return isset($this->min_node_cpus); + } + + public function clearMinNodeCpus() + { + unset($this->min_node_cpus); + } + + /** + * The minimum number of virtual CPUs this instance will consume when running on a sole-tenant node. + * + * Generated from protobuf field optional int32 min_node_cpus = 317231675; + * @param int $var + * @return $this + */ + public function setMinNodeCpus($var) + { + GPBUtil::checkInt32($var); + $this->min_node_cpus = $var; + + return $this; + } + + /** + * A set of node affinity and anti-affinity configurations. Refer to Configuring node affinity for more information. Overrides reservationAffinity. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNodeAffinities() + { + return $this->node_affinities; + } + + /** + * A set of node affinity and anti-affinity configurations. Refer to Configuring node affinity for more information. Overrides reservationAffinity. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971; + * @param array<\Google\Cloud\Compute\V1\SchedulingNodeAffinity>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNodeAffinities($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SchedulingNodeAffinity::class); + $this->node_affinities = $arr; + + return $this; + } + + /** + * Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Set VM host maintenance policy. + * Check the OnHostMaintenance enum for the list of possible values. + * + * Generated from protobuf field optional string on_host_maintenance = 64616796; + * @return string + */ + public function getOnHostMaintenance() + { + return isset($this->on_host_maintenance) ? $this->on_host_maintenance : ''; + } + + public function hasOnHostMaintenance() + { + return isset($this->on_host_maintenance); + } + + public function clearOnHostMaintenance() + { + unset($this->on_host_maintenance); + } + + /** + * Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Set VM host maintenance policy. + * Check the OnHostMaintenance enum for the list of possible values. + * + * Generated from protobuf field optional string on_host_maintenance = 64616796; + * @param string $var + * @return $this + */ + public function setOnHostMaintenance($var) + { + GPBUtil::checkString($var, True); + $this->on_host_maintenance = $var; + + return $this; + } + + /** + * Defines whether the instance is preemptible. This can only be set during instance creation or while the instance is stopped and therefore, in a `TERMINATED` state. See Instance Life Cycle for more information on the possible instance states. + * + * Generated from protobuf field optional bool preemptible = 324203169; + * @return bool + */ + public function getPreemptible() + { + return isset($this->preemptible) ? $this->preemptible : false; + } + + public function hasPreemptible() + { + return isset($this->preemptible); + } + + public function clearPreemptible() + { + unset($this->preemptible); + } + + /** + * Defines whether the instance is preemptible. This can only be set during instance creation or while the instance is stopped and therefore, in a `TERMINATED` state. See Instance Life Cycle for more information on the possible instance states. + * + * Generated from protobuf field optional bool preemptible = 324203169; + * @param bool $var + * @return $this + */ + public function setPreemptible($var) + { + GPBUtil::checkBool($var); + $this->preemptible = $var; + + return $this; + } + + /** + * Specifies the provisioning model of the instance. + * Check the ProvisioningModel enum for the list of possible values. + * + * Generated from protobuf field optional string provisioning_model = 494423; + * @return string + */ + public function getProvisioningModel() + { + return isset($this->provisioning_model) ? $this->provisioning_model : ''; + } + + public function hasProvisioningModel() + { + return isset($this->provisioning_model); + } + + public function clearProvisioningModel() + { + unset($this->provisioning_model); + } + + /** + * Specifies the provisioning model of the instance. + * Check the ProvisioningModel enum for the list of possible values. + * + * Generated from protobuf field optional string provisioning_model = 494423; + * @param string $var + * @return $this + */ + public function setProvisioningModel($var) + { + GPBUtil::checkString($var, True); + $this->provisioning_model = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Scheduling/InstanceTerminationAction.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Scheduling/InstanceTerminationAction.php new file mode 100644 index 000000000000..73cbf6d0b461 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Scheduling/InstanceTerminationAction.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.Scheduling.InstanceTerminationAction + */ +class InstanceTerminationAction +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_INSTANCE_TERMINATION_ACTION = 0; + */ + const UNDEFINED_INSTANCE_TERMINATION_ACTION = 0; + /** + * Delete the VM. + * + * Generated from protobuf enum DELETE = 402225579; + */ + const DELETE = 402225579; + /** + * Default value. This value is unused. + * + * Generated from protobuf enum INSTANCE_TERMINATION_ACTION_UNSPECIFIED = 92954803; + */ + const INSTANCE_TERMINATION_ACTION_UNSPECIFIED = 92954803; + /** + * Stop the VM without storing in-memory content. default action. + * + * Generated from protobuf enum STOP = 2555906; + */ + const STOP = 2555906; + + private static $valueToName = [ + self::UNDEFINED_INSTANCE_TERMINATION_ACTION => 'UNDEFINED_INSTANCE_TERMINATION_ACTION', + self::DELETE => 'DELETE', + self::INSTANCE_TERMINATION_ACTION_UNSPECIFIED => 'INSTANCE_TERMINATION_ACTION_UNSPECIFIED', + self::STOP => 'STOP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(InstanceTerminationAction::class, \Google\Cloud\Compute\V1\Scheduling_InstanceTerminationAction::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Scheduling/OnHostMaintenance.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Scheduling/OnHostMaintenance.php new file mode 100644 index 000000000000..03323a5e7aab --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Scheduling/OnHostMaintenance.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.Scheduling.OnHostMaintenance + */ +class OnHostMaintenance +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ON_HOST_MAINTENANCE = 0; + */ + const UNDEFINED_ON_HOST_MAINTENANCE = 0; + /** + * *[Default]* Allows Compute Engine to automatically migrate instances out of the way of maintenance events. + * + * Generated from protobuf enum MIGRATE = 165699979; + */ + const MIGRATE = 165699979; + /** + * Tells Compute Engine to terminate and (optionally) restart the instance away from the maintenance activity. If you would like your instance to be restarted, set the automaticRestart flag to true. Your instance may be restarted more than once, and it may be restarted outside the window of maintenance events. + * + * Generated from protobuf enum TERMINATE = 527617601; + */ + const TERMINATE = 527617601; + + private static $valueToName = [ + self::UNDEFINED_ON_HOST_MAINTENANCE => 'UNDEFINED_ON_HOST_MAINTENANCE', + self::MIGRATE => 'MIGRATE', + self::TERMINATE => 'TERMINATE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(OnHostMaintenance::class, \Google\Cloud\Compute\V1\Scheduling_OnHostMaintenance::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Scheduling/ProvisioningModel.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Scheduling/ProvisioningModel.php new file mode 100644 index 000000000000..224c236af829 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Scheduling/ProvisioningModel.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.Scheduling.ProvisioningModel + */ +class ProvisioningModel +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PROVISIONING_MODEL = 0; + */ + const UNDEFINED_PROVISIONING_MODEL = 0; + /** + * Heavily discounted, no guaranteed runtime. + * + * Generated from protobuf enum SPOT = 2552066; + */ + const SPOT = 2552066; + /** + * Standard provisioning with user controlled runtime, no discounts. + * + * Generated from protobuf enum STANDARD = 484642493; + */ + const STANDARD = 484642493; + + private static $valueToName = [ + self::UNDEFINED_PROVISIONING_MODEL => 'UNDEFINED_PROVISIONING_MODEL', + self::SPOT => 'SPOT', + self::STANDARD => 'STANDARD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ProvisioningModel::class, \Google\Cloud\Compute\V1\Scheduling_ProvisioningModel::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SchedulingNodeAffinity.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SchedulingNodeAffinity.php new file mode 100644 index 000000000000..c2d90f28a17f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SchedulingNodeAffinity.php @@ -0,0 +1,159 @@ +google.cloud.compute.v1.SchedulingNodeAffinity + */ +class SchedulingNodeAffinity extends \Google\Protobuf\Internal\Message +{ + /** + * Corresponds to the label key of Node resource. + * + * Generated from protobuf field optional string key = 106079; + */ + protected $key = null; + /** + * Defines the operation of node selection. Valid operators are IN for affinity and NOT_IN for anti-affinity. + * Check the Operator enum for the list of possible values. + * + * Generated from protobuf field optional string operator = 36317348; + */ + protected $operator = null; + /** + * Corresponds to the label values of Node resource. + * + * Generated from protobuf field repeated string values = 249928994; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * Corresponds to the label key of Node resource. + * @type string $operator + * Defines the operation of node selection. Valid operators are IN for affinity and NOT_IN for anti-affinity. + * Check the Operator enum for the list of possible values. + * @type array|\Google\Protobuf\Internal\RepeatedField $values + * Corresponds to the label values of Node resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Corresponds to the label key of Node resource. + * + * Generated from protobuf field optional string key = 106079; + * @return string + */ + public function getKey() + { + return isset($this->key) ? $this->key : ''; + } + + public function hasKey() + { + return isset($this->key); + } + + public function clearKey() + { + unset($this->key); + } + + /** + * Corresponds to the label key of Node resource. + * + * Generated from protobuf field optional string key = 106079; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Defines the operation of node selection. Valid operators are IN for affinity and NOT_IN for anti-affinity. + * Check the Operator enum for the list of possible values. + * + * Generated from protobuf field optional string operator = 36317348; + * @return string + */ + public function getOperator() + { + return isset($this->operator) ? $this->operator : ''; + } + + public function hasOperator() + { + return isset($this->operator); + } + + public function clearOperator() + { + unset($this->operator); + } + + /** + * Defines the operation of node selection. Valid operators are IN for affinity and NOT_IN for anti-affinity. + * Check the Operator enum for the list of possible values. + * + * Generated from protobuf field optional string operator = 36317348; + * @param string $var + * @return $this + */ + public function setOperator($var) + { + GPBUtil::checkString($var, True); + $this->operator = $var; + + return $this; + } + + /** + * Corresponds to the label values of Node resource. + * + * Generated from protobuf field repeated string values = 249928994; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * Corresponds to the label values of Node resource. + * + * Generated from protobuf field repeated string values = 249928994; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->values = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SchedulingNodeAffinity/Operator.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SchedulingNodeAffinity/Operator.php new file mode 100644 index 000000000000..0b204ae18faa --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SchedulingNodeAffinity/Operator.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.SchedulingNodeAffinity.Operator + */ +class Operator +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_OPERATOR = 0; + */ + const UNDEFINED_OPERATOR = 0; + /** + * Requires Compute Engine to seek for matched nodes. + * + * Generated from protobuf enum IN = 2341; + */ + const IN = 2341; + /** + * Requires Compute Engine to avoid certain nodes. + * + * Generated from protobuf enum NOT_IN = 161144369; + */ + const NOT_IN = 161144369; + /** + * Generated from protobuf enum OPERATOR_UNSPECIFIED = 128892924; + */ + const OPERATOR_UNSPECIFIED = 128892924; + + private static $valueToName = [ + self::UNDEFINED_OPERATOR => 'UNDEFINED_OPERATOR', + self::IN => 'IN', + self::NOT_IN => 'NOT_IN', + self::OPERATOR_UNSPECIFIED => 'OPERATOR_UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Operator::class, \Google\Cloud\Compute\V1\SchedulingNodeAffinity_Operator::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ScratchDisks.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ScratchDisks.php new file mode 100644 index 000000000000..ec6d045d5492 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ScratchDisks.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.ScratchDisks + */ +class ScratchDisks extends \Google\Protobuf\Internal\Message +{ + /** + * Size of the scratch disk, defined in GB. + * + * Generated from protobuf field optional int32 disk_gb = 60990141; + */ + protected $disk_gb = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $disk_gb + * Size of the scratch disk, defined in GB. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Size of the scratch disk, defined in GB. + * + * Generated from protobuf field optional int32 disk_gb = 60990141; + * @return int + */ + public function getDiskGb() + { + return isset($this->disk_gb) ? $this->disk_gb : 0; + } + + public function hasDiskGb() + { + return isset($this->disk_gb); + } + + public function clearDiskGb() + { + unset($this->disk_gb); + } + + /** + * Size of the scratch disk, defined in GB. + * + * Generated from protobuf field optional int32 disk_gb = 60990141; + * @param int $var + * @return $this + */ + public function setDiskGb($var) + { + GPBUtil::checkInt32($var); + $this->disk_gb = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Screenshot.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Screenshot.php new file mode 100644 index 000000000000..c550d1905ed0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Screenshot.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.Screenshot + */ +class Screenshot extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The Base64-encoded screenshot data. + * + * Generated from protobuf field optional string contents = 506419994; + */ + protected $contents = null; + /** + * [Output Only] Type of the resource. Always compute#screenshot for the screenshots. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $contents + * [Output Only] The Base64-encoded screenshot data. + * @type string $kind + * [Output Only] Type of the resource. Always compute#screenshot for the screenshots. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The Base64-encoded screenshot data. + * + * Generated from protobuf field optional string contents = 506419994; + * @return string + */ + public function getContents() + { + return isset($this->contents) ? $this->contents : ''; + } + + public function hasContents() + { + return isset($this->contents); + } + + public function clearContents() + { + unset($this->contents); + } + + /** + * [Output Only] The Base64-encoded screenshot data. + * + * Generated from protobuf field optional string contents = 506419994; + * @param string $var + * @return $this + */ + public function setContents($var) + { + GPBUtil::checkString($var, True); + $this->contents = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#screenshot for the screenshots. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#screenshot for the screenshots. + * + * 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPoliciesAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPoliciesAggregatedList.php new file mode 100644 index 000000000000..b9d2ab1d011c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPoliciesAggregatedList.php @@ -0,0 +1,357 @@ +google.cloud.compute.v1.SecurityPoliciesAggregatedList + */ +class SecurityPoliciesAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string etag = 3123477; + */ + protected $etag = null; + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of SecurityPoliciesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#securityPolicyAggregatedList for lists of Security Policies. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $etag + * @type string $id + * [Output Only] Unique identifier for the resource; defined by the server. + * @type array|\Google\Protobuf\Internal\MapField $items + * A list of SecurityPoliciesScopedList resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#securityPolicyAggregatedList for lists of Security Policies. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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); + } + + /** + * Generated from protobuf field optional string etag = 3123477; + * @return string + */ + public function getEtag() + { + return isset($this->etag) ? $this->etag : ''; + } + + public function hasEtag() + { + return isset($this->etag); + } + + public function clearEtag() + { + unset($this->etag); + } + + /** + * Generated from protobuf field optional string etag = 3123477; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * [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 SecurityPoliciesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of SecurityPoliciesScopedList 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\SecurityPoliciesScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#securityPolicyAggregatedList for lists of Security Policies. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#securityPolicyAggregatedList for lists of Security Policies. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPoliciesListPreconfiguredExpressionSetsResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPoliciesListPreconfiguredExpressionSetsResponse.php new file mode 100644 index 000000000000..1e5dded2a7a6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPoliciesListPreconfiguredExpressionSetsResponse.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse + */ +class SecurityPoliciesListPreconfiguredExpressionSetsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPoliciesWafConfig preconfigured_expression_sets = 536200826; + */ + protected $preconfigured_expression_sets = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\SecurityPoliciesWafConfig $preconfigured_expression_sets + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPoliciesWafConfig preconfigured_expression_sets = 536200826; + * @return \Google\Cloud\Compute\V1\SecurityPoliciesWafConfig|null + */ + public function getPreconfiguredExpressionSets() + { + return $this->preconfigured_expression_sets; + } + + public function hasPreconfiguredExpressionSets() + { + return isset($this->preconfigured_expression_sets); + } + + public function clearPreconfiguredExpressionSets() + { + unset($this->preconfigured_expression_sets); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPoliciesWafConfig preconfigured_expression_sets = 536200826; + * @param \Google\Cloud\Compute\V1\SecurityPoliciesWafConfig $var + * @return $this + */ + public function setPreconfiguredExpressionSets($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPoliciesWafConfig::class); + $this->preconfigured_expression_sets = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPoliciesScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPoliciesScopedList.php new file mode 100644 index 000000000000..d691acd38118 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPoliciesScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.SecurityPoliciesScopedList + */ +class SecurityPoliciesScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * A list of SecurityPolicies contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicy security_policies = 127783791; + */ + private $security_policies; + /** + * Informational warning which replaces the list of security policies when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\SecurityPolicy>|\Google\Protobuf\Internal\RepeatedField $security_policies + * A list of SecurityPolicies contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * Informational warning which replaces the list of security policies when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of SecurityPolicies contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicy security_policies = 127783791; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSecurityPolicies() + { + return $this->security_policies; + } + + /** + * A list of SecurityPolicies contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicy security_policies = 127783791; + * @param array<\Google\Cloud\Compute\V1\SecurityPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSecurityPolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SecurityPolicy::class); + $this->security_policies = $arr; + + return $this; + } + + /** + * Informational warning which replaces the list of security policies 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); + } + + /** + * Informational warning which replaces the list of security policies 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPoliciesWafConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPoliciesWafConfig.php new file mode 100644 index 000000000000..f907c573499b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPoliciesWafConfig.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.SecurityPoliciesWafConfig + */ +class SecurityPoliciesWafConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional .google.cloud.compute.v1.PreconfiguredWafSet waf_rules = 74899924; + */ + protected $waf_rules = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\PreconfiguredWafSet $waf_rules + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.PreconfiguredWafSet waf_rules = 74899924; + * @return \Google\Cloud\Compute\V1\PreconfiguredWafSet|null + */ + public function getWafRules() + { + return $this->waf_rules; + } + + public function hasWafRules() + { + return isset($this->waf_rules); + } + + public function clearWafRules() + { + unset($this->waf_rules); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.PreconfiguredWafSet waf_rules = 74899924; + * @param \Google\Cloud\Compute\V1\PreconfiguredWafSet $var + * @return $this + */ + public function setWafRules($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\PreconfiguredWafSet::class); + $this->waf_rules = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicy.php new file mode 100644 index 000000000000..fb21010bcc40 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicy.php @@ -0,0 +1,727 @@ +google.cloud.compute.v1.SecurityPolicy + */ +class SecurityPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyAdaptiveProtectionConfig adaptive_protection_config = 150240735; + */ + protected $adaptive_protection_config = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyAdvancedOptionsConfig advanced_options_config = 449276352; + */ + protected $advanced_options_config = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyDdosProtectionConfig ddos_protection_config = 50315853; + */ + protected $ddos_protection_config = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Specifies a fingerprint for this resource, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make get() request to the security policy. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output only] Type of the resource. Always compute#securityPolicyfor security policies + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * A fingerprint for the labels being applied to this security policy, 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. To see the latest fingerprint, make get() request to the security policy. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + */ + protected $label_fingerprint = null; + /** + * 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. + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRecaptchaOptionsConfig recaptcha_options_config = 519006811; + */ + protected $recaptcha_options_config = null; + /** + * [Output Only] URL of the region where the regional security policy resides. This field is not applicable to global security policies. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * A list of rules that belong to this policy. There must always be a default rule which is a rule with priority 2147483647 and match all condition (for the match condition this means match "*" for srcIpRanges and for the networkMatch condition every field must be either match "*" or not set). If no rules are provided when creating a security policy, a default rule with action "allow" will be added. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRule rules = 108873975; + */ + private $rules; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $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. - 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; + */ + protected $type = null; + /** + * Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies. A user-defined field consists of up to 4 bytes extracted from a fixed offset in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an optional mask to select certain bits. Rules may then specify matching values for these fields. Example: userDefinedFields: - name: "ipv4_fragment_offset" base: IPV4 offset: 6 size: 2 mask: "0x1fff" + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyUserDefinedField user_defined_fields = 28312739; + */ + private $user_defined_fields; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\SecurityPolicyAdaptiveProtectionConfig $adaptive_protection_config + * @type \Google\Cloud\Compute\V1\SecurityPolicyAdvancedOptionsConfig $advanced_options_config + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type \Google\Cloud\Compute\V1\SecurityPolicyDdosProtectionConfig $ddos_protection_config + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type string $fingerprint + * Specifies a fingerprint for this resource, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make get() request to the security policy. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output only] Type of the resource. Always compute#securityPolicyfor security policies + * @type string $label_fingerprint + * A fingerprint for the labels being applied to this security policy, 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. To see the latest fingerprint, make get() request to the security policy. + * @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 + * 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\SecurityPolicyRecaptchaOptionsConfig $recaptcha_options_config + * @type string $region + * [Output Only] URL of the region where the regional security policy resides. This field is not applicable to global security policies. + * @type array<\Google\Cloud\Compute\V1\SecurityPolicyRule>|\Google\Protobuf\Internal\RepeatedField $rules + * A list of rules that belong to this policy. There must always be a default rule which is a rule with priority 2147483647 and match all condition (for the match condition this means match "*" for srcIpRanges and for the networkMatch condition every field must be either match "*" or not set). If no rules are provided when creating a security policy, a default rule with action "allow" will be added. + * @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. - 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. + * @type array<\Google\Cloud\Compute\V1\SecurityPolicyUserDefinedField>|\Google\Protobuf\Internal\RepeatedField $user_defined_fields + * Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies. A user-defined field consists of up to 4 bytes extracted from a fixed offset in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an optional mask to select certain bits. Rules may then specify matching values for these fields. Example: userDefinedFields: - name: "ipv4_fragment_offset" base: IPV4 offset: 6 size: 2 mask: "0x1fff" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyAdaptiveProtectionConfig adaptive_protection_config = 150240735; + * @return \Google\Cloud\Compute\V1\SecurityPolicyAdaptiveProtectionConfig|null + */ + public function getAdaptiveProtectionConfig() + { + return $this->adaptive_protection_config; + } + + public function hasAdaptiveProtectionConfig() + { + return isset($this->adaptive_protection_config); + } + + public function clearAdaptiveProtectionConfig() + { + unset($this->adaptive_protection_config); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyAdaptiveProtectionConfig adaptive_protection_config = 150240735; + * @param \Google\Cloud\Compute\V1\SecurityPolicyAdaptiveProtectionConfig $var + * @return $this + */ + public function setAdaptiveProtectionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyAdaptiveProtectionConfig::class); + $this->adaptive_protection_config = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyAdvancedOptionsConfig advanced_options_config = 449276352; + * @return \Google\Cloud\Compute\V1\SecurityPolicyAdvancedOptionsConfig|null + */ + public function getAdvancedOptionsConfig() + { + return $this->advanced_options_config; + } + + public function hasAdvancedOptionsConfig() + { + return isset($this->advanced_options_config); + } + + public function clearAdvancedOptionsConfig() + { + unset($this->advanced_options_config); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyAdvancedOptionsConfig advanced_options_config = 449276352; + * @param \Google\Cloud\Compute\V1\SecurityPolicyAdvancedOptionsConfig $var + * @return $this + */ + public function setAdvancedOptionsConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyAdvancedOptionsConfig::class); + $this->advanced_options_config = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyDdosProtectionConfig ddos_protection_config = 50315853; + * @return \Google\Cloud\Compute\V1\SecurityPolicyDdosProtectionConfig|null + */ + public function getDdosProtectionConfig() + { + return $this->ddos_protection_config; + } + + public function hasDdosProtectionConfig() + { + return isset($this->ddos_protection_config); + } + + public function clearDdosProtectionConfig() + { + unset($this->ddos_protection_config); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyDdosProtectionConfig ddos_protection_config = 50315853; + * @param \Google\Cloud\Compute\V1\SecurityPolicyDdosProtectionConfig $var + * @return $this + */ + public function setDdosProtectionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyDdosProtectionConfig::class); + $this->ddos_protection_config = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Specifies a fingerprint for this resource, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make get() request to the security policy. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Specifies a fingerprint for this resource, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make get() request to the security policy. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output only] Type of the resource. Always compute#securityPolicyfor security policies + * + * 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); + } + + /** + * [Output only] Type of the resource. Always compute#securityPolicyfor security policies + * + * 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; + } + + /** + * A fingerprint for the labels being applied to this security policy, 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. To see the latest fingerprint, make get() request to the security policy. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @return string + */ + public function getLabelFingerprint() + { + return isset($this->label_fingerprint) ? $this->label_fingerprint : ''; + } + + public function hasLabelFingerprint() + { + return isset($this->label_fingerprint); + } + + public function clearLabelFingerprint() + { + unset($this->label_fingerprint); + } + + /** + * A fingerprint for the labels being applied to this security policy, 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. To see the latest fingerprint, make get() request to the security policy. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @param string $var + * @return $this + */ + public function setLabelFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->label_fingerprint = $var; + + return $this; + } + + /** + * 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. + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->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. + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRecaptchaOptionsConfig recaptcha_options_config = 519006811; + * @return \Google\Cloud\Compute\V1\SecurityPolicyRecaptchaOptionsConfig|null + */ + public function getRecaptchaOptionsConfig() + { + return $this->recaptcha_options_config; + } + + public function hasRecaptchaOptionsConfig() + { + return isset($this->recaptcha_options_config); + } + + public function clearRecaptchaOptionsConfig() + { + unset($this->recaptcha_options_config); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRecaptchaOptionsConfig recaptcha_options_config = 519006811; + * @param \Google\Cloud\Compute\V1\SecurityPolicyRecaptchaOptionsConfig $var + * @return $this + */ + public function setRecaptchaOptionsConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyRecaptchaOptionsConfig::class); + $this->recaptcha_options_config = $var; + + return $this; + } + + /** + * [Output Only] URL of the region where the regional security policy resides. This field is not applicable to global security policies. + * + * 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 regional security policy resides. This field is not applicable to global security policies. + * + * 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; + } + + /** + * A list of rules that belong to this policy. There must always be a default rule which is a rule with priority 2147483647 and match all condition (for the match condition this means match "*" for srcIpRanges and for the networkMatch condition every field must be either match "*" or not set). If no rules are provided when creating a security policy, a default rule with action "allow" will be added. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRule rules = 108873975; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * A list of rules that belong to this policy. There must always be a default rule which is a rule with priority 2147483647 and match all condition (for the match condition this means match "*" for srcIpRanges and for the networkMatch condition every field must be either match "*" or not set). If no rules are provided when creating a security policy, a default rule with action "allow" will be added. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRule rules = 108873975; + * @param array<\Google\Cloud\Compute\V1\SecurityPolicyRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SecurityPolicyRule::class); + $this->rules = $arr; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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; + } + + /** + * 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; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->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. - 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; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies. A user-defined field consists of up to 4 bytes extracted from a fixed offset in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an optional mask to select certain bits. Rules may then specify matching values for these fields. Example: userDefinedFields: - name: "ipv4_fragment_offset" base: IPV4 offset: 6 size: 2 mask: "0x1fff" + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyUserDefinedField user_defined_fields = 28312739; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUserDefinedFields() + { + return $this->user_defined_fields; + } + + /** + * Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies. A user-defined field consists of up to 4 bytes extracted from a fixed offset in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an optional mask to select certain bits. Rules may then specify matching values for these fields. Example: userDefinedFields: - name: "ipv4_fragment_offset" base: IPV4 offset: 6 size: 2 mask: "0x1fff" + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyUserDefinedField user_defined_fields = 28312739; + * @param array<\Google\Cloud\Compute\V1\SecurityPolicyUserDefinedField>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUserDefinedFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SecurityPolicyUserDefinedField::class); + $this->user_defined_fields = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicy/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicy/Type.php new file mode 100644 index 000000000000..b543fc230e9c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicy/Type.php @@ -0,0 +1,65 @@ +google.cloud.compute.v1.SecurityPolicy.Type + */ +class Type +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TYPE = 0; + */ + const UNDEFINED_TYPE = 0; + /** + * Generated from protobuf enum CLOUD_ARMOR = 260640373; + */ + const CLOUD_ARMOR = 260640373; + /** + * Generated from protobuf enum CLOUD_ARMOR_EDGE = 250728775; + */ + const CLOUD_ARMOR_EDGE = 250728775; + /** + * Generated from protobuf enum CLOUD_ARMOR_NETWORK = 488527428; + */ + const CLOUD_ARMOR_NETWORK = 488527428; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::CLOUD_ARMOR => 'CLOUD_ARMOR', + self::CLOUD_ARMOR_EDGE => 'CLOUD_ARMOR_EDGE', + self::CLOUD_ARMOR_NETWORK => 'CLOUD_ARMOR_NETWORK', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Compute\V1\SecurityPolicy_Type::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfig.php new file mode 100644 index 000000000000..db6f5f9942c1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfig.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.SecurityPolicyAdaptiveProtectionConfig + */ +class SecurityPolicyAdaptiveProtectionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * If set to true, enables Cloud Armor Machine Learning. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig layer7_ddos_defense_config = 437316771; + */ + protected $layer7_ddos_defense_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig $layer7_ddos_defense_config + * If set to true, enables Cloud Armor Machine Learning. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * If set to true, enables Cloud Armor Machine Learning. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig layer7_ddos_defense_config = 437316771; + * @return \Google\Cloud\Compute\V1\SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig|null + */ + public function getLayer7DdosDefenseConfig() + { + return $this->layer7_ddos_defense_config; + } + + public function hasLayer7DdosDefenseConfig() + { + return isset($this->layer7_ddos_defense_config); + } + + public function clearLayer7DdosDefenseConfig() + { + unset($this->layer7_ddos_defense_config); + } + + /** + * If set to true, enables Cloud Armor Machine Learning. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig layer7_ddos_defense_config = 437316771; + * @param \Google\Cloud\Compute\V1\SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig $var + * @return $this + */ + public function setLayer7DdosDefenseConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig::class); + $this->layer7_ddos_defense_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig.php new file mode 100644 index 000000000000..7d9d486bbea9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig.php @@ -0,0 +1,159 @@ +google.cloud.compute.v1.SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig + */ +class SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig extends \Google\Protobuf\Internal\Message +{ + /** + * If set to true, enables CAAP for L7 DDoS detection. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * + * Generated from protobuf field optional bool enable = 311764355; + */ + protected $enable = null; + /** + * Rule visibility can be one of the following: STANDARD - opaque rules. (default) PREMIUM - transparent rules. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * Check the RuleVisibility enum for the list of possible values. + * + * Generated from protobuf field optional string rule_visibility = 453258293; + */ + protected $rule_visibility = null; + /** + * Configuration options for layer7 adaptive protection for various customizable thresholds. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig threshold_configs = 60347805; + */ + private $threshold_configs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable + * If set to true, enables CAAP for L7 DDoS detection. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * @type string $rule_visibility + * Rule visibility can be one of the following: STANDARD - opaque rules. (default) PREMIUM - transparent rules. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * Check the RuleVisibility enum for the list of possible values. + * @type array<\Google\Cloud\Compute\V1\SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig>|\Google\Protobuf\Internal\RepeatedField $threshold_configs + * Configuration options for layer7 adaptive protection for various customizable thresholds. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * If set to true, enables CAAP for L7 DDoS detection. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * + * Generated from protobuf field optional bool enable = 311764355; + * @return bool + */ + public function getEnable() + { + return isset($this->enable) ? $this->enable : false; + } + + public function hasEnable() + { + return isset($this->enable); + } + + public function clearEnable() + { + unset($this->enable); + } + + /** + * If set to true, enables CAAP for L7 DDoS detection. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * + * Generated from protobuf field optional bool enable = 311764355; + * @param bool $var + * @return $this + */ + public function setEnable($var) + { + GPBUtil::checkBool($var); + $this->enable = $var; + + return $this; + } + + /** + * Rule visibility can be one of the following: STANDARD - opaque rules. (default) PREMIUM - transparent rules. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * Check the RuleVisibility enum for the list of possible values. + * + * Generated from protobuf field optional string rule_visibility = 453258293; + * @return string + */ + public function getRuleVisibility() + { + return isset($this->rule_visibility) ? $this->rule_visibility : ''; + } + + public function hasRuleVisibility() + { + return isset($this->rule_visibility); + } + + public function clearRuleVisibility() + { + unset($this->rule_visibility); + } + + /** + * Rule visibility can be one of the following: STANDARD - opaque rules. (default) PREMIUM - transparent rules. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * Check the RuleVisibility enum for the list of possible values. + * + * Generated from protobuf field optional string rule_visibility = 453258293; + * @param string $var + * @return $this + */ + public function setRuleVisibility($var) + { + GPBUtil::checkString($var, True); + $this->rule_visibility = $var; + + return $this; + } + + /** + * Configuration options for layer7 adaptive protection for various customizable thresholds. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig threshold_configs = 60347805; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getThresholdConfigs() + { + return $this->threshold_configs; + } + + /** + * Configuration options for layer7 adaptive protection for various customizable thresholds. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig threshold_configs = 60347805; + * @param array<\Google\Cloud\Compute\V1\SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setThresholdConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig::class); + $this->threshold_configs = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig/RuleVisibility.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig/RuleVisibility.php new file mode 100644 index 000000000000..af7a8a85cf81 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig/RuleVisibility.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig.RuleVisibility + */ +class RuleVisibility +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_RULE_VISIBILITY = 0; + */ + const UNDEFINED_RULE_VISIBILITY = 0; + /** + * Generated from protobuf enum PREMIUM = 399530551; + */ + const PREMIUM = 399530551; + /** + * Generated from protobuf enum STANDARD = 484642493; + */ + const STANDARD = 484642493; + + private static $valueToName = [ + self::UNDEFINED_RULE_VISIBILITY => 'UNDEFINED_RULE_VISIBILITY', + self::PREMIUM => 'PREMIUM', + self::STANDARD => 'STANDARD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RuleVisibility::class, \Google\Cloud\Compute\V1\SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig_RuleVisibility::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig.php new file mode 100644 index 000000000000..fb8c925a6997 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig.php @@ -0,0 +1,224 @@ +google.cloud.compute.v1.SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig + */ +class SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional float auto_deploy_confidence_threshold = 84309694; + */ + protected $auto_deploy_confidence_threshold = null; + /** + * Generated from protobuf field optional int32 auto_deploy_expiration_sec = 69638793; + */ + protected $auto_deploy_expiration_sec = null; + /** + * Generated from protobuf field optional float auto_deploy_impacted_baseline_threshold = 292441667; + */ + protected $auto_deploy_impacted_baseline_threshold = null; + /** + * Generated from protobuf field optional float auto_deploy_load_threshold = 522227738; + */ + protected $auto_deploy_load_threshold = null; + /** + * The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the security policy. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $auto_deploy_confidence_threshold + * @type int $auto_deploy_expiration_sec + * @type float $auto_deploy_impacted_baseline_threshold + * @type float $auto_deploy_load_threshold + * @type string $name + * The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the security policy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional float auto_deploy_confidence_threshold = 84309694; + * @return float + */ + public function getAutoDeployConfidenceThreshold() + { + return isset($this->auto_deploy_confidence_threshold) ? $this->auto_deploy_confidence_threshold : 0.0; + } + + public function hasAutoDeployConfidenceThreshold() + { + return isset($this->auto_deploy_confidence_threshold); + } + + public function clearAutoDeployConfidenceThreshold() + { + unset($this->auto_deploy_confidence_threshold); + } + + /** + * Generated from protobuf field optional float auto_deploy_confidence_threshold = 84309694; + * @param float $var + * @return $this + */ + public function setAutoDeployConfidenceThreshold($var) + { + GPBUtil::checkFloat($var); + $this->auto_deploy_confidence_threshold = $var; + + return $this; + } + + /** + * Generated from protobuf field optional int32 auto_deploy_expiration_sec = 69638793; + * @return int + */ + public function getAutoDeployExpirationSec() + { + return isset($this->auto_deploy_expiration_sec) ? $this->auto_deploy_expiration_sec : 0; + } + + public function hasAutoDeployExpirationSec() + { + return isset($this->auto_deploy_expiration_sec); + } + + public function clearAutoDeployExpirationSec() + { + unset($this->auto_deploy_expiration_sec); + } + + /** + * Generated from protobuf field optional int32 auto_deploy_expiration_sec = 69638793; + * @param int $var + * @return $this + */ + public function setAutoDeployExpirationSec($var) + { + GPBUtil::checkInt32($var); + $this->auto_deploy_expiration_sec = $var; + + return $this; + } + + /** + * Generated from protobuf field optional float auto_deploy_impacted_baseline_threshold = 292441667; + * @return float + */ + public function getAutoDeployImpactedBaselineThreshold() + { + return isset($this->auto_deploy_impacted_baseline_threshold) ? $this->auto_deploy_impacted_baseline_threshold : 0.0; + } + + public function hasAutoDeployImpactedBaselineThreshold() + { + return isset($this->auto_deploy_impacted_baseline_threshold); + } + + public function clearAutoDeployImpactedBaselineThreshold() + { + unset($this->auto_deploy_impacted_baseline_threshold); + } + + /** + * Generated from protobuf field optional float auto_deploy_impacted_baseline_threshold = 292441667; + * @param float $var + * @return $this + */ + public function setAutoDeployImpactedBaselineThreshold($var) + { + GPBUtil::checkFloat($var); + $this->auto_deploy_impacted_baseline_threshold = $var; + + return $this; + } + + /** + * Generated from protobuf field optional float auto_deploy_load_threshold = 522227738; + * @return float + */ + public function getAutoDeployLoadThreshold() + { + return isset($this->auto_deploy_load_threshold) ? $this->auto_deploy_load_threshold : 0.0; + } + + public function hasAutoDeployLoadThreshold() + { + return isset($this->auto_deploy_load_threshold); + } + + public function clearAutoDeployLoadThreshold() + { + unset($this->auto_deploy_load_threshold); + } + + /** + * Generated from protobuf field optional float auto_deploy_load_threshold = 522227738; + * @param float $var + * @return $this + */ + public function setAutoDeployLoadThreshold($var) + { + GPBUtil::checkFloat($var); + $this->auto_deploy_load_threshold = $var; + + return $this; + } + + /** + * The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the security policy. + * + * 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 must be 1-63 characters long, and comply with RFC1035. The name must be unique within the security policy. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdvancedOptionsConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdvancedOptionsConfig.php new file mode 100644 index 000000000000..1bd27459e69d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdvancedOptionsConfig.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.SecurityPolicyAdvancedOptionsConfig + */ +class SecurityPolicyAdvancedOptionsConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Custom configuration to apply the JSON parsing. Only applicable when json_parsing is set to STANDARD. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyAdvancedOptionsConfigJsonCustomConfig json_custom_config = 111570105; + */ + protected $json_custom_config = null; + /** + * + * Check the JsonParsing enum for the list of possible values. + * + * Generated from protobuf field optional string json_parsing = 282493529; + */ + protected $json_parsing = null; + /** + * + * Check the LogLevel enum for the list of possible values. + * + * Generated from protobuf field optional string log_level = 140582601; + */ + protected $log_level = null; + /** + * An optional list of case-insensitive request header names to use for resolving the callers client IP address. + * + * Generated from protobuf field repeated string user_ip_request_headers = 421050290; + */ + private $user_ip_request_headers; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\SecurityPolicyAdvancedOptionsConfigJsonCustomConfig $json_custom_config + * Custom configuration to apply the JSON parsing. Only applicable when json_parsing is set to STANDARD. + * @type string $json_parsing + * + * Check the JsonParsing enum for the list of possible values. + * @type string $log_level + * + * Check the LogLevel enum for the list of possible values. + * @type array|\Google\Protobuf\Internal\RepeatedField $user_ip_request_headers + * An optional list of case-insensitive request header names to use for resolving the callers client IP address. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Custom configuration to apply the JSON parsing. Only applicable when json_parsing is set to STANDARD. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyAdvancedOptionsConfigJsonCustomConfig json_custom_config = 111570105; + * @return \Google\Cloud\Compute\V1\SecurityPolicyAdvancedOptionsConfigJsonCustomConfig|null + */ + public function getJsonCustomConfig() + { + return $this->json_custom_config; + } + + public function hasJsonCustomConfig() + { + return isset($this->json_custom_config); + } + + public function clearJsonCustomConfig() + { + unset($this->json_custom_config); + } + + /** + * Custom configuration to apply the JSON parsing. Only applicable when json_parsing is set to STANDARD. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyAdvancedOptionsConfigJsonCustomConfig json_custom_config = 111570105; + * @param \Google\Cloud\Compute\V1\SecurityPolicyAdvancedOptionsConfigJsonCustomConfig $var + * @return $this + */ + public function setJsonCustomConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyAdvancedOptionsConfigJsonCustomConfig::class); + $this->json_custom_config = $var; + + return $this; + } + + /** + * + * Check the JsonParsing enum for the list of possible values. + * + * Generated from protobuf field optional string json_parsing = 282493529; + * @return string + */ + public function getJsonParsing() + { + return isset($this->json_parsing) ? $this->json_parsing : ''; + } + + public function hasJsonParsing() + { + return isset($this->json_parsing); + } + + public function clearJsonParsing() + { + unset($this->json_parsing); + } + + /** + * + * Check the JsonParsing enum for the list of possible values. + * + * Generated from protobuf field optional string json_parsing = 282493529; + * @param string $var + * @return $this + */ + public function setJsonParsing($var) + { + GPBUtil::checkString($var, True); + $this->json_parsing = $var; + + return $this; + } + + /** + * + * Check the LogLevel enum for the list of possible values. + * + * Generated from protobuf field optional string log_level = 140582601; + * @return string + */ + public function getLogLevel() + { + return isset($this->log_level) ? $this->log_level : ''; + } + + public function hasLogLevel() + { + return isset($this->log_level); + } + + public function clearLogLevel() + { + unset($this->log_level); + } + + /** + * + * Check the LogLevel enum for the list of possible values. + * + * Generated from protobuf field optional string log_level = 140582601; + * @param string $var + * @return $this + */ + public function setLogLevel($var) + { + GPBUtil::checkString($var, True); + $this->log_level = $var; + + return $this; + } + + /** + * An optional list of case-insensitive request header names to use for resolving the callers client IP address. + * + * Generated from protobuf field repeated string user_ip_request_headers = 421050290; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUserIpRequestHeaders() + { + return $this->user_ip_request_headers; + } + + /** + * An optional list of case-insensitive request header names to use for resolving the callers client IP address. + * + * Generated from protobuf field repeated string user_ip_request_headers = 421050290; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUserIpRequestHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->user_ip_request_headers = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdvancedOptionsConfig/JsonParsing.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdvancedOptionsConfig/JsonParsing.php new file mode 100644 index 000000000000..7dd40de4a0c5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdvancedOptionsConfig/JsonParsing.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.SecurityPolicyAdvancedOptionsConfig.JsonParsing + */ +class JsonParsing +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_JSON_PARSING = 0; + */ + const UNDEFINED_JSON_PARSING = 0; + /** + * Generated from protobuf enum DISABLED = 516696700; + */ + const DISABLED = 516696700; + /** + * Generated from protobuf enum STANDARD = 484642493; + */ + const STANDARD = 484642493; + /** + * Generated from protobuf enum STANDARD_WITH_GRAPHQL = 106979218; + */ + const STANDARD_WITH_GRAPHQL = 106979218; + + private static $valueToName = [ + self::UNDEFINED_JSON_PARSING => 'UNDEFINED_JSON_PARSING', + self::DISABLED => 'DISABLED', + self::STANDARD => 'STANDARD', + self::STANDARD_WITH_GRAPHQL => 'STANDARD_WITH_GRAPHQL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(JsonParsing::class, \Google\Cloud\Compute\V1\SecurityPolicyAdvancedOptionsConfig_JsonParsing::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdvancedOptionsConfig/LogLevel.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdvancedOptionsConfig/LogLevel.php new file mode 100644 index 000000000000..0fd5bf549d9b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdvancedOptionsConfig/LogLevel.php @@ -0,0 +1,59 @@ +google.cloud.compute.v1.SecurityPolicyAdvancedOptionsConfig.LogLevel + */ +class LogLevel +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_LOG_LEVEL = 0; + */ + const UNDEFINED_LOG_LEVEL = 0; + /** + * Generated from protobuf enum NORMAL = 161067239; + */ + const NORMAL = 161067239; + /** + * Generated from protobuf enum VERBOSE = 532219234; + */ + const VERBOSE = 532219234; + + private static $valueToName = [ + self::UNDEFINED_LOG_LEVEL => 'UNDEFINED_LOG_LEVEL', + self::NORMAL => 'NORMAL', + self::VERBOSE => 'VERBOSE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LogLevel::class, \Google\Cloud\Compute\V1\SecurityPolicyAdvancedOptionsConfig_LogLevel::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdvancedOptionsConfigJsonCustomConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdvancedOptionsConfigJsonCustomConfig.php new file mode 100644 index 000000000000..45ac4bb07195 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdvancedOptionsConfigJsonCustomConfig.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.SecurityPolicyAdvancedOptionsConfigJsonCustomConfig + */ +class SecurityPolicyAdvancedOptionsConfigJsonCustomConfig extends \Google\Protobuf\Internal\Message +{ + /** + * A list of custom Content-Type header values to apply the JSON parsing. As per RFC 1341, a Content-Type header value has the following format: Content-Type := type "/" subtype *[";" parameter] When configuring a custom Content-Type header value, only the type/subtype needs to be specified, and the parameters should be excluded. + * + * Generated from protobuf field repeated string content_types = 17428787; + */ + private $content_types; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $content_types + * A list of custom Content-Type header values to apply the JSON parsing. As per RFC 1341, a Content-Type header value has the following format: Content-Type := type "/" subtype *[";" parameter] When configuring a custom Content-Type header value, only the type/subtype needs to be specified, and the parameters should be excluded. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of custom Content-Type header values to apply the JSON parsing. As per RFC 1341, a Content-Type header value has the following format: Content-Type := type "/" subtype *[";" parameter] When configuring a custom Content-Type header value, only the type/subtype needs to be specified, and the parameters should be excluded. + * + * Generated from protobuf field repeated string content_types = 17428787; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getContentTypes() + { + return $this->content_types; + } + + /** + * A list of custom Content-Type header values to apply the JSON parsing. As per RFC 1341, a Content-Type header value has the following format: Content-Type := type "/" subtype *[";" parameter] When configuring a custom Content-Type header value, only the type/subtype needs to be specified, and the parameters should be excluded. + * + * Generated from protobuf field repeated string content_types = 17428787; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setContentTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->content_types = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyDdosProtectionConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyDdosProtectionConfig.php new file mode 100644 index 000000000000..811b17ae7d7f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyDdosProtectionConfig.php @@ -0,0 +1,80 @@ +google.cloud.compute.v1.SecurityPolicyDdosProtectionConfig + */ +class SecurityPolicyDdosProtectionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * + * Check the DdosProtection enum for the list of possible values. + * + * Generated from protobuf field optional string ddos_protection = 275173268; + */ + protected $ddos_protection = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ddos_protection + * + * Check the DdosProtection enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * + * Check the DdosProtection enum for the list of possible values. + * + * Generated from protobuf field optional string ddos_protection = 275173268; + * @return string + */ + public function getDdosProtection() + { + return isset($this->ddos_protection) ? $this->ddos_protection : ''; + } + + public function hasDdosProtection() + { + return isset($this->ddos_protection); + } + + public function clearDdosProtection() + { + unset($this->ddos_protection); + } + + /** + * + * Check the DdosProtection enum for the list of possible values. + * + * Generated from protobuf field optional string ddos_protection = 275173268; + * @param string $var + * @return $this + */ + public function setDdosProtection($var) + { + GPBUtil::checkString($var, True); + $this->ddos_protection = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyDdosProtectionConfig/DdosProtection.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyDdosProtectionConfig/DdosProtection.php new file mode 100644 index 000000000000..82eae3c80f51 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyDdosProtectionConfig/DdosProtection.php @@ -0,0 +1,59 @@ +google.cloud.compute.v1.SecurityPolicyDdosProtectionConfig.DdosProtection + */ +class DdosProtection +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_DDOS_PROTECTION = 0; + */ + const UNDEFINED_DDOS_PROTECTION = 0; + /** + * Generated from protobuf enum ADVANCED = 63789090; + */ + const ADVANCED = 63789090; + /** + * Generated from protobuf enum STANDARD = 484642493; + */ + const STANDARD = 484642493; + + private static $valueToName = [ + self::UNDEFINED_DDOS_PROTECTION => 'UNDEFINED_DDOS_PROTECTION', + self::ADVANCED => 'ADVANCED', + self::STANDARD => 'STANDARD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DdosProtection::class, \Google\Cloud\Compute\V1\SecurityPolicyDdosProtectionConfig_DdosProtection::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyList.php new file mode 100644 index 000000000000..6c222a7fedbb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyList.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SecurityPolicyList + */ +class SecurityPolicyList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of SecurityPolicy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicy items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#securityPolicyList for listsof securityPolicies + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\SecurityPolicy>|\Google\Protobuf\Internal\RepeatedField $items + * A list of SecurityPolicy resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#securityPolicyList for listsof securityPolicies + * @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 \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 SecurityPolicy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicy items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of SecurityPolicy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicy items = 100526016; + * @param array<\Google\Cloud\Compute\V1\SecurityPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SecurityPolicy::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#securityPolicyList for listsof securityPolicies + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#securityPolicyList for listsof securityPolicies + * + * 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] 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRecaptchaOptionsConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRecaptchaOptionsConfig.php new file mode 100644 index 000000000000..cabdf36e0dfd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRecaptchaOptionsConfig.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.SecurityPolicyRecaptchaOptionsConfig + */ +class SecurityPolicyRecaptchaOptionsConfig extends \Google\Protobuf\Internal\Message +{ + /** + * An optional field to supply a reCAPTCHA site key to be used for all the rules using the redirect action with the type of GOOGLE_RECAPTCHA under the security policy. The specified site key needs to be created from the reCAPTCHA API. The user is responsible for the validity of the specified site key. If not specified, a Google-managed site key is used. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * + * Generated from protobuf field optional string redirect_site_key = 447677034; + */ + protected $redirect_site_key = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $redirect_site_key + * An optional field to supply a reCAPTCHA site key to be used for all the rules using the redirect action with the type of GOOGLE_RECAPTCHA under the security policy. The specified site key needs to be created from the reCAPTCHA API. The user is responsible for the validity of the specified site key. If not specified, a Google-managed site key is used. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * An optional field to supply a reCAPTCHA site key to be used for all the rules using the redirect action with the type of GOOGLE_RECAPTCHA under the security policy. The specified site key needs to be created from the reCAPTCHA API. The user is responsible for the validity of the specified site key. If not specified, a Google-managed site key is used. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * + * Generated from protobuf field optional string redirect_site_key = 447677034; + * @return string + */ + public function getRedirectSiteKey() + { + return isset($this->redirect_site_key) ? $this->redirect_site_key : ''; + } + + public function hasRedirectSiteKey() + { + return isset($this->redirect_site_key); + } + + public function clearRedirectSiteKey() + { + unset($this->redirect_site_key); + } + + /** + * An optional field to supply a reCAPTCHA site key to be used for all the rules using the redirect action with the type of GOOGLE_RECAPTCHA under the security policy. The specified site key needs to be created from the reCAPTCHA API. The user is responsible for the validity of the specified site key. If not specified, a Google-managed site key is used. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * + * Generated from protobuf field optional string redirect_site_key = 447677034; + * @param string $var + * @return $this + */ + public function setRedirectSiteKey($var) + { + GPBUtil::checkString($var, True); + $this->redirect_site_key = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyReference.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyReference.php new file mode 100644 index 000000000000..dbc7f5c38fa1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyReference.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.SecurityPolicyReference + */ +class SecurityPolicyReference extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string security_policy = 171082513; + */ + protected $security_policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $security_policy + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string security_policy = 171082513; + * @return string + */ + public function getSecurityPolicy() + { + return isset($this->security_policy) ? $this->security_policy : ''; + } + + public function hasSecurityPolicy() + { + return isset($this->security_policy); + } + + public function clearSecurityPolicy() + { + unset($this->security_policy); + } + + /** + * Generated from protobuf field optional string security_policy = 171082513; + * @param string $var + * @return $this + */ + public function setSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->security_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRule.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRule.php new file mode 100644 index 000000000000..6bcf8ed43a40 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRule.php @@ -0,0 +1,517 @@ +google.cloud.compute.v1.SecurityPolicyRule + */ +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(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. This action is only supported in Global Security Policies of type CLOUD_ARMOR. - 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; + */ + protected $action = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Optional, additional actions that are performed on headers. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction header_action = 328077352; + */ + protected $header_action = null; + /** + * [Output only] Type of the resource. Always compute#securityPolicyRule for security policy rules + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleMatcher match = 103668165; + */ + protected $match = null; + /** + * A match condition that incoming packets are evaluated against for CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding 'action' is enforced. The match criteria for a rule consists of built-in match fields (like 'srcIpRanges') and potentially multiple user-defined match fields ('userDefinedFields'). Field values may be extracted directly from the packet or derived from it (e.g. 'srcRegionCodes'). Some fields may not be present in every packet (e.g. 'srcPorts'). A user-defined field is only present if the base header is found in the packet and the entire field is in bounds. Each match field may specify which values can match it, listing one or more ranges, prefixes, or exact values that are considered a match for the field. A field value must be present in order to match a specified match field. If no match values are specified for a match field, then any field value is considered to match it, and it's not required to be present. For strings specifying '*' is also equivalent to match all. For a packet to match a rule, all specified match fields must match the corresponding field values derived from the packet. Example: networkMatch: srcIpRanges: - "192.0.2.0/24" - "198.51.100.0/24" userDefinedFields: - name: "ipv4_fragment_offset" values: - "1-0x1fff" The above match condition matches packets with a source IP in 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named "ipv4_fragment_offset" with a value between 1 and 0x1fff inclusive. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleNetworkMatcher network_match = 463387764; + */ + protected $network_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; + */ + protected $preconfigured_waf_config = null; + /** + * If set to true, the specified action is not enforced. + * + * Generated from protobuf field optional bool preview = 218686408; + */ + protected $preview = null; + /** + * An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority. + * + * Generated from protobuf field optional int32 priority = 445151652; + */ + protected $priority = null; + /** + * Must be specified if the action is "rate_based_ban" or "throttle". Cannot be specified for any other actions. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions rate_limit_options = 67544315; + */ + protected $rate_limit_options = null; + /** + * Parameters defining the redirect action. Cannot be specified for any other actions. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions redirect_options = 163285307; + */ + protected $redirect_options = null; + + /** + * Constructor. + * + * @param array $data { + * 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(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. This action is only supported in Global Security Policies of type CLOUD_ARMOR. - 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 + * Optional, additional actions that are performed on headers. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * @type string $kind + * [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\SecurityPolicyRuleNetworkMatcher $network_match + * A match condition that incoming packets are evaluated against for CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding 'action' is enforced. The match criteria for a rule consists of built-in match fields (like 'srcIpRanges') and potentially multiple user-defined match fields ('userDefinedFields'). Field values may be extracted directly from the packet or derived from it (e.g. 'srcRegionCodes'). Some fields may not be present in every packet (e.g. 'srcPorts'). A user-defined field is only present if the base header is found in the packet and the entire field is in bounds. Each match field may specify which values can match it, listing one or more ranges, prefixes, or exact values that are considered a match for the field. A field value must be present in order to match a specified match field. If no match values are specified for a match field, then any field value is considered to match it, and it's not required to be present. For strings specifying '*' is also equivalent to match all. For a packet to match a rule, all specified match fields must match the corresponding field values derived from the packet. Example: networkMatch: srcIpRanges: - "192.0.2.0/24" - "198.51.100.0/24" userDefinedFields: - name: "ipv4_fragment_offset" values: - "1-0x1fff" The above match condition matches packets with a source IP in 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named "ipv4_fragment_offset" with a value between 1 and 0x1fff inclusive. + * @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 + * An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority. + * @type \Google\Cloud\Compute\V1\SecurityPolicyRuleRateLimitOptions $rate_limit_options + * Must be specified if the action is "rate_based_ban" or "throttle". Cannot be specified for any other actions. + * @type \Google\Cloud\Compute\V1\SecurityPolicyRuleRedirectOptions $redirect_options + * Parameters defining the redirect action. Cannot be specified for any other actions. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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. This action is only supported in Global Security Policies of type CLOUD_ARMOR. - 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 + */ + public function getAction() + { + return isset($this->action) ? $this->action : ''; + } + + public function hasAction() + { + return isset($this->action); + } + + public function clearAction() + { + unset($this->action); + } + + /** + * 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. This action is only supported in Global Security Policies of type CLOUD_ARMOR. - 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 + * @return $this + */ + public function setAction($var) + { + GPBUtil::checkString($var, True); + $this->action = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional, additional actions that are performed on headers. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction header_action = 328077352; + * @return \Google\Cloud\Compute\V1\SecurityPolicyRuleHttpHeaderAction|null + */ + public function getHeaderAction() + { + return $this->header_action; + } + + public function hasHeaderAction() + { + return isset($this->header_action); + } + + public function clearHeaderAction() + { + unset($this->header_action); + } + + /** + * Optional, additional actions that are performed on headers. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction header_action = 328077352; + * @param \Google\Cloud\Compute\V1\SecurityPolicyRuleHttpHeaderAction $var + * @return $this + */ + public function setHeaderAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyRuleHttpHeaderAction::class); + $this->header_action = $var; + + return $this; + } + + /** + * [Output only] Type of the resource. Always compute#securityPolicyRule for security policy rules + * + * 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); + } + + /** + * [Output only] Type of the resource. Always compute#securityPolicyRule for security policy rules + * + * 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; + } + + /** + * A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleMatcher match = 103668165; + * @return \Google\Cloud\Compute\V1\SecurityPolicyRuleMatcher|null + */ + public function getMatch() + { + return $this->match; + } + + public function hasMatch() + { + return isset($this->match); + } + + public function clearMatch() + { + unset($this->match); + } + + /** + * A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleMatcher match = 103668165; + * @param \Google\Cloud\Compute\V1\SecurityPolicyRuleMatcher $var + * @return $this + */ + public function setMatch($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyRuleMatcher::class); + $this->match = $var; + + return $this; + } + + /** + * A match condition that incoming packets are evaluated against for CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding 'action' is enforced. The match criteria for a rule consists of built-in match fields (like 'srcIpRanges') and potentially multiple user-defined match fields ('userDefinedFields'). Field values may be extracted directly from the packet or derived from it (e.g. 'srcRegionCodes'). Some fields may not be present in every packet (e.g. 'srcPorts'). A user-defined field is only present if the base header is found in the packet and the entire field is in bounds. Each match field may specify which values can match it, listing one or more ranges, prefixes, or exact values that are considered a match for the field. A field value must be present in order to match a specified match field. If no match values are specified for a match field, then any field value is considered to match it, and it's not required to be present. For strings specifying '*' is also equivalent to match all. For a packet to match a rule, all specified match fields must match the corresponding field values derived from the packet. Example: networkMatch: srcIpRanges: - "192.0.2.0/24" - "198.51.100.0/24" userDefinedFields: - name: "ipv4_fragment_offset" values: - "1-0x1fff" The above match condition matches packets with a source IP in 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named "ipv4_fragment_offset" with a value between 1 and 0x1fff inclusive. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleNetworkMatcher network_match = 463387764; + * @return \Google\Cloud\Compute\V1\SecurityPolicyRuleNetworkMatcher|null + */ + public function getNetworkMatch() + { + return $this->network_match; + } + + public function hasNetworkMatch() + { + return isset($this->network_match); + } + + public function clearNetworkMatch() + { + unset($this->network_match); + } + + /** + * A match condition that incoming packets are evaluated against for CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding 'action' is enforced. The match criteria for a rule consists of built-in match fields (like 'srcIpRanges') and potentially multiple user-defined match fields ('userDefinedFields'). Field values may be extracted directly from the packet or derived from it (e.g. 'srcRegionCodes'). Some fields may not be present in every packet (e.g. 'srcPorts'). A user-defined field is only present if the base header is found in the packet and the entire field is in bounds. Each match field may specify which values can match it, listing one or more ranges, prefixes, or exact values that are considered a match for the field. A field value must be present in order to match a specified match field. If no match values are specified for a match field, then any field value is considered to match it, and it's not required to be present. For strings specifying '*' is also equivalent to match all. For a packet to match a rule, all specified match fields must match the corresponding field values derived from the packet. Example: networkMatch: srcIpRanges: - "192.0.2.0/24" - "198.51.100.0/24" userDefinedFields: - name: "ipv4_fragment_offset" values: - "1-0x1fff" The above match condition matches packets with a source IP in 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named "ipv4_fragment_offset" with a value between 1 and 0x1fff inclusive. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleNetworkMatcher network_match = 463387764; + * @param \Google\Cloud\Compute\V1\SecurityPolicyRuleNetworkMatcher $var + * @return $this + */ + public function setNetworkMatch($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyRuleNetworkMatcher::class); + $this->network_match = $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. + * + * Generated from protobuf field optional bool preview = 218686408; + * @return bool + */ + public function getPreview() + { + return isset($this->preview) ? $this->preview : false; + } + + public function hasPreview() + { + return isset($this->preview); + } + + public function clearPreview() + { + unset($this->preview); + } + + /** + * If set to true, the specified action is not enforced. + * + * Generated from protobuf field optional bool preview = 218686408; + * @param bool $var + * @return $this + */ + public function setPreview($var) + { + GPBUtil::checkBool($var); + $this->preview = $var; + + return $this; + } + + /** + * An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @return int + */ + public function getPriority() + { + return isset($this->priority) ? $this->priority : 0; + } + + public function hasPriority() + { + return isset($this->priority); + } + + public function clearPriority() + { + unset($this->priority); + } + + /** + * An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority. + * + * Generated from protobuf field optional int32 priority = 445151652; + * @param int $var + * @return $this + */ + public function setPriority($var) + { + GPBUtil::checkInt32($var); + $this->priority = $var; + + return $this; + } + + /** + * Must be specified if the action is "rate_based_ban" or "throttle". Cannot be specified for any other actions. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions rate_limit_options = 67544315; + * @return \Google\Cloud\Compute\V1\SecurityPolicyRuleRateLimitOptions|null + */ + public function getRateLimitOptions() + { + return $this->rate_limit_options; + } + + public function hasRateLimitOptions() + { + return isset($this->rate_limit_options); + } + + public function clearRateLimitOptions() + { + unset($this->rate_limit_options); + } + + /** + * Must be specified if the action is "rate_based_ban" or "throttle". Cannot be specified for any other actions. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions rate_limit_options = 67544315; + * @param \Google\Cloud\Compute\V1\SecurityPolicyRuleRateLimitOptions $var + * @return $this + */ + public function setRateLimitOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyRuleRateLimitOptions::class); + $this->rate_limit_options = $var; + + return $this; + } + + /** + * Parameters defining the redirect action. Cannot be specified for any other actions. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions redirect_options = 163285307; + * @return \Google\Cloud\Compute\V1\SecurityPolicyRuleRedirectOptions|null + */ + public function getRedirectOptions() + { + return $this->redirect_options; + } + + public function hasRedirectOptions() + { + return isset($this->redirect_options); + } + + public function clearRedirectOptions() + { + unset($this->redirect_options); + } + + /** + * Parameters defining the redirect action. Cannot be specified for any other actions. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions redirect_options = 163285307; + * @param \Google\Cloud\Compute\V1\SecurityPolicyRuleRedirectOptions $var + * @return $this + */ + public function setRedirectOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyRuleRedirectOptions::class); + $this->redirect_options = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleHttpHeaderAction.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleHttpHeaderAction.php new file mode 100644 index 000000000000..20b2789d1421 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleHttpHeaderAction.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderAction + */ +class SecurityPolicyRuleHttpHeaderAction extends \Google\Protobuf\Internal\Message +{ + /** + * The list of request headers to add or overwrite if they're already present. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderActionHttpHeaderOption request_headers_to_adds = 87987661; + */ + private $request_headers_to_adds; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\SecurityPolicyRuleHttpHeaderActionHttpHeaderOption>|\Google\Protobuf\Internal\RepeatedField $request_headers_to_adds + * The list of request headers to add or overwrite if they're already present. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The list of request headers to add or overwrite if they're already present. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderActionHttpHeaderOption request_headers_to_adds = 87987661; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRequestHeadersToAdds() + { + return $this->request_headers_to_adds; + } + + /** + * The list of request headers to add or overwrite if they're already present. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderActionHttpHeaderOption request_headers_to_adds = 87987661; + * @param array<\Google\Cloud\Compute\V1\SecurityPolicyRuleHttpHeaderActionHttpHeaderOption>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRequestHeadersToAdds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SecurityPolicyRuleHttpHeaderActionHttpHeaderOption::class); + $this->request_headers_to_adds = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleHttpHeaderActionHttpHeaderOption.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleHttpHeaderActionHttpHeaderOption.php new file mode 100644 index 000000000000..cb5dc22a39e1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleHttpHeaderActionHttpHeaderOption.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.SecurityPolicyRuleHttpHeaderActionHttpHeaderOption + */ +class SecurityPolicyRuleHttpHeaderActionHttpHeaderOption extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the header to set. + * + * Generated from protobuf field optional string header_name = 110223613; + */ + protected $header_name = null; + /** + * The value to set the named header to. + * + * Generated from protobuf field optional string header_value = 203094335; + */ + protected $header_value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $header_name + * The name of the header to set. + * @type string $header_value + * The value to set the named header to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the header to set. + * + * Generated from protobuf field optional string header_name = 110223613; + * @return string + */ + public function getHeaderName() + { + return isset($this->header_name) ? $this->header_name : ''; + } + + public function hasHeaderName() + { + return isset($this->header_name); + } + + public function clearHeaderName() + { + unset($this->header_name); + } + + /** + * The name of the header to set. + * + * Generated from protobuf field optional string header_name = 110223613; + * @param string $var + * @return $this + */ + public function setHeaderName($var) + { + GPBUtil::checkString($var, True); + $this->header_name = $var; + + return $this; + } + + /** + * The value to set the named header to. + * + * Generated from protobuf field optional string header_value = 203094335; + * @return string + */ + public function getHeaderValue() + { + return isset($this->header_value) ? $this->header_value : ''; + } + + public function hasHeaderValue() + { + return isset($this->header_value); + } + + public function clearHeaderValue() + { + unset($this->header_value); + } + + /** + * The value to set the named header to. + * + * Generated from protobuf field optional string header_value = 203094335; + * @param string $var + * @return $this + */ + public function setHeaderValue($var) + { + GPBUtil::checkString($var, True); + $this->header_value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleMatcher.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleMatcher.php new file mode 100644 index 000000000000..d1639085fe6e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleMatcher.php @@ -0,0 +1,213 @@ +google.cloud.compute.v1.SecurityPolicyRuleMatcher + */ +class SecurityPolicyRuleMatcher extends \Google\Protobuf\Internal\Message +{ + /** + * The configuration options available when specifying versioned_expr. This field must be specified if versioned_expr is specified and cannot be specified if versioned_expr is not specified. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig config = 255820610; + */ + protected $config = null; + /** + * User defined CEVAL expression. A CEVAL expression is used to specify match criteria such as origin.ip, source.region_code and contents in the request header. Expressions containing `evaluateThreatIntelligence` require Cloud Armor Managed Protection Plus tier and are not supported in Edge Policies nor in Regional Policies. Expressions containing `evaluatePreconfiguredExpr('sourceiplist-*')` require Cloud Armor Managed Protection Plus tier and are only supported in Global Security Policies. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Expr expr = 3127797; + */ + protected $expr = null; + /** + * The configuration options available when specifying a user defined CEVAL expression (i.e., 'expr'). + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleMatcherExprOptions expr_options = 486220372; + */ + protected $expr_options = null; + /** + * Preconfigured versioned expression. If this field is specified, config must also be specified. Available preconfigured expressions along with their requirements are: SRC_IPS_V1 - must specify the corresponding src_ip_range field in config. + * Check the VersionedExpr enum for the list of possible values. + * + * Generated from protobuf field optional string versioned_expr = 322286013; + */ + protected $versioned_expr = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\SecurityPolicyRuleMatcherConfig $config + * The configuration options available when specifying versioned_expr. This field must be specified if versioned_expr is specified and cannot be specified if versioned_expr is not specified. + * @type \Google\Cloud\Compute\V1\Expr $expr + * User defined CEVAL expression. A CEVAL expression is used to specify match criteria such as origin.ip, source.region_code and contents in the request header. Expressions containing `evaluateThreatIntelligence` require Cloud Armor Managed Protection Plus tier and are not supported in Edge Policies nor in Regional Policies. Expressions containing `evaluatePreconfiguredExpr('sourceiplist-*')` require Cloud Armor Managed Protection Plus tier and are only supported in Global Security Policies. + * @type \Google\Cloud\Compute\V1\SecurityPolicyRuleMatcherExprOptions $expr_options + * The configuration options available when specifying a user defined CEVAL expression (i.e., 'expr'). + * @type string $versioned_expr + * Preconfigured versioned expression. If this field is specified, config must also be specified. Available preconfigured expressions along with their requirements are: SRC_IPS_V1 - must specify the corresponding src_ip_range field in config. + * Check the VersionedExpr enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The configuration options available when specifying versioned_expr. This field must be specified if versioned_expr is specified and cannot be specified if versioned_expr is not specified. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig config = 255820610; + * @return \Google\Cloud\Compute\V1\SecurityPolicyRuleMatcherConfig|null + */ + public function getConfig() + { + return $this->config; + } + + public function hasConfig() + { + return isset($this->config); + } + + public function clearConfig() + { + unset($this->config); + } + + /** + * The configuration options available when specifying versioned_expr. This field must be specified if versioned_expr is specified and cannot be specified if versioned_expr is not specified. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig config = 255820610; + * @param \Google\Cloud\Compute\V1\SecurityPolicyRuleMatcherConfig $var + * @return $this + */ + public function setConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyRuleMatcherConfig::class); + $this->config = $var; + + return $this; + } + + /** + * User defined CEVAL expression. A CEVAL expression is used to specify match criteria such as origin.ip, source.region_code and contents in the request header. Expressions containing `evaluateThreatIntelligence` require Cloud Armor Managed Protection Plus tier and are not supported in Edge Policies nor in Regional Policies. Expressions containing `evaluatePreconfiguredExpr('sourceiplist-*')` require Cloud Armor Managed Protection Plus tier and are only supported in Global Security Policies. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Expr expr = 3127797; + * @return \Google\Cloud\Compute\V1\Expr|null + */ + public function getExpr() + { + return $this->expr; + } + + public function hasExpr() + { + return isset($this->expr); + } + + public function clearExpr() + { + unset($this->expr); + } + + /** + * User defined CEVAL expression. A CEVAL expression is used to specify match criteria such as origin.ip, source.region_code and contents in the request header. Expressions containing `evaluateThreatIntelligence` require Cloud Armor Managed Protection Plus tier and are not supported in Edge Policies nor in Regional Policies. Expressions containing `evaluatePreconfiguredExpr('sourceiplist-*')` require Cloud Armor Managed Protection Plus tier and are only supported in Global Security Policies. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Expr expr = 3127797; + * @param \Google\Cloud\Compute\V1\Expr $var + * @return $this + */ + public function setExpr($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Expr::class); + $this->expr = $var; + + return $this; + } + + /** + * The configuration options available when specifying a user defined CEVAL expression (i.e., 'expr'). + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleMatcherExprOptions expr_options = 486220372; + * @return \Google\Cloud\Compute\V1\SecurityPolicyRuleMatcherExprOptions|null + */ + public function getExprOptions() + { + return $this->expr_options; + } + + public function hasExprOptions() + { + return isset($this->expr_options); + } + + public function clearExprOptions() + { + unset($this->expr_options); + } + + /** + * The configuration options available when specifying a user defined CEVAL expression (i.e., 'expr'). + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleMatcherExprOptions expr_options = 486220372; + * @param \Google\Cloud\Compute\V1\SecurityPolicyRuleMatcherExprOptions $var + * @return $this + */ + public function setExprOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyRuleMatcherExprOptions::class); + $this->expr_options = $var; + + return $this; + } + + /** + * Preconfigured versioned expression. If this field is specified, config must also be specified. Available preconfigured expressions along with their requirements are: SRC_IPS_V1 - must specify the corresponding src_ip_range field in config. + * Check the VersionedExpr enum for the list of possible values. + * + * Generated from protobuf field optional string versioned_expr = 322286013; + * @return string + */ + public function getVersionedExpr() + { + return isset($this->versioned_expr) ? $this->versioned_expr : ''; + } + + public function hasVersionedExpr() + { + return isset($this->versioned_expr); + } + + public function clearVersionedExpr() + { + unset($this->versioned_expr); + } + + /** + * Preconfigured versioned expression. If this field is specified, config must also be specified. Available preconfigured expressions along with their requirements are: SRC_IPS_V1 - must specify the corresponding src_ip_range field in config. + * Check the VersionedExpr enum for the list of possible values. + * + * Generated from protobuf field optional string versioned_expr = 322286013; + * @param string $var + * @return $this + */ + public function setVersionedExpr($var) + { + GPBUtil::checkString($var, True); + $this->versioned_expr = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleMatcher/VersionedExpr.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleMatcher/VersionedExpr.php new file mode 100644 index 000000000000..e9e69881cad5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleMatcher/VersionedExpr.php @@ -0,0 +1,57 @@ +google.cloud.compute.v1.SecurityPolicyRuleMatcher.VersionedExpr + */ +class VersionedExpr +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_VERSIONED_EXPR = 0; + */ + const UNDEFINED_VERSIONED_EXPR = 0; + /** + * Matches the source IP address of a request to the IP ranges supplied in config. + * + * Generated from protobuf enum SRC_IPS_V1 = 70925961; + */ + const SRC_IPS_V1 = 70925961; + + private static $valueToName = [ + self::UNDEFINED_VERSIONED_EXPR => 'UNDEFINED_VERSIONED_EXPR', + self::SRC_IPS_V1 => 'SRC_IPS_V1', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(VersionedExpr::class, \Google\Cloud\Compute\V1\SecurityPolicyRuleMatcher_VersionedExpr::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleMatcherConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleMatcherConfig.php new file mode 100644 index 000000000000..fac622505928 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleMatcherConfig.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig + */ +class SecurityPolicyRuleMatcherConfig extends \Google\Protobuf\Internal\Message +{ + /** + * CIDR IP address range. Maximum number of src_ip_ranges allowed is 10. + * + * Generated from protobuf field repeated string src_ip_ranges = 432128083; + */ + private $src_ip_ranges; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $src_ip_ranges + * CIDR IP address range. Maximum number of src_ip_ranges allowed is 10. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * CIDR IP address range. Maximum number of src_ip_ranges allowed is 10. + * + * Generated from protobuf field repeated string src_ip_ranges = 432128083; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSrcIpRanges() + { + return $this->src_ip_ranges; + } + + /** + * CIDR IP address range. Maximum number of src_ip_ranges allowed is 10. + * + * Generated from protobuf field repeated string src_ip_ranges = 432128083; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSrcIpRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->src_ip_ranges = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleMatcherExprOptions.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleMatcherExprOptions.php new file mode 100644 index 000000000000..69b6f559dc29 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleMatcherExprOptions.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.SecurityPolicyRuleMatcherExprOptions + */ +class SecurityPolicyRuleMatcherExprOptions extends \Google\Protobuf\Internal\Message +{ + /** + * reCAPTCHA configuration options to be applied for the rule. If the rule does not evaluate reCAPTCHA tokens, this field has no effect. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions recaptcha_options = 389151558; + */ + protected $recaptcha_options = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions $recaptcha_options + * reCAPTCHA configuration options to be applied for the rule. If the rule does not evaluate reCAPTCHA tokens, this field has no effect. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * reCAPTCHA configuration options to be applied for the rule. If the rule does not evaluate reCAPTCHA tokens, this field has no effect. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions recaptcha_options = 389151558; + * @return \Google\Cloud\Compute\V1\SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions|null + */ + public function getRecaptchaOptions() + { + return $this->recaptcha_options; + } + + public function hasRecaptchaOptions() + { + return isset($this->recaptcha_options); + } + + public function clearRecaptchaOptions() + { + unset($this->recaptcha_options); + } + + /** + * reCAPTCHA configuration options to be applied for the rule. If the rule does not evaluate reCAPTCHA tokens, this field has no effect. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions recaptcha_options = 389151558; + * @param \Google\Cloud\Compute\V1\SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions $var + * @return $this + */ + public function setRecaptchaOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions::class); + $this->recaptcha_options = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions.php new file mode 100644 index 000000000000..9962c90cbc28 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions.php @@ -0,0 +1,100 @@ +google.cloud.compute.v1.SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions + */ +class SecurityPolicyRuleMatcherExprOptionsRecaptchaOptions extends \Google\Protobuf\Internal\Message +{ + /** + * A list of site keys to be used during the validation of reCAPTCHA action-tokens. The provided site keys need to be created from reCAPTCHA API under the same project where the security policy is created. + * + * Generated from protobuf field repeated string action_token_site_keys = 59929885; + */ + private $action_token_site_keys; + /** + * A list of site keys to be used during the validation of reCAPTCHA session-tokens. The provided site keys need to be created from reCAPTCHA API under the same project where the security policy is created. + * + * Generated from protobuf field repeated string session_token_site_keys = 333363581; + */ + private $session_token_site_keys; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $action_token_site_keys + * A list of site keys to be used during the validation of reCAPTCHA action-tokens. The provided site keys need to be created from reCAPTCHA API under the same project where the security policy is created. + * @type array|\Google\Protobuf\Internal\RepeatedField $session_token_site_keys + * A list of site keys to be used during the validation of reCAPTCHA session-tokens. The provided site keys need to be created from reCAPTCHA API under the same project where the security policy is created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of site keys to be used during the validation of reCAPTCHA action-tokens. The provided site keys need to be created from reCAPTCHA API under the same project where the security policy is created. + * + * Generated from protobuf field repeated string action_token_site_keys = 59929885; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getActionTokenSiteKeys() + { + return $this->action_token_site_keys; + } + + /** + * A list of site keys to be used during the validation of reCAPTCHA action-tokens. The provided site keys need to be created from reCAPTCHA API under the same project where the security policy is created. + * + * Generated from protobuf field repeated string action_token_site_keys = 59929885; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setActionTokenSiteKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->action_token_site_keys = $arr; + + return $this; + } + + /** + * A list of site keys to be used during the validation of reCAPTCHA session-tokens. The provided site keys need to be created from reCAPTCHA API under the same project where the security policy is created. + * + * Generated from protobuf field repeated string session_token_site_keys = 333363581; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSessionTokenSiteKeys() + { + return $this->session_token_site_keys; + } + + /** + * A list of site keys to be used during the validation of reCAPTCHA session-tokens. The provided site keys need to be created from reCAPTCHA API under the same project where the security policy is created. + * + * Generated from protobuf field repeated string session_token_site_keys = 333363581; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSessionTokenSiteKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->session_token_site_keys = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleNetworkMatcher.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleNetworkMatcher.php new file mode 100644 index 000000000000..0d2db0bb9cd8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleNetworkMatcher.php @@ -0,0 +1,305 @@ +google.cloud.compute.v1.SecurityPolicyRuleNetworkMatcher + */ +class SecurityPolicyRuleNetworkMatcher extends \Google\Protobuf\Internal\Message +{ + /** + * Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text format. + * + * Generated from protobuf field repeated string dest_ip_ranges = 337357713; + */ + private $dest_ip_ranges; + /** + * Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023"). + * + * Generated from protobuf field repeated string dest_ports = 379902005; + */ + private $dest_ports; + /** + * IPv4 protocol / IPv6 next header (after extension headers). Each element can be an 8-bit unsigned decimal number (e.g. "6"), range (e.g. "253-254"), or one of the following protocol names: "tcp", "udp", "icmp", "esp", "ah", "ipip", or "sctp". + * + * Generated from protobuf field repeated string ip_protocols = 259213251; + */ + private $ip_protocols; + /** + * BGP Autonomous System Number associated with the source IP address. + * + * Generated from protobuf field repeated uint32 src_asns = 117825266; + */ + private $src_asns; + /** + * Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format. + * + * Generated from protobuf field repeated string src_ip_ranges = 432128083; + */ + private $src_ip_ranges; + /** + * Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023"). + * + * Generated from protobuf field repeated string src_ports = 445095415; + */ + private $src_ports; + /** + * Two-letter ISO 3166-1 alpha-2 country code associated with the source IP address. + * + * Generated from protobuf field repeated string src_region_codes = 99086742; + */ + private $src_region_codes; + /** + * User-defined fields. Each element names a defined field and lists the matching values for that field. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch user_defined_fields = 28312739; + */ + private $user_defined_fields; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $dest_ip_ranges + * Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text format. + * @type array|\Google\Protobuf\Internal\RepeatedField $dest_ports + * Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023"). + * @type array|\Google\Protobuf\Internal\RepeatedField $ip_protocols + * IPv4 protocol / IPv6 next header (after extension headers). Each element can be an 8-bit unsigned decimal number (e.g. "6"), range (e.g. "253-254"), or one of the following protocol names: "tcp", "udp", "icmp", "esp", "ah", "ipip", or "sctp". + * @type array|\Google\Protobuf\Internal\RepeatedField $src_asns + * BGP Autonomous System Number associated with the source IP address. + * @type array|\Google\Protobuf\Internal\RepeatedField $src_ip_ranges + * Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format. + * @type array|\Google\Protobuf\Internal\RepeatedField $src_ports + * Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023"). + * @type array|\Google\Protobuf\Internal\RepeatedField $src_region_codes + * Two-letter ISO 3166-1 alpha-2 country code associated with the source IP address. + * @type array<\Google\Cloud\Compute\V1\SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch>|\Google\Protobuf\Internal\RepeatedField $user_defined_fields + * User-defined fields. Each element names a defined field and lists the matching values for that field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text format. + * + * Generated from protobuf field repeated string dest_ip_ranges = 337357713; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDestIpRanges() + { + return $this->dest_ip_ranges; + } + + /** + * Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text format. + * + * Generated from protobuf field repeated string dest_ip_ranges = 337357713; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDestIpRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->dest_ip_ranges = $arr; + + return $this; + } + + /** + * Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023"). + * + * Generated from protobuf field repeated string dest_ports = 379902005; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDestPorts() + { + return $this->dest_ports; + } + + /** + * Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023"). + * + * Generated from protobuf field repeated string dest_ports = 379902005; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDestPorts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->dest_ports = $arr; + + return $this; + } + + /** + * IPv4 protocol / IPv6 next header (after extension headers). Each element can be an 8-bit unsigned decimal number (e.g. "6"), range (e.g. "253-254"), or one of the following protocol names: "tcp", "udp", "icmp", "esp", "ah", "ipip", or "sctp". + * + * Generated from protobuf field repeated string ip_protocols = 259213251; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIpProtocols() + { + return $this->ip_protocols; + } + + /** + * IPv4 protocol / IPv6 next header (after extension headers). Each element can be an 8-bit unsigned decimal number (e.g. "6"), range (e.g. "253-254"), or one of the following protocol names: "tcp", "udp", "icmp", "esp", "ah", "ipip", or "sctp". + * + * Generated from protobuf field repeated string ip_protocols = 259213251; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIpProtocols($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ip_protocols = $arr; + + return $this; + } + + /** + * BGP Autonomous System Number associated with the source IP address. + * + * Generated from protobuf field repeated uint32 src_asns = 117825266; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSrcAsns() + { + return $this->src_asns; + } + + /** + * BGP Autonomous System Number associated with the source IP address. + * + * Generated from protobuf field repeated uint32 src_asns = 117825266; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSrcAsns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::UINT32); + $this->src_asns = $arr; + + return $this; + } + + /** + * Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format. + * + * Generated from protobuf field repeated string src_ip_ranges = 432128083; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSrcIpRanges() + { + return $this->src_ip_ranges; + } + + /** + * Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format. + * + * Generated from protobuf field repeated string src_ip_ranges = 432128083; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSrcIpRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->src_ip_ranges = $arr; + + return $this; + } + + /** + * Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023"). + * + * Generated from protobuf field repeated string src_ports = 445095415; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSrcPorts() + { + return $this->src_ports; + } + + /** + * Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. "80") or range (e.g. "0-1023"). + * + * Generated from protobuf field repeated string src_ports = 445095415; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSrcPorts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->src_ports = $arr; + + return $this; + } + + /** + * Two-letter ISO 3166-1 alpha-2 country code associated with the source IP address. + * + * Generated from protobuf field repeated string src_region_codes = 99086742; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSrcRegionCodes() + { + return $this->src_region_codes; + } + + /** + * Two-letter ISO 3166-1 alpha-2 country code associated with the source IP address. + * + * Generated from protobuf field repeated string src_region_codes = 99086742; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSrcRegionCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->src_region_codes = $arr; + + return $this; + } + + /** + * User-defined fields. Each element names a defined field and lists the matching values for that field. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch user_defined_fields = 28312739; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUserDefinedFields() + { + return $this->user_defined_fields; + } + + /** + * User-defined fields. Each element names a defined field and lists the matching values for that field. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch user_defined_fields = 28312739; + * @param array<\Google\Cloud\Compute\V1\SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUserDefinedFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch::class); + $this->user_defined_fields = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch.php new file mode 100644 index 000000000000..ca6cc8bbc5e1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch + */ +class SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the user-defined field, as given in the definition. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Matching values of the field. Each element can be a 32-bit unsigned decimal or hexadecimal (starting with "0x") number (e.g. "64") or range (e.g. "0x400-0x7ff"). + * + * Generated from protobuf field repeated string values = 249928994; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of the user-defined field, as given in the definition. + * @type array|\Google\Protobuf\Internal\RepeatedField $values + * Matching values of the field. Each element can be a 32-bit unsigned decimal or hexadecimal (starting with "0x") number (e.g. "64") or range (e.g. "0x400-0x7ff"). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the user-defined field, as given in the definition. + * + * 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); + } + + /** + * Name of the user-defined field, as given in the definition. + * + * 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; + } + + /** + * Matching values of the field. Each element can be a 32-bit unsigned decimal or hexadecimal (starting with "0x") number (e.g. "64") or range (e.g. "0x400-0x7ff"). + * + * Generated from protobuf field repeated string values = 249928994; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * Matching values of the field. Each element can be a 32-bit unsigned decimal or hexadecimal (starting with "0x") number (e.g. "64") or range (e.g. "0x400-0x7ff"). + * + * Generated from protobuf field repeated string values = 249928994; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->values = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRulePreconfiguredWafConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRulePreconfiguredWafConfig.php new file mode 100644 index 000000000000..f5a64f3ee924 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRulePreconfiguredWafConfigExclusion.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRulePreconfiguredWafConfigExclusion.php new file mode 100644 index 000000000000..6a53832d7064 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/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; + */ + protected $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams.php new file mode 100644 index 000000000000..fad7028f3c24 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/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; + */ + protected $op = null; + /** + * The value of the field. + * + * Generated from protobuf field optional string val = 116513; + */ + protected $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams/Op.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams/Op.php new file mode 100644 index 000000000000..4e51faa3a1a6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams/Op.php @@ -0,0 +1,85 @@ +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); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Op::class, \Google\Cloud\Compute\V1\SecurityPolicyRulePreconfiguredWafConfigExclusionFieldParams_Op::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRateLimitOptions.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRateLimitOptions.php new file mode 100644 index 000000000000..30207eddaf1c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRateLimitOptions.php @@ -0,0 +1,422 @@ +google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions + */ +class SecurityPolicyRuleRateLimitOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Can only be specified if the action for the rule is "rate_based_ban". If specified, determines the time (in seconds) the traffic will continue to be banned by the rate limit after the rate falls below the threshold. + * + * Generated from protobuf field optional int32 ban_duration_sec = 42896726; + */ + protected $ban_duration_sec = null; + /** + * Can only be specified if the action for the rule is "rate_based_ban". If specified, the key will be banned for the configured 'ban_duration_sec' when the number of requests that exceed the 'rate_limit_threshold' also exceed this 'ban_threshold'. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptionsThreshold ban_threshold = 501208123; + */ + protected $ban_threshold = null; + /** + * Action to take for requests that are under the configured rate limit threshold. Valid option is "allow" only. + * + * Generated from protobuf field optional string conform_action = 517612367; + */ + protected $conform_action = null; + /** + * Determines the key to enforce the rate_limit_threshold on. Possible values are: - ALL: A single rate limit threshold is applied to all the requests matching this rule. This is the default value if "enforceOnKey" is not configured. - IP: The source IP address of the request is the key. Each IP has this limit enforced separately. - HTTP_HEADER: The value of the HTTP header whose name is configured under "enforceOnKeyName". The key value is truncated to the first 128 bytes of the header value. If no such header is present in the request, the key type defaults to ALL. - XFF_IP: The first IP address (i.e. the originating client IP address) specified in the list of IPs under X-Forwarded-For HTTP header. If no such header is present or the value is not a valid IP, the key defaults to the source IP address of the request i.e. key type IP. - HTTP_COOKIE: The value of the HTTP cookie whose name is configured under "enforceOnKeyName". The key value is truncated to the first 128 bytes of the cookie value. If no such cookie is present in the request, the key type defaults to ALL. - HTTP_PATH: The URL path of the HTTP request. The key value is truncated to the first 128 bytes. - SNI: Server name indication in the TLS session of the HTTPS request. The key value is truncated to the first 128 bytes. The key type defaults to ALL on a HTTP session. - REGION_CODE: The country/region from which the request originates. - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. - USER_IP: The IP address of the originating client, which is resolved based on "userIpRequestHeaders" configured with the security policy. If there is no "userIpRequestHeaders" configuration or an IP address cannot be resolved from it, the key type defaults to IP. + * Check the EnforceOnKey enum for the list of possible values. + * + * Generated from protobuf field optional string enforce_on_key = 416648956; + */ + protected $enforce_on_key = null; + /** + * If specified, any combination of values of enforce_on_key_type/enforce_on_key_name is treated as the key on which ratelimit threshold/action is enforced. You can specify up to 3 enforce_on_key_configs. If enforce_on_key_configs is specified, enforce_on_key must not be specified. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig enforce_on_key_configs = 33906478; + */ + private $enforce_on_key_configs; + /** + * 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. + * + * Generated from protobuf field optional string enforce_on_key_name = 132555246; + */ + protected $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. The `redirect` action is only supported in Global Security Policies of type CLOUD_ARMOR. + * + * Generated from protobuf field optional string exceed_action = 167159073; + */ + protected $exceed_action = null; + /** + * Parameters defining the redirect action that is used as the exceed action. Cannot be specified if the exceed action is not redirect. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions exceed_redirect_options = 473646694; + */ + protected $exceed_redirect_options = null; + /** + * Threshold at which to begin ratelimiting. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptionsThreshold rate_limit_threshold = 315875208; + */ + protected $rate_limit_threshold = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $ban_duration_sec + * Can only be specified if the action for the rule is "rate_based_ban". If specified, determines the time (in seconds) the traffic will continue to be banned by the rate limit after the rate falls below the threshold. + * @type \Google\Cloud\Compute\V1\SecurityPolicyRuleRateLimitOptionsThreshold $ban_threshold + * Can only be specified if the action for the rule is "rate_based_ban". If specified, the key will be banned for the configured 'ban_duration_sec' when the number of requests that exceed the 'rate_limit_threshold' also exceed this 'ban_threshold'. + * @type string $conform_action + * Action to take for requests that are under the configured rate limit threshold. Valid option is "allow" only. + * @type string $enforce_on_key + * Determines the key to enforce the rate_limit_threshold on. Possible values are: - ALL: A single rate limit threshold is applied to all the requests matching this rule. This is the default value if "enforceOnKey" is not configured. - IP: The source IP address of the request is the key. Each IP has this limit enforced separately. - HTTP_HEADER: The value of the HTTP header whose name is configured under "enforceOnKeyName". The key value is truncated to the first 128 bytes of the header value. If no such header is present in the request, the key type defaults to ALL. - XFF_IP: The first IP address (i.e. the originating client IP address) specified in the list of IPs under X-Forwarded-For HTTP header. If no such header is present or the value is not a valid IP, the key defaults to the source IP address of the request i.e. key type IP. - HTTP_COOKIE: The value of the HTTP cookie whose name is configured under "enforceOnKeyName". The key value is truncated to the first 128 bytes of the cookie value. If no such cookie is present in the request, the key type defaults to ALL. - HTTP_PATH: The URL path of the HTTP request. The key value is truncated to the first 128 bytes. - SNI: Server name indication in the TLS session of the HTTPS request. The key value is truncated to the first 128 bytes. The key type defaults to ALL on a HTTP session. - REGION_CODE: The country/region from which the request originates. - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. - USER_IP: The IP address of the originating client, which is resolved based on "userIpRequestHeaders" configured with the security policy. If there is no "userIpRequestHeaders" configuration or an IP address cannot be resolved from it, the key type defaults to IP. + * Check the EnforceOnKey enum for the list of possible values. + * @type array<\Google\Cloud\Compute\V1\SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig>|\Google\Protobuf\Internal\RepeatedField $enforce_on_key_configs + * If specified, any combination of values of enforce_on_key_type/enforce_on_key_name is treated as the key on which ratelimit threshold/action is enforced. You can specify up to 3 enforce_on_key_configs. If enforce_on_key_configs is specified, enforce_on_key must not be specified. + * @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. The `redirect` action is only supported in Global Security Policies of type CLOUD_ARMOR. + * @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. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * @type \Google\Cloud\Compute\V1\SecurityPolicyRuleRateLimitOptionsThreshold $rate_limit_threshold + * Threshold at which to begin ratelimiting. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Can only be specified if the action for the rule is "rate_based_ban". If specified, determines the time (in seconds) the traffic will continue to be banned by the rate limit after the rate falls below the threshold. + * + * Generated from protobuf field optional int32 ban_duration_sec = 42896726; + * @return int + */ + public function getBanDurationSec() + { + return isset($this->ban_duration_sec) ? $this->ban_duration_sec : 0; + } + + public function hasBanDurationSec() + { + return isset($this->ban_duration_sec); + } + + public function clearBanDurationSec() + { + unset($this->ban_duration_sec); + } + + /** + * Can only be specified if the action for the rule is "rate_based_ban". If specified, determines the time (in seconds) the traffic will continue to be banned by the rate limit after the rate falls below the threshold. + * + * Generated from protobuf field optional int32 ban_duration_sec = 42896726; + * @param int $var + * @return $this + */ + public function setBanDurationSec($var) + { + GPBUtil::checkInt32($var); + $this->ban_duration_sec = $var; + + return $this; + } + + /** + * Can only be specified if the action for the rule is "rate_based_ban". If specified, the key will be banned for the configured 'ban_duration_sec' when the number of requests that exceed the 'rate_limit_threshold' also exceed this 'ban_threshold'. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptionsThreshold ban_threshold = 501208123; + * @return \Google\Cloud\Compute\V1\SecurityPolicyRuleRateLimitOptionsThreshold|null + */ + public function getBanThreshold() + { + return $this->ban_threshold; + } + + public function hasBanThreshold() + { + return isset($this->ban_threshold); + } + + public function clearBanThreshold() + { + unset($this->ban_threshold); + } + + /** + * Can only be specified if the action for the rule is "rate_based_ban". If specified, the key will be banned for the configured 'ban_duration_sec' when the number of requests that exceed the 'rate_limit_threshold' also exceed this 'ban_threshold'. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptionsThreshold ban_threshold = 501208123; + * @param \Google\Cloud\Compute\V1\SecurityPolicyRuleRateLimitOptionsThreshold $var + * @return $this + */ + public function setBanThreshold($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyRuleRateLimitOptionsThreshold::class); + $this->ban_threshold = $var; + + return $this; + } + + /** + * Action to take for requests that are under the configured rate limit threshold. Valid option is "allow" only. + * + * Generated from protobuf field optional string conform_action = 517612367; + * @return string + */ + public function getConformAction() + { + return isset($this->conform_action) ? $this->conform_action : ''; + } + + public function hasConformAction() + { + return isset($this->conform_action); + } + + public function clearConformAction() + { + unset($this->conform_action); + } + + /** + * Action to take for requests that are under the configured rate limit threshold. Valid option is "allow" only. + * + * Generated from protobuf field optional string conform_action = 517612367; + * @param string $var + * @return $this + */ + public function setConformAction($var) + { + GPBUtil::checkString($var, True); + $this->conform_action = $var; + + return $this; + } + + /** + * Determines the key to enforce the rate_limit_threshold on. Possible values are: - ALL: A single rate limit threshold is applied to all the requests matching this rule. This is the default value if "enforceOnKey" is not configured. - IP: The source IP address of the request is the key. Each IP has this limit enforced separately. - HTTP_HEADER: The value of the HTTP header whose name is configured under "enforceOnKeyName". The key value is truncated to the first 128 bytes of the header value. If no such header is present in the request, the key type defaults to ALL. - XFF_IP: The first IP address (i.e. the originating client IP address) specified in the list of IPs under X-Forwarded-For HTTP header. If no such header is present or the value is not a valid IP, the key defaults to the source IP address of the request i.e. key type IP. - HTTP_COOKIE: The value of the HTTP cookie whose name is configured under "enforceOnKeyName". The key value is truncated to the first 128 bytes of the cookie value. If no such cookie is present in the request, the key type defaults to ALL. - HTTP_PATH: The URL path of the HTTP request. The key value is truncated to the first 128 bytes. - SNI: Server name indication in the TLS session of the HTTPS request. The key value is truncated to the first 128 bytes. The key type defaults to ALL on a HTTP session. - REGION_CODE: The country/region from which the request originates. - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. - USER_IP: The IP address of the originating client, which is resolved based on "userIpRequestHeaders" configured with the security policy. If there is no "userIpRequestHeaders" configuration or an IP address cannot be resolved from it, the key type defaults to IP. + * Check the EnforceOnKey enum for the list of possible values. + * + * Generated from protobuf field optional string enforce_on_key = 416648956; + * @return string + */ + public function getEnforceOnKey() + { + return isset($this->enforce_on_key) ? $this->enforce_on_key : ''; + } + + public function hasEnforceOnKey() + { + return isset($this->enforce_on_key); + } + + public function clearEnforceOnKey() + { + unset($this->enforce_on_key); + } + + /** + * Determines the key to enforce the rate_limit_threshold on. Possible values are: - ALL: A single rate limit threshold is applied to all the requests matching this rule. This is the default value if "enforceOnKey" is not configured. - IP: The source IP address of the request is the key. Each IP has this limit enforced separately. - HTTP_HEADER: The value of the HTTP header whose name is configured under "enforceOnKeyName". The key value is truncated to the first 128 bytes of the header value. If no such header is present in the request, the key type defaults to ALL. - XFF_IP: The first IP address (i.e. the originating client IP address) specified in the list of IPs under X-Forwarded-For HTTP header. If no such header is present or the value is not a valid IP, the key defaults to the source IP address of the request i.e. key type IP. - HTTP_COOKIE: The value of the HTTP cookie whose name is configured under "enforceOnKeyName". The key value is truncated to the first 128 bytes of the cookie value. If no such cookie is present in the request, the key type defaults to ALL. - HTTP_PATH: The URL path of the HTTP request. The key value is truncated to the first 128 bytes. - SNI: Server name indication in the TLS session of the HTTPS request. The key value is truncated to the first 128 bytes. The key type defaults to ALL on a HTTP session. - REGION_CODE: The country/region from which the request originates. - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. - USER_IP: The IP address of the originating client, which is resolved based on "userIpRequestHeaders" configured with the security policy. If there is no "userIpRequestHeaders" configuration or an IP address cannot be resolved from it, the key type defaults to IP. + * Check the EnforceOnKey enum for the list of possible values. + * + * Generated from protobuf field optional string enforce_on_key = 416648956; + * @param string $var + * @return $this + */ + public function setEnforceOnKey($var) + { + GPBUtil::checkString($var, True); + $this->enforce_on_key = $var; + + return $this; + } + + /** + * If specified, any combination of values of enforce_on_key_type/enforce_on_key_name is treated as the key on which ratelimit threshold/action is enforced. You can specify up to 3 enforce_on_key_configs. If enforce_on_key_configs is specified, enforce_on_key must not be specified. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig enforce_on_key_configs = 33906478; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEnforceOnKeyConfigs() + { + return $this->enforce_on_key_configs; + } + + /** + * If specified, any combination of values of enforce_on_key_type/enforce_on_key_name is treated as the key on which ratelimit threshold/action is enforced. You can specify up to 3 enforce_on_key_configs. If enforce_on_key_configs is specified, enforce_on_key must not be specified. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig enforce_on_key_configs = 33906478; + * @param array<\Google\Cloud\Compute\V1\SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEnforceOnKeyConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig::class); + $this->enforce_on_key_configs = $arr; + + return $this; + } + + /** + * 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. + * + * Generated from protobuf field optional string enforce_on_key_name = 132555246; + * @return string + */ + public function getEnforceOnKeyName() + { + return isset($this->enforce_on_key_name) ? $this->enforce_on_key_name : ''; + } + + public function hasEnforceOnKeyName() + { + return isset($this->enforce_on_key_name); + } + + public function clearEnforceOnKeyName() + { + unset($this->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. + * + * Generated from protobuf field optional string enforce_on_key_name = 132555246; + * @param string $var + * @return $this + */ + public function setEnforceOnKeyName($var) + { + GPBUtil::checkString($var, True); + $this->enforce_on_key_name = $var; + + return $this; + } + + /** + * 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. The `redirect` action is only supported in Global Security Policies of type CLOUD_ARMOR. + * + * Generated from protobuf field optional string exceed_action = 167159073; + * @return string + */ + public function getExceedAction() + { + return isset($this->exceed_action) ? $this->exceed_action : ''; + } + + public function hasExceedAction() + { + return isset($this->exceed_action); + } + + public function clearExceedAction() + { + unset($this->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. The `redirect` action is only supported in Global Security Policies of type CLOUD_ARMOR. + * + * Generated from protobuf field optional string exceed_action = 167159073; + * @param string $var + * @return $this + */ + public function setExceedAction($var) + { + GPBUtil::checkString($var, True); + $this->exceed_action = $var; + + return $this; + } + + /** + * Parameters defining the redirect action that is used as the exceed action. Cannot be specified if the exceed action is not redirect. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions exceed_redirect_options = 473646694; + * @return \Google\Cloud\Compute\V1\SecurityPolicyRuleRedirectOptions|null + */ + public function getExceedRedirectOptions() + { + return $this->exceed_redirect_options; + } + + public function hasExceedRedirectOptions() + { + return isset($this->exceed_redirect_options); + } + + public function clearExceedRedirectOptions() + { + unset($this->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. This field is only supported in Global Security Policies of type CLOUD_ARMOR. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions exceed_redirect_options = 473646694; + * @param \Google\Cloud\Compute\V1\SecurityPolicyRuleRedirectOptions $var + * @return $this + */ + public function setExceedRedirectOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyRuleRedirectOptions::class); + $this->exceed_redirect_options = $var; + + return $this; + } + + /** + * Threshold at which to begin ratelimiting. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptionsThreshold rate_limit_threshold = 315875208; + * @return \Google\Cloud\Compute\V1\SecurityPolicyRuleRateLimitOptionsThreshold|null + */ + public function getRateLimitThreshold() + { + return $this->rate_limit_threshold; + } + + public function hasRateLimitThreshold() + { + return isset($this->rate_limit_threshold); + } + + public function clearRateLimitThreshold() + { + unset($this->rate_limit_threshold); + } + + /** + * Threshold at which to begin ratelimiting. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptionsThreshold rate_limit_threshold = 315875208; + * @param \Google\Cloud\Compute\V1\SecurityPolicyRuleRateLimitOptionsThreshold $var + * @return $this + */ + public function setRateLimitThreshold($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyRuleRateLimitOptionsThreshold::class); + $this->rate_limit_threshold = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRateLimitOptions/EnforceOnKey.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRateLimitOptions/EnforceOnKey.php new file mode 100644 index 000000000000..69678c7d8ad3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRateLimitOptions/EnforceOnKey.php @@ -0,0 +1,100 @@ +google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptions.EnforceOnKey + */ +class EnforceOnKey +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ENFORCE_ON_KEY = 0; + */ + const UNDEFINED_ENFORCE_ON_KEY = 0; + /** + * Generated from protobuf enum ALL = 64897; + */ + const ALL = 64897; + /** + * Generated from protobuf enum HTTP_COOKIE = 494981627; + */ + const HTTP_COOKIE = 494981627; + /** + * Generated from protobuf enum HTTP_HEADER = 91597348; + */ + const HTTP_HEADER = 91597348; + /** + * Generated from protobuf enum HTTP_PATH = 311503228; + */ + const HTTP_PATH = 311503228; + /** + * Generated from protobuf enum IP = 2343; + */ + const IP = 2343; + /** + * Generated from protobuf enum REGION_CODE = 79559768; + */ + const REGION_CODE = 79559768; + /** + * Generated from protobuf enum SNI = 82254; + */ + const SNI = 82254; + /** + * Generated from protobuf enum TLS_JA3_FINGERPRINT = 327127933; + */ + const TLS_JA3_FINGERPRINT = 327127933; + /** + * Generated from protobuf enum USER_IP = 34009627; + */ + const USER_IP = 34009627; + /** + * Generated from protobuf enum XFF_IP = 438707118; + */ + const XFF_IP = 438707118; + + private static $valueToName = [ + self::UNDEFINED_ENFORCE_ON_KEY => 'UNDEFINED_ENFORCE_ON_KEY', + self::ALL => 'ALL', + self::HTTP_COOKIE => 'HTTP_COOKIE', + self::HTTP_HEADER => 'HTTP_HEADER', + self::HTTP_PATH => 'HTTP_PATH', + self::IP => 'IP', + self::REGION_CODE => 'REGION_CODE', + self::SNI => 'SNI', + self::TLS_JA3_FINGERPRINT => 'TLS_JA3_FINGERPRINT', + self::USER_IP => 'USER_IP', + self::XFF_IP => 'XFF_IP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(EnforceOnKey::class, \Google\Cloud\Compute\V1\SecurityPolicyRuleRateLimitOptions_EnforceOnKey::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig.php new file mode 100644 index 000000000000..e0b67d983b7c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig.php @@ -0,0 +1,124 @@ +google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig + */ +class SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig extends \Google\Protobuf\Internal\Message +{ + /** + * 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. + * + * Generated from protobuf field optional string enforce_on_key_name = 132555246; + */ + protected $enforce_on_key_name = null; + /** + * Determines the key to enforce the rate_limit_threshold on. Possible values are: - ALL: A single rate limit threshold is applied to all the requests matching this rule. This is the default value if "enforceOnKeyConfigs" is not configured. - IP: The source IP address of the request is the key. Each IP has this limit enforced separately. - HTTP_HEADER: The value of the HTTP header whose name is configured under "enforceOnKeyName". The key value is truncated to the first 128 bytes of the header value. If no such header is present in the request, the key type defaults to ALL. - XFF_IP: The first IP address (i.e. the originating client IP address) specified in the list of IPs under X-Forwarded-For HTTP header. If no such header is present or the value is not a valid IP, the key defaults to the source IP address of the request i.e. key type IP. - HTTP_COOKIE: The value of the HTTP cookie whose name is configured under "enforceOnKeyName". The key value is truncated to the first 128 bytes of the cookie value. If no such cookie is present in the request, the key type defaults to ALL. - HTTP_PATH: The URL path of the HTTP request. The key value is truncated to the first 128 bytes. - SNI: Server name indication in the TLS session of the HTTPS request. The key value is truncated to the first 128 bytes. The key type defaults to ALL on a HTTP session. - REGION_CODE: The country/region from which the request originates. - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. - USER_IP: The IP address of the originating client, which is resolved based on "userIpRequestHeaders" configured with the security policy. If there is no "userIpRequestHeaders" configuration or an IP address cannot be resolved from it, the key type defaults to IP. + * Check the EnforceOnKeyType enum for the list of possible values. + * + * Generated from protobuf field optional string enforce_on_key_type = 132757149; + */ + protected $enforce_on_key_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $enforce_on_key_type + * Determines the key to enforce the rate_limit_threshold on. Possible values are: - ALL: A single rate limit threshold is applied to all the requests matching this rule. This is the default value if "enforceOnKeyConfigs" is not configured. - IP: The source IP address of the request is the key. Each IP has this limit enforced separately. - HTTP_HEADER: The value of the HTTP header whose name is configured under "enforceOnKeyName". The key value is truncated to the first 128 bytes of the header value. If no such header is present in the request, the key type defaults to ALL. - XFF_IP: The first IP address (i.e. the originating client IP address) specified in the list of IPs under X-Forwarded-For HTTP header. If no such header is present or the value is not a valid IP, the key defaults to the source IP address of the request i.e. key type IP. - HTTP_COOKIE: The value of the HTTP cookie whose name is configured under "enforceOnKeyName". The key value is truncated to the first 128 bytes of the cookie value. If no such cookie is present in the request, the key type defaults to ALL. - HTTP_PATH: The URL path of the HTTP request. The key value is truncated to the first 128 bytes. - SNI: Server name indication in the TLS session of the HTTPS request. The key value is truncated to the first 128 bytes. The key type defaults to ALL on a HTTP session. - REGION_CODE: The country/region from which the request originates. - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. - USER_IP: The IP address of the originating client, which is resolved based on "userIpRequestHeaders" configured with the security policy. If there is no "userIpRequestHeaders" configuration or an IP address cannot be resolved from it, the key type defaults to IP. + * Check the EnforceOnKeyType enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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. + * + * Generated from protobuf field optional string enforce_on_key_name = 132555246; + * @return string + */ + public function getEnforceOnKeyName() + { + return isset($this->enforce_on_key_name) ? $this->enforce_on_key_name : ''; + } + + public function hasEnforceOnKeyName() + { + return isset($this->enforce_on_key_name); + } + + public function clearEnforceOnKeyName() + { + unset($this->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. + * + * Generated from protobuf field optional string enforce_on_key_name = 132555246; + * @param string $var + * @return $this + */ + public function setEnforceOnKeyName($var) + { + GPBUtil::checkString($var, True); + $this->enforce_on_key_name = $var; + + return $this; + } + + /** + * Determines the key to enforce the rate_limit_threshold on. Possible values are: - ALL: A single rate limit threshold is applied to all the requests matching this rule. This is the default value if "enforceOnKeyConfigs" is not configured. - IP: The source IP address of the request is the key. Each IP has this limit enforced separately. - HTTP_HEADER: The value of the HTTP header whose name is configured under "enforceOnKeyName". The key value is truncated to the first 128 bytes of the header value. If no such header is present in the request, the key type defaults to ALL. - XFF_IP: The first IP address (i.e. the originating client IP address) specified in the list of IPs under X-Forwarded-For HTTP header. If no such header is present or the value is not a valid IP, the key defaults to the source IP address of the request i.e. key type IP. - HTTP_COOKIE: The value of the HTTP cookie whose name is configured under "enforceOnKeyName". The key value is truncated to the first 128 bytes of the cookie value. If no such cookie is present in the request, the key type defaults to ALL. - HTTP_PATH: The URL path of the HTTP request. The key value is truncated to the first 128 bytes. - SNI: Server name indication in the TLS session of the HTTPS request. The key value is truncated to the first 128 bytes. The key type defaults to ALL on a HTTP session. - REGION_CODE: The country/region from which the request originates. - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. - USER_IP: The IP address of the originating client, which is resolved based on "userIpRequestHeaders" configured with the security policy. If there is no "userIpRequestHeaders" configuration or an IP address cannot be resolved from it, the key type defaults to IP. + * Check the EnforceOnKeyType enum for the list of possible values. + * + * Generated from protobuf field optional string enforce_on_key_type = 132757149; + * @return string + */ + public function getEnforceOnKeyType() + { + return isset($this->enforce_on_key_type) ? $this->enforce_on_key_type : ''; + } + + public function hasEnforceOnKeyType() + { + return isset($this->enforce_on_key_type); + } + + public function clearEnforceOnKeyType() + { + unset($this->enforce_on_key_type); + } + + /** + * Determines the key to enforce the rate_limit_threshold on. Possible values are: - ALL: A single rate limit threshold is applied to all the requests matching this rule. This is the default value if "enforceOnKeyConfigs" is not configured. - IP: The source IP address of the request is the key. Each IP has this limit enforced separately. - HTTP_HEADER: The value of the HTTP header whose name is configured under "enforceOnKeyName". The key value is truncated to the first 128 bytes of the header value. If no such header is present in the request, the key type defaults to ALL. - XFF_IP: The first IP address (i.e. the originating client IP address) specified in the list of IPs under X-Forwarded-For HTTP header. If no such header is present or the value is not a valid IP, the key defaults to the source IP address of the request i.e. key type IP. - HTTP_COOKIE: The value of the HTTP cookie whose name is configured under "enforceOnKeyName". The key value is truncated to the first 128 bytes of the cookie value. If no such cookie is present in the request, the key type defaults to ALL. - HTTP_PATH: The URL path of the HTTP request. The key value is truncated to the first 128 bytes. - SNI: Server name indication in the TLS session of the HTTPS request. The key value is truncated to the first 128 bytes. The key type defaults to ALL on a HTTP session. - REGION_CODE: The country/region from which the request originates. - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. - USER_IP: The IP address of the originating client, which is resolved based on "userIpRequestHeaders" configured with the security policy. If there is no "userIpRequestHeaders" configuration or an IP address cannot be resolved from it, the key type defaults to IP. + * Check the EnforceOnKeyType enum for the list of possible values. + * + * Generated from protobuf field optional string enforce_on_key_type = 132757149; + * @param string $var + * @return $this + */ + public function setEnforceOnKeyType($var) + { + GPBUtil::checkString($var, True); + $this->enforce_on_key_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig/EnforceOnKeyType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig/EnforceOnKeyType.php new file mode 100644 index 000000000000..949bfcabb992 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig/EnforceOnKeyType.php @@ -0,0 +1,100 @@ +google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig.EnforceOnKeyType + */ +class EnforceOnKeyType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ENFORCE_ON_KEY_TYPE = 0; + */ + const UNDEFINED_ENFORCE_ON_KEY_TYPE = 0; + /** + * Generated from protobuf enum ALL = 64897; + */ + const ALL = 64897; + /** + * Generated from protobuf enum HTTP_COOKIE = 494981627; + */ + const HTTP_COOKIE = 494981627; + /** + * Generated from protobuf enum HTTP_HEADER = 91597348; + */ + const HTTP_HEADER = 91597348; + /** + * Generated from protobuf enum HTTP_PATH = 311503228; + */ + const HTTP_PATH = 311503228; + /** + * Generated from protobuf enum IP = 2343; + */ + const IP = 2343; + /** + * Generated from protobuf enum REGION_CODE = 79559768; + */ + const REGION_CODE = 79559768; + /** + * Generated from protobuf enum SNI = 82254; + */ + const SNI = 82254; + /** + * Generated from protobuf enum TLS_JA3_FINGERPRINT = 327127933; + */ + const TLS_JA3_FINGERPRINT = 327127933; + /** + * Generated from protobuf enum USER_IP = 34009627; + */ + const USER_IP = 34009627; + /** + * Generated from protobuf enum XFF_IP = 438707118; + */ + const XFF_IP = 438707118; + + private static $valueToName = [ + self::UNDEFINED_ENFORCE_ON_KEY_TYPE => 'UNDEFINED_ENFORCE_ON_KEY_TYPE', + self::ALL => 'ALL', + self::HTTP_COOKIE => 'HTTP_COOKIE', + self::HTTP_HEADER => 'HTTP_HEADER', + self::HTTP_PATH => 'HTTP_PATH', + self::IP => 'IP', + self::REGION_CODE => 'REGION_CODE', + self::SNI => 'SNI', + self::TLS_JA3_FINGERPRINT => 'TLS_JA3_FINGERPRINT', + self::USER_IP => 'USER_IP', + self::XFF_IP => 'XFF_IP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(EnforceOnKeyType::class, \Google\Cloud\Compute\V1\SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig_EnforceOnKeyType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRateLimitOptionsThreshold.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRateLimitOptionsThreshold.php new file mode 100644 index 000000000000..c2b48ad7c3eb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRateLimitOptionsThreshold.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.SecurityPolicyRuleRateLimitOptionsThreshold + */ +class SecurityPolicyRuleRateLimitOptionsThreshold extends \Google\Protobuf\Internal\Message +{ + /** + * Number of HTTP(S) requests for calculating the threshold. + * + * Generated from protobuf field optional int32 count = 94851343; + */ + protected $count = null; + /** + * Interval over which the threshold is computed. + * + * Generated from protobuf field optional int32 interval_sec = 41084375; + */ + protected $interval_sec = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $count + * Number of HTTP(S) requests for calculating the threshold. + * @type int $interval_sec + * Interval over which the threshold is computed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Number of HTTP(S) requests for calculating the threshold. + * + * Generated from protobuf field optional int32 count = 94851343; + * @return int + */ + public function getCount() + { + return isset($this->count) ? $this->count : 0; + } + + public function hasCount() + { + return isset($this->count); + } + + public function clearCount() + { + unset($this->count); + } + + /** + * Number of HTTP(S) requests for calculating the threshold. + * + * Generated from protobuf field optional int32 count = 94851343; + * @param int $var + * @return $this + */ + public function setCount($var) + { + GPBUtil::checkInt32($var); + $this->count = $var; + + return $this; + } + + /** + * Interval over which the threshold is computed. + * + * Generated from protobuf field optional int32 interval_sec = 41084375; + * @return int + */ + public function getIntervalSec() + { + return isset($this->interval_sec) ? $this->interval_sec : 0; + } + + public function hasIntervalSec() + { + return isset($this->interval_sec); + } + + public function clearIntervalSec() + { + unset($this->interval_sec); + } + + /** + * Interval over which the threshold is computed. + * + * Generated from protobuf field optional int32 interval_sec = 41084375; + * @param int $var + * @return $this + */ + public function setIntervalSec($var) + { + GPBUtil::checkInt32($var); + $this->interval_sec = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRedirectOptions.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRedirectOptions.php new file mode 100644 index 000000000000..08332a22d2d6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRedirectOptions.php @@ -0,0 +1,124 @@ +google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions + */ +class SecurityPolicyRuleRedirectOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Target for the redirect action. This is required if the type is EXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA. + * + * Generated from protobuf field optional string target = 192835985; + */ + protected $target = null; + /** + * Type of the redirect action. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $target + * Target for the redirect action. This is required if the type is EXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA. + * @type string $type + * Type of the redirect action. + * Check the Type enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Target for the redirect action. This is required if the type is EXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA. + * + * Generated from protobuf field optional string target = 192835985; + * @return string + */ + public function getTarget() + { + return isset($this->target) ? $this->target : ''; + } + + public function hasTarget() + { + return isset($this->target); + } + + public function clearTarget() + { + unset($this->target); + } + + /** + * Target for the redirect action. This is required if the type is EXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA. + * + * Generated from protobuf field optional string target = 192835985; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Type of the redirect action. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * Type of the redirect action. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRedirectOptions/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRedirectOptions/Type.php new file mode 100644 index 000000000000..ee0770e85bc4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRedirectOptions/Type.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.SecurityPolicyRuleRedirectOptions.Type + */ +class Type +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TYPE = 0; + */ + const UNDEFINED_TYPE = 0; + /** + * Generated from protobuf enum EXTERNAL_302 = 395733761; + */ + const EXTERNAL_302 = 395733761; + /** + * Generated from protobuf enum GOOGLE_RECAPTCHA = 518803009; + */ + const GOOGLE_RECAPTCHA = 518803009; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::EXTERNAL_302 => 'EXTERNAL_302', + self::GOOGLE_RECAPTCHA => 'GOOGLE_RECAPTCHA', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Compute\V1\SecurityPolicyRuleRedirectOptions_Type::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyUserDefinedField.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyUserDefinedField.php new file mode 100644 index 000000000000..bd6936b44472 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyUserDefinedField.php @@ -0,0 +1,256 @@ +google.cloud.compute.v1.SecurityPolicyUserDefinedField + */ +class SecurityPolicyUserDefinedField extends \Google\Protobuf\Internal\Message +{ + /** + * The base relative to which 'offset' is measured. Possible values are: - IPV4: Points to the beginning of the IPv4 header. - IPV6: Points to the beginning of the IPv6 header. - TCP: Points to the beginning of the TCP header, skipping over any IPv4 options or IPv6 extension headers. Not present for non-first fragments. - UDP: Points to the beginning of the UDP header, skipping over any IPv4 options or IPv6 extension headers. Not present for non-first fragments. required + * Check the Base enum for the list of possible values. + * + * Generated from protobuf field optional string base = 3016401; + */ + protected $base = null; + /** + * If specified, apply this mask (bitwise AND) to the field to ignore bits before matching. Encoded as a hexadecimal number (starting with "0x"). The last byte of the field (in network byte order) corresponds to the least significant byte of the mask. + * + * Generated from protobuf field optional string mask = 3344108; + */ + protected $mask = null; + /** + * The name of this field. Must be unique within the policy. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Offset of the first byte of the field (in network byte order) relative to 'base'. + * + * Generated from protobuf field optional int32 offset = 53961875; + */ + protected $offset = null; + /** + * Size of the field in bytes. Valid values: 1-4. + * + * Generated from protobuf field optional int32 size = 3530753; + */ + protected $size = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $base + * The base relative to which 'offset' is measured. Possible values are: - IPV4: Points to the beginning of the IPv4 header. - IPV6: Points to the beginning of the IPv6 header. - TCP: Points to the beginning of the TCP header, skipping over any IPv4 options or IPv6 extension headers. Not present for non-first fragments. - UDP: Points to the beginning of the UDP header, skipping over any IPv4 options or IPv6 extension headers. Not present for non-first fragments. required + * Check the Base enum for the list of possible values. + * @type string $mask + * If specified, apply this mask (bitwise AND) to the field to ignore bits before matching. Encoded as a hexadecimal number (starting with "0x"). The last byte of the field (in network byte order) corresponds to the least significant byte of the mask. + * @type string $name + * The name of this field. Must be unique within the policy. + * @type int $offset + * Offset of the first byte of the field (in network byte order) relative to 'base'. + * @type int $size + * Size of the field in bytes. Valid values: 1-4. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The base relative to which 'offset' is measured. Possible values are: - IPV4: Points to the beginning of the IPv4 header. - IPV6: Points to the beginning of the IPv6 header. - TCP: Points to the beginning of the TCP header, skipping over any IPv4 options or IPv6 extension headers. Not present for non-first fragments. - UDP: Points to the beginning of the UDP header, skipping over any IPv4 options or IPv6 extension headers. Not present for non-first fragments. required + * Check the Base enum for the list of possible values. + * + * Generated from protobuf field optional string base = 3016401; + * @return string + */ + public function getBase() + { + return isset($this->base) ? $this->base : ''; + } + + public function hasBase() + { + return isset($this->base); + } + + public function clearBase() + { + unset($this->base); + } + + /** + * The base relative to which 'offset' is measured. Possible values are: - IPV4: Points to the beginning of the IPv4 header. - IPV6: Points to the beginning of the IPv6 header. - TCP: Points to the beginning of the TCP header, skipping over any IPv4 options or IPv6 extension headers. Not present for non-first fragments. - UDP: Points to the beginning of the UDP header, skipping over any IPv4 options or IPv6 extension headers. Not present for non-first fragments. required + * Check the Base enum for the list of possible values. + * + * Generated from protobuf field optional string base = 3016401; + * @param string $var + * @return $this + */ + public function setBase($var) + { + GPBUtil::checkString($var, True); + $this->base = $var; + + return $this; + } + + /** + * If specified, apply this mask (bitwise AND) to the field to ignore bits before matching. Encoded as a hexadecimal number (starting with "0x"). The last byte of the field (in network byte order) corresponds to the least significant byte of the mask. + * + * Generated from protobuf field optional string mask = 3344108; + * @return string + */ + public function getMask() + { + return isset($this->mask) ? $this->mask : ''; + } + + public function hasMask() + { + return isset($this->mask); + } + + public function clearMask() + { + unset($this->mask); + } + + /** + * If specified, apply this mask (bitwise AND) to the field to ignore bits before matching. Encoded as a hexadecimal number (starting with "0x"). The last byte of the field (in network byte order) corresponds to the least significant byte of the mask. + * + * Generated from protobuf field optional string mask = 3344108; + * @param string $var + * @return $this + */ + public function setMask($var) + { + GPBUtil::checkString($var, True); + $this->mask = $var; + + return $this; + } + + /** + * The name of this field. Must be unique within the policy. + * + * 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 of this field. Must be unique within the policy. + * + * 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; + } + + /** + * Offset of the first byte of the field (in network byte order) relative to 'base'. + * + * Generated from protobuf field optional int32 offset = 53961875; + * @return int + */ + public function getOffset() + { + return isset($this->offset) ? $this->offset : 0; + } + + public function hasOffset() + { + return isset($this->offset); + } + + public function clearOffset() + { + unset($this->offset); + } + + /** + * Offset of the first byte of the field (in network byte order) relative to 'base'. + * + * Generated from protobuf field optional int32 offset = 53961875; + * @param int $var + * @return $this + */ + public function setOffset($var) + { + GPBUtil::checkInt32($var); + $this->offset = $var; + + return $this; + } + + /** + * Size of the field in bytes. Valid values: 1-4. + * + * Generated from protobuf field optional int32 size = 3530753; + * @return int + */ + public function getSize() + { + return isset($this->size) ? $this->size : 0; + } + + public function hasSize() + { + return isset($this->size); + } + + public function clearSize() + { + unset($this->size); + } + + /** + * Size of the field in bytes. Valid values: 1-4. + * + * Generated from protobuf field optional int32 size = 3530753; + * @param int $var + * @return $this + */ + public function setSize($var) + { + GPBUtil::checkInt32($var); + $this->size = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyUserDefinedField/Base.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyUserDefinedField/Base.php new file mode 100644 index 000000000000..b17aa89e5250 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyUserDefinedField/Base.php @@ -0,0 +1,70 @@ +google.cloud.compute.v1.SecurityPolicyUserDefinedField.Base + */ +class Base +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_BASE = 0; + */ + const UNDEFINED_BASE = 0; + /** + * Generated from protobuf enum IPV4 = 2254341; + */ + const IPV4 = 2254341; + /** + * Generated from protobuf enum IPV6 = 2254343; + */ + const IPV6 = 2254343; + /** + * Generated from protobuf enum TCP = 82881; + */ + const TCP = 82881; + /** + * Generated from protobuf enum UDP = 83873; + */ + const UDP = 83873; + + private static $valueToName = [ + self::UNDEFINED_BASE => 'UNDEFINED_BASE', + self::IPV4 => 'IPV4', + self::IPV6 => 'IPV6', + self::TCP => 'TCP', + self::UDP => 'UDP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Base::class, \Google\Cloud\Compute\V1\SecurityPolicyUserDefinedField_Base::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecuritySettings.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecuritySettings.php new file mode 100644 index 000000000000..29cd7c3a1246 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecuritySettings.php @@ -0,0 +1,155 @@ +google.cloud.compute.v1.SecuritySettings + */ +class SecuritySettings extends \Google\Protobuf\Internal\Message +{ + /** + * The configuration needed to generate a signature for access to private storage buckets that support AWS's Signature Version 4 for authentication. Allowed only for INTERNET_IP_PORT and INTERNET_FQDN_PORT NEG backends. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AWSV4Signature aws_v4_authentication = 433993111; + */ + protected $aws_v4_authentication = null; + /** + * Optional. A URL referring to a networksecurity.ClientTlsPolicy resource that describes how clients should authenticate with this service's backends. clientTlsPolicy only applies to a global BackendService with the loadBalancingScheme set to INTERNAL_SELF_MANAGED. If left blank, communications are not encrypted. + * + * Generated from protobuf field optional string client_tls_policy = 462325226; + */ + protected $client_tls_policy = null; + /** + * Optional. A list of Subject Alternative Names (SANs) that the client verifies during a mutual TLS handshake with an server/endpoint for this BackendService. When the server presents its X.509 certificate to the client, the client inspects the certificate's subjectAltName field. If the field contains one of the specified values, the communication continues. Otherwise, it fails. This additional check enables the client to verify that the server is authorized to run the requested service. Note that the contents of the server certificate's subjectAltName field are configured by the Public Key Infrastructure which provisions server identities. Only applies to a global BackendService with loadBalancingScheme set to INTERNAL_SELF_MANAGED. Only applies when BackendService has an attached clientTlsPolicy with clientCertificate (mTLS mode). + * + * Generated from protobuf field repeated string subject_alt_names = 330029535; + */ + private $subject_alt_names; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\AWSV4Signature $aws_v4_authentication + * The configuration needed to generate a signature for access to private storage buckets that support AWS's Signature Version 4 for authentication. Allowed only for INTERNET_IP_PORT and INTERNET_FQDN_PORT NEG backends. + * @type string $client_tls_policy + * Optional. A URL referring to a networksecurity.ClientTlsPolicy resource that describes how clients should authenticate with this service's backends. clientTlsPolicy only applies to a global BackendService with the loadBalancingScheme set to INTERNAL_SELF_MANAGED. If left blank, communications are not encrypted. + * @type array|\Google\Protobuf\Internal\RepeatedField $subject_alt_names + * Optional. A list of Subject Alternative Names (SANs) that the client verifies during a mutual TLS handshake with an server/endpoint for this BackendService. When the server presents its X.509 certificate to the client, the client inspects the certificate's subjectAltName field. If the field contains one of the specified values, the communication continues. Otherwise, it fails. This additional check enables the client to verify that the server is authorized to run the requested service. Note that the contents of the server certificate's subjectAltName field are configured by the Public Key Infrastructure which provisions server identities. Only applies to a global BackendService with loadBalancingScheme set to INTERNAL_SELF_MANAGED. Only applies when BackendService has an attached clientTlsPolicy with clientCertificate (mTLS mode). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The configuration needed to generate a signature for access to private storage buckets that support AWS's Signature Version 4 for authentication. Allowed only for INTERNET_IP_PORT and INTERNET_FQDN_PORT NEG backends. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AWSV4Signature aws_v4_authentication = 433993111; + * @return \Google\Cloud\Compute\V1\AWSV4Signature|null + */ + public function getAwsV4Authentication() + { + return $this->aws_v4_authentication; + } + + public function hasAwsV4Authentication() + { + return isset($this->aws_v4_authentication); + } + + public function clearAwsV4Authentication() + { + unset($this->aws_v4_authentication); + } + + /** + * The configuration needed to generate a signature for access to private storage buckets that support AWS's Signature Version 4 for authentication. Allowed only for INTERNET_IP_PORT and INTERNET_FQDN_PORT NEG backends. + * + * Generated from protobuf field optional .google.cloud.compute.v1.AWSV4Signature aws_v4_authentication = 433993111; + * @param \Google\Cloud\Compute\V1\AWSV4Signature $var + * @return $this + */ + public function setAwsV4Authentication($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\AWSV4Signature::class); + $this->aws_v4_authentication = $var; + + return $this; + } + + /** + * Optional. A URL referring to a networksecurity.ClientTlsPolicy resource that describes how clients should authenticate with this service's backends. clientTlsPolicy only applies to a global BackendService with the loadBalancingScheme set to INTERNAL_SELF_MANAGED. If left blank, communications are not encrypted. + * + * Generated from protobuf field optional string client_tls_policy = 462325226; + * @return string + */ + public function getClientTlsPolicy() + { + return isset($this->client_tls_policy) ? $this->client_tls_policy : ''; + } + + public function hasClientTlsPolicy() + { + return isset($this->client_tls_policy); + } + + public function clearClientTlsPolicy() + { + unset($this->client_tls_policy); + } + + /** + * Optional. A URL referring to a networksecurity.ClientTlsPolicy resource that describes how clients should authenticate with this service's backends. clientTlsPolicy only applies to a global BackendService with the loadBalancingScheme set to INTERNAL_SELF_MANAGED. If left blank, communications are not encrypted. + * + * Generated from protobuf field optional string client_tls_policy = 462325226; + * @param string $var + * @return $this + */ + public function setClientTlsPolicy($var) + { + GPBUtil::checkString($var, True); + $this->client_tls_policy = $var; + + return $this; + } + + /** + * Optional. A list of Subject Alternative Names (SANs) that the client verifies during a mutual TLS handshake with an server/endpoint for this BackendService. When the server presents its X.509 certificate to the client, the client inspects the certificate's subjectAltName field. If the field contains one of the specified values, the communication continues. Otherwise, it fails. This additional check enables the client to verify that the server is authorized to run the requested service. Note that the contents of the server certificate's subjectAltName field are configured by the Public Key Infrastructure which provisions server identities. Only applies to a global BackendService with loadBalancingScheme set to INTERNAL_SELF_MANAGED. Only applies when BackendService has an attached clientTlsPolicy with clientCertificate (mTLS mode). + * + * Generated from protobuf field repeated string subject_alt_names = 330029535; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSubjectAltNames() + { + return $this->subject_alt_names; + } + + /** + * Optional. A list of Subject Alternative Names (SANs) that the client verifies during a mutual TLS handshake with an server/endpoint for this BackendService. When the server presents its X.509 certificate to the client, the client inspects the certificate's subjectAltName field. If the field contains one of the specified values, the communication continues. Otherwise, it fails. This additional check enables the client to verify that the server is authorized to run the requested service. Note that the contents of the server certificate's subjectAltName field are configured by the Public Key Infrastructure which provisions server identities. Only applies to a global BackendService with loadBalancingScheme set to INTERNAL_SELF_MANAGED. Only applies when BackendService has an attached clientTlsPolicy with clientCertificate (mTLS mode). + * + * Generated from protobuf field repeated string subject_alt_names = 330029535; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSubjectAltNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->subject_alt_names = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SendDiagnosticInterruptInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SendDiagnosticInterruptInstanceRequest.php new file mode 100644 index 000000000000..73a72b9930ec --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SendDiagnosticInterruptInstanceRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.SendDiagnosticInterruptInstanceRequest + */ +class SendDiagnosticInterruptInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance scoping this request. + * + * @return \Google\Cloud\Compute\V1\SendDiagnosticInterruptInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name of the instance scoping this request. + * @type string $project + * Project ID for 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); + } + + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance scoping 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; + } + + /** + * 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 zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SendDiagnosticInterruptInstanceResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SendDiagnosticInterruptInstanceResponse.php new file mode 100644 index 000000000000..c956054aab90 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SendDiagnosticInterruptInstanceResponse.php @@ -0,0 +1,33 @@ +google.cloud.compute.v1.SendDiagnosticInterruptInstanceResponse + */ +class SendDiagnosticInterruptInstanceResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SerialPortOutput.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SerialPortOutput.php new file mode 100644 index 000000000000..1a97f6aab3d5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SerialPortOutput.php @@ -0,0 +1,253 @@ +google.cloud.compute.v1.SerialPortOutput + */ +class SerialPortOutput extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The contents of the console output. + * + * Generated from protobuf field optional string contents = 506419994; + */ + protected $contents = null; + /** + * [Output Only] Type of the resource. Always compute#serialPortOutput for serial port output. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * [Output Only] The position of the next byte of content, regardless of whether the content exists, following the output returned in the `contents` property. Use this value in the next request as the start parameter. + * + * Generated from protobuf field optional int64 next = 3377907; + */ + protected $next = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * The starting byte position of the output that was returned. This should match the start parameter sent with the request. If the serial console output exceeds the size of the buffer (1 MB), older output is overwritten by newer content. The output start value will indicate the byte position of the output that was returned, which might be different than the `start` value that was specified in the request. + * + * Generated from protobuf field optional int64 start = 109757538; + */ + protected $start = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $contents + * [Output Only] The contents of the console output. + * @type string $kind + * [Output Only] Type of the resource. Always compute#serialPortOutput for serial port output. + * @type int|string $next + * [Output Only] The position of the next byte of content, regardless of whether the content exists, following the output returned in the `contents` property. Use this value in the next request as the start parameter. + * @type string $self_link + * [Output Only] Server-defined URL for this resource. + * @type int|string $start + * The starting byte position of the output that was returned. This should match the start parameter sent with the request. If the serial console output exceeds the size of the buffer (1 MB), older output is overwritten by newer content. The output start value will indicate the byte position of the output that was returned, which might be different than the `start` value that was specified in the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The contents of the console output. + * + * Generated from protobuf field optional string contents = 506419994; + * @return string + */ + public function getContents() + { + return isset($this->contents) ? $this->contents : ''; + } + + public function hasContents() + { + return isset($this->contents); + } + + public function clearContents() + { + unset($this->contents); + } + + /** + * [Output Only] The contents of the console output. + * + * Generated from protobuf field optional string contents = 506419994; + * @param string $var + * @return $this + */ + public function setContents($var) + { + GPBUtil::checkString($var, True); + $this->contents = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#serialPortOutput for serial port output. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#serialPortOutput for serial port output. + * + * 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] The position of the next byte of content, regardless of whether the content exists, following the output returned in the `contents` property. Use this value in the next request as the start parameter. + * + * Generated from protobuf field optional int64 next = 3377907; + * @return int|string + */ + public function getNext() + { + return isset($this->next) ? $this->next : 0; + } + + public function hasNext() + { + return isset($this->next); + } + + public function clearNext() + { + unset($this->next); + } + + /** + * [Output Only] The position of the next byte of content, regardless of whether the content exists, following the output returned in the `contents` property. Use this value in the next request as the start parameter. + * + * Generated from protobuf field optional int64 next = 3377907; + * @param int|string $var + * @return $this + */ + public function setNext($var) + { + GPBUtil::checkInt64($var); + $this->next = $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; + } + + /** + * The starting byte position of the output that was returned. This should match the start parameter sent with the request. If the serial console output exceeds the size of the buffer (1 MB), older output is overwritten by newer content. The output start value will indicate the byte position of the output that was returned, which might be different than the `start` value that was specified in the request. + * + * Generated from protobuf field optional int64 start = 109757538; + * @return int|string + */ + public function getStart() + { + return isset($this->start) ? $this->start : 0; + } + + public function hasStart() + { + return isset($this->start); + } + + public function clearStart() + { + unset($this->start); + } + + /** + * The starting byte position of the output that was returned. This should match the start parameter sent with the request. If the serial console output exceeds the size of the buffer (1 MB), older output is overwritten by newer content. The output start value will indicate the byte position of the output that was returned, which might be different than the `start` value that was specified in the request. + * + * Generated from protobuf field optional int64 start = 109757538; + * @param int|string $var + * @return $this + */ + public function setStart($var) + { + GPBUtil::checkInt64($var); + $this->start = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServerBinding.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServerBinding.php new file mode 100644 index 000000000000..0f2143865e87 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServerBinding.php @@ -0,0 +1,80 @@ +google.cloud.compute.v1.ServerBinding + */ +class ServerBinding extends \Google\Protobuf\Internal\Message +{ + /** + * + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $type + * + * Check the Type enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServerBinding/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServerBinding/Type.php new file mode 100644 index 000000000000..3ff7a51b5bde --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServerBinding/Type.php @@ -0,0 +1,68 @@ +google.cloud.compute.v1.ServerBinding.Type + */ +class Type +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TYPE = 0; + */ + const UNDEFINED_TYPE = 0; + /** + * Node may associate with any physical server over its lifetime. + * + * Generated from protobuf enum RESTART_NODE_ON_ANY_SERVER = 502950985; + */ + const RESTART_NODE_ON_ANY_SERVER = 502950985; + /** + * Node may associate with minimal physical servers over its lifetime. + * + * Generated from protobuf enum RESTART_NODE_ON_MINIMAL_SERVERS = 204166495; + */ + const RESTART_NODE_ON_MINIMAL_SERVERS = 204166495; + /** + * Generated from protobuf enum SERVER_BINDING_TYPE_UNSPECIFIED = 180825512; + */ + const SERVER_BINDING_TYPE_UNSPECIFIED = 180825512; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::RESTART_NODE_ON_ANY_SERVER => 'RESTART_NODE_ON_ANY_SERVER', + self::RESTART_NODE_ON_MINIMAL_SERVERS => 'RESTART_NODE_ON_MINIMAL_SERVERS', + self::SERVER_BINDING_TYPE_UNSPECIFIED => 'SERVER_BINDING_TYPE_UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Compute\V1\ServerBinding_Type::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAccount.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAccount.php new file mode 100644 index 000000000000..545940b13b72 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAccount.php @@ -0,0 +1,111 @@ +google.cloud.compute.v1.ServiceAccount + */ +class ServiceAccount extends \Google\Protobuf\Internal\Message +{ + /** + * Email address of the service account. + * + * Generated from protobuf field optional string email = 96619420; + */ + protected $email = null; + /** + * The list of scopes to be made available for this service account. + * + * Generated from protobuf field repeated string scopes = 165973151; + */ + private $scopes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $email + * Email address of the service account. + * @type array|\Google\Protobuf\Internal\RepeatedField $scopes + * The list of scopes to be made available for this service account. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Email address of the service account. + * + * Generated from protobuf field optional string email = 96619420; + * @return string + */ + public function getEmail() + { + return isset($this->email) ? $this->email : ''; + } + + public function hasEmail() + { + return isset($this->email); + } + + public function clearEmail() + { + unset($this->email); + } + + /** + * Email address of the service account. + * + * Generated from protobuf field optional string email = 96619420; + * @param string $var + * @return $this + */ + public function setEmail($var) + { + GPBUtil::checkString($var, True); + $this->email = $var; + + return $this; + } + + /** + * The list of scopes to be made available for this service account. + * + * Generated from protobuf field repeated string scopes = 165973151; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getScopes() + { + return $this->scopes; + } + + /** + * The list of scopes to be made available for this service account. + * + * Generated from protobuf field repeated string scopes = 165973151; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScopes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->scopes = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachment.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachment.php new file mode 100644 index 000000000000..a238ca0e4b11 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachment.php @@ -0,0 +1,823 @@ +google.cloud.compute.v1.ServiceAttachment + */ +class ServiceAttachment extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] An array of connections for all the consumers connected to this service attachment. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAttachmentConnectedEndpoint connected_endpoints = 72223688; + */ + private $connected_endpoints; + /** + * The connection preference of service attachment. The value can be set to ACCEPT_AUTOMATIC. An ACCEPT_AUTOMATIC service attachment is one that always accepts the connection from consumer forwarding rules. + * Check the ConnectionPreference enum for the list of possible values. + * + * Generated from protobuf field optional string connection_preference = 285818076; + */ + protected $connection_preference = null; + /** + * Specifies which consumer projects or networks are allowed to connect to the service attachment. Each project or network has a connection limit. A given service attachment can manage connections at either the project or network level. Therefore, both the accept and reject lists for a given service attachment must contain either only projects or only networks. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAttachmentConsumerProjectLimit consumer_accept_lists = 402725703; + */ + private $consumer_accept_lists; + /** + * Specifies a list of projects or networks that are not allowed to connect to this service attachment. The project can be specified using its project ID or project number and the network can be specified using its URL. A given service attachment can manage connections at either the project or network level. Therefore, both the reject and accept lists for a given service attachment must contain either only projects or only networks. + * + * Generated from protobuf field repeated string consumer_reject_lists = 204033182; + */ + private $consumer_reject_lists; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * If specified, the domain name will be used during the integration between the PSC connected endpoints and the Cloud DNS. For example, this is a valid domain name: "p.mycompany.com.". Current max number of domain names supported is 1. + * + * Generated from protobuf field repeated string domain_names = 6450189; + */ + private $domain_names; + /** + * If true, enable the proxy protocol which is for supplying client TCP/IP address data in TCP connections that traverse proxies on their way to destination servers. + * + * Generated from protobuf field optional bool enable_proxy_protocol = 363791237; + */ + protected $enable_proxy_protocol = null; + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a ServiceAttachment. An up-to-date fingerprint must be provided in order to patch/update the ServiceAttachment; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the ServiceAttachment. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * [Output Only] The unique identifier for the resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#serviceAttachment for service attachments. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * An array of URLs where each entry is the URL of a subnet provided by the service producer to use for NAT in this service attachment. + * + * Generated from protobuf field repeated string nat_subnets = 374785944; + */ + private $nat_subnets; + /** + * The URL of a forwarding rule with loadBalancingScheme INTERNAL* that is serving the endpoint identified by this service attachment. + * + * Generated from protobuf field optional string producer_forwarding_rule = 247927889; + */ + protected $producer_forwarding_rule = null; + /** + * [Output Only] An 128-bit global unique ID of the PSC service attachment. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Uint128 psc_service_attachment_id = 527695214; + */ + protected $psc_service_attachment_id = null; + /** + * This flag determines whether a consumer accept/reject list change can reconcile the statuses of existing ACCEPTED or REJECTED PSC endpoints. - If false, connection policy update will only affect existing PENDING PSC endpoints. Existing ACCEPTED/REJECTED endpoints will remain untouched regardless how the connection policy is modified . - If true, update will affect both PENDING and ACCEPTED/REJECTED PSC endpoints. For example, an ACCEPTED PSC endpoint will be moved to REJECTED if its project is added to the reject list. For newly created service attachment, this boolean defaults to false. + * + * Generated from protobuf field optional bool reconcile_connections = 125493732; + */ + protected $reconcile_connections = null; + /** + * [Output Only] URL of the region where the service attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * The URL of a service serving the endpoint identified by this service attachment. + * + * Generated from protobuf field optional string target_service = 1293831; + */ + protected $target_service = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\ServiceAttachmentConnectedEndpoint>|\Google\Protobuf\Internal\RepeatedField $connected_endpoints + * [Output Only] An array of connections for all the consumers connected to this service attachment. + * @type string $connection_preference + * The connection preference of service attachment. The value can be set to ACCEPT_AUTOMATIC. An ACCEPT_AUTOMATIC service attachment is one that always accepts the connection from consumer forwarding rules. + * Check the ConnectionPreference enum for the list of possible values. + * @type array<\Google\Cloud\Compute\V1\ServiceAttachmentConsumerProjectLimit>|\Google\Protobuf\Internal\RepeatedField $consumer_accept_lists + * Specifies which consumer projects or networks are allowed to connect to the service attachment. Each project or network has a connection limit. A given service attachment can manage connections at either the project or network level. Therefore, both the accept and reject lists for a given service attachment must contain either only projects or only networks. + * @type array|\Google\Protobuf\Internal\RepeatedField $consumer_reject_lists + * Specifies a list of projects or networks that are not allowed to connect to this service attachment. The project can be specified using its project ID or project number and the network can be specified using its URL. A given service attachment can manage connections at either the project or network level. Therefore, both the reject and accept lists for a given service attachment must contain either only projects or only networks. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type array|\Google\Protobuf\Internal\RepeatedField $domain_names + * If specified, the domain name will be used during the integration between the PSC connected endpoints and the Cloud DNS. For example, this is a valid domain name: "p.mycompany.com.". Current max number of domain names supported is 1. + * @type bool $enable_proxy_protocol + * If true, enable the proxy protocol which is for supplying client TCP/IP address data in TCP connections that traverse proxies on their way to destination servers. + * @type string $fingerprint + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a ServiceAttachment. An up-to-date fingerprint must be provided in order to patch/update the ServiceAttachment; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the ServiceAttachment. + * @type int|string $id + * [Output Only] The unique identifier for the resource type. The server generates this identifier. + * @type string $kind + * [Output Only] Type of the resource. Always compute#serviceAttachment for service attachments. + * @type string $name + * 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 array|\Google\Protobuf\Internal\RepeatedField $nat_subnets + * An array of URLs where each entry is the URL of a subnet provided by the service producer to use for NAT in this service attachment. + * @type string $producer_forwarding_rule + * The URL of a forwarding rule with loadBalancingScheme INTERNAL* that is serving the endpoint identified by this service attachment. + * @type \Google\Cloud\Compute\V1\Uint128 $psc_service_attachment_id + * [Output Only] An 128-bit global unique ID of the PSC service attachment. + * @type bool $reconcile_connections + * This flag determines whether a consumer accept/reject list change can reconcile the statuses of existing ACCEPTED or REJECTED PSC endpoints. - If false, connection policy update will only affect existing PENDING PSC endpoints. Existing ACCEPTED/REJECTED endpoints will remain untouched regardless how the connection policy is modified . - If true, update will affect both PENDING and ACCEPTED/REJECTED PSC endpoints. For example, an ACCEPTED PSC endpoint will be moved to REJECTED if its project is added to the reject list. For newly created service attachment, this boolean defaults to false. + * @type string $region + * [Output Only] URL of the region where the service attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $target_service + * The URL of a service serving the endpoint identified by this service attachment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] An array of connections for all the consumers connected to this service attachment. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAttachmentConnectedEndpoint connected_endpoints = 72223688; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConnectedEndpoints() + { + return $this->connected_endpoints; + } + + /** + * [Output Only] An array of connections for all the consumers connected to this service attachment. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAttachmentConnectedEndpoint connected_endpoints = 72223688; + * @param array<\Google\Cloud\Compute\V1\ServiceAttachmentConnectedEndpoint>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConnectedEndpoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ServiceAttachmentConnectedEndpoint::class); + $this->connected_endpoints = $arr; + + return $this; + } + + /** + * The connection preference of service attachment. The value can be set to ACCEPT_AUTOMATIC. An ACCEPT_AUTOMATIC service attachment is one that always accepts the connection from consumer forwarding rules. + * Check the ConnectionPreference enum for the list of possible values. + * + * Generated from protobuf field optional string connection_preference = 285818076; + * @return string + */ + public function getConnectionPreference() + { + return isset($this->connection_preference) ? $this->connection_preference : ''; + } + + public function hasConnectionPreference() + { + return isset($this->connection_preference); + } + + public function clearConnectionPreference() + { + unset($this->connection_preference); + } + + /** + * The connection preference of service attachment. The value can be set to ACCEPT_AUTOMATIC. An ACCEPT_AUTOMATIC service attachment is one that always accepts the connection from consumer forwarding rules. + * Check the ConnectionPreference enum for the list of possible values. + * + * Generated from protobuf field optional string connection_preference = 285818076; + * @param string $var + * @return $this + */ + public function setConnectionPreference($var) + { + GPBUtil::checkString($var, True); + $this->connection_preference = $var; + + return $this; + } + + /** + * Specifies which consumer projects or networks are allowed to connect to the service attachment. Each project or network has a connection limit. A given service attachment can manage connections at either the project or network level. Therefore, both the accept and reject lists for a given service attachment must contain either only projects or only networks. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAttachmentConsumerProjectLimit consumer_accept_lists = 402725703; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConsumerAcceptLists() + { + return $this->consumer_accept_lists; + } + + /** + * Specifies which consumer projects or networks are allowed to connect to the service attachment. Each project or network has a connection limit. A given service attachment can manage connections at either the project or network level. Therefore, both the accept and reject lists for a given service attachment must contain either only projects or only networks. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAttachmentConsumerProjectLimit consumer_accept_lists = 402725703; + * @param array<\Google\Cloud\Compute\V1\ServiceAttachmentConsumerProjectLimit>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConsumerAcceptLists($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ServiceAttachmentConsumerProjectLimit::class); + $this->consumer_accept_lists = $arr; + + return $this; + } + + /** + * Specifies a list of projects or networks that are not allowed to connect to this service attachment. The project can be specified using its project ID or project number and the network can be specified using its URL. A given service attachment can manage connections at either the project or network level. Therefore, both the reject and accept lists for a given service attachment must contain either only projects or only networks. + * + * Generated from protobuf field repeated string consumer_reject_lists = 204033182; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConsumerRejectLists() + { + return $this->consumer_reject_lists; + } + + /** + * Specifies a list of projects or networks that are not allowed to connect to this service attachment. The project can be specified using its project ID or project number and the network can be specified using its URL. A given service attachment can manage connections at either the project or network level. Therefore, both the reject and accept lists for a given service attachment must contain either only projects or only networks. + * + * Generated from protobuf field repeated string consumer_reject_lists = 204033182; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConsumerRejectLists($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->consumer_reject_lists = $arr; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * If specified, the domain name will be used during the integration between the PSC connected endpoints and the Cloud DNS. For example, this is a valid domain name: "p.mycompany.com.". Current max number of domain names supported is 1. + * + * Generated from protobuf field repeated string domain_names = 6450189; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDomainNames() + { + return $this->domain_names; + } + + /** + * If specified, the domain name will be used during the integration between the PSC connected endpoints and the Cloud DNS. For example, this is a valid domain name: "p.mycompany.com.". Current max number of domain names supported is 1. + * + * Generated from protobuf field repeated string domain_names = 6450189; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDomainNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->domain_names = $arr; + + return $this; + } + + /** + * If true, enable the proxy protocol which is for supplying client TCP/IP address data in TCP connections that traverse proxies on their way to destination servers. + * + * Generated from protobuf field optional bool enable_proxy_protocol = 363791237; + * @return bool + */ + public function getEnableProxyProtocol() + { + return isset($this->enable_proxy_protocol) ? $this->enable_proxy_protocol : false; + } + + public function hasEnableProxyProtocol() + { + return isset($this->enable_proxy_protocol); + } + + public function clearEnableProxyProtocol() + { + unset($this->enable_proxy_protocol); + } + + /** + * If true, enable the proxy protocol which is for supplying client TCP/IP address data in TCP connections that traverse proxies on their way to destination servers. + * + * Generated from protobuf field optional bool enable_proxy_protocol = 363791237; + * @param bool $var + * @return $this + */ + public function setEnableProxyProtocol($var) + { + GPBUtil::checkBool($var); + $this->enable_proxy_protocol = $var; + + return $this; + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a ServiceAttachment. An up-to-date fingerprint must be provided in order to patch/update the ServiceAttachment; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the ServiceAttachment. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a ServiceAttachment. An up-to-date fingerprint must be provided in order to patch/update the ServiceAttachment; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the ServiceAttachment. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#serviceAttachment for service attachments. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#serviceAttachment for service attachments. + * + * 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; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * An array of URLs where each entry is the URL of a subnet provided by the service producer to use for NAT in this service attachment. + * + * Generated from protobuf field repeated string nat_subnets = 374785944; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNatSubnets() + { + return $this->nat_subnets; + } + + /** + * An array of URLs where each entry is the URL of a subnet provided by the service producer to use for NAT in this service attachment. + * + * Generated from protobuf field repeated string nat_subnets = 374785944; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNatSubnets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->nat_subnets = $arr; + + return $this; + } + + /** + * The URL of a forwarding rule with loadBalancingScheme INTERNAL* that is serving the endpoint identified by this service attachment. + * + * Generated from protobuf field optional string producer_forwarding_rule = 247927889; + * @return string + */ + public function getProducerForwardingRule() + { + return isset($this->producer_forwarding_rule) ? $this->producer_forwarding_rule : ''; + } + + public function hasProducerForwardingRule() + { + return isset($this->producer_forwarding_rule); + } + + public function clearProducerForwardingRule() + { + unset($this->producer_forwarding_rule); + } + + /** + * The URL of a forwarding rule with loadBalancingScheme INTERNAL* that is serving the endpoint identified by this service attachment. + * + * Generated from protobuf field optional string producer_forwarding_rule = 247927889; + * @param string $var + * @return $this + */ + public function setProducerForwardingRule($var) + { + GPBUtil::checkString($var, True); + $this->producer_forwarding_rule = $var; + + return $this; + } + + /** + * [Output Only] An 128-bit global unique ID of the PSC service attachment. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Uint128 psc_service_attachment_id = 527695214; + * @return \Google\Cloud\Compute\V1\Uint128|null + */ + public function getPscServiceAttachmentId() + { + return $this->psc_service_attachment_id; + } + + public function hasPscServiceAttachmentId() + { + return isset($this->psc_service_attachment_id); + } + + public function clearPscServiceAttachmentId() + { + unset($this->psc_service_attachment_id); + } + + /** + * [Output Only] An 128-bit global unique ID of the PSC service attachment. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Uint128 psc_service_attachment_id = 527695214; + * @param \Google\Cloud\Compute\V1\Uint128 $var + * @return $this + */ + public function setPscServiceAttachmentId($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Uint128::class); + $this->psc_service_attachment_id = $var; + + return $this; + } + + /** + * This flag determines whether a consumer accept/reject list change can reconcile the statuses of existing ACCEPTED or REJECTED PSC endpoints. - If false, connection policy update will only affect existing PENDING PSC endpoints. Existing ACCEPTED/REJECTED endpoints will remain untouched regardless how the connection policy is modified . - If true, update will affect both PENDING and ACCEPTED/REJECTED PSC endpoints. For example, an ACCEPTED PSC endpoint will be moved to REJECTED if its project is added to the reject list. For newly created service attachment, this boolean defaults to false. + * + * Generated from protobuf field optional bool reconcile_connections = 125493732; + * @return bool + */ + public function getReconcileConnections() + { + return isset($this->reconcile_connections) ? $this->reconcile_connections : false; + } + + public function hasReconcileConnections() + { + return isset($this->reconcile_connections); + } + + public function clearReconcileConnections() + { + unset($this->reconcile_connections); + } + + /** + * This flag determines whether a consumer accept/reject list change can reconcile the statuses of existing ACCEPTED or REJECTED PSC endpoints. - If false, connection policy update will only affect existing PENDING PSC endpoints. Existing ACCEPTED/REJECTED endpoints will remain untouched regardless how the connection policy is modified . - If true, update will affect both PENDING and ACCEPTED/REJECTED PSC endpoints. For example, an ACCEPTED PSC endpoint will be moved to REJECTED if its project is added to the reject list. For newly created service attachment, this boolean defaults to false. + * + * Generated from protobuf field optional bool reconcile_connections = 125493732; + * @param bool $var + * @return $this + */ + public function setReconcileConnections($var) + { + GPBUtil::checkBool($var); + $this->reconcile_connections = $var; + + return $this; + } + + /** + * [Output Only] URL of the region where the service attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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 service attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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] Server-defined URL for the 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 the 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; + } + + /** + * The URL of a service serving the endpoint identified by this service attachment. + * + * Generated from protobuf field optional string target_service = 1293831; + * @return string + */ + public function getTargetService() + { + return isset($this->target_service) ? $this->target_service : ''; + } + + public function hasTargetService() + { + return isset($this->target_service); + } + + public function clearTargetService() + { + unset($this->target_service); + } + + /** + * The URL of a service serving the endpoint identified by this service attachment. + * + * Generated from protobuf field optional string target_service = 1293831; + * @param string $var + * @return $this + */ + public function setTargetService($var) + { + GPBUtil::checkString($var, True); + $this->target_service = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachment/ConnectionPreference.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachment/ConnectionPreference.php new file mode 100644 index 000000000000..ee5c88de4fd9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachment/ConnectionPreference.php @@ -0,0 +1,65 @@ +google.cloud.compute.v1.ServiceAttachment.ConnectionPreference + */ +class ConnectionPreference +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_CONNECTION_PREFERENCE = 0; + */ + const UNDEFINED_CONNECTION_PREFERENCE = 0; + /** + * Generated from protobuf enum ACCEPT_AUTOMATIC = 75250580; + */ + const ACCEPT_AUTOMATIC = 75250580; + /** + * Generated from protobuf enum ACCEPT_MANUAL = 373061341; + */ + const ACCEPT_MANUAL = 373061341; + /** + * Generated from protobuf enum CONNECTION_PREFERENCE_UNSPECIFIED = 34590772; + */ + const CONNECTION_PREFERENCE_UNSPECIFIED = 34590772; + + private static $valueToName = [ + self::UNDEFINED_CONNECTION_PREFERENCE => 'UNDEFINED_CONNECTION_PREFERENCE', + self::ACCEPT_AUTOMATIC => 'ACCEPT_AUTOMATIC', + self::ACCEPT_MANUAL => 'ACCEPT_MANUAL', + self::CONNECTION_PREFERENCE_UNSPECIFIED => 'CONNECTION_PREFERENCE_UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConnectionPreference::class, \Google\Cloud\Compute\V1\ServiceAttachment_ConnectionPreference::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentAggregatedList.php new file mode 100644 index 000000000000..1addb09f06c9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentAggregatedList.php @@ -0,0 +1,321 @@ +google.cloud.compute.v1.ServiceAttachmentAggregatedList + */ +class ServiceAttachmentAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of ServiceAttachmentsScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 ServiceAttachmentsScopedList 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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 ServiceAttachmentsScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of ServiceAttachmentsScopedList 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\ServiceAttachmentsScopedList::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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentConnectedEndpoint.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentConnectedEndpoint.php new file mode 100644 index 000000000000..fda81617b34d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentConnectedEndpoint.php @@ -0,0 +1,213 @@ +google.cloud.compute.v1.ServiceAttachmentConnectedEndpoint + */ +class ServiceAttachmentConnectedEndpoint extends \Google\Protobuf\Internal\Message +{ + /** + * The url of the consumer network. + * + * Generated from protobuf field optional string consumer_network = 254357221; + */ + protected $consumer_network = null; + /** + * The url of a connected endpoint. + * + * Generated from protobuf field optional string endpoint = 130489749; + */ + protected $endpoint = null; + /** + * The PSC connection id of the connected endpoint. + * + * Generated from protobuf field optional uint64 psc_connection_id = 292082397; + */ + protected $psc_connection_id = null; + /** + * The status of a connected endpoint to this service attachment. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $consumer_network + * The url of the consumer network. + * @type string $endpoint + * The url of a connected endpoint. + * @type int|string $psc_connection_id + * The PSC connection id of the connected endpoint. + * @type string $status + * The status of a connected endpoint to this service attachment. + * Check the Status enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The url of the consumer network. + * + * Generated from protobuf field optional string consumer_network = 254357221; + * @return string + */ + public function getConsumerNetwork() + { + return isset($this->consumer_network) ? $this->consumer_network : ''; + } + + public function hasConsumerNetwork() + { + return isset($this->consumer_network); + } + + public function clearConsumerNetwork() + { + unset($this->consumer_network); + } + + /** + * The url of the consumer network. + * + * Generated from protobuf field optional string consumer_network = 254357221; + * @param string $var + * @return $this + */ + public function setConsumerNetwork($var) + { + GPBUtil::checkString($var, True); + $this->consumer_network = $var; + + return $this; + } + + /** + * The url of a connected endpoint. + * + * Generated from protobuf field optional string endpoint = 130489749; + * @return string + */ + public function getEndpoint() + { + return isset($this->endpoint) ? $this->endpoint : ''; + } + + public function hasEndpoint() + { + return isset($this->endpoint); + } + + public function clearEndpoint() + { + unset($this->endpoint); + } + + /** + * The url of a connected endpoint. + * + * Generated from protobuf field optional string endpoint = 130489749; + * @param string $var + * @return $this + */ + public function setEndpoint($var) + { + GPBUtil::checkString($var, True); + $this->endpoint = $var; + + return $this; + } + + /** + * The PSC connection id of the connected endpoint. + * + * Generated from protobuf field optional uint64 psc_connection_id = 292082397; + * @return int|string + */ + public function getPscConnectionId() + { + return isset($this->psc_connection_id) ? $this->psc_connection_id : 0; + } + + public function hasPscConnectionId() + { + return isset($this->psc_connection_id); + } + + public function clearPscConnectionId() + { + unset($this->psc_connection_id); + } + + /** + * The PSC connection id of the connected endpoint. + * + * Generated from protobuf field optional uint64 psc_connection_id = 292082397; + * @param int|string $var + * @return $this + */ + public function setPscConnectionId($var) + { + GPBUtil::checkUint64($var); + $this->psc_connection_id = $var; + + return $this; + } + + /** + * The status of a connected endpoint to this service attachment. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * The status of a connected endpoint to this service attachment. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentConnectedEndpoint/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentConnectedEndpoint/Status.php new file mode 100644 index 000000000000..ee73d361b8a8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentConnectedEndpoint/Status.php @@ -0,0 +1,90 @@ +google.cloud.compute.v1.ServiceAttachmentConnectedEndpoint.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * The connection has been accepted by the producer. + * + * Generated from protobuf enum ACCEPTED = 246714279; + */ + const ACCEPTED = 246714279; + /** + * The connection has been closed by the producer. + * + * Generated from protobuf enum CLOSED = 380163436; + */ + const CLOSED = 380163436; + /** + * The connection has been accepted by the producer, but the producer needs to take further action before the forwarding rule can serve traffic. + * + * Generated from protobuf enum NEEDS_ATTENTION = 344491452; + */ + const NEEDS_ATTENTION = 344491452; + /** + * The connection is pending acceptance by the producer. + * + * Generated from protobuf enum PENDING = 35394935; + */ + const PENDING = 35394935; + /** + * The consumer is still connected but not using the connection. + * + * Generated from protobuf enum REJECTED = 174130302; + */ + const REJECTED = 174130302; + /** + * Generated from protobuf enum STATUS_UNSPECIFIED = 42133066; + */ + const STATUS_UNSPECIFIED = 42133066; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::ACCEPTED => 'ACCEPTED', + self::CLOSED => 'CLOSED', + self::NEEDS_ATTENTION => 'NEEDS_ATTENTION', + self::PENDING => 'PENDING', + self::REJECTED => 'REJECTED', + self::STATUS_UNSPECIFIED => 'STATUS_UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\ServiceAttachmentConnectedEndpoint_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentConsumerProjectLimit.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentConsumerProjectLimit.php new file mode 100644 index 000000000000..2d754a47fb48 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentConsumerProjectLimit.php @@ -0,0 +1,164 @@ +google.cloud.compute.v1.ServiceAttachmentConsumerProjectLimit + */ +class ServiceAttachmentConsumerProjectLimit extends \Google\Protobuf\Internal\Message +{ + /** + * The value of the limit to set. + * + * Generated from protobuf field optional uint32 connection_limit = 131403546; + */ + protected $connection_limit = null; + /** + * The network URL for the network to set the limit for. + * + * Generated from protobuf field optional string network_url = 207194078; + */ + protected $network_url = null; + /** + * The project id or number for the project to set the limit for. + * + * Generated from protobuf field optional string project_id_or_num = 349783336; + */ + protected $project_id_or_num = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $connection_limit + * The value of the limit to set. + * @type string $network_url + * The network URL for the network to set the limit for. + * @type string $project_id_or_num + * The project id or number for the project to set the limit for. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The value of the limit to set. + * + * Generated from protobuf field optional uint32 connection_limit = 131403546; + * @return int + */ + public function getConnectionLimit() + { + return isset($this->connection_limit) ? $this->connection_limit : 0; + } + + public function hasConnectionLimit() + { + return isset($this->connection_limit); + } + + public function clearConnectionLimit() + { + unset($this->connection_limit); + } + + /** + * The value of the limit to set. + * + * Generated from protobuf field optional uint32 connection_limit = 131403546; + * @param int $var + * @return $this + */ + public function setConnectionLimit($var) + { + GPBUtil::checkUint32($var); + $this->connection_limit = $var; + + return $this; + } + + /** + * The network URL for the network to set the limit for. + * + * Generated from protobuf field optional string network_url = 207194078; + * @return string + */ + public function getNetworkUrl() + { + return isset($this->network_url) ? $this->network_url : ''; + } + + public function hasNetworkUrl() + { + return isset($this->network_url); + } + + public function clearNetworkUrl() + { + unset($this->network_url); + } + + /** + * The network URL for the network to set the limit for. + * + * Generated from protobuf field optional string network_url = 207194078; + * @param string $var + * @return $this + */ + public function setNetworkUrl($var) + { + GPBUtil::checkString($var, True); + $this->network_url = $var; + + return $this; + } + + /** + * The project id or number for the project to set the limit for. + * + * Generated from protobuf field optional string project_id_or_num = 349783336; + * @return string + */ + public function getProjectIdOrNum() + { + return isset($this->project_id_or_num) ? $this->project_id_or_num : ''; + } + + public function hasProjectIdOrNum() + { + return isset($this->project_id_or_num); + } + + public function clearProjectIdOrNum() + { + unset($this->project_id_or_num); + } + + /** + * The project id or number for the project to set the limit for. + * + * Generated from protobuf field optional string project_id_or_num = 349783336; + * @param string $var + * @return $this + */ + public function setProjectIdOrNum($var) + { + GPBUtil::checkString($var, True); + $this->project_id_or_num = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentList.php new file mode 100644 index 000000000000..fb661df50087 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentList.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.ServiceAttachmentList + */ +class ServiceAttachmentList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of ServiceAttachment resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAttachment items = 100526016; + */ + private $items; + /** + * [Output Only] Type of the resource. Always compute#serviceAttachment for service attachments. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\ServiceAttachment>|\Google\Protobuf\Internal\RepeatedField $items + * A list of ServiceAttachment resources. + * @type string $kind + * [Output Only] Type of the resource. Always compute#serviceAttachment for service attachments. + * @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 ServiceAttachment resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAttachment items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of ServiceAttachment resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAttachment items = 100526016; + * @param array<\Google\Cloud\Compute\V1\ServiceAttachment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ServiceAttachment::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#serviceAttachment for service attachments. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#serviceAttachment for service attachments. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentsScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentsScopedList.php new file mode 100644 index 000000000000..21ea5825e3c2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentsScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.ServiceAttachmentsScopedList + */ +class ServiceAttachmentsScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * A list of ServiceAttachments contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAttachment service_attachments = 307136806; + */ + private $service_attachments; + /** + * Informational warning which replaces the list of service attachments when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\ServiceAttachment>|\Google\Protobuf\Internal\RepeatedField $service_attachments + * A list of ServiceAttachments contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * Informational warning which replaces the list of service attachments when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of ServiceAttachments contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAttachment service_attachments = 307136806; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServiceAttachments() + { + return $this->service_attachments; + } + + /** + * A list of ServiceAttachments contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAttachment service_attachments = 307136806; + * @param array<\Google\Cloud\Compute\V1\ServiceAttachment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServiceAttachments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ServiceAttachment::class); + $this->service_attachments = $arr; + + return $this; + } + + /** + * Informational warning which replaces the list of service attachments 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); + } + + /** + * Informational warning which replaces the list of service attachments 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetBackendServiceTargetSslProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetBackendServiceTargetSslProxyRequest.php new file mode 100644 index 000000000000..2824a60f967b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetBackendServiceTargetSslProxyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest + */ +class SetBackendServiceTargetSslProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest target_ssl_proxies_set_backend_service_request_resource = 139080868 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_ssl_proxies_set_backend_service_request_resource = null; + /** + * Name of the TargetSslProxy resource whose BackendService resource is to be set. + * + * Generated from protobuf field string target_ssl_proxy = 338795853 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_ssl_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $targetSslProxy Name of the TargetSslProxy resource whose BackendService resource is to be set. + * @param \Google\Cloud\Compute\V1\TargetSslProxiesSetBackendServiceRequest $targetSslProxiesSetBackendServiceRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetBackendServiceTargetSslProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetSslProxy, \Google\Cloud\Compute\V1\TargetSslProxiesSetBackendServiceRequest $targetSslProxiesSetBackendServiceRequestResource): self + { + return (new self()) + ->setProject($project) + ->setTargetSslProxy($targetSslProxy) + ->setTargetSslProxiesSetBackendServiceRequestResource($targetSslProxiesSetBackendServiceRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\TargetSslProxiesSetBackendServiceRequest $target_ssl_proxies_set_backend_service_request_resource + * The body resource for this request + * @type string $target_ssl_proxy + * Name of the TargetSslProxy resource whose BackendService resource is to be set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest target_ssl_proxies_set_backend_service_request_resource = 139080868 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetSslProxiesSetBackendServiceRequest|null + */ + public function getTargetSslProxiesSetBackendServiceRequestResource() + { + return $this->target_ssl_proxies_set_backend_service_request_resource; + } + + public function hasTargetSslProxiesSetBackendServiceRequestResource() + { + return isset($this->target_ssl_proxies_set_backend_service_request_resource); + } + + public function clearTargetSslProxiesSetBackendServiceRequestResource() + { + unset($this->target_ssl_proxies_set_backend_service_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest target_ssl_proxies_set_backend_service_request_resource = 139080868 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetSslProxiesSetBackendServiceRequest $var + * @return $this + */ + public function setTargetSslProxiesSetBackendServiceRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetSslProxiesSetBackendServiceRequest::class); + $this->target_ssl_proxies_set_backend_service_request_resource = $var; + + return $this; + } + + /** + * Name of the TargetSslProxy resource whose BackendService resource is to be set. + * + * Generated from protobuf field string target_ssl_proxy = 338795853 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetSslProxy() + { + return $this->target_ssl_proxy; + } + + /** + * Name of the TargetSslProxy resource whose BackendService resource is to be set. + * + * Generated from protobuf field string target_ssl_proxy = 338795853 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetSslProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_ssl_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetBackendServiceTargetTcpProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetBackendServiceTargetTcpProxyRequest.php new file mode 100644 index 000000000000..6f78dca1cfbb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetBackendServiceTargetTcpProxyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest + */ +class SetBackendServiceTargetTcpProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest target_tcp_proxies_set_backend_service_request_resource = 273721583 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_tcp_proxies_set_backend_service_request_resource = null; + /** + * Name of the TargetTcpProxy resource whose BackendService resource is to be set. + * + * Generated from protobuf field string target_tcp_proxy = 503065442 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_tcp_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $targetTcpProxy Name of the TargetTcpProxy resource whose BackendService resource is to be set. + * @param \Google\Cloud\Compute\V1\TargetTcpProxiesSetBackendServiceRequest $targetTcpProxiesSetBackendServiceRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetBackendServiceTargetTcpProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetTcpProxy, \Google\Cloud\Compute\V1\TargetTcpProxiesSetBackendServiceRequest $targetTcpProxiesSetBackendServiceRequestResource): self + { + return (new self()) + ->setProject($project) + ->setTargetTcpProxy($targetTcpProxy) + ->setTargetTcpProxiesSetBackendServiceRequestResource($targetTcpProxiesSetBackendServiceRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\TargetTcpProxiesSetBackendServiceRequest $target_tcp_proxies_set_backend_service_request_resource + * The body resource for this request + * @type string $target_tcp_proxy + * Name of the TargetTcpProxy resource whose BackendService resource is to be set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest target_tcp_proxies_set_backend_service_request_resource = 273721583 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetTcpProxiesSetBackendServiceRequest|null + */ + public function getTargetTcpProxiesSetBackendServiceRequestResource() + { + return $this->target_tcp_proxies_set_backend_service_request_resource; + } + + public function hasTargetTcpProxiesSetBackendServiceRequestResource() + { + return isset($this->target_tcp_proxies_set_backend_service_request_resource); + } + + public function clearTargetTcpProxiesSetBackendServiceRequestResource() + { + unset($this->target_tcp_proxies_set_backend_service_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest target_tcp_proxies_set_backend_service_request_resource = 273721583 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetTcpProxiesSetBackendServiceRequest $var + * @return $this + */ + public function setTargetTcpProxiesSetBackendServiceRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetTcpProxiesSetBackendServiceRequest::class); + $this->target_tcp_proxies_set_backend_service_request_resource = $var; + + return $this; + } + + /** + * Name of the TargetTcpProxy resource whose BackendService resource is to be set. + * + * Generated from protobuf field string target_tcp_proxy = 503065442 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetTcpProxy() + { + return $this->target_tcp_proxy; + } + + /** + * Name of the TargetTcpProxy resource whose BackendService resource is to be set. + * + * Generated from protobuf field string target_tcp_proxy = 503065442 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetTcpProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_tcp_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetBackupTargetPoolRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetBackupTargetPoolRequest.php new file mode 100644 index 000000000000..fcfe6267ea74 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetBackupTargetPoolRequest.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.SetBackupTargetPoolRequest + */ +class SetBackupTargetPoolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * New failoverRatio value for the target pool. + * + * Generated from protobuf field optional float failover_ratio = 212667006; + */ + protected $failover_ratio = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the TargetPool resource to set a backup pool for. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_pool = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetReference target_reference_resource = 523721712 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_reference_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetPool Name of the TargetPool resource to set a backup pool for. + * @param \Google\Cloud\Compute\V1\TargetReference $targetReferenceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetBackupTargetPoolRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $targetPool, \Google\Cloud\Compute\V1\TargetReference $targetReferenceResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetReferenceResource($targetReferenceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $failover_ratio + * New failoverRatio value for the target pool. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 $target_pool + * Name of the TargetPool resource to set a backup pool for. + * @type \Google\Cloud\Compute\V1\TargetReference $target_reference_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * New failoverRatio value for the target pool. + * + * Generated from protobuf field optional float failover_ratio = 212667006; + * @return float + */ + public function getFailoverRatio() + { + return isset($this->failover_ratio) ? $this->failover_ratio : 0.0; + } + + public function hasFailoverRatio() + { + return isset($this->failover_ratio); + } + + public function clearFailoverRatio() + { + unset($this->failover_ratio); + } + + /** + * New failoverRatio value for the target pool. + * + * Generated from protobuf field optional float failover_ratio = 212667006; + * @param float $var + * @return $this + */ + public function setFailoverRatio($var) + { + GPBUtil::checkFloat($var); + $this->failover_ratio = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the TargetPool resource to set a backup pool for. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetPool() + { + return $this->target_pool; + } + + /** + * Name of the TargetPool resource to set a backup pool for. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetPool($var) + { + GPBUtil::checkString($var, True); + $this->target_pool = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetReference target_reference_resource = 523721712 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetReference|null + */ + public function getTargetReferenceResource() + { + return $this->target_reference_resource; + } + + public function hasTargetReferenceResource() + { + return isset($this->target_reference_resource); + } + + public function clearTargetReferenceResource() + { + unset($this->target_reference_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetReference target_reference_resource = 523721712 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetReference $var + * @return $this + */ + public function setTargetReferenceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetReference::class); + $this->target_reference_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCertificateMapTargetHttpsProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCertificateMapTargetHttpsProxyRequest.php new file mode 100644 index 000000000000..c238dfeb4568 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCertificateMapTargetHttpsProxyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.SetCertificateMapTargetHttpsProxyRequest + */ +class SetCertificateMapTargetHttpsProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpsProxiesSetCertificateMapRequest target_https_proxies_set_certificate_map_request_resource = 467639099 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_https_proxies_set_certificate_map_request_resource = null; + /** + * Name of the TargetHttpsProxy resource whose CertificateMap is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_https_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource whose CertificateMap is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * @param \Google\Cloud\Compute\V1\TargetHttpsProxiesSetCertificateMapRequest $targetHttpsProxiesSetCertificateMapRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetCertificateMapTargetHttpsProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetHttpsProxy, \Google\Cloud\Compute\V1\TargetHttpsProxiesSetCertificateMapRequest $targetHttpsProxiesSetCertificateMapRequestResource): self + { + return (new self()) + ->setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setTargetHttpsProxiesSetCertificateMapRequestResource($targetHttpsProxiesSetCertificateMapRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\TargetHttpsProxiesSetCertificateMapRequest $target_https_proxies_set_certificate_map_request_resource + * The body resource for this request + * @type string $target_https_proxy + * Name of the TargetHttpsProxy resource whose CertificateMap is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpsProxiesSetCertificateMapRequest target_https_proxies_set_certificate_map_request_resource = 467639099 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetHttpsProxiesSetCertificateMapRequest|null + */ + public function getTargetHttpsProxiesSetCertificateMapRequestResource() + { + return $this->target_https_proxies_set_certificate_map_request_resource; + } + + public function hasTargetHttpsProxiesSetCertificateMapRequestResource() + { + return isset($this->target_https_proxies_set_certificate_map_request_resource); + } + + public function clearTargetHttpsProxiesSetCertificateMapRequestResource() + { + unset($this->target_https_proxies_set_certificate_map_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpsProxiesSetCertificateMapRequest target_https_proxies_set_certificate_map_request_resource = 467639099 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetHttpsProxiesSetCertificateMapRequest $var + * @return $this + */ + public function setTargetHttpsProxiesSetCertificateMapRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetHttpsProxiesSetCertificateMapRequest::class); + $this->target_https_proxies_set_certificate_map_request_resource = $var; + + return $this; + } + + /** + * Name of the TargetHttpsProxy resource whose CertificateMap is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetHttpsProxy() + { + return $this->target_https_proxy; + } + + /** + * Name of the TargetHttpsProxy resource whose CertificateMap is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetHttpsProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_https_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCertificateMapTargetSslProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCertificateMapTargetSslProxyRequest.php new file mode 100644 index 000000000000..6701611f2e95 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCertificateMapTargetSslProxyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.SetCertificateMapTargetSslProxyRequest + */ +class SetCertificateMapTargetSslProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetSslProxiesSetCertificateMapRequest target_ssl_proxies_set_certificate_map_request_resource = 343984954 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_ssl_proxies_set_certificate_map_request_resource = null; + /** + * Name of the TargetSslProxy resource whose CertificateMap is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string target_ssl_proxy = 338795853 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_ssl_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $targetSslProxy Name of the TargetSslProxy resource whose CertificateMap is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * @param \Google\Cloud\Compute\V1\TargetSslProxiesSetCertificateMapRequest $targetSslProxiesSetCertificateMapRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetCertificateMapTargetSslProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetSslProxy, \Google\Cloud\Compute\V1\TargetSslProxiesSetCertificateMapRequest $targetSslProxiesSetCertificateMapRequestResource): self + { + return (new self()) + ->setProject($project) + ->setTargetSslProxy($targetSslProxy) + ->setTargetSslProxiesSetCertificateMapRequestResource($targetSslProxiesSetCertificateMapRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\TargetSslProxiesSetCertificateMapRequest $target_ssl_proxies_set_certificate_map_request_resource + * The body resource for this request + * @type string $target_ssl_proxy + * Name of the TargetSslProxy resource whose CertificateMap is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetSslProxiesSetCertificateMapRequest target_ssl_proxies_set_certificate_map_request_resource = 343984954 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetSslProxiesSetCertificateMapRequest|null + */ + public function getTargetSslProxiesSetCertificateMapRequestResource() + { + return $this->target_ssl_proxies_set_certificate_map_request_resource; + } + + public function hasTargetSslProxiesSetCertificateMapRequestResource() + { + return isset($this->target_ssl_proxies_set_certificate_map_request_resource); + } + + public function clearTargetSslProxiesSetCertificateMapRequestResource() + { + unset($this->target_ssl_proxies_set_certificate_map_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetSslProxiesSetCertificateMapRequest target_ssl_proxies_set_certificate_map_request_resource = 343984954 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetSslProxiesSetCertificateMapRequest $var + * @return $this + */ + public function setTargetSslProxiesSetCertificateMapRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetSslProxiesSetCertificateMapRequest::class); + $this->target_ssl_proxies_set_certificate_map_request_resource = $var; + + return $this; + } + + /** + * Name of the TargetSslProxy resource whose CertificateMap is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string target_ssl_proxy = 338795853 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetSslProxy() + { + return $this->target_ssl_proxy; + } + + /** + * Name of the TargetSslProxy resource whose CertificateMap is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string target_ssl_proxy = 338795853 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetSslProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_ssl_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCloudArmorTierProjectRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCloudArmorTierProjectRequest.php new file mode 100644 index 000000000000..cf077f115f21 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCloudArmorTierProjectRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.SetCloudArmorTierProjectRequest + */ +class SetCloudArmorTierProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ProjectsSetCloudArmorTierRequest projects_set_cloud_armor_tier_request_resource = 77053391 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $projects_set_cloud_armor_tier_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\ProjectsSetCloudArmorTierRequest $projectsSetCloudArmorTierRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetCloudArmorTierProjectRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\ProjectsSetCloudArmorTierRequest $projectsSetCloudArmorTierRequestResource): self + { + return (new self()) + ->setProject($project) + ->setProjectsSetCloudArmorTierRequestResource($projectsSetCloudArmorTierRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type \Google\Cloud\Compute\V1\ProjectsSetCloudArmorTierRequest $projects_set_cloud_armor_tier_request_resource + * The body resource 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); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ProjectsSetCloudArmorTierRequest projects_set_cloud_armor_tier_request_resource = 77053391 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ProjectsSetCloudArmorTierRequest|null + */ + public function getProjectsSetCloudArmorTierRequestResource() + { + return $this->projects_set_cloud_armor_tier_request_resource; + } + + public function hasProjectsSetCloudArmorTierRequestResource() + { + return isset($this->projects_set_cloud_armor_tier_request_resource); + } + + public function clearProjectsSetCloudArmorTierRequestResource() + { + unset($this->projects_set_cloud_armor_tier_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ProjectsSetCloudArmorTierRequest projects_set_cloud_armor_tier_request_resource = 77053391 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ProjectsSetCloudArmorTierRequest $var + * @return $this + */ + public function setProjectsSetCloudArmorTierRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ProjectsSetCloudArmorTierRequest::class); + $this->projects_set_cloud_armor_tier_request_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCommonInstanceMetadataOperationMetadata.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCommonInstanceMetadataOperationMetadata.php new file mode 100644 index 000000000000..12daa17fa638 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCommonInstanceMetadataOperationMetadata.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.SetCommonInstanceMetadataOperationMetadata + */ +class SetCommonInstanceMetadataOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The client operation id. + * + * Generated from protobuf field optional string client_operation_id = 297240295; + */ + protected $client_operation_id = null; + /** + * [Output Only] Status information per location (location name is key). Example key: zones/us-central1-a + * + * Generated from protobuf field map per_location_operations = 408987796; + */ + private $per_location_operations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $client_operation_id + * [Output Only] The client operation id. + * @type array|\Google\Protobuf\Internal\MapField $per_location_operations + * [Output Only] Status information per location (location name is key). Example key: zones/us-central1-a + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The client operation id. + * + * Generated from protobuf field optional string client_operation_id = 297240295; + * @return string + */ + public function getClientOperationId() + { + return isset($this->client_operation_id) ? $this->client_operation_id : ''; + } + + public function hasClientOperationId() + { + return isset($this->client_operation_id); + } + + public function clearClientOperationId() + { + unset($this->client_operation_id); + } + + /** + * [Output Only] The client operation id. + * + * Generated from protobuf field optional string client_operation_id = 297240295; + * @param string $var + * @return $this + */ + public function setClientOperationId($var) + { + GPBUtil::checkString($var, True); + $this->client_operation_id = $var; + + return $this; + } + + /** + * [Output Only] Status information per location (location name is key). Example key: zones/us-central1-a + * + * Generated from protobuf field map per_location_operations = 408987796; + * @return \Google\Protobuf\Internal\MapField + */ + public function getPerLocationOperations() + { + return $this->per_location_operations; + } + + /** + * [Output Only] Status information per location (location name is key). Example key: zones/us-central1-a + * + * Generated from protobuf field map per_location_operations = 408987796; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setPerLocationOperations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo::class); + $this->per_location_operations = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo.php new file mode 100644 index 000000000000..c1e201b4e632 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo.php @@ -0,0 +1,124 @@ +google.cloud.compute.v1.SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo + */ +class SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] If state is `ABANDONED` or `FAILED`, this field is populated. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Status error = 96784904; + */ + protected $error = null; + /** + * [Output Only] Status of the action, which can be one of the following: `PROPAGATING`, `PROPAGATED`, `ABANDONED`, `FAILED`, or `DONE`. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + */ + protected $state = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\Status $error + * [Output Only] If state is `ABANDONED` or `FAILED`, this field is populated. + * @type string $state + * [Output Only] Status of the action, which can be one of the following: `PROPAGATING`, `PROPAGATED`, `ABANDONED`, `FAILED`, or `DONE`. + * Check the State enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] If state is `ABANDONED` or `FAILED`, this field is populated. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Status error = 96784904; + * @return \Google\Cloud\Compute\V1\Status|null + */ + public function getError() + { + return $this->error; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * [Output Only] If state is `ABANDONED` or `FAILED`, this field is populated. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Status error = 96784904; + * @param \Google\Cloud\Compute\V1\Status $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Status::class); + $this->error = $var; + + return $this; + } + + /** + * [Output Only] Status of the action, which can be one of the following: `PROPAGATING`, `PROPAGATED`, `ABANDONED`, `FAILED`, or `DONE`. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @return string + */ + public function getState() + { + return isset($this->state) ? $this->state : ''; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * [Output Only] Status of the action, which can be one of the following: `PROPAGATING`, `PROPAGATED`, `ABANDONED`, `FAILED`, or `DONE`. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo/State.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo/State.php new file mode 100644 index 000000000000..81d0286521b1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo/State.php @@ -0,0 +1,90 @@ +google.cloud.compute.v1.SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo.State + */ +class State +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATE = 0; + */ + const UNDEFINED_STATE = 0; + /** + * Operation not tracked in this location e.g. zone is marked as DOWN. + * + * Generated from protobuf enum ABANDONED = 81797556; + */ + const ABANDONED = 81797556; + /** + * Operation has completed successfully. + * + * Generated from protobuf enum DONE = 2104194; + */ + const DONE = 2104194; + /** + * Operation is in an error state. + * + * Generated from protobuf enum FAILED = 455706685; + */ + const FAILED = 455706685; + /** + * Operation is confirmed to be in the location. + * + * Generated from protobuf enum PROPAGATED = 507550299; + */ + const PROPAGATED = 507550299; + /** + * Operation is not yet confirmed to have been created in the location. + * + * Generated from protobuf enum PROPAGATING = 164807046; + */ + const PROPAGATING = 164807046; + /** + * Generated from protobuf enum UNSPECIFIED = 526786327; + */ + const UNSPECIFIED = 526786327; + + private static $valueToName = [ + self::UNDEFINED_STATE => 'UNDEFINED_STATE', + self::ABANDONED => 'ABANDONED', + self::DONE => 'DONE', + self::FAILED => 'FAILED', + self::PROPAGATED => 'PROPAGATED', + self::PROPAGATING => 'PROPAGATING', + self::UNSPECIFIED => 'UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Compute\V1\SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo_State::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCommonInstanceMetadataProjectRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCommonInstanceMetadataProjectRequest.php new file mode 100644 index 000000000000..3be4ce6e5399 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetCommonInstanceMetadataProjectRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest + */ +class SetCommonInstanceMetadataProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Metadata metadata_resource = 291086110 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $metadata_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\Metadata $metadataResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetCommonInstanceMetadataProjectRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\Metadata $metadataResource): self + { + return (new self()) + ->setProject($project) + ->setMetadataResource($metadataResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\Metadata $metadata_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). + * } + */ + 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.Metadata metadata_resource = 291086110 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Metadata|null + */ + public function getMetadataResource() + { + return $this->metadata_resource; + } + + public function hasMetadataResource() + { + return isset($this->metadata_resource); + } + + public function clearMetadataResource() + { + unset($this->metadata_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Metadata metadata_resource = 291086110 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Metadata $var + * @return $this + */ + public function setMetadataResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Metadata::class); + $this->metadata_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetDefaultNetworkTierProjectRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetDefaultNetworkTierProjectRequest.php new file mode 100644 index 000000000000..ed6f71483c4e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetDefaultNetworkTierProjectRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest + */ +class SetDefaultNetworkTierProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest projects_set_default_network_tier_request_resource = 126410762 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $projects_set_default_network_tier_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\ProjectsSetDefaultNetworkTierRequest $projectsSetDefaultNetworkTierRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetDefaultNetworkTierProjectRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\ProjectsSetDefaultNetworkTierRequest $projectsSetDefaultNetworkTierRequestResource): self + { + return (new self()) + ->setProject($project) + ->setProjectsSetDefaultNetworkTierRequestResource($projectsSetDefaultNetworkTierRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type \Google\Cloud\Compute\V1\ProjectsSetDefaultNetworkTierRequest $projects_set_default_network_tier_request_resource + * The body resource 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); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest projects_set_default_network_tier_request_resource = 126410762 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ProjectsSetDefaultNetworkTierRequest|null + */ + public function getProjectsSetDefaultNetworkTierRequestResource() + { + return $this->projects_set_default_network_tier_request_resource; + } + + public function hasProjectsSetDefaultNetworkTierRequestResource() + { + return isset($this->projects_set_default_network_tier_request_resource); + } + + public function clearProjectsSetDefaultNetworkTierRequestResource() + { + unset($this->projects_set_default_network_tier_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest projects_set_default_network_tier_request_resource = 126410762 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ProjectsSetDefaultNetworkTierRequest $var + * @return $this + */ + public function setProjectsSetDefaultNetworkTierRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ProjectsSetDefaultNetworkTierRequest::class); + $this->projects_set_default_network_tier_request_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetDeletionProtectionInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetDeletionProtectionInstanceRequest.php new file mode 100644 index 000000000000..954f192e2df8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetDeletionProtectionInstanceRequest.php @@ -0,0 +1,240 @@ +google.cloud.compute.v1.SetDeletionProtectionInstanceRequest + */ +class SetDeletionProtectionInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Whether the resource should be protected against deletion. + * + * Generated from protobuf field optional bool deletion_protection = 458014698; + */ + protected $deletion_protection = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * 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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $resource Name or id of the resource for this request. + * + * @return \Google\Cloud\Compute\V1\SetDeletionProtectionInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $resource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setResource($resource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $deletion_protection + * Whether the resource should be protected against deletion. + * @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 $resource + * Name or id of the resource for 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); + } + + /** + * Whether the resource should be protected against deletion. + * + * Generated from protobuf field optional bool deletion_protection = 458014698; + * @return bool + */ + public function getDeletionProtection() + { + return isset($this->deletion_protection) ? $this->deletion_protection : false; + } + + public function hasDeletionProtection() + { + return isset($this->deletion_protection); + } + + public function clearDeletionProtection() + { + unset($this->deletion_protection); + } + + /** + * Whether the resource should be protected against deletion. + * + * Generated from protobuf field optional bool deletion_protection = 458014698; + * @param bool $var + * @return $this + */ + public function setDeletionProtection($var) + { + GPBUtil::checkBool($var); + $this->deletion_protection = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetDiskAutoDeleteInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetDiskAutoDeleteInstanceRequest.php new file mode 100644 index 000000000000..76ee56d6b511 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetDiskAutoDeleteInstanceRequest.php @@ -0,0 +1,268 @@ +google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest + */ +class SetDiskAutoDeleteInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Whether to auto-delete the disk when the instance is deleted. + * + * Generated from protobuf field bool auto_delete = 464761403 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $auto_delete = false; + /** + * The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names. + * + * Generated from protobuf field string device_name = 67541716 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $device_name = ''; + /** + * The instance name for this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance The instance name for this request. + * @param bool $autoDelete Whether to auto-delete the disk when the instance is deleted. + * @param string $deviceName The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names. + * + * @return \Google\Cloud\Compute\V1\SetDiskAutoDeleteInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, bool $autoDelete, string $deviceName): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setAutoDelete($autoDelete) + ->setDeviceName($deviceName); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $auto_delete + * Whether to auto-delete the disk when the instance is deleted. + * @type string $device_name + * The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names. + * @type string $instance + * The instance name 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); + } + + /** + * Whether to auto-delete the disk when the instance is deleted. + * + * Generated from protobuf field bool auto_delete = 464761403 [(.google.api.field_behavior) = REQUIRED]; + * @return bool + */ + public function getAutoDelete() + { + return $this->auto_delete; + } + + /** + * Whether to auto-delete the disk when the instance is deleted. + * + * Generated from protobuf field bool auto_delete = 464761403 [(.google.api.field_behavior) = REQUIRED]; + * @param bool $var + * @return $this + */ + public function setAutoDelete($var) + { + GPBUtil::checkBool($var); + $this->auto_delete = $var; + + return $this; + } + + /** + * The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names. + * + * Generated from protobuf field string device_name = 67541716 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDeviceName() + { + return $this->device_name; + } + + /** + * The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names. + * + * Generated from protobuf field string device_name = 67541716 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDeviceName($var) + { + GPBUtil::checkString($var, True); + $this->device_name = $var; + + return $this; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetEdgeSecurityPolicyBackendBucketRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetEdgeSecurityPolicyBackendBucketRequest.php new file mode 100644 index 000000000000..1315d8982b4e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetEdgeSecurityPolicyBackendBucketRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.SetEdgeSecurityPolicyBackendBucketRequest + */ +class SetEdgeSecurityPolicyBackendBucketRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the BackendBucket resource to which the security policy should be set. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_bucket = 91714037 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_bucket = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyReference security_policy_reference_resource = 204135024 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy_reference_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $backendBucket Name of the BackendBucket resource to which the security policy should be set. The name should conform to RFC1035. + * @param \Google\Cloud\Compute\V1\SecurityPolicyReference $securityPolicyReferenceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetEdgeSecurityPolicyBackendBucketRequest + * + * @experimental + */ + public static function build(string $project, string $backendBucket, \Google\Cloud\Compute\V1\SecurityPolicyReference $securityPolicyReferenceResource): self + { + return (new self()) + ->setProject($project) + ->setBackendBucket($backendBucket) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_bucket + * Name of the BackendBucket resource to which the security policy should be set. The name should conform to RFC1035. + * @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 \Google\Cloud\Compute\V1\SecurityPolicyReference $security_policy_reference_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the BackendBucket resource to which the security policy should be set. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_bucket = 91714037 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackendBucket() + { + return $this->backend_bucket; + } + + /** + * Name of the BackendBucket resource to which the security policy should be set. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_bucket = 91714037 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackendBucket($var) + { + GPBUtil::checkString($var, True); + $this->backend_bucket = $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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyReference security_policy_reference_resource = 204135024 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SecurityPolicyReference|null + */ + public function getSecurityPolicyReferenceResource() + { + return $this->security_policy_reference_resource; + } + + public function hasSecurityPolicyReferenceResource() + { + return isset($this->security_policy_reference_resource); + } + + public function clearSecurityPolicyReferenceResource() + { + unset($this->security_policy_reference_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyReference security_policy_reference_resource = 204135024 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SecurityPolicyReference $var + * @return $this + */ + public function setSecurityPolicyReferenceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyReference::class); + $this->security_policy_reference_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetEdgeSecurityPolicyBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetEdgeSecurityPolicyBackendServiceRequest.php new file mode 100644 index 000000000000..798af923ee68 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetEdgeSecurityPolicyBackendServiceRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.SetEdgeSecurityPolicyBackendServiceRequest + */ +class SetEdgeSecurityPolicyBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the BackendService resource to which the edge security policy should be set. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_service = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyReference security_policy_reference_resource = 204135024 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy_reference_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $backendService Name of the BackendService resource to which the edge security policy should be set. The name should conform to RFC1035. + * @param \Google\Cloud\Compute\V1\SecurityPolicyReference $securityPolicyReferenceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetEdgeSecurityPolicyBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, string $backendService, \Google\Cloud\Compute\V1\SecurityPolicyReference $securityPolicyReferenceResource): self + { + return (new self()) + ->setProject($project) + ->setBackendService($backendService) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_service + * Name of the BackendService resource to which the edge security policy should be set. The name should conform to RFC1035. + * @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 \Google\Cloud\Compute\V1\SecurityPolicyReference $security_policy_reference_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the BackendService resource to which the edge security policy should be set. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackendService() + { + return $this->backend_service; + } + + /** + * Name of the BackendService resource to which the edge security policy should be set. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackendService($var) + { + GPBUtil::checkString($var, True); + $this->backend_service = $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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyReference security_policy_reference_resource = 204135024 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SecurityPolicyReference|null + */ + public function getSecurityPolicyReferenceResource() + { + return $this->security_policy_reference_resource; + } + + public function hasSecurityPolicyReferenceResource() + { + return isset($this->security_policy_reference_resource); + } + + public function clearSecurityPolicyReferenceResource() + { + unset($this->security_policy_reference_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyReference security_policy_reference_resource = 204135024 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SecurityPolicyReference $var + * @return $this + */ + public function setSecurityPolicyReferenceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyReference::class); + $this->security_policy_reference_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyBackendBucketRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyBackendBucketRequest.php new file mode 100644 index 000000000000..d326114550a5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyBackendBucketRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.SetIamPolicyBackendBucketRequest + */ +class SetIamPolicyBackendBucketRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $global_set_policy_request_resource = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $globalSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicyBackendBucketRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $globalSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $global_set_policy_request_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + 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.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\GlobalSetPolicyRequest|null + */ + public function getGlobalSetPolicyRequestResource() + { + return $this->global_set_policy_request_resource; + } + + public function hasGlobalSetPolicyRequestResource() + { + return isset($this->global_set_policy_request_resource); + } + + public function clearGlobalSetPolicyRequestResource() + { + unset($this->global_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $var + * @return $this + */ + public function setGlobalSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\GlobalSetPolicyRequest::class); + $this->global_set_policy_request_resource = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyBackendServiceRequest.php new file mode 100644 index 000000000000..cf17f44b8eae --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyBackendServiceRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.SetIamPolicyBackendServiceRequest + */ +class SetIamPolicyBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $global_set_policy_request_resource = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $globalSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicyBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $globalSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $global_set_policy_request_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + 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.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\GlobalSetPolicyRequest|null + */ + public function getGlobalSetPolicyRequestResource() + { + return $this->global_set_policy_request_resource; + } + + public function hasGlobalSetPolicyRequestResource() + { + return isset($this->global_set_policy_request_resource); + } + + public function clearGlobalSetPolicyRequestResource() + { + unset($this->global_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $var + * @return $this + */ + public function setGlobalSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\GlobalSetPolicyRequest::class); + $this->global_set_policy_request_resource = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyDiskRequest.php new file mode 100644 index 000000000000..35853f04cf7e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyDiskRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.SetIamPolicyDiskRequest + */ +class SetIamPolicyDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetPolicyRequest zone_set_policy_request_resource = 382082107 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone_set_policy_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $zoneSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicyDiskRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $resource, \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $zoneSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setResource($resource) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type string $zone + * The name of the zone for this request. + * @type \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $zone_set_policy_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetPolicyRequest zone_set_policy_request_resource = 382082107 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ZoneSetPolicyRequest|null + */ + public function getZoneSetPolicyRequestResource() + { + return $this->zone_set_policy_request_resource; + } + + public function hasZoneSetPolicyRequestResource() + { + return isset($this->zone_set_policy_request_resource); + } + + public function clearZoneSetPolicyRequestResource() + { + unset($this->zone_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetPolicyRequest zone_set_policy_request_resource = 382082107 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $var + * @return $this + */ + public function setZoneSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ZoneSetPolicyRequest::class); + $this->zone_set_policy_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyFirewallPolicyRequest.php new file mode 100644 index 000000000000..611925162b49 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyFirewallPolicyRequest.php @@ -0,0 +1,126 @@ +google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest + */ +class SetIamPolicyFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest global_organization_set_policy_request_resource = 177408606 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $global_organization_set_policy_request_resource = null; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\GlobalOrganizationSetPolicyRequest $globalOrganizationSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicyFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $resource, \Google\Cloud\Compute\V1\GlobalOrganizationSetPolicyRequest $globalOrganizationSetPolicyRequestResource): self + { + return (new self()) + ->setResource($resource) + ->setGlobalOrganizationSetPolicyRequestResource($globalOrganizationSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\GlobalOrganizationSetPolicyRequest $global_organization_set_policy_request_resource + * The body resource for this request + * @type string $resource + * Name or id of the resource for this request. + * } + */ + 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.GlobalOrganizationSetPolicyRequest global_organization_set_policy_request_resource = 177408606 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\GlobalOrganizationSetPolicyRequest|null + */ + public function getGlobalOrganizationSetPolicyRequestResource() + { + return $this->global_organization_set_policy_request_resource; + } + + public function hasGlobalOrganizationSetPolicyRequestResource() + { + return isset($this->global_organization_set_policy_request_resource); + } + + public function clearGlobalOrganizationSetPolicyRequestResource() + { + unset($this->global_organization_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest global_organization_set_policy_request_resource = 177408606 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\GlobalOrganizationSetPolicyRequest $var + * @return $this + */ + public function setGlobalOrganizationSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\GlobalOrganizationSetPolicyRequest::class); + $this->global_organization_set_policy_request_resource = $var; + + return $this; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyImageRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyImageRequest.php new file mode 100644 index 000000000000..337e53b282e9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyImageRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.SetIamPolicyImageRequest + */ +class SetIamPolicyImageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $global_set_policy_request_resource = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $globalSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicyImageRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $globalSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $global_set_policy_request_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + 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.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\GlobalSetPolicyRequest|null + */ + public function getGlobalSetPolicyRequestResource() + { + return $this->global_set_policy_request_resource; + } + + public function hasGlobalSetPolicyRequestResource() + { + return isset($this->global_set_policy_request_resource); + } + + public function clearGlobalSetPolicyRequestResource() + { + unset($this->global_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $var + * @return $this + */ + public function setGlobalSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\GlobalSetPolicyRequest::class); + $this->global_set_policy_request_resource = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyInstanceRequest.php new file mode 100644 index 000000000000..e8d34ab1b3aa --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyInstanceRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.SetIamPolicyInstanceRequest + */ +class SetIamPolicyInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetPolicyRequest zone_set_policy_request_resource = 382082107 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone_set_policy_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $zoneSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicyInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $resource, \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $zoneSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setResource($resource) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type string $zone + * The name of the zone for this request. + * @type \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $zone_set_policy_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetPolicyRequest zone_set_policy_request_resource = 382082107 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ZoneSetPolicyRequest|null + */ + public function getZoneSetPolicyRequestResource() + { + return $this->zone_set_policy_request_resource; + } + + public function hasZoneSetPolicyRequestResource() + { + return isset($this->zone_set_policy_request_resource); + } + + public function clearZoneSetPolicyRequestResource() + { + unset($this->zone_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetPolicyRequest zone_set_policy_request_resource = 382082107 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $var + * @return $this + */ + public function setZoneSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ZoneSetPolicyRequest::class); + $this->zone_set_policy_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyInstanceTemplateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyInstanceTemplateRequest.php new file mode 100644 index 000000000000..48863c4df694 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyInstanceTemplateRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest + */ +class SetIamPolicyInstanceTemplateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $global_set_policy_request_resource = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $globalSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicyInstanceTemplateRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $globalSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $global_set_policy_request_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + 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.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\GlobalSetPolicyRequest|null + */ + public function getGlobalSetPolicyRequestResource() + { + return $this->global_set_policy_request_resource; + } + + public function hasGlobalSetPolicyRequestResource() + { + return isset($this->global_set_policy_request_resource); + } + + public function clearGlobalSetPolicyRequestResource() + { + unset($this->global_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $var + * @return $this + */ + public function setGlobalSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\GlobalSetPolicyRequest::class); + $this->global_set_policy_request_resource = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyInstantSnapshotRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyInstantSnapshotRequest.php new file mode 100644 index 000000000000..5bb26bd9a9ee --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyInstantSnapshotRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.SetIamPolicyInstantSnapshotRequest + */ +class SetIamPolicyInstantSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetPolicyRequest zone_set_policy_request_resource = 382082107 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone_set_policy_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $zoneSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicyInstantSnapshotRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $resource, \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $zoneSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setResource($resource) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type string $zone + * The name of the zone for this request. + * @type \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $zone_set_policy_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetPolicyRequest zone_set_policy_request_resource = 382082107 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ZoneSetPolicyRequest|null + */ + public function getZoneSetPolicyRequestResource() + { + return $this->zone_set_policy_request_resource; + } + + public function hasZoneSetPolicyRequestResource() + { + return isset($this->zone_set_policy_request_resource); + } + + public function clearZoneSetPolicyRequestResource() + { + unset($this->zone_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetPolicyRequest zone_set_policy_request_resource = 382082107 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $var + * @return $this + */ + public function setZoneSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ZoneSetPolicyRequest::class); + $this->zone_set_policy_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyLicenseRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyLicenseRequest.php new file mode 100644 index 000000000000..07455dfd7170 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyLicenseRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.SetIamPolicyLicenseRequest + */ +class SetIamPolicyLicenseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $global_set_policy_request_resource = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $globalSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicyLicenseRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $globalSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $global_set_policy_request_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + 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.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\GlobalSetPolicyRequest|null + */ + public function getGlobalSetPolicyRequestResource() + { + return $this->global_set_policy_request_resource; + } + + public function hasGlobalSetPolicyRequestResource() + { + return isset($this->global_set_policy_request_resource); + } + + public function clearGlobalSetPolicyRequestResource() + { + unset($this->global_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $var + * @return $this + */ + public function setGlobalSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\GlobalSetPolicyRequest::class); + $this->global_set_policy_request_resource = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyMachineImageRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyMachineImageRequest.php new file mode 100644 index 000000000000..7f2823d02d07 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyMachineImageRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.SetIamPolicyMachineImageRequest + */ +class SetIamPolicyMachineImageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $global_set_policy_request_resource = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $globalSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicyMachineImageRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $globalSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $global_set_policy_request_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + 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.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\GlobalSetPolicyRequest|null + */ + public function getGlobalSetPolicyRequestResource() + { + return $this->global_set_policy_request_resource; + } + + public function hasGlobalSetPolicyRequestResource() + { + return isset($this->global_set_policy_request_resource); + } + + public function clearGlobalSetPolicyRequestResource() + { + unset($this->global_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $var + * @return $this + */ + public function setGlobalSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\GlobalSetPolicyRequest::class); + $this->global_set_policy_request_resource = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyNetworkAttachmentRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyNetworkAttachmentRequest.php new file mode 100644 index 000000000000..816abbf5149e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyNetworkAttachmentRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.SetIamPolicyNetworkAttachmentRequest + */ +class SetIamPolicyNetworkAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_set_policy_request_resource = null; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\RegionSetPolicyRequest $regionSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicyNetworkAttachmentRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\RegionSetPolicyRequest $regionSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type \Google\Cloud\Compute\V1\RegionSetPolicyRequest $region_set_policy_request_resource + * The body resource for this request + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionSetPolicyRequest|null + */ + public function getRegionSetPolicyRequestResource() + { + return $this->region_set_policy_request_resource; + } + + public function hasRegionSetPolicyRequestResource() + { + return isset($this->region_set_policy_request_resource); + } + + public function clearRegionSetPolicyRequestResource() + { + unset($this->region_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionSetPolicyRequest $var + * @return $this + */ + public function setRegionSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionSetPolicyRequest::class); + $this->region_set_policy_request_resource = $var; + + return $this; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..0d49245f3261 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyNetworkFirewallPolicyRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.SetIamPolicyNetworkFirewallPolicyRequest + */ +class SetIamPolicyNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $global_set_policy_request_resource = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $globalSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicyNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $globalSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $global_set_policy_request_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + 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.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\GlobalSetPolicyRequest|null + */ + public function getGlobalSetPolicyRequestResource() + { + return $this->global_set_policy_request_resource; + } + + public function hasGlobalSetPolicyRequestResource() + { + return isset($this->global_set_policy_request_resource); + } + + public function clearGlobalSetPolicyRequestResource() + { + unset($this->global_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $var + * @return $this + */ + public function setGlobalSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\GlobalSetPolicyRequest::class); + $this->global_set_policy_request_resource = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyNodeGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyNodeGroupRequest.php new file mode 100644 index 000000000000..23dfd08e15b2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyNodeGroupRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.SetIamPolicyNodeGroupRequest + */ +class SetIamPolicyNodeGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetPolicyRequest zone_set_policy_request_resource = 382082107 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone_set_policy_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $zoneSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicyNodeGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $resource, \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $zoneSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setResource($resource) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type string $zone + * The name of the zone for this request. + * @type \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $zone_set_policy_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetPolicyRequest zone_set_policy_request_resource = 382082107 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ZoneSetPolicyRequest|null + */ + public function getZoneSetPolicyRequestResource() + { + return $this->zone_set_policy_request_resource; + } + + public function hasZoneSetPolicyRequestResource() + { + return isset($this->zone_set_policy_request_resource); + } + + public function clearZoneSetPolicyRequestResource() + { + unset($this->zone_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetPolicyRequest zone_set_policy_request_resource = 382082107 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $var + * @return $this + */ + public function setZoneSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ZoneSetPolicyRequest::class); + $this->zone_set_policy_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyNodeTemplateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyNodeTemplateRequest.php new file mode 100644 index 000000000000..abbe68a21464 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyNodeTemplateRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest + */ +class SetIamPolicyNodeTemplateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_set_policy_request_resource = null; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\RegionSetPolicyRequest $regionSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicyNodeTemplateRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\RegionSetPolicyRequest $regionSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type \Google\Cloud\Compute\V1\RegionSetPolicyRequest $region_set_policy_request_resource + * The body resource for this request + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionSetPolicyRequest|null + */ + public function getRegionSetPolicyRequestResource() + { + return $this->region_set_policy_request_resource; + } + + public function hasRegionSetPolicyRequestResource() + { + return isset($this->region_set_policy_request_resource); + } + + public function clearRegionSetPolicyRequestResource() + { + unset($this->region_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionSetPolicyRequest $var + * @return $this + */ + public function setRegionSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionSetPolicyRequest::class); + $this->region_set_policy_request_resource = $var; + + return $this; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyRegionBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyRegionBackendServiceRequest.php new file mode 100644 index 000000000000..519d640a2c1e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyRegionBackendServiceRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.SetIamPolicyRegionBackendServiceRequest + */ +class SetIamPolicyRegionBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_set_policy_request_resource = null; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\RegionSetPolicyRequest $regionSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicyRegionBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\RegionSetPolicyRequest $regionSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type \Google\Cloud\Compute\V1\RegionSetPolicyRequest $region_set_policy_request_resource + * The body resource for this request + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionSetPolicyRequest|null + */ + public function getRegionSetPolicyRequestResource() + { + return $this->region_set_policy_request_resource; + } + + public function hasRegionSetPolicyRequestResource() + { + return isset($this->region_set_policy_request_resource); + } + + public function clearRegionSetPolicyRequestResource() + { + unset($this->region_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionSetPolicyRequest $var + * @return $this + */ + public function setRegionSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionSetPolicyRequest::class); + $this->region_set_policy_request_resource = $var; + + return $this; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyRegionDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyRegionDiskRequest.php new file mode 100644 index 000000000000..d7bc07c2073b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyRegionDiskRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.SetIamPolicyRegionDiskRequest + */ +class SetIamPolicyRegionDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_set_policy_request_resource = null; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\RegionSetPolicyRequest $regionSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicyRegionDiskRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\RegionSetPolicyRequest $regionSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type \Google\Cloud\Compute\V1\RegionSetPolicyRequest $region_set_policy_request_resource + * The body resource for this request + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionSetPolicyRequest|null + */ + public function getRegionSetPolicyRequestResource() + { + return $this->region_set_policy_request_resource; + } + + public function hasRegionSetPolicyRequestResource() + { + return isset($this->region_set_policy_request_resource); + } + + public function clearRegionSetPolicyRequestResource() + { + unset($this->region_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionSetPolicyRequest $var + * @return $this + */ + public function setRegionSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionSetPolicyRequest::class); + $this->region_set_policy_request_resource = $var; + + return $this; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyRegionInstantSnapshotRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyRegionInstantSnapshotRequest.php new file mode 100644 index 000000000000..17e2d1f9d921 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyRegionInstantSnapshotRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.SetIamPolicyRegionInstantSnapshotRequest + */ +class SetIamPolicyRegionInstantSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_set_policy_request_resource = null; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\RegionSetPolicyRequest $regionSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicyRegionInstantSnapshotRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\RegionSetPolicyRequest $regionSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type \Google\Cloud\Compute\V1\RegionSetPolicyRequest $region_set_policy_request_resource + * The body resource for this request + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionSetPolicyRequest|null + */ + public function getRegionSetPolicyRequestResource() + { + return $this->region_set_policy_request_resource; + } + + public function hasRegionSetPolicyRequestResource() + { + return isset($this->region_set_policy_request_resource); + } + + public function clearRegionSetPolicyRequestResource() + { + unset($this->region_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionSetPolicyRequest $var + * @return $this + */ + public function setRegionSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionSetPolicyRequest::class); + $this->region_set_policy_request_resource = $var; + + return $this; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyRegionNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyRegionNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..be1801989731 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyRegionNetworkFirewallPolicyRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.SetIamPolicyRegionNetworkFirewallPolicyRequest + */ +class SetIamPolicyRegionNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_set_policy_request_resource = null; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\RegionSetPolicyRequest $regionSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicyRegionNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\RegionSetPolicyRequest $regionSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type \Google\Cloud\Compute\V1\RegionSetPolicyRequest $region_set_policy_request_resource + * The body resource for this request + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionSetPolicyRequest|null + */ + public function getRegionSetPolicyRequestResource() + { + return $this->region_set_policy_request_resource; + } + + public function hasRegionSetPolicyRequestResource() + { + return isset($this->region_set_policy_request_resource); + } + + public function clearRegionSetPolicyRequestResource() + { + unset($this->region_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionSetPolicyRequest $var + * @return $this + */ + public function setRegionSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionSetPolicyRequest::class); + $this->region_set_policy_request_resource = $var; + + return $this; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyReservationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyReservationRequest.php new file mode 100644 index 000000000000..4f762de9336d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyReservationRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.SetIamPolicyReservationRequest + */ +class SetIamPolicyReservationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetPolicyRequest zone_set_policy_request_resource = 382082107 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone_set_policy_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $zoneSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicyReservationRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $resource, \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $zoneSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setResource($resource) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type string $zone + * The name of the zone for this request. + * @type \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $zone_set_policy_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetPolicyRequest zone_set_policy_request_resource = 382082107 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ZoneSetPolicyRequest|null + */ + public function getZoneSetPolicyRequestResource() + { + return $this->zone_set_policy_request_resource; + } + + public function hasZoneSetPolicyRequestResource() + { + return isset($this->zone_set_policy_request_resource); + } + + public function clearZoneSetPolicyRequestResource() + { + unset($this->zone_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetPolicyRequest zone_set_policy_request_resource = 382082107 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $var + * @return $this + */ + public function setZoneSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ZoneSetPolicyRequest::class); + $this->zone_set_policy_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyResourcePolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyResourcePolicyRequest.php new file mode 100644 index 000000000000..bfb459eb0401 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyResourcePolicyRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest + */ +class SetIamPolicyResourcePolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_set_policy_request_resource = null; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\RegionSetPolicyRequest $regionSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicyResourcePolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\RegionSetPolicyRequest $regionSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type \Google\Cloud\Compute\V1\RegionSetPolicyRequest $region_set_policy_request_resource + * The body resource for this request + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionSetPolicyRequest|null + */ + public function getRegionSetPolicyRequestResource() + { + return $this->region_set_policy_request_resource; + } + + public function hasRegionSetPolicyRequestResource() + { + return isset($this->region_set_policy_request_resource); + } + + public function clearRegionSetPolicyRequestResource() + { + unset($this->region_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionSetPolicyRequest $var + * @return $this + */ + public function setRegionSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionSetPolicyRequest::class); + $this->region_set_policy_request_resource = $var; + + return $this; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyServiceAttachmentRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyServiceAttachmentRequest.php new file mode 100644 index 000000000000..87104468174a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyServiceAttachmentRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.SetIamPolicyServiceAttachmentRequest + */ +class SetIamPolicyServiceAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_set_policy_request_resource = null; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\RegionSetPolicyRequest $regionSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicyServiceAttachmentRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\RegionSetPolicyRequest $regionSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type \Google\Cloud\Compute\V1\RegionSetPolicyRequest $region_set_policy_request_resource + * The body resource for this request + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionSetPolicyRequest|null + */ + public function getRegionSetPolicyRequestResource() + { + return $this->region_set_policy_request_resource; + } + + public function hasRegionSetPolicyRequestResource() + { + return isset($this->region_set_policy_request_resource); + } + + public function clearRegionSetPolicyRequestResource() + { + unset($this->region_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionSetPolicyRequest $var + * @return $this + */ + public function setRegionSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionSetPolicyRequest::class); + $this->region_set_policy_request_resource = $var; + + return $this; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicySnapshotRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicySnapshotRequest.php new file mode 100644 index 000000000000..935a1200033e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicySnapshotRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.SetIamPolicySnapshotRequest + */ +class SetIamPolicySnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $global_set_policy_request_resource = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $globalSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicySnapshotRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $globalSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $global_set_policy_request_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + 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.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\GlobalSetPolicyRequest|null + */ + public function getGlobalSetPolicyRequestResource() + { + return $this->global_set_policy_request_resource; + } + + public function hasGlobalSetPolicyRequestResource() + { + return isset($this->global_set_policy_request_resource); + } + + public function clearGlobalSetPolicyRequestResource() + { + unset($this->global_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\GlobalSetPolicyRequest $var + * @return $this + */ + public function setGlobalSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\GlobalSetPolicyRequest::class); + $this->global_set_policy_request_resource = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyStoragePoolRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyStoragePoolRequest.php new file mode 100644 index 000000000000..f628b0595daf --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicyStoragePoolRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.SetIamPolicyStoragePoolRequest + */ +class SetIamPolicyStoragePoolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetPolicyRequest zone_set_policy_request_resource = 382082107 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone_set_policy_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $zoneSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicyStoragePoolRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $resource, \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $zoneSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setResource($resource) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type string $zone + * The name of the zone for this request. + * @type \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $zone_set_policy_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetPolicyRequest zone_set_policy_request_resource = 382082107 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ZoneSetPolicyRequest|null + */ + public function getZoneSetPolicyRequestResource() + { + return $this->zone_set_policy_request_resource; + } + + public function hasZoneSetPolicyRequestResource() + { + return isset($this->zone_set_policy_request_resource); + } + + public function clearZoneSetPolicyRequestResource() + { + unset($this->zone_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetPolicyRequest zone_set_policy_request_resource = 382082107 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ZoneSetPolicyRequest $var + * @return $this + */ + public function setZoneSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ZoneSetPolicyRequest::class); + $this->zone_set_policy_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicySubnetworkRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicySubnetworkRequest.php new file mode 100644 index 000000000000..5ab89f4a4eaf --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetIamPolicySubnetworkRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.SetIamPolicySubnetworkRequest + */ +class SetIamPolicySubnetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_set_policy_request_resource = null; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\RegionSetPolicyRequest $regionSetPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetIamPolicySubnetworkRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\RegionSetPolicyRequest $regionSetPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type \Google\Cloud\Compute\V1\RegionSetPolicyRequest $region_set_policy_request_resource + * The body resource for this request + * @type string $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionSetPolicyRequest|null + */ + public function getRegionSetPolicyRequestResource() + { + return $this->region_set_policy_request_resource; + } + + public function hasRegionSetPolicyRequestResource() + { + return isset($this->region_set_policy_request_resource); + } + + public function clearRegionSetPolicyRequestResource() + { + unset($this->region_set_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionSetPolicyRequest $var + * @return $this + */ + public function setRegionSetPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionSetPolicyRequest::class); + $this->region_set_policy_request_resource = $var; + + return $this; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetInstanceTemplateInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetInstanceTemplateInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..6c6e43c12b3b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetInstanceTemplateInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest + */ +class SetInstanceTemplateInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest instance_group_managers_set_instance_template_request_resource = 9809093 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_managers_set_instance_template_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the zone where the managed instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. + * @param string $instanceGroupManager The name of the managed instance group. + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersSetInstanceTemplateRequest $instanceGroupManagersSetInstanceTemplateRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetInstanceTemplateInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager, \Google\Cloud\Compute\V1\InstanceGroupManagersSetInstanceTemplateRequest $instanceGroupManagersSetInstanceTemplateRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersSetInstanceTemplateRequestResource($instanceGroupManagersSetInstanceTemplateRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group. + * @type \Google\Cloud\Compute\V1\InstanceGroupManagersSetInstanceTemplateRequest $instance_group_managers_set_instance_template_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 where the managed instance group is located. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest instance_group_managers_set_instance_template_request_resource = 9809093 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagersSetInstanceTemplateRequest|null + */ + public function getInstanceGroupManagersSetInstanceTemplateRequestResource() + { + return $this->instance_group_managers_set_instance_template_request_resource; + } + + public function hasInstanceGroupManagersSetInstanceTemplateRequestResource() + { + return isset($this->instance_group_managers_set_instance_template_request_resource); + } + + public function clearInstanceGroupManagersSetInstanceTemplateRequestResource() + { + unset($this->instance_group_managers_set_instance_template_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest instance_group_managers_set_instance_template_request_resource = 9809093 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersSetInstanceTemplateRequest $var + * @return $this + */ + public function setInstanceGroupManagersSetInstanceTemplateRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagersSetInstanceTemplateRequest::class); + $this->instance_group_managers_set_instance_template_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 where the managed instance group is located. + * + * 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 where the managed instance group is located. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetInstanceTemplateRegionInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetInstanceTemplateRegionInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..45bf17b122af --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetInstanceTemplateRegionInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest + */ +class SetInstanceTemplateRegionInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest region_instance_group_managers_set_template_request_resource = 187310412 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_instance_group_managers_set_template_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $instanceGroupManager The name of the managed instance group. + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagersSetTemplateRequest $regionInstanceGroupManagersSetTemplateRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetInstanceTemplateRegionInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroupManager, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersSetTemplateRequest $regionInstanceGroupManagersSetTemplateRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroupManager($instanceGroupManager) + ->setRegionInstanceGroupManagersSetTemplateRequestResource($regionInstanceGroupManagersSetTemplateRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type \Google\Cloud\Compute\V1\RegionInstanceGroupManagersSetTemplateRequest $region_instance_group_managers_set_template_request_resource + * The body resource 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 managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest region_instance_group_managers_set_template_request_resource = 187310412 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionInstanceGroupManagersSetTemplateRequest|null + */ + public function getRegionInstanceGroupManagersSetTemplateRequestResource() + { + return $this->region_instance_group_managers_set_template_request_resource; + } + + public function hasRegionInstanceGroupManagersSetTemplateRequestResource() + { + return isset($this->region_instance_group_managers_set_template_request_resource); + } + + public function clearRegionInstanceGroupManagersSetTemplateRequestResource() + { + unset($this->region_instance_group_managers_set_template_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest region_instance_group_managers_set_template_request_resource = 187310412 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagersSetTemplateRequest $var + * @return $this + */ + public function setRegionInstanceGroupManagersSetTemplateRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersSetTemplateRequest::class); + $this->region_instance_group_managers_set_template_request_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsAddressRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsAddressRequest.php new file mode 100644 index 000000000000..aea44a151789 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsAddressRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetLabelsAddressRequest + */ +class SetLabelsAddressRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_set_labels_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\RegionSetLabelsRequest $regionSetLabelsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetLabelsAddressRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\RegionSetLabelsRequest $regionSetLabelsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The region for this request. + * @type \Google\Cloud\Compute\V1\RegionSetLabelsRequest $region_set_labels_request_resource + * The body resource 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 $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 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 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionSetLabelsRequest|null + */ + public function getRegionSetLabelsRequestResource() + { + return $this->region_set_labels_request_resource; + } + + public function hasRegionSetLabelsRequestResource() + { + return isset($this->region_set_labels_request_resource); + } + + public function clearRegionSetLabelsRequestResource() + { + unset($this->region_set_labels_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionSetLabelsRequest $var + * @return $this + */ + public function setRegionSetLabelsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionSetLabelsRequest::class); + $this->region_set_labels_request_resource = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsDiskRequest.php new file mode 100644 index 000000000000..59bac7b349bc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsDiskRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetLabelsDiskRequest + */ +class SetLabelsDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * 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"]; + */ + protected $zone = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetLabelsRequest zone_set_labels_request_resource = 364950798 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone_set_labels_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\ZoneSetLabelsRequest $zoneSetLabelsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetLabelsDiskRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $resource, \Google\Cloud\Compute\V1\ZoneSetLabelsRequest $zoneSetLabelsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setResource($resource) + ->setZoneSetLabelsRequestResource($zoneSetLabelsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $resource + * Name or id of the resource for this request. + * @type string $zone + * The name of the zone for this request. + * @type \Google\Cloud\Compute\V1\ZoneSetLabelsRequest $zone_set_labels_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetLabelsRequest zone_set_labels_request_resource = 364950798 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ZoneSetLabelsRequest|null + */ + public function getZoneSetLabelsRequestResource() + { + return $this->zone_set_labels_request_resource; + } + + public function hasZoneSetLabelsRequestResource() + { + return isset($this->zone_set_labels_request_resource); + } + + public function clearZoneSetLabelsRequestResource() + { + unset($this->zone_set_labels_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetLabelsRequest zone_set_labels_request_resource = 364950798 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ZoneSetLabelsRequest $var + * @return $this + */ + public function setZoneSetLabelsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ZoneSetLabelsRequest::class); + $this->zone_set_labels_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsExternalVpnGatewayRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsExternalVpnGatewayRequest.php new file mode 100644 index 000000000000..331c226b2be7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsExternalVpnGatewayRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest + */ +class SetLabelsExternalVpnGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $global_set_labels_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"]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $globalSetLabelsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetLabelsExternalVpnGatewayRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $globalSetLabelsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $global_set_labels_request_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + 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.GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\GlobalSetLabelsRequest|null + */ + public function getGlobalSetLabelsRequestResource() + { + return $this->global_set_labels_request_resource; + } + + public function hasGlobalSetLabelsRequestResource() + { + return isset($this->global_set_labels_request_resource); + } + + public function clearGlobalSetLabelsRequestResource() + { + unset($this->global_set_labels_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $var + * @return $this + */ + public function setGlobalSetLabelsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\GlobalSetLabelsRequest::class); + $this->global_set_labels_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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsForwardingRuleRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsForwardingRuleRequest.php new file mode 100644 index 000000000000..9834e154d045 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsForwardingRuleRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetLabelsForwardingRuleRequest + */ +class SetLabelsForwardingRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_set_labels_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\RegionSetLabelsRequest $regionSetLabelsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetLabelsForwardingRuleRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\RegionSetLabelsRequest $regionSetLabelsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The region for this request. + * @type \Google\Cloud\Compute\V1\RegionSetLabelsRequest $region_set_labels_request_resource + * The body resource 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 $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 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 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionSetLabelsRequest|null + */ + public function getRegionSetLabelsRequestResource() + { + return $this->region_set_labels_request_resource; + } + + public function hasRegionSetLabelsRequestResource() + { + return isset($this->region_set_labels_request_resource); + } + + public function clearRegionSetLabelsRequestResource() + { + unset($this->region_set_labels_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionSetLabelsRequest $var + * @return $this + */ + public function setRegionSetLabelsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionSetLabelsRequest::class); + $this->region_set_labels_request_resource = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsGlobalAddressRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsGlobalAddressRequest.php new file mode 100644 index 000000000000..d13ac9b3966f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsGlobalAddressRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.SetLabelsGlobalAddressRequest + */ +class SetLabelsGlobalAddressRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $global_set_labels_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"]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $globalSetLabelsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetLabelsGlobalAddressRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $globalSetLabelsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $global_set_labels_request_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + 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.GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\GlobalSetLabelsRequest|null + */ + public function getGlobalSetLabelsRequestResource() + { + return $this->global_set_labels_request_resource; + } + + public function hasGlobalSetLabelsRequestResource() + { + return isset($this->global_set_labels_request_resource); + } + + public function clearGlobalSetLabelsRequestResource() + { + unset($this->global_set_labels_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $var + * @return $this + */ + public function setGlobalSetLabelsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\GlobalSetLabelsRequest::class); + $this->global_set_labels_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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsGlobalForwardingRuleRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsGlobalForwardingRuleRequest.php new file mode 100644 index 000000000000..7dc14c89c262 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsGlobalForwardingRuleRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest + */ +class SetLabelsGlobalForwardingRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $global_set_labels_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"]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $globalSetLabelsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetLabelsGlobalForwardingRuleRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $globalSetLabelsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $global_set_labels_request_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + 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.GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\GlobalSetLabelsRequest|null + */ + public function getGlobalSetLabelsRequestResource() + { + return $this->global_set_labels_request_resource; + } + + public function hasGlobalSetLabelsRequestResource() + { + return isset($this->global_set_labels_request_resource); + } + + public function clearGlobalSetLabelsRequestResource() + { + unset($this->global_set_labels_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $var + * @return $this + */ + public function setGlobalSetLabelsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\GlobalSetLabelsRequest::class); + $this->global_set_labels_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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsImageRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsImageRequest.php new file mode 100644 index 000000000000..519be6999c13 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsImageRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.SetLabelsImageRequest + */ +class SetLabelsImageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $global_set_labels_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"]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $globalSetLabelsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetLabelsImageRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $globalSetLabelsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $global_set_labels_request_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + 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.GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\GlobalSetLabelsRequest|null + */ + public function getGlobalSetLabelsRequestResource() + { + return $this->global_set_labels_request_resource; + } + + public function hasGlobalSetLabelsRequestResource() + { + return isset($this->global_set_labels_request_resource); + } + + public function clearGlobalSetLabelsRequestResource() + { + unset($this->global_set_labels_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $var + * @return $this + */ + public function setGlobalSetLabelsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\GlobalSetLabelsRequest::class); + $this->global_set_labels_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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsInstanceRequest.php new file mode 100644 index 000000000000..bc70186b2caf --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsInstanceRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetLabelsInstanceRequest + */ +class SetLabelsInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstancesSetLabelsRequest instances_set_labels_request_resource = 207749344 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instances_set_labels_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance scoping this request. + * @param \Google\Cloud\Compute\V1\InstancesSetLabelsRequest $instancesSetLabelsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetLabelsInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, \Google\Cloud\Compute\V1\InstancesSetLabelsRequest $instancesSetLabelsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setInstancesSetLabelsRequestResource($instancesSetLabelsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name of the instance scoping this request. + * @type \Google\Cloud\Compute\V1\InstancesSetLabelsRequest $instances_set_labels_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); + } + + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance scoping 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.InstancesSetLabelsRequest instances_set_labels_request_resource = 207749344 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstancesSetLabelsRequest|null + */ + public function getInstancesSetLabelsRequestResource() + { + return $this->instances_set_labels_request_resource; + } + + public function hasInstancesSetLabelsRequestResource() + { + return isset($this->instances_set_labels_request_resource); + } + + public function clearInstancesSetLabelsRequestResource() + { + unset($this->instances_set_labels_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstancesSetLabelsRequest instances_set_labels_request_resource = 207749344 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstancesSetLabelsRequest $var + * @return $this + */ + public function setInstancesSetLabelsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstancesSetLabelsRequest::class); + $this->instances_set_labels_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsInstantSnapshotRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsInstantSnapshotRequest.php new file mode 100644 index 000000000000..ccfe551025cf --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsInstantSnapshotRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetLabelsInstantSnapshotRequest + */ +class SetLabelsInstantSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * 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"]; + */ + protected $zone = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetLabelsRequest zone_set_labels_request_resource = 364950798 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone_set_labels_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\ZoneSetLabelsRequest $zoneSetLabelsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetLabelsInstantSnapshotRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $resource, \Google\Cloud\Compute\V1\ZoneSetLabelsRequest $zoneSetLabelsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setResource($resource) + ->setZoneSetLabelsRequestResource($zoneSetLabelsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $resource + * Name or id of the resource for this request. + * @type string $zone + * The name of the zone for this request. + * @type \Google\Cloud\Compute\V1\ZoneSetLabelsRequest $zone_set_labels_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetLabelsRequest zone_set_labels_request_resource = 364950798 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ZoneSetLabelsRequest|null + */ + public function getZoneSetLabelsRequestResource() + { + return $this->zone_set_labels_request_resource; + } + + public function hasZoneSetLabelsRequestResource() + { + return isset($this->zone_set_labels_request_resource); + } + + public function clearZoneSetLabelsRequestResource() + { + unset($this->zone_set_labels_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ZoneSetLabelsRequest zone_set_labels_request_resource = 364950798 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ZoneSetLabelsRequest $var + * @return $this + */ + public function setZoneSetLabelsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ZoneSetLabelsRequest::class); + $this->zone_set_labels_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsInterconnectAttachmentRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsInterconnectAttachmentRequest.php new file mode 100644 index 000000000000..0b8aa5b2f851 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsInterconnectAttachmentRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetLabelsInterconnectAttachmentRequest + */ +class SetLabelsInterconnectAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_set_labels_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\RegionSetLabelsRequest $regionSetLabelsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetLabelsInterconnectAttachmentRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\RegionSetLabelsRequest $regionSetLabelsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The region for this request. + * @type \Google\Cloud\Compute\V1\RegionSetLabelsRequest $region_set_labels_request_resource + * The body resource 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 $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 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 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionSetLabelsRequest|null + */ + public function getRegionSetLabelsRequestResource() + { + return $this->region_set_labels_request_resource; + } + + public function hasRegionSetLabelsRequestResource() + { + return isset($this->region_set_labels_request_resource); + } + + public function clearRegionSetLabelsRequestResource() + { + unset($this->region_set_labels_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionSetLabelsRequest $var + * @return $this + */ + public function setRegionSetLabelsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionSetLabelsRequest::class); + $this->region_set_labels_request_resource = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsInterconnectRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsInterconnectRequest.php new file mode 100644 index 000000000000..d342dc95307e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsInterconnectRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.SetLabelsInterconnectRequest + */ +class SetLabelsInterconnectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $global_set_labels_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"]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $globalSetLabelsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetLabelsInterconnectRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $globalSetLabelsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $global_set_labels_request_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + 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.GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\GlobalSetLabelsRequest|null + */ + public function getGlobalSetLabelsRequestResource() + { + return $this->global_set_labels_request_resource; + } + + public function hasGlobalSetLabelsRequestResource() + { + return isset($this->global_set_labels_request_resource); + } + + public function clearGlobalSetLabelsRequestResource() + { + unset($this->global_set_labels_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $var + * @return $this + */ + public function setGlobalSetLabelsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\GlobalSetLabelsRequest::class); + $this->global_set_labels_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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsRegionDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsRegionDiskRequest.php new file mode 100644 index 000000000000..a9af4a5a239e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsRegionDiskRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetLabelsRegionDiskRequest + */ +class SetLabelsRegionDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_set_labels_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\RegionSetLabelsRequest $regionSetLabelsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetLabelsRegionDiskRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\RegionSetLabelsRequest $regionSetLabelsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The region for this request. + * @type \Google\Cloud\Compute\V1\RegionSetLabelsRequest $region_set_labels_request_resource + * The body resource 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 $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 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 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionSetLabelsRequest|null + */ + public function getRegionSetLabelsRequestResource() + { + return $this->region_set_labels_request_resource; + } + + public function hasRegionSetLabelsRequestResource() + { + return isset($this->region_set_labels_request_resource); + } + + public function clearRegionSetLabelsRequestResource() + { + unset($this->region_set_labels_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionSetLabelsRequest $var + * @return $this + */ + public function setRegionSetLabelsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionSetLabelsRequest::class); + $this->region_set_labels_request_resource = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsRegionInstantSnapshotRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsRegionInstantSnapshotRequest.php new file mode 100644 index 000000000000..f3317199bfd0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsRegionInstantSnapshotRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetLabelsRegionInstantSnapshotRequest + */ +class SetLabelsRegionInstantSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_set_labels_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\RegionSetLabelsRequest $regionSetLabelsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetLabelsRegionInstantSnapshotRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\RegionSetLabelsRequest $regionSetLabelsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The region for this request. + * @type \Google\Cloud\Compute\V1\RegionSetLabelsRequest $region_set_labels_request_resource + * The body resource 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 $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 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 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionSetLabelsRequest|null + */ + public function getRegionSetLabelsRequestResource() + { + return $this->region_set_labels_request_resource; + } + + public function hasRegionSetLabelsRequestResource() + { + return isset($this->region_set_labels_request_resource); + } + + public function clearRegionSetLabelsRequestResource() + { + unset($this->region_set_labels_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionSetLabelsRequest $var + * @return $this + */ + public function setRegionSetLabelsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionSetLabelsRequest::class); + $this->region_set_labels_request_resource = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsSecurityPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsSecurityPolicyRequest.php new file mode 100644 index 000000000000..7a2a144f62ec --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsSecurityPolicyRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.SetLabelsSecurityPolicyRequest + */ +class SetLabelsSecurityPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $global_set_labels_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"]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $globalSetLabelsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetLabelsSecurityPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $globalSetLabelsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $global_set_labels_request_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + 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.GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\GlobalSetLabelsRequest|null + */ + public function getGlobalSetLabelsRequestResource() + { + return $this->global_set_labels_request_resource; + } + + public function hasGlobalSetLabelsRequestResource() + { + return isset($this->global_set_labels_request_resource); + } + + public function clearGlobalSetLabelsRequestResource() + { + unset($this->global_set_labels_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $var + * @return $this + */ + public function setGlobalSetLabelsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\GlobalSetLabelsRequest::class); + $this->global_set_labels_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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsSnapshotRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsSnapshotRequest.php new file mode 100644 index 000000000000..7c1ed2a4089e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsSnapshotRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.SetLabelsSnapshotRequest + */ +class SetLabelsSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $global_set_labels_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"]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $globalSetLabelsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetLabelsSnapshotRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $globalSetLabelsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $global_set_labels_request_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * } + */ + 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.GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\GlobalSetLabelsRequest|null + */ + public function getGlobalSetLabelsRequestResource() + { + return $this->global_set_labels_request_resource; + } + + public function hasGlobalSetLabelsRequestResource() + { + return isset($this->global_set_labels_request_resource); + } + + public function clearGlobalSetLabelsRequestResource() + { + unset($this->global_set_labels_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\GlobalSetLabelsRequest $var + * @return $this + */ + public function setGlobalSetLabelsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\GlobalSetLabelsRequest::class); + $this->global_set_labels_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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsTargetVpnGatewayRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsTargetVpnGatewayRequest.php new file mode 100644 index 000000000000..ee0d4585d29a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsTargetVpnGatewayRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetLabelsTargetVpnGatewayRequest + */ +class SetLabelsTargetVpnGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_set_labels_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\RegionSetLabelsRequest $regionSetLabelsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetLabelsTargetVpnGatewayRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\RegionSetLabelsRequest $regionSetLabelsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The region for this request. + * @type \Google\Cloud\Compute\V1\RegionSetLabelsRequest $region_set_labels_request_resource + * The body resource 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 $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 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 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionSetLabelsRequest|null + */ + public function getRegionSetLabelsRequestResource() + { + return $this->region_set_labels_request_resource; + } + + public function hasRegionSetLabelsRequestResource() + { + return isset($this->region_set_labels_request_resource); + } + + public function clearRegionSetLabelsRequestResource() + { + unset($this->region_set_labels_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionSetLabelsRequest $var + * @return $this + */ + public function setRegionSetLabelsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionSetLabelsRequest::class); + $this->region_set_labels_request_resource = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsVpnGatewayRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsVpnGatewayRequest.php new file mode 100644 index 000000000000..cffb7feacc24 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsVpnGatewayRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetLabelsVpnGatewayRequest + */ +class SetLabelsVpnGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_set_labels_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\RegionSetLabelsRequest $regionSetLabelsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetLabelsVpnGatewayRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\RegionSetLabelsRequest $regionSetLabelsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The region for this request. + * @type \Google\Cloud\Compute\V1\RegionSetLabelsRequest $region_set_labels_request_resource + * The body resource 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 $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 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 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionSetLabelsRequest|null + */ + public function getRegionSetLabelsRequestResource() + { + return $this->region_set_labels_request_resource; + } + + public function hasRegionSetLabelsRequestResource() + { + return isset($this->region_set_labels_request_resource); + } + + public function clearRegionSetLabelsRequestResource() + { + unset($this->region_set_labels_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionSetLabelsRequest $var + * @return $this + */ + public function setRegionSetLabelsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionSetLabelsRequest::class); + $this->region_set_labels_request_resource = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsVpnTunnelRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsVpnTunnelRequest.php new file mode 100644 index 000000000000..980a2df715e4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsVpnTunnelRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetLabelsVpnTunnelRequest + */ +class SetLabelsVpnTunnelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_set_labels_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region The region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\RegionSetLabelsRequest $regionSetLabelsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetLabelsVpnTunnelRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\RegionSetLabelsRequest $regionSetLabelsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The region for this request. + * @type \Google\Cloud\Compute\V1\RegionSetLabelsRequest $region_set_labels_request_resource + * The body resource 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 $resource + * Name or id of the resource for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 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 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionSetLabelsRequest|null + */ + public function getRegionSetLabelsRequestResource() + { + return $this->region_set_labels_request_resource; + } + + public function hasRegionSetLabelsRequestResource() + { + return isset($this->region_set_labels_request_resource); + } + + public function clearRegionSetLabelsRequestResource() + { + unset($this->region_set_labels_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionSetLabelsRequest $var + * @return $this + */ + public function setRegionSetLabelsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionSetLabelsRequest::class); + $this->region_set_labels_request_resource = $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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetMachineResourcesInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetMachineResourcesInstanceRequest.php new file mode 100644 index 000000000000..557ed2176874 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetMachineResourcesInstanceRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetMachineResourcesInstanceRequest + */ +class SetMachineResourcesInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstancesSetMachineResourcesRequest instances_set_machine_resources_request_resource = 196286318 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instances_set_machine_resources_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance scoping this request. + * @param \Google\Cloud\Compute\V1\InstancesSetMachineResourcesRequest $instancesSetMachineResourcesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetMachineResourcesInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, \Google\Cloud\Compute\V1\InstancesSetMachineResourcesRequest $instancesSetMachineResourcesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setInstancesSetMachineResourcesRequestResource($instancesSetMachineResourcesRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name of the instance scoping this request. + * @type \Google\Cloud\Compute\V1\InstancesSetMachineResourcesRequest $instances_set_machine_resources_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); + } + + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance scoping 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.InstancesSetMachineResourcesRequest instances_set_machine_resources_request_resource = 196286318 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstancesSetMachineResourcesRequest|null + */ + public function getInstancesSetMachineResourcesRequestResource() + { + return $this->instances_set_machine_resources_request_resource; + } + + public function hasInstancesSetMachineResourcesRequestResource() + { + return isset($this->instances_set_machine_resources_request_resource); + } + + public function clearInstancesSetMachineResourcesRequestResource() + { + unset($this->instances_set_machine_resources_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstancesSetMachineResourcesRequest instances_set_machine_resources_request_resource = 196286318 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstancesSetMachineResourcesRequest $var + * @return $this + */ + public function setInstancesSetMachineResourcesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstancesSetMachineResourcesRequest::class); + $this->instances_set_machine_resources_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetMachineTypeInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetMachineTypeInstanceRequest.php new file mode 100644 index 000000000000..b8cd1141e994 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetMachineTypeInstanceRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetMachineTypeInstanceRequest + */ +class SetMachineTypeInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstancesSetMachineTypeRequest instances_set_machine_type_request_resource = 254157709 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instances_set_machine_type_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance scoping this request. + * @param \Google\Cloud\Compute\V1\InstancesSetMachineTypeRequest $instancesSetMachineTypeRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetMachineTypeInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, \Google\Cloud\Compute\V1\InstancesSetMachineTypeRequest $instancesSetMachineTypeRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setInstancesSetMachineTypeRequestResource($instancesSetMachineTypeRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name of the instance scoping this request. + * @type \Google\Cloud\Compute\V1\InstancesSetMachineTypeRequest $instances_set_machine_type_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); + } + + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance scoping 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.InstancesSetMachineTypeRequest instances_set_machine_type_request_resource = 254157709 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstancesSetMachineTypeRequest|null + */ + public function getInstancesSetMachineTypeRequestResource() + { + return $this->instances_set_machine_type_request_resource; + } + + public function hasInstancesSetMachineTypeRequestResource() + { + return isset($this->instances_set_machine_type_request_resource); + } + + public function clearInstancesSetMachineTypeRequestResource() + { + unset($this->instances_set_machine_type_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstancesSetMachineTypeRequest instances_set_machine_type_request_resource = 254157709 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstancesSetMachineTypeRequest $var + * @return $this + */ + public function setInstancesSetMachineTypeRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstancesSetMachineTypeRequest::class); + $this->instances_set_machine_type_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetMetadataInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetMetadataInstanceRequest.php new file mode 100644 index 000000000000..503e741d9a96 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetMetadataInstanceRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetMetadataInstanceRequest + */ +class SetMetadataInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Metadata metadata_resource = 291086110 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $metadata_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance scoping this request. + * @param \Google\Cloud\Compute\V1\Metadata $metadataResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetMetadataInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, \Google\Cloud\Compute\V1\Metadata $metadataResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setMetadataResource($metadataResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name of the instance scoping this request. + * @type \Google\Cloud\Compute\V1\Metadata $metadata_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); + } + + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance scoping 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.Metadata metadata_resource = 291086110 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Metadata|null + */ + public function getMetadataResource() + { + return $this->metadata_resource; + } + + public function hasMetadataResource() + { + return isset($this->metadata_resource); + } + + public function clearMetadataResource() + { + unset($this->metadata_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Metadata metadata_resource = 291086110 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Metadata $var + * @return $this + */ + public function setMetadataResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Metadata::class); + $this->metadata_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetMinCpuPlatformInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetMinCpuPlatformInstanceRequest.php new file mode 100644 index 000000000000..f4c67ce76ea1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetMinCpuPlatformInstanceRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest + */ +class SetMinCpuPlatformInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest instances_set_min_cpu_platform_request_resource = 148459368 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instances_set_min_cpu_platform_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance scoping this request. + * @param \Google\Cloud\Compute\V1\InstancesSetMinCpuPlatformRequest $instancesSetMinCpuPlatformRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetMinCpuPlatformInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, \Google\Cloud\Compute\V1\InstancesSetMinCpuPlatformRequest $instancesSetMinCpuPlatformRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setInstancesSetMinCpuPlatformRequestResource($instancesSetMinCpuPlatformRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name of the instance scoping this request. + * @type \Google\Cloud\Compute\V1\InstancesSetMinCpuPlatformRequest $instances_set_min_cpu_platform_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); + } + + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance scoping 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.InstancesSetMinCpuPlatformRequest instances_set_min_cpu_platform_request_resource = 148459368 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstancesSetMinCpuPlatformRequest|null + */ + public function getInstancesSetMinCpuPlatformRequestResource() + { + return $this->instances_set_min_cpu_platform_request_resource; + } + + public function hasInstancesSetMinCpuPlatformRequestResource() + { + return isset($this->instances_set_min_cpu_platform_request_resource); + } + + public function clearInstancesSetMinCpuPlatformRequestResource() + { + unset($this->instances_set_min_cpu_platform_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest instances_set_min_cpu_platform_request_resource = 148459368 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstancesSetMinCpuPlatformRequest $var + * @return $this + */ + public function setInstancesSetMinCpuPlatformRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstancesSetMinCpuPlatformRequest::class); + $this->instances_set_min_cpu_platform_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetNameInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetNameInstanceRequest.php new file mode 100644 index 000000000000..9817ad22a65c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetNameInstanceRequest.php @@ -0,0 +1,242 @@ +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]; + */ + protected $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]; + */ + protected $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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance The instance name for this request. + * @param \Google\Cloud\Compute\V1\InstancesSetNameRequest $instancesSetNameRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetNameInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, \Google\Cloud\Compute\V1\InstancesSetNameRequest $instancesSetNameRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setInstancesSetNameRequestResource($instancesSetNameRequestResource); + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetNamedPortsInstanceGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetNamedPortsInstanceGroupRequest.php new file mode 100644 index 000000000000..2871f2bd7132 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetNamedPortsInstanceGroupRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest + */ +class SetNamedPortsInstanceGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the instance group where the named ports are updated. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest instance_groups_set_named_ports_request_resource = 385151535 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_groups_set_named_ports_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the zone where the instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the instance group is located. + * @param string $instanceGroup The name of the instance group where the named ports are updated. + * @param \Google\Cloud\Compute\V1\InstanceGroupsSetNamedPortsRequest $instanceGroupsSetNamedPortsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetNamedPortsInstanceGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroup, \Google\Cloud\Compute\V1\InstanceGroupsSetNamedPortsRequest $instanceGroupsSetNamedPortsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroup($instanceGroup) + ->setInstanceGroupsSetNamedPortsRequestResource($instanceGroupsSetNamedPortsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group + * The name of the instance group where the named ports are updated. + * @type \Google\Cloud\Compute\V1\InstanceGroupsSetNamedPortsRequest $instance_groups_set_named_ports_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 where the instance group is located. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the instance group where the named ports are updated. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroup() + { + return $this->instance_group; + } + + /** + * The name of the instance group where the named ports are updated. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroup($var) + { + GPBUtil::checkString($var, True); + $this->instance_group = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest instance_groups_set_named_ports_request_resource = 385151535 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupsSetNamedPortsRequest|null + */ + public function getInstanceGroupsSetNamedPortsRequestResource() + { + return $this->instance_groups_set_named_ports_request_resource; + } + + public function hasInstanceGroupsSetNamedPortsRequestResource() + { + return isset($this->instance_groups_set_named_ports_request_resource); + } + + public function clearInstanceGroupsSetNamedPortsRequestResource() + { + unset($this->instance_groups_set_named_ports_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest instance_groups_set_named_ports_request_resource = 385151535 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupsSetNamedPortsRequest $var + * @return $this + */ + public function setInstanceGroupsSetNamedPortsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupsSetNamedPortsRequest::class); + $this->instance_groups_set_named_ports_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 where the instance group is located. + * + * 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 where the instance group is located. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetNamedPortsRegionInstanceGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetNamedPortsRegionInstanceGroupRequest.php new file mode 100644 index 000000000000..b10aa0c00f96 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetNamedPortsRegionInstanceGroupRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest + */ +class SetNamedPortsRegionInstanceGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the regional instance group where the named ports are updated. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest region_instance_groups_set_named_ports_request_resource = 1574938 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_instance_groups_set_named_ports_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $instanceGroup The name of the regional instance group where the named ports are updated. + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupsSetNamedPortsRequest $regionInstanceGroupsSetNamedPortsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetNamedPortsRegionInstanceGroupRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroup, \Google\Cloud\Compute\V1\RegionInstanceGroupsSetNamedPortsRequest $regionInstanceGroupsSetNamedPortsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroup($instanceGroup) + ->setRegionInstanceGroupsSetNamedPortsRequestResource($regionInstanceGroupsSetNamedPortsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group + * The name of the regional instance group where the named ports are updated. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type \Google\Cloud\Compute\V1\RegionInstanceGroupsSetNamedPortsRequest $region_instance_groups_set_named_ports_request_resource + * The body resource 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 regional instance group where the named ports are updated. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroup() + { + return $this->instance_group; + } + + /** + * The name of the regional instance group where the named ports are updated. + * + * Generated from protobuf field string instance_group = 81095253 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroup($var) + { + GPBUtil::checkString($var, True); + $this->instance_group = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest region_instance_groups_set_named_ports_request_resource = 1574938 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionInstanceGroupsSetNamedPortsRequest|null + */ + public function getRegionInstanceGroupsSetNamedPortsRequestResource() + { + return $this->region_instance_groups_set_named_ports_request_resource; + } + + public function hasRegionInstanceGroupsSetNamedPortsRequestResource() + { + return isset($this->region_instance_groups_set_named_ports_request_resource); + } + + public function clearRegionInstanceGroupsSetNamedPortsRequestResource() + { + unset($this->region_instance_groups_set_named_ports_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest region_instance_groups_set_named_ports_request_resource = 1574938 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupsSetNamedPortsRequest $var + * @return $this + */ + public function setRegionInstanceGroupsSetNamedPortsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionInstanceGroupsSetNamedPortsRequest::class); + $this->region_instance_groups_set_named_ports_request_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetNodeTemplateNodeGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetNodeTemplateNodeGroupRequest.php new file mode 100644 index 000000000000..25178cd04561 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetNodeTemplateNodeGroupRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest + */ +class SetNodeTemplateNodeGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the NodeGroup resource to update. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $node_group = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest node_groups_set_node_template_request_resource = 117382321 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $node_groups_set_node_template_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $nodeGroup Name of the NodeGroup resource to update. + * @param \Google\Cloud\Compute\V1\NodeGroupsSetNodeTemplateRequest $nodeGroupsSetNodeTemplateRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetNodeTemplateNodeGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $nodeGroup, \Google\Cloud\Compute\V1\NodeGroupsSetNodeTemplateRequest $nodeGroupsSetNodeTemplateRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setNodeGroup($nodeGroup) + ->setNodeGroupsSetNodeTemplateRequestResource($nodeGroupsSetNodeTemplateRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $node_group + * Name of the NodeGroup resource to update. + * @type \Google\Cloud\Compute\V1\NodeGroupsSetNodeTemplateRequest $node_groups_set_node_template_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); + } + + /** + * Name of the NodeGroup resource to update. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNodeGroup() + { + return $this->node_group; + } + + /** + * Name of the NodeGroup resource to update. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNodeGroup($var) + { + GPBUtil::checkString($var, True); + $this->node_group = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest node_groups_set_node_template_request_resource = 117382321 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NodeGroupsSetNodeTemplateRequest|null + */ + public function getNodeGroupsSetNodeTemplateRequestResource() + { + return $this->node_groups_set_node_template_request_resource; + } + + public function hasNodeGroupsSetNodeTemplateRequestResource() + { + return isset($this->node_groups_set_node_template_request_resource); + } + + public function clearNodeGroupsSetNodeTemplateRequestResource() + { + unset($this->node_groups_set_node_template_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest node_groups_set_node_template_request_resource = 117382321 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NodeGroupsSetNodeTemplateRequest $var + * @return $this + */ + public function setNodeGroupsSetNodeTemplateRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NodeGroupsSetNodeTemplateRequest::class); + $this->node_groups_set_node_template_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetPrivateIpGoogleAccessSubnetworkRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetPrivateIpGoogleAccessSubnetworkRequest.php new file mode 100644 index 000000000000..ba10d41e4808 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetPrivateIpGoogleAccessSubnetworkRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest + */ +class SetPrivateIpGoogleAccessSubnetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the Subnetwork resource. + * + * Generated from protobuf field string subnetwork = 307827694 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $subnetwork = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest subnetworks_set_private_ip_google_access_request_resource = 268920696 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $subnetworks_set_private_ip_google_access_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $subnetwork Name of the Subnetwork resource. + * @param \Google\Cloud\Compute\V1\SubnetworksSetPrivateIpGoogleAccessRequest $subnetworksSetPrivateIpGoogleAccessRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetPrivateIpGoogleAccessSubnetworkRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $subnetwork, \Google\Cloud\Compute\V1\SubnetworksSetPrivateIpGoogleAccessRequest $subnetworksSetPrivateIpGoogleAccessRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork) + ->setSubnetworksSetPrivateIpGoogleAccessRequestResource($subnetworksSetPrivateIpGoogleAccessRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 $subnetwork + * Name of the Subnetwork resource. + * @type \Google\Cloud\Compute\V1\SubnetworksSetPrivateIpGoogleAccessRequest $subnetworks_set_private_ip_google_access_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the Subnetwork resource. + * + * Generated from protobuf field string subnetwork = 307827694 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getSubnetwork() + { + return $this->subnetwork; + } + + /** + * Name of the Subnetwork resource. + * + * Generated from protobuf field string subnetwork = 307827694 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest subnetworks_set_private_ip_google_access_request_resource = 268920696 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SubnetworksSetPrivateIpGoogleAccessRequest|null + */ + public function getSubnetworksSetPrivateIpGoogleAccessRequestResource() + { + return $this->subnetworks_set_private_ip_google_access_request_resource; + } + + public function hasSubnetworksSetPrivateIpGoogleAccessRequestResource() + { + return isset($this->subnetworks_set_private_ip_google_access_request_resource); + } + + public function clearSubnetworksSetPrivateIpGoogleAccessRequestResource() + { + unset($this->subnetworks_set_private_ip_google_access_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest subnetworks_set_private_ip_google_access_request_resource = 268920696 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SubnetworksSetPrivateIpGoogleAccessRequest $var + * @return $this + */ + public function setSubnetworksSetPrivateIpGoogleAccessRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SubnetworksSetPrivateIpGoogleAccessRequest::class); + $this->subnetworks_set_private_ip_google_access_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetProxyHeaderTargetSslProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetProxyHeaderTargetSslProxyRequest.php new file mode 100644 index 000000000000..3bfab1f2bb3e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetProxyHeaderTargetSslProxyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest + */ +class SetProxyHeaderTargetSslProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest target_ssl_proxies_set_proxy_header_request_resource = 205284526 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_ssl_proxies_set_proxy_header_request_resource = null; + /** + * Name of the TargetSslProxy resource whose ProxyHeader is to be set. + * + * Generated from protobuf field string target_ssl_proxy = 338795853 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_ssl_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $targetSslProxy Name of the TargetSslProxy resource whose ProxyHeader is to be set. + * @param \Google\Cloud\Compute\V1\TargetSslProxiesSetProxyHeaderRequest $targetSslProxiesSetProxyHeaderRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetProxyHeaderTargetSslProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetSslProxy, \Google\Cloud\Compute\V1\TargetSslProxiesSetProxyHeaderRequest $targetSslProxiesSetProxyHeaderRequestResource): self + { + return (new self()) + ->setProject($project) + ->setTargetSslProxy($targetSslProxy) + ->setTargetSslProxiesSetProxyHeaderRequestResource($targetSslProxiesSetProxyHeaderRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\TargetSslProxiesSetProxyHeaderRequest $target_ssl_proxies_set_proxy_header_request_resource + * The body resource for this request + * @type string $target_ssl_proxy + * Name of the TargetSslProxy resource whose ProxyHeader is to be set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest target_ssl_proxies_set_proxy_header_request_resource = 205284526 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetSslProxiesSetProxyHeaderRequest|null + */ + public function getTargetSslProxiesSetProxyHeaderRequestResource() + { + return $this->target_ssl_proxies_set_proxy_header_request_resource; + } + + public function hasTargetSslProxiesSetProxyHeaderRequestResource() + { + return isset($this->target_ssl_proxies_set_proxy_header_request_resource); + } + + public function clearTargetSslProxiesSetProxyHeaderRequestResource() + { + unset($this->target_ssl_proxies_set_proxy_header_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest target_ssl_proxies_set_proxy_header_request_resource = 205284526 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetSslProxiesSetProxyHeaderRequest $var + * @return $this + */ + public function setTargetSslProxiesSetProxyHeaderRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetSslProxiesSetProxyHeaderRequest::class); + $this->target_ssl_proxies_set_proxy_header_request_resource = $var; + + return $this; + } + + /** + * Name of the TargetSslProxy resource whose ProxyHeader is to be set. + * + * Generated from protobuf field string target_ssl_proxy = 338795853 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetSslProxy() + { + return $this->target_ssl_proxy; + } + + /** + * Name of the TargetSslProxy resource whose ProxyHeader is to be set. + * + * Generated from protobuf field string target_ssl_proxy = 338795853 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetSslProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_ssl_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetProxyHeaderTargetTcpProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetProxyHeaderTargetTcpProxyRequest.php new file mode 100644 index 000000000000..6ba4edd03a63 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetProxyHeaderTargetTcpProxyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest + */ +class SetProxyHeaderTargetTcpProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest target_tcp_proxies_set_proxy_header_request_resource = 219958339 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_tcp_proxies_set_proxy_header_request_resource = null; + /** + * Name of the TargetTcpProxy resource whose ProxyHeader is to be set. + * + * Generated from protobuf field string target_tcp_proxy = 503065442 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_tcp_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $targetTcpProxy Name of the TargetTcpProxy resource whose ProxyHeader is to be set. + * @param \Google\Cloud\Compute\V1\TargetTcpProxiesSetProxyHeaderRequest $targetTcpProxiesSetProxyHeaderRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetProxyHeaderTargetTcpProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetTcpProxy, \Google\Cloud\Compute\V1\TargetTcpProxiesSetProxyHeaderRequest $targetTcpProxiesSetProxyHeaderRequestResource): self + { + return (new self()) + ->setProject($project) + ->setTargetTcpProxy($targetTcpProxy) + ->setTargetTcpProxiesSetProxyHeaderRequestResource($targetTcpProxiesSetProxyHeaderRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\TargetTcpProxiesSetProxyHeaderRequest $target_tcp_proxies_set_proxy_header_request_resource + * The body resource for this request + * @type string $target_tcp_proxy + * Name of the TargetTcpProxy resource whose ProxyHeader is to be set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest target_tcp_proxies_set_proxy_header_request_resource = 219958339 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetTcpProxiesSetProxyHeaderRequest|null + */ + public function getTargetTcpProxiesSetProxyHeaderRequestResource() + { + return $this->target_tcp_proxies_set_proxy_header_request_resource; + } + + public function hasTargetTcpProxiesSetProxyHeaderRequestResource() + { + return isset($this->target_tcp_proxies_set_proxy_header_request_resource); + } + + public function clearTargetTcpProxiesSetProxyHeaderRequestResource() + { + unset($this->target_tcp_proxies_set_proxy_header_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest target_tcp_proxies_set_proxy_header_request_resource = 219958339 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetTcpProxiesSetProxyHeaderRequest $var + * @return $this + */ + public function setTargetTcpProxiesSetProxyHeaderRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetTcpProxiesSetProxyHeaderRequest::class); + $this->target_tcp_proxies_set_proxy_header_request_resource = $var; + + return $this; + } + + /** + * Name of the TargetTcpProxy resource whose ProxyHeader is to be set. + * + * Generated from protobuf field string target_tcp_proxy = 503065442 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetTcpProxy() + { + return $this->target_tcp_proxy; + } + + /** + * Name of the TargetTcpProxy resource whose ProxyHeader is to be set. + * + * Generated from protobuf field string target_tcp_proxy = 503065442 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetTcpProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_tcp_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetQuicOverrideTargetHttpsProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetQuicOverrideTargetHttpsProxyRequest.php new file mode 100644 index 000000000000..981809ab40f2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetQuicOverrideTargetHttpsProxyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest + */ +class SetQuicOverrideTargetHttpsProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest target_https_proxies_set_quic_override_request_resource = 72940258 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_https_proxies_set_quic_override_request_resource = null; + /** + * Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_https_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035. + * @param \Google\Cloud\Compute\V1\TargetHttpsProxiesSetQuicOverrideRequest $targetHttpsProxiesSetQuicOverrideRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetQuicOverrideTargetHttpsProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetHttpsProxy, \Google\Cloud\Compute\V1\TargetHttpsProxiesSetQuicOverrideRequest $targetHttpsProxiesSetQuicOverrideRequestResource): self + { + return (new self()) + ->setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setTargetHttpsProxiesSetQuicOverrideRequestResource($targetHttpsProxiesSetQuicOverrideRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\TargetHttpsProxiesSetQuicOverrideRequest $target_https_proxies_set_quic_override_request_resource + * The body resource for this request + * @type string $target_https_proxy + * Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest target_https_proxies_set_quic_override_request_resource = 72940258 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetHttpsProxiesSetQuicOverrideRequest|null + */ + public function getTargetHttpsProxiesSetQuicOverrideRequestResource() + { + return $this->target_https_proxies_set_quic_override_request_resource; + } + + public function hasTargetHttpsProxiesSetQuicOverrideRequestResource() + { + return isset($this->target_https_proxies_set_quic_override_request_resource); + } + + public function clearTargetHttpsProxiesSetQuicOverrideRequestResource() + { + unset($this->target_https_proxies_set_quic_override_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest target_https_proxies_set_quic_override_request_resource = 72940258 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetHttpsProxiesSetQuicOverrideRequest $var + * @return $this + */ + public function setTargetHttpsProxiesSetQuicOverrideRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetHttpsProxiesSetQuicOverrideRequest::class); + $this->target_https_proxies_set_quic_override_request_resource = $var; + + return $this; + } + + /** + * Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetHttpsProxy() + { + return $this->target_https_proxy; + } + + /** + * Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetHttpsProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_https_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSchedulingInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSchedulingInstanceRequest.php new file mode 100644 index 000000000000..1c812ffed357 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSchedulingInstanceRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetSchedulingInstanceRequest + */ +class SetSchedulingInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Instance name for this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Scheduling scheduling_resource = 463181401 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $scheduling_resource = 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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Instance name for this request. + * @param \Google\Cloud\Compute\V1\Scheduling $schedulingResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetSchedulingInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, \Google\Cloud\Compute\V1\Scheduling $schedulingResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setSchedulingResource($schedulingResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Instance name 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 \Google\Cloud\Compute\V1\Scheduling $scheduling_resource + * The body resource for 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); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Scheduling scheduling_resource = 463181401 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Scheduling|null + */ + public function getSchedulingResource() + { + return $this->scheduling_resource; + } + + public function hasSchedulingResource() + { + return isset($this->scheduling_resource); + } + + public function clearSchedulingResource() + { + unset($this->scheduling_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Scheduling scheduling_resource = 463181401 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Scheduling $var + * @return $this + */ + public function setSchedulingResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Scheduling::class); + $this->scheduling_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSecurityPolicyBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSecurityPolicyBackendServiceRequest.php new file mode 100644 index 000000000000..6aa0bb298999 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSecurityPolicyBackendServiceRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest + */ +class SetSecurityPolicyBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_service = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyReference security_policy_reference_resource = 204135024 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy_reference_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $backendService Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. + * @param \Google\Cloud\Compute\V1\SecurityPolicyReference $securityPolicyReferenceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetSecurityPolicyBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, string $backendService, \Google\Cloud\Compute\V1\SecurityPolicyReference $securityPolicyReferenceResource): self + { + return (new self()) + ->setProject($project) + ->setBackendService($backendService) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_service + * Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. + * @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 \Google\Cloud\Compute\V1\SecurityPolicyReference $security_policy_reference_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackendService() + { + return $this->backend_service; + } + + /** + * Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackendService($var) + { + GPBUtil::checkString($var, True); + $this->backend_service = $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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyReference security_policy_reference_resource = 204135024 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SecurityPolicyReference|null + */ + public function getSecurityPolicyReferenceResource() + { + return $this->security_policy_reference_resource; + } + + public function hasSecurityPolicyReferenceResource() + { + return isset($this->security_policy_reference_resource); + } + + public function clearSecurityPolicyReferenceResource() + { + unset($this->security_policy_reference_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyReference security_policy_reference_resource = 204135024 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SecurityPolicyReference $var + * @return $this + */ + public function setSecurityPolicyReferenceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyReference::class); + $this->security_policy_reference_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSecurityPolicyInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSecurityPolicyInstanceRequest.php new file mode 100644 index 000000000000..956cf5f3ad69 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSecurityPolicyInstanceRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetSecurityPolicyInstanceRequest + */ +class SetSecurityPolicyInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the Instance resource to which the security policy should be set. The name should conform to RFC1035. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstancesSetSecurityPolicyRequest instances_set_security_policy_request_resource = 248424586 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instances_set_security_policy_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the zone scoping this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone scoping this request. + * @param string $instance Name of the Instance resource to which the security policy should be set. The name should conform to RFC1035. + * @param \Google\Cloud\Compute\V1\InstancesSetSecurityPolicyRequest $instancesSetSecurityPolicyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetSecurityPolicyInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, \Google\Cloud\Compute\V1\InstancesSetSecurityPolicyRequest $instancesSetSecurityPolicyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setInstancesSetSecurityPolicyRequestResource($instancesSetSecurityPolicyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name of the Instance resource to which the security policy should be set. The name should conform to RFC1035. + * @type \Google\Cloud\Compute\V1\InstancesSetSecurityPolicyRequest $instances_set_security_policy_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 + * Name of the zone scoping this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the Instance resource to which the security policy should be set. The name should conform to RFC1035. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the Instance resource to which the security policy should be set. The name should conform to RFC1035. + * + * 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.InstancesSetSecurityPolicyRequest instances_set_security_policy_request_resource = 248424586 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstancesSetSecurityPolicyRequest|null + */ + public function getInstancesSetSecurityPolicyRequestResource() + { + return $this->instances_set_security_policy_request_resource; + } + + public function hasInstancesSetSecurityPolicyRequestResource() + { + return isset($this->instances_set_security_policy_request_resource); + } + + public function clearInstancesSetSecurityPolicyRequestResource() + { + unset($this->instances_set_security_policy_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstancesSetSecurityPolicyRequest instances_set_security_policy_request_resource = 248424586 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstancesSetSecurityPolicyRequest $var + * @return $this + */ + public function setInstancesSetSecurityPolicyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstancesSetSecurityPolicyRequest::class); + $this->instances_set_security_policy_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; + } + + /** + * Name of the zone scoping 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; + } + + /** + * Name of the zone scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSecurityPolicyRegionBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSecurityPolicyRegionBackendServiceRequest.php new file mode 100644 index 000000000000..6e632fbe046c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSecurityPolicyRegionBackendServiceRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetSecurityPolicyRegionBackendServiceRequest + */ +class SetSecurityPolicyRegionBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_service = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyReference security_policy_reference_resource = 204135024 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy_reference_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $backendService Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. + * @param \Google\Cloud\Compute\V1\SecurityPolicyReference $securityPolicyReferenceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetSecurityPolicyRegionBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $backendService, \Google\Cloud\Compute\V1\SecurityPolicyReference $securityPolicyReferenceResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setBackendService($backendService) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_service + * Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 \Google\Cloud\Compute\V1\SecurityPolicyReference $security_policy_reference_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackendService() + { + return $this->backend_service; + } + + /** + * Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackendService($var) + { + GPBUtil::checkString($var, True); + $this->backend_service = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyReference security_policy_reference_resource = 204135024 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SecurityPolicyReference|null + */ + public function getSecurityPolicyReferenceResource() + { + return $this->security_policy_reference_resource; + } + + public function hasSecurityPolicyReferenceResource() + { + return isset($this->security_policy_reference_resource); + } + + public function clearSecurityPolicyReferenceResource() + { + unset($this->security_policy_reference_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyReference security_policy_reference_resource = 204135024 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SecurityPolicyReference $var + * @return $this + */ + public function setSecurityPolicyReferenceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyReference::class); + $this->security_policy_reference_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSecurityPolicyTargetInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSecurityPolicyTargetInstanceRequest.php new file mode 100644 index 000000000000..d58be6cb7c5e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSecurityPolicyTargetInstanceRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetSecurityPolicyTargetInstanceRequest + */ +class SetSecurityPolicyTargetInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyReference security_policy_reference_resource = 204135024 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy_reference_resource = null; + /** + * Name of the TargetInstance resource to which the security policy should be set. The name should conform to RFC1035. + * + * Generated from protobuf field string target_instance = 289769347 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_instance = ''; + /** + * Name of the zone scoping this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone scoping this request. + * @param string $targetInstance Name of the TargetInstance resource to which the security policy should be set. The name should conform to RFC1035. + * @param \Google\Cloud\Compute\V1\SecurityPolicyReference $securityPolicyReferenceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetSecurityPolicyTargetInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $targetInstance, \Google\Cloud\Compute\V1\SecurityPolicyReference $securityPolicyReferenceResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setTargetInstance($targetInstance) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\SecurityPolicyReference $security_policy_reference_resource + * The body resource for this request + * @type string $target_instance + * Name of the TargetInstance resource to which the security policy should be set. The name should conform to RFC1035. + * @type string $zone + * Name of the zone scoping this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyReference security_policy_reference_resource = 204135024 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SecurityPolicyReference|null + */ + public function getSecurityPolicyReferenceResource() + { + return $this->security_policy_reference_resource; + } + + public function hasSecurityPolicyReferenceResource() + { + return isset($this->security_policy_reference_resource); + } + + public function clearSecurityPolicyReferenceResource() + { + unset($this->security_policy_reference_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyReference security_policy_reference_resource = 204135024 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SecurityPolicyReference $var + * @return $this + */ + public function setSecurityPolicyReferenceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyReference::class); + $this->security_policy_reference_resource = $var; + + return $this; + } + + /** + * Name of the TargetInstance resource to which the security policy should be set. The name should conform to RFC1035. + * + * Generated from protobuf field string target_instance = 289769347 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetInstance() + { + return $this->target_instance; + } + + /** + * Name of the TargetInstance resource to which the security policy should be set. The name should conform to RFC1035. + * + * Generated from protobuf field string target_instance = 289769347 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetInstance($var) + { + GPBUtil::checkString($var, True); + $this->target_instance = $var; + + return $this; + } + + /** + * Name of the zone scoping 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; + } + + /** + * Name of the zone scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSecurityPolicyTargetPoolRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSecurityPolicyTargetPoolRequest.php new file mode 100644 index 000000000000..7d406d53c55d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSecurityPolicyTargetPoolRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetSecurityPolicyTargetPoolRequest + */ +class SetSecurityPolicyTargetPoolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyReference security_policy_reference_resource = 204135024 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $security_policy_reference_resource = null; + /** + * Name of the TargetPool resource to which the security policy should be set. The name should conform to RFC1035. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_pool = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetPool Name of the TargetPool resource to which the security policy should be set. The name should conform to RFC1035. + * @param \Google\Cloud\Compute\V1\SecurityPolicyReference $securityPolicyReferenceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetSecurityPolicyTargetPoolRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $targetPool, \Google\Cloud\Compute\V1\SecurityPolicyReference $securityPolicyReferenceResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 \Google\Cloud\Compute\V1\SecurityPolicyReference $security_policy_reference_resource + * The body resource for this request + * @type string $target_pool + * Name of the TargetPool resource to which the security policy should be set. The name should conform to RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyReference security_policy_reference_resource = 204135024 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SecurityPolicyReference|null + */ + public function getSecurityPolicyReferenceResource() + { + return $this->security_policy_reference_resource; + } + + public function hasSecurityPolicyReferenceResource() + { + return isset($this->security_policy_reference_resource); + } + + public function clearSecurityPolicyReferenceResource() + { + unset($this->security_policy_reference_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SecurityPolicyReference security_policy_reference_resource = 204135024 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SecurityPolicyReference $var + * @return $this + */ + public function setSecurityPolicyReferenceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SecurityPolicyReference::class); + $this->security_policy_reference_resource = $var; + + return $this; + } + + /** + * Name of the TargetPool resource to which the security policy should be set. The name should conform to RFC1035. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetPool() + { + return $this->target_pool; + } + + /** + * Name of the TargetPool resource to which the security policy should be set. The name should conform to RFC1035. + * + * Generated from protobuf field string target_pool = 62796298 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetPool($var) + { + GPBUtil::checkString($var, True); + $this->target_pool = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetServiceAccountInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetServiceAccountInstanceRequest.php new file mode 100644 index 000000000000..9db33e84f705 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetServiceAccountInstanceRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetServiceAccountInstanceRequest + */ +class SetServiceAccountInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the instance resource to start. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstancesSetServiceAccountRequest instances_set_service_account_request_resource = 275550008 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instances_set_service_account_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance resource to start. + * @param \Google\Cloud\Compute\V1\InstancesSetServiceAccountRequest $instancesSetServiceAccountRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetServiceAccountInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, \Google\Cloud\Compute\V1\InstancesSetServiceAccountRequest $instancesSetServiceAccountRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setInstancesSetServiceAccountRequestResource($instancesSetServiceAccountRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name of the instance resource to start. + * @type \Google\Cloud\Compute\V1\InstancesSetServiceAccountRequest $instances_set_service_account_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); + } + + /** + * Name of the instance resource to start. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance resource to start. + * + * 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.InstancesSetServiceAccountRequest instances_set_service_account_request_resource = 275550008 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstancesSetServiceAccountRequest|null + */ + public function getInstancesSetServiceAccountRequestResource() + { + return $this->instances_set_service_account_request_resource; + } + + public function hasInstancesSetServiceAccountRequestResource() + { + return isset($this->instances_set_service_account_request_resource); + } + + public function clearInstancesSetServiceAccountRequestResource() + { + unset($this->instances_set_service_account_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstancesSetServiceAccountRequest instances_set_service_account_request_resource = 275550008 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstancesSetServiceAccountRequest $var + * @return $this + */ + public function setInstancesSetServiceAccountRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstancesSetServiceAccountRequest::class); + $this->instances_set_service_account_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetShieldedInstanceIntegrityPolicyInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetShieldedInstanceIntegrityPolicyInstanceRequest.php new file mode 100644 index 000000000000..09e1d294aaee --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetShieldedInstanceIntegrityPolicyInstanceRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest + */ +class SetShieldedInstanceIntegrityPolicyInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name or id of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy shielded_instance_integrity_policy_resource = 409169462 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $shielded_instance_integrity_policy_resource = 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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name or id of the instance scoping this request. + * @param \Google\Cloud\Compute\V1\ShieldedInstanceIntegrityPolicy $shieldedInstanceIntegrityPolicyResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetShieldedInstanceIntegrityPolicyInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, \Google\Cloud\Compute\V1\ShieldedInstanceIntegrityPolicy $shieldedInstanceIntegrityPolicyResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setShieldedInstanceIntegrityPolicyResource($shieldedInstanceIntegrityPolicyResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name or id of the instance scoping 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 \Google\Cloud\Compute\V1\ShieldedInstanceIntegrityPolicy $shielded_instance_integrity_policy_resource + * The body resource for 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); + } + + /** + * Name or id of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name or id of the instance scoping 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; + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy shielded_instance_integrity_policy_resource = 409169462 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ShieldedInstanceIntegrityPolicy|null + */ + public function getShieldedInstanceIntegrityPolicyResource() + { + return $this->shielded_instance_integrity_policy_resource; + } + + public function hasShieldedInstanceIntegrityPolicyResource() + { + return isset($this->shielded_instance_integrity_policy_resource); + } + + public function clearShieldedInstanceIntegrityPolicyResource() + { + unset($this->shielded_instance_integrity_policy_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy shielded_instance_integrity_policy_resource = 409169462 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ShieldedInstanceIntegrityPolicy $var + * @return $this + */ + public function setShieldedInstanceIntegrityPolicyResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ShieldedInstanceIntegrityPolicy::class); + $this->shielded_instance_integrity_policy_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSslCertificatesRegionTargetHttpsProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSslCertificatesRegionTargetHttpsProxyRequest.php new file mode 100644 index 000000000000..76b7906f24c6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSslCertificatesRegionTargetHttpsProxyRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest + */ +class SetSslCertificatesRegionTargetHttpsProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest region_target_https_proxies_set_ssl_certificates_request_resource = 390693383 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_target_https_proxies_set_ssl_certificates_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + /** + * Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_https_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * @param \Google\Cloud\Compute\V1\RegionTargetHttpsProxiesSetSslCertificatesRequest $regionTargetHttpsProxiesSetSslCertificatesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetSslCertificatesRegionTargetHttpsProxyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $targetHttpsProxy, \Google\Cloud\Compute\V1\RegionTargetHttpsProxiesSetSslCertificatesRequest $regionTargetHttpsProxiesSetSslCertificatesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setRegionTargetHttpsProxiesSetSslCertificatesRequestResource($regionTargetHttpsProxiesSetSslCertificatesRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type \Google\Cloud\Compute\V1\RegionTargetHttpsProxiesSetSslCertificatesRequest $region_target_https_proxies_set_ssl_certificates_request_resource + * The body resource 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 $target_https_proxy + * Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest region_target_https_proxies_set_ssl_certificates_request_resource = 390693383 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionTargetHttpsProxiesSetSslCertificatesRequest|null + */ + public function getRegionTargetHttpsProxiesSetSslCertificatesRequestResource() + { + return $this->region_target_https_proxies_set_ssl_certificates_request_resource; + } + + public function hasRegionTargetHttpsProxiesSetSslCertificatesRequestResource() + { + return isset($this->region_target_https_proxies_set_ssl_certificates_request_resource); + } + + public function clearRegionTargetHttpsProxiesSetSslCertificatesRequestResource() + { + unset($this->region_target_https_proxies_set_ssl_certificates_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest region_target_https_proxies_set_ssl_certificates_request_resource = 390693383 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionTargetHttpsProxiesSetSslCertificatesRequest $var + * @return $this + */ + public function setRegionTargetHttpsProxiesSetSslCertificatesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionTargetHttpsProxiesSetSslCertificatesRequest::class); + $this->region_target_https_proxies_set_ssl_certificates_request_resource = $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; + } + + /** + * Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetHttpsProxy() + { + return $this->target_https_proxy; + } + + /** + * Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetHttpsProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_https_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSslCertificatesTargetHttpsProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSslCertificatesTargetHttpsProxyRequest.php new file mode 100644 index 000000000000..ef4ee3d645a5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSslCertificatesTargetHttpsProxyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest + */ +class SetSslCertificatesTargetHttpsProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest target_https_proxies_set_ssl_certificates_request_resource = 223122908 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_https_proxies_set_ssl_certificates_request_resource = null; + /** + * Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_https_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * @param \Google\Cloud\Compute\V1\TargetHttpsProxiesSetSslCertificatesRequest $targetHttpsProxiesSetSslCertificatesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetSslCertificatesTargetHttpsProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetHttpsProxy, \Google\Cloud\Compute\V1\TargetHttpsProxiesSetSslCertificatesRequest $targetHttpsProxiesSetSslCertificatesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setTargetHttpsProxiesSetSslCertificatesRequestResource($targetHttpsProxiesSetSslCertificatesRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\TargetHttpsProxiesSetSslCertificatesRequest $target_https_proxies_set_ssl_certificates_request_resource + * The body resource for this request + * @type string $target_https_proxy + * Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest target_https_proxies_set_ssl_certificates_request_resource = 223122908 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetHttpsProxiesSetSslCertificatesRequest|null + */ + public function getTargetHttpsProxiesSetSslCertificatesRequestResource() + { + return $this->target_https_proxies_set_ssl_certificates_request_resource; + } + + public function hasTargetHttpsProxiesSetSslCertificatesRequestResource() + { + return isset($this->target_https_proxies_set_ssl_certificates_request_resource); + } + + public function clearTargetHttpsProxiesSetSslCertificatesRequestResource() + { + unset($this->target_https_proxies_set_ssl_certificates_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest target_https_proxies_set_ssl_certificates_request_resource = 223122908 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetHttpsProxiesSetSslCertificatesRequest $var + * @return $this + */ + public function setTargetHttpsProxiesSetSslCertificatesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetHttpsProxiesSetSslCertificatesRequest::class); + $this->target_https_proxies_set_ssl_certificates_request_resource = $var; + + return $this; + } + + /** + * Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetHttpsProxy() + { + return $this->target_https_proxy; + } + + /** + * Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetHttpsProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_https_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSslCertificatesTargetSslProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSslCertificatesTargetSslProxyRequest.php new file mode 100644 index 000000000000..d00ba425da87 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSslCertificatesTargetSslProxyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest + */ +class SetSslCertificatesTargetSslProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest target_ssl_proxies_set_ssl_certificates_request_resource = 147940797 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_ssl_proxies_set_ssl_certificates_request_resource = null; + /** + * Name of the TargetSslProxy resource whose SslCertificate resource is to be set. + * + * Generated from protobuf field string target_ssl_proxy = 338795853 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_ssl_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $targetSslProxy Name of the TargetSslProxy resource whose SslCertificate resource is to be set. + * @param \Google\Cloud\Compute\V1\TargetSslProxiesSetSslCertificatesRequest $targetSslProxiesSetSslCertificatesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetSslCertificatesTargetSslProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetSslProxy, \Google\Cloud\Compute\V1\TargetSslProxiesSetSslCertificatesRequest $targetSslProxiesSetSslCertificatesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setTargetSslProxy($targetSslProxy) + ->setTargetSslProxiesSetSslCertificatesRequestResource($targetSslProxiesSetSslCertificatesRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\TargetSslProxiesSetSslCertificatesRequest $target_ssl_proxies_set_ssl_certificates_request_resource + * The body resource for this request + * @type string $target_ssl_proxy + * Name of the TargetSslProxy resource whose SslCertificate resource is to be set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest target_ssl_proxies_set_ssl_certificates_request_resource = 147940797 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetSslProxiesSetSslCertificatesRequest|null + */ + public function getTargetSslProxiesSetSslCertificatesRequestResource() + { + return $this->target_ssl_proxies_set_ssl_certificates_request_resource; + } + + public function hasTargetSslProxiesSetSslCertificatesRequestResource() + { + return isset($this->target_ssl_proxies_set_ssl_certificates_request_resource); + } + + public function clearTargetSslProxiesSetSslCertificatesRequestResource() + { + unset($this->target_ssl_proxies_set_ssl_certificates_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest target_ssl_proxies_set_ssl_certificates_request_resource = 147940797 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetSslProxiesSetSslCertificatesRequest $var + * @return $this + */ + public function setTargetSslProxiesSetSslCertificatesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetSslProxiesSetSslCertificatesRequest::class); + $this->target_ssl_proxies_set_ssl_certificates_request_resource = $var; + + return $this; + } + + /** + * Name of the TargetSslProxy resource whose SslCertificate resource is to be set. + * + * Generated from protobuf field string target_ssl_proxy = 338795853 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetSslProxy() + { + return $this->target_ssl_proxy; + } + + /** + * Name of the TargetSslProxy resource whose SslCertificate resource is to be set. + * + * Generated from protobuf field string target_ssl_proxy = 338795853 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetSslProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_ssl_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSslPolicyTargetHttpsProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSslPolicyTargetHttpsProxyRequest.php new file mode 100644 index 000000000000..60765ce1cc34 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSslPolicyTargetHttpsProxyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest + */ +class SetSslPolicyTargetHttpsProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslPolicyReference ssl_policy_reference_resource = 235403836 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ssl_policy_reference_resource = null; + /** + * Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_https_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * @param \Google\Cloud\Compute\V1\SslPolicyReference $sslPolicyReferenceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetSslPolicyTargetHttpsProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetHttpsProxy, \Google\Cloud\Compute\V1\SslPolicyReference $sslPolicyReferenceResource): self + { + return (new self()) + ->setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setSslPolicyReferenceResource($sslPolicyReferenceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\SslPolicyReference $ssl_policy_reference_resource + * The body resource for this request + * @type string $target_https_proxy + * Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslPolicyReference ssl_policy_reference_resource = 235403836 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SslPolicyReference|null + */ + public function getSslPolicyReferenceResource() + { + return $this->ssl_policy_reference_resource; + } + + public function hasSslPolicyReferenceResource() + { + return isset($this->ssl_policy_reference_resource); + } + + public function clearSslPolicyReferenceResource() + { + unset($this->ssl_policy_reference_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslPolicyReference ssl_policy_reference_resource = 235403836 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SslPolicyReference $var + * @return $this + */ + public function setSslPolicyReferenceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SslPolicyReference::class); + $this->ssl_policy_reference_resource = $var; + + return $this; + } + + /** + * Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetHttpsProxy() + { + return $this->target_https_proxy; + } + + /** + * Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetHttpsProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_https_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSslPolicyTargetSslProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSslPolicyTargetSslProxyRequest.php new file mode 100644 index 000000000000..1d575555eb22 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetSslPolicyTargetSslProxyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest + */ +class SetSslPolicyTargetSslProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslPolicyReference ssl_policy_reference_resource = 235403836 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ssl_policy_reference_resource = null; + /** + * Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string target_ssl_proxy = 338795853 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_ssl_proxy = ''; + + /** + * @param string $project Project ID for this request. + * @param string $targetSslProxy Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * @param \Google\Cloud\Compute\V1\SslPolicyReference $sslPolicyReferenceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetSslPolicyTargetSslProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetSslProxy, \Google\Cloud\Compute\V1\SslPolicyReference $sslPolicyReferenceResource): self + { + return (new self()) + ->setProject($project) + ->setTargetSslProxy($targetSslProxy) + ->setSslPolicyReferenceResource($sslPolicyReferenceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\SslPolicyReference $ssl_policy_reference_resource + * The body resource for this request + * @type string $target_ssl_proxy + * Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslPolicyReference ssl_policy_reference_resource = 235403836 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\SslPolicyReference|null + */ + public function getSslPolicyReferenceResource() + { + return $this->ssl_policy_reference_resource; + } + + public function hasSslPolicyReferenceResource() + { + return isset($this->ssl_policy_reference_resource); + } + + public function clearSslPolicyReferenceResource() + { + unset($this->ssl_policy_reference_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.SslPolicyReference ssl_policy_reference_resource = 235403836 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\SslPolicyReference $var + * @return $this + */ + public function setSslPolicyReferenceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SslPolicyReference::class); + $this->ssl_policy_reference_resource = $var; + + return $this; + } + + /** + * Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string target_ssl_proxy = 338795853 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetSslProxy() + { + return $this->target_ssl_proxy; + } + + /** + * Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field string target_ssl_proxy = 338795853 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetSslProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_ssl_proxy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetTagsInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetTagsInstanceRequest.php new file mode 100644 index 000000000000..c69d3bcf1eda --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetTagsInstanceRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetTagsInstanceRequest + */ +class SetTagsInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Tags tags_resource = 331435380 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $tags_resource = 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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance scoping this request. + * @param \Google\Cloud\Compute\V1\Tags $tagsResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetTagsInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, \Google\Cloud\Compute\V1\Tags $tagsResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setTagsResource($tagsResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name of the instance scoping 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 \Google\Cloud\Compute\V1\Tags $tags_resource + * The body resource for 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); + } + + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance scoping 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; + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Tags tags_resource = 331435380 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Tags|null + */ + public function getTagsResource() + { + return $this->tags_resource; + } + + public function hasTagsResource() + { + return isset($this->tags_resource); + } + + public function clearTagsResource() + { + unset($this->tags_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Tags tags_resource = 331435380 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Tags $var + * @return $this + */ + public function setTagsResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Tags::class); + $this->tags_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetTargetForwardingRuleRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetTargetForwardingRuleRequest.php new file mode 100644 index 000000000000..71907f4cf4ba --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetTargetForwardingRuleRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetTargetForwardingRuleRequest + */ +class SetTargetForwardingRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the ForwardingRule resource in which target is to be set. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $forwarding_rule = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetReference target_reference_resource = 523721712 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_reference_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $forwardingRule Name of the ForwardingRule resource in which target is to be set. + * @param \Google\Cloud\Compute\V1\TargetReference $targetReferenceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetTargetForwardingRuleRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $forwardingRule, \Google\Cloud\Compute\V1\TargetReference $targetReferenceResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setForwardingRule($forwardingRule) + ->setTargetReferenceResource($targetReferenceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $forwarding_rule + * Name of the ForwardingRule resource in which target is to be set. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 \Google\Cloud\Compute\V1\TargetReference $target_reference_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the ForwardingRule resource in which target is to be set. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getForwardingRule() + { + return $this->forwarding_rule; + } + + /** + * Name of the ForwardingRule resource in which target is to be set. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setForwardingRule($var) + { + GPBUtil::checkString($var, True); + $this->forwarding_rule = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetReference target_reference_resource = 523721712 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetReference|null + */ + public function getTargetReferenceResource() + { + return $this->target_reference_resource; + } + + public function hasTargetReferenceResource() + { + return isset($this->target_reference_resource); + } + + public function clearTargetReferenceResource() + { + unset($this->target_reference_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetReference target_reference_resource = 523721712 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetReference $var + * @return $this + */ + public function setTargetReferenceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetReference::class); + $this->target_reference_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetTargetGlobalForwardingRuleRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetTargetGlobalForwardingRuleRequest.php new file mode 100644 index 000000000000..a00a31b22f2e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetTargetGlobalForwardingRuleRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest + */ +class SetTargetGlobalForwardingRuleRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the ForwardingRule resource in which target is to be set. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $forwarding_rule = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetReference target_reference_resource = 523721712 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_reference_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $forwardingRule Name of the ForwardingRule resource in which target is to be set. + * @param \Google\Cloud\Compute\V1\TargetReference $targetReferenceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetTargetGlobalForwardingRuleRequest + * + * @experimental + */ + public static function build(string $project, string $forwardingRule, \Google\Cloud\Compute\V1\TargetReference $targetReferenceResource): self + { + return (new self()) + ->setProject($project) + ->setForwardingRule($forwardingRule) + ->setTargetReferenceResource($targetReferenceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $forwarding_rule + * Name of the ForwardingRule resource in which target is to be set. + * @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 \Google\Cloud\Compute\V1\TargetReference $target_reference_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the ForwardingRule resource in which target is to be set. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getForwardingRule() + { + return $this->forwarding_rule; + } + + /** + * Name of the ForwardingRule resource in which target is to be set. + * + * Generated from protobuf field string forwarding_rule = 269964030 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setForwardingRule($var) + { + GPBUtil::checkString($var, True); + $this->forwarding_rule = $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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetReference target_reference_resource = 523721712 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TargetReference|null + */ + public function getTargetReferenceResource() + { + return $this->target_reference_resource; + } + + public function hasTargetReferenceResource() + { + return isset($this->target_reference_resource); + } + + public function clearTargetReferenceResource() + { + unset($this->target_reference_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TargetReference target_reference_resource = 523721712 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TargetReference $var + * @return $this + */ + public function setTargetReferenceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TargetReference::class); + $this->target_reference_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetTargetPoolsInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetTargetPoolsInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..adc898f8fabd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetTargetPoolsInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest + */ +class SetTargetPoolsInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest instance_group_managers_set_target_pools_request_resource = 281150216 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_managers_set_target_pools_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the zone where the managed instance group is located. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. + * @param string $instanceGroupManager The name of the managed instance group. + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersSetTargetPoolsRequest $instanceGroupManagersSetTargetPoolsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetTargetPoolsInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager, \Google\Cloud\Compute\V1\InstanceGroupManagersSetTargetPoolsRequest $instanceGroupManagersSetTargetPoolsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersSetTargetPoolsRequestResource($instanceGroupManagersSetTargetPoolsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group. + * @type \Google\Cloud\Compute\V1\InstanceGroupManagersSetTargetPoolsRequest $instance_group_managers_set_target_pools_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 where the managed instance group is located. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest instance_group_managers_set_target_pools_request_resource = 281150216 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagersSetTargetPoolsRequest|null + */ + public function getInstanceGroupManagersSetTargetPoolsRequestResource() + { + return $this->instance_group_managers_set_target_pools_request_resource; + } + + public function hasInstanceGroupManagersSetTargetPoolsRequestResource() + { + return isset($this->instance_group_managers_set_target_pools_request_resource); + } + + public function clearInstanceGroupManagersSetTargetPoolsRequestResource() + { + unset($this->instance_group_managers_set_target_pools_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest instance_group_managers_set_target_pools_request_resource = 281150216 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersSetTargetPoolsRequest $var + * @return $this + */ + public function setInstanceGroupManagersSetTargetPoolsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagersSetTargetPoolsRequest::class); + $this->instance_group_managers_set_target_pools_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 where the managed instance group is located. + * + * 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 where the managed instance group is located. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetTargetPoolsRegionInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetTargetPoolsRegionInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..45d1be5ca21b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetTargetPoolsRegionInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest + */ +class SetTargetPoolsRegionInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest region_instance_group_managers_set_target_pools_request_resource = 78734717 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_instance_group_managers_set_target_pools_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $instanceGroupManager Name of the managed instance group. + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagersSetTargetPoolsRequest $regionInstanceGroupManagersSetTargetPoolsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetTargetPoolsRegionInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroupManager, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersSetTargetPoolsRequest $regionInstanceGroupManagersSetTargetPoolsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroupManager($instanceGroupManager) + ->setRegionInstanceGroupManagersSetTargetPoolsRequestResource($regionInstanceGroupManagersSetTargetPoolsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * Name of the managed instance group. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type \Google\Cloud\Compute\V1\RegionInstanceGroupManagersSetTargetPoolsRequest $region_instance_group_managers_set_target_pools_request_resource + * The body resource 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); + } + + /** + * Name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * Name of the managed instance group. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest region_instance_group_managers_set_target_pools_request_resource = 78734717 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionInstanceGroupManagersSetTargetPoolsRequest|null + */ + public function getRegionInstanceGroupManagersSetTargetPoolsRequestResource() + { + return $this->region_instance_group_managers_set_target_pools_request_resource; + } + + public function hasRegionInstanceGroupManagersSetTargetPoolsRequestResource() + { + return isset($this->region_instance_group_managers_set_target_pools_request_resource); + } + + public function clearRegionInstanceGroupManagersSetTargetPoolsRequestResource() + { + unset($this->region_instance_group_managers_set_target_pools_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest region_instance_group_managers_set_target_pools_request_resource = 78734717 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagersSetTargetPoolsRequest $var + * @return $this + */ + public function setRegionInstanceGroupManagersSetTargetPoolsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersSetTargetPoolsRequest::class); + $this->region_instance_group_managers_set_target_pools_request_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetUrlMapRegionTargetHttpProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetUrlMapRegionTargetHttpProxyRequest.php new file mode 100644 index 000000000000..ac999df310cd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetUrlMapRegionTargetHttpProxyRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest + */ +class SetUrlMapRegionTargetHttpProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the TargetHttpProxy to set a URL map for. + * + * Generated from protobuf field string target_http_proxy = 206872421 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_http_proxy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMapReference url_map_reference_resource = 398701333 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url_map_reference_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetHttpProxy Name of the TargetHttpProxy to set a URL map for. + * @param \Google\Cloud\Compute\V1\UrlMapReference $urlMapReferenceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetUrlMapRegionTargetHttpProxyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $targetHttpProxy, \Google\Cloud\Compute\V1\UrlMapReference $urlMapReferenceResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpProxy($targetHttpProxy) + ->setUrlMapReferenceResource($urlMapReferenceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 $target_http_proxy + * Name of the TargetHttpProxy to set a URL map for. + * @type \Google\Cloud\Compute\V1\UrlMapReference $url_map_reference_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the TargetHttpProxy to set a URL map for. + * + * Generated from protobuf field string target_http_proxy = 206872421 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetHttpProxy() + { + return $this->target_http_proxy; + } + + /** + * Name of the TargetHttpProxy to set a URL map for. + * + * Generated from protobuf field string target_http_proxy = 206872421 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetHttpProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_http_proxy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMapReference url_map_reference_resource = 398701333 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\UrlMapReference|null + */ + public function getUrlMapReferenceResource() + { + return $this->url_map_reference_resource; + } + + public function hasUrlMapReferenceResource() + { + return isset($this->url_map_reference_resource); + } + + public function clearUrlMapReferenceResource() + { + unset($this->url_map_reference_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMapReference url_map_reference_resource = 398701333 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\UrlMapReference $var + * @return $this + */ + public function setUrlMapReferenceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\UrlMapReference::class); + $this->url_map_reference_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetUrlMapRegionTargetHttpsProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetUrlMapRegionTargetHttpsProxyRequest.php new file mode 100644 index 000000000000..36383272a46a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetUrlMapRegionTargetHttpsProxyRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest + */ +class SetUrlMapRegionTargetHttpsProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the TargetHttpsProxy to set a URL map for. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_https_proxy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMapReference url_map_reference_resource = 398701333 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url_map_reference_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetHttpsProxy Name of the TargetHttpsProxy to set a URL map for. + * @param \Google\Cloud\Compute\V1\UrlMapReference $urlMapReferenceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetUrlMapRegionTargetHttpsProxyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $targetHttpsProxy, \Google\Cloud\Compute\V1\UrlMapReference $urlMapReferenceResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setUrlMapReferenceResource($urlMapReferenceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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 $target_https_proxy + * Name of the TargetHttpsProxy to set a URL map for. + * @type \Google\Cloud\Compute\V1\UrlMapReference $url_map_reference_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the TargetHttpsProxy to set a URL map for. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetHttpsProxy() + { + return $this->target_https_proxy; + } + + /** + * Name of the TargetHttpsProxy to set a URL map for. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetHttpsProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_https_proxy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMapReference url_map_reference_resource = 398701333 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\UrlMapReference|null + */ + public function getUrlMapReferenceResource() + { + return $this->url_map_reference_resource; + } + + public function hasUrlMapReferenceResource() + { + return isset($this->url_map_reference_resource); + } + + public function clearUrlMapReferenceResource() + { + unset($this->url_map_reference_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMapReference url_map_reference_resource = 398701333 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\UrlMapReference $var + * @return $this + */ + public function setUrlMapReferenceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\UrlMapReference::class); + $this->url_map_reference_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetUrlMapTargetHttpProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetUrlMapTargetHttpProxyRequest.php new file mode 100644 index 000000000000..fb7745142b55 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetUrlMapTargetHttpProxyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest + */ +class SetUrlMapTargetHttpProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the TargetHttpProxy to set a URL map for. + * + * Generated from protobuf field string target_http_proxy = 206872421 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_http_proxy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMapReference url_map_reference_resource = 398701333 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url_map_reference_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $targetHttpProxy Name of the TargetHttpProxy to set a URL map for. + * @param \Google\Cloud\Compute\V1\UrlMapReference $urlMapReferenceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetUrlMapTargetHttpProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetHttpProxy, \Google\Cloud\Compute\V1\UrlMapReference $urlMapReferenceResource): self + { + return (new self()) + ->setProject($project) + ->setTargetHttpProxy($targetHttpProxy) + ->setUrlMapReferenceResource($urlMapReferenceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $target_http_proxy + * Name of the TargetHttpProxy to set a URL map for. + * @type \Google\Cloud\Compute\V1\UrlMapReference $url_map_reference_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the TargetHttpProxy to set a URL map for. + * + * Generated from protobuf field string target_http_proxy = 206872421 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetHttpProxy() + { + return $this->target_http_proxy; + } + + /** + * Name of the TargetHttpProxy to set a URL map for. + * + * Generated from protobuf field string target_http_proxy = 206872421 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetHttpProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_http_proxy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMapReference url_map_reference_resource = 398701333 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\UrlMapReference|null + */ + public function getUrlMapReferenceResource() + { + return $this->url_map_reference_resource; + } + + public function hasUrlMapReferenceResource() + { + return isset($this->url_map_reference_resource); + } + + public function clearUrlMapReferenceResource() + { + unset($this->url_map_reference_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMapReference url_map_reference_resource = 398701333 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\UrlMapReference $var + * @return $this + */ + public function setUrlMapReferenceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\UrlMapReference::class); + $this->url_map_reference_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetUrlMapTargetHttpsProxyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetUrlMapTargetHttpsProxyRequest.php new file mode 100644 index 000000000000..1461f6f69eab --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetUrlMapTargetHttpsProxyRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest + */ +class SetUrlMapTargetHttpsProxyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the TargetHttpsProxy resource whose URL map is to be set. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_https_proxy = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMapReference url_map_reference_resource = 398701333 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url_map_reference_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource whose URL map is to be set. + * @param \Google\Cloud\Compute\V1\UrlMapReference $urlMapReferenceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetUrlMapTargetHttpsProxyRequest + * + * @experimental + */ + public static function build(string $project, string $targetHttpsProxy, \Google\Cloud\Compute\V1\UrlMapReference $urlMapReferenceResource): self + { + return (new self()) + ->setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setUrlMapReferenceResource($urlMapReferenceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $target_https_proxy + * Name of the TargetHttpsProxy resource whose URL map is to be set. + * @type \Google\Cloud\Compute\V1\UrlMapReference $url_map_reference_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the TargetHttpsProxy resource whose URL map is to be set. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetHttpsProxy() + { + return $this->target_https_proxy; + } + + /** + * Name of the TargetHttpsProxy resource whose URL map is to be set. + * + * Generated from protobuf field string target_https_proxy = 52336748 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetHttpsProxy($var) + { + GPBUtil::checkString($var, True); + $this->target_https_proxy = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMapReference url_map_reference_resource = 398701333 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\UrlMapReference|null + */ + public function getUrlMapReferenceResource() + { + return $this->url_map_reference_resource; + } + + public function hasUrlMapReferenceResource() + { + return isset($this->url_map_reference_resource); + } + + public function clearUrlMapReferenceResource() + { + unset($this->url_map_reference_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMapReference url_map_reference_resource = 398701333 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\UrlMapReference $var + * @return $this + */ + public function setUrlMapReferenceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\UrlMapReference::class); + $this->url_map_reference_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetUsageExportBucketProjectRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetUsageExportBucketProjectRequest.php new file mode 100644 index 000000000000..8f0473ac61a9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetUsageExportBucketProjectRequest.php @@ -0,0 +1,170 @@ +google.cloud.compute.v1.SetUsageExportBucketProjectRequest + */ +class SetUsageExportBucketProjectRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UsageExportLocation usage_export_location_resource = 20260459 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $usage_export_location_resource = null; + + /** + * @param string $project Project ID for this request. + * @param \Google\Cloud\Compute\V1\UsageExportLocation $usageExportLocationResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SetUsageExportBucketProjectRequest + * + * @experimental + */ + public static function build(string $project, \Google\Cloud\Compute\V1\UsageExportLocation $usageExportLocationResource): self + { + return (new self()) + ->setProject($project) + ->setUsageExportLocationResource($usageExportLocationResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 \Google\Cloud\Compute\V1\UsageExportLocation $usage_export_location_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UsageExportLocation usage_export_location_resource = 20260459 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\UsageExportLocation|null + */ + public function getUsageExportLocationResource() + { + return $this->usage_export_location_resource; + } + + public function hasUsageExportLocationResource() + { + return isset($this->usage_export_location_resource); + } + + public function clearUsageExportLocationResource() + { + unset($this->usage_export_location_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UsageExportLocation usage_export_location_resource = 20260459 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\UsageExportLocation $var + * @return $this + */ + public function setUsageExportLocationResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\UsageExportLocation::class); + $this->usage_export_location_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShareSettings.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShareSettings.php new file mode 100644 index 000000000000..15b1bc2bd3e5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShareSettings.php @@ -0,0 +1,115 @@ +google.cloud.compute.v1.ShareSettings + */ +class ShareSettings extends \Google\Protobuf\Internal\Message +{ + /** + * A map of project id and project config. This is only valid when share_type's value is SPECIFIC_PROJECTS. + * + * Generated from protobuf field map project_map = 134212406; + */ + private $project_map; + /** + * Type of sharing for this shared-reservation + * Check the ShareType enum for the list of possible values. + * + * Generated from protobuf field optional string share_type = 359533466; + */ + protected $share_type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $project_map + * A map of project id and project config. This is only valid when share_type's value is SPECIFIC_PROJECTS. + * @type string $share_type + * Type of sharing for this shared-reservation + * Check the ShareType enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A map of project id and project config. This is only valid when share_type's value is SPECIFIC_PROJECTS. + * + * Generated from protobuf field map project_map = 134212406; + * @return \Google\Protobuf\Internal\MapField + */ + public function getProjectMap() + { + return $this->project_map; + } + + /** + * A map of project id and project config. This is only valid when share_type's value is SPECIFIC_PROJECTS. + * + * Generated from protobuf field map project_map = 134212406; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setProjectMap($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ShareSettingsProjectConfig::class); + $this->project_map = $arr; + + return $this; + } + + /** + * Type of sharing for this shared-reservation + * Check the ShareType enum for the list of possible values. + * + * Generated from protobuf field optional string share_type = 359533466; + * @return string + */ + public function getShareType() + { + return isset($this->share_type) ? $this->share_type : ''; + } + + public function hasShareType() + { + return isset($this->share_type); + } + + public function clearShareType() + { + unset($this->share_type); + } + + /** + * Type of sharing for this shared-reservation + * Check the ShareType enum for the list of possible values. + * + * Generated from protobuf field optional string share_type = 359533466; + * @param string $var + * @return $this + */ + public function setShareType($var) + { + GPBUtil::checkString($var, True); + $this->share_type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShareSettings/ShareType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShareSettings/ShareType.php new file mode 100644 index 000000000000..f4954d92dc80 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShareSettings/ShareType.php @@ -0,0 +1,78 @@ +google.cloud.compute.v1.ShareSettings.ShareType + */ +class ShareType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_SHARE_TYPE = 0; + */ + const UNDEFINED_SHARE_TYPE = 0; + /** + * Default value. + * + * Generated from protobuf enum LOCAL = 72607563; + */ + const LOCAL = 72607563; + /** + * Shared-reservation is open to entire Organization + * + * Generated from protobuf enum ORGANIZATION = 274978099; + */ + const ORGANIZATION = 274978099; + /** + * Default value. This value is unused. + * + * Generated from protobuf enum SHARE_TYPE_UNSPECIFIED = 494771730; + */ + const SHARE_TYPE_UNSPECIFIED = 494771730; + /** + * Shared-reservation is open to specific projects + * + * Generated from protobuf enum SPECIFIC_PROJECTS = 347838695; + */ + const SPECIFIC_PROJECTS = 347838695; + + private static $valueToName = [ + self::UNDEFINED_SHARE_TYPE => 'UNDEFINED_SHARE_TYPE', + self::LOCAL => 'LOCAL', + self::ORGANIZATION => 'ORGANIZATION', + self::SHARE_TYPE_UNSPECIFIED => 'SHARE_TYPE_UNSPECIFIED', + self::SPECIFIC_PROJECTS => 'SPECIFIC_PROJECTS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ShareType::class, \Google\Cloud\Compute\V1\ShareSettings_ShareType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShareSettingsProjectConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShareSettingsProjectConfig.php new file mode 100644 index 000000000000..85bddab767cf --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShareSettingsProjectConfig.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.ShareSettingsProjectConfig + */ +class ShareSettingsProjectConfig extends \Google\Protobuf\Internal\Message +{ + /** + * The project ID, should be same as the key of this project config in the parent map. + * + * Generated from protobuf field optional string project_id = 177513473; + */ + protected $project_id = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * The project ID, should be same as the key of this project config in the parent map. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The project ID, should be same as the key of this project config in the parent map. + * + * Generated from protobuf field optional string project_id = 177513473; + * @return string + */ + public function getProjectId() + { + return isset($this->project_id) ? $this->project_id : ''; + } + + public function hasProjectId() + { + return isset($this->project_id); + } + + public function clearProjectId() + { + unset($this->project_id); + } + + /** + * The project ID, should be same as the key of this project config in the parent map. + * + * Generated from protobuf field optional string project_id = 177513473; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShieldedInstanceConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShieldedInstanceConfig.php new file mode 100644 index 000000000000..81eded53679b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShieldedInstanceConfig.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.ShieldedInstanceConfig + */ +class ShieldedInstanceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Defines whether the instance has integrity monitoring enabled. Enabled by default. + * + * Generated from protobuf field optional bool enable_integrity_monitoring = 409071030; + */ + protected $enable_integrity_monitoring = null; + /** + * Defines whether the instance has Secure Boot enabled. Disabled by default. + * + * Generated from protobuf field optional bool enable_secure_boot = 123568638; + */ + protected $enable_secure_boot = null; + /** + * Defines whether the instance has the vTPM enabled. Enabled by default. + * + * Generated from protobuf field optional bool enable_vtpm = 181858935; + */ + protected $enable_vtpm = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_integrity_monitoring + * Defines whether the instance has integrity monitoring enabled. Enabled by default. + * @type bool $enable_secure_boot + * Defines whether the instance has Secure Boot enabled. Disabled by default. + * @type bool $enable_vtpm + * Defines whether the instance has the vTPM enabled. Enabled by default. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Defines whether the instance has integrity monitoring enabled. Enabled by default. + * + * Generated from protobuf field optional bool enable_integrity_monitoring = 409071030; + * @return bool + */ + public function getEnableIntegrityMonitoring() + { + return isset($this->enable_integrity_monitoring) ? $this->enable_integrity_monitoring : false; + } + + public function hasEnableIntegrityMonitoring() + { + return isset($this->enable_integrity_monitoring); + } + + public function clearEnableIntegrityMonitoring() + { + unset($this->enable_integrity_monitoring); + } + + /** + * Defines whether the instance has integrity monitoring enabled. Enabled by default. + * + * Generated from protobuf field optional bool enable_integrity_monitoring = 409071030; + * @param bool $var + * @return $this + */ + public function setEnableIntegrityMonitoring($var) + { + GPBUtil::checkBool($var); + $this->enable_integrity_monitoring = $var; + + return $this; + } + + /** + * Defines whether the instance has Secure Boot enabled. Disabled by default. + * + * Generated from protobuf field optional bool enable_secure_boot = 123568638; + * @return bool + */ + public function getEnableSecureBoot() + { + return isset($this->enable_secure_boot) ? $this->enable_secure_boot : false; + } + + public function hasEnableSecureBoot() + { + return isset($this->enable_secure_boot); + } + + public function clearEnableSecureBoot() + { + unset($this->enable_secure_boot); + } + + /** + * Defines whether the instance has Secure Boot enabled. Disabled by default. + * + * Generated from protobuf field optional bool enable_secure_boot = 123568638; + * @param bool $var + * @return $this + */ + public function setEnableSecureBoot($var) + { + GPBUtil::checkBool($var); + $this->enable_secure_boot = $var; + + return $this; + } + + /** + * Defines whether the instance has the vTPM enabled. Enabled by default. + * + * Generated from protobuf field optional bool enable_vtpm = 181858935; + * @return bool + */ + public function getEnableVtpm() + { + return isset($this->enable_vtpm) ? $this->enable_vtpm : false; + } + + public function hasEnableVtpm() + { + return isset($this->enable_vtpm); + } + + public function clearEnableVtpm() + { + unset($this->enable_vtpm); + } + + /** + * Defines whether the instance has the vTPM enabled. Enabled by default. + * + * Generated from protobuf field optional bool enable_vtpm = 181858935; + * @param bool $var + * @return $this + */ + public function setEnableVtpm($var) + { + GPBUtil::checkBool($var); + $this->enable_vtpm = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShieldedInstanceIdentity.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShieldedInstanceIdentity.php new file mode 100644 index 000000000000..bfb585c42f54 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShieldedInstanceIdentity.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.ShieldedInstanceIdentity + */ +class ShieldedInstanceIdentity extends \Google\Protobuf\Internal\Message +{ + /** + * An Endorsement Key (EK) made by the RSA 2048 algorithm issued to the Shielded Instance's vTPM. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ShieldedInstanceIdentityEntry encryption_key = 488268707; + */ + protected $encryption_key = null; + /** + * [Output Only] Type of the resource. Always compute#shieldedInstanceIdentity for shielded Instance identity entry. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * An Attestation Key (AK) made by the RSA 2048 algorithm issued to the Shielded Instance's vTPM. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ShieldedInstanceIdentityEntry signing_key = 320948261; + */ + protected $signing_key = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\ShieldedInstanceIdentityEntry $encryption_key + * An Endorsement Key (EK) made by the RSA 2048 algorithm issued to the Shielded Instance's vTPM. + * @type string $kind + * [Output Only] Type of the resource. Always compute#shieldedInstanceIdentity for shielded Instance identity entry. + * @type \Google\Cloud\Compute\V1\ShieldedInstanceIdentityEntry $signing_key + * An Attestation Key (AK) made by the RSA 2048 algorithm issued to the Shielded Instance's vTPM. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * An Endorsement Key (EK) made by the RSA 2048 algorithm issued to the Shielded Instance's vTPM. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ShieldedInstanceIdentityEntry encryption_key = 488268707; + * @return \Google\Cloud\Compute\V1\ShieldedInstanceIdentityEntry|null + */ + public function getEncryptionKey() + { + return $this->encryption_key; + } + + public function hasEncryptionKey() + { + return isset($this->encryption_key); + } + + public function clearEncryptionKey() + { + unset($this->encryption_key); + } + + /** + * An Endorsement Key (EK) made by the RSA 2048 algorithm issued to the Shielded Instance's vTPM. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ShieldedInstanceIdentityEntry encryption_key = 488268707; + * @param \Google\Cloud\Compute\V1\ShieldedInstanceIdentityEntry $var + * @return $this + */ + public function setEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ShieldedInstanceIdentityEntry::class); + $this->encryption_key = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#shieldedInstanceIdentity for shielded Instance identity entry. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#shieldedInstanceIdentity for shielded Instance identity entry. + * + * 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; + } + + /** + * An Attestation Key (AK) made by the RSA 2048 algorithm issued to the Shielded Instance's vTPM. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ShieldedInstanceIdentityEntry signing_key = 320948261; + * @return \Google\Cloud\Compute\V1\ShieldedInstanceIdentityEntry|null + */ + public function getSigningKey() + { + return $this->signing_key; + } + + public function hasSigningKey() + { + return isset($this->signing_key); + } + + public function clearSigningKey() + { + unset($this->signing_key); + } + + /** + * An Attestation Key (AK) made by the RSA 2048 algorithm issued to the Shielded Instance's vTPM. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ShieldedInstanceIdentityEntry signing_key = 320948261; + * @param \Google\Cloud\Compute\V1\ShieldedInstanceIdentityEntry $var + * @return $this + */ + public function setSigningKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ShieldedInstanceIdentityEntry::class); + $this->signing_key = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShieldedInstanceIdentityEntry.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShieldedInstanceIdentityEntry.php new file mode 100644 index 000000000000..9f28c5be3f0e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShieldedInstanceIdentityEntry.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.ShieldedInstanceIdentityEntry + */ +class ShieldedInstanceIdentityEntry extends \Google\Protobuf\Internal\Message +{ + /** + * A PEM-encoded X.509 certificate. This field can be empty. + * + * Generated from protobuf field optional string ek_cert = 450178589; + */ + protected $ek_cert = null; + /** + * A PEM-encoded public key. + * + * Generated from protobuf field optional string ek_pub = 308947940; + */ + protected $ek_pub = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ek_cert + * A PEM-encoded X.509 certificate. This field can be empty. + * @type string $ek_pub + * A PEM-encoded public key. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A PEM-encoded X.509 certificate. This field can be empty. + * + * Generated from protobuf field optional string ek_cert = 450178589; + * @return string + */ + public function getEkCert() + { + return isset($this->ek_cert) ? $this->ek_cert : ''; + } + + public function hasEkCert() + { + return isset($this->ek_cert); + } + + public function clearEkCert() + { + unset($this->ek_cert); + } + + /** + * A PEM-encoded X.509 certificate. This field can be empty. + * + * Generated from protobuf field optional string ek_cert = 450178589; + * @param string $var + * @return $this + */ + public function setEkCert($var) + { + GPBUtil::checkString($var, True); + $this->ek_cert = $var; + + return $this; + } + + /** + * A PEM-encoded public key. + * + * Generated from protobuf field optional string ek_pub = 308947940; + * @return string + */ + public function getEkPub() + { + return isset($this->ek_pub) ? $this->ek_pub : ''; + } + + public function hasEkPub() + { + return isset($this->ek_pub); + } + + public function clearEkPub() + { + unset($this->ek_pub); + } + + /** + * A PEM-encoded public key. + * + * Generated from protobuf field optional string ek_pub = 308947940; + * @param string $var + * @return $this + */ + public function setEkPub($var) + { + GPBUtil::checkString($var, True); + $this->ek_pub = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShieldedInstanceIntegrityPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShieldedInstanceIntegrityPolicy.php new file mode 100644 index 000000000000..a8f02bfc3e65 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ShieldedInstanceIntegrityPolicy.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy + */ +class ShieldedInstanceIntegrityPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Updates the integrity policy baseline using the measurements from the VM instance's most recent boot. + * + * Generated from protobuf field optional bool update_auto_learn_policy = 245490215; + */ + protected $update_auto_learn_policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $update_auto_learn_policy + * Updates the integrity policy baseline using the measurements from the VM instance's most recent boot. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Updates the integrity policy baseline using the measurements from the VM instance's most recent boot. + * + * Generated from protobuf field optional bool update_auto_learn_policy = 245490215; + * @return bool + */ + public function getUpdateAutoLearnPolicy() + { + return isset($this->update_auto_learn_policy) ? $this->update_auto_learn_policy : false; + } + + public function hasUpdateAutoLearnPolicy() + { + return isset($this->update_auto_learn_policy); + } + + public function clearUpdateAutoLearnPolicy() + { + unset($this->update_auto_learn_policy); + } + + /** + * Updates the integrity policy baseline using the measurements from the VM instance's most recent boot. + * + * Generated from protobuf field optional bool update_auto_learn_policy = 245490215; + * @param bool $var + * @return $this + */ + public function setUpdateAutoLearnPolicy($var) + { + GPBUtil::checkBool($var); + $this->update_auto_learn_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SignedUrlKey.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SignedUrlKey.php new file mode 100644 index 000000000000..692d45166f6b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SignedUrlKey.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.SignedUrlKey + */ +class SignedUrlKey extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the key. 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. + * + * Generated from protobuf field optional string key_name = 500938859; + */ + protected $key_name = null; + /** + * 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. + * + * Generated from protobuf field optional string key_value = 504106897; + */ + protected $key_value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key_name + * Name of the key. 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 string $key_value + * 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the key. 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. + * + * Generated from protobuf field optional string key_name = 500938859; + * @return string + */ + public function getKeyName() + { + return isset($this->key_name) ? $this->key_name : ''; + } + + public function hasKeyName() + { + return isset($this->key_name); + } + + public function clearKeyName() + { + unset($this->key_name); + } + + /** + * Name of the key. 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. + * + * Generated from protobuf field optional string key_name = 500938859; + * @param string $var + * @return $this + */ + public function setKeyName($var) + { + GPBUtil::checkString($var, True); + $this->key_name = $var; + + return $this; + } + + /** + * 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. + * + * Generated from protobuf field optional string key_value = 504106897; + * @return string + */ + public function getKeyValue() + { + return isset($this->key_value) ? $this->key_value : ''; + } + + public function hasKeyValue() + { + return isset($this->key_value); + } + + public function clearKeyValue() + { + unset($this->key_value); + } + + /** + * 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. + * + * Generated from protobuf field optional string key_value = 504106897; + * @param string $var + * @return $this + */ + public function setKeyValue($var) + { + GPBUtil::checkString($var, True); + $this->key_value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SimulateMaintenanceEventInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SimulateMaintenanceEventInstanceRequest.php new file mode 100644 index 000000000000..41bdb9212ba9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SimulateMaintenanceEventInstanceRequest.php @@ -0,0 +1,240 @@ +google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest + */ +class SimulateMaintenanceEventInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Determines whether the customers receive notifications before migration. Only applicable to SF vms. + * + * Generated from protobuf field optional bool with_extended_notifications = 405957627; + */ + protected $with_extended_notifications = 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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance scoping this request. + * + * @return \Google\Cloud\Compute\V1\SimulateMaintenanceEventInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name of the instance scoping 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 bool $with_extended_notifications + * Determines whether the customers receive notifications before migration. Only applicable to SF vms. + * @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); + } + + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance scoping 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; + } + + /** + * 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; + } + + /** + * Determines whether the customers receive notifications before migration. Only applicable to SF vms. + * + * Generated from protobuf field optional bool with_extended_notifications = 405957627; + * @return bool + */ + public function getWithExtendedNotifications() + { + return isset($this->with_extended_notifications) ? $this->with_extended_notifications : false; + } + + public function hasWithExtendedNotifications() + { + return isset($this->with_extended_notifications); + } + + public function clearWithExtendedNotifications() + { + unset($this->with_extended_notifications); + } + + /** + * Determines whether the customers receive notifications before migration. Only applicable to SF vms. + * + * Generated from protobuf field optional bool with_extended_notifications = 405957627; + * @param bool $var + * @return $this + */ + public function setWithExtendedNotifications($var) + { + GPBUtil::checkBool($var); + $this->with_extended_notifications = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SimulateMaintenanceEventNodeGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SimulateMaintenanceEventNodeGroupRequest.php new file mode 100644 index 000000000000..d6a66d782911 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SimulateMaintenanceEventNodeGroupRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SimulateMaintenanceEventNodeGroupRequest + */ +class SimulateMaintenanceEventNodeGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the NodeGroup resource whose nodes will go under maintenance simulation. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $node_group = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest node_groups_simulate_maintenance_event_request_resource = 351468764 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $node_groups_simulate_maintenance_event_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $nodeGroup Name of the NodeGroup resource whose nodes will go under maintenance simulation. + * @param \Google\Cloud\Compute\V1\NodeGroupsSimulateMaintenanceEventRequest $nodeGroupsSimulateMaintenanceEventRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SimulateMaintenanceEventNodeGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $nodeGroup, \Google\Cloud\Compute\V1\NodeGroupsSimulateMaintenanceEventRequest $nodeGroupsSimulateMaintenanceEventRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setNodeGroup($nodeGroup) + ->setNodeGroupsSimulateMaintenanceEventRequestResource($nodeGroupsSimulateMaintenanceEventRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $node_group + * Name of the NodeGroup resource whose nodes will go under maintenance simulation. + * @type \Google\Cloud\Compute\V1\NodeGroupsSimulateMaintenanceEventRequest $node_groups_simulate_maintenance_event_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); + } + + /** + * Name of the NodeGroup resource whose nodes will go under maintenance simulation. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNodeGroup() + { + return $this->node_group; + } + + /** + * Name of the NodeGroup resource whose nodes will go under maintenance simulation. + * + * Generated from protobuf field string node_group = 469958146 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNodeGroup($var) + { + GPBUtil::checkString($var, True); + $this->node_group = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest node_groups_simulate_maintenance_event_request_resource = 351468764 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NodeGroupsSimulateMaintenanceEventRequest|null + */ + public function getNodeGroupsSimulateMaintenanceEventRequestResource() + { + return $this->node_groups_simulate_maintenance_event_request_resource; + } + + public function hasNodeGroupsSimulateMaintenanceEventRequestResource() + { + return isset($this->node_groups_simulate_maintenance_event_request_resource); + } + + public function clearNodeGroupsSimulateMaintenanceEventRequestResource() + { + unset($this->node_groups_simulate_maintenance_event_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NodeGroupsSimulateMaintenanceEventRequest node_groups_simulate_maintenance_event_request_resource = 351468764 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NodeGroupsSimulateMaintenanceEventRequest $var + * @return $this + */ + public function setNodeGroupsSimulateMaintenanceEventRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NodeGroupsSimulateMaintenanceEventRequest::class); + $this->node_groups_simulate_maintenance_event_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Snapshot.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Snapshot.php new file mode 100644 index 000000000000..d5d004b57669 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Snapshot.php @@ -0,0 +1,1583 @@ +google.cloud.compute.v1.Snapshot + */ +class Snapshot extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The architecture of the snapshot. Valid values are ARM64 or X86_64. + * Check the Architecture enum for the list of possible values. + * + * Generated from protobuf field optional string architecture = 302803283; + */ + protected $architecture = null; + /** + * [Output Only] Set to true if snapshots are automatically created by applying resource policy on the target disk. + * + * Generated from protobuf field optional bool auto_created = 463922264; + */ + protected $auto_created = null; + /** + * Creates the new snapshot in the snapshot chain labeled with the specified name. The chain name must be 1-63 characters long and comply with RFC1035. This is an uncommon option only for advanced service owners who needs to create separate snapshot chains, for example, for chargeback tracking. When you describe your snapshot resource, this field is visible only if it has a non-empty value. + * + * Generated from protobuf field optional string chain_name = 68644169; + */ + protected $chain_name = null; + /** + * [Output Only] Size in bytes of the snapshot at creation time. + * + * Generated from protobuf field optional int64 creation_size_bytes = 125400077; + */ + protected $creation_size_bytes = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] Size of the source disk, specified in GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 316263735; + */ + protected $disk_size_gb = null; + /** + * [Output Only] Number of bytes downloaded to restore a snapshot to a disk. + * + * Generated from protobuf field optional int64 download_bytes = 435054068; + */ + protected $download_bytes = null; + /** + * Whether this snapshot is created from a confidential compute mode disk. [Output Only]: This field is not set by user, but from source disk. + * + * Generated from protobuf field optional bool enable_confidential_compute = 102135228; + */ + protected $enable_confidential_compute = null; + /** + * [Output Only] A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545; + */ + private $guest_os_features; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#snapshot for Snapshot resources. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * A fingerprint for the labels being applied to this snapshot, 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 snapshot. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + */ + protected $label_fingerprint = null; + /** + * Labels to apply to this snapshot. These can be later modified by the setLabels method. Label values may be empty. + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + /** + * [Output Only] Integer license codes indicating which licenses are attached to this snapshot. + * + * Generated from protobuf field repeated int64 license_codes = 45482664; + */ + private $license_codes; + /** + * [Output Only] A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image). + * + * Generated from protobuf field repeated string licenses = 337642578; + */ + private $licenses; + /** + * An opaque location hint used to place the snapshot close to other resources. This field is for use by internal tools that use the public API. + * + * Generated from protobuf field optional string location_hint = 350519505; + */ + protected $location_hint = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzi = 480964257; + */ + protected $satisfies_pzi = null; + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + */ + protected $satisfies_pzs = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * Encrypts the snapshot using a customer-supplied encryption key. After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the snapshot later. For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request. Customer-supplied encryption keys do not protect access to metadata of the snapshot. If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey snapshot_encryption_key = 43334526; + */ + protected $snapshot_encryption_key = null; + /** + * Indicates the type of the snapshot. + * Check the SnapshotType enum for the list of possible values. + * + * Generated from protobuf field optional string snapshot_type = 124349653; + */ + protected $snapshot_type = null; + /** + * The source disk used to create this snapshot. + * + * Generated from protobuf field optional string source_disk = 451753793; + */ + protected $source_disk = null; + /** + * The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_disk_encryption_key = 531501153; + */ + protected $source_disk_encryption_key = null; + /** + * The source disk whose recovery checkpoint will be used to create this snapshot. + * + * Generated from protobuf field optional string source_disk_for_recovery_checkpoint = 359837950; + */ + protected $source_disk_for_recovery_checkpoint = null; + /** + * [Output Only] The ID value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name. + * + * Generated from protobuf field optional string source_disk_id = 454190809; + */ + protected $source_disk_id = null; + /** + * The source instant snapshot used to create this snapshot. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instantSnapshots/instantSnapshot - projects/project/zones/zone/instantSnapshots/instantSnapshot - zones/zone/instantSnapshots/instantSnapshot + * + * Generated from protobuf field optional string source_instant_snapshot = 219202054; + */ + protected $source_instant_snapshot = null; + /** + * Customer provided encryption key when creating Snapshot from Instant Snapshot. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_instant_snapshot_encryption_key = 436536060; + */ + protected $source_instant_snapshot_encryption_key = null; + /** + * [Output Only] The unique ID of the instant snapshot used to create this snapshot. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact instant snapshot that was used. + * + * Generated from protobuf field optional string source_instant_snapshot_id = 287582708; + */ + protected $source_instant_snapshot_id = null; + /** + * [Output Only] URL of the resource policy which created this scheduled snapshot. + * + * Generated from protobuf field optional string source_snapshot_schedule_policy = 235756291; + */ + protected $source_snapshot_schedule_policy = null; + /** + * [Output Only] ID of the resource policy which created this scheduled snapshot. + * + * Generated from protobuf field optional string source_snapshot_schedule_policy_id = 70489047; + */ + protected $source_snapshot_schedule_policy_id = null; + /** + * [Output Only] The status of the snapshot. This can be CREATING, DELETING, FAILED, READY, or UPLOADING. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + /** + * [Output Only] A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion. + * + * Generated from protobuf field optional int64 storage_bytes = 424631719; + */ + protected $storage_bytes = null; + /** + * [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. + * Check the StorageBytesStatus enum for the list of possible values. + * + * Generated from protobuf field optional string storage_bytes_status = 490739082; + */ + protected $storage_bytes_status = null; + /** + * Cloud Storage bucket storage location of the snapshot (regional or multi-regional). + * + * Generated from protobuf field repeated string storage_locations = 328005274; + */ + private $storage_locations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $architecture + * [Output Only] The architecture of the snapshot. Valid values are ARM64 or X86_64. + * Check the Architecture enum for the list of possible values. + * @type bool $auto_created + * [Output Only] Set to true if snapshots are automatically created by applying resource policy on the target disk. + * @type string $chain_name + * Creates the new snapshot in the snapshot chain labeled with the specified name. The chain name must be 1-63 characters long and comply with RFC1035. This is an uncommon option only for advanced service owners who needs to create separate snapshot chains, for example, for chargeback tracking. When you describe your snapshot resource, this field is visible only if it has a non-empty value. + * @type int|string $creation_size_bytes + * [Output Only] Size in bytes of the snapshot at creation time. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type int|string $disk_size_gb + * [Output Only] Size of the source disk, specified in GB. + * @type int|string $download_bytes + * [Output Only] Number of bytes downloaded to restore a snapshot to a disk. + * @type bool $enable_confidential_compute + * Whether this snapshot is created from a confidential compute mode disk. [Output Only]: This field is not set by user, but from source disk. + * @type array<\Google\Cloud\Compute\V1\GuestOsFeature>|\Google\Protobuf\Internal\RepeatedField $guest_os_features + * [Output Only] A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of the resource. Always compute#snapshot for Snapshot resources. + * @type string $label_fingerprint + * A fingerprint for the labels being applied to this snapshot, 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 snapshot. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels to apply to this snapshot. These can be later modified by the setLabels method. Label values may be empty. + * @type array|array|\Google\Protobuf\Internal\RepeatedField $license_codes + * [Output Only] Integer license codes indicating which licenses are attached to this snapshot. + * @type array|\Google\Protobuf\Internal\RepeatedField $licenses + * [Output Only] A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image). + * @type string $location_hint + * An opaque location hint used to place the snapshot close to other resources. This field is for use by internal tools that use the public API. + * @type string $name + * 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 bool $satisfies_pzi + * Output only. Reserved for future use. + * @type bool $satisfies_pzs + * [Output Only] Reserved for future use. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type \Google\Cloud\Compute\V1\CustomerEncryptionKey $snapshot_encryption_key + * Encrypts the snapshot using a customer-supplied encryption key. After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the snapshot later. For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request. Customer-supplied encryption keys do not protect access to metadata of the snapshot. If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later. + * @type string $snapshot_type + * Indicates the type of the snapshot. + * Check the SnapshotType enum for the list of possible values. + * @type string $source_disk + * The source disk used to create this snapshot. + * @type \Google\Cloud\Compute\V1\CustomerEncryptionKey $source_disk_encryption_key + * The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. + * @type string $source_disk_for_recovery_checkpoint + * The source disk whose recovery checkpoint will be used to create this snapshot. + * @type string $source_disk_id + * [Output Only] The ID value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name. + * @type string $source_instant_snapshot + * The source instant snapshot used to create this snapshot. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instantSnapshots/instantSnapshot - projects/project/zones/zone/instantSnapshots/instantSnapshot - zones/zone/instantSnapshots/instantSnapshot + * @type \Google\Cloud\Compute\V1\CustomerEncryptionKey $source_instant_snapshot_encryption_key + * Customer provided encryption key when creating Snapshot from Instant Snapshot. + * @type string $source_instant_snapshot_id + * [Output Only] The unique ID of the instant snapshot used to create this snapshot. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact instant snapshot that was used. + * @type string $source_snapshot_schedule_policy + * [Output Only] URL of the resource policy which created this scheduled snapshot. + * @type string $source_snapshot_schedule_policy_id + * [Output Only] ID of the resource policy which created this scheduled snapshot. + * @type string $status + * [Output Only] The status of the snapshot. This can be CREATING, DELETING, FAILED, READY, or UPLOADING. + * Check the Status enum for the list of possible values. + * @type int|string $storage_bytes + * [Output Only] A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion. + * @type string $storage_bytes_status + * [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. + * Check the StorageBytesStatus enum for the list of possible values. + * @type array|\Google\Protobuf\Internal\RepeatedField $storage_locations + * Cloud Storage bucket storage location of the snapshot (regional or multi-regional). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The architecture of the snapshot. Valid values are ARM64 or X86_64. + * Check the Architecture enum for the list of possible values. + * + * Generated from protobuf field optional string architecture = 302803283; + * @return string + */ + public function getArchitecture() + { + return isset($this->architecture) ? $this->architecture : ''; + } + + public function hasArchitecture() + { + return isset($this->architecture); + } + + public function clearArchitecture() + { + unset($this->architecture); + } + + /** + * [Output Only] The architecture of the snapshot. Valid values are ARM64 or X86_64. + * Check the Architecture enum for the list of possible values. + * + * Generated from protobuf field optional string architecture = 302803283; + * @param string $var + * @return $this + */ + public function setArchitecture($var) + { + GPBUtil::checkString($var, True); + $this->architecture = $var; + + return $this; + } + + /** + * [Output Only] Set to true if snapshots are automatically created by applying resource policy on the target disk. + * + * Generated from protobuf field optional bool auto_created = 463922264; + * @return bool + */ + public function getAutoCreated() + { + return isset($this->auto_created) ? $this->auto_created : false; + } + + public function hasAutoCreated() + { + return isset($this->auto_created); + } + + public function clearAutoCreated() + { + unset($this->auto_created); + } + + /** + * [Output Only] Set to true if snapshots are automatically created by applying resource policy on the target disk. + * + * Generated from protobuf field optional bool auto_created = 463922264; + * @param bool $var + * @return $this + */ + public function setAutoCreated($var) + { + GPBUtil::checkBool($var); + $this->auto_created = $var; + + return $this; + } + + /** + * Creates the new snapshot in the snapshot chain labeled with the specified name. The chain name must be 1-63 characters long and comply with RFC1035. This is an uncommon option only for advanced service owners who needs to create separate snapshot chains, for example, for chargeback tracking. When you describe your snapshot resource, this field is visible only if it has a non-empty value. + * + * Generated from protobuf field optional string chain_name = 68644169; + * @return string + */ + public function getChainName() + { + return isset($this->chain_name) ? $this->chain_name : ''; + } + + public function hasChainName() + { + return isset($this->chain_name); + } + + public function clearChainName() + { + unset($this->chain_name); + } + + /** + * Creates the new snapshot in the snapshot chain labeled with the specified name. The chain name must be 1-63 characters long and comply with RFC1035. This is an uncommon option only for advanced service owners who needs to create separate snapshot chains, for example, for chargeback tracking. When you describe your snapshot resource, this field is visible only if it has a non-empty value. + * + * Generated from protobuf field optional string chain_name = 68644169; + * @param string $var + * @return $this + */ + public function setChainName($var) + { + GPBUtil::checkString($var, True); + $this->chain_name = $var; + + return $this; + } + + /** + * [Output Only] Size in bytes of the snapshot at creation time. + * + * Generated from protobuf field optional int64 creation_size_bytes = 125400077; + * @return int|string + */ + public function getCreationSizeBytes() + { + return isset($this->creation_size_bytes) ? $this->creation_size_bytes : 0; + } + + public function hasCreationSizeBytes() + { + return isset($this->creation_size_bytes); + } + + public function clearCreationSizeBytes() + { + unset($this->creation_size_bytes); + } + + /** + * [Output Only] Size in bytes of the snapshot at creation time. + * + * Generated from protobuf field optional int64 creation_size_bytes = 125400077; + * @param int|string $var + * @return $this + */ + public function setCreationSizeBytes($var) + { + GPBUtil::checkInt64($var); + $this->creation_size_bytes = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] Size of the source disk, specified in GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 316263735; + * @return int|string + */ + public function getDiskSizeGb() + { + return isset($this->disk_size_gb) ? $this->disk_size_gb : 0; + } + + public function hasDiskSizeGb() + { + return isset($this->disk_size_gb); + } + + public function clearDiskSizeGb() + { + unset($this->disk_size_gb); + } + + /** + * [Output Only] Size of the source disk, specified in GB. + * + * Generated from protobuf field optional int64 disk_size_gb = 316263735; + * @param int|string $var + * @return $this + */ + public function setDiskSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->disk_size_gb = $var; + + return $this; + } + + /** + * [Output Only] Number of bytes downloaded to restore a snapshot to a disk. + * + * Generated from protobuf field optional int64 download_bytes = 435054068; + * @return int|string + */ + public function getDownloadBytes() + { + return isset($this->download_bytes) ? $this->download_bytes : 0; + } + + public function hasDownloadBytes() + { + return isset($this->download_bytes); + } + + public function clearDownloadBytes() + { + unset($this->download_bytes); + } + + /** + * [Output Only] Number of bytes downloaded to restore a snapshot to a disk. + * + * Generated from protobuf field optional int64 download_bytes = 435054068; + * @param int|string $var + * @return $this + */ + public function setDownloadBytes($var) + { + GPBUtil::checkInt64($var); + $this->download_bytes = $var; + + return $this; + } + + /** + * Whether this snapshot is created from a confidential compute mode disk. [Output Only]: This field is not set by user, but from source disk. + * + * Generated from protobuf field optional bool enable_confidential_compute = 102135228; + * @return bool + */ + public function getEnableConfidentialCompute() + { + return isset($this->enable_confidential_compute) ? $this->enable_confidential_compute : false; + } + + public function hasEnableConfidentialCompute() + { + return isset($this->enable_confidential_compute); + } + + public function clearEnableConfidentialCompute() + { + unset($this->enable_confidential_compute); + } + + /** + * Whether this snapshot is created from a confidential compute mode disk. [Output Only]: This field is not set by user, but from source disk. + * + * Generated from protobuf field optional bool enable_confidential_compute = 102135228; + * @param bool $var + * @return $this + */ + public function setEnableConfidentialCompute($var) + { + GPBUtil::checkBool($var); + $this->enable_confidential_compute = $var; + + return $this; + } + + /** + * [Output Only] A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGuestOsFeatures() + { + return $this->guest_os_features; + } + + /** + * [Output Only] A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.GuestOsFeature guest_os_features = 79294545; + * @param array<\Google\Cloud\Compute\V1\GuestOsFeature>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGuestOsFeatures($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\GuestOsFeature::class); + $this->guest_os_features = $arr; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#snapshot for Snapshot resources. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#snapshot for Snapshot resources. + * + * 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; + } + + /** + * A fingerprint for the labels being applied to this snapshot, 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 snapshot. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @return string + */ + public function getLabelFingerprint() + { + return isset($this->label_fingerprint) ? $this->label_fingerprint : ''; + } + + public function hasLabelFingerprint() + { + return isset($this->label_fingerprint); + } + + public function clearLabelFingerprint() + { + unset($this->label_fingerprint); + } + + /** + * A fingerprint for the labels being applied to this snapshot, 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 snapshot. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @param string $var + * @return $this + */ + public function setLabelFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->label_fingerprint = $var; + + return $this; + } + + /** + * Labels to apply to this snapshot. These can be later modified by the setLabels method. Label values may be empty. + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels to apply to this snapshot. These can be later modified by the setLabels method. Label values may be empty. + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * [Output Only] Integer license codes indicating which licenses are attached to this snapshot. + * + * Generated from protobuf field repeated int64 license_codes = 45482664; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLicenseCodes() + { + return $this->license_codes; + } + + /** + * [Output Only] Integer license codes indicating which licenses are attached to this snapshot. + * + * Generated from protobuf field repeated int64 license_codes = 45482664; + * @param array|array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLicenseCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT64); + $this->license_codes = $arr; + + return $this; + } + + /** + * [Output Only] A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image). + * + * Generated from protobuf field repeated string licenses = 337642578; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLicenses() + { + return $this->licenses; + } + + /** + * [Output Only] A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image). + * + * Generated from protobuf field repeated string licenses = 337642578; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLicenses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->licenses = $arr; + + return $this; + } + + /** + * An opaque location hint used to place the snapshot close to other resources. This field is for use by internal tools that use the public API. + * + * Generated from protobuf field optional string location_hint = 350519505; + * @return string + */ + public function getLocationHint() + { + return isset($this->location_hint) ? $this->location_hint : ''; + } + + public function hasLocationHint() + { + return isset($this->location_hint); + } + + public function clearLocationHint() + { + unset($this->location_hint); + } + + /** + * An opaque location hint used to place the snapshot close to other resources. This field is for use by internal tools that use the public API. + * + * Generated from protobuf field optional string location_hint = 350519505; + * @param string $var + * @return $this + */ + public function setLocationHint($var) + { + GPBUtil::checkString($var, True); + $this->location_hint = $var; + + return $this; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzi = 480964257; + * @return bool + */ + public function getSatisfiesPzi() + { + return isset($this->satisfies_pzi) ? $this->satisfies_pzi : false; + } + + public function hasSatisfiesPzi() + { + return isset($this->satisfies_pzi); + } + + public function clearSatisfiesPzi() + { + unset($this->satisfies_pzi); + } + + /** + * Output only. Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzi = 480964257; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzi($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzi = $var; + + return $this; + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + * @return bool + */ + public function getSatisfiesPzs() + { + return isset($this->satisfies_pzs) ? $this->satisfies_pzs : false; + } + + public function hasSatisfiesPzs() + { + return isset($this->satisfies_pzs); + } + + public function clearSatisfiesPzs() + { + unset($this->satisfies_pzs); + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool satisfies_pzs = 480964267; + * @param bool $var + * @return $this + */ + public function setSatisfiesPzs($var) + { + GPBUtil::checkBool($var); + $this->satisfies_pzs = $var; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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; + } + + /** + * Encrypts the snapshot using a customer-supplied encryption key. After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the snapshot later. For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request. Customer-supplied encryption keys do not protect access to metadata of the snapshot. If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey snapshot_encryption_key = 43334526; + * @return \Google\Cloud\Compute\V1\CustomerEncryptionKey|null + */ + public function getSnapshotEncryptionKey() + { + return $this->snapshot_encryption_key; + } + + public function hasSnapshotEncryptionKey() + { + return isset($this->snapshot_encryption_key); + } + + public function clearSnapshotEncryptionKey() + { + unset($this->snapshot_encryption_key); + } + + /** + * Encrypts the snapshot using a customer-supplied encryption key. After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the snapshot later. For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request. Customer-supplied encryption keys do not protect access to metadata of the snapshot. If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey snapshot_encryption_key = 43334526; + * @param \Google\Cloud\Compute\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setSnapshotEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomerEncryptionKey::class); + $this->snapshot_encryption_key = $var; + + return $this; + } + + /** + * Indicates the type of the snapshot. + * Check the SnapshotType enum for the list of possible values. + * + * Generated from protobuf field optional string snapshot_type = 124349653; + * @return string + */ + public function getSnapshotType() + { + return isset($this->snapshot_type) ? $this->snapshot_type : ''; + } + + public function hasSnapshotType() + { + return isset($this->snapshot_type); + } + + public function clearSnapshotType() + { + unset($this->snapshot_type); + } + + /** + * Indicates the type of the snapshot. + * Check the SnapshotType enum for the list of possible values. + * + * Generated from protobuf field optional string snapshot_type = 124349653; + * @param string $var + * @return $this + */ + public function setSnapshotType($var) + { + GPBUtil::checkString($var, True); + $this->snapshot_type = $var; + + return $this; + } + + /** + * The source disk used to create this snapshot. + * + * Generated from protobuf field optional string source_disk = 451753793; + * @return string + */ + public function getSourceDisk() + { + return isset($this->source_disk) ? $this->source_disk : ''; + } + + public function hasSourceDisk() + { + return isset($this->source_disk); + } + + public function clearSourceDisk() + { + unset($this->source_disk); + } + + /** + * The source disk used to create this snapshot. + * + * Generated from protobuf field optional string source_disk = 451753793; + * @param string $var + * @return $this + */ + public function setSourceDisk($var) + { + GPBUtil::checkString($var, True); + $this->source_disk = $var; + + return $this; + } + + /** + * The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_disk_encryption_key = 531501153; + * @return \Google\Cloud\Compute\V1\CustomerEncryptionKey|null + */ + public function getSourceDiskEncryptionKey() + { + return $this->source_disk_encryption_key; + } + + public function hasSourceDiskEncryptionKey() + { + return isset($this->source_disk_encryption_key); + } + + public function clearSourceDiskEncryptionKey() + { + unset($this->source_disk_encryption_key); + } + + /** + * The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_disk_encryption_key = 531501153; + * @param \Google\Cloud\Compute\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setSourceDiskEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomerEncryptionKey::class); + $this->source_disk_encryption_key = $var; + + return $this; + } + + /** + * The source disk whose recovery checkpoint will be used to create this snapshot. + * + * Generated from protobuf field optional string source_disk_for_recovery_checkpoint = 359837950; + * @return string + */ + public function getSourceDiskForRecoveryCheckpoint() + { + return isset($this->source_disk_for_recovery_checkpoint) ? $this->source_disk_for_recovery_checkpoint : ''; + } + + public function hasSourceDiskForRecoveryCheckpoint() + { + return isset($this->source_disk_for_recovery_checkpoint); + } + + public function clearSourceDiskForRecoveryCheckpoint() + { + unset($this->source_disk_for_recovery_checkpoint); + } + + /** + * The source disk whose recovery checkpoint will be used to create this snapshot. + * + * Generated from protobuf field optional string source_disk_for_recovery_checkpoint = 359837950; + * @param string $var + * @return $this + */ + public function setSourceDiskForRecoveryCheckpoint($var) + { + GPBUtil::checkString($var, True); + $this->source_disk_for_recovery_checkpoint = $var; + + return $this; + } + + /** + * [Output Only] The ID value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name. + * + * Generated from protobuf field optional string source_disk_id = 454190809; + * @return string + */ + public function getSourceDiskId() + { + return isset($this->source_disk_id) ? $this->source_disk_id : ''; + } + + public function hasSourceDiskId() + { + return isset($this->source_disk_id); + } + + public function clearSourceDiskId() + { + unset($this->source_disk_id); + } + + /** + * [Output Only] The ID value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name. + * + * Generated from protobuf field optional string source_disk_id = 454190809; + * @param string $var + * @return $this + */ + public function setSourceDiskId($var) + { + GPBUtil::checkString($var, True); + $this->source_disk_id = $var; + + return $this; + } + + /** + * The source instant snapshot used to create this snapshot. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instantSnapshots/instantSnapshot - projects/project/zones/zone/instantSnapshots/instantSnapshot - zones/zone/instantSnapshots/instantSnapshot + * + * Generated from protobuf field optional string source_instant_snapshot = 219202054; + * @return string + */ + public function getSourceInstantSnapshot() + { + return isset($this->source_instant_snapshot) ? $this->source_instant_snapshot : ''; + } + + public function hasSourceInstantSnapshot() + { + return isset($this->source_instant_snapshot); + } + + public function clearSourceInstantSnapshot() + { + unset($this->source_instant_snapshot); + } + + /** + * The source instant snapshot used to create this snapshot. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instantSnapshots/instantSnapshot - projects/project/zones/zone/instantSnapshots/instantSnapshot - zones/zone/instantSnapshots/instantSnapshot + * + * Generated from protobuf field optional string source_instant_snapshot = 219202054; + * @param string $var + * @return $this + */ + public function setSourceInstantSnapshot($var) + { + GPBUtil::checkString($var, True); + $this->source_instant_snapshot = $var; + + return $this; + } + + /** + * Customer provided encryption key when creating Snapshot from Instant Snapshot. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_instant_snapshot_encryption_key = 436536060; + * @return \Google\Cloud\Compute\V1\CustomerEncryptionKey|null + */ + public function getSourceInstantSnapshotEncryptionKey() + { + return $this->source_instant_snapshot_encryption_key; + } + + public function hasSourceInstantSnapshotEncryptionKey() + { + return isset($this->source_instant_snapshot_encryption_key); + } + + public function clearSourceInstantSnapshotEncryptionKey() + { + unset($this->source_instant_snapshot_encryption_key); + } + + /** + * Customer provided encryption key when creating Snapshot from Instant Snapshot. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey source_instant_snapshot_encryption_key = 436536060; + * @param \Google\Cloud\Compute\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setSourceInstantSnapshotEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomerEncryptionKey::class); + $this->source_instant_snapshot_encryption_key = $var; + + return $this; + } + + /** + * [Output Only] The unique ID of the instant snapshot used to create this snapshot. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact instant snapshot that was used. + * + * Generated from protobuf field optional string source_instant_snapshot_id = 287582708; + * @return string + */ + public function getSourceInstantSnapshotId() + { + return isset($this->source_instant_snapshot_id) ? $this->source_instant_snapshot_id : ''; + } + + public function hasSourceInstantSnapshotId() + { + return isset($this->source_instant_snapshot_id); + } + + public function clearSourceInstantSnapshotId() + { + unset($this->source_instant_snapshot_id); + } + + /** + * [Output Only] The unique ID of the instant snapshot used to create this snapshot. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact instant snapshot that was used. + * + * Generated from protobuf field optional string source_instant_snapshot_id = 287582708; + * @param string $var + * @return $this + */ + public function setSourceInstantSnapshotId($var) + { + GPBUtil::checkString($var, True); + $this->source_instant_snapshot_id = $var; + + return $this; + } + + /** + * [Output Only] URL of the resource policy which created this scheduled snapshot. + * + * Generated from protobuf field optional string source_snapshot_schedule_policy = 235756291; + * @return string + */ + public function getSourceSnapshotSchedulePolicy() + { + return isset($this->source_snapshot_schedule_policy) ? $this->source_snapshot_schedule_policy : ''; + } + + public function hasSourceSnapshotSchedulePolicy() + { + return isset($this->source_snapshot_schedule_policy); + } + + public function clearSourceSnapshotSchedulePolicy() + { + unset($this->source_snapshot_schedule_policy); + } + + /** + * [Output Only] URL of the resource policy which created this scheduled snapshot. + * + * Generated from protobuf field optional string source_snapshot_schedule_policy = 235756291; + * @param string $var + * @return $this + */ + public function setSourceSnapshotSchedulePolicy($var) + { + GPBUtil::checkString($var, True); + $this->source_snapshot_schedule_policy = $var; + + return $this; + } + + /** + * [Output Only] ID of the resource policy which created this scheduled snapshot. + * + * Generated from protobuf field optional string source_snapshot_schedule_policy_id = 70489047; + * @return string + */ + public function getSourceSnapshotSchedulePolicyId() + { + return isset($this->source_snapshot_schedule_policy_id) ? $this->source_snapshot_schedule_policy_id : ''; + } + + public function hasSourceSnapshotSchedulePolicyId() + { + return isset($this->source_snapshot_schedule_policy_id); + } + + public function clearSourceSnapshotSchedulePolicyId() + { + unset($this->source_snapshot_schedule_policy_id); + } + + /** + * [Output Only] ID of the resource policy which created this scheduled snapshot. + * + * Generated from protobuf field optional string source_snapshot_schedule_policy_id = 70489047; + * @param string $var + * @return $this + */ + public function setSourceSnapshotSchedulePolicyId($var) + { + GPBUtil::checkString($var, True); + $this->source_snapshot_schedule_policy_id = $var; + + return $this; + } + + /** + * [Output Only] The status of the snapshot. This can be CREATING, DELETING, FAILED, READY, or UPLOADING. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] The status of the snapshot. This can be CREATING, DELETING, FAILED, READY, or UPLOADING. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + + /** + * [Output Only] A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion. + * + * Generated from protobuf field optional int64 storage_bytes = 424631719; + * @return int|string + */ + public function getStorageBytes() + { + return isset($this->storage_bytes) ? $this->storage_bytes : 0; + } + + public function hasStorageBytes() + { + return isset($this->storage_bytes); + } + + public function clearStorageBytes() + { + unset($this->storage_bytes); + } + + /** + * [Output Only] A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion. + * + * Generated from protobuf field optional int64 storage_bytes = 424631719; + * @param int|string $var + * @return $this + */ + public function setStorageBytes($var) + { + GPBUtil::checkInt64($var); + $this->storage_bytes = $var; + + return $this; + } + + /** + * [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. + * Check the StorageBytesStatus enum for the list of possible values. + * + * Generated from protobuf field optional string storage_bytes_status = 490739082; + * @return string + */ + public function getStorageBytesStatus() + { + return isset($this->storage_bytes_status) ? $this->storage_bytes_status : ''; + } + + public function hasStorageBytesStatus() + { + return isset($this->storage_bytes_status); + } + + public function clearStorageBytesStatus() + { + unset($this->storage_bytes_status); + } + + /** + * [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. + * Check the StorageBytesStatus enum for the list of possible values. + * + * Generated from protobuf field optional string storage_bytes_status = 490739082; + * @param string $var + * @return $this + */ + public function setStorageBytesStatus($var) + { + GPBUtil::checkString($var, True); + $this->storage_bytes_status = $var; + + return $this; + } + + /** + * Cloud Storage bucket storage location of the snapshot (regional or multi-regional). + * + * Generated from protobuf field repeated string storage_locations = 328005274; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStorageLocations() + { + return $this->storage_locations; + } + + /** + * Cloud Storage bucket storage location of the snapshot (regional or multi-regional). + * + * Generated from protobuf field repeated string storage_locations = 328005274; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStorageLocations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->storage_locations = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Snapshot/Architecture.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Snapshot/Architecture.php new file mode 100644 index 000000000000..80d0cf939560 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Snapshot/Architecture.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.Snapshot.Architecture + */ +class Architecture +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ARCHITECTURE = 0; + */ + const UNDEFINED_ARCHITECTURE = 0; + /** + * Default value indicating Architecture is not set. + * + * Generated from protobuf enum ARCHITECTURE_UNSPECIFIED = 394750507; + */ + const ARCHITECTURE_UNSPECIFIED = 394750507; + /** + * Machines with architecture ARM64 + * + * Generated from protobuf enum ARM64 = 62547450; + */ + const ARM64 = 62547450; + /** + * Machines with architecture X86_64 + * + * Generated from protobuf enum X86_64 = 425300551; + */ + const X86_64 = 425300551; + + private static $valueToName = [ + self::UNDEFINED_ARCHITECTURE => 'UNDEFINED_ARCHITECTURE', + self::ARCHITECTURE_UNSPECIFIED => 'ARCHITECTURE_UNSPECIFIED', + self::ARM64 => 'ARM64', + self::X86_64 => 'X86_64', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Architecture::class, \Google\Cloud\Compute\V1\Snapshot_Architecture::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Snapshot/SnapshotType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Snapshot/SnapshotType.php new file mode 100644 index 000000000000..476b3daa3c33 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Snapshot/SnapshotType.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.Snapshot.SnapshotType + */ +class SnapshotType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_SNAPSHOT_TYPE = 0; + */ + const UNDEFINED_SNAPSHOT_TYPE = 0; + /** + * Generated from protobuf enum ARCHIVE = 506752162; + */ + const ARCHIVE = 506752162; + /** + * Generated from protobuf enum STANDARD = 484642493; + */ + const STANDARD = 484642493; + + private static $valueToName = [ + self::UNDEFINED_SNAPSHOT_TYPE => 'UNDEFINED_SNAPSHOT_TYPE', + self::ARCHIVE => 'ARCHIVE', + self::STANDARD => 'STANDARD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SnapshotType::class, \Google\Cloud\Compute\V1\Snapshot_SnapshotType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Snapshot/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Snapshot/Status.php new file mode 100644 index 000000000000..0b9d31afb70b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Snapshot/Status.php @@ -0,0 +1,85 @@ +google.cloud.compute.v1.Snapshot.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * Snapshot creation is in progress. + * + * Generated from protobuf enum CREATING = 455564985; + */ + const CREATING = 455564985; + /** + * Snapshot is currently being deleted. + * + * Generated from protobuf enum DELETING = 528602024; + */ + const DELETING = 528602024; + /** + * Snapshot creation failed. + * + * Generated from protobuf enum FAILED = 455706685; + */ + const FAILED = 455706685; + /** + * Snapshot has been created successfully. + * + * Generated from protobuf enum READY = 77848963; + */ + const READY = 77848963; + /** + * Snapshot is being uploaded. + * + * Generated from protobuf enum UPLOADING = 267603489; + */ + const UPLOADING = 267603489; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::CREATING => 'CREATING', + self::DELETING => 'DELETING', + self::FAILED => 'FAILED', + self::READY => 'READY', + self::UPLOADING => 'UPLOADING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\Snapshot_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Snapshot/StorageBytesStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Snapshot/StorageBytesStatus.php new file mode 100644 index 000000000000..3181bb129e18 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Snapshot/StorageBytesStatus.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.Snapshot.StorageBytesStatus + */ +class StorageBytesStatus +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STORAGE_BYTES_STATUS = 0; + */ + const UNDEFINED_STORAGE_BYTES_STATUS = 0; + /** + * Generated from protobuf enum UPDATING = 494614342; + */ + const UPDATING = 494614342; + /** + * Generated from protobuf enum UP_TO_DATE = 101306702; + */ + const UP_TO_DATE = 101306702; + + private static $valueToName = [ + self::UNDEFINED_STORAGE_BYTES_STATUS => 'UNDEFINED_STORAGE_BYTES_STATUS', + self::UPDATING => 'UPDATING', + self::UP_TO_DATE => 'UP_TO_DATE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StorageBytesStatus::class, \Google\Cloud\Compute\V1\Snapshot_StorageBytesStatus::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SnapshotList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SnapshotList.php new file mode 100644 index 000000000000..de072186682d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SnapshotList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.SnapshotList + */ +class SnapshotList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of Snapshot resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Snapshot items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\Snapshot>|\Google\Protobuf\Internal\RepeatedField $items + * A list of Snapshot 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 Snapshot resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Snapshot items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of Snapshot resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Snapshot items = 100526016; + * @param array<\Google\Cloud\Compute\V1\Snapshot>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Snapshot::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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SnapshotSettings.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SnapshotSettings.php new file mode 100644 index 000000000000..932deecd5385 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SnapshotSettings.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.SnapshotSettings + */ +class SnapshotSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Policy of which storage location is going to be resolved, and additional data that particularizes how the policy is going to be carried out. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SnapshotSettingsStorageLocationSettings storage_location = 460859641; + */ + protected $storage_location = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\SnapshotSettingsStorageLocationSettings $storage_location + * Policy of which storage location is going to be resolved, and additional data that particularizes how the policy is going to be carried out. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Policy of which storage location is going to be resolved, and additional data that particularizes how the policy is going to be carried out. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SnapshotSettingsStorageLocationSettings storage_location = 460859641; + * @return \Google\Cloud\Compute\V1\SnapshotSettingsStorageLocationSettings|null + */ + public function getStorageLocation() + { + return $this->storage_location; + } + + public function hasStorageLocation() + { + return isset($this->storage_location); + } + + public function clearStorageLocation() + { + unset($this->storage_location); + } + + /** + * Policy of which storage location is going to be resolved, and additional data that particularizes how the policy is going to be carried out. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SnapshotSettingsStorageLocationSettings storage_location = 460859641; + * @param \Google\Cloud\Compute\V1\SnapshotSettingsStorageLocationSettings $var + * @return $this + */ + public function setStorageLocation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SnapshotSettingsStorageLocationSettings::class); + $this->storage_location = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SnapshotSettingsStorageLocationSettings.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SnapshotSettingsStorageLocationSettings.php new file mode 100644 index 000000000000..044a503a6fc8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SnapshotSettingsStorageLocationSettings.php @@ -0,0 +1,114 @@ +google.cloud.compute.v1.SnapshotSettingsStorageLocationSettings + */ +class SnapshotSettingsStorageLocationSettings extends \Google\Protobuf\Internal\Message +{ + /** + * When the policy is SPECIFIC_LOCATIONS, snapshots will be stored in the locations listed in this field. Keys are GCS bucket locations. + * + * Generated from protobuf field map locations = 413423454; + */ + private $locations; + /** + * The chosen location policy. + * Check the Policy enum for the list of possible values. + * + * Generated from protobuf field optional string policy = 91071794; + */ + protected $policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $locations + * When the policy is SPECIFIC_LOCATIONS, snapshots will be stored in the locations listed in this field. Keys are GCS bucket locations. + * @type string $policy + * The chosen location policy. + * Check the Policy enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * When the policy is SPECIFIC_LOCATIONS, snapshots will be stored in the locations listed in this field. Keys are GCS bucket locations. + * + * Generated from protobuf field map locations = 413423454; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLocations() + { + return $this->locations; + } + + /** + * When the policy is SPECIFIC_LOCATIONS, snapshots will be stored in the locations listed in this field. Keys are GCS bucket locations. + * + * Generated from protobuf field map locations = 413423454; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLocations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SnapshotSettingsStorageLocationSettingsStorageLocationPreference::class); + $this->locations = $arr; + + return $this; + } + + /** + * The chosen location policy. + * Check the Policy enum for the list of possible values. + * + * Generated from protobuf field optional string policy = 91071794; + * @return string + */ + public function getPolicy() + { + return isset($this->policy) ? $this->policy : ''; + } + + public function hasPolicy() + { + return isset($this->policy); + } + + public function clearPolicy() + { + unset($this->policy); + } + + /** + * The chosen location policy. + * Check the Policy enum for the list of possible values. + * + * Generated from protobuf field optional string policy = 91071794; + * @param string $var + * @return $this + */ + public function setPolicy($var) + { + GPBUtil::checkString($var, True); + $this->policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SnapshotSettingsStorageLocationSettings/Policy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SnapshotSettingsStorageLocationSettings/Policy.php new file mode 100644 index 000000000000..3e224f69f64c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SnapshotSettingsStorageLocationSettings/Policy.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.SnapshotSettingsStorageLocationSettings.Policy + */ +class Policy +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_POLICY = 0; + */ + const UNDEFINED_POLICY = 0; + /** + * Store snapshot in the same region as with the originating disk. No additional parameters are needed. + * + * Generated from protobuf enum LOCAL_REGION = 403535464; + */ + const LOCAL_REGION = 403535464; + /** + * Store snapshot to the nearest multi region GCS bucket, relative to the originating disk. No additional parameters are needed. + * + * Generated from protobuf enum NEAREST_MULTI_REGION = 212467515; + */ + const NEAREST_MULTI_REGION = 212467515; + /** + * Store snapshot in the specific locations, as specified by the user. The list of regions to store must be defined under the `locations` field. + * + * Generated from protobuf enum SPECIFIC_LOCATIONS = 280093809; + */ + const SPECIFIC_LOCATIONS = 280093809; + /** + * Generated from protobuf enum STORAGE_LOCATION_POLICY_UNSPECIFIED = 250644592; + */ + const STORAGE_LOCATION_POLICY_UNSPECIFIED = 250644592; + + private static $valueToName = [ + self::UNDEFINED_POLICY => 'UNDEFINED_POLICY', + self::LOCAL_REGION => 'LOCAL_REGION', + self::NEAREST_MULTI_REGION => 'NEAREST_MULTI_REGION', + self::SPECIFIC_LOCATIONS => 'SPECIFIC_LOCATIONS', + self::STORAGE_LOCATION_POLICY_UNSPECIFIED => 'STORAGE_LOCATION_POLICY_UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Policy::class, \Google\Cloud\Compute\V1\SnapshotSettingsStorageLocationSettings_Policy::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SnapshotSettingsStorageLocationSettingsStorageLocationPreference.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SnapshotSettingsStorageLocationSettingsStorageLocationPreference.php new file mode 100644 index 000000000000..576252c05615 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SnapshotSettingsStorageLocationSettingsStorageLocationPreference.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.SnapshotSettingsStorageLocationSettingsStorageLocationPreference + */ +class SnapshotSettingsStorageLocationSettingsStorageLocationPreference extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the location. It should be one of the GCS buckets. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Name of the location. It should be one of the GCS buckets. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the location. It should be one of the GCS buckets. + * + * 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); + } + + /** + * Name of the location. It should be one of the GCS buckets. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SourceDiskEncryptionKey.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SourceDiskEncryptionKey.php new file mode 100644 index 000000000000..e73836d2bfbb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SourceDiskEncryptionKey.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.SourceDiskEncryptionKey + */ +class SourceDiskEncryptionKey extends \Google\Protobuf\Internal\Message +{ + /** + * The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677; + */ + protected $disk_encryption_key = null; + /** + * URL of the disk attached to the source instance. This can be a full or valid partial URL. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk + * + * Generated from protobuf field optional string source_disk = 451753793; + */ + protected $source_disk = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\CustomerEncryptionKey $disk_encryption_key + * The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. + * @type string $source_disk + * URL of the disk attached to the source instance. This can be a full or valid partial URL. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677; + * @return \Google\Cloud\Compute\V1\CustomerEncryptionKey|null + */ + public function getDiskEncryptionKey() + { + return $this->disk_encryption_key; + } + + public function hasDiskEncryptionKey() + { + return isset($this->disk_encryption_key); + } + + public function clearDiskEncryptionKey() + { + unset($this->disk_encryption_key); + } + + /** + * The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomerEncryptionKey disk_encryption_key = 271660677; + * @param \Google\Cloud\Compute\V1\CustomerEncryptionKey $var + * @return $this + */ + public function setDiskEncryptionKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomerEncryptionKey::class); + $this->disk_encryption_key = $var; + + return $this; + } + + /** + * URL of the disk attached to the source instance. This can be a full or valid partial URL. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk + * + * Generated from protobuf field optional string source_disk = 451753793; + * @return string + */ + public function getSourceDisk() + { + return isset($this->source_disk) ? $this->source_disk : ''; + } + + public function hasSourceDisk() + { + return isset($this->source_disk); + } + + public function clearSourceDisk() + { + unset($this->source_disk); + } + + /** + * URL of the disk attached to the source instance. This can be a full or valid partial URL. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk + * + * Generated from protobuf field optional string source_disk = 451753793; + * @param string $var + * @return $this + */ + public function setSourceDisk($var) + { + GPBUtil::checkString($var, True); + $this->source_disk = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SourceInstanceParams.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SourceInstanceParams.php new file mode 100644 index 000000000000..838d5a28691f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SourceInstanceParams.php @@ -0,0 +1,67 @@ +google.cloud.compute.v1.SourceInstanceParams + */ +class SourceInstanceParams extends \Google\Protobuf\Internal\Message +{ + /** + * Attached disks configuration. If not provided, defaults are applied: For boot disk and any other R/W disks, the source images for each disk will be used. For read-only disks, they will be attached in read-only mode. Local SSD disks will be created as blank volumes. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.DiskInstantiationConfig disk_configs = 235580623; + */ + private $disk_configs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\DiskInstantiationConfig>|\Google\Protobuf\Internal\RepeatedField $disk_configs + * Attached disks configuration. If not provided, defaults are applied: For boot disk and any other R/W disks, the source images for each disk will be used. For read-only disks, they will be attached in read-only mode. Local SSD disks will be created as blank volumes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Attached disks configuration. If not provided, defaults are applied: For boot disk and any other R/W disks, the source images for each disk will be used. For read-only disks, they will be attached in read-only mode. Local SSD disks will be created as blank volumes. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.DiskInstantiationConfig disk_configs = 235580623; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDiskConfigs() + { + return $this->disk_configs; + } + + /** + * Attached disks configuration. If not provided, defaults are applied: For boot disk and any other R/W disks, the source images for each disk will be used. For read-only disks, they will be attached in read-only mode. Local SSD disks will be created as blank volumes. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.DiskInstantiationConfig disk_configs = 235580623; + * @param array<\Google\Cloud\Compute\V1\DiskInstantiationConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDiskConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\DiskInstantiationConfig::class); + $this->disk_configs = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SourceInstanceProperties.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SourceInstanceProperties.php new file mode 100644 index 000000000000..148701fc8ec8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SourceInstanceProperties.php @@ -0,0 +1,603 @@ +google.cloud.compute.v1.SourceInstanceProperties + */ +class SourceInstanceProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Enables instances created based on this machine image to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set to false. See the Enable IP forwarding documentation for more information. + * + * Generated from protobuf field optional bool can_ip_forward = 467731324; + */ + protected $can_ip_forward = null; + /** + * Whether the instance created from this machine image should be protected against deletion. + * + * Generated from protobuf field optional bool deletion_protection = 458014698; + */ + protected $deletion_protection = null; + /** + * An optional text description for the instances that are created from this machine image. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * An array of disks that are associated with the instances that are created from this machine image. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SavedAttachedDisk disks = 95594102; + */ + private $disks; + /** + * A list of guest accelerator cards' type and count to use for instances created from this machine image. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig guest_accelerators = 463595119; + */ + private $guest_accelerators; + /** + * KeyRevocationActionType of the instance. Supported options are "STOP" and "NONE". The default value is "NONE" if it is not specified. + * Check the KeyRevocationActionType enum for the list of possible values. + * + * Generated from protobuf field optional string key_revocation_action_type = 235941474; + */ + protected $key_revocation_action_type = null; + /** + * Labels to apply to instances that are created from this machine image. + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + /** + * The machine type to use for instances that are created from this machine image. + * + * Generated from protobuf field optional string machine_type = 227711026; + */ + protected $machine_type = null; + /** + * The metadata key/value pairs to assign to instances that are created from this machine image. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Metadata metadata = 86866735; + */ + protected $metadata = null; + /** + * Minimum cpu/platform to be used by instances created from this machine image. The instance may be scheduled on the specified or newer cpu/platform. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more information, read Specifying a Minimum CPU Platform. + * + * Generated from protobuf field optional string min_cpu_platform = 242912759; + */ + protected $min_cpu_platform = null; + /** + * An array of network access configurations for this interface. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkInterface network_interfaces = 52735243; + */ + private $network_interfaces; + /** + * Specifies the scheduling options for the instances that are created from this machine image. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Scheduling scheduling = 386688404; + */ + protected $scheduling = null; + /** + * A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from this machine image. Use metadata queries to obtain the access tokens for these instances. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAccount service_accounts = 277537328; + */ + private $service_accounts; + /** + * A list of tags to apply to the instances that are created from this machine image. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Tags tags = 3552281; + */ + protected $tags = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $can_ip_forward + * Enables instances created based on this machine image to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set to false. See the Enable IP forwarding documentation for more information. + * @type bool $deletion_protection + * Whether the instance created from this machine image should be protected against deletion. + * @type string $description + * An optional text description for the instances that are created from this machine image. + * @type array<\Google\Cloud\Compute\V1\SavedAttachedDisk>|\Google\Protobuf\Internal\RepeatedField $disks + * An array of disks that are associated with the instances that are created from this machine image. + * @type array<\Google\Cloud\Compute\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $guest_accelerators + * A list of guest accelerator cards' type and count to use for instances created from this machine image. + * @type string $key_revocation_action_type + * KeyRevocationActionType of the instance. Supported options are "STOP" and "NONE". The default value is "NONE" if it is not specified. + * Check the KeyRevocationActionType enum for the list of possible values. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels to apply to instances that are created from this machine image. + * @type string $machine_type + * The machine type to use for instances that are created from this machine image. + * @type \Google\Cloud\Compute\V1\Metadata $metadata + * The metadata key/value pairs to assign to instances that are created from this machine image. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information. + * @type string $min_cpu_platform + * Minimum cpu/platform to be used by instances created from this machine image. The instance may be scheduled on the specified or newer cpu/platform. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more information, read Specifying a Minimum CPU Platform. + * @type array<\Google\Cloud\Compute\V1\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $network_interfaces + * An array of network access configurations for this interface. + * @type \Google\Cloud\Compute\V1\Scheduling $scheduling + * Specifies the scheduling options for the instances that are created from this machine image. + * @type array<\Google\Cloud\Compute\V1\ServiceAccount>|\Google\Protobuf\Internal\RepeatedField $service_accounts + * A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from this machine image. Use metadata queries to obtain the access tokens for these instances. + * @type \Google\Cloud\Compute\V1\Tags $tags + * A list of tags to apply to the instances that are created from this machine image. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Enables instances created based on this machine image to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set to false. See the Enable IP forwarding documentation for more information. + * + * Generated from protobuf field optional bool can_ip_forward = 467731324; + * @return bool + */ + public function getCanIpForward() + { + return isset($this->can_ip_forward) ? $this->can_ip_forward : false; + } + + public function hasCanIpForward() + { + return isset($this->can_ip_forward); + } + + public function clearCanIpForward() + { + unset($this->can_ip_forward); + } + + /** + * Enables instances created based on this machine image to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set to false. See the Enable IP forwarding documentation for more information. + * + * Generated from protobuf field optional bool can_ip_forward = 467731324; + * @param bool $var + * @return $this + */ + public function setCanIpForward($var) + { + GPBUtil::checkBool($var); + $this->can_ip_forward = $var; + + return $this; + } + + /** + * Whether the instance created from this machine image should be protected against deletion. + * + * Generated from protobuf field optional bool deletion_protection = 458014698; + * @return bool + */ + public function getDeletionProtection() + { + return isset($this->deletion_protection) ? $this->deletion_protection : false; + } + + public function hasDeletionProtection() + { + return isset($this->deletion_protection); + } + + public function clearDeletionProtection() + { + unset($this->deletion_protection); + } + + /** + * Whether the instance created from this machine image should be protected against deletion. + * + * Generated from protobuf field optional bool deletion_protection = 458014698; + * @param bool $var + * @return $this + */ + public function setDeletionProtection($var) + { + GPBUtil::checkBool($var); + $this->deletion_protection = $var; + + return $this; + } + + /** + * An optional text description for the instances that are created from this machine image. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional text description for the instances that are created from this machine image. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * An array of disks that are associated with the instances that are created from this machine image. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SavedAttachedDisk disks = 95594102; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisks() + { + return $this->disks; + } + + /** + * An array of disks that are associated with the instances that are created from this machine image. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SavedAttachedDisk disks = 95594102; + * @param array<\Google\Cloud\Compute\V1\SavedAttachedDisk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SavedAttachedDisk::class); + $this->disks = $arr; + + return $this; + } + + /** + * A list of guest accelerator cards' type and count to use for instances created from this machine image. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig guest_accelerators = 463595119; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGuestAccelerators() + { + return $this->guest_accelerators; + } + + /** + * A list of guest accelerator cards' type and count to use for instances created from this machine image. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig guest_accelerators = 463595119; + * @param array<\Google\Cloud\Compute\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGuestAccelerators($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AcceleratorConfig::class); + $this->guest_accelerators = $arr; + + return $this; + } + + /** + * KeyRevocationActionType of the instance. Supported options are "STOP" and "NONE". The default value is "NONE" if it is not specified. + * Check the KeyRevocationActionType enum for the list of possible values. + * + * Generated from protobuf field optional string key_revocation_action_type = 235941474; + * @return string + */ + public function getKeyRevocationActionType() + { + return isset($this->key_revocation_action_type) ? $this->key_revocation_action_type : ''; + } + + public function hasKeyRevocationActionType() + { + return isset($this->key_revocation_action_type); + } + + public function clearKeyRevocationActionType() + { + unset($this->key_revocation_action_type); + } + + /** + * KeyRevocationActionType of the instance. Supported options are "STOP" and "NONE". The default value is "NONE" if it is not specified. + * Check the KeyRevocationActionType enum for the list of possible values. + * + * Generated from protobuf field optional string key_revocation_action_type = 235941474; + * @param string $var + * @return $this + */ + public function setKeyRevocationActionType($var) + { + GPBUtil::checkString($var, True); + $this->key_revocation_action_type = $var; + + return $this; + } + + /** + * Labels to apply to instances that are created from this machine image. + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels to apply to instances that are created from this machine image. + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * The machine type to use for instances that are created from this machine image. + * + * Generated from protobuf field optional string machine_type = 227711026; + * @return string + */ + public function getMachineType() + { + return isset($this->machine_type) ? $this->machine_type : ''; + } + + public function hasMachineType() + { + return isset($this->machine_type); + } + + public function clearMachineType() + { + unset($this->machine_type); + } + + /** + * The machine type to use for instances that are created from this machine image. + * + * Generated from protobuf field optional string machine_type = 227711026; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $var; + + return $this; + } + + /** + * The metadata key/value pairs to assign to instances that are created from this machine image. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Metadata metadata = 86866735; + * @return \Google\Cloud\Compute\V1\Metadata|null + */ + public function getMetadata() + { + return $this->metadata; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * The metadata key/value pairs to assign to instances that are created from this machine image. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Metadata metadata = 86866735; + * @param \Google\Cloud\Compute\V1\Metadata $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Metadata::class); + $this->metadata = $var; + + return $this; + } + + /** + * Minimum cpu/platform to be used by instances created from this machine image. The instance may be scheduled on the specified or newer cpu/platform. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more information, read Specifying a Minimum CPU Platform. + * + * Generated from protobuf field optional string min_cpu_platform = 242912759; + * @return string + */ + public function getMinCpuPlatform() + { + return isset($this->min_cpu_platform) ? $this->min_cpu_platform : ''; + } + + public function hasMinCpuPlatform() + { + return isset($this->min_cpu_platform); + } + + public function clearMinCpuPlatform() + { + unset($this->min_cpu_platform); + } + + /** + * Minimum cpu/platform to be used by instances created from this machine image. The instance may be scheduled on the specified or newer cpu/platform. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more information, read Specifying a Minimum CPU Platform. + * + * Generated from protobuf field optional string min_cpu_platform = 242912759; + * @param string $var + * @return $this + */ + public function setMinCpuPlatform($var) + { + GPBUtil::checkString($var, True); + $this->min_cpu_platform = $var; + + return $this; + } + + /** + * An array of network access configurations for this interface. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkInterface network_interfaces = 52735243; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkInterfaces() + { + return $this->network_interfaces; + } + + /** + * An array of network access configurations for this interface. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkInterface network_interfaces = 52735243; + * @param array<\Google\Cloud\Compute\V1\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkInterfaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NetworkInterface::class); + $this->network_interfaces = $arr; + + return $this; + } + + /** + * Specifies the scheduling options for the instances that are created from this machine image. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Scheduling scheduling = 386688404; + * @return \Google\Cloud\Compute\V1\Scheduling|null + */ + public function getScheduling() + { + return $this->scheduling; + } + + public function hasScheduling() + { + return isset($this->scheduling); + } + + public function clearScheduling() + { + unset($this->scheduling); + } + + /** + * Specifies the scheduling options for the instances that are created from this machine image. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Scheduling scheduling = 386688404; + * @param \Google\Cloud\Compute\V1\Scheduling $var + * @return $this + */ + public function setScheduling($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Scheduling::class); + $this->scheduling = $var; + + return $this; + } + + /** + * A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from this machine image. Use metadata queries to obtain the access tokens for these instances. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAccount service_accounts = 277537328; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getServiceAccounts() + { + return $this->service_accounts; + } + + /** + * A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from this machine image. Use metadata queries to obtain the access tokens for these instances. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.ServiceAccount service_accounts = 277537328; + * @param array<\Google\Cloud\Compute\V1\ServiceAccount>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setServiceAccounts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\ServiceAccount::class); + $this->service_accounts = $arr; + + return $this; + } + + /** + * A list of tags to apply to the instances that are created from this machine image. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Tags tags = 3552281; + * @return \Google\Cloud\Compute\V1\Tags|null + */ + public function getTags() + { + return $this->tags; + } + + public function hasTags() + { + return isset($this->tags); + } + + public function clearTags() + { + unset($this->tags); + } + + /** + * A list of tags to apply to the instances that are created from this machine image. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Tags tags = 3552281; + * @param \Google\Cloud\Compute\V1\Tags $var + * @return $this + */ + public function setTags($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Tags::class); + $this->tags = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SourceInstanceProperties/KeyRevocationActionType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SourceInstanceProperties/KeyRevocationActionType.php new file mode 100644 index 000000000000..ba1dc1bd5204 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SourceInstanceProperties/KeyRevocationActionType.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.SourceInstanceProperties.KeyRevocationActionType + */ +class KeyRevocationActionType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_KEY_REVOCATION_ACTION_TYPE = 0; + */ + const UNDEFINED_KEY_REVOCATION_ACTION_TYPE = 0; + /** + * Default value. This value is unused. + * + * Generated from protobuf enum KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 467110106; + */ + const KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 467110106; + /** + * Indicates user chose no operation. + * + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + /** + * Indicates user chose to opt for VM shutdown on key revocation. + * + * Generated from protobuf enum STOP = 2555906; + */ + const STOP = 2555906; + + private static $valueToName = [ + self::UNDEFINED_KEY_REVOCATION_ACTION_TYPE => 'UNDEFINED_KEY_REVOCATION_ACTION_TYPE', + self::KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED => 'KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED', + self::NONE => 'NONE', + self::STOP => 'STOP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(KeyRevocationActionType::class, \Google\Cloud\Compute\V1\SourceInstanceProperties_KeyRevocationActionType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificate.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificate.php new file mode 100644 index 000000000000..cdaa642665d5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificate.php @@ -0,0 +1,643 @@ +google.cloud.compute.v1.SslCertificate + */ +class SslCertificate extends \Google\Protobuf\Internal\Message +{ + /** + * A value read into memory from a certificate file. The certificate file must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert. + * + * Generated from protobuf field optional string certificate = 341787031; + */ + protected $certificate = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] Expire time of the certificate. RFC3339 + * + * Generated from protobuf field optional string expire_time = 440691181; + */ + protected $expire_time = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#sslCertificate for SSL certificates. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * Configuration and status of a managed SSL certificate. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SslCertificateManagedSslCertificate managed = 298389407; + */ + protected $managed = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * A value read into memory from a write-only private key file. The private key file must be in PEM format. For security, only insert requests include this field. + * + * Generated from protobuf field optional string private_key = 361331107; + */ + protected $private_key = null; + /** + * [Output Only] URL of the region where the regional SSL Certificate resides. This field is not applicable to global SSL Certificate. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * Configuration and status of a self-managed SSL certificate. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate self_managed = 329284012; + */ + protected $self_managed = null; + /** + * [Output Only] Domains associated with the certificate via Subject Alternative Name. + * + * Generated from protobuf field repeated string subject_alternative_names = 528807907; + */ + private $subject_alternative_names; + /** + * (Optional) Specifies the type of SSL certificate, either "SELF_MANAGED" or "MANAGED". If not specified, the certificate is self-managed and the fields certificate and private_key are used. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $certificate + * A value read into memory from a certificate file. The certificate file must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type string $expire_time + * [Output Only] Expire time of the certificate. RFC3339 + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of the resource. Always compute#sslCertificate for SSL certificates. + * @type \Google\Cloud\Compute\V1\SslCertificateManagedSslCertificate $managed + * Configuration and status of a managed SSL certificate. + * @type string $name + * 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 string $private_key + * A value read into memory from a write-only private key file. The private key file must be in PEM format. For security, only insert requests include this field. + * @type string $region + * [Output Only] URL of the region where the regional SSL Certificate resides. This field is not applicable to global SSL Certificate. + * @type string $self_link + * [Output only] Server-defined URL for the resource. + * @type \Google\Cloud\Compute\V1\SslCertificateSelfManagedSslCertificate $self_managed + * Configuration and status of a self-managed SSL certificate. + * @type array|\Google\Protobuf\Internal\RepeatedField $subject_alternative_names + * [Output Only] Domains associated with the certificate via Subject Alternative Name. + * @type string $type + * (Optional) Specifies the type of SSL certificate, either "SELF_MANAGED" or "MANAGED". If not specified, the certificate is self-managed and the fields certificate and private_key are used. + * Check the Type enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A value read into memory from a certificate file. The certificate file must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert. + * + * Generated from protobuf field optional string certificate = 341787031; + * @return string + */ + public function getCertificate() + { + return isset($this->certificate) ? $this->certificate : ''; + } + + public function hasCertificate() + { + return isset($this->certificate); + } + + public function clearCertificate() + { + unset($this->certificate); + } + + /** + * A value read into memory from a certificate file. The certificate file must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert. + * + * Generated from protobuf field optional string certificate = 341787031; + * @param string $var + * @return $this + */ + public function setCertificate($var) + { + GPBUtil::checkString($var, True); + $this->certificate = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] Expire time of the certificate. RFC3339 + * + * Generated from protobuf field optional string expire_time = 440691181; + * @return string + */ + public function getExpireTime() + { + return isset($this->expire_time) ? $this->expire_time : ''; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * [Output Only] Expire time of the certificate. RFC3339 + * + * Generated from protobuf field optional string expire_time = 440691181; + * @param string $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkString($var, True); + $this->expire_time = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#sslCertificate for SSL certificates. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#sslCertificate for SSL certificates. + * + * 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; + } + + /** + * Configuration and status of a managed SSL certificate. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SslCertificateManagedSslCertificate managed = 298389407; + * @return \Google\Cloud\Compute\V1\SslCertificateManagedSslCertificate|null + */ + public function getManaged() + { + return $this->managed; + } + + public function hasManaged() + { + return isset($this->managed); + } + + public function clearManaged() + { + unset($this->managed); + } + + /** + * Configuration and status of a managed SSL certificate. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SslCertificateManagedSslCertificate managed = 298389407; + * @param \Google\Cloud\Compute\V1\SslCertificateManagedSslCertificate $var + * @return $this + */ + public function setManaged($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SslCertificateManagedSslCertificate::class); + $this->managed = $var; + + return $this; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * A value read into memory from a write-only private key file. The private key file must be in PEM format. For security, only insert requests include this field. + * + * Generated from protobuf field optional string private_key = 361331107; + * @return string + */ + public function getPrivateKey() + { + return isset($this->private_key) ? $this->private_key : ''; + } + + public function hasPrivateKey() + { + return isset($this->private_key); + } + + public function clearPrivateKey() + { + unset($this->private_key); + } + + /** + * A value read into memory from a write-only private key file. The private key file must be in PEM format. For security, only insert requests include this field. + * + * Generated from protobuf field optional string private_key = 361331107; + * @param string $var + * @return $this + */ + public function setPrivateKey($var) + { + GPBUtil::checkString($var, True); + $this->private_key = $var; + + return $this; + } + + /** + * [Output Only] URL of the region where the regional SSL Certificate resides. This field is not applicable to global SSL Certificate. + * + * 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 regional SSL Certificate resides. This field is not applicable to global SSL Certificate. + * + * 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] Server-defined URL for the 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 the 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; + } + + /** + * Configuration and status of a self-managed SSL certificate. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate self_managed = 329284012; + * @return \Google\Cloud\Compute\V1\SslCertificateSelfManagedSslCertificate|null + */ + public function getSelfManaged() + { + return $this->self_managed; + } + + public function hasSelfManaged() + { + return isset($this->self_managed); + } + + public function clearSelfManaged() + { + unset($this->self_managed); + } + + /** + * Configuration and status of a self-managed SSL certificate. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate self_managed = 329284012; + * @param \Google\Cloud\Compute\V1\SslCertificateSelfManagedSslCertificate $var + * @return $this + */ + public function setSelfManaged($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SslCertificateSelfManagedSslCertificate::class); + $this->self_managed = $var; + + return $this; + } + + /** + * [Output Only] Domains associated with the certificate via Subject Alternative Name. + * + * Generated from protobuf field repeated string subject_alternative_names = 528807907; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSubjectAlternativeNames() + { + return $this->subject_alternative_names; + } + + /** + * [Output Only] Domains associated with the certificate via Subject Alternative Name. + * + * Generated from protobuf field repeated string subject_alternative_names = 528807907; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSubjectAlternativeNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->subject_alternative_names = $arr; + + return $this; + } + + /** + * (Optional) Specifies the type of SSL certificate, either "SELF_MANAGED" or "MANAGED". If not specified, the certificate is self-managed and the fields certificate and private_key are used. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * (Optional) Specifies the type of SSL certificate, either "SELF_MANAGED" or "MANAGED". If not specified, the certificate is self-managed and the fields certificate and private_key are used. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificate/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificate/Type.php new file mode 100644 index 000000000000..e0c39f423ad7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificate/Type.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.SslCertificate.Type + */ +class Type +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TYPE = 0; + */ + const UNDEFINED_TYPE = 0; + /** + * Google-managed SSLCertificate. + * + * Generated from protobuf enum MANAGED = 479501183; + */ + const MANAGED = 479501183; + /** + * Certificate uploaded by user. + * + * Generated from protobuf enum SELF_MANAGED = 434437516; + */ + const SELF_MANAGED = 434437516; + /** + * Generated from protobuf enum TYPE_UNSPECIFIED = 437714322; + */ + const TYPE_UNSPECIFIED = 437714322; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::MANAGED => 'MANAGED', + self::SELF_MANAGED => 'SELF_MANAGED', + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Compute\V1\SslCertificate_Type::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificateAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificateAggregatedList.php new file mode 100644 index 000000000000..75f0ec6f5dfc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificateAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.SslCertificateAggregatedList + */ +class SslCertificateAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of SslCertificatesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#sslCertificateAggregatedList for lists of SSL Certificates. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 SslCertificatesScopedList resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#sslCertificateAggregatedList for lists of SSL Certificates. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 SslCertificatesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of SslCertificatesScopedList 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\SslCertificatesScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#sslCertificateAggregatedList for lists of SSL Certificates. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#sslCertificateAggregatedList for lists of SSL Certificates. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificateList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificateList.php new file mode 100644 index 000000000000..8e4026985531 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificateList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.SslCertificateList + */ +class SslCertificateList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of SslCertificate resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SslCertificate items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\SslCertificate>|\Google\Protobuf\Internal\RepeatedField $items + * A list of SslCertificate 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 SslCertificate resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SslCertificate items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of SslCertificate resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SslCertificate items = 100526016; + * @param array<\Google\Cloud\Compute\V1\SslCertificate>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SslCertificate::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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificateManagedSslCertificate.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificateManagedSslCertificate.php new file mode 100644 index 000000000000..ad4afe804104 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificateManagedSslCertificate.php @@ -0,0 +1,149 @@ +google.cloud.compute.v1.SslCertificateManagedSslCertificate + */ +class SslCertificateManagedSslCertificate extends \Google\Protobuf\Internal\Message +{ + /** + * [Output only] Detailed statuses of the domains specified for managed certificate resource. + * + * Generated from protobuf field map domain_status = 360305613; + */ + private $domain_status; + /** + * The domains for which a managed SSL certificate will be generated. Each Google-managed SSL certificate supports up to the [maximum number of domains per Google-managed SSL certificate](/load-balancing/docs/quotas#ssl_certificates). + * + * Generated from protobuf field repeated string domains = 226935855; + */ + private $domains; + /** + * [Output only] Status of the managed certificate resource. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $domain_status + * [Output only] Detailed statuses of the domains specified for managed certificate resource. + * @type array|\Google\Protobuf\Internal\RepeatedField $domains + * The domains for which a managed SSL certificate will be generated. Each Google-managed SSL certificate supports up to the [maximum number of domains per Google-managed SSL certificate](/load-balancing/docs/quotas#ssl_certificates). + * @type string $status + * [Output only] Status of the managed certificate resource. + * Check the Status enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output only] Detailed statuses of the domains specified for managed certificate resource. + * + * Generated from protobuf field map domain_status = 360305613; + * @return \Google\Protobuf\Internal\MapField + */ + public function getDomainStatus() + { + return $this->domain_status; + } + + /** + * [Output only] Detailed statuses of the domains specified for managed certificate resource. + * + * Generated from protobuf field map domain_status = 360305613; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setDomainStatus($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->domain_status = $arr; + + return $this; + } + + /** + * The domains for which a managed SSL certificate will be generated. Each Google-managed SSL certificate supports up to the [maximum number of domains per Google-managed SSL certificate](/load-balancing/docs/quotas#ssl_certificates). + * + * Generated from protobuf field repeated string domains = 226935855; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDomains() + { + return $this->domains; + } + + /** + * The domains for which a managed SSL certificate will be generated. Each Google-managed SSL certificate supports up to the [maximum number of domains per Google-managed SSL certificate](/load-balancing/docs/quotas#ssl_certificates). + * + * Generated from protobuf field repeated string domains = 226935855; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDomains($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->domains = $arr; + + return $this; + } + + /** + * [Output only] Status of the managed certificate resource. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output only] Status of the managed certificate resource. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificateManagedSslCertificate/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificateManagedSslCertificate/Status.php new file mode 100644 index 000000000000..7c6c15c70b50 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificateManagedSslCertificate/Status.php @@ -0,0 +1,90 @@ +google.cloud.compute.v1.SslCertificateManagedSslCertificate.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * The certificate management is working, and a certificate has been provisioned. + * + * Generated from protobuf enum ACTIVE = 314733318; + */ + const ACTIVE = 314733318; + /** + * Generated from protobuf enum MANAGED_CERTIFICATE_STATUS_UNSPECIFIED = 474800850; + */ + const MANAGED_CERTIFICATE_STATUS_UNSPECIFIED = 474800850; + /** + * The certificate management is working. GCP will attempt to provision the first certificate. + * + * Generated from protobuf enum PROVISIONING = 290896621; + */ + const PROVISIONING = 290896621; + /** + * Certificate provisioning failed due to an issue with the DNS or load balancing configuration. For details of which domain failed, consult domain_status field. + * + * Generated from protobuf enum PROVISIONING_FAILED = 76813775; + */ + const PROVISIONING_FAILED = 76813775; + /** + * Certificate provisioning failed due to an issue with the DNS or load balancing configuration. It won't be retried. To try again delete and create a new managed SslCertificate resource. For details of which domain failed, consult domain_status field. + * + * Generated from protobuf enum PROVISIONING_FAILED_PERMANENTLY = 275036203; + */ + const PROVISIONING_FAILED_PERMANENTLY = 275036203; + /** + * Renewal of the certificate has failed due to an issue with the DNS or load balancing configuration. The existing cert is still serving; however, it will expire shortly. To provision a renewed certificate, delete and create a new managed SslCertificate resource. For details on which domain failed, consult domain_status field. + * + * Generated from protobuf enum RENEWAL_FAILED = 434659076; + */ + const RENEWAL_FAILED = 434659076; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::ACTIVE => 'ACTIVE', + self::MANAGED_CERTIFICATE_STATUS_UNSPECIFIED => 'MANAGED_CERTIFICATE_STATUS_UNSPECIFIED', + self::PROVISIONING => 'PROVISIONING', + self::PROVISIONING_FAILED => 'PROVISIONING_FAILED', + self::PROVISIONING_FAILED_PERMANENTLY => 'PROVISIONING_FAILED_PERMANENTLY', + self::RENEWAL_FAILED => 'RENEWAL_FAILED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\SslCertificateManagedSslCertificate_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificateSelfManagedSslCertificate.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificateSelfManagedSslCertificate.php new file mode 100644 index 000000000000..68cbc09e74be --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificateSelfManagedSslCertificate.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate + */ +class SslCertificateSelfManagedSslCertificate extends \Google\Protobuf\Internal\Message +{ + /** + * A local certificate file. The certificate must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert. + * + * Generated from protobuf field optional string certificate = 341787031; + */ + protected $certificate = null; + /** + * A write-only private key in PEM format. Only insert requests will include this field. + * + * Generated from protobuf field optional string private_key = 361331107; + */ + protected $private_key = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $certificate + * A local certificate file. The certificate must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert. + * @type string $private_key + * A write-only private key in PEM format. Only insert requests will include this field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A local certificate file. The certificate must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert. + * + * Generated from protobuf field optional string certificate = 341787031; + * @return string + */ + public function getCertificate() + { + return isset($this->certificate) ? $this->certificate : ''; + } + + public function hasCertificate() + { + return isset($this->certificate); + } + + public function clearCertificate() + { + unset($this->certificate); + } + + /** + * A local certificate file. The certificate must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert. + * + * Generated from protobuf field optional string certificate = 341787031; + * @param string $var + * @return $this + */ + public function setCertificate($var) + { + GPBUtil::checkString($var, True); + $this->certificate = $var; + + return $this; + } + + /** + * A write-only private key in PEM format. Only insert requests will include this field. + * + * Generated from protobuf field optional string private_key = 361331107; + * @return string + */ + public function getPrivateKey() + { + return isset($this->private_key) ? $this->private_key : ''; + } + + public function hasPrivateKey() + { + return isset($this->private_key); + } + + public function clearPrivateKey() + { + unset($this->private_key); + } + + /** + * A write-only private key in PEM format. Only insert requests will include this field. + * + * Generated from protobuf field optional string private_key = 361331107; + * @param string $var + * @return $this + */ + public function setPrivateKey($var) + { + GPBUtil::checkString($var, True); + $this->private_key = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificatesScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificatesScopedList.php new file mode 100644 index 000000000000..87e8dca40524 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslCertificatesScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.SslCertificatesScopedList + */ +class SslCertificatesScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * List of SslCertificates contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SslCertificate ssl_certificates = 366006543; + */ + private $ssl_certificates; + /** + * Informational warning which replaces the list of backend services when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\SslCertificate>|\Google\Protobuf\Internal\RepeatedField $ssl_certificates + * List of SslCertificates contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * Informational warning which replaces the list of backend services when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * List of SslCertificates contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SslCertificate ssl_certificates = 366006543; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSslCertificates() + { + return $this->ssl_certificates; + } + + /** + * List of SslCertificates contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SslCertificate ssl_certificates = 366006543; + * @param array<\Google\Cloud\Compute\V1\SslCertificate>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSslCertificates($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SslCertificate::class); + $this->ssl_certificates = $arr; + + return $this; + } + + /** + * Informational warning which replaces the list of backend services 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); + } + + /** + * Informational warning which replaces the list of backend services 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPoliciesAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPoliciesAggregatedList.php new file mode 100644 index 000000000000..55af644842d5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPoliciesAggregatedList.php @@ -0,0 +1,357 @@ +google.cloud.compute.v1.SslPoliciesAggregatedList + */ +class SslPoliciesAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string etag = 3123477; + */ + protected $etag = null; + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of SslPoliciesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#sslPolicyAggregatedList for lists of SSL Policies. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $etag + * @type string $id + * [Output Only] Unique identifier for the resource; defined by the server. + * @type array|\Google\Protobuf\Internal\MapField $items + * A list of SslPoliciesScopedList resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#sslPolicyAggregatedList for lists of SSL Policies. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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); + } + + /** + * Generated from protobuf field optional string etag = 3123477; + * @return string + */ + public function getEtag() + { + return isset($this->etag) ? $this->etag : ''; + } + + public function hasEtag() + { + return isset($this->etag); + } + + public function clearEtag() + { + unset($this->etag); + } + + /** + * Generated from protobuf field optional string etag = 3123477; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * [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 SslPoliciesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of SslPoliciesScopedList 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\SslPoliciesScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#sslPolicyAggregatedList for lists of SSL Policies. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#sslPolicyAggregatedList for lists of SSL Policies. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPoliciesList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPoliciesList.php new file mode 100644 index 000000000000..f2e465b07d42 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPoliciesList.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.SslPoliciesList + */ +class SslPoliciesList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of SslPolicy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SslPolicy items = 100526016; + */ + private $items; + /** + * [Output Only] Type of the resource. Always compute#sslPoliciesList for lists of sslPolicies. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\SslPolicy>|\Google\Protobuf\Internal\RepeatedField $items + * A list of SslPolicy resources. + * @type string $kind + * [Output Only] Type of the resource. Always compute#sslPoliciesList for lists of sslPolicies. + * @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 SslPolicy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SslPolicy items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of SslPolicy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SslPolicy items = 100526016; + * @param array<\Google\Cloud\Compute\V1\SslPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SslPolicy::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#sslPoliciesList for lists of sslPolicies. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#sslPoliciesList for lists of sslPolicies. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPoliciesListAvailableFeaturesResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPoliciesListAvailableFeaturesResponse.php new file mode 100644 index 000000000000..c7ec42b186fc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPoliciesListAvailableFeaturesResponse.php @@ -0,0 +1,59 @@ +google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse + */ +class SslPoliciesListAvailableFeaturesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated string features = 246211645; + */ + private $features; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $features + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated string features = 246211645; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFeatures() + { + return $this->features; + } + + /** + * Generated from protobuf field repeated string features = 246211645; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFeatures($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->features = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPoliciesScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPoliciesScopedList.php new file mode 100644 index 000000000000..63a901c49156 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPoliciesScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.SslPoliciesScopedList + */ +class SslPoliciesScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * A list of SslPolicies contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SslPolicy ssl_policies = 209941027; + */ + private $ssl_policies; + /** + * Informational warning which replaces the list of SSL policies when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\SslPolicy>|\Google\Protobuf\Internal\RepeatedField $ssl_policies + * A list of SslPolicies contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * Informational warning which replaces the list of SSL policies when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of SslPolicies contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SslPolicy ssl_policies = 209941027; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSslPolicies() + { + return $this->ssl_policies; + } + + /** + * A list of SslPolicies contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SslPolicy ssl_policies = 209941027; + * @param array<\Google\Cloud\Compute\V1\SslPolicy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSslPolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SslPolicy::class); + $this->ssl_policies = $arr; + + return $this; + } + + /** + * Informational warning which replaces the list of SSL policies 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); + } + + /** + * Informational warning which replaces the list of SSL policies 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPolicy.php new file mode 100644 index 000000000000..18c709b4d9a4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPolicy.php @@ -0,0 +1,583 @@ +google.cloud.compute.v1.SslPolicy + */ +class SslPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * A list of features enabled when the selected profile is CUSTOM. The method returns the set of features that can be specified in this list. This field must be empty if the profile is not CUSTOM. + * + * Generated from protobuf field repeated string custom_features = 34789707; + */ + private $custom_features; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The list of features enabled in the SSL policy. + * + * Generated from protobuf field repeated string enabled_features = 469017467; + */ + private $enabled_features; + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a SslPolicy. An up-to-date fingerprint must be provided in order to update the SslPolicy, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an SslPolicy. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output only] Type of the resource. Always compute#sslPolicyfor SSL policies. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * The minimum version of SSL protocol that can be used by the clients to establish a connection with the load balancer. This can be one of TLS_1_0, TLS_1_1, TLS_1_2. + * Check the MinTlsVersion enum for the list of possible values. + * + * Generated from protobuf field optional string min_tls_version = 8155943; + */ + protected $min_tls_version = null; + /** + * Name of the resource. 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Profile specifies the set of SSL features that can be used by the load balancer when negotiating SSL with clients. This can be one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, the set of SSL features to enable must be specified in the customFeatures field. + * Check the Profile enum for the list of possible values. + * + * Generated from protobuf field optional string profile = 227445161; + */ + protected $profile = null; + /** + * [Output Only] URL of the region where the regional SSL policy resides. This field is not applicable to global SSL policies. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] If potential misconfigurations are detected for this SSL policy, this field will be populated with warning messages. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Warnings warnings = 498091095; + */ + private $warnings; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type array|\Google\Protobuf\Internal\RepeatedField $custom_features + * A list of features enabled when the selected profile is CUSTOM. The method returns the set of features that can be specified in this list. This field must be empty if the profile is not CUSTOM. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type array|\Google\Protobuf\Internal\RepeatedField $enabled_features + * [Output Only] The list of features enabled in the SSL policy. + * @type string $fingerprint + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a SslPolicy. An up-to-date fingerprint must be provided in order to update the SslPolicy, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an SslPolicy. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output only] Type of the resource. Always compute#sslPolicyfor SSL policies. + * @type string $min_tls_version + * The minimum version of SSL protocol that can be used by the clients to establish a connection with the load balancer. This can be one of TLS_1_0, TLS_1_1, TLS_1_2. + * Check the MinTlsVersion enum for the list of possible values. + * @type string $name + * Name of the resource. 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 string $profile + * Profile specifies the set of SSL features that can be used by the load balancer when negotiating SSL with clients. This can be one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, the set of SSL features to enable must be specified in the customFeatures field. + * Check the Profile enum for the list of possible values. + * @type string $region + * [Output Only] URL of the region where the regional SSL policy resides. This field is not applicable to global SSL policies. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type array<\Google\Cloud\Compute\V1\Warnings>|\Google\Protobuf\Internal\RepeatedField $warnings + * [Output Only] If potential misconfigurations are detected for this SSL policy, this field will be populated with warning messages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * A list of features enabled when the selected profile is CUSTOM. The method returns the set of features that can be specified in this list. This field must be empty if the profile is not CUSTOM. + * + * Generated from protobuf field repeated string custom_features = 34789707; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCustomFeatures() + { + return $this->custom_features; + } + + /** + * A list of features enabled when the selected profile is CUSTOM. The method returns the set of features that can be specified in this list. This field must be empty if the profile is not CUSTOM. + * + * Generated from protobuf field repeated string custom_features = 34789707; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCustomFeatures($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->custom_features = $arr; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The list of features enabled in the SSL policy. + * + * Generated from protobuf field repeated string enabled_features = 469017467; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEnabledFeatures() + { + return $this->enabled_features; + } + + /** + * [Output Only] The list of features enabled in the SSL policy. + * + * Generated from protobuf field repeated string enabled_features = 469017467; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEnabledFeatures($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->enabled_features = $arr; + + return $this; + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a SslPolicy. An up-to-date fingerprint must be provided in order to update the SslPolicy, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an SslPolicy. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a SslPolicy. An up-to-date fingerprint must be provided in order to update the SslPolicy, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an SslPolicy. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output only] Type of the resource. Always compute#sslPolicyfor SSL policies. + * + * 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); + } + + /** + * [Output only] Type of the resource. Always compute#sslPolicyfor SSL policies. + * + * 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; + } + + /** + * The minimum version of SSL protocol that can be used by the clients to establish a connection with the load balancer. This can be one of TLS_1_0, TLS_1_1, TLS_1_2. + * Check the MinTlsVersion enum for the list of possible values. + * + * Generated from protobuf field optional string min_tls_version = 8155943; + * @return string + */ + public function getMinTlsVersion() + { + return isset($this->min_tls_version) ? $this->min_tls_version : ''; + } + + public function hasMinTlsVersion() + { + return isset($this->min_tls_version); + } + + public function clearMinTlsVersion() + { + unset($this->min_tls_version); + } + + /** + * The minimum version of SSL protocol that can be used by the clients to establish a connection with the load balancer. This can be one of TLS_1_0, TLS_1_1, TLS_1_2. + * Check the MinTlsVersion enum for the list of possible values. + * + * Generated from protobuf field optional string min_tls_version = 8155943; + * @param string $var + * @return $this + */ + public function setMinTlsVersion($var) + { + GPBUtil::checkString($var, True); + $this->min_tls_version = $var; + + return $this; + } + + /** + * Name of the resource. 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. + * + * 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); + } + + /** + * Name of the resource. 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. + * + * 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; + } + + /** + * Profile specifies the set of SSL features that can be used by the load balancer when negotiating SSL with clients. This can be one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, the set of SSL features to enable must be specified in the customFeatures field. + * Check the Profile enum for the list of possible values. + * + * Generated from protobuf field optional string profile = 227445161; + * @return string + */ + public function getProfile() + { + return isset($this->profile) ? $this->profile : ''; + } + + public function hasProfile() + { + return isset($this->profile); + } + + public function clearProfile() + { + unset($this->profile); + } + + /** + * Profile specifies the set of SSL features that can be used by the load balancer when negotiating SSL with clients. This can be one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, the set of SSL features to enable must be specified in the customFeatures field. + * Check the Profile enum for the list of possible values. + * + * Generated from protobuf field optional string profile = 227445161; + * @param string $var + * @return $this + */ + public function setProfile($var) + { + GPBUtil::checkString($var, True); + $this->profile = $var; + + return $this; + } + + /** + * [Output Only] URL of the region where the regional SSL policy resides. This field is not applicable to global SSL policies. + * + * 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 regional SSL policy resides. This field is not applicable to global SSL policies. + * + * 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] Server-defined URL for the 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 the 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] If potential misconfigurations are detected for this SSL policy, this field will be populated with warning messages. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Warnings warnings = 498091095; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWarnings() + { + return $this->warnings; + } + + /** + * [Output Only] If potential misconfigurations are detected for this SSL policy, this field will be populated with warning messages. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Warnings warnings = 498091095; + * @param array<\Google\Cloud\Compute\V1\Warnings>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWarnings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Warnings::class); + $this->warnings = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPolicy/MinTlsVersion.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPolicy/MinTlsVersion.php new file mode 100644 index 000000000000..b145f9252927 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPolicy/MinTlsVersion.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.SslPolicy.MinTlsVersion + */ +class MinTlsVersion +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MIN_TLS_VERSION = 0; + */ + const UNDEFINED_MIN_TLS_VERSION = 0; + /** + * TLS 1.0 + * + * Generated from protobuf enum TLS_1_0 = 33116734; + */ + const TLS_1_0 = 33116734; + /** + * TLS 1.1 + * + * Generated from protobuf enum TLS_1_1 = 33116735; + */ + const TLS_1_1 = 33116735; + /** + * TLS 1.2 + * + * Generated from protobuf enum TLS_1_2 = 33116736; + */ + const TLS_1_2 = 33116736; + + private static $valueToName = [ + self::UNDEFINED_MIN_TLS_VERSION => 'UNDEFINED_MIN_TLS_VERSION', + self::TLS_1_0 => 'TLS_1_0', + self::TLS_1_1 => 'TLS_1_1', + self::TLS_1_2 => 'TLS_1_2', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MinTlsVersion::class, \Google\Cloud\Compute\V1\SslPolicy_MinTlsVersion::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPolicy/Profile.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPolicy/Profile.php new file mode 100644 index 000000000000..8ee6672c44e9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPolicy/Profile.php @@ -0,0 +1,78 @@ +google.cloud.compute.v1.SslPolicy.Profile + */ +class Profile +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PROFILE = 0; + */ + const UNDEFINED_PROFILE = 0; + /** + * Compatible profile. Allows the broadset set of clients, even those which support only out-of-date SSL features to negotiate with the load balancer. + * + * Generated from protobuf enum COMPATIBLE = 179357396; + */ + const COMPATIBLE = 179357396; + /** + * Custom profile. Allow only the set of allowed SSL features specified in the customFeatures field. + * + * Generated from protobuf enum CUSTOM = 388595569; + */ + const CUSTOM = 388595569; + /** + * Modern profile. Supports a wide set of SSL features, allowing modern clients to negotiate SSL with the load balancer. + * + * Generated from protobuf enum MODERN = 132013855; + */ + const MODERN = 132013855; + /** + * Restricted profile. Supports a reduced set of SSL features, intended to meet stricter compliance requirements. + * + * Generated from protobuf enum RESTRICTED = 261551195; + */ + const RESTRICTED = 261551195; + + private static $valueToName = [ + self::UNDEFINED_PROFILE => 'UNDEFINED_PROFILE', + self::COMPATIBLE => 'COMPATIBLE', + self::CUSTOM => 'CUSTOM', + self::MODERN => 'MODERN', + self::RESTRICTED => 'RESTRICTED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Profile::class, \Google\Cloud\Compute\V1\SslPolicy_Profile::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPolicyReference.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPolicyReference.php new file mode 100644 index 000000000000..3312493c7aee --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SslPolicyReference.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.SslPolicyReference + */ +class SslPolicyReference extends \Google\Protobuf\Internal\Message +{ + /** + * URL of the SSL policy resource. Set this to empty string to clear any existing SSL policy associated with the target proxy resource. + * + * Generated from protobuf field optional string ssl_policy = 295190213; + */ + protected $ssl_policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ssl_policy + * URL of the SSL policy resource. Set this to empty string to clear any existing SSL policy associated with the target proxy resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * URL of the SSL policy resource. Set this to empty string to clear any existing SSL policy associated with the target proxy resource. + * + * Generated from protobuf field optional string ssl_policy = 295190213; + * @return string + */ + public function getSslPolicy() + { + return isset($this->ssl_policy) ? $this->ssl_policy : ''; + } + + public function hasSslPolicy() + { + return isset($this->ssl_policy); + } + + public function clearSslPolicy() + { + unset($this->ssl_policy); + } + + /** + * URL of the SSL policy resource. Set this to empty string to clear any existing SSL policy associated with the target proxy resource. + * + * Generated from protobuf field optional string ssl_policy = 295190213; + * @param string $var + * @return $this + */ + public function setSslPolicy($var) + { + GPBUtil::checkString($var, True); + $this->ssl_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StartAsyncReplicationDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StartAsyncReplicationDiskRequest.php new file mode 100644 index 000000000000..9d5474042b77 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StartAsyncReplicationDiskRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.StartAsyncReplicationDiskRequest + */ +class StartAsyncReplicationDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the persistent disk. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.DisksStartAsyncReplicationRequest disks_start_async_replication_request_resource = 470814554 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disks_start_async_replication_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $disk The name of the persistent disk. + * @param \Google\Cloud\Compute\V1\DisksStartAsyncReplicationRequest $disksStartAsyncReplicationRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\StartAsyncReplicationDiskRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $disk, \Google\Cloud\Compute\V1\DisksStartAsyncReplicationRequest $disksStartAsyncReplicationRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setDisk($disk) + ->setDisksStartAsyncReplicationRequestResource($disksStartAsyncReplicationRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $disk + * The name of the persistent disk. + * @type \Google\Cloud\Compute\V1\DisksStartAsyncReplicationRequest $disks_start_async_replication_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 name of the persistent disk. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisk() + { + return $this->disk; + } + + /** + * The name of the persistent disk. + * + * 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.DisksStartAsyncReplicationRequest disks_start_async_replication_request_resource = 470814554 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\DisksStartAsyncReplicationRequest|null + */ + public function getDisksStartAsyncReplicationRequestResource() + { + return $this->disks_start_async_replication_request_resource; + } + + public function hasDisksStartAsyncReplicationRequestResource() + { + return isset($this->disks_start_async_replication_request_resource); + } + + public function clearDisksStartAsyncReplicationRequestResource() + { + unset($this->disks_start_async_replication_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.DisksStartAsyncReplicationRequest disks_start_async_replication_request_resource = 470814554 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\DisksStartAsyncReplicationRequest $var + * @return $this + */ + public function setDisksStartAsyncReplicationRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DisksStartAsyncReplicationRequest::class); + $this->disks_start_async_replication_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StartAsyncReplicationRegionDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StartAsyncReplicationRegionDiskRequest.php new file mode 100644 index 000000000000..9b406bf6285e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StartAsyncReplicationRegionDiskRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.StartAsyncReplicationRegionDiskRequest + */ +class StartAsyncReplicationRegionDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the persistent disk. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionDisksStartAsyncReplicationRequest region_disks_start_async_replication_request_resource = 474326021 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_disks_start_async_replication_request_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $disk The name of the persistent disk. + * @param \Google\Cloud\Compute\V1\RegionDisksStartAsyncReplicationRequest $regionDisksStartAsyncReplicationRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\StartAsyncReplicationRegionDiskRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $disk, \Google\Cloud\Compute\V1\RegionDisksStartAsyncReplicationRequest $regionDisksStartAsyncReplicationRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setDisk($disk) + ->setRegionDisksStartAsyncReplicationRequestResource($regionDisksStartAsyncReplicationRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $disk + * The name of the persistent disk. + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type \Google\Cloud\Compute\V1\RegionDisksStartAsyncReplicationRequest $region_disks_start_async_replication_request_resource + * The body resource 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 persistent disk. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisk() + { + return $this->disk; + } + + /** + * The name of the persistent disk. + * + * 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; + } + + /** + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionDisksStartAsyncReplicationRequest region_disks_start_async_replication_request_resource = 474326021 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionDisksStartAsyncReplicationRequest|null + */ + public function getRegionDisksStartAsyncReplicationRequestResource() + { + return $this->region_disks_start_async_replication_request_resource; + } + + public function hasRegionDisksStartAsyncReplicationRequestResource() + { + return isset($this->region_disks_start_async_replication_request_resource); + } + + public function clearRegionDisksStartAsyncReplicationRequestResource() + { + unset($this->region_disks_start_async_replication_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionDisksStartAsyncReplicationRequest region_disks_start_async_replication_request_resource = 474326021 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionDisksStartAsyncReplicationRequest $var + * @return $this + */ + public function setRegionDisksStartAsyncReplicationRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionDisksStartAsyncReplicationRequest::class); + $this->region_disks_start_async_replication_request_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StartInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StartInstanceRequest.php new file mode 100644 index 000000000000..b22885f08fcb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StartInstanceRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.StartInstanceRequest + */ +class StartInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the instance resource to start. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance resource to start. + * + * @return \Google\Cloud\Compute\V1\StartInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name of the instance resource to start. + * @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); + } + + /** + * Name of the instance resource to start. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance resource to start. + * + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StartWithEncryptionKeyInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StartWithEncryptionKeyInstanceRequest.php new file mode 100644 index 000000000000..6ae4e42d3ee2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StartWithEncryptionKeyInstanceRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest + */ +class StartWithEncryptionKeyInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the instance resource to start. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest instances_start_with_encryption_key_request_resource = 441712511 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instances_start_with_encryption_key_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance resource to start. + * @param \Google\Cloud\Compute\V1\InstancesStartWithEncryptionKeyRequest $instancesStartWithEncryptionKeyRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\StartWithEncryptionKeyInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, \Google\Cloud\Compute\V1\InstancesStartWithEncryptionKeyRequest $instancesStartWithEncryptionKeyRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setInstancesStartWithEncryptionKeyRequestResource($instancesStartWithEncryptionKeyRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name of the instance resource to start. + * @type \Google\Cloud\Compute\V1\InstancesStartWithEncryptionKeyRequest $instances_start_with_encryption_key_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); + } + + /** + * Name of the instance resource to start. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance resource to start. + * + * 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.InstancesStartWithEncryptionKeyRequest instances_start_with_encryption_key_request_resource = 441712511 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstancesStartWithEncryptionKeyRequest|null + */ + public function getInstancesStartWithEncryptionKeyRequestResource() + { + return $this->instances_start_with_encryption_key_request_resource; + } + + public function hasInstancesStartWithEncryptionKeyRequestResource() + { + return isset($this->instances_start_with_encryption_key_request_resource); + } + + public function clearInstancesStartWithEncryptionKeyRequestResource() + { + unset($this->instances_start_with_encryption_key_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest instances_start_with_encryption_key_request_resource = 441712511 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstancesStartWithEncryptionKeyRequest $var + * @return $this + */ + public function setInstancesStartWithEncryptionKeyRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstancesStartWithEncryptionKeyRequest::class); + $this->instances_start_with_encryption_key_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicy.php new file mode 100644 index 000000000000..57e79835cd02 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicy.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.StatefulPolicy + */ +class StatefulPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional .google.cloud.compute.v1.StatefulPolicyPreservedState preserved_state = 2634026; + */ + protected $preserved_state = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\StatefulPolicyPreservedState $preserved_state + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.StatefulPolicyPreservedState preserved_state = 2634026; + * @return \Google\Cloud\Compute\V1\StatefulPolicyPreservedState|null + */ + public function getPreservedState() + { + return $this->preserved_state; + } + + public function hasPreservedState() + { + return isset($this->preserved_state); + } + + public function clearPreservedState() + { + unset($this->preserved_state); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.StatefulPolicyPreservedState preserved_state = 2634026; + * @param \Google\Cloud\Compute\V1\StatefulPolicyPreservedState $var + * @return $this + */ + public function setPreservedState($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\StatefulPolicyPreservedState::class); + $this->preserved_state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicyPreservedState.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicyPreservedState.php new file mode 100644 index 000000000000..617903ba0a26 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicyPreservedState.php @@ -0,0 +1,135 @@ +google.cloud.compute.v1.StatefulPolicyPreservedState + */ +class StatefulPolicyPreservedState extends \Google\Protobuf\Internal\Message +{ + /** + * Disks created on the instances that will be preserved on instance delete, update, etc. This map is keyed with the device names of the disks. + * + * Generated from protobuf field map disks = 95594102; + */ + private $disks; + /** + * External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. + * + * Generated from protobuf field map external_i_ps = 532687245; + */ + private $external_i_ps; + /** + * Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. + * + * Generated from protobuf field map internal_i_ps = 215731675; + */ + private $internal_i_ps; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $disks + * Disks created on the instances that will be preserved on instance delete, update, etc. This map is keyed with the device names of the disks. + * @type array|\Google\Protobuf\Internal\MapField $external_i_ps + * External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. + * @type array|\Google\Protobuf\Internal\MapField $internal_i_ps + * Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Disks created on the instances that will be preserved on instance delete, update, etc. This map is keyed with the device names of the disks. + * + * Generated from protobuf field map disks = 95594102; + * @return \Google\Protobuf\Internal\MapField + */ + public function getDisks() + { + return $this->disks; + } + + /** + * Disks created on the instances that will be preserved on instance delete, update, etc. This map is keyed with the device names of the disks. + * + * Generated from protobuf field map disks = 95594102; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setDisks($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\StatefulPolicyPreservedStateDiskDevice::class); + $this->disks = $arr; + + return $this; + } + + /** + * External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. + * + * Generated from protobuf field map external_i_ps = 532687245; + * @return \Google\Protobuf\Internal\MapField + */ + public function getExternalIPs() + { + return $this->external_i_ps; + } + + /** + * External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. + * + * Generated from protobuf field map external_i_ps = 532687245; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setExternalIPs($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\StatefulPolicyPreservedStateNetworkIp::class); + $this->external_i_ps = $arr; + + return $this; + } + + /** + * Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. + * + * Generated from protobuf field map internal_i_ps = 215731675; + * @return \Google\Protobuf\Internal\MapField + */ + public function getInternalIPs() + { + return $this->internal_i_ps; + } + + /** + * Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name. + * + * Generated from protobuf field map internal_i_ps = 215731675; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setInternalIPs($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\StatefulPolicyPreservedStateNetworkIp::class); + $this->internal_i_ps = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicyPreservedStateDiskDevice.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicyPreservedStateDiskDevice.php new file mode 100644 index 000000000000..7791c778e904 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicyPreservedStateDiskDevice.php @@ -0,0 +1,80 @@ +google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice + */ +class StatefulPolicyPreservedStateDiskDevice extends \Google\Protobuf\Internal\Message +{ + /** + * These stateful disks will never be deleted during autohealing, update or VM instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted. + * Check the AutoDelete enum for the list of possible values. + * + * Generated from protobuf field optional string auto_delete = 464761403; + */ + protected $auto_delete = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $auto_delete + * These stateful disks will never be deleted during autohealing, update or VM instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted. + * Check the AutoDelete enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * These stateful disks will never be deleted during autohealing, update or VM instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted. + * Check the AutoDelete enum for the list of possible values. + * + * Generated from protobuf field optional string auto_delete = 464761403; + * @return string + */ + public function getAutoDelete() + { + return isset($this->auto_delete) ? $this->auto_delete : ''; + } + + public function hasAutoDelete() + { + return isset($this->auto_delete); + } + + public function clearAutoDelete() + { + unset($this->auto_delete); + } + + /** + * These stateful disks will never be deleted during autohealing, update or VM instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted. + * Check the AutoDelete enum for the list of possible values. + * + * Generated from protobuf field optional string auto_delete = 464761403; + * @param string $var + * @return $this + */ + public function setAutoDelete($var) + { + GPBUtil::checkString($var, True); + $this->auto_delete = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicyPreservedStateDiskDevice/AutoDelete.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicyPreservedStateDiskDevice/AutoDelete.php new file mode 100644 index 000000000000..504f9f9fa2b5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicyPreservedStateDiskDevice/AutoDelete.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice.AutoDelete + */ +class AutoDelete +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_AUTO_DELETE = 0; + */ + const UNDEFINED_AUTO_DELETE = 0; + /** + * Generated from protobuf enum NEVER = 74175084; + */ + const NEVER = 74175084; + /** + * Generated from protobuf enum ON_PERMANENT_INSTANCE_DELETION = 95727719; + */ + const ON_PERMANENT_INSTANCE_DELETION = 95727719; + + private static $valueToName = [ + self::UNDEFINED_AUTO_DELETE => 'UNDEFINED_AUTO_DELETE', + self::NEVER => 'NEVER', + self::ON_PERMANENT_INSTANCE_DELETION => 'ON_PERMANENT_INSTANCE_DELETION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AutoDelete::class, \Google\Cloud\Compute\V1\StatefulPolicyPreservedStateDiskDevice_AutoDelete::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicyPreservedStateNetworkIp.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicyPreservedStateNetworkIp.php new file mode 100644 index 000000000000..851fa3ec6372 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicyPreservedStateNetworkIp.php @@ -0,0 +1,80 @@ +google.cloud.compute.v1.StatefulPolicyPreservedStateNetworkIp + */ +class StatefulPolicyPreservedStateNetworkIp extends \Google\Protobuf\Internal\Message +{ + /** + * These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. + * Check the AutoDelete enum for the list of possible values. + * + * Generated from protobuf field optional string auto_delete = 464761403; + */ + protected $auto_delete = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $auto_delete + * These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. + * Check the AutoDelete enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. + * Check the AutoDelete enum for the list of possible values. + * + * Generated from protobuf field optional string auto_delete = 464761403; + * @return string + */ + public function getAutoDelete() + { + return isset($this->auto_delete) ? $this->auto_delete : ''; + } + + public function hasAutoDelete() + { + return isset($this->auto_delete); + } + + public function clearAutoDelete() + { + unset($this->auto_delete); + } + + /** + * These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. + * Check the AutoDelete enum for the list of possible values. + * + * Generated from protobuf field optional string auto_delete = 464761403; + * @param string $var + * @return $this + */ + public function setAutoDelete($var) + { + GPBUtil::checkString($var, True); + $this->auto_delete = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicyPreservedStateNetworkIp/AutoDelete.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicyPreservedStateNetworkIp/AutoDelete.php new file mode 100644 index 000000000000..cd6f2c6b69e9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StatefulPolicyPreservedStateNetworkIp/AutoDelete.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.StatefulPolicyPreservedStateNetworkIp.AutoDelete + */ +class AutoDelete +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_AUTO_DELETE = 0; + */ + const UNDEFINED_AUTO_DELETE = 0; + /** + * Generated from protobuf enum NEVER = 74175084; + */ + const NEVER = 74175084; + /** + * Generated from protobuf enum ON_PERMANENT_INSTANCE_DELETION = 95727719; + */ + const ON_PERMANENT_INSTANCE_DELETION = 95727719; + + private static $valueToName = [ + self::UNDEFINED_AUTO_DELETE => 'UNDEFINED_AUTO_DELETE', + self::NEVER => 'NEVER', + self::ON_PERMANENT_INSTANCE_DELETION => 'ON_PERMANENT_INSTANCE_DELETION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AutoDelete::class, \Google\Cloud\Compute\V1\StatefulPolicyPreservedStateNetworkIp_AutoDelete::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Status.php new file mode 100644 index 000000000000..4bc98f742e57 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Status.php @@ -0,0 +1,155 @@ +google.cloud.compute.v1.Status + */ +class Status extends \Google\Protobuf\Internal\Message +{ + /** + * The status code, which should be an enum value of google.rpc.Code. + * + * Generated from protobuf field optional int32 code = 3059181; + */ + protected $code = null; + /** + * A list of messages that carry the error details. There is a common set of message types for APIs to use. + * + * Generated from protobuf field repeated .google.protobuf.Any details = 483979842; + */ + private $details; + /** + * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. + * + * Generated from protobuf field optional string message = 418054151; + */ + protected $message = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $code + * The status code, which should be an enum value of google.rpc.Code. + * @type array<\Google\Protobuf\Any>|\Google\Protobuf\Internal\RepeatedField $details + * A list of messages that carry the error details. There is a common set of message types for APIs to use. + * @type string $message + * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The status code, which should be an enum value of google.rpc.Code. + * + * Generated from protobuf field optional int32 code = 3059181; + * @return int + */ + public function getCode() + { + return isset($this->code) ? $this->code : 0; + } + + public function hasCode() + { + return isset($this->code); + } + + public function clearCode() + { + unset($this->code); + } + + /** + * The status code, which should be an enum value of google.rpc.Code. + * + * Generated from protobuf field optional int32 code = 3059181; + * @param int $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkInt32($var); + $this->code = $var; + + return $this; + } + + /** + * A list of messages that carry the error details. There is a common set of message types for APIs to use. + * + * Generated from protobuf field repeated .google.protobuf.Any details = 483979842; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDetails() + { + return $this->details; + } + + /** + * A list of messages that carry the error details. There is a common set of message types for APIs to use. + * + * Generated from protobuf field repeated .google.protobuf.Any details = 483979842; + * @param array<\Google\Protobuf\Any>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDetails($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Any::class); + $this->details = $arr; + + return $this; + } + + /** + * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. + * + * Generated from protobuf field optional string message = 418054151; + * @return string + */ + public function getMessage() + { + return isset($this->message) ? $this->message : ''; + } + + public function hasMessage() + { + return isset($this->message); + } + + public function clearMessage() + { + unset($this->message); + } + + /** + * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. + * + * Generated from protobuf field optional string message = 418054151; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopAsyncReplicationDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopAsyncReplicationDiskRequest.php new file mode 100644 index 000000000000..9de8dbd54780 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopAsyncReplicationDiskRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.StopAsyncReplicationDiskRequest + */ +class StopAsyncReplicationDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the persistent disk. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $disk The name of the persistent disk. + * + * @return \Google\Cloud\Compute\V1\StopAsyncReplicationDiskRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $disk): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setDisk($disk); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $disk + * The name of the persistent disk. + * @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 name of the persistent disk. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisk() + { + return $this->disk; + } + + /** + * The name of the persistent disk. + * + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopAsyncReplicationRegionDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopAsyncReplicationRegionDiskRequest.php new file mode 100644 index 000000000000..885be041f4ba --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopAsyncReplicationRegionDiskRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.StopAsyncReplicationRegionDiskRequest + */ +class StopAsyncReplicationRegionDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the persistent disk. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $disk The name of the persistent disk. + * + * @return \Google\Cloud\Compute\V1\StopAsyncReplicationRegionDiskRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $disk): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setDisk($disk); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $disk + * The name of the persistent disk. + * @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 persistent disk. + * + * Generated from protobuf field string disk = 3083677 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDisk() + { + return $this->disk; + } + + /** + * The name of the persistent disk. + * + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopGroupAsyncReplicationDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopGroupAsyncReplicationDiskRequest.php new file mode 100644 index 000000000000..a599dde07380 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopGroupAsyncReplicationDiskRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.StopGroupAsyncReplicationDiskRequest + */ +class StopGroupAsyncReplicationDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.DisksStopGroupAsyncReplicationResource disks_stop_group_async_replication_resource_resource = 346815509 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disks_stop_group_async_replication_resource_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the zone for this request. This must be the zone of the primary or secondary disks in the consistency group. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. This must be the zone of the primary or secondary disks in the consistency group. + * @param \Google\Cloud\Compute\V1\DisksStopGroupAsyncReplicationResource $disksStopGroupAsyncReplicationResourceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\StopGroupAsyncReplicationDiskRequest + * + * @experimental + */ + public static function build(string $project, string $zone, \Google\Cloud\Compute\V1\DisksStopGroupAsyncReplicationResource $disksStopGroupAsyncReplicationResourceResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setDisksStopGroupAsyncReplicationResourceResource($disksStopGroupAsyncReplicationResourceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\DisksStopGroupAsyncReplicationResource $disks_stop_group_async_replication_resource_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. This must be the zone of the primary or secondary disks in the consistency group. + * } + */ + 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.DisksStopGroupAsyncReplicationResource disks_stop_group_async_replication_resource_resource = 346815509 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\DisksStopGroupAsyncReplicationResource|null + */ + public function getDisksStopGroupAsyncReplicationResourceResource() + { + return $this->disks_stop_group_async_replication_resource_resource; + } + + public function hasDisksStopGroupAsyncReplicationResourceResource() + { + return isset($this->disks_stop_group_async_replication_resource_resource); + } + + public function clearDisksStopGroupAsyncReplicationResourceResource() + { + unset($this->disks_stop_group_async_replication_resource_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.DisksStopGroupAsyncReplicationResource disks_stop_group_async_replication_resource_resource = 346815509 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\DisksStopGroupAsyncReplicationResource $var + * @return $this + */ + public function setDisksStopGroupAsyncReplicationResourceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DisksStopGroupAsyncReplicationResource::class); + $this->disks_stop_group_async_replication_resource_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. This must be the zone of the primary or secondary disks in the consistency group. + * + * 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. This must be the zone of the primary or secondary disks in the consistency group. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopGroupAsyncReplicationRegionDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopGroupAsyncReplicationRegionDiskRequest.php new file mode 100644 index 000000000000..e6d0a8a8eedc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopGroupAsyncReplicationRegionDiskRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.StopGroupAsyncReplicationRegionDiskRequest + */ +class StopGroupAsyncReplicationRegionDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.DisksStopGroupAsyncReplicationResource disks_stop_group_async_replication_resource_resource = 346815509 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disks_stop_group_async_replication_resource_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"]; + */ + protected $project = ''; + /** + * The name of the region for this request. This must be the region of the primary or secondary disks in the consistency group. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. This must be the region of the primary or secondary disks in the consistency group. + * @param \Google\Cloud\Compute\V1\DisksStopGroupAsyncReplicationResource $disksStopGroupAsyncReplicationResourceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\StopGroupAsyncReplicationRegionDiskRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\DisksStopGroupAsyncReplicationResource $disksStopGroupAsyncReplicationResourceResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setDisksStopGroupAsyncReplicationResourceResource($disksStopGroupAsyncReplicationResourceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\DisksStopGroupAsyncReplicationResource $disks_stop_group_async_replication_resource_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. This must be the region of the primary or secondary disks in the consistency group. + * @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.DisksStopGroupAsyncReplicationResource disks_stop_group_async_replication_resource_resource = 346815509 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\DisksStopGroupAsyncReplicationResource|null + */ + public function getDisksStopGroupAsyncReplicationResourceResource() + { + return $this->disks_stop_group_async_replication_resource_resource; + } + + public function hasDisksStopGroupAsyncReplicationResourceResource() + { + return isset($this->disks_stop_group_async_replication_resource_resource); + } + + public function clearDisksStopGroupAsyncReplicationResourceResource() + { + unset($this->disks_stop_group_async_replication_resource_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.DisksStopGroupAsyncReplicationResource disks_stop_group_async_replication_resource_resource = 346815509 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\DisksStopGroupAsyncReplicationResource $var + * @return $this + */ + public function setDisksStopGroupAsyncReplicationResourceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DisksStopGroupAsyncReplicationResource::class); + $this->disks_stop_group_async_replication_resource_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. This must be the region of the primary or secondary disks in the consistency group. + * + * 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. This must be the region of the primary or secondary disks in the consistency group. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopInstanceRequest.php new file mode 100644 index 000000000000..520999901762 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopInstanceRequest.php @@ -0,0 +1,240 @@ +google.cloud.compute.v1.StopInstanceRequest + */ +class StopInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * This property is required if the instance has any attached Local SSD disks. If false, Local SSD data will be preserved when the instance is suspended. If true, the contents of any attached Local SSD disks will be discarded. + * + * Generated from protobuf field optional bool discard_local_ssd = 319517903; + */ + protected $discard_local_ssd = null; + /** + * Name of the instance resource to stop. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance resource to stop. + * + * @return \Google\Cloud\Compute\V1\StopInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $discard_local_ssd + * This property is required if the instance has any attached Local SSD disks. If false, Local SSD data will be preserved when the instance is suspended. If true, the contents of any attached Local SSD disks will be discarded. + * @type string $instance + * Name of the instance resource to stop. + * @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); + } + + /** + * This property is required if the instance has any attached Local SSD disks. If false, Local SSD data will be preserved when the instance is suspended. If true, the contents of any attached Local SSD disks will be discarded. + * + * Generated from protobuf field optional bool discard_local_ssd = 319517903; + * @return bool + */ + public function getDiscardLocalSsd() + { + return isset($this->discard_local_ssd) ? $this->discard_local_ssd : false; + } + + public function hasDiscardLocalSsd() + { + return isset($this->discard_local_ssd); + } + + public function clearDiscardLocalSsd() + { + unset($this->discard_local_ssd); + } + + /** + * This property is required if the instance has any attached Local SSD disks. If false, Local SSD data will be preserved when the instance is suspended. If true, the contents of any attached Local SSD disks will be discarded. + * + * Generated from protobuf field optional bool discard_local_ssd = 319517903; + * @param bool $var + * @return $this + */ + public function setDiscardLocalSsd($var) + { + GPBUtil::checkBool($var); + $this->discard_local_ssd = $var; + + return $this; + } + + /** + * Name of the instance resource to stop. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance resource to stop. + * + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePool.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePool.php new file mode 100644 index 000000000000..3ac080cadf3b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePool.php @@ -0,0 +1,871 @@ +google.cloud.compute.v1.StoragePool + */ +class StoragePool extends \Google\Protobuf\Internal\Message +{ + /** + * Provisioning type of the byte capacity of the pool. + * Check the CapacityProvisioningType enum for the list of possible values. + * + * Generated from protobuf field optional string capacity_provisioning_type = 251610375; + */ + protected $capacity_provisioning_type = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#storagePool for storage pools. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * A fingerprint for the labels being applied to this storage pool, 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 storage pool. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + */ + protected $label_fingerprint = null; + /** + * Labels to apply to this storage pool. These can be later modified by the setLabels method. + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Provisioning type of the performance-related parameters of the pool, such as throughput and IOPS. + * Check the PerformanceProvisioningType enum for the list of possible values. + * + * Generated from protobuf field optional string performance_provisioning_type = 468553469; + */ + protected $performance_provisioning_type = null; + /** + * Size, in GiB, of the storage pool. + * + * Generated from protobuf field optional int64 pool_provisioned_capacity_gb = 478537682; + */ + protected $pool_provisioned_capacity_gb = null; + /** + * Provisioned IOPS of the storage pool. Only relevant if the storage pool type is hyperdisk-balanced. + * + * Generated from protobuf field optional int64 pool_provisioned_iops = 112092311; + */ + protected $pool_provisioned_iops = null; + /** + * Provisioned throughput of the storage pool. Only relevant if the storage pool type is hyperdisk-balanced or hyperdisk-throughput. + * + * Generated from protobuf field optional int64 pool_provisioned_throughput = 169215640; + */ + protected $pool_provisioned_throughput = null; + /** + * [Output Only] Status information for the storage pool resource. + * + * Generated from protobuf field optional .google.cloud.compute.v1.StoragePoolResourceStatus resource_status = 249429315; + */ + protected $resource_status = null; + /** + * [Output Only] Server-defined fully-qualified URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Server-defined URL for this resource's resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + */ + protected $self_link_with_id = null; + /** + * [Output Only] The status of storage pool creation. - CREATING: Storage pool is provisioning. storagePool. - FAILED: Storage pool creation failed. - READY: Storage pool is ready for use. - DELETING: Storage pool is deleting. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + */ + protected $state = null; + /** + * [Output Only] Status information for the storage pool resource. + * + * Generated from protobuf field optional .google.cloud.compute.v1.StoragePoolResourceStatus status = 181260274; + */ + protected $status = null; + /** + * Type of the storage pool. + * + * Generated from protobuf field optional string storage_pool_type = 285999289; + */ + protected $storage_pool_type = null; + /** + * [Output Only] URL of the zone where the storage pool resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + */ + protected $zone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $capacity_provisioning_type + * Provisioning type of the byte capacity of the pool. + * Check the CapacityProvisioningType enum for the list of possible values. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of the resource. Always compute#storagePool for storage pools. + * @type string $label_fingerprint + * A fingerprint for the labels being applied to this storage pool, 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 storage pool. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Labels to apply to this storage pool. These can be later modified by the setLabels method. + * @type string $name + * 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 string $performance_provisioning_type + * Provisioning type of the performance-related parameters of the pool, such as throughput and IOPS. + * Check the PerformanceProvisioningType enum for the list of possible values. + * @type int|string $pool_provisioned_capacity_gb + * Size, in GiB, of the storage pool. + * @type int|string $pool_provisioned_iops + * Provisioned IOPS of the storage pool. Only relevant if the storage pool type is hyperdisk-balanced. + * @type int|string $pool_provisioned_throughput + * Provisioned throughput of the storage pool. Only relevant if the storage pool type is hyperdisk-balanced or hyperdisk-throughput. + * @type \Google\Cloud\Compute\V1\StoragePoolResourceStatus $resource_status + * [Output Only] Status information for the storage pool resource. + * @type string $self_link + * [Output Only] Server-defined fully-qualified URL for this resource. + * @type string $self_link_with_id + * [Output Only] Server-defined URL for this resource's resource id. + * @type string $state + * [Output Only] The status of storage pool creation. - CREATING: Storage pool is provisioning. storagePool. - FAILED: Storage pool creation failed. - READY: Storage pool is ready for use. - DELETING: Storage pool is deleting. + * Check the State enum for the list of possible values. + * @type \Google\Cloud\Compute\V1\StoragePoolResourceStatus $status + * [Output Only] Status information for the storage pool resource. + * @type string $storage_pool_type + * Type of the storage pool. + * @type string $zone + * [Output Only] URL of the zone where the storage pool resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Provisioning type of the byte capacity of the pool. + * Check the CapacityProvisioningType enum for the list of possible values. + * + * Generated from protobuf field optional string capacity_provisioning_type = 251610375; + * @return string + */ + public function getCapacityProvisioningType() + { + return isset($this->capacity_provisioning_type) ? $this->capacity_provisioning_type : ''; + } + + public function hasCapacityProvisioningType() + { + return isset($this->capacity_provisioning_type); + } + + public function clearCapacityProvisioningType() + { + unset($this->capacity_provisioning_type); + } + + /** + * Provisioning type of the byte capacity of the pool. + * Check the CapacityProvisioningType enum for the list of possible values. + * + * Generated from protobuf field optional string capacity_provisioning_type = 251610375; + * @param string $var + * @return $this + */ + public function setCapacityProvisioningType($var) + { + GPBUtil::checkString($var, True); + $this->capacity_provisioning_type = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#storagePool for storage pools. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#storagePool for storage pools. + * + * 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; + } + + /** + * A fingerprint for the labels being applied to this storage pool, 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 storage pool. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @return string + */ + public function getLabelFingerprint() + { + return isset($this->label_fingerprint) ? $this->label_fingerprint : ''; + } + + public function hasLabelFingerprint() + { + return isset($this->label_fingerprint); + } + + public function clearLabelFingerprint() + { + unset($this->label_fingerprint); + } + + /** + * A fingerprint for the labels being applied to this storage pool, 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 storage pool. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @param string $var + * @return $this + */ + public function setLabelFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->label_fingerprint = $var; + + return $this; + } + + /** + * Labels to apply to this storage pool. These can be later modified by the setLabels method. + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Labels to apply to this storage pool. These can be later modified by the setLabels method. + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * Provisioning type of the performance-related parameters of the pool, such as throughput and IOPS. + * Check the PerformanceProvisioningType enum for the list of possible values. + * + * Generated from protobuf field optional string performance_provisioning_type = 468553469; + * @return string + */ + public function getPerformanceProvisioningType() + { + return isset($this->performance_provisioning_type) ? $this->performance_provisioning_type : ''; + } + + public function hasPerformanceProvisioningType() + { + return isset($this->performance_provisioning_type); + } + + public function clearPerformanceProvisioningType() + { + unset($this->performance_provisioning_type); + } + + /** + * Provisioning type of the performance-related parameters of the pool, such as throughput and IOPS. + * Check the PerformanceProvisioningType enum for the list of possible values. + * + * Generated from protobuf field optional string performance_provisioning_type = 468553469; + * @param string $var + * @return $this + */ + public function setPerformanceProvisioningType($var) + { + GPBUtil::checkString($var, True); + $this->performance_provisioning_type = $var; + + return $this; + } + + /** + * Size, in GiB, of the storage pool. + * + * Generated from protobuf field optional int64 pool_provisioned_capacity_gb = 478537682; + * @return int|string + */ + public function getPoolProvisionedCapacityGb() + { + return isset($this->pool_provisioned_capacity_gb) ? $this->pool_provisioned_capacity_gb : 0; + } + + public function hasPoolProvisionedCapacityGb() + { + return isset($this->pool_provisioned_capacity_gb); + } + + public function clearPoolProvisionedCapacityGb() + { + unset($this->pool_provisioned_capacity_gb); + } + + /** + * Size, in GiB, of the storage pool. + * + * Generated from protobuf field optional int64 pool_provisioned_capacity_gb = 478537682; + * @param int|string $var + * @return $this + */ + public function setPoolProvisionedCapacityGb($var) + { + GPBUtil::checkInt64($var); + $this->pool_provisioned_capacity_gb = $var; + + return $this; + } + + /** + * Provisioned IOPS of the storage pool. Only relevant if the storage pool type is hyperdisk-balanced. + * + * Generated from protobuf field optional int64 pool_provisioned_iops = 112092311; + * @return int|string + */ + public function getPoolProvisionedIops() + { + return isset($this->pool_provisioned_iops) ? $this->pool_provisioned_iops : 0; + } + + public function hasPoolProvisionedIops() + { + return isset($this->pool_provisioned_iops); + } + + public function clearPoolProvisionedIops() + { + unset($this->pool_provisioned_iops); + } + + /** + * Provisioned IOPS of the storage pool. Only relevant if the storage pool type is hyperdisk-balanced. + * + * Generated from protobuf field optional int64 pool_provisioned_iops = 112092311; + * @param int|string $var + * @return $this + */ + public function setPoolProvisionedIops($var) + { + GPBUtil::checkInt64($var); + $this->pool_provisioned_iops = $var; + + return $this; + } + + /** + * Provisioned throughput of the storage pool. Only relevant if the storage pool type is hyperdisk-balanced or hyperdisk-throughput. + * + * Generated from protobuf field optional int64 pool_provisioned_throughput = 169215640; + * @return int|string + */ + public function getPoolProvisionedThroughput() + { + return isset($this->pool_provisioned_throughput) ? $this->pool_provisioned_throughput : 0; + } + + public function hasPoolProvisionedThroughput() + { + return isset($this->pool_provisioned_throughput); + } + + public function clearPoolProvisionedThroughput() + { + unset($this->pool_provisioned_throughput); + } + + /** + * Provisioned throughput of the storage pool. Only relevant if the storage pool type is hyperdisk-balanced or hyperdisk-throughput. + * + * Generated from protobuf field optional int64 pool_provisioned_throughput = 169215640; + * @param int|string $var + * @return $this + */ + public function setPoolProvisionedThroughput($var) + { + GPBUtil::checkInt64($var); + $this->pool_provisioned_throughput = $var; + + return $this; + } + + /** + * [Output Only] Status information for the storage pool resource. + * + * Generated from protobuf field optional .google.cloud.compute.v1.StoragePoolResourceStatus resource_status = 249429315; + * @return \Google\Cloud\Compute\V1\StoragePoolResourceStatus|null + */ + public function getResourceStatus() + { + return $this->resource_status; + } + + public function hasResourceStatus() + { + return isset($this->resource_status); + } + + public function clearResourceStatus() + { + unset($this->resource_status); + } + + /** + * [Output Only] Status information for the storage pool resource. + * + * Generated from protobuf field optional .google.cloud.compute.v1.StoragePoolResourceStatus resource_status = 249429315; + * @param \Google\Cloud\Compute\V1\StoragePoolResourceStatus $var + * @return $this + */ + public function setResourceStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\StoragePoolResourceStatus::class); + $this->resource_status = $var; + + return $this; + } + + /** + * [Output Only] Server-defined fully-qualified 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 fully-qualified 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] Server-defined URL for this resource's resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + * @return string + */ + public function getSelfLinkWithId() + { + return isset($this->self_link_with_id) ? $this->self_link_with_id : ''; + } + + public function hasSelfLinkWithId() + { + return isset($this->self_link_with_id); + } + + public function clearSelfLinkWithId() + { + unset($this->self_link_with_id); + } + + /** + * [Output Only] Server-defined URL for this resource's resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + * @param string $var + * @return $this + */ + public function setSelfLinkWithId($var) + { + GPBUtil::checkString($var, True); + $this->self_link_with_id = $var; + + return $this; + } + + /** + * [Output Only] The status of storage pool creation. - CREATING: Storage pool is provisioning. storagePool. - FAILED: Storage pool creation failed. - READY: Storage pool is ready for use. - DELETING: Storage pool is deleting. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @return string + */ + public function getState() + { + return isset($this->state) ? $this->state : ''; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * [Output Only] The status of storage pool creation. - CREATING: Storage pool is provisioning. storagePool. - FAILED: Storage pool creation failed. - READY: Storage pool is ready for use. - DELETING: Storage pool is deleting. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + + /** + * [Output Only] Status information for the storage pool resource. + * + * Generated from protobuf field optional .google.cloud.compute.v1.StoragePoolResourceStatus status = 181260274; + * @return \Google\Cloud\Compute\V1\StoragePoolResourceStatus|null + */ + public function getStatus() + { + return $this->status; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] Status information for the storage pool resource. + * + * Generated from protobuf field optional .google.cloud.compute.v1.StoragePoolResourceStatus status = 181260274; + * @param \Google\Cloud\Compute\V1\StoragePoolResourceStatus $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\StoragePoolResourceStatus::class); + $this->status = $var; + + return $this; + } + + /** + * Type of the storage pool. + * + * Generated from protobuf field optional string storage_pool_type = 285999289; + * @return string + */ + public function getStoragePoolType() + { + return isset($this->storage_pool_type) ? $this->storage_pool_type : ''; + } + + public function hasStoragePoolType() + { + return isset($this->storage_pool_type); + } + + public function clearStoragePoolType() + { + unset($this->storage_pool_type); + } + + /** + * Type of the storage pool. + * + * Generated from protobuf field optional string storage_pool_type = 285999289; + * @param string $var + * @return $this + */ + public function setStoragePoolType($var) + { + GPBUtil::checkString($var, True); + $this->storage_pool_type = $var; + + return $this; + } + + /** + * [Output Only] URL of the zone where the storage pool resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + * @return string + */ + public function getZone() + { + return isset($this->zone) ? $this->zone : ''; + } + + public function hasZone() + { + return isset($this->zone); + } + + public function clearZone() + { + unset($this->zone); + } + + /** + * [Output Only] URL of the zone where the storage pool resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePool/CapacityProvisioningType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePool/CapacityProvisioningType.php new file mode 100644 index 000000000000..ab44618cd47d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePool/CapacityProvisioningType.php @@ -0,0 +1,54 @@ +google.cloud.compute.v1.StoragePool.CapacityProvisioningType + */ +class CapacityProvisioningType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_CAPACITY_PROVISIONING_TYPE = 0; + */ + const UNDEFINED_CAPACITY_PROVISIONING_TYPE = 0; + + private static $valueToName = [ + self::UNDEFINED_CAPACITY_PROVISIONING_TYPE => 'UNDEFINED_CAPACITY_PROVISIONING_TYPE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(CapacityProvisioningType::class, \Google\Cloud\Compute\V1\StoragePool_CapacityProvisioningType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePool/PerformanceProvisioningType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePool/PerformanceProvisioningType.php new file mode 100644 index 000000000000..ab54e7e9c217 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePool/PerformanceProvisioningType.php @@ -0,0 +1,54 @@ +google.cloud.compute.v1.StoragePool.PerformanceProvisioningType + */ +class PerformanceProvisioningType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PERFORMANCE_PROVISIONING_TYPE = 0; + */ + const UNDEFINED_PERFORMANCE_PROVISIONING_TYPE = 0; + + private static $valueToName = [ + self::UNDEFINED_PERFORMANCE_PROVISIONING_TYPE => 'UNDEFINED_PERFORMANCE_PROVISIONING_TYPE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PerformanceProvisioningType::class, \Google\Cloud\Compute\V1\StoragePool_PerformanceProvisioningType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePool/State.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePool/State.php new file mode 100644 index 000000000000..1d7f67a49f0b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePool/State.php @@ -0,0 +1,78 @@ +google.cloud.compute.v1.StoragePool.State + */ +class State +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATE = 0; + */ + const UNDEFINED_STATE = 0; + /** + * StoragePool is provisioning + * + * Generated from protobuf enum CREATING = 455564985; + */ + const CREATING = 455564985; + /** + * StoragePool is deleting. + * + * Generated from protobuf enum DELETING = 528602024; + */ + const DELETING = 528602024; + /** + * StoragePool creation failed. + * + * Generated from protobuf enum FAILED = 455706685; + */ + const FAILED = 455706685; + /** + * StoragePool is ready for use. + * + * Generated from protobuf enum READY = 77848963; + */ + const READY = 77848963; + + private static $valueToName = [ + self::UNDEFINED_STATE => 'UNDEFINED_STATE', + self::CREATING => 'CREATING', + self::DELETING => 'DELETING', + self::FAILED => 'FAILED', + self::READY => 'READY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Compute\V1\StoragePool_State::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolAggregatedList.php new file mode 100644 index 000000000000..809b1d444a26 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolAggregatedList.php @@ -0,0 +1,357 @@ +google.cloud.compute.v1.StoragePoolAggregatedList + */ +class StoragePoolAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string etag = 3123477; + */ + protected $etag = null; + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of StoragePoolsScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#storagePoolAggregatedList for aggregated lists of storage pools. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $etag + * @type string $id + * [Output Only] Unique identifier for the resource; defined by the server. + * @type array|\Google\Protobuf\Internal\MapField $items + * A list of StoragePoolsScopedList resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#storagePoolAggregatedList for aggregated lists of storage pools. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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); + } + + /** + * Generated from protobuf field optional string etag = 3123477; + * @return string + */ + public function getEtag() + { + return isset($this->etag) ? $this->etag : ''; + } + + public function hasEtag() + { + return isset($this->etag); + } + + public function clearEtag() + { + unset($this->etag); + } + + /** + * Generated from protobuf field optional string etag = 3123477; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * [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 StoragePoolsScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of StoragePoolsScopedList 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\StoragePoolsScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#storagePoolAggregatedList for aggregated lists of storage pools. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#storagePoolAggregatedList for aggregated lists of storage pools. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolDisk.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolDisk.php new file mode 100644 index 000000000000..ec2ee31ed8d9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolDisk.php @@ -0,0 +1,500 @@ +google.cloud.compute.v1.StoragePoolDisk + */ +class StoragePoolDisk extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Instances this disk is attached to. + * + * Generated from protobuf field repeated string attached_instances = 65255843; + */ + private $attached_instances; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * [Output Only] The URL of the disk. + * + * Generated from protobuf field optional string disk = 3083677; + */ + protected $disk = null; + /** + * [Output Only] The name of the disk. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] The number of IOPS provisioned for the disk. + * + * Generated from protobuf field optional int64 provisioned_iops = 186769108; + */ + protected $provisioned_iops = null; + /** + * [Output Only] The throughput provisioned for the disk. + * + * Generated from protobuf field optional int64 provisioned_throughput = 526524181; + */ + protected $provisioned_throughput = null; + /** + * [Output Only] Resource policies applied to disk for automatic snapshot creations. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + */ + private $resource_policies; + /** + * [Output Only] The disk size, in GB. + * + * Generated from protobuf field optional int64 size_gb = 494929369; + */ + protected $size_gb = null; + /** + * [Output Only] The disk status. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + /** + * [Output Only] The disk type. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + /** + * [Output Only] Amount of disk space used. + * + * Generated from protobuf field optional int64 used_bytes = 231640425; + */ + protected $used_bytes = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $attached_instances + * [Output Only] Instances this disk is attached to. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $disk + * [Output Only] The URL of the disk. + * @type string $name + * [Output Only] The name of the disk. + * @type int|string $provisioned_iops + * [Output Only] The number of IOPS provisioned for the disk. + * @type int|string $provisioned_throughput + * [Output Only] The throughput provisioned for the disk. + * @type array|\Google\Protobuf\Internal\RepeatedField $resource_policies + * [Output Only] Resource policies applied to disk for automatic snapshot creations. + * @type int|string $size_gb + * [Output Only] The disk size, in GB. + * @type string $status + * [Output Only] The disk status. + * Check the Status enum for the list of possible values. + * @type string $type + * [Output Only] The disk type. + * @type int|string $used_bytes + * [Output Only] Amount of disk space used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Instances this disk is attached to. + * + * Generated from protobuf field repeated string attached_instances = 65255843; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttachedInstances() + { + return $this->attached_instances; + } + + /** + * [Output Only] Instances this disk is attached to. + * + * Generated from protobuf field repeated string attached_instances = 65255843; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttachedInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->attached_instances = $arr; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * [Output Only] The URL of the disk. + * + * Generated from protobuf field optional string disk = 3083677; + * @return string + */ + public function getDisk() + { + return isset($this->disk) ? $this->disk : ''; + } + + public function hasDisk() + { + return isset($this->disk); + } + + public function clearDisk() + { + unset($this->disk); + } + + /** + * [Output Only] The URL of the disk. + * + * Generated from protobuf field optional string disk = 3083677; + * @param string $var + * @return $this + */ + public function setDisk($var) + { + GPBUtil::checkString($var, True); + $this->disk = $var; + + return $this; + } + + /** + * [Output Only] The name of the disk. + * + * 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); + } + + /** + * [Output Only] The name of the disk. + * + * 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; + } + + /** + * [Output Only] The number of IOPS provisioned for the disk. + * + * Generated from protobuf field optional int64 provisioned_iops = 186769108; + * @return int|string + */ + public function getProvisionedIops() + { + return isset($this->provisioned_iops) ? $this->provisioned_iops : 0; + } + + public function hasProvisionedIops() + { + return isset($this->provisioned_iops); + } + + public function clearProvisionedIops() + { + unset($this->provisioned_iops); + } + + /** + * [Output Only] The number of IOPS provisioned for the disk. + * + * Generated from protobuf field optional int64 provisioned_iops = 186769108; + * @param int|string $var + * @return $this + */ + public function setProvisionedIops($var) + { + GPBUtil::checkInt64($var); + $this->provisioned_iops = $var; + + return $this; + } + + /** + * [Output Only] The throughput provisioned for the disk. + * + * Generated from protobuf field optional int64 provisioned_throughput = 526524181; + * @return int|string + */ + public function getProvisionedThroughput() + { + return isset($this->provisioned_throughput) ? $this->provisioned_throughput : 0; + } + + public function hasProvisionedThroughput() + { + return isset($this->provisioned_throughput); + } + + public function clearProvisionedThroughput() + { + unset($this->provisioned_throughput); + } + + /** + * [Output Only] The throughput provisioned for the disk. + * + * Generated from protobuf field optional int64 provisioned_throughput = 526524181; + * @param int|string $var + * @return $this + */ + public function setProvisionedThroughput($var) + { + GPBUtil::checkInt64($var); + $this->provisioned_throughput = $var; + + return $this; + } + + /** + * [Output Only] Resource policies applied to disk for automatic snapshot creations. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResourcePolicies() + { + return $this->resource_policies; + } + + /** + * [Output Only] Resource policies applied to disk for automatic snapshot creations. + * + * Generated from protobuf field repeated string resource_policies = 22220385; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResourcePolicies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->resource_policies = $arr; + + return $this; + } + + /** + * [Output Only] The disk size, in GB. + * + * Generated from protobuf field optional int64 size_gb = 494929369; + * @return int|string + */ + public function getSizeGb() + { + return isset($this->size_gb) ? $this->size_gb : 0; + } + + public function hasSizeGb() + { + return isset($this->size_gb); + } + + public function clearSizeGb() + { + unset($this->size_gb); + } + + /** + * [Output Only] The disk size, in GB. + * + * Generated from protobuf field optional int64 size_gb = 494929369; + * @param int|string $var + * @return $this + */ + public function setSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->size_gb = $var; + + return $this; + } + + /** + * [Output Only] The disk status. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] The disk status. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + + /** + * [Output Only] The disk type. + * + * Generated from protobuf field optional string type = 3575610; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * [Output Only] The disk type. + * + * Generated from protobuf field optional string type = 3575610; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * [Output Only] Amount of disk space used. + * + * Generated from protobuf field optional int64 used_bytes = 231640425; + * @return int|string + */ + public function getUsedBytes() + { + return isset($this->used_bytes) ? $this->used_bytes : 0; + } + + public function hasUsedBytes() + { + return isset($this->used_bytes); + } + + public function clearUsedBytes() + { + unset($this->used_bytes); + } + + /** + * [Output Only] Amount of disk space used. + * + * Generated from protobuf field optional int64 used_bytes = 231640425; + * @param int|string $var + * @return $this + */ + public function setUsedBytes($var) + { + GPBUtil::checkInt64($var); + $this->used_bytes = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolDisk/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolDisk/Status.php new file mode 100644 index 000000000000..54361d1fce4b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolDisk/Status.php @@ -0,0 +1,92 @@ +google.cloud.compute.v1.StoragePoolDisk.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * Disk is provisioning + * + * Generated from protobuf enum CREATING = 455564985; + */ + const CREATING = 455564985; + /** + * Disk is deleting. + * + * Generated from protobuf enum DELETING = 528602024; + */ + const DELETING = 528602024; + /** + * Disk creation failed. + * + * Generated from protobuf enum FAILED = 455706685; + */ + const FAILED = 455706685; + /** + * Disk is ready for use. + * + * Generated from protobuf enum READY = 77848963; + */ + const READY = 77848963; + /** + * Source data is being copied into the disk. + * + * Generated from protobuf enum RESTORING = 404263851; + */ + const RESTORING = 404263851; + /** + * Disk is currently unavailable and cannot be accessed, attached or detached. + * + * Generated from protobuf enum UNAVAILABLE = 413756464; + */ + const UNAVAILABLE = 413756464; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::CREATING => 'CREATING', + self::DELETING => 'DELETING', + self::FAILED => 'FAILED', + self::READY => 'READY', + self::RESTORING => 'RESTORING', + self::UNAVAILABLE => 'UNAVAILABLE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\StoragePoolDisk_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolList.php new file mode 100644 index 000000000000..3d5a8e7d88e6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolList.php @@ -0,0 +1,358 @@ +google.cloud.compute.v1.StoragePoolList + */ +class StoragePoolList extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string etag = 3123477; + */ + protected $etag = null; + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of StoragePool resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.StoragePool items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#storagePoolList for lists of storagePools. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. end_interface: MixerListResponseWithEtagBuilder + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $etag + * @type string $id + * [Output Only] Unique identifier for the resource; defined by the server. + * @type array<\Google\Cloud\Compute\V1\StoragePool>|\Google\Protobuf\Internal\RepeatedField $items + * A list of StoragePool resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#storagePoolList for lists of storagePools. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. end_interface: MixerListResponseWithEtagBuilder + * @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); + } + + /** + * Generated from protobuf field optional string etag = 3123477; + * @return string + */ + public function getEtag() + { + return isset($this->etag) ? $this->etag : ''; + } + + public function hasEtag() + { + return isset($this->etag); + } + + public function clearEtag() + { + unset($this->etag); + } + + /** + * Generated from protobuf field optional string etag = 3123477; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * [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 StoragePool resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.StoragePool items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of StoragePool resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.StoragePool items = 100526016; + * @param array<\Google\Cloud\Compute\V1\StoragePool>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\StoragePool::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#storagePoolList for lists of storagePools. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#storagePoolList for lists of storagePools. + * + * 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] Unreachable resources. end_interface: MixerListResponseWithEtagBuilder + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. end_interface: MixerListResponseWithEtagBuilder + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolListDisks.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolListDisks.php new file mode 100644 index 000000000000..f27cea9e514e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolListDisks.php @@ -0,0 +1,357 @@ +google.cloud.compute.v1.StoragePoolListDisks + */ +class StoragePoolListDisks extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string etag = 3123477; + */ + protected $etag = null; + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of StoragePoolDisk resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.StoragePoolDisk items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#storagePoolListDisks for lists of disks in a storagePool. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. end_interface: MixerListResponseWithEtagBuilder + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $etag + * @type string $id + * [Output Only] Unique identifier for the resource; defined by the server. + * @type array<\Google\Cloud\Compute\V1\StoragePoolDisk>|\Google\Protobuf\Internal\RepeatedField $items + * A list of StoragePoolDisk resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#storagePoolListDisks for lists of disks in a storagePool. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. end_interface: MixerListResponseWithEtagBuilder + * @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); + } + + /** + * Generated from protobuf field optional string etag = 3123477; + * @return string + */ + public function getEtag() + { + return isset($this->etag) ? $this->etag : ''; + } + + public function hasEtag() + { + return isset($this->etag); + } + + public function clearEtag() + { + unset($this->etag); + } + + /** + * Generated from protobuf field optional string etag = 3123477; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * [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 StoragePoolDisk resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.StoragePoolDisk items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of StoragePoolDisk resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.StoragePoolDisk items = 100526016; + * @param array<\Google\Cloud\Compute\V1\StoragePoolDisk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\StoragePoolDisk::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#storagePoolListDisks for lists of disks in a storagePool. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#storagePoolListDisks for lists of disks in a storagePool. + * + * 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] Unreachable resources. end_interface: MixerListResponseWithEtagBuilder + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. end_interface: MixerListResponseWithEtagBuilder + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolResourceStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolResourceStatus.php new file mode 100644 index 000000000000..1589f7b16805 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolResourceStatus.php @@ -0,0 +1,473 @@ +google.cloud.compute.v1.StoragePoolResourceStatus + */ +class StoragePoolResourceStatus extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Number of disks used. + * + * Generated from protobuf field optional int64 disk_count = 182933485; + */ + protected $disk_count = null; + /** + * [Output Only] Timestamp of the last successful resize in RFC3339 text format. + * + * Generated from protobuf field optional string last_resize_timestamp = 500825556; + */ + protected $last_resize_timestamp = null; + /** + * [Output Only] Maximum allowed aggregate disk size in gigabytes. + * + * Generated from protobuf field optional int64 max_total_provisioned_disk_capacity_gb = 165818207; + */ + protected $max_total_provisioned_disk_capacity_gb = null; + /** + * [Output Only] Space used by data stored in disks within the storage pool (in bytes). This will reflect the total number of bytes written to the disks in the pool, in contrast to the capacity of those disks. + * + * Generated from protobuf field optional int64 pool_used_capacity_bytes = 510407877; + */ + protected $pool_used_capacity_bytes = null; + /** + * Sum of all the disks' provisioned IOPS, minus some amount that is allowed per disk that is not counted towards pool's IOPS capacity. + * + * Generated from protobuf field optional int64 pool_used_iops = 99558536; + */ + protected $pool_used_iops = null; + /** + * [Output Only] Sum of all the disks' provisioned throughput in MB/s. + * + * Generated from protobuf field optional int64 pool_used_throughput = 206130633; + */ + protected $pool_used_throughput = null; + /** + * [Output Only] Amount of data written into the pool, before it is compacted. + * + * Generated from protobuf field optional int64 pool_user_written_bytes = 228964050; + */ + protected $pool_user_written_bytes = null; + /** + * [Output Only] Sum of all the capacity provisioned in disks in this storage pool. A disk's provisioned capacity is the same as its total capacity. + * + * Generated from protobuf field optional int64 total_provisioned_disk_capacity_gb = 520930980; + */ + protected $total_provisioned_disk_capacity_gb = null; + /** + * [Output Only] Sum of all the disks' provisioned IOPS. + * + * Generated from protobuf field optional int64 total_provisioned_disk_iops = 32812549; + */ + protected $total_provisioned_disk_iops = null; + /** + * [Output Only] Sum of all the disks' provisioned throughput in MB/s, minus some amount that is allowed per disk that is not counted towards pool's throughput capacity. + * + * Generated from protobuf field optional int64 total_provisioned_disk_throughput = 447677830; + */ + protected $total_provisioned_disk_throughput = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $disk_count + * [Output Only] Number of disks used. + * @type string $last_resize_timestamp + * [Output Only] Timestamp of the last successful resize in RFC3339 text format. + * @type int|string $max_total_provisioned_disk_capacity_gb + * [Output Only] Maximum allowed aggregate disk size in gigabytes. + * @type int|string $pool_used_capacity_bytes + * [Output Only] Space used by data stored in disks within the storage pool (in bytes). This will reflect the total number of bytes written to the disks in the pool, in contrast to the capacity of those disks. + * @type int|string $pool_used_iops + * Sum of all the disks' provisioned IOPS, minus some amount that is allowed per disk that is not counted towards pool's IOPS capacity. + * @type int|string $pool_used_throughput + * [Output Only] Sum of all the disks' provisioned throughput in MB/s. + * @type int|string $pool_user_written_bytes + * [Output Only] Amount of data written into the pool, before it is compacted. + * @type int|string $total_provisioned_disk_capacity_gb + * [Output Only] Sum of all the capacity provisioned in disks in this storage pool. A disk's provisioned capacity is the same as its total capacity. + * @type int|string $total_provisioned_disk_iops + * [Output Only] Sum of all the disks' provisioned IOPS. + * @type int|string $total_provisioned_disk_throughput + * [Output Only] Sum of all the disks' provisioned throughput in MB/s, minus some amount that is allowed per disk that is not counted towards pool's throughput capacity. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Number of disks used. + * + * Generated from protobuf field optional int64 disk_count = 182933485; + * @return int|string + */ + public function getDiskCount() + { + return isset($this->disk_count) ? $this->disk_count : 0; + } + + public function hasDiskCount() + { + return isset($this->disk_count); + } + + public function clearDiskCount() + { + unset($this->disk_count); + } + + /** + * [Output Only] Number of disks used. + * + * Generated from protobuf field optional int64 disk_count = 182933485; + * @param int|string $var + * @return $this + */ + public function setDiskCount($var) + { + GPBUtil::checkInt64($var); + $this->disk_count = $var; + + return $this; + } + + /** + * [Output Only] Timestamp of the last successful resize in RFC3339 text format. + * + * Generated from protobuf field optional string last_resize_timestamp = 500825556; + * @return string + */ + public function getLastResizeTimestamp() + { + return isset($this->last_resize_timestamp) ? $this->last_resize_timestamp : ''; + } + + public function hasLastResizeTimestamp() + { + return isset($this->last_resize_timestamp); + } + + public function clearLastResizeTimestamp() + { + unset($this->last_resize_timestamp); + } + + /** + * [Output Only] Timestamp of the last successful resize in RFC3339 text format. + * + * Generated from protobuf field optional string last_resize_timestamp = 500825556; + * @param string $var + * @return $this + */ + public function setLastResizeTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->last_resize_timestamp = $var; + + return $this; + } + + /** + * [Output Only] Maximum allowed aggregate disk size in gigabytes. + * + * Generated from protobuf field optional int64 max_total_provisioned_disk_capacity_gb = 165818207; + * @return int|string + */ + public function getMaxTotalProvisionedDiskCapacityGb() + { + return isset($this->max_total_provisioned_disk_capacity_gb) ? $this->max_total_provisioned_disk_capacity_gb : 0; + } + + public function hasMaxTotalProvisionedDiskCapacityGb() + { + return isset($this->max_total_provisioned_disk_capacity_gb); + } + + public function clearMaxTotalProvisionedDiskCapacityGb() + { + unset($this->max_total_provisioned_disk_capacity_gb); + } + + /** + * [Output Only] Maximum allowed aggregate disk size in gigabytes. + * + * Generated from protobuf field optional int64 max_total_provisioned_disk_capacity_gb = 165818207; + * @param int|string $var + * @return $this + */ + public function setMaxTotalProvisionedDiskCapacityGb($var) + { + GPBUtil::checkInt64($var); + $this->max_total_provisioned_disk_capacity_gb = $var; + + return $this; + } + + /** + * [Output Only] Space used by data stored in disks within the storage pool (in bytes). This will reflect the total number of bytes written to the disks in the pool, in contrast to the capacity of those disks. + * + * Generated from protobuf field optional int64 pool_used_capacity_bytes = 510407877; + * @return int|string + */ + public function getPoolUsedCapacityBytes() + { + return isset($this->pool_used_capacity_bytes) ? $this->pool_used_capacity_bytes : 0; + } + + public function hasPoolUsedCapacityBytes() + { + return isset($this->pool_used_capacity_bytes); + } + + public function clearPoolUsedCapacityBytes() + { + unset($this->pool_used_capacity_bytes); + } + + /** + * [Output Only] Space used by data stored in disks within the storage pool (in bytes). This will reflect the total number of bytes written to the disks in the pool, in contrast to the capacity of those disks. + * + * Generated from protobuf field optional int64 pool_used_capacity_bytes = 510407877; + * @param int|string $var + * @return $this + */ + public function setPoolUsedCapacityBytes($var) + { + GPBUtil::checkInt64($var); + $this->pool_used_capacity_bytes = $var; + + return $this; + } + + /** + * Sum of all the disks' provisioned IOPS, minus some amount that is allowed per disk that is not counted towards pool's IOPS capacity. + * + * Generated from protobuf field optional int64 pool_used_iops = 99558536; + * @return int|string + */ + public function getPoolUsedIops() + { + return isset($this->pool_used_iops) ? $this->pool_used_iops : 0; + } + + public function hasPoolUsedIops() + { + return isset($this->pool_used_iops); + } + + public function clearPoolUsedIops() + { + unset($this->pool_used_iops); + } + + /** + * Sum of all the disks' provisioned IOPS, minus some amount that is allowed per disk that is not counted towards pool's IOPS capacity. + * + * Generated from protobuf field optional int64 pool_used_iops = 99558536; + * @param int|string $var + * @return $this + */ + public function setPoolUsedIops($var) + { + GPBUtil::checkInt64($var); + $this->pool_used_iops = $var; + + return $this; + } + + /** + * [Output Only] Sum of all the disks' provisioned throughput in MB/s. + * + * Generated from protobuf field optional int64 pool_used_throughput = 206130633; + * @return int|string + */ + public function getPoolUsedThroughput() + { + return isset($this->pool_used_throughput) ? $this->pool_used_throughput : 0; + } + + public function hasPoolUsedThroughput() + { + return isset($this->pool_used_throughput); + } + + public function clearPoolUsedThroughput() + { + unset($this->pool_used_throughput); + } + + /** + * [Output Only] Sum of all the disks' provisioned throughput in MB/s. + * + * Generated from protobuf field optional int64 pool_used_throughput = 206130633; + * @param int|string $var + * @return $this + */ + public function setPoolUsedThroughput($var) + { + GPBUtil::checkInt64($var); + $this->pool_used_throughput = $var; + + return $this; + } + + /** + * [Output Only] Amount of data written into the pool, before it is compacted. + * + * Generated from protobuf field optional int64 pool_user_written_bytes = 228964050; + * @return int|string + */ + public function getPoolUserWrittenBytes() + { + return isset($this->pool_user_written_bytes) ? $this->pool_user_written_bytes : 0; + } + + public function hasPoolUserWrittenBytes() + { + return isset($this->pool_user_written_bytes); + } + + public function clearPoolUserWrittenBytes() + { + unset($this->pool_user_written_bytes); + } + + /** + * [Output Only] Amount of data written into the pool, before it is compacted. + * + * Generated from protobuf field optional int64 pool_user_written_bytes = 228964050; + * @param int|string $var + * @return $this + */ + public function setPoolUserWrittenBytes($var) + { + GPBUtil::checkInt64($var); + $this->pool_user_written_bytes = $var; + + return $this; + } + + /** + * [Output Only] Sum of all the capacity provisioned in disks in this storage pool. A disk's provisioned capacity is the same as its total capacity. + * + * Generated from protobuf field optional int64 total_provisioned_disk_capacity_gb = 520930980; + * @return int|string + */ + public function getTotalProvisionedDiskCapacityGb() + { + return isset($this->total_provisioned_disk_capacity_gb) ? $this->total_provisioned_disk_capacity_gb : 0; + } + + public function hasTotalProvisionedDiskCapacityGb() + { + return isset($this->total_provisioned_disk_capacity_gb); + } + + public function clearTotalProvisionedDiskCapacityGb() + { + unset($this->total_provisioned_disk_capacity_gb); + } + + /** + * [Output Only] Sum of all the capacity provisioned in disks in this storage pool. A disk's provisioned capacity is the same as its total capacity. + * + * Generated from protobuf field optional int64 total_provisioned_disk_capacity_gb = 520930980; + * @param int|string $var + * @return $this + */ + public function setTotalProvisionedDiskCapacityGb($var) + { + GPBUtil::checkInt64($var); + $this->total_provisioned_disk_capacity_gb = $var; + + return $this; + } + + /** + * [Output Only] Sum of all the disks' provisioned IOPS. + * + * Generated from protobuf field optional int64 total_provisioned_disk_iops = 32812549; + * @return int|string + */ + public function getTotalProvisionedDiskIops() + { + return isset($this->total_provisioned_disk_iops) ? $this->total_provisioned_disk_iops : 0; + } + + public function hasTotalProvisionedDiskIops() + { + return isset($this->total_provisioned_disk_iops); + } + + public function clearTotalProvisionedDiskIops() + { + unset($this->total_provisioned_disk_iops); + } + + /** + * [Output Only] Sum of all the disks' provisioned IOPS. + * + * Generated from protobuf field optional int64 total_provisioned_disk_iops = 32812549; + * @param int|string $var + * @return $this + */ + public function setTotalProvisionedDiskIops($var) + { + GPBUtil::checkInt64($var); + $this->total_provisioned_disk_iops = $var; + + return $this; + } + + /** + * [Output Only] Sum of all the disks' provisioned throughput in MB/s, minus some amount that is allowed per disk that is not counted towards pool's throughput capacity. + * + * Generated from protobuf field optional int64 total_provisioned_disk_throughput = 447677830; + * @return int|string + */ + public function getTotalProvisionedDiskThroughput() + { + return isset($this->total_provisioned_disk_throughput) ? $this->total_provisioned_disk_throughput : 0; + } + + public function hasTotalProvisionedDiskThroughput() + { + return isset($this->total_provisioned_disk_throughput); + } + + public function clearTotalProvisionedDiskThroughput() + { + unset($this->total_provisioned_disk_throughput); + } + + /** + * [Output Only] Sum of all the disks' provisioned throughput in MB/s, minus some amount that is allowed per disk that is not counted towards pool's throughput capacity. + * + * Generated from protobuf field optional int64 total_provisioned_disk_throughput = 447677830; + * @param int|string $var + * @return $this + */ + public function setTotalProvisionedDiskThroughput($var) + { + GPBUtil::checkInt64($var); + $this->total_provisioned_disk_throughput = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolType.php new file mode 100644 index 000000000000..c79987b4061d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolType.php @@ -0,0 +1,770 @@ +google.cloud.compute.v1.StoragePoolType + */ +class StoragePoolType extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * [Output Only] The deprecation status associated with this storage pool type. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + */ + protected $deprecated = null; + /** + * [Output Only] An optional description of this resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#storagePoolType for storage pool types. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * [Output Only] Maximum storage pool size in GB. + * + * Generated from protobuf field optional int64 max_pool_provisioned_capacity_gb = 182139085; + */ + protected $max_pool_provisioned_capacity_gb = null; + /** + * [Output Only] Maximum provisioned IOPS. + * + * Generated from protobuf field optional int64 max_pool_provisioned_iops = 515270652; + */ + protected $max_pool_provisioned_iops = null; + /** + * [Output Only] Maximum provisioned throughput. + * + * Generated from protobuf field optional int64 max_pool_provisioned_throughput = 228928061; + */ + protected $max_pool_provisioned_throughput = null; + /** + * [Output Only] Minimum storage pool size in GB. + * + * Generated from protobuf field optional int64 min_pool_provisioned_capacity_gb = 191022751; + */ + protected $min_pool_provisioned_capacity_gb = null; + /** + * [Output Only] Minimum provisioned IOPS. + * + * Generated from protobuf field optional int64 min_pool_provisioned_iops = 416473706; + */ + protected $min_pool_provisioned_iops = null; + /** + * [Output Only] Minimum provisioned throughput. + * + * Generated from protobuf field optional int64 min_pool_provisioned_throughput = 367761963; + */ + protected $min_pool_provisioned_throughput = null; + /** + * [Deprecated] This field is deprecated. Use minPoolProvisionedCapacityGb instead. + * + * Generated from protobuf field optional int64 min_size_gb = 385278188; + */ + protected $min_size_gb = null; + /** + * [Output Only] Name of the resource. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Server-defined URL for this resource with the resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + */ + protected $self_link_with_id = null; + /** + * [Output Only] The list of disk types supported in this storage pool type. + * + * Generated from protobuf field repeated string supported_disk_types = 150587272; + */ + private $supported_disk_types; + /** + * [Output Only] URL of the zone where the storage pool type resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + */ + protected $zone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type \Google\Cloud\Compute\V1\DeprecationStatus $deprecated + * [Output Only] The deprecation status associated with this storage pool type. + * @type string $description + * [Output Only] An optional description of this resource. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of the resource. Always compute#storagePoolType for storage pool types. + * @type int|string $max_pool_provisioned_capacity_gb + * [Output Only] Maximum storage pool size in GB. + * @type int|string $max_pool_provisioned_iops + * [Output Only] Maximum provisioned IOPS. + * @type int|string $max_pool_provisioned_throughput + * [Output Only] Maximum provisioned throughput. + * @type int|string $min_pool_provisioned_capacity_gb + * [Output Only] Minimum storage pool size in GB. + * @type int|string $min_pool_provisioned_iops + * [Output Only] Minimum provisioned IOPS. + * @type int|string $min_pool_provisioned_throughput + * [Output Only] Minimum provisioned throughput. + * @type int|string $min_size_gb + * [Deprecated] This field is deprecated. Use minPoolProvisionedCapacityGb instead. + * @type string $name + * [Output Only] Name of the resource. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $self_link_with_id + * [Output Only] Server-defined URL for this resource with the resource id. + * @type array|\Google\Protobuf\Internal\RepeatedField $supported_disk_types + * [Output Only] The list of disk types supported in this storage pool type. + * @type string $zone + * [Output Only] URL of the zone where the storage pool type resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * [Output Only] The deprecation status associated with this storage pool type. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + * @return \Google\Cloud\Compute\V1\DeprecationStatus|null + */ + public function getDeprecated() + { + return $this->deprecated; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * [Output Only] The deprecation status associated with this storage pool type. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + * @param \Google\Cloud\Compute\V1\DeprecationStatus $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DeprecationStatus::class); + $this->deprecated = $var; + + return $this; + } + + /** + * [Output Only] An optional description of this resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * [Output Only] An optional description of this resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#storagePoolType for storage pool types. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#storagePoolType for storage pool types. + * + * 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] Maximum storage pool size in GB. + * + * Generated from protobuf field optional int64 max_pool_provisioned_capacity_gb = 182139085; + * @return int|string + */ + public function getMaxPoolProvisionedCapacityGb() + { + return isset($this->max_pool_provisioned_capacity_gb) ? $this->max_pool_provisioned_capacity_gb : 0; + } + + public function hasMaxPoolProvisionedCapacityGb() + { + return isset($this->max_pool_provisioned_capacity_gb); + } + + public function clearMaxPoolProvisionedCapacityGb() + { + unset($this->max_pool_provisioned_capacity_gb); + } + + /** + * [Output Only] Maximum storage pool size in GB. + * + * Generated from protobuf field optional int64 max_pool_provisioned_capacity_gb = 182139085; + * @param int|string $var + * @return $this + */ + public function setMaxPoolProvisionedCapacityGb($var) + { + GPBUtil::checkInt64($var); + $this->max_pool_provisioned_capacity_gb = $var; + + return $this; + } + + /** + * [Output Only] Maximum provisioned IOPS. + * + * Generated from protobuf field optional int64 max_pool_provisioned_iops = 515270652; + * @return int|string + */ + public function getMaxPoolProvisionedIops() + { + return isset($this->max_pool_provisioned_iops) ? $this->max_pool_provisioned_iops : 0; + } + + public function hasMaxPoolProvisionedIops() + { + return isset($this->max_pool_provisioned_iops); + } + + public function clearMaxPoolProvisionedIops() + { + unset($this->max_pool_provisioned_iops); + } + + /** + * [Output Only] Maximum provisioned IOPS. + * + * Generated from protobuf field optional int64 max_pool_provisioned_iops = 515270652; + * @param int|string $var + * @return $this + */ + public function setMaxPoolProvisionedIops($var) + { + GPBUtil::checkInt64($var); + $this->max_pool_provisioned_iops = $var; + + return $this; + } + + /** + * [Output Only] Maximum provisioned throughput. + * + * Generated from protobuf field optional int64 max_pool_provisioned_throughput = 228928061; + * @return int|string + */ + public function getMaxPoolProvisionedThroughput() + { + return isset($this->max_pool_provisioned_throughput) ? $this->max_pool_provisioned_throughput : 0; + } + + public function hasMaxPoolProvisionedThroughput() + { + return isset($this->max_pool_provisioned_throughput); + } + + public function clearMaxPoolProvisionedThroughput() + { + unset($this->max_pool_provisioned_throughput); + } + + /** + * [Output Only] Maximum provisioned throughput. + * + * Generated from protobuf field optional int64 max_pool_provisioned_throughput = 228928061; + * @param int|string $var + * @return $this + */ + public function setMaxPoolProvisionedThroughput($var) + { + GPBUtil::checkInt64($var); + $this->max_pool_provisioned_throughput = $var; + + return $this; + } + + /** + * [Output Only] Minimum storage pool size in GB. + * + * Generated from protobuf field optional int64 min_pool_provisioned_capacity_gb = 191022751; + * @return int|string + */ + public function getMinPoolProvisionedCapacityGb() + { + return isset($this->min_pool_provisioned_capacity_gb) ? $this->min_pool_provisioned_capacity_gb : 0; + } + + public function hasMinPoolProvisionedCapacityGb() + { + return isset($this->min_pool_provisioned_capacity_gb); + } + + public function clearMinPoolProvisionedCapacityGb() + { + unset($this->min_pool_provisioned_capacity_gb); + } + + /** + * [Output Only] Minimum storage pool size in GB. + * + * Generated from protobuf field optional int64 min_pool_provisioned_capacity_gb = 191022751; + * @param int|string $var + * @return $this + */ + public function setMinPoolProvisionedCapacityGb($var) + { + GPBUtil::checkInt64($var); + $this->min_pool_provisioned_capacity_gb = $var; + + return $this; + } + + /** + * [Output Only] Minimum provisioned IOPS. + * + * Generated from protobuf field optional int64 min_pool_provisioned_iops = 416473706; + * @return int|string + */ + public function getMinPoolProvisionedIops() + { + return isset($this->min_pool_provisioned_iops) ? $this->min_pool_provisioned_iops : 0; + } + + public function hasMinPoolProvisionedIops() + { + return isset($this->min_pool_provisioned_iops); + } + + public function clearMinPoolProvisionedIops() + { + unset($this->min_pool_provisioned_iops); + } + + /** + * [Output Only] Minimum provisioned IOPS. + * + * Generated from protobuf field optional int64 min_pool_provisioned_iops = 416473706; + * @param int|string $var + * @return $this + */ + public function setMinPoolProvisionedIops($var) + { + GPBUtil::checkInt64($var); + $this->min_pool_provisioned_iops = $var; + + return $this; + } + + /** + * [Output Only] Minimum provisioned throughput. + * + * Generated from protobuf field optional int64 min_pool_provisioned_throughput = 367761963; + * @return int|string + */ + public function getMinPoolProvisionedThroughput() + { + return isset($this->min_pool_provisioned_throughput) ? $this->min_pool_provisioned_throughput : 0; + } + + public function hasMinPoolProvisionedThroughput() + { + return isset($this->min_pool_provisioned_throughput); + } + + public function clearMinPoolProvisionedThroughput() + { + unset($this->min_pool_provisioned_throughput); + } + + /** + * [Output Only] Minimum provisioned throughput. + * + * Generated from protobuf field optional int64 min_pool_provisioned_throughput = 367761963; + * @param int|string $var + * @return $this + */ + public function setMinPoolProvisionedThroughput($var) + { + GPBUtil::checkInt64($var); + $this->min_pool_provisioned_throughput = $var; + + return $this; + } + + /** + * [Deprecated] This field is deprecated. Use minPoolProvisionedCapacityGb instead. + * + * Generated from protobuf field optional int64 min_size_gb = 385278188; + * @return int|string + */ + public function getMinSizeGb() + { + return isset($this->min_size_gb) ? $this->min_size_gb : 0; + } + + public function hasMinSizeGb() + { + return isset($this->min_size_gb); + } + + public function clearMinSizeGb() + { + unset($this->min_size_gb); + } + + /** + * [Deprecated] This field is deprecated. Use minPoolProvisionedCapacityGb instead. + * + * Generated from protobuf field optional int64 min_size_gb = 385278188; + * @param int|string $var + * @return $this + */ + public function setMinSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->min_size_gb = $var; + + return $this; + } + + /** + * [Output Only] Name of the resource. + * + * 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); + } + + /** + * [Output Only] Name of the resource. + * + * 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; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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] Server-defined URL for this resource with the resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + * @return string + */ + public function getSelfLinkWithId() + { + return isset($this->self_link_with_id) ? $this->self_link_with_id : ''; + } + + public function hasSelfLinkWithId() + { + return isset($this->self_link_with_id); + } + + public function clearSelfLinkWithId() + { + unset($this->self_link_with_id); + } + + /** + * [Output Only] Server-defined URL for this resource with the resource id. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + * @param string $var + * @return $this + */ + public function setSelfLinkWithId($var) + { + GPBUtil::checkString($var, True); + $this->self_link_with_id = $var; + + return $this; + } + + /** + * [Output Only] The list of disk types supported in this storage pool type. + * + * Generated from protobuf field repeated string supported_disk_types = 150587272; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSupportedDiskTypes() + { + return $this->supported_disk_types; + } + + /** + * [Output Only] The list of disk types supported in this storage pool type. + * + * Generated from protobuf field repeated string supported_disk_types = 150587272; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSupportedDiskTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->supported_disk_types = $arr; + + return $this; + } + + /** + * [Output Only] URL of the zone where the storage pool type resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + * @return string + */ + public function getZone() + { + return isset($this->zone) ? $this->zone : ''; + } + + public function hasZone() + { + return isset($this->zone); + } + + public function clearZone() + { + unset($this->zone); + } + + /** + * [Output Only] URL of the zone where the storage pool type resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolTypeAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolTypeAggregatedList.php new file mode 100644 index 000000000000..9fef345fae78 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolTypeAggregatedList.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.StoragePoolTypeAggregatedList + */ +class StoragePoolTypeAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of StoragePoolTypesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#storagePoolTypeAggregatedList . + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 StoragePoolTypesScopedList resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#storagePoolTypeAggregatedList . + * @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 StoragePoolTypesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of StoragePoolTypesScopedList 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\StoragePoolTypesScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#storagePoolTypeAggregatedList . + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#storagePoolTypeAggregatedList . + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolTypeList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolTypeList.php new file mode 100644 index 000000000000..1cae80c73832 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolTypeList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.StoragePoolTypeList + */ +class StoragePoolTypeList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of StoragePoolType resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.StoragePoolType items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#storagePoolTypeList for storage pool types. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\StoragePoolType>|\Google\Protobuf\Internal\RepeatedField $items + * A list of StoragePoolType resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#storagePoolTypeList for storage pool types. + * @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 StoragePoolType resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.StoragePoolType items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of StoragePoolType resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.StoragePoolType items = 100526016; + * @param array<\Google\Cloud\Compute\V1\StoragePoolType>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\StoragePoolType::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#storagePoolTypeList for storage pool types. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#storagePoolTypeList for storage pool types. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolTypesScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolTypesScopedList.php new file mode 100644 index 000000000000..a65ddf727660 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolTypesScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.StoragePoolTypesScopedList + */ +class StoragePoolTypesScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A list of storage pool types contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.StoragePoolType storage_pool_types = 276043482; + */ + private $storage_pool_types; + /** + * [Output Only] Informational warning which replaces the list of storage pool types when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\StoragePoolType>|\Google\Protobuf\Internal\RepeatedField $storage_pool_types + * [Output Only] A list of storage pool types contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] Informational warning which replaces the list of storage pool types 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 storage pool types contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.StoragePoolType storage_pool_types = 276043482; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStoragePoolTypes() + { + return $this->storage_pool_types; + } + + /** + * [Output Only] A list of storage pool types contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.StoragePoolType storage_pool_types = 276043482; + * @param array<\Google\Cloud\Compute\V1\StoragePoolType>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStoragePoolTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\StoragePoolType::class); + $this->storage_pool_types = $arr; + + return $this; + } + + /** + * [Output Only] Informational warning which replaces the list of storage pool types 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] Informational warning which replaces the list of storage pool types 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolsScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolsScopedList.php new file mode 100644 index 000000000000..bbc41603e514 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePoolsScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.StoragePoolsScopedList + */ +class StoragePoolsScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A list of storage pool contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.StoragePool storage_pools = 437258515; + */ + private $storage_pools; + /** + * [Output Only] Informational warning which replaces the list of storage pool when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\StoragePool>|\Google\Protobuf\Internal\RepeatedField $storage_pools + * [Output Only] A list of storage pool contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] Informational warning which replaces the list of storage pool 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 storage pool contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.StoragePool storage_pools = 437258515; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getStoragePools() + { + return $this->storage_pools; + } + + /** + * [Output Only] A list of storage pool contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.StoragePool storage_pools = 437258515; + * @param array<\Google\Cloud\Compute\V1\StoragePool>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setStoragePools($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\StoragePool::class); + $this->storage_pools = $arr; + + return $this; + } + + /** + * [Output Only] Informational warning which replaces the list of storage pool 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] Informational warning which replaces the list of storage pool 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork.php new file mode 100644 index 000000000000..18febe9fa5a9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork.php @@ -0,0 +1,1147 @@ +google.cloud.compute.v1.Subnetwork + */ +class Subnetwork extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is determined by the org policy, if there is no org policy specified, then it will default to disabled. This field isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY. + * + * Generated from protobuf field optional bool enable_flow_logs = 151544420; + */ + protected $enable_flow_logs = null; + /** + * The external IPv6 address range that is owned by this subnetwork. + * + * Generated from protobuf field optional string external_ipv6_prefix = 139299190; + */ + protected $external_ipv6_prefix = null; + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a Subnetwork. An up-to-date fingerprint must be provided in order to update the Subnetwork, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a Subnetwork. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * [Output Only] The gateway address for default routes to reach destination addresses outside this subnetwork. + * + * Generated from protobuf field optional string gateway_address = 459867385; + */ + protected $gateway_address = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] The internal IPv6 address range that is assigned to this subnetwork. + * + * Generated from protobuf field optional string internal_ipv6_prefix = 506270056; + */ + protected $internal_ipv6_prefix = null; + /** + * The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 100.64.0.0/10. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. This field is set at resource creation time. The range can be any range listed in the Valid ranges list. The range can be expanded after creation using expandIpCidrRange. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + */ + protected $ip_cidr_range = null; + /** + * The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack. + * Check the Ipv6AccessType enum for the list of possible values. + * + * Generated from protobuf field optional string ipv6_access_type = 504658653; + */ + protected $ipv6_access_type = null; + /** + * [Output Only] This field is for internal use. + * + * Generated from protobuf field optional string ipv6_cidr_range = 273141258; + */ + protected $ipv6_cidr_range = null; + /** + * [Output Only] Type of the resource. Always compute#subnetwork for Subnetwork resources. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * This field denotes the VPC flow logging options for this subnetwork. If logging is enabled, logs are exported to Cloud Logging. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SubnetworkLogConfig log_config = 351299741; + */ + protected $log_config = null; + /** + * The name of the resource, provided by the client when initially creating the resource. 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. This field can be set only at resource creation time. + * + * Generated from protobuf field optional string network = 232872494; + */ + protected $network = null; + /** + * Whether the VMs in this subnet can access Google services without assigned external IP addresses. This field can be both set at resource creation time and updated using setPrivateIpGoogleAccess. + * + * Generated from protobuf field optional bool private_ip_google_access = 421491790; + */ + protected $private_ip_google_access = null; + /** + * This field is for internal use. This field can be both set at resource creation time and updated using patch. + * Check the PrivateIpv6GoogleAccess enum for the list of possible values. + * + * Generated from protobuf field optional string private_ipv6_google_access = 48277006; + */ + protected $private_ipv6_google_access = null; + /** + * The purpose of the resource. This field can be either PRIVATE, GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, or PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. Subnets with purpose set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks that are reserved for Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. + * Check the Purpose enum for the list of possible values. + * + * Generated from protobuf field optional string purpose = 316407070; + */ + protected $purpose = null; + /** + * URL of the region where the Subnetwork resides. This field can be set only at resource creation time. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * The URL of the reserved internal range. + * + * Generated from protobuf field optional string reserved_internal_range = 286248754; + */ + protected $reserved_internal_range = null; + /** + * The role of subnetwork. Currently, this field is only used when purpose is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. This field can be updated with a patch request. + * Check the Role enum for the list of possible values. + * + * Generated from protobuf field optional string role = 3506294; + */ + protected $role = null; + /** + * An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. This field can be updated with a patch request. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SubnetworkSecondaryRange secondary_ip_ranges = 136658915; + */ + private $secondary_ip_ranges; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * The stack type for the subnet. If set to IPV4_ONLY, new VMs in the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and IPv6 addresses. If not specified, IPV4_ONLY is used. This field can be both set at resource creation time and updated using patch. + * Check the StackType enum for the list of possible values. + * + * Generated from protobuf field optional string stack_type = 425908881; + */ + protected $stack_type = null; + /** + * [Output Only] The state of the subnetwork, which can be one of the following values: READY: Subnetwork is created and ready to use DRAINING: only applicable to subnetworks that have the purpose set to INTERNAL_HTTPS_LOAD_BALANCER and indicates that connections to the load balancer are being drained. A subnetwork that is draining cannot be used or modified until it reaches a status of READY + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + */ + protected $state = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time. + * @type bool $enable_flow_logs + * Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is determined by the org policy, if there is no org policy specified, then it will default to disabled. This field isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY. + * @type string $external_ipv6_prefix + * The external IPv6 address range that is owned by this subnetwork. + * @type string $fingerprint + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a Subnetwork. An up-to-date fingerprint must be provided in order to update the Subnetwork, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a Subnetwork. + * @type string $gateway_address + * [Output Only] The gateway address for default routes to reach destination addresses outside this subnetwork. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $internal_ipv6_prefix + * [Output Only] The internal IPv6 address range that is assigned to this subnetwork. + * @type string $ip_cidr_range + * The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 100.64.0.0/10. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. This field is set at resource creation time. The range can be any range listed in the Valid ranges list. The range can be expanded after creation using expandIpCidrRange. + * @type string $ipv6_access_type + * The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack. + * Check the Ipv6AccessType enum for the list of possible values. + * @type string $ipv6_cidr_range + * [Output Only] This field is for internal use. + * @type string $kind + * [Output Only] Type of the resource. Always compute#subnetwork for Subnetwork resources. + * @type \Google\Cloud\Compute\V1\SubnetworkLogConfig $log_config + * This field denotes the VPC flow logging options for this subnetwork. If logging is enabled, logs are exported to Cloud Logging. + * @type string $name + * The name of the resource, provided by the client when initially creating the resource. 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 string $network + * The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. This field can be set only at resource creation time. + * @type bool $private_ip_google_access + * Whether the VMs in this subnet can access Google services without assigned external IP addresses. This field can be both set at resource creation time and updated using setPrivateIpGoogleAccess. + * @type string $private_ipv6_google_access + * This field is for internal use. This field can be both set at resource creation time and updated using patch. + * Check the PrivateIpv6GoogleAccess enum for the list of possible values. + * @type string $purpose + * The purpose of the resource. This field can be either PRIVATE, GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, or PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. Subnets with purpose set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks that are reserved for Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. + * Check the Purpose enum for the list of possible values. + * @type string $region + * URL of the region where the Subnetwork resides. This field can be set only at resource creation time. + * @type string $reserved_internal_range + * The URL of the reserved internal range. + * @type string $role + * The role of subnetwork. Currently, this field is only used when purpose is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. This field can be updated with a patch request. + * Check the Role enum for the list of possible values. + * @type array<\Google\Cloud\Compute\V1\SubnetworkSecondaryRange>|\Google\Protobuf\Internal\RepeatedField $secondary_ip_ranges + * An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. This field can be updated with a patch request. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $stack_type + * The stack type for the subnet. If set to IPV4_ONLY, new VMs in the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and IPv6 addresses. If not specified, IPV4_ONLY is used. This field can be both set at resource creation time and updated using patch. + * Check the StackType enum for the list of possible values. + * @type string $state + * [Output Only] The state of the subnetwork, which can be one of the following values: READY: Subnetwork is created and ready to use DRAINING: only applicable to subnetworks that have the purpose set to INTERNAL_HTTPS_LOAD_BALANCER and indicates that connections to the load balancer are being drained. A subnetwork that is draining cannot be used or modified until it reaches a status of READY + * Check the State enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is determined by the org policy, if there is no org policy specified, then it will default to disabled. This field isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY. + * + * Generated from protobuf field optional bool enable_flow_logs = 151544420; + * @return bool + */ + public function getEnableFlowLogs() + { + return isset($this->enable_flow_logs) ? $this->enable_flow_logs : false; + } + + public function hasEnableFlowLogs() + { + return isset($this->enable_flow_logs); + } + + public function clearEnableFlowLogs() + { + unset($this->enable_flow_logs); + } + + /** + * Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is determined by the org policy, if there is no org policy specified, then it will default to disabled. This field isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY. + * + * Generated from protobuf field optional bool enable_flow_logs = 151544420; + * @param bool $var + * @return $this + */ + public function setEnableFlowLogs($var) + { + GPBUtil::checkBool($var); + $this->enable_flow_logs = $var; + + return $this; + } + + /** + * The external IPv6 address range that is owned by this subnetwork. + * + * Generated from protobuf field optional string external_ipv6_prefix = 139299190; + * @return string + */ + public function getExternalIpv6Prefix() + { + return isset($this->external_ipv6_prefix) ? $this->external_ipv6_prefix : ''; + } + + public function hasExternalIpv6Prefix() + { + return isset($this->external_ipv6_prefix); + } + + public function clearExternalIpv6Prefix() + { + unset($this->external_ipv6_prefix); + } + + /** + * The external IPv6 address range that is owned by this subnetwork. + * + * Generated from protobuf field optional string external_ipv6_prefix = 139299190; + * @param string $var + * @return $this + */ + public function setExternalIpv6Prefix($var) + { + GPBUtil::checkString($var, True); + $this->external_ipv6_prefix = $var; + + return $this; + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a Subnetwork. An up-to-date fingerprint must be provided in order to update the Subnetwork, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a Subnetwork. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a Subnetwork. An up-to-date fingerprint must be provided in order to update the Subnetwork, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a Subnetwork. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * [Output Only] The gateway address for default routes to reach destination addresses outside this subnetwork. + * + * Generated from protobuf field optional string gateway_address = 459867385; + * @return string + */ + public function getGatewayAddress() + { + return isset($this->gateway_address) ? $this->gateway_address : ''; + } + + public function hasGatewayAddress() + { + return isset($this->gateway_address); + } + + public function clearGatewayAddress() + { + unset($this->gateway_address); + } + + /** + * [Output Only] The gateway address for default routes to reach destination addresses outside this subnetwork. + * + * Generated from protobuf field optional string gateway_address = 459867385; + * @param string $var + * @return $this + */ + public function setGatewayAddress($var) + { + GPBUtil::checkString($var, True); + $this->gateway_address = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] The internal IPv6 address range that is assigned to this subnetwork. + * + * Generated from protobuf field optional string internal_ipv6_prefix = 506270056; + * @return string + */ + public function getInternalIpv6Prefix() + { + return isset($this->internal_ipv6_prefix) ? $this->internal_ipv6_prefix : ''; + } + + public function hasInternalIpv6Prefix() + { + return isset($this->internal_ipv6_prefix); + } + + public function clearInternalIpv6Prefix() + { + unset($this->internal_ipv6_prefix); + } + + /** + * [Output Only] The internal IPv6 address range that is assigned to this subnetwork. + * + * Generated from protobuf field optional string internal_ipv6_prefix = 506270056; + * @param string $var + * @return $this + */ + public function setInternalIpv6Prefix($var) + { + GPBUtil::checkString($var, True); + $this->internal_ipv6_prefix = $var; + + return $this; + } + + /** + * The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 100.64.0.0/10. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. This field is set at resource creation time. The range can be any range listed in the Valid ranges list. The range can be expanded after creation using expandIpCidrRange. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + * @return string + */ + public function getIpCidrRange() + { + return isset($this->ip_cidr_range) ? $this->ip_cidr_range : ''; + } + + public function hasIpCidrRange() + { + return isset($this->ip_cidr_range); + } + + public function clearIpCidrRange() + { + unset($this->ip_cidr_range); + } + + /** + * The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 100.64.0.0/10. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. This field is set at resource creation time. The range can be any range listed in the Valid ranges list. The range can be expanded after creation using expandIpCidrRange. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + * @param string $var + * @return $this + */ + public function setIpCidrRange($var) + { + GPBUtil::checkString($var, True); + $this->ip_cidr_range = $var; + + return $this; + } + + /** + * The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack. + * Check the Ipv6AccessType enum for the list of possible values. + * + * Generated from protobuf field optional string ipv6_access_type = 504658653; + * @return string + */ + public function getIpv6AccessType() + { + return isset($this->ipv6_access_type) ? $this->ipv6_access_type : ''; + } + + public function hasIpv6AccessType() + { + return isset($this->ipv6_access_type); + } + + public function clearIpv6AccessType() + { + unset($this->ipv6_access_type); + } + + /** + * The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack. + * Check the Ipv6AccessType enum for the list of possible values. + * + * Generated from protobuf field optional string ipv6_access_type = 504658653; + * @param string $var + * @return $this + */ + public function setIpv6AccessType($var) + { + GPBUtil::checkString($var, True); + $this->ipv6_access_type = $var; + + return $this; + } + + /** + * [Output Only] This field is for internal use. + * + * Generated from protobuf field optional string ipv6_cidr_range = 273141258; + * @return string + */ + public function getIpv6CidrRange() + { + return isset($this->ipv6_cidr_range) ? $this->ipv6_cidr_range : ''; + } + + public function hasIpv6CidrRange() + { + return isset($this->ipv6_cidr_range); + } + + public function clearIpv6CidrRange() + { + unset($this->ipv6_cidr_range); + } + + /** + * [Output Only] This field is for internal use. + * + * Generated from protobuf field optional string ipv6_cidr_range = 273141258; + * @param string $var + * @return $this + */ + public function setIpv6CidrRange($var) + { + GPBUtil::checkString($var, True); + $this->ipv6_cidr_range = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#subnetwork for Subnetwork resources. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#subnetwork for Subnetwork resources. + * + * 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; + } + + /** + * This field denotes the VPC flow logging options for this subnetwork. If logging is enabled, logs are exported to Cloud Logging. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SubnetworkLogConfig log_config = 351299741; + * @return \Google\Cloud\Compute\V1\SubnetworkLogConfig|null + */ + public function getLogConfig() + { + return $this->log_config; + } + + public function hasLogConfig() + { + return isset($this->log_config); + } + + public function clearLogConfig() + { + unset($this->log_config); + } + + /** + * This field denotes the VPC flow logging options for this subnetwork. If logging is enabled, logs are exported to Cloud Logging. + * + * Generated from protobuf field optional .google.cloud.compute.v1.SubnetworkLogConfig log_config = 351299741; + * @param \Google\Cloud\Compute\V1\SubnetworkLogConfig $var + * @return $this + */ + public function setLogConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SubnetworkLogConfig::class); + $this->log_config = $var; + + return $this; + } + + /** + * The name of the resource, provided by the client when initially creating the resource. 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. + * + * 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 of the resource, provided by the client when initially creating the resource. 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. + * + * 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; + } + + /** + * The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. This field can be set only at resource creation time. + * + * Generated from protobuf field optional string network = 232872494; + * @return string + */ + public function getNetwork() + { + return isset($this->network) ? $this->network : ''; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. This field can be set only at resource creation time. + * + * Generated from protobuf field optional string network = 232872494; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * Whether the VMs in this subnet can access Google services without assigned external IP addresses. This field can be both set at resource creation time and updated using setPrivateIpGoogleAccess. + * + * Generated from protobuf field optional bool private_ip_google_access = 421491790; + * @return bool + */ + public function getPrivateIpGoogleAccess() + { + return isset($this->private_ip_google_access) ? $this->private_ip_google_access : false; + } + + public function hasPrivateIpGoogleAccess() + { + return isset($this->private_ip_google_access); + } + + public function clearPrivateIpGoogleAccess() + { + unset($this->private_ip_google_access); + } + + /** + * Whether the VMs in this subnet can access Google services without assigned external IP addresses. This field can be both set at resource creation time and updated using setPrivateIpGoogleAccess. + * + * Generated from protobuf field optional bool private_ip_google_access = 421491790; + * @param bool $var + * @return $this + */ + public function setPrivateIpGoogleAccess($var) + { + GPBUtil::checkBool($var); + $this->private_ip_google_access = $var; + + return $this; + } + + /** + * This field is for internal use. This field can be both set at resource creation time and updated using patch. + * Check the PrivateIpv6GoogleAccess enum for the list of possible values. + * + * Generated from protobuf field optional string private_ipv6_google_access = 48277006; + * @return string + */ + public function getPrivateIpv6GoogleAccess() + { + return isset($this->private_ipv6_google_access) ? $this->private_ipv6_google_access : ''; + } + + public function hasPrivateIpv6GoogleAccess() + { + return isset($this->private_ipv6_google_access); + } + + public function clearPrivateIpv6GoogleAccess() + { + unset($this->private_ipv6_google_access); + } + + /** + * This field is for internal use. This field can be both set at resource creation time and updated using patch. + * Check the PrivateIpv6GoogleAccess enum for the list of possible values. + * + * Generated from protobuf field optional string private_ipv6_google_access = 48277006; + * @param string $var + * @return $this + */ + public function setPrivateIpv6GoogleAccess($var) + { + GPBUtil::checkString($var, True); + $this->private_ipv6_google_access = $var; + + return $this; + } + + /** + * The purpose of the resource. This field can be either PRIVATE, GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, or PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. Subnets with purpose set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks that are reserved for Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. + * Check the Purpose enum for the list of possible values. + * + * Generated from protobuf field optional string purpose = 316407070; + * @return string + */ + public function getPurpose() + { + return isset($this->purpose) ? $this->purpose : ''; + } + + public function hasPurpose() + { + return isset($this->purpose); + } + + public function clearPurpose() + { + unset($this->purpose); + } + + /** + * The purpose of the resource. This field can be either PRIVATE, GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, or PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. Subnets with purpose set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks that are reserved for Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. + * Check the Purpose enum for the list of possible values. + * + * Generated from protobuf field optional string purpose = 316407070; + * @param string $var + * @return $this + */ + public function setPurpose($var) + { + GPBUtil::checkString($var, True); + $this->purpose = $var; + + return $this; + } + + /** + * URL of the region where the Subnetwork resides. This field can be set only at resource creation time. + * + * 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); + } + + /** + * URL of the region where the Subnetwork resides. This field can be set only at resource creation time. + * + * 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; + } + + /** + * The URL of the reserved internal range. + * + * Generated from protobuf field optional string reserved_internal_range = 286248754; + * @return string + */ + public function getReservedInternalRange() + { + return isset($this->reserved_internal_range) ? $this->reserved_internal_range : ''; + } + + public function hasReservedInternalRange() + { + return isset($this->reserved_internal_range); + } + + public function clearReservedInternalRange() + { + unset($this->reserved_internal_range); + } + + /** + * The URL of the reserved internal range. + * + * Generated from protobuf field optional string reserved_internal_range = 286248754; + * @param string $var + * @return $this + */ + public function setReservedInternalRange($var) + { + GPBUtil::checkString($var, True); + $this->reserved_internal_range = $var; + + return $this; + } + + /** + * The role of subnetwork. Currently, this field is only used when purpose is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. This field can be updated with a patch request. + * Check the Role enum for the list of possible values. + * + * Generated from protobuf field optional string role = 3506294; + * @return string + */ + public function getRole() + { + return isset($this->role) ? $this->role : ''; + } + + public function hasRole() + { + return isset($this->role); + } + + public function clearRole() + { + unset($this->role); + } + + /** + * The role of subnetwork. Currently, this field is only used when purpose is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. This field can be updated with a patch request. + * Check the Role enum for the list of possible values. + * + * Generated from protobuf field optional string role = 3506294; + * @param string $var + * @return $this + */ + public function setRole($var) + { + GPBUtil::checkString($var, True); + $this->role = $var; + + return $this; + } + + /** + * An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. This field can be updated with a patch request. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SubnetworkSecondaryRange secondary_ip_ranges = 136658915; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSecondaryIpRanges() + { + return $this->secondary_ip_ranges; + } + + /** + * An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. This field can be updated with a patch request. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SubnetworkSecondaryRange secondary_ip_ranges = 136658915; + * @param array<\Google\Cloud\Compute\V1\SubnetworkSecondaryRange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSecondaryIpRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SubnetworkSecondaryRange::class); + $this->secondary_ip_ranges = $arr; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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; + } + + /** + * The stack type for the subnet. If set to IPV4_ONLY, new VMs in the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and IPv6 addresses. If not specified, IPV4_ONLY is used. This field can be both set at resource creation time and updated using patch. + * Check the StackType enum for the list of possible values. + * + * Generated from protobuf field optional string stack_type = 425908881; + * @return string + */ + public function getStackType() + { + return isset($this->stack_type) ? $this->stack_type : ''; + } + + public function hasStackType() + { + return isset($this->stack_type); + } + + public function clearStackType() + { + unset($this->stack_type); + } + + /** + * The stack type for the subnet. If set to IPV4_ONLY, new VMs in the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and IPv6 addresses. If not specified, IPV4_ONLY is used. This field can be both set at resource creation time and updated using patch. + * Check the StackType enum for the list of possible values. + * + * Generated from protobuf field optional string stack_type = 425908881; + * @param string $var + * @return $this + */ + public function setStackType($var) + { + GPBUtil::checkString($var, True); + $this->stack_type = $var; + + return $this; + } + + /** + * [Output Only] The state of the subnetwork, which can be one of the following values: READY: Subnetwork is created and ready to use DRAINING: only applicable to subnetworks that have the purpose set to INTERNAL_HTTPS_LOAD_BALANCER and indicates that connections to the load balancer are being drained. A subnetwork that is draining cannot be used or modified until it reaches a status of READY + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @return string + */ + public function getState() + { + return isset($this->state) ? $this->state : ''; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * [Output Only] The state of the subnetwork, which can be one of the following values: READY: Subnetwork is created and ready to use DRAINING: only applicable to subnetworks that have the purpose set to INTERNAL_HTTPS_LOAD_BALANCER and indicates that connections to the load balancer are being drained. A subnetwork that is draining cannot be used or modified until it reaches a status of READY + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/Ipv6AccessType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/Ipv6AccessType.php new file mode 100644 index 000000000000..2eaef611d10f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/Ipv6AccessType.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.Subnetwork.Ipv6AccessType + */ +class Ipv6AccessType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_IPV6_ACCESS_TYPE = 0; + */ + const UNDEFINED_IPV6_ACCESS_TYPE = 0; + /** + * VMs on this subnet will be assigned IPv6 addresses that are accessible via the Internet, as well as the VPC network. + * + * Generated from protobuf enum EXTERNAL = 35607499; + */ + const EXTERNAL = 35607499; + /** + * VMs on this subnet will be assigned IPv6 addresses that are only accessible over the VPC network. + * + * Generated from protobuf enum INTERNAL = 279295677; + */ + const INTERNAL = 279295677; + /** + * Generated from protobuf enum UNSPECIFIED_IPV6_ACCESS_TYPE = 313080613; + */ + const UNSPECIFIED_IPV6_ACCESS_TYPE = 313080613; + + private static $valueToName = [ + self::UNDEFINED_IPV6_ACCESS_TYPE => 'UNDEFINED_IPV6_ACCESS_TYPE', + self::EXTERNAL => 'EXTERNAL', + self::INTERNAL => 'INTERNAL', + self::UNSPECIFIED_IPV6_ACCESS_TYPE => 'UNSPECIFIED_IPV6_ACCESS_TYPE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Ipv6AccessType::class, \Google\Cloud\Compute\V1\Subnetwork_Ipv6AccessType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/PrivateIpv6GoogleAccess.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/PrivateIpv6GoogleAccess.php new file mode 100644 index 000000000000..6db222757ac8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/PrivateIpv6GoogleAccess.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.Subnetwork.PrivateIpv6GoogleAccess + */ +class PrivateIpv6GoogleAccess +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS = 0; + */ + const UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS = 0; + /** + * Disable private IPv6 access to/from Google services. + * + * Generated from protobuf enum DISABLE_GOOGLE_ACCESS = 450958579; + */ + const DISABLE_GOOGLE_ACCESS = 450958579; + /** + * Bidirectional private IPv6 access to/from Google services. + * + * Generated from protobuf enum ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 427975994; + */ + const ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 427975994; + /** + * Outbound private IPv6 access from VMs in this subnet to Google services. + * + * Generated from protobuf enum ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 288210263; + */ + const ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 288210263; + + private static $valueToName = [ + self::UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS => 'UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS', + self::DISABLE_GOOGLE_ACCESS => 'DISABLE_GOOGLE_ACCESS', + self::ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE => 'ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE', + self::ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE => 'ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PrivateIpv6GoogleAccess::class, \Google\Cloud\Compute\V1\Subnetwork_PrivateIpv6GoogleAccess::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/Purpose.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/Purpose.php new file mode 100644 index 000000000000..206c139371ee --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/Purpose.php @@ -0,0 +1,103 @@ +google.cloud.compute.v1.Subnetwork.Purpose + */ +class Purpose +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PURPOSE = 0; + */ + const UNDEFINED_PURPOSE = 0; + /** + * Subnet reserved for Global Envoy-based Load Balancing. + * + * Generated from protobuf enum GLOBAL_MANAGED_PROXY = 236463602; + */ + const GLOBAL_MANAGED_PROXY = 236463602; + /** + * Subnet reserved for Internal HTTP(S) Load Balancing. This is a legacy purpose, please use REGIONAL_MANAGED_PROXY instead. + * + * Generated from protobuf enum INTERNAL_HTTPS_LOAD_BALANCER = 248748889; + */ + const INTERNAL_HTTPS_LOAD_BALANCER = 248748889; + /** + * Regular user created or automatically created subnet. + * + * Generated from protobuf enum PRIVATE = 403485027; + */ + const PBPRIVATE = 403485027; + /** + * Subnetwork used as source range for Private NAT Gateways. + * + * Generated from protobuf enum PRIVATE_NAT = 367764517; + */ + const PRIVATE_NAT = 367764517; + /** + * Regular user created or automatically created subnet. + * + * Generated from protobuf enum PRIVATE_RFC_1918 = 254902107; + */ + const PRIVATE_RFC_1918 = 254902107; + /** + * Subnetworks created for Private Service Connect in the producer network. + * + * Generated from protobuf enum PRIVATE_SERVICE_CONNECT = 48134724; + */ + const PRIVATE_SERVICE_CONNECT = 48134724; + /** + * Subnetwork used for Regional Envoy-based Load Balancing. + * + * Generated from protobuf enum REGIONAL_MANAGED_PROXY = 153049966; + */ + const REGIONAL_MANAGED_PROXY = 153049966; + + private static $valueToName = [ + self::UNDEFINED_PURPOSE => 'UNDEFINED_PURPOSE', + self::GLOBAL_MANAGED_PROXY => 'GLOBAL_MANAGED_PROXY', + self::INTERNAL_HTTPS_LOAD_BALANCER => 'INTERNAL_HTTPS_LOAD_BALANCER', + self::PBPRIVATE => 'PRIVATE', + self::PRIVATE_NAT => 'PRIVATE_NAT', + self::PRIVATE_RFC_1918 => 'PRIVATE_RFC_1918', + self::PRIVATE_SERVICE_CONNECT => 'PRIVATE_SERVICE_CONNECT', + self::REGIONAL_MANAGED_PROXY => 'REGIONAL_MANAGED_PROXY', + ]; + + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Purpose::class, \Google\Cloud\Compute\V1\Subnetwork_Purpose::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/Role.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/Role.php new file mode 100644 index 000000000000..49a8576203bc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/Role.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.Subnetwork.Role + */ +class Role +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ROLE = 0; + */ + const UNDEFINED_ROLE = 0; + /** + * The ACTIVE subnet that is currently used. + * + * Generated from protobuf enum ACTIVE = 314733318; + */ + const ACTIVE = 314733318; + /** + * The BACKUP subnet that could be promoted to ACTIVE. + * + * Generated from protobuf enum BACKUP = 341010882; + */ + const BACKUP = 341010882; + + private static $valueToName = [ + self::UNDEFINED_ROLE => 'UNDEFINED_ROLE', + self::ACTIVE => 'ACTIVE', + self::BACKUP => 'BACKUP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Role::class, \Google\Cloud\Compute\V1\Subnetwork_Role::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/StackType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/StackType.php new file mode 100644 index 000000000000..70427a208f03 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/StackType.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.Subnetwork.StackType + */ +class StackType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STACK_TYPE = 0; + */ + const UNDEFINED_STACK_TYPE = 0; + /** + * New VMs in this subnet can have both IPv4 and IPv6 addresses. + * + * Generated from protobuf enum IPV4_IPV6 = 22197249; + */ + const IPV4_IPV6 = 22197249; + /** + * New VMs in this subnet will only be assigned IPv4 addresses. + * + * Generated from protobuf enum IPV4_ONLY = 22373798; + */ + const IPV4_ONLY = 22373798; + /** + * Generated from protobuf enum UNSPECIFIED_STACK_TYPE = 298084569; + */ + const UNSPECIFIED_STACK_TYPE = 298084569; + + private static $valueToName = [ + self::UNDEFINED_STACK_TYPE => 'UNDEFINED_STACK_TYPE', + self::IPV4_IPV6 => 'IPV4_IPV6', + self::IPV4_ONLY => 'IPV4_ONLY', + self::UNSPECIFIED_STACK_TYPE => 'UNSPECIFIED_STACK_TYPE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StackType::class, \Google\Cloud\Compute\V1\Subnetwork_StackType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/State.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/State.php new file mode 100644 index 000000000000..450d8210da19 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/State.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.Subnetwork.State + */ +class State +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATE = 0; + */ + const UNDEFINED_STATE = 0; + /** + * Subnetwork is being drained. + * + * Generated from protobuf enum DRAINING = 480455402; + */ + const DRAINING = 480455402; + /** + * Subnetwork is ready for use. + * + * Generated from protobuf enum READY = 77848963; + */ + const READY = 77848963; + + private static $valueToName = [ + self::UNDEFINED_STATE => 'UNDEFINED_STATE', + self::DRAINING => 'DRAINING', + self::READY => 'READY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Compute\V1\Subnetwork_State::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkAggregatedList.php new file mode 100644 index 000000000000..34013b6cd07f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.SubnetworkAggregatedList + */ +class SubnetworkAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of SubnetworksScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#subnetworkAggregatedList for aggregated lists of subnetworks. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 SubnetworksScopedList resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#subnetworkAggregatedList for aggregated lists of subnetworks. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 SubnetworksScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of SubnetworksScopedList 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\SubnetworksScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#subnetworkAggregatedList for aggregated lists of subnetworks. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#subnetworkAggregatedList for aggregated lists of subnetworks. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkList.php new file mode 100644 index 000000000000..725eb88e66ff --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.SubnetworkList + */ +class SubnetworkList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of Subnetwork resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Subnetwork items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#subnetworkList for lists of subnetworks. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\Subnetwork>|\Google\Protobuf\Internal\RepeatedField $items + * A list of Subnetwork resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#subnetworkList for lists of subnetworks. + * @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 Subnetwork resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Subnetwork items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of Subnetwork resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Subnetwork items = 100526016; + * @param array<\Google\Cloud\Compute\V1\Subnetwork>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Subnetwork::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#subnetworkList for lists of subnetworks. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#subnetworkList for lists of subnetworks. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkLogConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkLogConfig.php new file mode 100644 index 000000000000..bcf1efaabc3b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkLogConfig.php @@ -0,0 +1,295 @@ +google.cloud.compute.v1.SubnetworkLogConfig + */ +class SubnetworkLogConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection. + * Check the AggregationInterval enum for the list of possible values. + * + * Generated from protobuf field optional string aggregation_interval = 174919042; + */ + protected $aggregation_interval = null; + /** + * Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is determined by the org policy, if there is no org policy specified, then it will default to disabled. Flow logging isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY. + * + * Generated from protobuf field optional bool enable = 311764355; + */ + protected $enable = null; + /** + * Can only be specified if VPC flow logs for this subnetwork is enabled. The filter expression is used to define which VPC flow logs should be exported to Cloud Logging. + * + * Generated from protobuf field optional string filter_expr = 183374428; + */ + protected $filter_expr = null; + /** + * Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5 unless otherwise specified by the org policy, which means half of all collected logs are reported. + * + * Generated from protobuf field optional float flow_sampling = 530150360; + */ + protected $flow_sampling = null; + /** + * Can only be specified if VPC flow logs for this subnetwork is enabled. Configures whether all, none or a subset of metadata fields should be added to the reported VPC flow logs. Default is EXCLUDE_ALL_METADATA. + * Check the Metadata enum for the list of possible values. + * + * Generated from protobuf field optional string metadata = 86866735; + */ + protected $metadata = null; + /** + * Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" was set to CUSTOM_METADATA. + * + * Generated from protobuf field repeated string metadata_fields = 378461641; + */ + private $metadata_fields; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $aggregation_interval + * Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection. + * Check the AggregationInterval enum for the list of possible values. + * @type bool $enable + * Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is determined by the org policy, if there is no org policy specified, then it will default to disabled. Flow logging isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY. + * @type string $filter_expr + * Can only be specified if VPC flow logs for this subnetwork is enabled. The filter expression is used to define which VPC flow logs should be exported to Cloud Logging. + * @type float $flow_sampling + * Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5 unless otherwise specified by the org policy, which means half of all collected logs are reported. + * @type string $metadata + * Can only be specified if VPC flow logs for this subnetwork is enabled. Configures whether all, none or a subset of metadata fields should be added to the reported VPC flow logs. Default is EXCLUDE_ALL_METADATA. + * Check the Metadata enum for the list of possible values. + * @type array|\Google\Protobuf\Internal\RepeatedField $metadata_fields + * Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" was set to CUSTOM_METADATA. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection. + * Check the AggregationInterval enum for the list of possible values. + * + * Generated from protobuf field optional string aggregation_interval = 174919042; + * @return string + */ + public function getAggregationInterval() + { + return isset($this->aggregation_interval) ? $this->aggregation_interval : ''; + } + + public function hasAggregationInterval() + { + return isset($this->aggregation_interval); + } + + public function clearAggregationInterval() + { + unset($this->aggregation_interval); + } + + /** + * Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection. + * Check the AggregationInterval enum for the list of possible values. + * + * Generated from protobuf field optional string aggregation_interval = 174919042; + * @param string $var + * @return $this + */ + public function setAggregationInterval($var) + { + GPBUtil::checkString($var, True); + $this->aggregation_interval = $var; + + return $this; + } + + /** + * Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is determined by the org policy, if there is no org policy specified, then it will default to disabled. Flow logging isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY. + * + * Generated from protobuf field optional bool enable = 311764355; + * @return bool + */ + public function getEnable() + { + return isset($this->enable) ? $this->enable : false; + } + + public function hasEnable() + { + return isset($this->enable); + } + + public function clearEnable() + { + unset($this->enable); + } + + /** + * Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is determined by the org policy, if there is no org policy specified, then it will default to disabled. Flow logging isn't supported if the subnet purpose field is set to REGIONAL_MANAGED_PROXY. + * + * Generated from protobuf field optional bool enable = 311764355; + * @param bool $var + * @return $this + */ + public function setEnable($var) + { + GPBUtil::checkBool($var); + $this->enable = $var; + + return $this; + } + + /** + * Can only be specified if VPC flow logs for this subnetwork is enabled. The filter expression is used to define which VPC flow logs should be exported to Cloud Logging. + * + * Generated from protobuf field optional string filter_expr = 183374428; + * @return string + */ + public function getFilterExpr() + { + return isset($this->filter_expr) ? $this->filter_expr : ''; + } + + public function hasFilterExpr() + { + return isset($this->filter_expr); + } + + public function clearFilterExpr() + { + unset($this->filter_expr); + } + + /** + * Can only be specified if VPC flow logs for this subnetwork is enabled. The filter expression is used to define which VPC flow logs should be exported to Cloud Logging. + * + * Generated from protobuf field optional string filter_expr = 183374428; + * @param string $var + * @return $this + */ + public function setFilterExpr($var) + { + GPBUtil::checkString($var, True); + $this->filter_expr = $var; + + return $this; + } + + /** + * Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5 unless otherwise specified by the org policy, which means half of all collected logs are reported. + * + * Generated from protobuf field optional float flow_sampling = 530150360; + * @return float + */ + public function getFlowSampling() + { + return isset($this->flow_sampling) ? $this->flow_sampling : 0.0; + } + + public function hasFlowSampling() + { + return isset($this->flow_sampling); + } + + public function clearFlowSampling() + { + unset($this->flow_sampling); + } + + /** + * Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5 unless otherwise specified by the org policy, which means half of all collected logs are reported. + * + * Generated from protobuf field optional float flow_sampling = 530150360; + * @param float $var + * @return $this + */ + public function setFlowSampling($var) + { + GPBUtil::checkFloat($var); + $this->flow_sampling = $var; + + return $this; + } + + /** + * Can only be specified if VPC flow logs for this subnetwork is enabled. Configures whether all, none or a subset of metadata fields should be added to the reported VPC flow logs. Default is EXCLUDE_ALL_METADATA. + * Check the Metadata enum for the list of possible values. + * + * Generated from protobuf field optional string metadata = 86866735; + * @return string + */ + public function getMetadata() + { + return isset($this->metadata) ? $this->metadata : ''; + } + + public function hasMetadata() + { + return isset($this->metadata); + } + + public function clearMetadata() + { + unset($this->metadata); + } + + /** + * Can only be specified if VPC flow logs for this subnetwork is enabled. Configures whether all, none or a subset of metadata fields should be added to the reported VPC flow logs. Default is EXCLUDE_ALL_METADATA. + * Check the Metadata enum for the list of possible values. + * + * Generated from protobuf field optional string metadata = 86866735; + * @param string $var + * @return $this + */ + public function setMetadata($var) + { + GPBUtil::checkString($var, True); + $this->metadata = $var; + + return $this; + } + + /** + * Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" was set to CUSTOM_METADATA. + * + * Generated from protobuf field repeated string metadata_fields = 378461641; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMetadataFields() + { + return $this->metadata_fields; + } + + /** + * Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" was set to CUSTOM_METADATA. + * + * Generated from protobuf field repeated string metadata_fields = 378461641; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMetadataFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadata_fields = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkLogConfig/AggregationInterval.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkLogConfig/AggregationInterval.php new file mode 100644 index 000000000000..0e315de9205e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkLogConfig/AggregationInterval.php @@ -0,0 +1,80 @@ +google.cloud.compute.v1.SubnetworkLogConfig.AggregationInterval + */ +class AggregationInterval +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_AGGREGATION_INTERVAL = 0; + */ + const UNDEFINED_AGGREGATION_INTERVAL = 0; + /** + * Generated from protobuf enum INTERVAL_10_MIN = 487155916; + */ + const INTERVAL_10_MIN = 487155916; + /** + * Generated from protobuf enum INTERVAL_15_MIN = 491773521; + */ + const INTERVAL_15_MIN = 491773521; + /** + * Generated from protobuf enum INTERVAL_1_MIN = 69052714; + */ + const INTERVAL_1_MIN = 69052714; + /** + * Generated from protobuf enum INTERVAL_30_SEC = 7548937; + */ + const INTERVAL_30_SEC = 7548937; + /** + * Generated from protobuf enum INTERVAL_5_MIN = 72746798; + */ + const INTERVAL_5_MIN = 72746798; + /** + * Generated from protobuf enum INTERVAL_5_SEC = 72752429; + */ + const INTERVAL_5_SEC = 72752429; + + private static $valueToName = [ + self::UNDEFINED_AGGREGATION_INTERVAL => 'UNDEFINED_AGGREGATION_INTERVAL', + self::INTERVAL_10_MIN => 'INTERVAL_10_MIN', + self::INTERVAL_15_MIN => 'INTERVAL_15_MIN', + self::INTERVAL_1_MIN => 'INTERVAL_1_MIN', + self::INTERVAL_30_SEC => 'INTERVAL_30_SEC', + self::INTERVAL_5_MIN => 'INTERVAL_5_MIN', + self::INTERVAL_5_SEC => 'INTERVAL_5_SEC', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AggregationInterval::class, \Google\Cloud\Compute\V1\SubnetworkLogConfig_AggregationInterval::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkLogConfig/Metadata.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkLogConfig/Metadata.php new file mode 100644 index 000000000000..caca3711ddfa --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkLogConfig/Metadata.php @@ -0,0 +1,65 @@ +google.cloud.compute.v1.SubnetworkLogConfig.Metadata + */ +class Metadata +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_METADATA = 0; + */ + const UNDEFINED_METADATA = 0; + /** + * Generated from protobuf enum CUSTOM_METADATA = 62450749; + */ + const CUSTOM_METADATA = 62450749; + /** + * Generated from protobuf enum EXCLUDE_ALL_METADATA = 334519954; + */ + const EXCLUDE_ALL_METADATA = 334519954; + /** + * Generated from protobuf enum INCLUDE_ALL_METADATA = 164619908; + */ + const INCLUDE_ALL_METADATA = 164619908; + + private static $valueToName = [ + self::UNDEFINED_METADATA => 'UNDEFINED_METADATA', + self::CUSTOM_METADATA => 'CUSTOM_METADATA', + self::EXCLUDE_ALL_METADATA => 'EXCLUDE_ALL_METADATA', + self::INCLUDE_ALL_METADATA => 'INCLUDE_ALL_METADATA', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Metadata::class, \Google\Cloud\Compute\V1\SubnetworkLogConfig_Metadata::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkSecondaryRange.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkSecondaryRange.php new file mode 100644 index 000000000000..10393c73ffbb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworkSecondaryRange.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.SubnetworkSecondaryRange + */ +class SubnetworkSecondaryRange extends \Google\Protobuf\Internal\Message +{ + /** + * The range of IP addresses belonging to this subnetwork secondary range. Provide this property when you create the subnetwork. Ranges must be unique and non-overlapping with all primary and secondary IP ranges within a network. Only IPv4 is supported. The range can be any range listed in the Valid ranges list. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + */ + protected $ip_cidr_range = null; + /** + * The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork. + * + * Generated from protobuf field optional string range_name = 332216397; + */ + protected $range_name = null; + /** + * The URL of the reserved internal range. + * + * Generated from protobuf field optional string reserved_internal_range = 286248754; + */ + protected $reserved_internal_range = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ip_cidr_range + * The range of IP addresses belonging to this subnetwork secondary range. Provide this property when you create the subnetwork. Ranges must be unique and non-overlapping with all primary and secondary IP ranges within a network. Only IPv4 is supported. The range can be any range listed in the Valid ranges list. + * @type string $range_name + * The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork. + * @type string $reserved_internal_range + * The URL of the reserved internal range. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The range of IP addresses belonging to this subnetwork secondary range. Provide this property when you create the subnetwork. Ranges must be unique and non-overlapping with all primary and secondary IP ranges within a network. Only IPv4 is supported. The range can be any range listed in the Valid ranges list. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + * @return string + */ + public function getIpCidrRange() + { + return isset($this->ip_cidr_range) ? $this->ip_cidr_range : ''; + } + + public function hasIpCidrRange() + { + return isset($this->ip_cidr_range); + } + + public function clearIpCidrRange() + { + unset($this->ip_cidr_range); + } + + /** + * The range of IP addresses belonging to this subnetwork secondary range. Provide this property when you create the subnetwork. Ranges must be unique and non-overlapping with all primary and secondary IP ranges within a network. Only IPv4 is supported. The range can be any range listed in the Valid ranges list. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + * @param string $var + * @return $this + */ + public function setIpCidrRange($var) + { + GPBUtil::checkString($var, True); + $this->ip_cidr_range = $var; + + return $this; + } + + /** + * The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork. + * + * Generated from protobuf field optional string range_name = 332216397; + * @return string + */ + public function getRangeName() + { + return isset($this->range_name) ? $this->range_name : ''; + } + + public function hasRangeName() + { + return isset($this->range_name); + } + + public function clearRangeName() + { + unset($this->range_name); + } + + /** + * The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork. + * + * Generated from protobuf field optional string range_name = 332216397; + * @param string $var + * @return $this + */ + public function setRangeName($var) + { + GPBUtil::checkString($var, True); + $this->range_name = $var; + + return $this; + } + + /** + * The URL of the reserved internal range. + * + * Generated from protobuf field optional string reserved_internal_range = 286248754; + * @return string + */ + public function getReservedInternalRange() + { + return isset($this->reserved_internal_range) ? $this->reserved_internal_range : ''; + } + + public function hasReservedInternalRange() + { + return isset($this->reserved_internal_range); + } + + public function clearReservedInternalRange() + { + unset($this->reserved_internal_range); + } + + /** + * The URL of the reserved internal range. + * + * Generated from protobuf field optional string reserved_internal_range = 286248754; + * @param string $var + * @return $this + */ + public function setReservedInternalRange($var) + { + GPBUtil::checkString($var, True); + $this->reserved_internal_range = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworksExpandIpCidrRangeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworksExpandIpCidrRangeRequest.php new file mode 100644 index 000000000000..f796448a2570 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworksExpandIpCidrRangeRequest.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest + */ +class SubnetworksExpandIpCidrRangeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The IP (in CIDR format or netmask) of internal addresses that are legal on this Subnetwork. This range should be disjoint from other subnetworks within this network. This range can only be larger than (i.e. a superset of) the range previously defined before the update. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + */ + protected $ip_cidr_range = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ip_cidr_range + * The IP (in CIDR format or netmask) of internal addresses that are legal on this Subnetwork. This range should be disjoint from other subnetworks within this network. This range can only be larger than (i.e. a superset of) the range previously defined before the update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The IP (in CIDR format or netmask) of internal addresses that are legal on this Subnetwork. This range should be disjoint from other subnetworks within this network. This range can only be larger than (i.e. a superset of) the range previously defined before the update. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + * @return string + */ + public function getIpCidrRange() + { + return isset($this->ip_cidr_range) ? $this->ip_cidr_range : ''; + } + + public function hasIpCidrRange() + { + return isset($this->ip_cidr_range); + } + + public function clearIpCidrRange() + { + unset($this->ip_cidr_range); + } + + /** + * The IP (in CIDR format or netmask) of internal addresses that are legal on this Subnetwork. This range should be disjoint from other subnetworks within this network. This range can only be larger than (i.e. a superset of) the range previously defined before the update. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + * @param string $var + * @return $this + */ + public function setIpCidrRange($var) + { + GPBUtil::checkString($var, True); + $this->ip_cidr_range = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworksScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworksScopedList.php new file mode 100644 index 000000000000..49a27c4befea --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworksScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.SubnetworksScopedList + */ +class SubnetworksScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * A list of subnetworks contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Subnetwork subnetworks = 415853125; + */ + private $subnetworks; + /** + * An informational warning that appears when the list of addresses is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\Subnetwork>|\Google\Protobuf\Internal\RepeatedField $subnetworks + * A list of subnetworks contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * An informational warning that appears when the list of addresses is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of subnetworks contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Subnetwork subnetworks = 415853125; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSubnetworks() + { + return $this->subnetworks; + } + + /** + * A list of subnetworks contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Subnetwork subnetworks = 415853125; + * @param array<\Google\Cloud\Compute\V1\Subnetwork>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSubnetworks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Subnetwork::class); + $this->subnetworks = $arr; + + return $this; + } + + /** + * An informational warning that appears when the list of addresses 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); + } + + /** + * An informational warning that appears when the list of addresses 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworksSetPrivateIpGoogleAccessRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworksSetPrivateIpGoogleAccessRequest.php new file mode 100644 index 000000000000..dd68498dc29b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SubnetworksSetPrivateIpGoogleAccessRequest.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest + */ +class SubnetworksSetPrivateIpGoogleAccessRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional bool private_ip_google_access = 421491790; + */ + protected $private_ip_google_access = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $private_ip_google_access + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional bool private_ip_google_access = 421491790; + * @return bool + */ + public function getPrivateIpGoogleAccess() + { + return isset($this->private_ip_google_access) ? $this->private_ip_google_access : false; + } + + public function hasPrivateIpGoogleAccess() + { + return isset($this->private_ip_google_access); + } + + public function clearPrivateIpGoogleAccess() + { + unset($this->private_ip_google_access); + } + + /** + * Generated from protobuf field optional bool private_ip_google_access = 421491790; + * @param bool $var + * @return $this + */ + public function setPrivateIpGoogleAccess($var) + { + GPBUtil::checkBool($var); + $this->private_ip_google_access = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subsetting.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subsetting.php new file mode 100644 index 000000000000..17341e1e7281 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subsetting.php @@ -0,0 +1,81 @@ +google.cloud.compute.v1.Subsetting + */ +class Subsetting extends \Google\Protobuf\Internal\Message +{ + /** + * + * Check the Policy enum for the list of possible values. + * + * Generated from protobuf field optional string policy = 91071794; + */ + protected $policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $policy + * + * Check the Policy enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * + * Check the Policy enum for the list of possible values. + * + * Generated from protobuf field optional string policy = 91071794; + * @return string + */ + public function getPolicy() + { + return isset($this->policy) ? $this->policy : ''; + } + + public function hasPolicy() + { + return isset($this->policy); + } + + public function clearPolicy() + { + unset($this->policy); + } + + /** + * + * Check the Policy enum for the list of possible values. + * + * Generated from protobuf field optional string policy = 91071794; + * @param string $var + * @return $this + */ + public function setPolicy($var) + { + GPBUtil::checkString($var, True); + $this->policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subsetting/Policy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subsetting/Policy.php new file mode 100644 index 000000000000..3f1ab1c4ba68 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subsetting/Policy.php @@ -0,0 +1,63 @@ +google.cloud.compute.v1.Subsetting.Policy + */ +class Policy +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_POLICY = 0; + */ + const UNDEFINED_POLICY = 0; + /** + * Subsetting based on consistent hashing. For Traffic Director, the number of backends per backend group (the subset size) is based on the `subset_size` parameter. For Internal HTTP(S) load balancing, the number of backends per backend group (the subset size) is dynamically adjusted in two cases: - As the number of proxy instances participating in Internal HTTP(S) load balancing increases, the subset size decreases. - When the total number of backends in a network exceeds the capacity of a single proxy instance, subset sizes are reduced automatically for each service that has backend subsetting enabled. + * + * Generated from protobuf enum CONSISTENT_HASH_SUBSETTING = 108989492; + */ + const CONSISTENT_HASH_SUBSETTING = 108989492; + /** + * No Subsetting. Clients may open connections and send traffic to all backends of this backend service. This can lead to performance issues if there is substantial imbalance in the count of clients and backends. + * + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + + private static $valueToName = [ + self::UNDEFINED_POLICY => 'UNDEFINED_POLICY', + self::CONSISTENT_HASH_SUBSETTING => 'CONSISTENT_HASH_SUBSETTING', + self::NONE => 'NONE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Policy::class, \Google\Cloud\Compute\V1\Subsetting_Policy::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SuspendInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SuspendInstanceRequest.php new file mode 100644 index 000000000000..6d761a393d3a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SuspendInstanceRequest.php @@ -0,0 +1,240 @@ +google.cloud.compute.v1.SuspendInstanceRequest + */ +class SuspendInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * This property is required if the instance has any attached Local SSD disks. If false, Local SSD data will be preserved when the instance is suspended. If true, the contents of any attached Local SSD disks will be discarded. + * + * Generated from protobuf field optional bool discard_local_ssd = 319517903; + */ + protected $discard_local_ssd = null; + /** + * Name of the instance resource to suspend. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance resource to suspend. + * + * @return \Google\Cloud\Compute\V1\SuspendInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $discard_local_ssd + * This property is required if the instance has any attached Local SSD disks. If false, Local SSD data will be preserved when the instance is suspended. If true, the contents of any attached Local SSD disks will be discarded. + * @type string $instance + * Name of the instance resource to suspend. + * @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); + } + + /** + * This property is required if the instance has any attached Local SSD disks. If false, Local SSD data will be preserved when the instance is suspended. If true, the contents of any attached Local SSD disks will be discarded. + * + * Generated from protobuf field optional bool discard_local_ssd = 319517903; + * @return bool + */ + public function getDiscardLocalSsd() + { + return isset($this->discard_local_ssd) ? $this->discard_local_ssd : false; + } + + public function hasDiscardLocalSsd() + { + return isset($this->discard_local_ssd); + } + + public function clearDiscardLocalSsd() + { + unset($this->discard_local_ssd); + } + + /** + * This property is required if the instance has any attached Local SSD disks. If false, Local SSD data will be preserved when the instance is suspended. If true, the contents of any attached Local SSD disks will be discarded. + * + * Generated from protobuf field optional bool discard_local_ssd = 319517903; + * @param bool $var + * @return $this + */ + public function setDiscardLocalSsd($var) + { + GPBUtil::checkBool($var); + $this->discard_local_ssd = $var; + + return $this; + } + + /** + * Name of the instance resource to suspend. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance resource to suspend. + * + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SwitchToCustomModeNetworkRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SwitchToCustomModeNetworkRequest.php new file mode 100644 index 000000000000..4bcc09376f8c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SwitchToCustomModeNetworkRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.SwitchToCustomModeNetworkRequest + */ +class SwitchToCustomModeNetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the network to be updated. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $network Name of the network to be updated. + * + * @return \Google\Cloud\Compute\V1\SwitchToCustomModeNetworkRequest + * + * @experimental + */ + public static function build(string $project, string $network): self + { + return (new self()) + ->setProject($project) + ->setNetwork($network); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Name of the network to be updated. + * @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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the network to be updated. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Name of the network to be updated. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TCPHealthCheck.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TCPHealthCheck.php new file mode 100644 index 000000000000..3324f5329561 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TCPHealthCheck.php @@ -0,0 +1,304 @@ +google.cloud.compute.v1.TCPHealthCheck + */ +class TCPHealthCheck extends \Google\Protobuf\Internal\Message +{ + /** + * The TCP port number to which the health check prober sends packets. The default value is 80. Valid values are 1 through 65535. + * + * Generated from protobuf field optional int32 port = 3446913; + */ + protected $port = null; + /** + * Not supported. + * + * Generated from protobuf field optional string port_name = 41534345; + */ + protected $port_name = null; + /** + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * + * Generated from protobuf field optional string port_specification = 51590597; + */ + protected $port_specification = null; + /** + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + */ + protected $proxy_header = null; + /** + * Instructs the health check prober to send this exact ASCII string, up to 1024 bytes in length, after establishing the TCP connection. + * + * Generated from protobuf field optional string request = 21951119; + */ + protected $request = null; + /** + * Creates a content-based TCP health check. In addition to establishing a TCP connection, you can configure the health check to pass only when the backend sends this exact response ASCII string, up to 1024 bytes in length. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-ssl-tcp + * + * Generated from protobuf field optional string response = 196547649; + */ + protected $response = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $port + * The TCP port number to which the health check prober sends packets. The default value is 80. Valid values are 1 through 65535. + * @type string $port_name + * Not supported. + * @type string $port_specification + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * @type string $proxy_header + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * @type string $request + * Instructs the health check prober to send this exact ASCII string, up to 1024 bytes in length, after establishing the TCP connection. + * @type string $response + * Creates a content-based TCP health check. In addition to establishing a TCP connection, you can configure the health check to pass only when the backend sends this exact response ASCII string, up to 1024 bytes in length. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-ssl-tcp + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The TCP port number to which the health check prober sends packets. The default value is 80. Valid values are 1 through 65535. + * + * Generated from protobuf field optional int32 port = 3446913; + * @return int + */ + public function getPort() + { + return isset($this->port) ? $this->port : 0; + } + + public function hasPort() + { + return isset($this->port); + } + + public function clearPort() + { + unset($this->port); + } + + /** + * The TCP port number to which the health check prober sends packets. The default value is 80. Valid values are 1 through 65535. + * + * Generated from protobuf field optional int32 port = 3446913; + * @param int $var + * @return $this + */ + public function setPort($var) + { + GPBUtil::checkInt32($var); + $this->port = $var; + + return $this; + } + + /** + * Not supported. + * + * Generated from protobuf field optional string port_name = 41534345; + * @return string + */ + public function getPortName() + { + return isset($this->port_name) ? $this->port_name : ''; + } + + public function hasPortName() + { + return isset($this->port_name); + } + + public function clearPortName() + { + unset($this->port_name); + } + + /** + * Not supported. + * + * Generated from protobuf field optional string port_name = 41534345; + * @param string $var + * @return $this + */ + public function setPortName($var) + { + GPBUtil::checkString($var, True); + $this->port_name = $var; + + return $this; + } + + /** + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * + * Generated from protobuf field optional string port_specification = 51590597; + * @return string + */ + public function getPortSpecification() + { + return isset($this->port_specification) ? $this->port_specification : ''; + } + + public function hasPortSpecification() + { + return isset($this->port_specification); + } + + public function clearPortSpecification() + { + unset($this->port_specification); + } + + /** + * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports. + * Check the PortSpecification enum for the list of possible values. + * + * Generated from protobuf field optional string port_specification = 51590597; + * @param string $var + * @return $this + */ + public function setPortSpecification($var) + { + GPBUtil::checkString($var, True); + $this->port_specification = $var; + + return $this; + } + + /** + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + * @return string + */ + public function getProxyHeader() + { + return isset($this->proxy_header) ? $this->proxy_header : ''; + } + + public function hasProxyHeader() + { + return isset($this->proxy_header); + } + + public function clearProxyHeader() + { + unset($this->proxy_header); + } + + /** + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + * @param string $var + * @return $this + */ + public function setProxyHeader($var) + { + GPBUtil::checkString($var, True); + $this->proxy_header = $var; + + return $this; + } + + /** + * Instructs the health check prober to send this exact ASCII string, up to 1024 bytes in length, after establishing the TCP connection. + * + * Generated from protobuf field optional string request = 21951119; + * @return string + */ + public function getRequest() + { + return isset($this->request) ? $this->request : ''; + } + + public function hasRequest() + { + return isset($this->request); + } + + public function clearRequest() + { + unset($this->request); + } + + /** + * Instructs the health check prober to send this exact ASCII string, up to 1024 bytes in length, after establishing the TCP connection. + * + * Generated from protobuf field optional string request = 21951119; + * @param string $var + * @return $this + */ + public function setRequest($var) + { + GPBUtil::checkString($var, True); + $this->request = $var; + + return $this; + } + + /** + * Creates a content-based TCP health check. In addition to establishing a TCP connection, you can configure the health check to pass only when the backend sends this exact response ASCII string, up to 1024 bytes in length. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-ssl-tcp + * + * Generated from protobuf field optional string response = 196547649; + * @return string + */ + public function getResponse() + { + return isset($this->response) ? $this->response : ''; + } + + public function hasResponse() + { + return isset($this->response); + } + + public function clearResponse() + { + unset($this->response); + } + + /** + * Creates a content-based TCP health check. In addition to establishing a TCP connection, you can configure the health check to pass only when the backend sends this exact response ASCII string, up to 1024 bytes in length. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-ssl-tcp + * + * Generated from protobuf field optional string response = 196547649; + * @param string $var + * @return $this + */ + public function setResponse($var) + { + GPBUtil::checkString($var, True); + $this->response = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TCPHealthCheck/PortSpecification.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TCPHealthCheck/PortSpecification.php new file mode 100644 index 000000000000..0e3349fd6b3f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TCPHealthCheck/PortSpecification.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.TCPHealthCheck.PortSpecification + */ +class PortSpecification +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PORT_SPECIFICATION = 0; + */ + const UNDEFINED_PORT_SPECIFICATION = 0; + /** + * The port number in the health check's port is used for health checking. Applies to network endpoint group and instance group backends. + * + * Generated from protobuf enum USE_FIXED_PORT = 190235748; + */ + const USE_FIXED_PORT = 190235748; + /** + * Not supported. + * + * Generated from protobuf enum USE_NAMED_PORT = 349300671; + */ + const USE_NAMED_PORT = 349300671; + /** + * For network endpoint group backends, the health check uses the port number specified on each endpoint in the network endpoint group. For instance group backends, the health check uses the port number specified for the backend service's named port defined in the instance group's named ports. + * + * Generated from protobuf enum USE_SERVING_PORT = 362637516; + */ + const USE_SERVING_PORT = 362637516; + + private static $valueToName = [ + self::UNDEFINED_PORT_SPECIFICATION => 'UNDEFINED_PORT_SPECIFICATION', + self::USE_FIXED_PORT => 'USE_FIXED_PORT', + self::USE_NAMED_PORT => 'USE_NAMED_PORT', + self::USE_SERVING_PORT => 'USE_SERVING_PORT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PortSpecification::class, \Google\Cloud\Compute\V1\TCPHealthCheck_PortSpecification::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TCPHealthCheck/ProxyHeader.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TCPHealthCheck/ProxyHeader.php new file mode 100644 index 000000000000..29c4bc45f83b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TCPHealthCheck/ProxyHeader.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.TCPHealthCheck.ProxyHeader + */ +class ProxyHeader +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PROXY_HEADER = 0; + */ + const UNDEFINED_PROXY_HEADER = 0; + /** + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + /** + * Generated from protobuf enum PROXY_V1 = 334352940; + */ + const PROXY_V1 = 334352940; + + private static $valueToName = [ + self::UNDEFINED_PROXY_HEADER => 'UNDEFINED_PROXY_HEADER', + self::NONE => 'NONE', + self::PROXY_V1 => 'PROXY_V1', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ProxyHeader::class, \Google\Cloud\Compute\V1\TCPHealthCheck_ProxyHeader::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Tags.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Tags.php new file mode 100644 index 000000000000..533e90e3aae6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Tags.php @@ -0,0 +1,111 @@ +google.cloud.compute.v1.Tags + */ +class Tags extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies a fingerprint for this request, which is essentially a hash of the tags' contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update tags. You must always provide an up-to-date fingerprint hash in order to update or change tags. To see the latest fingerprint, make get() request to the instance. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field repeated string items = 100526016; + */ + private $items; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $fingerprint + * Specifies a fingerprint for this request, which is essentially a hash of the tags' contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update tags. You must always provide an up-to-date fingerprint hash in order to update or change tags. To see the latest fingerprint, make get() request to the instance. + * @type array|\Google\Protobuf\Internal\RepeatedField $items + * An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies a fingerprint for this request, which is essentially a hash of the tags' contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update tags. You must always provide an up-to-date fingerprint hash in order to update or change tags. To see the latest fingerprint, make get() request to the instance. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Specifies a fingerprint for this request, which is essentially a hash of the tags' contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update tags. You must always provide an up-to-date fingerprint hash in order to update or change tags. To see the latest fingerprint, make get() request to the instance. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field repeated string items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035. + * + * Generated from protobuf field repeated string items = 100526016; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->items = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetGrpcProxy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetGrpcProxy.php new file mode 100644 index 000000000000..eb19a525275e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetGrpcProxy.php @@ -0,0 +1,473 @@ +google.cloud.compute.v1.TargetGrpcProxy + */ +class TargetGrpcProxy extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a TargetGrpcProxy. An up-to-date fingerprint must be provided in order to patch/update the TargetGrpcProxy; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the TargetGrpcProxy. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * [Output Only] The unique identifier for the resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#targetGrpcProxy for target grpc proxies. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Server-defined URL with id for the resource. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + */ + protected $self_link_with_id = null; + /** + * URL to the UrlMap resource that defines the mapping from URL to the BackendService. The protocol field in the BackendService must be set to GRPC. + * + * Generated from protobuf field optional string url_map = 367020684; + */ + protected $url_map = null; + /** + * If true, indicates that the BackendServices referenced by the urlMap may be accessed by gRPC applications without using a sidecar proxy. This will enable configuration checks on urlMap and its referenced BackendServices to not allow unsupported features. A gRPC application must use "xds:///" scheme in the target URI of the service it is connecting to. If false, indicates that the BackendServices referenced by the urlMap will be accessed by gRPC applications via a sidecar proxy. In this case, a gRPC application must not use "xds:///" scheme in the target URI of the service it is connecting to + * + * Generated from protobuf field optional bool validate_for_proxyless = 101822888; + */ + protected $validate_for_proxyless = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type string $fingerprint + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a TargetGrpcProxy. An up-to-date fingerprint must be provided in order to patch/update the TargetGrpcProxy; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the TargetGrpcProxy. + * @type int|string $id + * [Output Only] The unique identifier for the resource type. The server generates this identifier. + * @type string $kind + * [Output Only] Type of the resource. Always compute#targetGrpcProxy for target grpc proxies. + * @type string $name + * 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 string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $self_link_with_id + * [Output Only] Server-defined URL with id for the resource. + * @type string $url_map + * URL to the UrlMap resource that defines the mapping from URL to the BackendService. The protocol field in the BackendService must be set to GRPC. + * @type bool $validate_for_proxyless + * If true, indicates that the BackendServices referenced by the urlMap may be accessed by gRPC applications without using a sidecar proxy. This will enable configuration checks on urlMap and its referenced BackendServices to not allow unsupported features. A gRPC application must use "xds:///" scheme in the target URI of the service it is connecting to. If false, indicates that the BackendServices referenced by the urlMap will be accessed by gRPC applications via a sidecar proxy. In this case, a gRPC application must not use "xds:///" scheme in the target URI of the service it is connecting to + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a TargetGrpcProxy. An up-to-date fingerprint must be provided in order to patch/update the TargetGrpcProxy; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the TargetGrpcProxy. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a TargetGrpcProxy. An up-to-date fingerprint must be provided in order to patch/update the TargetGrpcProxy; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the TargetGrpcProxy. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource type. The server generates this identifier. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#targetGrpcProxy for target grpc proxies. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#targetGrpcProxy for target grpc proxies. + * + * 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; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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] Server-defined URL with id for the resource. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + * @return string + */ + public function getSelfLinkWithId() + { + return isset($this->self_link_with_id) ? $this->self_link_with_id : ''; + } + + public function hasSelfLinkWithId() + { + return isset($this->self_link_with_id); + } + + public function clearSelfLinkWithId() + { + unset($this->self_link_with_id); + } + + /** + * [Output Only] Server-defined URL with id for the resource. + * + * Generated from protobuf field optional string self_link_with_id = 44520962; + * @param string $var + * @return $this + */ + public function setSelfLinkWithId($var) + { + GPBUtil::checkString($var, True); + $this->self_link_with_id = $var; + + return $this; + } + + /** + * URL to the UrlMap resource that defines the mapping from URL to the BackendService. The protocol field in the BackendService must be set to GRPC. + * + * Generated from protobuf field optional string url_map = 367020684; + * @return string + */ + public function getUrlMap() + { + return isset($this->url_map) ? $this->url_map : ''; + } + + public function hasUrlMap() + { + return isset($this->url_map); + } + + public function clearUrlMap() + { + unset($this->url_map); + } + + /** + * URL to the UrlMap resource that defines the mapping from URL to the BackendService. The protocol field in the BackendService must be set to GRPC. + * + * Generated from protobuf field optional string url_map = 367020684; + * @param string $var + * @return $this + */ + public function setUrlMap($var) + { + GPBUtil::checkString($var, True); + $this->url_map = $var; + + return $this; + } + + /** + * If true, indicates that the BackendServices referenced by the urlMap may be accessed by gRPC applications without using a sidecar proxy. This will enable configuration checks on urlMap and its referenced BackendServices to not allow unsupported features. A gRPC application must use "xds:///" scheme in the target URI of the service it is connecting to. If false, indicates that the BackendServices referenced by the urlMap will be accessed by gRPC applications via a sidecar proxy. In this case, a gRPC application must not use "xds:///" scheme in the target URI of the service it is connecting to + * + * Generated from protobuf field optional bool validate_for_proxyless = 101822888; + * @return bool + */ + public function getValidateForProxyless() + { + return isset($this->validate_for_proxyless) ? $this->validate_for_proxyless : false; + } + + public function hasValidateForProxyless() + { + return isset($this->validate_for_proxyless); + } + + public function clearValidateForProxyless() + { + unset($this->validate_for_proxyless); + } + + /** + * If true, indicates that the BackendServices referenced by the urlMap may be accessed by gRPC applications without using a sidecar proxy. This will enable configuration checks on urlMap and its referenced BackendServices to not allow unsupported features. A gRPC application must use "xds:///" scheme in the target URI of the service it is connecting to. If false, indicates that the BackendServices referenced by the urlMap will be accessed by gRPC applications via a sidecar proxy. In this case, a gRPC application must not use "xds:///" scheme in the target URI of the service it is connecting to + * + * Generated from protobuf field optional bool validate_for_proxyless = 101822888; + * @param bool $var + * @return $this + */ + public function setValidateForProxyless($var) + { + GPBUtil::checkBool($var); + $this->validate_for_proxyless = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetGrpcProxyList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetGrpcProxyList.php new file mode 100644 index 000000000000..72dec7accfbd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetGrpcProxyList.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.TargetGrpcProxyList + */ +class TargetGrpcProxyList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of TargetGrpcProxy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetGrpcProxy items = 100526016; + */ + private $items; + /** + * [Output Only] Type of the resource. Always compute#targetGrpcProxy for target grpc proxies. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\TargetGrpcProxy>|\Google\Protobuf\Internal\RepeatedField $items + * A list of TargetGrpcProxy resources. + * @type string $kind + * [Output Only] Type of the resource. Always compute#targetGrpcProxy for target grpc proxies. + * @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 TargetGrpcProxy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetGrpcProxy items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of TargetGrpcProxy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetGrpcProxy items = 100526016; + * @param array<\Google\Cloud\Compute\V1\TargetGrpcProxy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\TargetGrpcProxy::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#targetGrpcProxy for target grpc proxies. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#targetGrpcProxy for target grpc proxies. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpProxiesScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpProxiesScopedList.php new file mode 100644 index 000000000000..2900e42d430c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpProxiesScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.TargetHttpProxiesScopedList + */ +class TargetHttpProxiesScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * A list of TargetHttpProxies contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetHttpProxy target_http_proxies = 162147011; + */ + private $target_http_proxies; + /** + * Informational warning which replaces the list of backend services when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\TargetHttpProxy>|\Google\Protobuf\Internal\RepeatedField $target_http_proxies + * A list of TargetHttpProxies contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * Informational warning which replaces the list of backend services when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of TargetHttpProxies contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetHttpProxy target_http_proxies = 162147011; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetHttpProxies() + { + return $this->target_http_proxies; + } + + /** + * A list of TargetHttpProxies contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetHttpProxy target_http_proxies = 162147011; + * @param array<\Google\Cloud\Compute\V1\TargetHttpProxy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetHttpProxies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\TargetHttpProxy::class); + $this->target_http_proxies = $arr; + + return $this; + } + + /** + * Informational warning which replaces the list of backend services 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); + } + + /** + * Informational warning which replaces the list of backend services 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpProxy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpProxy.php new file mode 100644 index 000000000000..97ce514f07c6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpProxy.php @@ -0,0 +1,517 @@ +google.cloud.compute.v1.TargetHttpProxy + */ +class TargetHttpProxy extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a TargetHttpProxy. An up-to-date fingerprint must be provided in order to patch/update the TargetHttpProxy; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the TargetHttpProxy. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * Specifies how long to keep a connection open, after completing a response, while there is no matching traffic (in seconds). If an HTTP keep-alive is not specified, a default value (610 seconds) will be used. For global external Application Load Balancers, the minimum allowed value is 5 seconds and the maximum allowed value is 1200 seconds. For classic Application Load Balancers, this option is not supported. + * + * Generated from protobuf field optional int32 http_keep_alive_timeout_sec = 447326046; + */ + protected $http_keep_alive_timeout_sec = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of resource. Always compute#targetHttpProxy for target HTTP proxies. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. When this field is set to true, Envoy proxies set up inbound traffic interception and bind to the IP address and port specified in the forwarding rule. This is generally useful when using Traffic Director to configure Envoy as a gateway or middle proxy (in other words, not a sidecar proxy). The Envoy proxy listens for inbound requests and handles requests when it receives them. The default is false. + * + * Generated from protobuf field optional bool proxy_bind = 286025582; + */ + protected $proxy_bind = null; + /** + * [Output Only] URL of the region where the regional Target HTTP Proxy resides. This field is not applicable to global Target HTTP Proxies. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * URL to the UrlMap resource that defines the mapping from URL to the BackendService. + * + * Generated from protobuf field optional string url_map = 367020684; + */ + protected $url_map = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type string $fingerprint + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a TargetHttpProxy. An up-to-date fingerprint must be provided in order to patch/update the TargetHttpProxy; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the TargetHttpProxy. + * @type int $http_keep_alive_timeout_sec + * Specifies how long to keep a connection open, after completing a response, while there is no matching traffic (in seconds). If an HTTP keep-alive is not specified, a default value (610 seconds) will be used. For global external Application Load Balancers, the minimum allowed value is 5 seconds and the maximum allowed value is 1200 seconds. For classic Application Load Balancers, this option is not supported. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of resource. Always compute#targetHttpProxy for target HTTP proxies. + * @type string $name + * 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 bool $proxy_bind + * This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. When this field is set to true, Envoy proxies set up inbound traffic interception and bind to the IP address and port specified in the forwarding rule. This is generally useful when using Traffic Director to configure Envoy as a gateway or middle proxy (in other words, not a sidecar proxy). The Envoy proxy listens for inbound requests and handles requests when it receives them. The default is false. + * @type string $region + * [Output Only] URL of the region where the regional Target HTTP Proxy resides. This field is not applicable to global Target HTTP Proxies. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $url_map + * URL to the UrlMap resource that defines the mapping from URL to the BackendService. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a TargetHttpProxy. An up-to-date fingerprint must be provided in order to patch/update the TargetHttpProxy; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the TargetHttpProxy. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a TargetHttpProxy. An up-to-date fingerprint must be provided in order to patch/update the TargetHttpProxy; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the TargetHttpProxy. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * Specifies how long to keep a connection open, after completing a response, while there is no matching traffic (in seconds). If an HTTP keep-alive is not specified, a default value (610 seconds) will be used. For global external Application Load Balancers, the minimum allowed value is 5 seconds and the maximum allowed value is 1200 seconds. For classic Application Load Balancers, this option is not supported. + * + * Generated from protobuf field optional int32 http_keep_alive_timeout_sec = 447326046; + * @return int + */ + public function getHttpKeepAliveTimeoutSec() + { + return isset($this->http_keep_alive_timeout_sec) ? $this->http_keep_alive_timeout_sec : 0; + } + + public function hasHttpKeepAliveTimeoutSec() + { + return isset($this->http_keep_alive_timeout_sec); + } + + public function clearHttpKeepAliveTimeoutSec() + { + unset($this->http_keep_alive_timeout_sec); + } + + /** + * Specifies how long to keep a connection open, after completing a response, while there is no matching traffic (in seconds). If an HTTP keep-alive is not specified, a default value (610 seconds) will be used. For global external Application Load Balancers, the minimum allowed value is 5 seconds and the maximum allowed value is 1200 seconds. For classic Application Load Balancers, this option is not supported. + * + * Generated from protobuf field optional int32 http_keep_alive_timeout_sec = 447326046; + * @param int $var + * @return $this + */ + public function setHttpKeepAliveTimeoutSec($var) + { + GPBUtil::checkInt32($var); + $this->http_keep_alive_timeout_sec = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#targetHttpProxy for target HTTP proxies. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#targetHttpProxy for target HTTP proxies. + * + * 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; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. When this field is set to true, Envoy proxies set up inbound traffic interception and bind to the IP address and port specified in the forwarding rule. This is generally useful when using Traffic Director to configure Envoy as a gateway or middle proxy (in other words, not a sidecar proxy). The Envoy proxy listens for inbound requests and handles requests when it receives them. The default is false. + * + * Generated from protobuf field optional bool proxy_bind = 286025582; + * @return bool + */ + public function getProxyBind() + { + return isset($this->proxy_bind) ? $this->proxy_bind : false; + } + + public function hasProxyBind() + { + return isset($this->proxy_bind); + } + + public function clearProxyBind() + { + unset($this->proxy_bind); + } + + /** + * This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. When this field is set to true, Envoy proxies set up inbound traffic interception and bind to the IP address and port specified in the forwarding rule. This is generally useful when using Traffic Director to configure Envoy as a gateway or middle proxy (in other words, not a sidecar proxy). The Envoy proxy listens for inbound requests and handles requests when it receives them. The default is false. + * + * Generated from protobuf field optional bool proxy_bind = 286025582; + * @param bool $var + * @return $this + */ + public function setProxyBind($var) + { + GPBUtil::checkBool($var); + $this->proxy_bind = $var; + + return $this; + } + + /** + * [Output Only] URL of the region where the regional Target HTTP Proxy resides. This field is not applicable to global Target HTTP Proxies. + * + * 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 regional Target HTTP Proxy resides. This field is not applicable to global Target HTTP Proxies. + * + * 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] Server-defined URL for the 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 the 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; + } + + /** + * URL to the UrlMap resource that defines the mapping from URL to the BackendService. + * + * Generated from protobuf field optional string url_map = 367020684; + * @return string + */ + public function getUrlMap() + { + return isset($this->url_map) ? $this->url_map : ''; + } + + public function hasUrlMap() + { + return isset($this->url_map); + } + + public function clearUrlMap() + { + unset($this->url_map); + } + + /** + * URL to the UrlMap resource that defines the mapping from URL to the BackendService. + * + * Generated from protobuf field optional string url_map = 367020684; + * @param string $var + * @return $this + */ + public function setUrlMap($var) + { + GPBUtil::checkString($var, True); + $this->url_map = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpProxyAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpProxyAggregatedList.php new file mode 100644 index 000000000000..01a3c4ec4b62 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpProxyAggregatedList.php @@ -0,0 +1,276 @@ +google.cloud.compute.v1.TargetHttpProxyAggregatedList + */ +class TargetHttpProxyAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of TargetHttpProxiesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#targetHttpProxyAggregatedList for lists of Target HTTP Proxies. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + + /** + * 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 TargetHttpProxiesScopedList resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#targetHttpProxyAggregatedList for lists of Target HTTP Proxies. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * } + */ + 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 TargetHttpProxiesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of TargetHttpProxiesScopedList 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\TargetHttpProxiesScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#targetHttpProxyAggregatedList for lists of Target HTTP Proxies. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#targetHttpProxyAggregatedList for lists of Target HTTP Proxies. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpProxyList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpProxyList.php new file mode 100644 index 000000000000..03127da0125d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpProxyList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.TargetHttpProxyList + */ +class TargetHttpProxyList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of TargetHttpProxy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetHttpProxy items = 100526016; + */ + private $items; + /** + * Type of resource. Always compute#targetHttpProxyList for lists of target HTTP proxies. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\TargetHttpProxy>|\Google\Protobuf\Internal\RepeatedField $items + * A list of TargetHttpProxy resources. + * @type string $kind + * Type of resource. Always compute#targetHttpProxyList for lists of target HTTP proxies. + * @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 TargetHttpProxy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetHttpProxy items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of TargetHttpProxy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetHttpProxy items = 100526016; + * @param array<\Google\Cloud\Compute\V1\TargetHttpProxy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\TargetHttpProxy::class); + $this->items = $arr; + + return $this; + } + + /** + * Type of resource. Always compute#targetHttpProxyList for lists of target HTTP proxies. + * + * 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. Always compute#targetHttpProxyList for lists of target HTTP proxies. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxiesScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxiesScopedList.php new file mode 100644 index 000000000000..f337a49a7b9f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxiesScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.TargetHttpsProxiesScopedList + */ +class TargetHttpsProxiesScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * A list of TargetHttpsProxies contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetHttpsProxy target_https_proxies = 366607882; + */ + private $target_https_proxies; + /** + * Informational warning which replaces the list of backend services when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\TargetHttpsProxy>|\Google\Protobuf\Internal\RepeatedField $target_https_proxies + * A list of TargetHttpsProxies contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * Informational warning which replaces the list of backend services when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of TargetHttpsProxies contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetHttpsProxy target_https_proxies = 366607882; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetHttpsProxies() + { + return $this->target_https_proxies; + } + + /** + * A list of TargetHttpsProxies contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetHttpsProxy target_https_proxies = 366607882; + * @param array<\Google\Cloud\Compute\V1\TargetHttpsProxy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetHttpsProxies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\TargetHttpsProxy::class); + $this->target_https_proxies = $arr; + + return $this; + } + + /** + * Informational warning which replaces the list of backend services 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); + } + + /** + * Informational warning which replaces the list of backend services 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxiesSetCertificateMapRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxiesSetCertificateMapRequest.php new file mode 100644 index 000000000000..0eef192e5ad2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxiesSetCertificateMapRequest.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.TargetHttpsProxiesSetCertificateMapRequest + */ +class TargetHttpsProxiesSetCertificateMapRequest extends \Google\Protobuf\Internal\Message +{ + /** + * URL of the Certificate Map to associate with this TargetHttpsProxy. Accepted format is //certificatemanager.googleapis.com/projects/{project }/locations/{location}/certificateMaps/{resourceName}. + * + * Generated from protobuf field optional string certificate_map = 156463796; + */ + protected $certificate_map = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $certificate_map + * URL of the Certificate Map to associate with this TargetHttpsProxy. Accepted format is //certificatemanager.googleapis.com/projects/{project }/locations/{location}/certificateMaps/{resourceName}. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * URL of the Certificate Map to associate with this TargetHttpsProxy. Accepted format is //certificatemanager.googleapis.com/projects/{project }/locations/{location}/certificateMaps/{resourceName}. + * + * Generated from protobuf field optional string certificate_map = 156463796; + * @return string + */ + public function getCertificateMap() + { + return isset($this->certificate_map) ? $this->certificate_map : ''; + } + + public function hasCertificateMap() + { + return isset($this->certificate_map); + } + + public function clearCertificateMap() + { + unset($this->certificate_map); + } + + /** + * URL of the Certificate Map to associate with this TargetHttpsProxy. Accepted format is //certificatemanager.googleapis.com/projects/{project }/locations/{location}/certificateMaps/{resourceName}. + * + * Generated from protobuf field optional string certificate_map = 156463796; + * @param string $var + * @return $this + */ + public function setCertificateMap($var) + { + GPBUtil::checkString($var, True); + $this->certificate_map = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxiesSetQuicOverrideRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxiesSetQuicOverrideRequest.php new file mode 100644 index 000000000000..f6f13e171b69 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxiesSetQuicOverrideRequest.php @@ -0,0 +1,80 @@ +google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest + */ +class TargetHttpsProxiesSetQuicOverrideRequest extends \Google\Protobuf\Internal\Message +{ + /** + * QUIC policy for the TargetHttpsProxy resource. + * Check the QuicOverride enum for the list of possible values. + * + * Generated from protobuf field optional string quic_override = 456577197; + */ + protected $quic_override = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $quic_override + * QUIC policy for the TargetHttpsProxy resource. + * Check the QuicOverride enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * QUIC policy for the TargetHttpsProxy resource. + * Check the QuicOverride enum for the list of possible values. + * + * Generated from protobuf field optional string quic_override = 456577197; + * @return string + */ + public function getQuicOverride() + { + return isset($this->quic_override) ? $this->quic_override : ''; + } + + public function hasQuicOverride() + { + return isset($this->quic_override); + } + + public function clearQuicOverride() + { + unset($this->quic_override); + } + + /** + * QUIC policy for the TargetHttpsProxy resource. + * Check the QuicOverride enum for the list of possible values. + * + * Generated from protobuf field optional string quic_override = 456577197; + * @param string $var + * @return $this + */ + public function setQuicOverride($var) + { + GPBUtil::checkString($var, True); + $this->quic_override = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxiesSetQuicOverrideRequest/QuicOverride.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxiesSetQuicOverrideRequest/QuicOverride.php new file mode 100644 index 000000000000..735847ce7169 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxiesSetQuicOverrideRequest/QuicOverride.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest.QuicOverride + */ +class QuicOverride +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_QUIC_OVERRIDE = 0; + */ + const UNDEFINED_QUIC_OVERRIDE = 0; + /** + * The load balancer will not attempt to negotiate QUIC with clients. + * + * Generated from protobuf enum DISABLE = 241807048; + */ + const DISABLE = 241807048; + /** + * The load balancer will attempt to negotiate QUIC with clients. + * + * Generated from protobuf enum ENABLE = 438835587; + */ + const ENABLE = 438835587; + /** + * No overrides to the default QUIC policy. This option is implicit if no QUIC override has been specified in the request. + * + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + + private static $valueToName = [ + self::UNDEFINED_QUIC_OVERRIDE => 'UNDEFINED_QUIC_OVERRIDE', + self::DISABLE => 'DISABLE', + self::ENABLE => 'ENABLE', + self::NONE => 'NONE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(QuicOverride::class, \Google\Cloud\Compute\V1\TargetHttpsProxiesSetQuicOverrideRequest_QuicOverride::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxiesSetSslCertificatesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxiesSetSslCertificatesRequest.php new file mode 100644 index 000000000000..dde534610011 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxiesSetSslCertificatesRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest + */ +class TargetHttpsProxiesSetSslCertificatesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * New set of SslCertificate resources to associate with this TargetHttpsProxy resource. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. + * + * Generated from protobuf field repeated string ssl_certificates = 366006543; + */ + private $ssl_certificates; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $ssl_certificates + * New set of SslCertificate resources to associate with this TargetHttpsProxy resource. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * New set of SslCertificate resources to associate with this TargetHttpsProxy resource. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. + * + * Generated from protobuf field repeated string ssl_certificates = 366006543; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSslCertificates() + { + return $this->ssl_certificates; + } + + /** + * New set of SslCertificate resources to associate with this TargetHttpsProxy resource. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. + * + * Generated from protobuf field repeated string ssl_certificates = 366006543; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSslCertificates($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ssl_certificates = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxy.php new file mode 100644 index 000000000000..ffb4cad9d5e5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxy.php @@ -0,0 +1,775 @@ +google.cloud.compute.v1.TargetHttpsProxy + */ +class TargetHttpsProxy extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A URL referring to a networksecurity.AuthorizationPolicy resource that describes how the proxy should authorize inbound traffic. If left blank, access will not be restricted by an authorization policy. Refer to the AuthorizationPolicy resource for additional details. authorizationPolicy only applies to a global TargetHttpsProxy attached to globalForwardingRules with the loadBalancingScheme set to INTERNAL_SELF_MANAGED. Note: This field currently has no impact. + * + * Generated from protobuf field optional string authorization_policy = 33945528; + */ + protected $authorization_policy = null; + /** + * URL of a certificate map that identifies a certificate map associated with the given target proxy. This field can only be set for global target proxies. If set, sslCertificates will be ignored. Accepted format is //certificatemanager.googleapis.com/projects/{project }/locations/{location}/certificateMaps/{resourceName}. + * + * Generated from protobuf field optional string certificate_map = 156463796; + */ + protected $certificate_map = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a TargetHttpsProxy. An up-to-date fingerprint must be provided in order to patch the TargetHttpsProxy; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the TargetHttpsProxy. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * Specifies how long to keep a connection open, after completing a response, while there is no matching traffic (in seconds). If an HTTP keep-alive is not specified, a default value (610 seconds) will be used. For global external Application Load Balancers, the minimum allowed value is 5 seconds and the maximum allowed value is 1200 seconds. For classic Application Load Balancers, this option is not supported. + * + * Generated from protobuf field optional int32 http_keep_alive_timeout_sec = 447326046; + */ + protected $http_keep_alive_timeout_sec = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of resource. Always compute#targetHttpsProxy for target HTTPS proxies. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. When this field is set to true, Envoy proxies set up inbound traffic interception and bind to the IP address and port specified in the forwarding rule. This is generally useful when using Traffic Director to configure Envoy as a gateway or middle proxy (in other words, not a sidecar proxy). The Envoy proxy listens for inbound requests and handles requests when it receives them. The default is false. + * + * Generated from protobuf field optional bool proxy_bind = 286025582; + */ + protected $proxy_bind = null; + /** + * Specifies the QUIC override policy for this TargetHttpsProxy resource. This setting determines whether the load balancer attempts to negotiate QUIC with clients. You can specify NONE, ENABLE, or DISABLE. - When quic-override is set to NONE, Google manages whether QUIC is used. - When quic-override is set to ENABLE, the load balancer uses QUIC when possible. - When quic-override is set to DISABLE, the load balancer doesn't use QUIC. - If the quic-override flag is not specified, NONE is implied. + * Check the QuicOverride enum for the list of possible values. + * + * Generated from protobuf field optional string quic_override = 456577197; + */ + protected $quic_override = null; + /** + * [Output Only] URL of the region where the regional TargetHttpsProxy resides. This field is not applicable to global TargetHttpsProxies. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * Optional. A URL referring to a networksecurity.ServerTlsPolicy resource that describes how the proxy should authenticate inbound traffic. serverTlsPolicy only applies to a global TargetHttpsProxy attached to globalForwardingRules with the loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL or EXTERNAL_MANAGED. For details which ServerTlsPolicy resources are accepted with INTERNAL_SELF_MANAGED and which with EXTERNAL, EXTERNAL_MANAGED loadBalancingScheme consult ServerTlsPolicy documentation. If left blank, communications are not encrypted. + * + * Generated from protobuf field optional string server_tls_policy = 295825266; + */ + protected $server_tls_policy = null; + /** + * URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. sslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field repeated string ssl_certificates = 366006543; + */ + private $ssl_certificates; + /** + * URL of SslPolicy resource that will be associated with the TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource has no SSL policy configured. + * + * Generated from protobuf field optional string ssl_policy = 295190213; + */ + protected $ssl_policy = null; + /** + * A fully-qualified or valid partial URL to the UrlMap resource that defines the mapping from URL to the BackendService. For example, the following are all valid URLs for specifying a URL map: - https://www.googleapis.compute/v1/projects/project/global/urlMaps/ url-map - projects/project/global/urlMaps/url-map - global/urlMaps/url-map + * + * Generated from protobuf field optional string url_map = 367020684; + */ + protected $url_map = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $authorization_policy + * Optional. A URL referring to a networksecurity.AuthorizationPolicy resource that describes how the proxy should authorize inbound traffic. If left blank, access will not be restricted by an authorization policy. Refer to the AuthorizationPolicy resource for additional details. authorizationPolicy only applies to a global TargetHttpsProxy attached to globalForwardingRules with the loadBalancingScheme set to INTERNAL_SELF_MANAGED. Note: This field currently has no impact. + * @type string $certificate_map + * URL of a certificate map that identifies a certificate map associated with the given target proxy. This field can only be set for global target proxies. If set, sslCertificates will be ignored. Accepted format is //certificatemanager.googleapis.com/projects/{project }/locations/{location}/certificateMaps/{resourceName}. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type string $fingerprint + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a TargetHttpsProxy. An up-to-date fingerprint must be provided in order to patch the TargetHttpsProxy; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the TargetHttpsProxy. + * @type int $http_keep_alive_timeout_sec + * Specifies how long to keep a connection open, after completing a response, while there is no matching traffic (in seconds). If an HTTP keep-alive is not specified, a default value (610 seconds) will be used. For global external Application Load Balancers, the minimum allowed value is 5 seconds and the maximum allowed value is 1200 seconds. For classic Application Load Balancers, this option is not supported. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of resource. Always compute#targetHttpsProxy for target HTTPS proxies. + * @type string $name + * 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 bool $proxy_bind + * This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. When this field is set to true, Envoy proxies set up inbound traffic interception and bind to the IP address and port specified in the forwarding rule. This is generally useful when using Traffic Director to configure Envoy as a gateway or middle proxy (in other words, not a sidecar proxy). The Envoy proxy listens for inbound requests and handles requests when it receives them. The default is false. + * @type string $quic_override + * Specifies the QUIC override policy for this TargetHttpsProxy resource. This setting determines whether the load balancer attempts to negotiate QUIC with clients. You can specify NONE, ENABLE, or DISABLE. - When quic-override is set to NONE, Google manages whether QUIC is used. - When quic-override is set to ENABLE, the load balancer uses QUIC when possible. - When quic-override is set to DISABLE, the load balancer doesn't use QUIC. - If the quic-override flag is not specified, NONE is implied. + * Check the QuicOverride enum for the list of possible values. + * @type string $region + * [Output Only] URL of the region where the regional TargetHttpsProxy resides. This field is not applicable to global TargetHttpsProxies. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $server_tls_policy + * Optional. A URL referring to a networksecurity.ServerTlsPolicy resource that describes how the proxy should authenticate inbound traffic. serverTlsPolicy only applies to a global TargetHttpsProxy attached to globalForwardingRules with the loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL or EXTERNAL_MANAGED. For details which ServerTlsPolicy resources are accepted with INTERNAL_SELF_MANAGED and which with EXTERNAL, EXTERNAL_MANAGED loadBalancingScheme consult ServerTlsPolicy documentation. If left blank, communications are not encrypted. + * @type array|\Google\Protobuf\Internal\RepeatedField $ssl_certificates + * URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. sslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. + * @type string $ssl_policy + * URL of SslPolicy resource that will be associated with the TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource has no SSL policy configured. + * @type string $url_map + * A fully-qualified or valid partial URL to the UrlMap resource that defines the mapping from URL to the BackendService. For example, the following are all valid URLs for specifying a URL map: - https://www.googleapis.compute/v1/projects/project/global/urlMaps/ url-map - projects/project/global/urlMaps/url-map - global/urlMaps/url-map + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A URL referring to a networksecurity.AuthorizationPolicy resource that describes how the proxy should authorize inbound traffic. If left blank, access will not be restricted by an authorization policy. Refer to the AuthorizationPolicy resource for additional details. authorizationPolicy only applies to a global TargetHttpsProxy attached to globalForwardingRules with the loadBalancingScheme set to INTERNAL_SELF_MANAGED. Note: This field currently has no impact. + * + * Generated from protobuf field optional string authorization_policy = 33945528; + * @return string + */ + public function getAuthorizationPolicy() + { + return isset($this->authorization_policy) ? $this->authorization_policy : ''; + } + + public function hasAuthorizationPolicy() + { + return isset($this->authorization_policy); + } + + public function clearAuthorizationPolicy() + { + unset($this->authorization_policy); + } + + /** + * Optional. A URL referring to a networksecurity.AuthorizationPolicy resource that describes how the proxy should authorize inbound traffic. If left blank, access will not be restricted by an authorization policy. Refer to the AuthorizationPolicy resource for additional details. authorizationPolicy only applies to a global TargetHttpsProxy attached to globalForwardingRules with the loadBalancingScheme set to INTERNAL_SELF_MANAGED. Note: This field currently has no impact. + * + * Generated from protobuf field optional string authorization_policy = 33945528; + * @param string $var + * @return $this + */ + public function setAuthorizationPolicy($var) + { + GPBUtil::checkString($var, True); + $this->authorization_policy = $var; + + return $this; + } + + /** + * URL of a certificate map that identifies a certificate map associated with the given target proxy. This field can only be set for global target proxies. If set, sslCertificates will be ignored. Accepted format is //certificatemanager.googleapis.com/projects/{project }/locations/{location}/certificateMaps/{resourceName}. + * + * Generated from protobuf field optional string certificate_map = 156463796; + * @return string + */ + public function getCertificateMap() + { + return isset($this->certificate_map) ? $this->certificate_map : ''; + } + + public function hasCertificateMap() + { + return isset($this->certificate_map); + } + + public function clearCertificateMap() + { + unset($this->certificate_map); + } + + /** + * URL of a certificate map that identifies a certificate map associated with the given target proxy. This field can only be set for global target proxies. If set, sslCertificates will be ignored. Accepted format is //certificatemanager.googleapis.com/projects/{project }/locations/{location}/certificateMaps/{resourceName}. + * + * Generated from protobuf field optional string certificate_map = 156463796; + * @param string $var + * @return $this + */ + public function setCertificateMap($var) + { + GPBUtil::checkString($var, True); + $this->certificate_map = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a TargetHttpsProxy. An up-to-date fingerprint must be provided in order to patch the TargetHttpsProxy; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the TargetHttpsProxy. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a TargetHttpsProxy. An up-to-date fingerprint must be provided in order to patch the TargetHttpsProxy; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the TargetHttpsProxy. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * Specifies how long to keep a connection open, after completing a response, while there is no matching traffic (in seconds). If an HTTP keep-alive is not specified, a default value (610 seconds) will be used. For global external Application Load Balancers, the minimum allowed value is 5 seconds and the maximum allowed value is 1200 seconds. For classic Application Load Balancers, this option is not supported. + * + * Generated from protobuf field optional int32 http_keep_alive_timeout_sec = 447326046; + * @return int + */ + public function getHttpKeepAliveTimeoutSec() + { + return isset($this->http_keep_alive_timeout_sec) ? $this->http_keep_alive_timeout_sec : 0; + } + + public function hasHttpKeepAliveTimeoutSec() + { + return isset($this->http_keep_alive_timeout_sec); + } + + public function clearHttpKeepAliveTimeoutSec() + { + unset($this->http_keep_alive_timeout_sec); + } + + /** + * Specifies how long to keep a connection open, after completing a response, while there is no matching traffic (in seconds). If an HTTP keep-alive is not specified, a default value (610 seconds) will be used. For global external Application Load Balancers, the minimum allowed value is 5 seconds and the maximum allowed value is 1200 seconds. For classic Application Load Balancers, this option is not supported. + * + * Generated from protobuf field optional int32 http_keep_alive_timeout_sec = 447326046; + * @param int $var + * @return $this + */ + public function setHttpKeepAliveTimeoutSec($var) + { + GPBUtil::checkInt32($var); + $this->http_keep_alive_timeout_sec = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#targetHttpsProxy for target HTTPS proxies. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#targetHttpsProxy for target HTTPS proxies. + * + * 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; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. When this field is set to true, Envoy proxies set up inbound traffic interception and bind to the IP address and port specified in the forwarding rule. This is generally useful when using Traffic Director to configure Envoy as a gateway or middle proxy (in other words, not a sidecar proxy). The Envoy proxy listens for inbound requests and handles requests when it receives them. The default is false. + * + * Generated from protobuf field optional bool proxy_bind = 286025582; + * @return bool + */ + public function getProxyBind() + { + return isset($this->proxy_bind) ? $this->proxy_bind : false; + } + + public function hasProxyBind() + { + return isset($this->proxy_bind); + } + + public function clearProxyBind() + { + unset($this->proxy_bind); + } + + /** + * This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. When this field is set to true, Envoy proxies set up inbound traffic interception and bind to the IP address and port specified in the forwarding rule. This is generally useful when using Traffic Director to configure Envoy as a gateway or middle proxy (in other words, not a sidecar proxy). The Envoy proxy listens for inbound requests and handles requests when it receives them. The default is false. + * + * Generated from protobuf field optional bool proxy_bind = 286025582; + * @param bool $var + * @return $this + */ + public function setProxyBind($var) + { + GPBUtil::checkBool($var); + $this->proxy_bind = $var; + + return $this; + } + + /** + * Specifies the QUIC override policy for this TargetHttpsProxy resource. This setting determines whether the load balancer attempts to negotiate QUIC with clients. You can specify NONE, ENABLE, or DISABLE. - When quic-override is set to NONE, Google manages whether QUIC is used. - When quic-override is set to ENABLE, the load balancer uses QUIC when possible. - When quic-override is set to DISABLE, the load balancer doesn't use QUIC. - If the quic-override flag is not specified, NONE is implied. + * Check the QuicOverride enum for the list of possible values. + * + * Generated from protobuf field optional string quic_override = 456577197; + * @return string + */ + public function getQuicOverride() + { + return isset($this->quic_override) ? $this->quic_override : ''; + } + + public function hasQuicOverride() + { + return isset($this->quic_override); + } + + public function clearQuicOverride() + { + unset($this->quic_override); + } + + /** + * Specifies the QUIC override policy for this TargetHttpsProxy resource. This setting determines whether the load balancer attempts to negotiate QUIC with clients. You can specify NONE, ENABLE, or DISABLE. - When quic-override is set to NONE, Google manages whether QUIC is used. - When quic-override is set to ENABLE, the load balancer uses QUIC when possible. - When quic-override is set to DISABLE, the load balancer doesn't use QUIC. - If the quic-override flag is not specified, NONE is implied. + * Check the QuicOverride enum for the list of possible values. + * + * Generated from protobuf field optional string quic_override = 456577197; + * @param string $var + * @return $this + */ + public function setQuicOverride($var) + { + GPBUtil::checkString($var, True); + $this->quic_override = $var; + + return $this; + } + + /** + * [Output Only] URL of the region where the regional TargetHttpsProxy resides. This field is not applicable to global TargetHttpsProxies. + * + * 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 regional TargetHttpsProxy resides. This field is not applicable to global TargetHttpsProxies. + * + * 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] Server-defined URL for the 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 the 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; + } + + /** + * Optional. A URL referring to a networksecurity.ServerTlsPolicy resource that describes how the proxy should authenticate inbound traffic. serverTlsPolicy only applies to a global TargetHttpsProxy attached to globalForwardingRules with the loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL or EXTERNAL_MANAGED. For details which ServerTlsPolicy resources are accepted with INTERNAL_SELF_MANAGED and which with EXTERNAL, EXTERNAL_MANAGED loadBalancingScheme consult ServerTlsPolicy documentation. If left blank, communications are not encrypted. + * + * Generated from protobuf field optional string server_tls_policy = 295825266; + * @return string + */ + public function getServerTlsPolicy() + { + return isset($this->server_tls_policy) ? $this->server_tls_policy : ''; + } + + public function hasServerTlsPolicy() + { + return isset($this->server_tls_policy); + } + + public function clearServerTlsPolicy() + { + unset($this->server_tls_policy); + } + + /** + * Optional. A URL referring to a networksecurity.ServerTlsPolicy resource that describes how the proxy should authenticate inbound traffic. serverTlsPolicy only applies to a global TargetHttpsProxy attached to globalForwardingRules with the loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL or EXTERNAL_MANAGED. For details which ServerTlsPolicy resources are accepted with INTERNAL_SELF_MANAGED and which with EXTERNAL, EXTERNAL_MANAGED loadBalancingScheme consult ServerTlsPolicy documentation. If left blank, communications are not encrypted. + * + * Generated from protobuf field optional string server_tls_policy = 295825266; + * @param string $var + * @return $this + */ + public function setServerTlsPolicy($var) + { + GPBUtil::checkString($var, True); + $this->server_tls_policy = $var; + + return $this; + } + + /** + * URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. sslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field repeated string ssl_certificates = 366006543; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSslCertificates() + { + return $this->ssl_certificates; + } + + /** + * URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. sslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field repeated string ssl_certificates = 366006543; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSslCertificates($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ssl_certificates = $arr; + + return $this; + } + + /** + * URL of SslPolicy resource that will be associated with the TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource has no SSL policy configured. + * + * Generated from protobuf field optional string ssl_policy = 295190213; + * @return string + */ + public function getSslPolicy() + { + return isset($this->ssl_policy) ? $this->ssl_policy : ''; + } + + public function hasSslPolicy() + { + return isset($this->ssl_policy); + } + + public function clearSslPolicy() + { + unset($this->ssl_policy); + } + + /** + * URL of SslPolicy resource that will be associated with the TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource has no SSL policy configured. + * + * Generated from protobuf field optional string ssl_policy = 295190213; + * @param string $var + * @return $this + */ + public function setSslPolicy($var) + { + GPBUtil::checkString($var, True); + $this->ssl_policy = $var; + + return $this; + } + + /** + * A fully-qualified or valid partial URL to the UrlMap resource that defines the mapping from URL to the BackendService. For example, the following are all valid URLs for specifying a URL map: - https://www.googleapis.compute/v1/projects/project/global/urlMaps/ url-map - projects/project/global/urlMaps/url-map - global/urlMaps/url-map + * + * Generated from protobuf field optional string url_map = 367020684; + * @return string + */ + public function getUrlMap() + { + return isset($this->url_map) ? $this->url_map : ''; + } + + public function hasUrlMap() + { + return isset($this->url_map); + } + + public function clearUrlMap() + { + unset($this->url_map); + } + + /** + * A fully-qualified or valid partial URL to the UrlMap resource that defines the mapping from URL to the BackendService. For example, the following are all valid URLs for specifying a URL map: - https://www.googleapis.compute/v1/projects/project/global/urlMaps/ url-map - projects/project/global/urlMaps/url-map - global/urlMaps/url-map + * + * Generated from protobuf field optional string url_map = 367020684; + * @param string $var + * @return $this + */ + public function setUrlMap($var) + { + GPBUtil::checkString($var, True); + $this->url_map = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxy/QuicOverride.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxy/QuicOverride.php new file mode 100644 index 000000000000..291873c39496 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxy/QuicOverride.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.TargetHttpsProxy.QuicOverride + */ +class QuicOverride +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_QUIC_OVERRIDE = 0; + */ + const UNDEFINED_QUIC_OVERRIDE = 0; + /** + * The load balancer will not attempt to negotiate QUIC with clients. + * + * Generated from protobuf enum DISABLE = 241807048; + */ + const DISABLE = 241807048; + /** + * The load balancer will attempt to negotiate QUIC with clients. + * + * Generated from protobuf enum ENABLE = 438835587; + */ + const ENABLE = 438835587; + /** + * No overrides to the default QUIC policy. This option is implicit if no QUIC override has been specified in the request. + * + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + + private static $valueToName = [ + self::UNDEFINED_QUIC_OVERRIDE => 'UNDEFINED_QUIC_OVERRIDE', + self::DISABLE => 'DISABLE', + self::ENABLE => 'ENABLE', + self::NONE => 'NONE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(QuicOverride::class, \Google\Cloud\Compute\V1\TargetHttpsProxy_QuicOverride::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxyAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxyAggregatedList.php new file mode 100644 index 000000000000..36791d67cae1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxyAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.TargetHttpsProxyAggregatedList + */ +class TargetHttpsProxyAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of TargetHttpsProxiesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#targetHttpsProxyAggregatedList for lists of Target HTTP Proxies. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 TargetHttpsProxiesScopedList resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#targetHttpsProxyAggregatedList for lists of Target HTTP Proxies. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 TargetHttpsProxiesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of TargetHttpsProxiesScopedList 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\TargetHttpsProxiesScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#targetHttpsProxyAggregatedList for lists of Target HTTP Proxies. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#targetHttpsProxyAggregatedList for lists of Target HTTP Proxies. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxyList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxyList.php new file mode 100644 index 000000000000..36719b3414bc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxyList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.TargetHttpsProxyList + */ +class TargetHttpsProxyList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of TargetHttpsProxy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetHttpsProxy items = 100526016; + */ + private $items; + /** + * Type of resource. Always compute#targetHttpsProxyList for lists of target HTTPS proxies. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\TargetHttpsProxy>|\Google\Protobuf\Internal\RepeatedField $items + * A list of TargetHttpsProxy resources. + * @type string $kind + * Type of resource. Always compute#targetHttpsProxyList for lists of target HTTPS proxies. + * @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 TargetHttpsProxy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetHttpsProxy items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of TargetHttpsProxy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetHttpsProxy items = 100526016; + * @param array<\Google\Cloud\Compute\V1\TargetHttpsProxy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\TargetHttpsProxy::class); + $this->items = $arr; + + return $this; + } + + /** + * Type of resource. Always compute#targetHttpsProxyList for lists of target HTTPS proxies. + * + * 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. Always compute#targetHttpsProxyList for lists of target HTTPS proxies. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetInstance.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetInstance.php new file mode 100644 index 000000000000..6aa7321eed77 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetInstance.php @@ -0,0 +1,521 @@ +google.cloud.compute.v1.TargetInstance + */ +class TargetInstance extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * A URL to the virtual machine instance that handles traffic for this target instance. When creating a target instance, you can provide the fully-qualified URL or a valid partial URL to the desired virtual machine. For example, the following are all valid URLs: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instances/instance - projects/project/zones/zone/instances/instance - zones/zone/instances/instance + * + * Generated from protobuf field optional string instance = 18257045; + */ + protected $instance = null; + /** + * [Output Only] The type of the resource. Always compute#targetInstance for target instances. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Must have a value of NO_NAT. Protocol forwarding delivers packets while preserving the destination IP address of the forwarding rule referencing the target instance. + * Check the NatPolicy enum for the list of possible values. + * + * Generated from protobuf field optional string nat_policy = 509780496; + */ + protected $nat_policy = null; + /** + * The URL of the network this target instance uses to forward traffic. If not specified, the traffic will be forwarded to the network that the default network interface belongs to. + * + * Generated from protobuf field optional string network = 232872494; + */ + protected $network = null; + /** + * [Output Only] The resource URL for the security policy associated with this target instance. + * + * Generated from protobuf field optional string security_policy = 171082513; + */ + protected $security_policy = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] URL of the zone where the target instance resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + */ + protected $zone = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $instance + * A URL to the virtual machine instance that handles traffic for this target instance. When creating a target instance, you can provide the fully-qualified URL or a valid partial URL to the desired virtual machine. For example, the following are all valid URLs: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instances/instance - projects/project/zones/zone/instances/instance - zones/zone/instances/instance + * @type string $kind + * [Output Only] The type of the resource. Always compute#targetInstance for target instances. + * @type string $name + * 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 string $nat_policy + * Must have a value of NO_NAT. Protocol forwarding delivers packets while preserving the destination IP address of the forwarding rule referencing the target instance. + * Check the NatPolicy enum for the list of possible values. + * @type string $network + * The URL of the network this target instance uses to forward traffic. If not specified, the traffic will be forwarded to the network that the default network interface belongs to. + * @type string $security_policy + * [Output Only] The resource URL for the security policy associated with this target instance. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $zone + * [Output Only] URL of the zone where the target instance resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * A URL to the virtual machine instance that handles traffic for this target instance. When creating a target instance, you can provide the fully-qualified URL or a valid partial URL to the desired virtual machine. For example, the following are all valid URLs: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instances/instance - projects/project/zones/zone/instances/instance - zones/zone/instances/instance + * + * Generated from protobuf field optional string instance = 18257045; + * @return string + */ + public function getInstance() + { + return isset($this->instance) ? $this->instance : ''; + } + + public function hasInstance() + { + return isset($this->instance); + } + + public function clearInstance() + { + unset($this->instance); + } + + /** + * A URL to the virtual machine instance that handles traffic for this target instance. When creating a target instance, you can provide the fully-qualified URL or a valid partial URL to the desired virtual machine. For example, the following are all valid URLs: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instances/instance - projects/project/zones/zone/instances/instance - zones/zone/instances/instance + * + * Generated from protobuf field optional string instance = 18257045; + * @param string $var + * @return $this + */ + public function setInstance($var) + { + GPBUtil::checkString($var, True); + $this->instance = $var; + + return $this; + } + + /** + * [Output Only] The type of the resource. Always compute#targetInstance for target instances. + * + * 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); + } + + /** + * [Output Only] The type of the resource. Always compute#targetInstance for target instances. + * + * 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; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * Must have a value of NO_NAT. Protocol forwarding delivers packets while preserving the destination IP address of the forwarding rule referencing the target instance. + * Check the NatPolicy enum for the list of possible values. + * + * Generated from protobuf field optional string nat_policy = 509780496; + * @return string + */ + public function getNatPolicy() + { + return isset($this->nat_policy) ? $this->nat_policy : ''; + } + + public function hasNatPolicy() + { + return isset($this->nat_policy); + } + + public function clearNatPolicy() + { + unset($this->nat_policy); + } + + /** + * Must have a value of NO_NAT. Protocol forwarding delivers packets while preserving the destination IP address of the forwarding rule referencing the target instance. + * Check the NatPolicy enum for the list of possible values. + * + * Generated from protobuf field optional string nat_policy = 509780496; + * @param string $var + * @return $this + */ + public function setNatPolicy($var) + { + GPBUtil::checkString($var, True); + $this->nat_policy = $var; + + return $this; + } + + /** + * The URL of the network this target instance uses to forward traffic. If not specified, the traffic will be forwarded to the network that the default network interface belongs to. + * + * Generated from protobuf field optional string network = 232872494; + * @return string + */ + public function getNetwork() + { + return isset($this->network) ? $this->network : ''; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * The URL of the network this target instance uses to forward traffic. If not specified, the traffic will be forwarded to the network that the default network interface belongs to. + * + * Generated from protobuf field optional string network = 232872494; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * [Output Only] The resource URL for the security policy associated with this target instance. + * + * Generated from protobuf field optional string security_policy = 171082513; + * @return string + */ + public function getSecurityPolicy() + { + return isset($this->security_policy) ? $this->security_policy : ''; + } + + public function hasSecurityPolicy() + { + return isset($this->security_policy); + } + + public function clearSecurityPolicy() + { + unset($this->security_policy); + } + + /** + * [Output Only] The resource URL for the security policy associated with this target instance. + * + * Generated from protobuf field optional string security_policy = 171082513; + * @param string $var + * @return $this + */ + public function setSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->security_policy = $var; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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] URL of the zone where the target instance resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + * @return string + */ + public function getZone() + { + return isset($this->zone) ? $this->zone : ''; + } + + public function hasZone() + { + return isset($this->zone); + } + + public function clearZone() + { + unset($this->zone); + } + + /** + * [Output Only] URL of the zone where the target instance resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string zone = 3744684; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetInstance/NatPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetInstance/NatPolicy.php new file mode 100644 index 000000000000..5f4a5987f49d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetInstance/NatPolicy.php @@ -0,0 +1,57 @@ +google.cloud.compute.v1.TargetInstance.NatPolicy + */ +class NatPolicy +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_NAT_POLICY = 0; + */ + const UNDEFINED_NAT_POLICY = 0; + /** + * No NAT performed. + * + * Generated from protobuf enum NO_NAT = 161455491; + */ + const NO_NAT = 161455491; + + private static $valueToName = [ + self::UNDEFINED_NAT_POLICY => 'UNDEFINED_NAT_POLICY', + self::NO_NAT => 'NO_NAT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NatPolicy::class, \Google\Cloud\Compute\V1\TargetInstance_NatPolicy::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetInstanceAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetInstanceAggregatedList.php new file mode 100644 index 000000000000..79aacd037cc8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetInstanceAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.TargetInstanceAggregatedList + */ +class TargetInstanceAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of TargetInstance resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 TargetInstance 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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 TargetInstance resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of TargetInstance 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\TargetInstancesScopedList::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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetInstanceList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetInstanceList.php new file mode 100644 index 000000000000..c546ea532fde --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetInstanceList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.TargetInstanceList + */ +class TargetInstanceList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of TargetInstance resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetInstance items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\TargetInstance>|\Google\Protobuf\Internal\RepeatedField $items + * A list of TargetInstance 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 TargetInstance resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetInstance items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of TargetInstance resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetInstance items = 100526016; + * @param array<\Google\Cloud\Compute\V1\TargetInstance>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\TargetInstance::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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetInstancesScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetInstancesScopedList.php new file mode 100644 index 000000000000..ad63d2f8398a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetInstancesScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.TargetInstancesScopedList + */ +class TargetInstancesScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * A list of target instances contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetInstance target_instances = 392915280; + */ + private $target_instances; + /** + * Informational warning which replaces the list of addresses when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\TargetInstance>|\Google\Protobuf\Internal\RepeatedField $target_instances + * A list of target instances contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * Informational warning which replaces the list of addresses when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of target instances contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetInstance target_instances = 392915280; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetInstances() + { + return $this->target_instances; + } + + /** + * A list of target instances contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetInstance target_instances = 392915280; + * @param array<\Google\Cloud\Compute\V1\TargetInstance>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\TargetInstance::class); + $this->target_instances = $arr; + + return $this; + } + + /** + * Informational warning which replaces the list of addresses 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); + } + + /** + * Informational warning which replaces the list of addresses 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPool.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPool.php new file mode 100644 index 000000000000..0bc9b6bde623 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPool.php @@ -0,0 +1,589 @@ +google.cloud.compute.v1.TargetPool + */ +class TargetPool extends \Google\Protobuf\Internal\Message +{ + /** + * The server-defined URL for the resource. This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool, and its failoverRatio field is properly set to a value between [0, 1]. backupPool and failoverRatio together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below failoverRatio, traffic arriving at the load-balanced IP will be directed to the backup pool. In case where failoverRatio and backupPool are not set, or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy. + * + * Generated from protobuf field optional string backup_pool = 45884537; + */ + protected $backup_pool = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool (i.e., not as a backup pool to some other target pool). The value of the field must be in [0, 1]. If set, backupPool must also be set. They together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below this number, traffic arriving at the load-balanced IP will be directed to the backup pool. In case where failoverRatio is not set or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy. + * + * Generated from protobuf field optional float failover_ratio = 212667006; + */ + protected $failover_ratio = null; + /** + * The URL of the HttpHealthCheck resource. A member instance in this pool is considered healthy if and only if the health checks pass. Only legacy HttpHealthChecks are supported. Only one health check may be specified. + * + * Generated from protobuf field repeated string health_checks = 448370606; + */ + private $health_checks; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * A list of resource URLs to the virtual machine instances serving this pool. They must live in zones contained in the same region as this pool. + * + * Generated from protobuf field repeated string instances = 29097598; + */ + private $instances; + /** + * [Output Only] Type of the resource. Always compute#targetPool for target pools. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] URL of the region where the target pool resides. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] The resource URL for the security policy associated with this target pool. + * + * Generated from protobuf field optional string security_policy = 171082513; + */ + protected $security_policy = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * Session affinity option, must be one of the following values: NONE: Connections from the same client IP may go to any instance in the pool. CLIENT_IP: Connections from the same client IP will go to the same instance in the pool while that instance remains healthy. CLIENT_IP_PROTO: Connections from the same client IP with the same IP protocol will go to the same instance in the pool while that instance remains healthy. + * Check the SessionAffinity enum for the list of possible values. + * + * Generated from protobuf field optional string session_affinity = 463888561; + */ + protected $session_affinity = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backup_pool + * The server-defined URL for the resource. This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool, and its failoverRatio field is properly set to a value between [0, 1]. backupPool and failoverRatio together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below failoverRatio, traffic arriving at the load-balanced IP will be directed to the backup pool. In case where failoverRatio and backupPool are not set, or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type float $failover_ratio + * This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool (i.e., not as a backup pool to some other target pool). The value of the field must be in [0, 1]. If set, backupPool must also be set. They together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below this number, traffic arriving at the load-balanced IP will be directed to the backup pool. In case where failoverRatio is not set or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy. + * @type array|\Google\Protobuf\Internal\RepeatedField $health_checks + * The URL of the HttpHealthCheck resource. A member instance in this pool is considered healthy if and only if the health checks pass. Only legacy HttpHealthChecks are supported. Only one health check may be specified. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type array|\Google\Protobuf\Internal\RepeatedField $instances + * A list of resource URLs to the virtual machine instances serving this pool. They must live in zones contained in the same region as this pool. + * @type string $kind + * [Output Only] Type of the resource. Always compute#targetPool for target pools. + * @type string $name + * 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 string $region + * [Output Only] URL of the region where the target pool resides. + * @type string $security_policy + * [Output Only] The resource URL for the security policy associated with this target pool. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $session_affinity + * Session affinity option, must be one of the following values: NONE: Connections from the same client IP may go to any instance in the pool. CLIENT_IP: Connections from the same client IP will go to the same instance in the pool while that instance remains healthy. CLIENT_IP_PROTO: Connections from the same client IP with the same IP protocol will go to the same instance in the pool while that instance remains healthy. + * Check the SessionAffinity enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The server-defined URL for the resource. This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool, and its failoverRatio field is properly set to a value between [0, 1]. backupPool and failoverRatio together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below failoverRatio, traffic arriving at the load-balanced IP will be directed to the backup pool. In case where failoverRatio and backupPool are not set, or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy. + * + * Generated from protobuf field optional string backup_pool = 45884537; + * @return string + */ + public function getBackupPool() + { + return isset($this->backup_pool) ? $this->backup_pool : ''; + } + + public function hasBackupPool() + { + return isset($this->backup_pool); + } + + public function clearBackupPool() + { + unset($this->backup_pool); + } + + /** + * The server-defined URL for the resource. This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool, and its failoverRatio field is properly set to a value between [0, 1]. backupPool and failoverRatio together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below failoverRatio, traffic arriving at the load-balanced IP will be directed to the backup pool. In case where failoverRatio and backupPool are not set, or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy. + * + * Generated from protobuf field optional string backup_pool = 45884537; + * @param string $var + * @return $this + */ + public function setBackupPool($var) + { + GPBUtil::checkString($var, True); + $this->backup_pool = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool (i.e., not as a backup pool to some other target pool). The value of the field must be in [0, 1]. If set, backupPool must also be set. They together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below this number, traffic arriving at the load-balanced IP will be directed to the backup pool. In case where failoverRatio is not set or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy. + * + * Generated from protobuf field optional float failover_ratio = 212667006; + * @return float + */ + public function getFailoverRatio() + { + return isset($this->failover_ratio) ? $this->failover_ratio : 0.0; + } + + public function hasFailoverRatio() + { + return isset($this->failover_ratio); + } + + public function clearFailoverRatio() + { + unset($this->failover_ratio); + } + + /** + * This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool (i.e., not as a backup pool to some other target pool). The value of the field must be in [0, 1]. If set, backupPool must also be set. They together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below this number, traffic arriving at the load-balanced IP will be directed to the backup pool. In case where failoverRatio is not set or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy. + * + * Generated from protobuf field optional float failover_ratio = 212667006; + * @param float $var + * @return $this + */ + public function setFailoverRatio($var) + { + GPBUtil::checkFloat($var); + $this->failover_ratio = $var; + + return $this; + } + + /** + * The URL of the HttpHealthCheck resource. A member instance in this pool is considered healthy if and only if the health checks pass. Only legacy HttpHealthChecks are supported. Only one health check may be specified. + * + * Generated from protobuf field repeated string health_checks = 448370606; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHealthChecks() + { + return $this->health_checks; + } + + /** + * The URL of the HttpHealthCheck resource. A member instance in this pool is considered healthy if and only if the health checks pass. Only legacy HttpHealthChecks are supported. Only one health check may be specified. + * + * Generated from protobuf field repeated string health_checks = 448370606; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHealthChecks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->health_checks = $arr; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * A list of resource URLs to the virtual machine instances serving this pool. They must live in zones contained in the same region as this pool. + * + * Generated from protobuf field repeated string instances = 29097598; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * A list of resource URLs to the virtual machine instances serving this pool. They must live in zones contained in the same region as this pool. + * + * Generated from protobuf field repeated string instances = 29097598; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->instances = $arr; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#targetPool for target pools. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#targetPool for target pools. + * + * 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; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * [Output Only] URL of the region where the target pool resides. + * + * 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 target pool resides. + * + * 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 resource URL for the security policy associated with this target pool. + * + * Generated from protobuf field optional string security_policy = 171082513; + * @return string + */ + public function getSecurityPolicy() + { + return isset($this->security_policy) ? $this->security_policy : ''; + } + + public function hasSecurityPolicy() + { + return isset($this->security_policy); + } + + public function clearSecurityPolicy() + { + unset($this->security_policy); + } + + /** + * [Output Only] The resource URL for the security policy associated with this target pool. + * + * Generated from protobuf field optional string security_policy = 171082513; + * @param string $var + * @return $this + */ + public function setSecurityPolicy($var) + { + GPBUtil::checkString($var, True); + $this->security_policy = $var; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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; + } + + /** + * Session affinity option, must be one of the following values: NONE: Connections from the same client IP may go to any instance in the pool. CLIENT_IP: Connections from the same client IP will go to the same instance in the pool while that instance remains healthy. CLIENT_IP_PROTO: Connections from the same client IP with the same IP protocol will go to the same instance in the pool while that instance remains healthy. + * Check the SessionAffinity enum for the list of possible values. + * + * Generated from protobuf field optional string session_affinity = 463888561; + * @return string + */ + public function getSessionAffinity() + { + return isset($this->session_affinity) ? $this->session_affinity : ''; + } + + public function hasSessionAffinity() + { + return isset($this->session_affinity); + } + + public function clearSessionAffinity() + { + unset($this->session_affinity); + } + + /** + * Session affinity option, must be one of the following values: NONE: Connections from the same client IP may go to any instance in the pool. CLIENT_IP: Connections from the same client IP will go to the same instance in the pool while that instance remains healthy. CLIENT_IP_PROTO: Connections from the same client IP with the same IP protocol will go to the same instance in the pool while that instance remains healthy. + * Check the SessionAffinity enum for the list of possible values. + * + * Generated from protobuf field optional string session_affinity = 463888561; + * @param string $var + * @return $this + */ + public function setSessionAffinity($var) + { + GPBUtil::checkString($var, True); + $this->session_affinity = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPool/SessionAffinity.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPool/SessionAffinity.php new file mode 100644 index 000000000000..41619a46eb0c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPool/SessionAffinity.php @@ -0,0 +1,106 @@ +google.cloud.compute.v1.TargetPool.SessionAffinity + */ +class SessionAffinity +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_SESSION_AFFINITY = 0; + */ + const UNDEFINED_SESSION_AFFINITY = 0; + /** + * 2-tuple hash on packet's source and destination IP addresses. Connections from the same source IP address to the same destination IP address will be served by the same backend VM while that VM remains healthy. + * + * Generated from protobuf enum CLIENT_IP = 345665051; + */ + const CLIENT_IP = 345665051; + /** + * 1-tuple hash only on packet's source IP address. Connections from the same source IP address will be served by the same backend VM while that VM remains healthy. This option can only be used for Internal TCP/UDP Load Balancing. + * + * Generated from protobuf enum CLIENT_IP_NO_DESTINATION = 106122516; + */ + const CLIENT_IP_NO_DESTINATION = 106122516; + /** + * 5-tuple hash on packet's source and destination IP addresses, IP protocol, and source and destination ports. Connections for the same IP protocol from the same source IP address and port to the same destination IP address and port will be served by the same backend VM while that VM remains healthy. This option cannot be used for HTTP(S) load balancing. + * + * Generated from protobuf enum CLIENT_IP_PORT_PROTO = 221722926; + */ + const CLIENT_IP_PORT_PROTO = 221722926; + /** + * 3-tuple hash on packet's source and destination IP addresses, and IP protocol. Connections for the same IP protocol from the same source IP address to the same destination IP address will be served by the same backend VM while that VM remains healthy. This option cannot be used for HTTP(S) load balancing. + * + * Generated from protobuf enum CLIENT_IP_PROTO = 25322148; + */ + const CLIENT_IP_PROTO = 25322148; + /** + * Hash based on a cookie generated by the L7 loadbalancer. Only valid for HTTP(S) load balancing. + * + * Generated from protobuf enum GENERATED_COOKIE = 370321204; + */ + const GENERATED_COOKIE = 370321204; + /** + * The hash is based on a user specified header field. + * + * Generated from protobuf enum HEADER_FIELD = 200737960; + */ + const HEADER_FIELD = 200737960; + /** + * The hash is based on a user provided cookie. + * + * Generated from protobuf enum HTTP_COOKIE = 494981627; + */ + const HTTP_COOKIE = 494981627; + /** + * No session affinity. Connections from the same client IP may go to any instance in the pool. + * + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + + private static $valueToName = [ + self::UNDEFINED_SESSION_AFFINITY => 'UNDEFINED_SESSION_AFFINITY', + self::CLIENT_IP => 'CLIENT_IP', + self::CLIENT_IP_NO_DESTINATION => 'CLIENT_IP_NO_DESTINATION', + self::CLIENT_IP_PORT_PROTO => 'CLIENT_IP_PORT_PROTO', + self::CLIENT_IP_PROTO => 'CLIENT_IP_PROTO', + self::GENERATED_COOKIE => 'GENERATED_COOKIE', + self::HEADER_FIELD => 'HEADER_FIELD', + self::HTTP_COOKIE => 'HTTP_COOKIE', + self::NONE => 'NONE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SessionAffinity::class, \Google\Cloud\Compute\V1\TargetPool_SessionAffinity::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolAggregatedList.php new file mode 100644 index 000000000000..95c29e9e33fc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.TargetPoolAggregatedList + */ +class TargetPoolAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of TargetPool resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#targetPoolAggregatedList for aggregated lists of target pools. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 TargetPool resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#targetPoolAggregatedList for aggregated lists of target pools. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 TargetPool resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of TargetPool 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\TargetPoolsScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#targetPoolAggregatedList for aggregated lists of target pools. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#targetPoolAggregatedList for aggregated lists of target pools. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolInstanceHealth.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolInstanceHealth.php new file mode 100644 index 000000000000..e27ad1afe6ef --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolInstanceHealth.php @@ -0,0 +1,103 @@ +google.cloud.compute.v1.TargetPoolInstanceHealth + */ +class TargetPoolInstanceHealth extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthStatus health_status = 380545845; + */ + private $health_status; + /** + * [Output Only] Type of resource. Always compute#targetPoolInstanceHealth when checking the health of an instance. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\HealthStatus>|\Google\Protobuf\Internal\RepeatedField $health_status + * @type string $kind + * [Output Only] Type of resource. Always compute#targetPoolInstanceHealth when checking the health of an instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthStatus health_status = 380545845; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHealthStatus() + { + return $this->health_status; + } + + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthStatus health_status = 380545845; + * @param array<\Google\Cloud\Compute\V1\HealthStatus>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHealthStatus($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\HealthStatus::class); + $this->health_status = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#targetPoolInstanceHealth when checking the health of an instance. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#targetPoolInstanceHealth when checking the health of an instance. + * + * 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolList.php new file mode 100644 index 000000000000..7e64e3948482 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.TargetPoolList + */ +class TargetPoolList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of TargetPool resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetPool items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#targetPoolList for lists of target pools. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\TargetPool>|\Google\Protobuf\Internal\RepeatedField $items + * A list of TargetPool resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#targetPoolList for lists of target pools. + * @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 TargetPool resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetPool items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of TargetPool resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetPool items = 100526016; + * @param array<\Google\Cloud\Compute\V1\TargetPool>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\TargetPool::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#targetPoolList for lists of target pools. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#targetPoolList for lists of target pools. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolsAddHealthCheckRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolsAddHealthCheckRequest.php new file mode 100644 index 000000000000..d7339b1e8f96 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolsAddHealthCheckRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest + */ +class TargetPoolsAddHealthCheckRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The HttpHealthCheck to add to the target pool. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthCheckReference health_checks = 448370606; + */ + private $health_checks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\HealthCheckReference>|\Google\Protobuf\Internal\RepeatedField $health_checks + * The HttpHealthCheck to add to the target pool. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The HttpHealthCheck to add to the target pool. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthCheckReference health_checks = 448370606; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHealthChecks() + { + return $this->health_checks; + } + + /** + * The HttpHealthCheck to add to the target pool. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthCheckReference health_checks = 448370606; + * @param array<\Google\Cloud\Compute\V1\HealthCheckReference>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHealthChecks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\HealthCheckReference::class); + $this->health_checks = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolsAddInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolsAddInstanceRequest.php new file mode 100644 index 000000000000..4835aa9b40e8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolsAddInstanceRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.TargetPoolsAddInstanceRequest + */ +class TargetPoolsAddInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * A full or partial URL to an instance to add to this target pool. This can be a full or partial URL. For example, the following are valid URLs: - https://www.googleapis.com/compute/v1/projects/project-id/zones/zone /instances/instance-name - projects/project-id/zones/zone/instances/instance-name - zones/zone/instances/instance-name + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceReference instances = 29097598; + */ + private $instances; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\InstanceReference>|\Google\Protobuf\Internal\RepeatedField $instances + * A full or partial URL to an instance to add to this target pool. This can be a full or partial URL. For example, the following are valid URLs: - https://www.googleapis.com/compute/v1/projects/project-id/zones/zone /instances/instance-name - projects/project-id/zones/zone/instances/instance-name - zones/zone/instances/instance-name + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A full or partial URL to an instance to add to this target pool. This can be a full or partial URL. For example, the following are valid URLs: - https://www.googleapis.com/compute/v1/projects/project-id/zones/zone /instances/instance-name - projects/project-id/zones/zone/instances/instance-name - zones/zone/instances/instance-name + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceReference instances = 29097598; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * A full or partial URL to an instance to add to this target pool. This can be a full or partial URL. For example, the following are valid URLs: - https://www.googleapis.com/compute/v1/projects/project-id/zones/zone /instances/instance-name - projects/project-id/zones/zone/instances/instance-name - zones/zone/instances/instance-name + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceReference instances = 29097598; + * @param array<\Google\Cloud\Compute\V1\InstanceReference>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstanceReference::class); + $this->instances = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolsRemoveHealthCheckRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolsRemoveHealthCheckRequest.php new file mode 100644 index 000000000000..e6c120a5c3e3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolsRemoveHealthCheckRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest + */ +class TargetPoolsRemoveHealthCheckRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Health check URL to be removed. This can be a full or valid partial URL. For example, the following are valid URLs: - https://www.googleapis.com/compute/beta/projects/project /global/httpHealthChecks/health-check - projects/project/global/httpHealthChecks/health-check - global/httpHealthChecks/health-check + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthCheckReference health_checks = 448370606; + */ + private $health_checks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\HealthCheckReference>|\Google\Protobuf\Internal\RepeatedField $health_checks + * Health check URL to be removed. This can be a full or valid partial URL. For example, the following are valid URLs: - https://www.googleapis.com/compute/beta/projects/project /global/httpHealthChecks/health-check - projects/project/global/httpHealthChecks/health-check - global/httpHealthChecks/health-check + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Health check URL to be removed. This can be a full or valid partial URL. For example, the following are valid URLs: - https://www.googleapis.com/compute/beta/projects/project /global/httpHealthChecks/health-check - projects/project/global/httpHealthChecks/health-check - global/httpHealthChecks/health-check + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthCheckReference health_checks = 448370606; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHealthChecks() + { + return $this->health_checks; + } + + /** + * Health check URL to be removed. This can be a full or valid partial URL. For example, the following are valid URLs: - https://www.googleapis.com/compute/beta/projects/project /global/httpHealthChecks/health-check - projects/project/global/httpHealthChecks/health-check - global/httpHealthChecks/health-check + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HealthCheckReference health_checks = 448370606; + * @param array<\Google\Cloud\Compute\V1\HealthCheckReference>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHealthChecks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\HealthCheckReference::class); + $this->health_checks = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolsRemoveInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolsRemoveInstanceRequest.php new file mode 100644 index 000000000000..a34aee94a0ff --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolsRemoveInstanceRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest + */ +class TargetPoolsRemoveInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * URLs of the instances to be removed from target pool. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceReference instances = 29097598; + */ + private $instances; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\InstanceReference>|\Google\Protobuf\Internal\RepeatedField $instances + * URLs of the instances to be removed from target pool. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * URLs of the instances to be removed from target pool. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceReference instances = 29097598; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstances() + { + return $this->instances; + } + + /** + * URLs of the instances to be removed from target pool. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.InstanceReference instances = 29097598; + * @param array<\Google\Cloud\Compute\V1\InstanceReference>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstances($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstanceReference::class); + $this->instances = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolsScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolsScopedList.php new file mode 100644 index 000000000000..2494aac4383b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPoolsScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.TargetPoolsScopedList + */ +class TargetPoolsScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * A list of target pools contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetPool target_pools = 336072617; + */ + private $target_pools; + /** + * Informational warning which replaces the list of addresses when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\TargetPool>|\Google\Protobuf\Internal\RepeatedField $target_pools + * A list of target pools contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * Informational warning which replaces the list of addresses when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of target pools contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetPool target_pools = 336072617; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetPools() + { + return $this->target_pools; + } + + /** + * A list of target pools contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetPool target_pools = 336072617; + * @param array<\Google\Cloud\Compute\V1\TargetPool>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetPools($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\TargetPool::class); + $this->target_pools = $arr; + + return $this; + } + + /** + * Informational warning which replaces the list of addresses 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); + } + + /** + * Informational warning which replaces the list of addresses 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetReference.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetReference.php new file mode 100644 index 000000000000..61d7f40e1e4a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetReference.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.TargetReference + */ +class TargetReference extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string target = 192835985; + */ + protected $target = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $target + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string target = 192835985; + * @return string + */ + public function getTarget() + { + return isset($this->target) ? $this->target : ''; + } + + public function hasTarget() + { + return isset($this->target); + } + + public function clearTarget() + { + unset($this->target); + } + + /** + * Generated from protobuf field optional string target = 192835985; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxiesSetBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxiesSetBackendServiceRequest.php new file mode 100644 index 000000000000..d29e2cc88510 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxiesSetBackendServiceRequest.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest + */ +class TargetSslProxiesSetBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The URL of the new BackendService resource for the targetSslProxy. + * + * Generated from protobuf field optional string service = 373540533; + */ + protected $service = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service + * The URL of the new BackendService resource for the targetSslProxy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The URL of the new BackendService resource for the targetSslProxy. + * + * Generated from protobuf field optional string service = 373540533; + * @return string + */ + public function getService() + { + return isset($this->service) ? $this->service : ''; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * The URL of the new BackendService resource for the targetSslProxy. + * + * Generated from protobuf field optional string service = 373540533; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxiesSetCertificateMapRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxiesSetCertificateMapRequest.php new file mode 100644 index 000000000000..20c8a97e34d6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxiesSetCertificateMapRequest.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.TargetSslProxiesSetCertificateMapRequest + */ +class TargetSslProxiesSetCertificateMapRequest extends \Google\Protobuf\Internal\Message +{ + /** + * URL of the Certificate Map to associate with this TargetSslProxy. Accepted format is //certificatemanager.googleapis.com/projects/{project }/locations/{location}/certificateMaps/{resourceName}. + * + * Generated from protobuf field optional string certificate_map = 156463796; + */ + protected $certificate_map = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $certificate_map + * URL of the Certificate Map to associate with this TargetSslProxy. Accepted format is //certificatemanager.googleapis.com/projects/{project }/locations/{location}/certificateMaps/{resourceName}. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * URL of the Certificate Map to associate with this TargetSslProxy. Accepted format is //certificatemanager.googleapis.com/projects/{project }/locations/{location}/certificateMaps/{resourceName}. + * + * Generated from protobuf field optional string certificate_map = 156463796; + * @return string + */ + public function getCertificateMap() + { + return isset($this->certificate_map) ? $this->certificate_map : ''; + } + + public function hasCertificateMap() + { + return isset($this->certificate_map); + } + + public function clearCertificateMap() + { + unset($this->certificate_map); + } + + /** + * URL of the Certificate Map to associate with this TargetSslProxy. Accepted format is //certificatemanager.googleapis.com/projects/{project }/locations/{location}/certificateMaps/{resourceName}. + * + * Generated from protobuf field optional string certificate_map = 156463796; + * @param string $var + * @return $this + */ + public function setCertificateMap($var) + { + GPBUtil::checkString($var, True); + $this->certificate_map = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxiesSetProxyHeaderRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxiesSetProxyHeaderRequest.php new file mode 100644 index 000000000000..f2bc6b788640 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxiesSetProxyHeaderRequest.php @@ -0,0 +1,80 @@ +google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest + */ +class TargetSslProxiesSetProxyHeaderRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The new type of proxy header to append before sending data to the backend. NONE or PROXY_V1 are allowed. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + */ + protected $proxy_header = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $proxy_header + * The new type of proxy header to append before sending data to the backend. NONE or PROXY_V1 are allowed. + * Check the ProxyHeader enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The new type of proxy header to append before sending data to the backend. NONE or PROXY_V1 are allowed. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + * @return string + */ + public function getProxyHeader() + { + return isset($this->proxy_header) ? $this->proxy_header : ''; + } + + public function hasProxyHeader() + { + return isset($this->proxy_header); + } + + public function clearProxyHeader() + { + unset($this->proxy_header); + } + + /** + * The new type of proxy header to append before sending data to the backend. NONE or PROXY_V1 are allowed. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + * @param string $var + * @return $this + */ + public function setProxyHeader($var) + { + GPBUtil::checkString($var, True); + $this->proxy_header = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxiesSetProxyHeaderRequest/ProxyHeader.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxiesSetProxyHeaderRequest/ProxyHeader.php new file mode 100644 index 000000000000..a72d4f4c3639 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxiesSetProxyHeaderRequest/ProxyHeader.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest.ProxyHeader + */ +class ProxyHeader +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PROXY_HEADER = 0; + */ + const UNDEFINED_PROXY_HEADER = 0; + /** + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + /** + * Generated from protobuf enum PROXY_V1 = 334352940; + */ + const PROXY_V1 = 334352940; + + private static $valueToName = [ + self::UNDEFINED_PROXY_HEADER => 'UNDEFINED_PROXY_HEADER', + self::NONE => 'NONE', + self::PROXY_V1 => 'PROXY_V1', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ProxyHeader::class, \Google\Cloud\Compute\V1\TargetSslProxiesSetProxyHeaderRequest_ProxyHeader::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxiesSetSslCertificatesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxiesSetSslCertificatesRequest.php new file mode 100644 index 000000000000..7586dd6479fe --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxiesSetSslCertificatesRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest + */ +class TargetSslProxiesSetSslCertificatesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * New set of URLs to SslCertificate resources to associate with this TargetSslProxy. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. + * + * Generated from protobuf field repeated string ssl_certificates = 366006543; + */ + private $ssl_certificates; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $ssl_certificates + * New set of URLs to SslCertificate resources to associate with this TargetSslProxy. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * New set of URLs to SslCertificate resources to associate with this TargetSslProxy. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. + * + * Generated from protobuf field repeated string ssl_certificates = 366006543; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSslCertificates() + { + return $this->ssl_certificates; + } + + /** + * New set of URLs to SslCertificate resources to associate with this TargetSslProxy. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. + * + * Generated from protobuf field repeated string ssl_certificates = 366006543; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSslCertificates($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ssl_certificates = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxy.php new file mode 100644 index 000000000000..9c3743b078de --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxy.php @@ -0,0 +1,511 @@ +google.cloud.compute.v1.TargetSslProxy + */ +class TargetSslProxy extends \Google\Protobuf\Internal\Message +{ + /** + * URL of a certificate map that identifies a certificate map associated with the given target proxy. This field can only be set for global target proxies. If set, sslCertificates will be ignored. Accepted format is //certificatemanager.googleapis.com/projects/{project }/locations/{location}/certificateMaps/{resourceName}. + * + * Generated from protobuf field optional string certificate_map = 156463796; + */ + protected $certificate_map = null; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#targetSslProxy for target SSL proxies. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + */ + protected $proxy_header = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * URL to the BackendService resource. + * + * Generated from protobuf field optional string service = 373540533; + */ + protected $service = null; + /** + * URLs to SslCertificate resources that are used to authenticate connections to Backends. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. sslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field repeated string ssl_certificates = 366006543; + */ + private $ssl_certificates; + /** + * URL of SslPolicy resource that will be associated with the TargetSslProxy resource. If not set, the TargetSslProxy resource will not have any SSL policy configured. + * + * Generated from protobuf field optional string ssl_policy = 295190213; + */ + protected $ssl_policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $certificate_map + * URL of a certificate map that identifies a certificate map associated with the given target proxy. This field can only be set for global target proxies. If set, sslCertificates will be ignored. Accepted format is //certificatemanager.googleapis.com/projects/{project }/locations/{location}/certificateMaps/{resourceName}. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of the resource. Always compute#targetSslProxy for target SSL proxies. + * @type string $name + * 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 string $proxy_header + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $service + * URL to the BackendService resource. + * @type array|\Google\Protobuf\Internal\RepeatedField $ssl_certificates + * URLs to SslCertificate resources that are used to authenticate connections to Backends. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. sslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. + * @type string $ssl_policy + * URL of SslPolicy resource that will be associated with the TargetSslProxy resource. If not set, the TargetSslProxy resource will not have any SSL policy configured. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * URL of a certificate map that identifies a certificate map associated with the given target proxy. This field can only be set for global target proxies. If set, sslCertificates will be ignored. Accepted format is //certificatemanager.googleapis.com/projects/{project }/locations/{location}/certificateMaps/{resourceName}. + * + * Generated from protobuf field optional string certificate_map = 156463796; + * @return string + */ + public function getCertificateMap() + { + return isset($this->certificate_map) ? $this->certificate_map : ''; + } + + public function hasCertificateMap() + { + return isset($this->certificate_map); + } + + public function clearCertificateMap() + { + unset($this->certificate_map); + } + + /** + * URL of a certificate map that identifies a certificate map associated with the given target proxy. This field can only be set for global target proxies. If set, sslCertificates will be ignored. Accepted format is //certificatemanager.googleapis.com/projects/{project }/locations/{location}/certificateMaps/{resourceName}. + * + * Generated from protobuf field optional string certificate_map = 156463796; + * @param string $var + * @return $this + */ + public function setCertificateMap($var) + { + GPBUtil::checkString($var, True); + $this->certificate_map = $var; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#targetSslProxy for target SSL proxies. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#targetSslProxy for target SSL proxies. + * + * 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; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + * @return string + */ + public function getProxyHeader() + { + return isset($this->proxy_header) ? $this->proxy_header : ''; + } + + public function hasProxyHeader() + { + return isset($this->proxy_header); + } + + public function clearProxyHeader() + { + unset($this->proxy_header); + } + + /** + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + * @param string $var + * @return $this + */ + public function setProxyHeader($var) + { + GPBUtil::checkString($var, True); + $this->proxy_header = $var; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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; + } + + /** + * URL to the BackendService resource. + * + * Generated from protobuf field optional string service = 373540533; + * @return string + */ + public function getService() + { + return isset($this->service) ? $this->service : ''; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * URL to the BackendService resource. + * + * Generated from protobuf field optional string service = 373540533; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * URLs to SslCertificate resources that are used to authenticate connections to Backends. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. sslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field repeated string ssl_certificates = 366006543; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSslCertificates() + { + return $this->ssl_certificates; + } + + /** + * URLs to SslCertificate resources that are used to authenticate connections to Backends. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. sslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. + * + * Generated from protobuf field repeated string ssl_certificates = 366006543; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSslCertificates($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ssl_certificates = $arr; + + return $this; + } + + /** + * URL of SslPolicy resource that will be associated with the TargetSslProxy resource. If not set, the TargetSslProxy resource will not have any SSL policy configured. + * + * Generated from protobuf field optional string ssl_policy = 295190213; + * @return string + */ + public function getSslPolicy() + { + return isset($this->ssl_policy) ? $this->ssl_policy : ''; + } + + public function hasSslPolicy() + { + return isset($this->ssl_policy); + } + + public function clearSslPolicy() + { + unset($this->ssl_policy); + } + + /** + * URL of SslPolicy resource that will be associated with the TargetSslProxy resource. If not set, the TargetSslProxy resource will not have any SSL policy configured. + * + * Generated from protobuf field optional string ssl_policy = 295190213; + * @param string $var + * @return $this + */ + public function setSslPolicy($var) + { + GPBUtil::checkString($var, True); + $this->ssl_policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxy/ProxyHeader.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxy/ProxyHeader.php new file mode 100644 index 000000000000..06dc28b8164a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxy/ProxyHeader.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.TargetSslProxy.ProxyHeader + */ +class ProxyHeader +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PROXY_HEADER = 0; + */ + const UNDEFINED_PROXY_HEADER = 0; + /** + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + /** + * Generated from protobuf enum PROXY_V1 = 334352940; + */ + const PROXY_V1 = 334352940; + + private static $valueToName = [ + self::UNDEFINED_PROXY_HEADER => 'UNDEFINED_PROXY_HEADER', + self::NONE => 'NONE', + self::PROXY_V1 => 'PROXY_V1', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ProxyHeader::class, \Google\Cloud\Compute\V1\TargetSslProxy_ProxyHeader::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxyList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxyList.php new file mode 100644 index 000000000000..e4b0f43fc17d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetSslProxyList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.TargetSslProxyList + */ +class TargetSslProxyList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of TargetSslProxy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetSslProxy items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\TargetSslProxy>|\Google\Protobuf\Internal\RepeatedField $items + * A list of TargetSslProxy 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 TargetSslProxy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetSslProxy items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of TargetSslProxy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetSslProxy items = 100526016; + * @param array<\Google\Cloud\Compute\V1\TargetSslProxy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\TargetSslProxy::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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxiesScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxiesScopedList.php new file mode 100644 index 000000000000..fbaf495d5f49 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxiesScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.TargetTcpProxiesScopedList + */ +class TargetTcpProxiesScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * A list of TargetTcpProxies contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetTcpProxy target_tcp_proxies = 262056832; + */ + private $target_tcp_proxies; + /** + * Informational warning which replaces the list of backend services when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\TargetTcpProxy>|\Google\Protobuf\Internal\RepeatedField $target_tcp_proxies + * A list of TargetTcpProxies contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * Informational warning which replaces the list of backend services when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of TargetTcpProxies contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetTcpProxy target_tcp_proxies = 262056832; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetTcpProxies() + { + return $this->target_tcp_proxies; + } + + /** + * A list of TargetTcpProxies contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetTcpProxy target_tcp_proxies = 262056832; + * @param array<\Google\Cloud\Compute\V1\TargetTcpProxy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetTcpProxies($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\TargetTcpProxy::class); + $this->target_tcp_proxies = $arr; + + return $this; + } + + /** + * Informational warning which replaces the list of backend services 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); + } + + /** + * Informational warning which replaces the list of backend services 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxiesSetBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxiesSetBackendServiceRequest.php new file mode 100644 index 000000000000..1a32be372ca7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxiesSetBackendServiceRequest.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest + */ +class TargetTcpProxiesSetBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The URL of the new BackendService resource for the targetTcpProxy. + * + * Generated from protobuf field optional string service = 373540533; + */ + protected $service = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service + * The URL of the new BackendService resource for the targetTcpProxy. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The URL of the new BackendService resource for the targetTcpProxy. + * + * Generated from protobuf field optional string service = 373540533; + * @return string + */ + public function getService() + { + return isset($this->service) ? $this->service : ''; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * The URL of the new BackendService resource for the targetTcpProxy. + * + * Generated from protobuf field optional string service = 373540533; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxiesSetProxyHeaderRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxiesSetProxyHeaderRequest.php new file mode 100644 index 000000000000..93e269d8bea2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxiesSetProxyHeaderRequest.php @@ -0,0 +1,80 @@ +google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest + */ +class TargetTcpProxiesSetProxyHeaderRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The new type of proxy header to append before sending data to the backend. NONE or PROXY_V1 are allowed. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + */ + protected $proxy_header = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $proxy_header + * The new type of proxy header to append before sending data to the backend. NONE or PROXY_V1 are allowed. + * Check the ProxyHeader enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The new type of proxy header to append before sending data to the backend. NONE or PROXY_V1 are allowed. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + * @return string + */ + public function getProxyHeader() + { + return isset($this->proxy_header) ? $this->proxy_header : ''; + } + + public function hasProxyHeader() + { + return isset($this->proxy_header); + } + + public function clearProxyHeader() + { + unset($this->proxy_header); + } + + /** + * The new type of proxy header to append before sending data to the backend. NONE or PROXY_V1 are allowed. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + * @param string $var + * @return $this + */ + public function setProxyHeader($var) + { + GPBUtil::checkString($var, True); + $this->proxy_header = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxiesSetProxyHeaderRequest/ProxyHeader.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxiesSetProxyHeaderRequest/ProxyHeader.php new file mode 100644 index 000000000000..9d717e4bf942 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxiesSetProxyHeaderRequest/ProxyHeader.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest.ProxyHeader + */ +class ProxyHeader +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PROXY_HEADER = 0; + */ + const UNDEFINED_PROXY_HEADER = 0; + /** + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + /** + * Generated from protobuf enum PROXY_V1 = 334352940; + */ + const PROXY_V1 = 334352940; + + private static $valueToName = [ + self::UNDEFINED_PROXY_HEADER => 'UNDEFINED_PROXY_HEADER', + self::NONE => 'NONE', + self::PROXY_V1 => 'PROXY_V1', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ProxyHeader::class, \Google\Cloud\Compute\V1\TargetTcpProxiesSetProxyHeaderRequest_ProxyHeader::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxy.php new file mode 100644 index 000000000000..67fdc2f449c5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxy.php @@ -0,0 +1,477 @@ +google.cloud.compute.v1.TargetTcpProxy + */ +class TargetTcpProxy extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#targetTcpProxy for target TCP proxies. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. When this field is set to true, Envoy proxies set up inbound traffic interception and bind to the IP address and port specified in the forwarding rule. This is generally useful when using Traffic Director to configure Envoy as a gateway or middle proxy (in other words, not a sidecar proxy). The Envoy proxy listens for inbound requests and handles requests when it receives them. The default is false. + * + * Generated from protobuf field optional bool proxy_bind = 286025582; + */ + protected $proxy_bind = null; + /** + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + */ + protected $proxy_header = null; + /** + * [Output Only] URL of the region where the regional TCP proxy resides. This field is not applicable to global TCP proxy. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * URL to the BackendService resource. + * + * Generated from protobuf field optional string service = 373540533; + */ + protected $service = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of the resource. Always compute#targetTcpProxy for target TCP proxies. + * @type string $name + * 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 bool $proxy_bind + * This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. When this field is set to true, Envoy proxies set up inbound traffic interception and bind to the IP address and port specified in the forwarding rule. This is generally useful when using Traffic Director to configure Envoy as a gateway or middle proxy (in other words, not a sidecar proxy). The Envoy proxy listens for inbound requests and handles requests when it receives them. The default is false. + * @type string $proxy_header + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * @type string $region + * [Output Only] URL of the region where the regional TCP proxy resides. This field is not applicable to global TCP proxy. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $service + * URL to the BackendService resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#targetTcpProxy for target TCP proxies. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#targetTcpProxy for target TCP proxies. + * + * 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; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. When this field is set to true, Envoy proxies set up inbound traffic interception and bind to the IP address and port specified in the forwarding rule. This is generally useful when using Traffic Director to configure Envoy as a gateway or middle proxy (in other words, not a sidecar proxy). The Envoy proxy listens for inbound requests and handles requests when it receives them. The default is false. + * + * Generated from protobuf field optional bool proxy_bind = 286025582; + * @return bool + */ + public function getProxyBind() + { + return isset($this->proxy_bind) ? $this->proxy_bind : false; + } + + public function hasProxyBind() + { + return isset($this->proxy_bind); + } + + public function clearProxyBind() + { + unset($this->proxy_bind); + } + + /** + * This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. When this field is set to true, Envoy proxies set up inbound traffic interception and bind to the IP address and port specified in the forwarding rule. This is generally useful when using Traffic Director to configure Envoy as a gateway or middle proxy (in other words, not a sidecar proxy). The Envoy proxy listens for inbound requests and handles requests when it receives them. The default is false. + * + * Generated from protobuf field optional bool proxy_bind = 286025582; + * @param bool $var + * @return $this + */ + public function setProxyBind($var) + { + GPBUtil::checkBool($var); + $this->proxy_bind = $var; + + return $this; + } + + /** + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + * @return string + */ + public function getProxyHeader() + { + return isset($this->proxy_header) ? $this->proxy_header : ''; + } + + public function hasProxyHeader() + { + return isset($this->proxy_header); + } + + public function clearProxyHeader() + { + unset($this->proxy_header); + } + + /** + * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + * Check the ProxyHeader enum for the list of possible values. + * + * Generated from protobuf field optional string proxy_header = 160374142; + * @param string $var + * @return $this + */ + public function setProxyHeader($var) + { + GPBUtil::checkString($var, True); + $this->proxy_header = $var; + + return $this; + } + + /** + * [Output Only] URL of the region where the regional TCP proxy resides. This field is not applicable to global TCP proxy. + * + * 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 regional TCP proxy resides. This field is not applicable to global TCP proxy. + * + * 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] Server-defined URL for the 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 the 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; + } + + /** + * URL to the BackendService resource. + * + * Generated from protobuf field optional string service = 373540533; + * @return string + */ + public function getService() + { + return isset($this->service) ? $this->service : ''; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * URL to the BackendService resource. + * + * Generated from protobuf field optional string service = 373540533; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxy/ProxyHeader.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxy/ProxyHeader.php new file mode 100644 index 000000000000..46f3429e7fec --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxy/ProxyHeader.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.TargetTcpProxy.ProxyHeader + */ +class ProxyHeader +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PROXY_HEADER = 0; + */ + const UNDEFINED_PROXY_HEADER = 0; + /** + * Generated from protobuf enum NONE = 2402104; + */ + const NONE = 2402104; + /** + * Generated from protobuf enum PROXY_V1 = 334352940; + */ + const PROXY_V1 = 334352940; + + private static $valueToName = [ + self::UNDEFINED_PROXY_HEADER => 'UNDEFINED_PROXY_HEADER', + self::NONE => 'NONE', + self::PROXY_V1 => 'PROXY_V1', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ProxyHeader::class, \Google\Cloud\Compute\V1\TargetTcpProxy_ProxyHeader::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxyAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxyAggregatedList.php new file mode 100644 index 000000000000..15caba7e64eb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxyAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.TargetTcpProxyAggregatedList + */ +class TargetTcpProxyAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of TargetTcpProxiesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#targetTcpProxyAggregatedList for lists of Target TCP Proxies. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 TargetTcpProxiesScopedList resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#targetTcpProxyAggregatedList for lists of Target TCP Proxies. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 TargetTcpProxiesScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of TargetTcpProxiesScopedList 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\TargetTcpProxiesScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#targetTcpProxyAggregatedList for lists of Target TCP Proxies. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#targetTcpProxyAggregatedList for lists of Target TCP Proxies. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxyList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxyList.php new file mode 100644 index 000000000000..111265221f1f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetTcpProxyList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.TargetTcpProxyList + */ +class TargetTcpProxyList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of TargetTcpProxy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetTcpProxy items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\TargetTcpProxy>|\Google\Protobuf\Internal\RepeatedField $items + * A list of TargetTcpProxy 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 TargetTcpProxy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetTcpProxy items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of TargetTcpProxy resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetTcpProxy items = 100526016; + * @param array<\Google\Cloud\Compute\V1\TargetTcpProxy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\TargetTcpProxy::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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetVpnGateway.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetVpnGateway.php new file mode 100644 index 000000000000..2bfbd2cf71a0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetVpnGateway.php @@ -0,0 +1,579 @@ +google.cloud.compute.v1.TargetVpnGateway + */ +class TargetVpnGateway extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] A list of URLs to the ForwardingRule resources. ForwardingRules are created using compute.forwardingRules.insert and associated with a VPN gateway. + * + * Generated from protobuf field repeated string forwarding_rules = 315821365; + */ + private $forwarding_rules; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * A fingerprint for the labels being applied to this TargetVpnGateway, 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 TargetVpnGateway. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + */ + protected $label_fingerprint = null; + /** + * 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. + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * URL of the network to which this VPN gateway is attached. Provided by the client when the VPN gateway is created. + * + * Generated from protobuf field optional string network = 232872494; + */ + protected $network = null; + /** + * [Output Only] URL of the region where the target VPN gateway resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] The status of the VPN gateway, which can be one of the following: CREATING, READY, FAILED, or DELETING. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + /** + * [Output Only] A list of URLs to VpnTunnel resources. VpnTunnels are created using the compute.vpntunnels.insert method and associated with a VPN gateway. + * + * Generated from protobuf field repeated string tunnels = 104561931; + */ + private $tunnels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type array|\Google\Protobuf\Internal\RepeatedField $forwarding_rules + * [Output Only] A list of URLs to the ForwardingRule resources. ForwardingRules are created using compute.forwardingRules.insert and associated with a VPN gateway. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. + * @type string $label_fingerprint + * A fingerprint for the labels being applied to this TargetVpnGateway, 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 TargetVpnGateway. + * @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 + * 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 string $network + * URL of the network to which this VPN gateway is attached. Provided by the client when the VPN gateway is created. + * @type string $region + * [Output Only] URL of the region where the target VPN gateway resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $status + * [Output Only] The status of the VPN gateway, which can be one of the following: CREATING, READY, FAILED, or DELETING. + * Check the Status enum for the list of possible values. + * @type array|\Google\Protobuf\Internal\RepeatedField $tunnels + * [Output Only] A list of URLs to VpnTunnel resources. VpnTunnels are created using the compute.vpntunnels.insert method and associated with a VPN gateway. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] A list of URLs to the ForwardingRule resources. ForwardingRules are created using compute.forwardingRules.insert and associated with a VPN gateway. + * + * Generated from protobuf field repeated string forwarding_rules = 315821365; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getForwardingRules() + { + return $this->forwarding_rules; + } + + /** + * [Output Only] A list of URLs to the ForwardingRule resources. ForwardingRules are created using compute.forwardingRules.insert and associated with a VPN gateway. + * + * Generated from protobuf field repeated string forwarding_rules = 315821365; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setForwardingRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->forwarding_rules = $arr; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. + * + * 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; + } + + /** + * A fingerprint for the labels being applied to this TargetVpnGateway, 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 TargetVpnGateway. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @return string + */ + public function getLabelFingerprint() + { + return isset($this->label_fingerprint) ? $this->label_fingerprint : ''; + } + + public function hasLabelFingerprint() + { + return isset($this->label_fingerprint); + } + + public function clearLabelFingerprint() + { + unset($this->label_fingerprint); + } + + /** + * A fingerprint for the labels being applied to this TargetVpnGateway, 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 TargetVpnGateway. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @param string $var + * @return $this + */ + public function setLabelFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->label_fingerprint = $var; + + return $this; + } + + /** + * 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. + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->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. + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * URL of the network to which this VPN gateway is attached. Provided by the client when the VPN gateway is created. + * + * Generated from protobuf field optional string network = 232872494; + * @return string + */ + public function getNetwork() + { + return isset($this->network) ? $this->network : ''; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * URL of the network to which this VPN gateway is attached. Provided by the client when the VPN gateway is created. + * + * Generated from protobuf field optional string network = 232872494; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * [Output Only] URL of the region where the target VPN gateway resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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 target VPN gateway resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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] Server-defined URL for the 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 the 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] The status of the VPN gateway, which can be one of the following: CREATING, READY, FAILED, or DELETING. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] The status of the VPN gateway, which can be one of the following: CREATING, READY, FAILED, or DELETING. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + + /** + * [Output Only] A list of URLs to VpnTunnel resources. VpnTunnels are created using the compute.vpntunnels.insert method and associated with a VPN gateway. + * + * Generated from protobuf field repeated string tunnels = 104561931; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTunnels() + { + return $this->tunnels; + } + + /** + * [Output Only] A list of URLs to VpnTunnel resources. VpnTunnels are created using the compute.vpntunnels.insert method and associated with a VPN gateway. + * + * Generated from protobuf field repeated string tunnels = 104561931; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTunnels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->tunnels = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetVpnGateway/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetVpnGateway/Status.php new file mode 100644 index 000000000000..5aceb7fae919 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetVpnGateway/Status.php @@ -0,0 +1,70 @@ +google.cloud.compute.v1.TargetVpnGateway.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * Generated from protobuf enum CREATING = 455564985; + */ + const CREATING = 455564985; + /** + * Generated from protobuf enum DELETING = 528602024; + */ + const DELETING = 528602024; + /** + * Generated from protobuf enum FAILED = 455706685; + */ + const FAILED = 455706685; + /** + * Generated from protobuf enum READY = 77848963; + */ + const READY = 77848963; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::CREATING => 'CREATING', + self::DELETING => 'DELETING', + self::FAILED => 'FAILED', + self::READY => 'READY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\TargetVpnGateway_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetVpnGatewayAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetVpnGatewayAggregatedList.php new file mode 100644 index 000000000000..6a734fe10070 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetVpnGatewayAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.TargetVpnGatewayAggregatedList + */ +class TargetVpnGatewayAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of TargetVpnGateway resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 TargetVpnGateway resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 TargetVpnGateway resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of TargetVpnGateway 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\TargetVpnGatewaysScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetVpnGatewayList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetVpnGatewayList.php new file mode 100644 index 000000000000..dc4920849ca9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetVpnGatewayList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.TargetVpnGatewayList + */ +class TargetVpnGatewayList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of TargetVpnGateway resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetVpnGateway items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\TargetVpnGateway>|\Google\Protobuf\Internal\RepeatedField $items + * A list of TargetVpnGateway resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. + * @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 TargetVpnGateway resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetVpnGateway items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of TargetVpnGateway resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetVpnGateway items = 100526016; + * @param array<\Google\Cloud\Compute\V1\TargetVpnGateway>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\TargetVpnGateway::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetVpnGatewaysScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetVpnGatewaysScopedList.php new file mode 100644 index 000000000000..71fc403d96a1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetVpnGatewaysScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.TargetVpnGatewaysScopedList + */ +class TargetVpnGatewaysScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A list of target VPN gateways contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetVpnGateway target_vpn_gateways = 401770888; + */ + private $target_vpn_gateways; + /** + * [Output Only] Informational warning which replaces the list of addresses when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\TargetVpnGateway>|\Google\Protobuf\Internal\RepeatedField $target_vpn_gateways + * [Output Only] A list of target VPN gateways contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] Informational warning which replaces the list of addresses 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 target VPN gateways contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetVpnGateway target_vpn_gateways = 401770888; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargetVpnGateways() + { + return $this->target_vpn_gateways; + } + + /** + * [Output Only] A list of target VPN gateways contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.TargetVpnGateway target_vpn_gateways = 401770888; + * @param array<\Google\Cloud\Compute\V1\TargetVpnGateway>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargetVpnGateways($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\TargetVpnGateway::class); + $this->target_vpn_gateways = $arr; + + return $this; + } + + /** + * [Output Only] Informational warning which replaces the list of addresses 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] Informational warning which replaces the list of addresses 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestFailure.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestFailure.php new file mode 100644 index 000000000000..dd4da3f41f93 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestFailure.php @@ -0,0 +1,418 @@ +google.cloud.compute.v1.TestFailure + */ +class TestFailure extends \Google\Protobuf\Internal\Message +{ + /** + * The actual output URL evaluated by a load balancer containing the scheme, host, path and query parameters. + * + * Generated from protobuf field optional string actual_output_url = 287075458; + */ + protected $actual_output_url = null; + /** + * Actual HTTP status code for rule with `urlRedirect` calculated by load balancer + * + * Generated from protobuf field optional int32 actual_redirect_response_code = 42926553; + */ + protected $actual_redirect_response_code = null; + /** + * BackendService or BackendBucket returned by load balancer. + * + * Generated from protobuf field optional string actual_service = 440379652; + */ + protected $actual_service = null; + /** + * The expected output URL evaluated by a load balancer containing the scheme, host, path and query parameters. + * + * Generated from protobuf field optional string expected_output_url = 433967384; + */ + protected $expected_output_url = null; + /** + * Expected HTTP status code for rule with `urlRedirect` calculated by load balancer + * + * Generated from protobuf field optional int32 expected_redirect_response_code = 18888047; + */ + protected $expected_redirect_response_code = null; + /** + * Expected BackendService or BackendBucket resource the given URL should be mapped to. + * + * Generated from protobuf field optional string expected_service = 133987374; + */ + protected $expected_service = null; + /** + * HTTP headers of the request. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.UrlMapTestHeader headers = 258436998; + */ + private $headers; + /** + * Host portion of the URL. + * + * Generated from protobuf field optional string host = 3208616; + */ + protected $host = null; + /** + * Path portion including query parameters in the URL. + * + * Generated from protobuf field optional string path = 3433509; + */ + protected $path = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $actual_output_url + * The actual output URL evaluated by a load balancer containing the scheme, host, path and query parameters. + * @type int $actual_redirect_response_code + * Actual HTTP status code for rule with `urlRedirect` calculated by load balancer + * @type string $actual_service + * BackendService or BackendBucket returned by load balancer. + * @type string $expected_output_url + * The expected output URL evaluated by a load balancer containing the scheme, host, path and query parameters. + * @type int $expected_redirect_response_code + * Expected HTTP status code for rule with `urlRedirect` calculated by load balancer + * @type string $expected_service + * Expected BackendService or BackendBucket resource the given URL should be mapped to. + * @type array<\Google\Cloud\Compute\V1\UrlMapTestHeader>|\Google\Protobuf\Internal\RepeatedField $headers + * HTTP headers of the request. + * @type string $host + * Host portion of the URL. + * @type string $path + * Path portion including query parameters in the URL. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The actual output URL evaluated by a load balancer containing the scheme, host, path and query parameters. + * + * Generated from protobuf field optional string actual_output_url = 287075458; + * @return string + */ + public function getActualOutputUrl() + { + return isset($this->actual_output_url) ? $this->actual_output_url : ''; + } + + public function hasActualOutputUrl() + { + return isset($this->actual_output_url); + } + + public function clearActualOutputUrl() + { + unset($this->actual_output_url); + } + + /** + * The actual output URL evaluated by a load balancer containing the scheme, host, path and query parameters. + * + * Generated from protobuf field optional string actual_output_url = 287075458; + * @param string $var + * @return $this + */ + public function setActualOutputUrl($var) + { + GPBUtil::checkString($var, True); + $this->actual_output_url = $var; + + return $this; + } + + /** + * Actual HTTP status code for rule with `urlRedirect` calculated by load balancer + * + * Generated from protobuf field optional int32 actual_redirect_response_code = 42926553; + * @return int + */ + public function getActualRedirectResponseCode() + { + return isset($this->actual_redirect_response_code) ? $this->actual_redirect_response_code : 0; + } + + public function hasActualRedirectResponseCode() + { + return isset($this->actual_redirect_response_code); + } + + public function clearActualRedirectResponseCode() + { + unset($this->actual_redirect_response_code); + } + + /** + * Actual HTTP status code for rule with `urlRedirect` calculated by load balancer + * + * Generated from protobuf field optional int32 actual_redirect_response_code = 42926553; + * @param int $var + * @return $this + */ + public function setActualRedirectResponseCode($var) + { + GPBUtil::checkInt32($var); + $this->actual_redirect_response_code = $var; + + return $this; + } + + /** + * BackendService or BackendBucket returned by load balancer. + * + * Generated from protobuf field optional string actual_service = 440379652; + * @return string + */ + public function getActualService() + { + return isset($this->actual_service) ? $this->actual_service : ''; + } + + public function hasActualService() + { + return isset($this->actual_service); + } + + public function clearActualService() + { + unset($this->actual_service); + } + + /** + * BackendService or BackendBucket returned by load balancer. + * + * Generated from protobuf field optional string actual_service = 440379652; + * @param string $var + * @return $this + */ + public function setActualService($var) + { + GPBUtil::checkString($var, True); + $this->actual_service = $var; + + return $this; + } + + /** + * The expected output URL evaluated by a load balancer containing the scheme, host, path and query parameters. + * + * Generated from protobuf field optional string expected_output_url = 433967384; + * @return string + */ + public function getExpectedOutputUrl() + { + return isset($this->expected_output_url) ? $this->expected_output_url : ''; + } + + public function hasExpectedOutputUrl() + { + return isset($this->expected_output_url); + } + + public function clearExpectedOutputUrl() + { + unset($this->expected_output_url); + } + + /** + * The expected output URL evaluated by a load balancer containing the scheme, host, path and query parameters. + * + * Generated from protobuf field optional string expected_output_url = 433967384; + * @param string $var + * @return $this + */ + public function setExpectedOutputUrl($var) + { + GPBUtil::checkString($var, True); + $this->expected_output_url = $var; + + return $this; + } + + /** + * Expected HTTP status code for rule with `urlRedirect` calculated by load balancer + * + * Generated from protobuf field optional int32 expected_redirect_response_code = 18888047; + * @return int + */ + public function getExpectedRedirectResponseCode() + { + return isset($this->expected_redirect_response_code) ? $this->expected_redirect_response_code : 0; + } + + public function hasExpectedRedirectResponseCode() + { + return isset($this->expected_redirect_response_code); + } + + public function clearExpectedRedirectResponseCode() + { + unset($this->expected_redirect_response_code); + } + + /** + * Expected HTTP status code for rule with `urlRedirect` calculated by load balancer + * + * Generated from protobuf field optional int32 expected_redirect_response_code = 18888047; + * @param int $var + * @return $this + */ + public function setExpectedRedirectResponseCode($var) + { + GPBUtil::checkInt32($var); + $this->expected_redirect_response_code = $var; + + return $this; + } + + /** + * Expected BackendService or BackendBucket resource the given URL should be mapped to. + * + * Generated from protobuf field optional string expected_service = 133987374; + * @return string + */ + public function getExpectedService() + { + return isset($this->expected_service) ? $this->expected_service : ''; + } + + public function hasExpectedService() + { + return isset($this->expected_service); + } + + public function clearExpectedService() + { + unset($this->expected_service); + } + + /** + * Expected BackendService or BackendBucket resource the given URL should be mapped to. + * + * Generated from protobuf field optional string expected_service = 133987374; + * @param string $var + * @return $this + */ + public function setExpectedService($var) + { + GPBUtil::checkString($var, True); + $this->expected_service = $var; + + return $this; + } + + /** + * HTTP headers of the request. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.UrlMapTestHeader headers = 258436998; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * HTTP headers of the request. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.UrlMapTestHeader headers = 258436998; + * @param array<\Google\Cloud\Compute\V1\UrlMapTestHeader>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\UrlMapTestHeader::class); + $this->headers = $arr; + + return $this; + } + + /** + * Host portion of the URL. + * + * Generated from protobuf field optional string host = 3208616; + * @return string + */ + public function getHost() + { + return isset($this->host) ? $this->host : ''; + } + + public function hasHost() + { + return isset($this->host); + } + + public function clearHost() + { + unset($this->host); + } + + /** + * Host portion of the URL. + * + * Generated from protobuf field optional string host = 3208616; + * @param string $var + * @return $this + */ + public function setHost($var) + { + GPBUtil::checkString($var, True); + $this->host = $var; + + return $this; + } + + /** + * Path portion including query parameters in the URL. + * + * Generated from protobuf field optional string path = 3433509; + * @return string + */ + public function getPath() + { + return isset($this->path) ? $this->path : ''; + } + + public function hasPath() + { + return isset($this->path); + } + + public function clearPath() + { + unset($this->path); + } + + /** + * Path portion including query parameters in the URL. + * + * Generated from protobuf field optional string path = 3433509; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsBackendBucketRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsBackendBucketRequest.php new file mode 100644 index 000000000000..abf4ee90ebbe --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsBackendBucketRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.TestIamPermissionsBackendBucketRequest + */ +class TestIamPermissionsBackendBucketRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsBackendBucketRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsBackendServiceRequest.php new file mode 100644 index 000000000000..202238f8a2b9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsBackendServiceRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.TestIamPermissionsBackendServiceRequest + */ +class TestIamPermissionsBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsDiskRequest.php new file mode 100644 index 000000000000..365682f2ae41 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsDiskRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.TestIamPermissionsDiskRequest + */ +class TestIamPermissionsDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsDiskRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for 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); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsExternalVpnGatewayRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsExternalVpnGatewayRequest.php new file mode 100644 index 000000000000..101781805ca7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsExternalVpnGatewayRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest + */ +class TestIamPermissionsExternalVpnGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsExternalVpnGatewayRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsFirewallPolicyRequest.php new file mode 100644 index 000000000000..2e3833946f35 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsFirewallPolicyRequest.php @@ -0,0 +1,126 @@ +google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest + */ +class TestIamPermissionsFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + + /** + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsImageRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsImageRequest.php new file mode 100644 index 000000000000..ad25a0fcfda3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsImageRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.TestIamPermissionsImageRequest + */ +class TestIamPermissionsImageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsImageRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsInstanceRequest.php new file mode 100644 index 000000000000..4f4b84205afe --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsInstanceRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.TestIamPermissionsInstanceRequest + */ +class TestIamPermissionsInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for 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); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsInstanceTemplateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsInstanceTemplateRequest.php new file mode 100644 index 000000000000..ab2b3e429d4b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsInstanceTemplateRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest + */ +class TestIamPermissionsInstanceTemplateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsInstanceTemplateRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsInstantSnapshotRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsInstantSnapshotRequest.php new file mode 100644 index 000000000000..b11f5604f6b2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsInstantSnapshotRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.TestIamPermissionsInstantSnapshotRequest + */ +class TestIamPermissionsInstantSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsInstantSnapshotRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for 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); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsLicenseCodeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsLicenseCodeRequest.php new file mode 100644 index 000000000000..786ab0f182dd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsLicenseCodeRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest + */ +class TestIamPermissionsLicenseCodeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsLicenseCodeRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsLicenseRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsLicenseRequest.php new file mode 100644 index 000000000000..d6edef1e9bd7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsLicenseRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.TestIamPermissionsLicenseRequest + */ +class TestIamPermissionsLicenseRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsLicenseRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsMachineImageRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsMachineImageRequest.php new file mode 100644 index 000000000000..39a441f57a9d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsMachineImageRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.TestIamPermissionsMachineImageRequest + */ +class TestIamPermissionsMachineImageRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsMachineImageRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsNetworkAttachmentRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsNetworkAttachmentRequest.php new file mode 100644 index 000000000000..2db7f09410bf --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsNetworkAttachmentRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.TestIamPermissionsNetworkAttachmentRequest + */ +class TestIamPermissionsNetworkAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsNetworkAttachmentRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsNetworkEndpointGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsNetworkEndpointGroupRequest.php new file mode 100644 index 000000000000..0cbf3bde605e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsNetworkEndpointGroupRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest + */ +class TestIamPermissionsNetworkEndpointGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsNetworkEndpointGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for 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); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..901c10caadf0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsNetworkFirewallPolicyRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.TestIamPermissionsNetworkFirewallPolicyRequest + */ +class TestIamPermissionsNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsNodeGroupRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsNodeGroupRequest.php new file mode 100644 index 000000000000..f22e04ef9eb6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsNodeGroupRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest + */ +class TestIamPermissionsNodeGroupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsNodeGroupRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for 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); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsNodeTemplateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsNodeTemplateRequest.php new file mode 100644 index 000000000000..b6bdd7de3940 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsNodeTemplateRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest + */ +class TestIamPermissionsNodeTemplateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsNodeTemplateRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsPacketMirroringRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsPacketMirroringRequest.php new file mode 100644 index 000000000000..e295fbae7d21 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsPacketMirroringRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest + */ +class TestIamPermissionsPacketMirroringRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsPacketMirroringRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsRegionBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsRegionBackendServiceRequest.php new file mode 100644 index 000000000000..548a040f5fb7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsRegionBackendServiceRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.TestIamPermissionsRegionBackendServiceRequest + */ +class TestIamPermissionsRegionBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsRegionBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsRegionDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsRegionDiskRequest.php new file mode 100644 index 000000000000..66638d14cfef --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsRegionDiskRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest + */ +class TestIamPermissionsRegionDiskRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsRegionDiskRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsRegionInstantSnapshotRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsRegionInstantSnapshotRequest.php new file mode 100644 index 000000000000..94884ab084c8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsRegionInstantSnapshotRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.TestIamPermissionsRegionInstantSnapshotRequest + */ +class TestIamPermissionsRegionInstantSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsRegionInstantSnapshotRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsRegionNetworkFirewallPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsRegionNetworkFirewallPolicyRequest.php new file mode 100644 index 000000000000..747366819c58 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsRegionNetworkFirewallPolicyRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.TestIamPermissionsRegionNetworkFirewallPolicyRequest + */ +class TestIamPermissionsRegionNetworkFirewallPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsRegionNetworkFirewallPolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsReservationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsReservationRequest.php new file mode 100644 index 000000000000..870676244051 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsReservationRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.TestIamPermissionsReservationRequest + */ +class TestIamPermissionsReservationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsReservationRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for 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); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsResourcePolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsResourcePolicyRequest.php new file mode 100644 index 000000000000..2df43854f341 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsResourcePolicyRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest + */ +class TestIamPermissionsResourcePolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsResourcePolicyRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsServiceAttachmentRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsServiceAttachmentRequest.php new file mode 100644 index 000000000000..35b9cbd9aa98 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsServiceAttachmentRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.TestIamPermissionsServiceAttachmentRequest + */ +class TestIamPermissionsServiceAttachmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsServiceAttachmentRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsSnapshotRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsSnapshotRequest.php new file mode 100644 index 000000000000..990c06c6c2ab --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsSnapshotRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.TestIamPermissionsSnapshotRequest + */ +class TestIamPermissionsSnapshotRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsSnapshotRequest + * + * @experimental + */ + public static function build(string $project, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsStoragePoolRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsStoragePoolRequest.php new file mode 100644 index 000000000000..6c491694ea69 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsStoragePoolRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.TestIamPermissionsStoragePoolRequest + */ +class TestIamPermissionsStoragePoolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsStoragePoolRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for 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); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + + /** + * The name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @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]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsSubnetworkRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsSubnetworkRequest.php new file mode 100644 index 000000000000..7a9d1ea613a8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsSubnetworkRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest + */ +class TestIamPermissionsSubnetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsSubnetworkRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsVpnGatewayRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsVpnGatewayRequest.php new file mode 100644 index 000000000000..5e3d18c43f14 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestIamPermissionsVpnGatewayRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest + */ +class TestIamPermissionsVpnGatewayRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * The name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $resource = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $test_permissions_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\TestIamPermissionsVpnGatewayRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $resource, \Google\Cloud\Compute\V1\TestPermissionsRequest $testPermissionsRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * The name of the region for this request. + * @type string $resource + * Name or id of the resource for this request. + * @type \Google\Cloud\Compute\V1\TestPermissionsRequest $test_permissions_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getResource() + { + return $this->resource; + } + + /** + * Name or id of the resource for this request. + * + * Generated from protobuf field string resource = 195806222 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkString($var, True); + $this->resource = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\TestPermissionsRequest|null + */ + public function getTestPermissionsRequestResource() + { + return $this->test_permissions_request_resource; + } + + public function hasTestPermissionsRequestResource() + { + return isset($this->test_permissions_request_resource); + } + + public function clearTestPermissionsRequestResource() + { + unset($this->test_permissions_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.TestPermissionsRequest test_permissions_request_resource = 439214758 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\TestPermissionsRequest $var + * @return $this + */ + public function setTestPermissionsRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\TestPermissionsRequest::class); + $this->test_permissions_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestPermissionsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestPermissionsRequest.php new file mode 100644 index 000000000000..34b53d9f6d43 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestPermissionsRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.TestPermissionsRequest + */ +class TestPermissionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. + * + * Generated from protobuf field repeated string permissions = 59962500; + */ + private $permissions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $permissions + * The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. + * + * Generated from protobuf field repeated string permissions = 59962500; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPermissions() + { + return $this->permissions; + } + + /** + * The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. + * + * Generated from protobuf field repeated string permissions = 59962500; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPermissions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->permissions = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestPermissionsResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestPermissionsResponse.php new file mode 100644 index 000000000000..0a2f4a8947a5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TestPermissionsResponse.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.TestPermissionsResponse + */ +class TestPermissionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is allowed. + * + * Generated from protobuf field repeated string permissions = 59962500; + */ + private $permissions; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $permissions + * A subset of `TestPermissionsRequest.permissions` that the caller is allowed. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is allowed. + * + * Generated from protobuf field repeated string permissions = 59962500; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPermissions() + { + return $this->permissions; + } + + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is allowed. + * + * Generated from protobuf field repeated string permissions = 59962500; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPermissions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->permissions = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Uint128.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Uint128.php new file mode 100644 index 000000000000..32ad57cbfe66 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Uint128.php @@ -0,0 +1,106 @@ +google.cloud.compute.v1.Uint128 + */ +class Uint128 extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional uint64 high = 3202466; + */ + protected $high = null; + /** + * Generated from protobuf field optional uint64 low = 107348; + */ + protected $low = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $high + * @type int|string $low + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional uint64 high = 3202466; + * @return int|string + */ + public function getHigh() + { + return isset($this->high) ? $this->high : 0; + } + + public function hasHigh() + { + return isset($this->high); + } + + public function clearHigh() + { + unset($this->high); + } + + /** + * Generated from protobuf field optional uint64 high = 3202466; + * @param int|string $var + * @return $this + */ + public function setHigh($var) + { + GPBUtil::checkUint64($var); + $this->high = $var; + + return $this; + } + + /** + * Generated from protobuf field optional uint64 low = 107348; + * @return int|string + */ + public function getLow() + { + return isset($this->low) ? $this->low : 0; + } + + public function hasLow() + { + return isset($this->low); + } + + public function clearLow() + { + unset($this->low); + } + + /** + * Generated from protobuf field optional uint64 low = 107348; + * @param int|string $var + * @return $this + */ + public function setLow($var) + { + GPBUtil::checkUint64($var); + $this->low = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpcomingMaintenance.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpcomingMaintenance.php new file mode 100644 index 000000000000..3b115b8aaf7d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpcomingMaintenance.php @@ -0,0 +1,305 @@ +google.cloud.compute.v1.UpcomingMaintenance + */ +class UpcomingMaintenance extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates if the maintenance can be customer triggered. + * + * Generated from protobuf field optional bool can_reschedule = 95981977; + */ + protected $can_reschedule = null; + /** + * The latest time for the planned maintenance window to start. This timestamp value is in RFC3339 text format. + * + * Generated from protobuf field optional string latest_window_start_time = 128032129; + */ + protected $latest_window_start_time = null; + /** + * + * Check the MaintenanceStatus enum for the list of possible values. + * + * Generated from protobuf field optional string maintenance_status = 81645214; + */ + protected $maintenance_status = null; + /** + * Defines the type of maintenance. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + /** + * The time by which the maintenance disruption will be completed. This timestamp value is in RFC3339 text format. + * + * Generated from protobuf field optional string window_end_time = 271816480; + */ + protected $window_end_time = null; + /** + * The current start time of the maintenance window. This timestamp value is in RFC3339 text format. + * + * Generated from protobuf field optional string window_start_time = 473061433; + */ + protected $window_start_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $can_reschedule + * Indicates if the maintenance can be customer triggered. + * @type string $latest_window_start_time + * The latest time for the planned maintenance window to start. This timestamp value is in RFC3339 text format. + * @type string $maintenance_status + * + * Check the MaintenanceStatus enum for the list of possible values. + * @type string $type + * Defines the type of maintenance. + * Check the Type enum for the list of possible values. + * @type string $window_end_time + * The time by which the maintenance disruption will be completed. This timestamp value is in RFC3339 text format. + * @type string $window_start_time + * The current start time of the maintenance window. This timestamp value is in RFC3339 text format. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Indicates if the maintenance can be customer triggered. + * + * Generated from protobuf field optional bool can_reschedule = 95981977; + * @return bool + */ + public function getCanReschedule() + { + return isset($this->can_reschedule) ? $this->can_reschedule : false; + } + + public function hasCanReschedule() + { + return isset($this->can_reschedule); + } + + public function clearCanReschedule() + { + unset($this->can_reschedule); + } + + /** + * Indicates if the maintenance can be customer triggered. + * + * Generated from protobuf field optional bool can_reschedule = 95981977; + * @param bool $var + * @return $this + */ + public function setCanReschedule($var) + { + GPBUtil::checkBool($var); + $this->can_reschedule = $var; + + return $this; + } + + /** + * The latest time for the planned maintenance window to start. This timestamp value is in RFC3339 text format. + * + * Generated from protobuf field optional string latest_window_start_time = 128032129; + * @return string + */ + public function getLatestWindowStartTime() + { + return isset($this->latest_window_start_time) ? $this->latest_window_start_time : ''; + } + + public function hasLatestWindowStartTime() + { + return isset($this->latest_window_start_time); + } + + public function clearLatestWindowStartTime() + { + unset($this->latest_window_start_time); + } + + /** + * The latest time for the planned maintenance window to start. This timestamp value is in RFC3339 text format. + * + * Generated from protobuf field optional string latest_window_start_time = 128032129; + * @param string $var + * @return $this + */ + public function setLatestWindowStartTime($var) + { + GPBUtil::checkString($var, True); + $this->latest_window_start_time = $var; + + return $this; + } + + /** + * + * Check the MaintenanceStatus enum for the list of possible values. + * + * Generated from protobuf field optional string maintenance_status = 81645214; + * @return string + */ + public function getMaintenanceStatus() + { + return isset($this->maintenance_status) ? $this->maintenance_status : ''; + } + + public function hasMaintenanceStatus() + { + return isset($this->maintenance_status); + } + + public function clearMaintenanceStatus() + { + unset($this->maintenance_status); + } + + /** + * + * Check the MaintenanceStatus enum for the list of possible values. + * + * Generated from protobuf field optional string maintenance_status = 81645214; + * @param string $var + * @return $this + */ + public function setMaintenanceStatus($var) + { + GPBUtil::checkString($var, True); + $this->maintenance_status = $var; + + return $this; + } + + /** + * Defines the type of maintenance. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * Defines the type of maintenance. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * The time by which the maintenance disruption will be completed. This timestamp value is in RFC3339 text format. + * + * Generated from protobuf field optional string window_end_time = 271816480; + * @return string + */ + public function getWindowEndTime() + { + return isset($this->window_end_time) ? $this->window_end_time : ''; + } + + public function hasWindowEndTime() + { + return isset($this->window_end_time); + } + + public function clearWindowEndTime() + { + unset($this->window_end_time); + } + + /** + * The time by which the maintenance disruption will be completed. This timestamp value is in RFC3339 text format. + * + * Generated from protobuf field optional string window_end_time = 271816480; + * @param string $var + * @return $this + */ + public function setWindowEndTime($var) + { + GPBUtil::checkString($var, True); + $this->window_end_time = $var; + + return $this; + } + + /** + * The current start time of the maintenance window. This timestamp value is in RFC3339 text format. + * + * Generated from protobuf field optional string window_start_time = 473061433; + * @return string + */ + public function getWindowStartTime() + { + return isset($this->window_start_time) ? $this->window_start_time : ''; + } + + public function hasWindowStartTime() + { + return isset($this->window_start_time); + } + + public function clearWindowStartTime() + { + unset($this->window_start_time); + } + + /** + * The current start time of the maintenance window. This timestamp value is in RFC3339 text format. + * + * Generated from protobuf field optional string window_start_time = 473061433; + * @param string $var + * @return $this + */ + public function setWindowStartTime($var) + { + GPBUtil::checkString($var, True); + $this->window_start_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpcomingMaintenance/MaintenanceStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpcomingMaintenance/MaintenanceStatus.php new file mode 100644 index 000000000000..05875d3beb5c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpcomingMaintenance/MaintenanceStatus.php @@ -0,0 +1,70 @@ +google.cloud.compute.v1.UpcomingMaintenance.MaintenanceStatus + */ +class MaintenanceStatus +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MAINTENANCE_STATUS = 0; + */ + const UNDEFINED_MAINTENANCE_STATUS = 0; + /** + * There is ongoing maintenance on this VM. + * + * Generated from protobuf enum ONGOING = 473158491; + */ + const ONGOING = 473158491; + /** + * There is pending maintenance. + * + * Generated from protobuf enum PENDING = 35394935; + */ + const PENDING = 35394935; + /** + * Unknown maintenance status. Do not use this value. + * + * Generated from protobuf enum UNKNOWN = 433141802; + */ + const UNKNOWN = 433141802; + + private static $valueToName = [ + self::UNDEFINED_MAINTENANCE_STATUS => 'UNDEFINED_MAINTENANCE_STATUS', + self::ONGOING => 'ONGOING', + self::PENDING => 'PENDING', + self::UNKNOWN => 'UNKNOWN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MaintenanceStatus::class, \Google\Cloud\Compute\V1\UpcomingMaintenance_MaintenanceStatus::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpcomingMaintenance/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpcomingMaintenance/Type.php new file mode 100644 index 000000000000..66fcd28c6807 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpcomingMaintenance/Type.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.UpcomingMaintenance.Type + */ +class Type +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TYPE = 0; + */ + const UNDEFINED_TYPE = 0; + /** + * Scheduled maintenance (e.g. maintenance after uptime guarantee is complete). + * + * Generated from protobuf enum SCHEDULED = 478400653; + */ + const SCHEDULED = 478400653; + /** + * No type specified. Do not use this value. + * + * Generated from protobuf enum UNKNOWN_TYPE = 490705455; + */ + const UNKNOWN_TYPE = 490705455; + /** + * Unscheduled maintenance (e.g. emergency maintenance during uptime guarantee). + * + * Generated from protobuf enum UNSCHEDULED = 450077204; + */ + const UNSCHEDULED = 450077204; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::SCHEDULED => 'SCHEDULED', + self::UNKNOWN_TYPE => 'UNKNOWN_TYPE', + self::UNSCHEDULED => 'UNSCHEDULED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Compute\V1\UpcomingMaintenance_Type::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateAccessConfigInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateAccessConfigInstanceRequest.php new file mode 100644 index 000000000000..bd939c973d6d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateAccessConfigInstanceRequest.php @@ -0,0 +1,278 @@ +google.cloud.compute.v1.UpdateAccessConfigInstanceRequest + */ +class UpdateAccessConfigInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.AccessConfig access_config_resource = 387825552 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $access_config_resource = null; + /** + * The instance name for this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * The name of the network interface where the access config is attached. + * + * Generated from protobuf field string network_interface = 365387880 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_interface = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance The instance name for this request. + * @param string $networkInterface The name of the network interface where the access config is attached. + * @param \Google\Cloud\Compute\V1\AccessConfig $accessConfigResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdateAccessConfigInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, string $networkInterface, \Google\Cloud\Compute\V1\AccessConfig $accessConfigResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setAccessConfigResource($accessConfigResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\AccessConfig $access_config_resource + * The body resource for this request + * @type string $instance + * The instance name for this request. + * @type string $network_interface + * The name of the network interface where the access config is attached. + * @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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.AccessConfig access_config_resource = 387825552 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\AccessConfig|null + */ + public function getAccessConfigResource() + { + return $this->access_config_resource; + } + + public function hasAccessConfigResource() + { + return isset($this->access_config_resource); + } + + public function clearAccessConfigResource() + { + unset($this->access_config_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.AccessConfig access_config_resource = 387825552 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\AccessConfig $var + * @return $this + */ + public function setAccessConfigResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\AccessConfig::class); + $this->access_config_resource = $var; + + return $this; + } + + /** + * 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 name of the network interface where the access config is attached. + * + * Generated from protobuf field string network_interface = 365387880 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkInterface() + { + return $this->network_interface; + } + + /** + * The name of the network interface where the access config is attached. + * + * Generated from protobuf field string network_interface = 365387880 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkInterface($var) + { + GPBUtil::checkString($var, True); + $this->network_interface = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateAutoscalerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateAutoscalerRequest.php new file mode 100644 index 000000000000..210313c03dee --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateAutoscalerRequest.php @@ -0,0 +1,250 @@ +google.cloud.compute.v1.UpdateAutoscalerRequest + */ +class UpdateAutoscalerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the autoscaler to update. + * + * Generated from protobuf field optional string autoscaler = 517258967; + */ + protected $autoscaler = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Autoscaler autoscaler_resource = 207616118 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $autoscaler_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * 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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone for this request. + * @param \Google\Cloud\Compute\V1\Autoscaler $autoscalerResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdateAutoscalerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, \Google\Cloud\Compute\V1\Autoscaler $autoscalerResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setAutoscalerResource($autoscalerResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $autoscaler + * Name of the autoscaler to update. + * @type \Google\Cloud\Compute\V1\Autoscaler $autoscaler_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 + * Name of the zone for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the autoscaler to update. + * + * Generated from protobuf field optional string autoscaler = 517258967; + * @return string + */ + public function getAutoscaler() + { + return isset($this->autoscaler) ? $this->autoscaler : ''; + } + + public function hasAutoscaler() + { + return isset($this->autoscaler); + } + + public function clearAutoscaler() + { + unset($this->autoscaler); + } + + /** + * Name of the autoscaler to update. + * + * Generated from protobuf field optional string autoscaler = 517258967; + * @param string $var + * @return $this + */ + public function setAutoscaler($var) + { + GPBUtil::checkString($var, True); + $this->autoscaler = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Autoscaler autoscaler_resource = 207616118 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Autoscaler|null + */ + public function getAutoscalerResource() + { + return $this->autoscaler_resource; + } + + public function hasAutoscalerResource() + { + return isset($this->autoscaler_resource); + } + + public function clearAutoscalerResource() + { + unset($this->autoscaler_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Autoscaler autoscaler_resource = 207616118 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Autoscaler $var + * @return $this + */ + public function setAutoscalerResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Autoscaler::class); + $this->autoscaler_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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateBackendBucketRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateBackendBucketRequest.php new file mode 100644 index 000000000000..43b3854f2055 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateBackendBucketRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.UpdateBackendBucketRequest + */ +class UpdateBackendBucketRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the BackendBucket resource to update. + * + * Generated from protobuf field string backend_bucket = 91714037 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_bucket = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendBucket backend_bucket_resource = 380757784 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_bucket_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $backendBucket Name of the BackendBucket resource to update. + * @param \Google\Cloud\Compute\V1\BackendBucket $backendBucketResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdateBackendBucketRequest + * + * @experimental + */ + public static function build(string $project, string $backendBucket, \Google\Cloud\Compute\V1\BackendBucket $backendBucketResource): self + { + return (new self()) + ->setProject($project) + ->setBackendBucket($backendBucket) + ->setBackendBucketResource($backendBucketResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_bucket + * Name of the BackendBucket resource to update. + * @type \Google\Cloud\Compute\V1\BackendBucket $backend_bucket_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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the BackendBucket resource to update. + * + * Generated from protobuf field string backend_bucket = 91714037 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackendBucket() + { + return $this->backend_bucket; + } + + /** + * Name of the BackendBucket resource to update. + * + * Generated from protobuf field string backend_bucket = 91714037 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackendBucket($var) + { + GPBUtil::checkString($var, True); + $this->backend_bucket = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendBucket backend_bucket_resource = 380757784 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\BackendBucket|null + */ + public function getBackendBucketResource() + { + return $this->backend_bucket_resource; + } + + public function hasBackendBucketResource() + { + return isset($this->backend_bucket_resource); + } + + public function clearBackendBucketResource() + { + unset($this->backend_bucket_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendBucket backend_bucket_resource = 380757784 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\BackendBucket $var + * @return $this + */ + public function setBackendBucketResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BackendBucket::class); + $this->backend_bucket_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateBackendServiceRequest.php new file mode 100644 index 000000000000..9da260ec5e39 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateBackendServiceRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.UpdateBackendServiceRequest + */ +class UpdateBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the BackendService resource to update. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_service = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendService backend_service_resource = 347586723 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_service_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $backendService Name of the BackendService resource to update. + * @param \Google\Cloud\Compute\V1\BackendService $backendServiceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdateBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, string $backendService, \Google\Cloud\Compute\V1\BackendService $backendServiceResource): self + { + return (new self()) + ->setProject($project) + ->setBackendService($backendService) + ->setBackendServiceResource($backendServiceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_service + * Name of the BackendService resource to update. + * @type \Google\Cloud\Compute\V1\BackendService $backend_service_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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the BackendService resource to update. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackendService() + { + return $this->backend_service; + } + + /** + * Name of the BackendService resource to update. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackendService($var) + { + GPBUtil::checkString($var, True); + $this->backend_service = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendService backend_service_resource = 347586723 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\BackendService|null + */ + public function getBackendServiceResource() + { + return $this->backend_service_resource; + } + + public function hasBackendServiceResource() + { + return isset($this->backend_service_resource); + } + + public function clearBackendServiceResource() + { + unset($this->backend_service_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendService backend_service_resource = 347586723 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\BackendService $var + * @return $this + */ + public function setBackendServiceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BackendService::class); + $this->backend_service_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateDiskRequest.php new file mode 100644 index 000000000000..559b1a1d9744 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateDiskRequest.php @@ -0,0 +1,323 @@ +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]; + */ + protected $disk = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Disk disk_resource = 25880688 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk_resource = null; + /** + * Generated from protobuf field optional string paths = 106438894; + */ + protected $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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * update_mask indicates fields to be updated as part of this request. + * + * Generated from protobuf field optional string update_mask = 500079778; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $disk The disk name for this request. + * @param \Google\Cloud\Compute\V1\Disk $diskResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdateDiskRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $disk, \Google\Cloud\Compute\V1\Disk $diskResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setDisk($disk) + ->setDiskResource($diskResource); + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateDisplayDeviceInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateDisplayDeviceInstanceRequest.php new file mode 100644 index 000000000000..bdd447d9d017 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateDisplayDeviceInstanceRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest + */ +class UpdateDisplayDeviceInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.DisplayDevice display_device_resource = 289686106 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $display_device_resource = null; + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance scoping this request. + * @param \Google\Cloud\Compute\V1\DisplayDevice $displayDeviceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdateDisplayDeviceInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, \Google\Cloud\Compute\V1\DisplayDevice $displayDeviceResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setDisplayDeviceResource($displayDeviceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\DisplayDevice $display_device_resource + * The body resource for this request + * @type string $instance + * Name of the instance scoping 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.DisplayDevice display_device_resource = 289686106 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\DisplayDevice|null + */ + public function getDisplayDeviceResource() + { + return $this->display_device_resource; + } + + public function hasDisplayDeviceResource() + { + return isset($this->display_device_resource); + } + + public function clearDisplayDeviceResource() + { + unset($this->display_device_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.DisplayDevice display_device_resource = 289686106 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\DisplayDevice $var + * @return $this + */ + public function setDisplayDeviceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DisplayDevice::class); + $this->display_device_resource = $var; + + return $this; + } + + /** + * Name of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance scoping 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateFirewallRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateFirewallRequest.php new file mode 100644 index 000000000000..56ec1a01c119 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateFirewallRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.UpdateFirewallRequest + */ +class UpdateFirewallRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the firewall rule to update. + * + * Generated from protobuf field string firewall = 511016192 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Firewall firewall_resource = 41425005 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $firewall_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $firewall Name of the firewall rule to update. + * @param \Google\Cloud\Compute\V1\Firewall $firewallResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdateFirewallRequest + * + * @experimental + */ + public static function build(string $project, string $firewall, \Google\Cloud\Compute\V1\Firewall $firewallResource): self + { + return (new self()) + ->setProject($project) + ->setFirewall($firewall) + ->setFirewallResource($firewallResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $firewall + * Name of the firewall rule to update. + * @type \Google\Cloud\Compute\V1\Firewall $firewall_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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the firewall rule to update. + * + * Generated from protobuf field string firewall = 511016192 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getFirewall() + { + return $this->firewall; + } + + /** + * Name of the firewall rule to update. + * + * Generated from protobuf field string firewall = 511016192 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setFirewall($var) + { + GPBUtil::checkString($var, True); + $this->firewall = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Firewall firewall_resource = 41425005 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Firewall|null + */ + public function getFirewallResource() + { + return $this->firewall_resource; + } + + public function hasFirewallResource() + { + return isset($this->firewall_resource); + } + + public function clearFirewallResource() + { + unset($this->firewall_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Firewall firewall_resource = 41425005 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Firewall $var + * @return $this + */ + public function setFirewallResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Firewall::class); + $this->firewall_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateHealthCheckRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateHealthCheckRequest.php new file mode 100644 index 000000000000..0df7d03caeaa --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateHealthCheckRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.UpdateHealthCheckRequest + */ +class UpdateHealthCheckRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the HealthCheck resource to update. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $health_check = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.HealthCheck health_check_resource = 201925032 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $health_check_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $healthCheck Name of the HealthCheck resource to update. + * @param \Google\Cloud\Compute\V1\HealthCheck $healthCheckResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdateHealthCheckRequest + * + * @experimental + */ + public static function build(string $project, string $healthCheck, \Google\Cloud\Compute\V1\HealthCheck $healthCheckResource): self + { + return (new self()) + ->setProject($project) + ->setHealthCheck($healthCheck) + ->setHealthCheckResource($healthCheckResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $health_check + * Name of the HealthCheck resource to update. + * @type \Google\Cloud\Compute\V1\HealthCheck $health_check_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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the HealthCheck resource to update. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getHealthCheck() + { + return $this->health_check; + } + + /** + * Name of the HealthCheck resource to update. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setHealthCheck($var) + { + GPBUtil::checkString($var, True); + $this->health_check = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.HealthCheck health_check_resource = 201925032 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\HealthCheck|null + */ + public function getHealthCheckResource() + { + return $this->health_check_resource; + } + + public function hasHealthCheckResource() + { + return isset($this->health_check_resource); + } + + public function clearHealthCheckResource() + { + unset($this->health_check_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.HealthCheck health_check_resource = 201925032 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\HealthCheck $var + * @return $this + */ + public function setHealthCheckResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HealthCheck::class); + $this->health_check_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateInstanceRequest.php new file mode 100644 index 000000000000..221abb38998e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateInstanceRequest.php @@ -0,0 +1,338 @@ +google.cloud.compute.v1.UpdateInstanceRequest + */ +class UpdateInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the instance resource to update. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Instance instance_resource = 215988344 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_resource = null; + /** + * Specifies the action to take when updating an instance even if the updated properties do not require it. If not specified, then Compute Engine acts based on the minimum action that the updated properties require. + * Check the MinimalAction enum for the list of possible values. + * + * Generated from protobuf field optional string minimal_action = 270567060; + */ + protected $minimal_action = null; + /** + * Specifies the most disruptive action that can be taken on the instance as part of the update. Compute Engine returns an error if the instance properties require a more disruptive action as part of the instance update. Valid options from lowest to highest are NO_EFFECT, REFRESH, and RESTART. + * Check the MostDisruptiveAllowedAction enum for the list of possible values. + * + * Generated from protobuf field optional string most_disruptive_allowed_action = 66103053; + */ + protected $most_disruptive_allowed_action = null; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name of the instance resource to update. + * @param \Google\Cloud\Compute\V1\Instance $instanceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdateInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, \Google\Cloud\Compute\V1\Instance $instanceResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setInstanceResource($instanceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name of the instance resource to update. + * @type \Google\Cloud\Compute\V1\Instance $instance_resource + * The body resource for this request + * @type string $minimal_action + * Specifies the action to take when updating an instance even if the updated properties do not require it. If not specified, then Compute Engine acts based on the minimum action that the updated properties require. + * Check the MinimalAction enum for the list of possible values. + * @type string $most_disruptive_allowed_action + * Specifies the most disruptive action that can be taken on the instance as part of the update. Compute Engine returns an error if the instance properties require a more disruptive action as part of the instance update. Valid options from lowest to highest are NO_EFFECT, REFRESH, and RESTART. + * Check the MostDisruptiveAllowedAction enum for the list of possible values. + * @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); + } + + /** + * Name of the instance resource to update. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name of the instance resource to update. + * + * 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.Instance instance_resource = 215988344 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Instance|null + */ + public function getInstanceResource() + { + return $this->instance_resource; + } + + public function hasInstanceResource() + { + return isset($this->instance_resource); + } + + public function clearInstanceResource() + { + unset($this->instance_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Instance instance_resource = 215988344 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Instance $var + * @return $this + */ + public function setInstanceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Instance::class); + $this->instance_resource = $var; + + return $this; + } + + /** + * Specifies the action to take when updating an instance even if the updated properties do not require it. If not specified, then Compute Engine acts based on the minimum action that the updated properties require. + * Check the MinimalAction enum for the list of possible values. + * + * Generated from protobuf field optional string minimal_action = 270567060; + * @return string + */ + public function getMinimalAction() + { + return isset($this->minimal_action) ? $this->minimal_action : ''; + } + + public function hasMinimalAction() + { + return isset($this->minimal_action); + } + + public function clearMinimalAction() + { + unset($this->minimal_action); + } + + /** + * Specifies the action to take when updating an instance even if the updated properties do not require it. If not specified, then Compute Engine acts based on the minimum action that the updated properties require. + * Check the MinimalAction enum for the list of possible values. + * + * Generated from protobuf field optional string minimal_action = 270567060; + * @param string $var + * @return $this + */ + public function setMinimalAction($var) + { + GPBUtil::checkString($var, True); + $this->minimal_action = $var; + + return $this; + } + + /** + * Specifies the most disruptive action that can be taken on the instance as part of the update. Compute Engine returns an error if the instance properties require a more disruptive action as part of the instance update. Valid options from lowest to highest are NO_EFFECT, REFRESH, and RESTART. + * Check the MostDisruptiveAllowedAction enum for the list of possible values. + * + * Generated from protobuf field optional string most_disruptive_allowed_action = 66103053; + * @return string + */ + public function getMostDisruptiveAllowedAction() + { + return isset($this->most_disruptive_allowed_action) ? $this->most_disruptive_allowed_action : ''; + } + + public function hasMostDisruptiveAllowedAction() + { + return isset($this->most_disruptive_allowed_action); + } + + public function clearMostDisruptiveAllowedAction() + { + unset($this->most_disruptive_allowed_action); + } + + /** + * Specifies the most disruptive action that can be taken on the instance as part of the update. Compute Engine returns an error if the instance properties require a more disruptive action as part of the instance update. Valid options from lowest to highest are NO_EFFECT, REFRESH, and RESTART. + * Check the MostDisruptiveAllowedAction enum for the list of possible values. + * + * Generated from protobuf field optional string most_disruptive_allowed_action = 66103053; + * @param string $var + * @return $this + */ + public function setMostDisruptiveAllowedAction($var) + { + GPBUtil::checkString($var, True); + $this->most_disruptive_allowed_action = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateInstanceRequest/MinimalAction.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateInstanceRequest/MinimalAction.php new file mode 100644 index 000000000000..c9cbfb5f01a4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateInstanceRequest/MinimalAction.php @@ -0,0 +1,55 @@ +google.cloud.compute.v1.UpdateInstanceRequest.MinimalAction + */ +class MinimalAction +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MINIMAL_ACTION = 0; + */ + const UNDEFINED_MINIMAL_ACTION = 0; + + private static $valueToName = [ + self::UNDEFINED_MINIMAL_ACTION => 'UNDEFINED_MINIMAL_ACTION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MinimalAction::class, \Google\Cloud\Compute\V1\UpdateInstanceRequest_MinimalAction::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateInstanceRequest/MostDisruptiveAllowedAction.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateInstanceRequest/MostDisruptiveAllowedAction.php new file mode 100644 index 000000000000..362a3702c6c3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateInstanceRequest/MostDisruptiveAllowedAction.php @@ -0,0 +1,55 @@ +google.cloud.compute.v1.UpdateInstanceRequest.MostDisruptiveAllowedAction + */ +class MostDisruptiveAllowedAction +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MOST_DISRUPTIVE_ALLOWED_ACTION = 0; + */ + const UNDEFINED_MOST_DISRUPTIVE_ALLOWED_ACTION = 0; + + private static $valueToName = [ + self::UNDEFINED_MOST_DISRUPTIVE_ALLOWED_ACTION => 'UNDEFINED_MOST_DISRUPTIVE_ALLOWED_ACTION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MostDisruptiveAllowedAction::class, \Google\Cloud\Compute\V1\UpdateInstanceRequest_MostDisruptiveAllowedAction::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateNetworkInterfaceInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateNetworkInterfaceInstanceRequest.php new file mode 100644 index 000000000000..8273eb8168e7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateNetworkInterfaceInstanceRequest.php @@ -0,0 +1,278 @@ +google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest + */ +class UpdateNetworkInterfaceInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The instance name for this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * The name of the network interface to update. + * + * Generated from protobuf field string network_interface = 365387880 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_interface = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkInterface network_interface_resource = 325814789 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_interface_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"]; + */ + protected $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; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance The instance name for this request. + * @param string $networkInterface The name of the network interface to update. + * @param \Google\Cloud\Compute\V1\NetworkInterface $networkInterfaceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdateNetworkInterfaceInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, string $networkInterface, \Google\Cloud\Compute\V1\NetworkInterface $networkInterfaceResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setNetworkInterfaceResource($networkInterfaceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * The instance name for this request. + * @type string $network_interface + * The name of the network interface to update. + * @type \Google\Cloud\Compute\V1\NetworkInterface $network_interface_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 name of the network interface to update. + * + * Generated from protobuf field string network_interface = 365387880 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkInterface() + { + return $this->network_interface; + } + + /** + * The name of the network interface to update. + * + * Generated from protobuf field string network_interface = 365387880 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkInterface($var) + { + GPBUtil::checkString($var, True); + $this->network_interface = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkInterface network_interface_resource = 325814789 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NetworkInterface|null + */ + public function getNetworkInterfaceResource() + { + return $this->network_interface_resource; + } + + public function hasNetworkInterfaceResource() + { + return isset($this->network_interface_resource); + } + + public function clearNetworkInterfaceResource() + { + unset($this->network_interface_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworkInterface network_interface_resource = 325814789 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NetworkInterface $var + * @return $this + */ + public function setNetworkInterfaceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkInterface::class); + $this->network_interface_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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdatePeeringNetworkRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdatePeeringNetworkRequest.php new file mode 100644 index 000000000000..9e620c392d0d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdatePeeringNetworkRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.UpdatePeeringNetworkRequest + */ +class UpdatePeeringNetworkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the network resource which the updated peering is belonging to. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworksUpdatePeeringRequest networks_update_peering_request_resource = 224433497 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $networks_update_peering_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"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $network Name of the network resource which the updated peering is belonging to. + * @param \Google\Cloud\Compute\V1\NetworksUpdatePeeringRequest $networksUpdatePeeringRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdatePeeringNetworkRequest + * + * @experimental + */ + public static function build(string $project, string $network, \Google\Cloud\Compute\V1\NetworksUpdatePeeringRequest $networksUpdatePeeringRequestResource): self + { + return (new self()) + ->setProject($project) + ->setNetwork($network) + ->setNetworksUpdatePeeringRequestResource($networksUpdatePeeringRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network + * Name of the network resource which the updated peering is belonging to. + * @type \Google\Cloud\Compute\V1\NetworksUpdatePeeringRequest $networks_update_peering_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). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the network resource which the updated peering is belonging to. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetwork() + { + return $this->network; + } + + /** + * Name of the network resource which the updated peering is belonging to. + * + * Generated from protobuf field string network = 232872494 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworksUpdatePeeringRequest networks_update_peering_request_resource = 224433497 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\NetworksUpdatePeeringRequest|null + */ + public function getNetworksUpdatePeeringRequestResource() + { + return $this->networks_update_peering_request_resource; + } + + public function hasNetworksUpdatePeeringRequestResource() + { + return isset($this->networks_update_peering_request_resource); + } + + public function clearNetworksUpdatePeeringRequestResource() + { + unset($this->networks_update_peering_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.NetworksUpdatePeeringRequest networks_update_peering_request_resource = 224433497 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\NetworksUpdatePeeringRequest $var + * @return $this + */ + public function setNetworksUpdatePeeringRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworksUpdatePeeringRequest::class); + $this->networks_update_peering_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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdatePerInstanceConfigsInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdatePerInstanceConfigsInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..4f7848426f2f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdatePerInstanceConfigsInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest + */ +class UpdatePerInstanceConfigsInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq instance_group_managers_update_per_instance_configs_req_resource = 141402302 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_managers_update_per_instance_configs_req_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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "zone"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @param string $instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersUpdatePerInstanceConfigsReq $instanceGroupManagersUpdatePerInstanceConfigsReqResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdatePerInstanceConfigsInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager, \Google\Cloud\Compute\V1\InstanceGroupManagersUpdatePerInstanceConfigsReq $instanceGroupManagersUpdatePerInstanceConfigsReqResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersUpdatePerInstanceConfigsReqResource($instanceGroupManagersUpdatePerInstanceConfigsReqResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group. It should conform to RFC1035. + * @type \Google\Cloud\Compute\V1\InstanceGroupManagersUpdatePerInstanceConfigsReq $instance_group_managers_update_per_instance_configs_req_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 where the managed instance group is located. It should conform to RFC1035. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq instance_group_managers_update_per_instance_configs_req_resource = 141402302 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagersUpdatePerInstanceConfigsReq|null + */ + public function getInstanceGroupManagersUpdatePerInstanceConfigsReqResource() + { + return $this->instance_group_managers_update_per_instance_configs_req_resource; + } + + public function hasInstanceGroupManagersUpdatePerInstanceConfigsReqResource() + { + return isset($this->instance_group_managers_update_per_instance_configs_req_resource); + } + + public function clearInstanceGroupManagersUpdatePerInstanceConfigsReqResource() + { + unset($this->instance_group_managers_update_per_instance_configs_req_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq instance_group_managers_update_per_instance_configs_req_resource = 141402302 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersUpdatePerInstanceConfigsReq $var + * @return $this + */ + public function setInstanceGroupManagersUpdatePerInstanceConfigsReqResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagersUpdatePerInstanceConfigsReq::class); + $this->instance_group_managers_update_per_instance_configs_req_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 where the managed instance group is located. It should conform to RFC1035. + * + * 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 where the managed instance group is located. It should conform to RFC1035. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..eaf2d9607f06 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + */ +class UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_manager = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request, should conform to RFC1035. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq region_instance_group_manager_update_instance_config_req_resource = 89036583 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_instance_group_manager_update_instance_config_req_resource = null; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request, should conform to RFC1035. + * @param string $instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagerUpdateInstanceConfigReq $regionInstanceGroupManagerUpdateInstanceConfigReqResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroupManager, \Google\Cloud\Compute\V1\RegionInstanceGroupManagerUpdateInstanceConfigReq $regionInstanceGroupManagerUpdateInstanceConfigReqResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroupManager($instanceGroupManager) + ->setRegionInstanceGroupManagerUpdateInstanceConfigReqResource($regionInstanceGroupManagerUpdateInstanceConfigReqResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_group_manager + * The name of the managed instance group. It should conform to RFC1035. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request, should conform to RFC1035. + * @type \Google\Cloud\Compute\V1\RegionInstanceGroupManagerUpdateInstanceConfigReq $region_instance_group_manager_update_instance_config_req_resource + * The body resource 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 managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstanceGroupManager() + { + return $this->instance_group_manager; + } + + /** + * The name of the managed instance group. It should conform to RFC1035. + * + * Generated from protobuf field string instance_group_manager = 249363395 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInstanceGroupManager($var) + { + GPBUtil::checkString($var, True); + $this->instance_group_manager = $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; + } + + /** + * Name of the region scoping this request, should conform to RFC1035. + * + * 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; + } + + /** + * Name of the region scoping this request, should conform to RFC1035. + * + * 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq region_instance_group_manager_update_instance_config_req_resource = 89036583 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionInstanceGroupManagerUpdateInstanceConfigReq|null + */ + public function getRegionInstanceGroupManagerUpdateInstanceConfigReqResource() + { + return $this->region_instance_group_manager_update_instance_config_req_resource; + } + + public function hasRegionInstanceGroupManagerUpdateInstanceConfigReqResource() + { + return isset($this->region_instance_group_manager_update_instance_config_req_resource); + } + + public function clearRegionInstanceGroupManagerUpdateInstanceConfigReqResource() + { + unset($this->region_instance_group_manager_update_instance_config_req_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq region_instance_group_manager_update_instance_config_req_resource = 89036583 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagerUpdateInstanceConfigReq $var + * @return $this + */ + public function setRegionInstanceGroupManagerUpdateInstanceConfigReqResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionInstanceGroupManagerUpdateInstanceConfigReq::class); + $this->region_instance_group_manager_update_instance_config_req_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionAutoscalerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionAutoscalerRequest.php new file mode 100644 index 000000000000..a63ada6268f7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionAutoscalerRequest.php @@ -0,0 +1,250 @@ +google.cloud.compute.v1.UpdateRegionAutoscalerRequest + */ +class UpdateRegionAutoscalerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the autoscaler to update. + * + * Generated from protobuf field optional string autoscaler = 517258967; + */ + protected $autoscaler = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Autoscaler autoscaler_resource = 207616118 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $autoscaler_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"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param \Google\Cloud\Compute\V1\Autoscaler $autoscalerResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdateRegionAutoscalerRequest + * + * @experimental + */ + public static function build(string $project, string $region, \Google\Cloud\Compute\V1\Autoscaler $autoscalerResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setAutoscalerResource($autoscalerResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $autoscaler + * Name of the autoscaler to update. + * @type \Google\Cloud\Compute\V1\Autoscaler $autoscaler_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the autoscaler to update. + * + * Generated from protobuf field optional string autoscaler = 517258967; + * @return string + */ + public function getAutoscaler() + { + return isset($this->autoscaler) ? $this->autoscaler : ''; + } + + public function hasAutoscaler() + { + return isset($this->autoscaler); + } + + public function clearAutoscaler() + { + unset($this->autoscaler); + } + + /** + * Name of the autoscaler to update. + * + * Generated from protobuf field optional string autoscaler = 517258967; + * @param string $var + * @return $this + */ + public function setAutoscaler($var) + { + GPBUtil::checkString($var, True); + $this->autoscaler = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Autoscaler autoscaler_resource = 207616118 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Autoscaler|null + */ + public function getAutoscalerResource() + { + return $this->autoscaler_resource; + } + + public function hasAutoscalerResource() + { + return isset($this->autoscaler_resource); + } + + public function clearAutoscalerResource() + { + unset($this->autoscaler_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Autoscaler autoscaler_resource = 207616118 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Autoscaler $var + * @return $this + */ + public function setAutoscalerResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Autoscaler::class); + $this->autoscaler_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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionBackendServiceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionBackendServiceRequest.php new file mode 100644 index 000000000000..e413b486a975 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionBackendServiceRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.UpdateRegionBackendServiceRequest + */ +class UpdateRegionBackendServiceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the BackendService resource to update. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_service = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendService backend_service_resource = 347586723 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $backend_service_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"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $backendService Name of the BackendService resource to update. + * @param \Google\Cloud\Compute\V1\BackendService $backendServiceResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdateRegionBackendServiceRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $backendService, \Google\Cloud\Compute\V1\BackendService $backendServiceResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setBackendService($backendService) + ->setBackendServiceResource($backendServiceResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_service + * Name of the BackendService resource to update. + * @type \Google\Cloud\Compute\V1\BackendService $backend_service_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the BackendService resource to update. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getBackendService() + { + return $this->backend_service; + } + + /** + * Name of the BackendService resource to update. + * + * Generated from protobuf field string backend_service = 306946058 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setBackendService($var) + { + GPBUtil::checkString($var, True); + $this->backend_service = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendService backend_service_resource = 347586723 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\BackendService|null + */ + public function getBackendServiceResource() + { + return $this->backend_service_resource; + } + + public function hasBackendServiceResource() + { + return isset($this->backend_service_resource); + } + + public function clearBackendServiceResource() + { + unset($this->backend_service_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.BackendService backend_service_resource = 347586723 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\BackendService $var + * @return $this + */ + public function setBackendServiceResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BackendService::class); + $this->backend_service_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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionCommitmentRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionCommitmentRequest.php new file mode 100644 index 000000000000..2aabb54d997a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionCommitmentRequest.php @@ -0,0 +1,323 @@ +google.cloud.compute.v1.UpdateRegionCommitmentRequest + */ +class UpdateRegionCommitmentRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the commitment for which auto renew is being updated. + * + * Generated from protobuf field string commitment = 482134805 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $commitment = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Commitment commitment_resource = 244240888 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $commitment_resource = null; + /** + * Generated from protobuf field optional string paths = 106438894; + */ + protected $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"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * update_mask indicates fields to be updated as part of this request. + * + * Generated from protobuf field optional string update_mask = 500079778; + */ + protected $update_mask = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $commitment Name of the commitment for which auto renew is being updated. + * @param \Google\Cloud\Compute\V1\Commitment $commitmentResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdateRegionCommitmentRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $commitment, \Google\Cloud\Compute\V1\Commitment $commitmentResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setCommitment($commitment) + ->setCommitmentResource($commitmentResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $commitment + * Name of the commitment for which auto renew is being updated. + * @type \Google\Cloud\Compute\V1\Commitment $commitment_resource + * The body resource for this request + * @type string $paths + * @type string $project + * Project ID for this request. + * @type string $region + * 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); + } + + /** + * Name of the commitment for which auto renew is being updated. + * + * Generated from protobuf field string commitment = 482134805 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCommitment() + { + return $this->commitment; + } + + /** + * Name of the commitment for which auto renew is being updated. + * + * Generated from protobuf field string commitment = 482134805 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCommitment($var) + { + GPBUtil::checkString($var, True); + $this->commitment = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Commitment commitment_resource = 244240888 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Commitment|null + */ + public function getCommitmentResource() + { + return $this->commitment_resource; + } + + public function hasCommitmentResource() + { + return isset($this->commitment_resource); + } + + public function clearCommitmentResource() + { + unset($this->commitment_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Commitment commitment_resource = 244240888 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Commitment $var + * @return $this + */ + public function setCommitmentResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Commitment::class); + $this->commitment_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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionDiskRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionDiskRequest.php new file mode 100644 index 000000000000..4a4267737b3e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionDiskRequest.php @@ -0,0 +1,323 @@ +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]; + */ + protected $disk = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Disk disk_resource = 25880688 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk_resource = null; + /** + * Generated from protobuf field optional string paths = 106438894; + */ + protected $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"]; + */ + protected $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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * update_mask indicates fields to be updated as part of this request. + * + * Generated from protobuf field optional string update_mask = 500079778; + */ + protected $update_mask = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $disk The disk name for this request. + * @param \Google\Cloud\Compute\V1\Disk $diskResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdateRegionDiskRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $disk, \Google\Cloud\Compute\V1\Disk $diskResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setDisk($disk) + ->setDiskResource($diskResource); + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionHealthCheckRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionHealthCheckRequest.php new file mode 100644 index 000000000000..50ff5ffec812 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionHealthCheckRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.UpdateRegionHealthCheckRequest + */ +class UpdateRegionHealthCheckRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the HealthCheck resource to update. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $health_check = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.HealthCheck health_check_resource = 201925032 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $health_check_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"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $healthCheck Name of the HealthCheck resource to update. + * @param \Google\Cloud\Compute\V1\HealthCheck $healthCheckResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdateRegionHealthCheckRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $healthCheck, \Google\Cloud\Compute\V1\HealthCheck $healthCheckResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setHealthCheck($healthCheck) + ->setHealthCheckResource($healthCheckResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $health_check + * Name of the HealthCheck resource to update. + * @type \Google\Cloud\Compute\V1\HealthCheck $health_check_resource + * The body resource for this request + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping 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); + } + + /** + * Name of the HealthCheck resource to update. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getHealthCheck() + { + return $this->health_check; + } + + /** + * Name of the HealthCheck resource to update. + * + * Generated from protobuf field string health_check = 308876645 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setHealthCheck($var) + { + GPBUtil::checkString($var, True); + $this->health_check = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.HealthCheck health_check_resource = 201925032 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\HealthCheck|null + */ + public function getHealthCheckResource() + { + return $this->health_check_resource; + } + + public function hasHealthCheckResource() + { + return isset($this->health_check_resource); + } + + public function clearHealthCheckResource() + { + unset($this->health_check_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.HealthCheck health_check_resource = 201925032 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\HealthCheck $var + * @return $this + */ + public function setHealthCheckResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HealthCheck::class); + $this->health_check_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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionUrlMapRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionUrlMapRequest.php new file mode 100644 index 000000000000..e367a4ce5d48 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRegionUrlMapRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.UpdateRegionUrlMapRequest + */ +class UpdateRegionUrlMapRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $region = ''; + /** + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * + * Generated from protobuf field optional string request_id = 37109963; + */ + protected $request_id = null; + /** + * Name of the UrlMap resource to update. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url_map = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMap url_map_resource = 168675425 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url_map_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $urlMap Name of the UrlMap resource to update. + * @param \Google\Cloud\Compute\V1\UrlMap $urlMapResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdateRegionUrlMapRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $urlMap, \Google\Cloud\Compute\V1\UrlMap $urlMapResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setUrlMap($urlMap) + ->setUrlMapResource($urlMapResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type string $request_id + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * @type string $url_map + * Name of the UrlMap resource to update. + * @type \Google\Cloud\Compute\V1\UrlMap $url_map_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * Name of the region scoping 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; + } + + /** + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * + * 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); + } + + /** + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * + * 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; + } + + /** + * Name of the UrlMap resource to update. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUrlMap() + { + return $this->url_map; + } + + /** + * Name of the UrlMap resource to update. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUrlMap($var) + { + GPBUtil::checkString($var, True); + $this->url_map = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMap url_map_resource = 168675425 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\UrlMap|null + */ + public function getUrlMapResource() + { + return $this->url_map_resource; + } + + public function hasUrlMapResource() + { + return isset($this->url_map_resource); + } + + public function clearUrlMapResource() + { + unset($this->url_map_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMap url_map_resource = 168675425 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\UrlMap $var + * @return $this + */ + public function setUrlMapResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\UrlMap::class); + $this->url_map_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateReservationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateReservationRequest.php new file mode 100644 index 000000000000..0d606047795f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateReservationRequest.php @@ -0,0 +1,323 @@ +google.cloud.compute.v1.UpdateReservationRequest + */ +class UpdateReservationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string paths = 106438894; + */ + protected $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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the reservation to update. + * + * Generated from protobuf field string reservation = 47530956 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $reservation = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Reservation reservation_resource = 285030177 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $reservation_resource = null; + /** + * Update_mask indicates fields to be updated as part of this request. + * + * Generated from protobuf field optional string update_mask = 500079778; + */ + protected $update_mask = null; + /** + * 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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone for this request. + * @param string $reservation Name of the reservation to update. + * @param \Google\Cloud\Compute\V1\Reservation $reservationResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdateReservationRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $reservation, \Google\Cloud\Compute\V1\Reservation $reservationResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setReservation($reservation) + ->setReservationResource($reservationResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $reservation + * Name of the reservation to update. + * @type \Google\Cloud\Compute\V1\Reservation $reservation_resource + * The body resource for this request + * @type string $update_mask + * Update_mask indicates fields to be updated as part of this request. + * @type string $zone + * Name of the zone for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the reservation to update. + * + * Generated from protobuf field string reservation = 47530956 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getReservation() + { + return $this->reservation; + } + + /** + * Name of the reservation to update. + * + * Generated from protobuf field string reservation = 47530956 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setReservation($var) + { + GPBUtil::checkString($var, True); + $this->reservation = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Reservation reservation_resource = 285030177 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Reservation|null + */ + public function getReservationResource() + { + return $this->reservation_resource; + } + + public function hasReservationResource() + { + return isset($this->reservation_resource); + } + + public function clearReservationResource() + { + unset($this->reservation_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Reservation reservation_resource = 285030177 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Reservation $var + * @return $this + */ + public function setReservationResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Reservation::class); + $this->reservation_resource = $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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRouterRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRouterRequest.php new file mode 100644 index 000000000000..2675e01fc44a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateRouterRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.UpdateRouterRequest + */ +class UpdateRouterRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * 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"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the Router resource to update. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $router = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Router router_resource = 155222084 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $router_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $router Name of the Router resource to update. + * @param \Google\Cloud\Compute\V1\Router $routerResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdateRouterRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $router, \Google\Cloud\Compute\V1\Router $routerResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router) + ->setRouterResource($routerResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * 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 $router + * Name of the Router resource to update. + * @type \Google\Cloud\Compute\V1\Router $router_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Name of the Router resource to update. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRouter() + { + return $this->router; + } + + /** + * Name of the Router resource to update. + * + * Generated from protobuf field string router = 148608841 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRouter($var) + { + GPBUtil::checkString($var, True); + $this->router = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Router router_resource = 155222084 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\Router|null + */ + public function getRouterResource() + { + return $this->router_resource; + } + + public function hasRouterResource() + { + return isset($this->router_resource); + } + + public function clearRouterResource() + { + unset($this->router_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.Router router_resource = 155222084 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\Router $var + * @return $this + */ + public function setRouterResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Router::class); + $this->router_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateShieldedInstanceConfigInstanceRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateShieldedInstanceConfigInstanceRequest.php new file mode 100644 index 000000000000..40b38a738d44 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateShieldedInstanceConfigInstanceRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest + */ +class UpdateShieldedInstanceConfigInstanceRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name or id of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ShieldedInstanceConfig shielded_instance_config_resource = 272059224 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $shielded_instance_config_resource = 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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $instance Name or id of the instance scoping this request. + * @param \Google\Cloud\Compute\V1\ShieldedInstanceConfig $shieldedInstanceConfigResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdateShieldedInstanceConfigInstanceRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instance, \Google\Cloud\Compute\V1\ShieldedInstanceConfig $shieldedInstanceConfigResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstance($instance) + ->setShieldedInstanceConfigResource($shieldedInstanceConfigResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance + * Name or id of the instance scoping 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 \Google\Cloud\Compute\V1\ShieldedInstanceConfig $shielded_instance_config_resource + * The body resource for 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); + } + + /** + * Name or id of the instance scoping this request. + * + * Generated from protobuf field string instance = 18257045 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInstance() + { + return $this->instance; + } + + /** + * Name or id of the instance scoping 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; + } + + /** + * 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 body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ShieldedInstanceConfig shielded_instance_config_resource = 272059224 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\ShieldedInstanceConfig|null + */ + public function getShieldedInstanceConfigResource() + { + return $this->shielded_instance_config_resource; + } + + public function hasShieldedInstanceConfigResource() + { + return isset($this->shielded_instance_config_resource); + } + + public function clearShieldedInstanceConfigResource() + { + unset($this->shielded_instance_config_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.ShieldedInstanceConfig shielded_instance_config_resource = 272059224 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\ShieldedInstanceConfig $var + * @return $this + */ + public function setShieldedInstanceConfigResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ShieldedInstanceConfig::class); + $this->shielded_instance_config_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateStoragePoolRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateStoragePoolRequest.php new file mode 100644 index 000000000000..344bfb7966f7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateStoragePoolRequest.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.UpdateStoragePoolRequest + */ +class UpdateStoragePoolRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * The storagePool name for this request. + * + * Generated from protobuf field string storage_pool = 360473440 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $storage_pool = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.StoragePool storage_pool_resource = 157179405 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $storage_pool_resource = null; + /** + * update_mask indicates fields to be updated as part of this request. + * + * Generated from protobuf field optional string update_mask = 500079778; + */ + protected $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"]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param string $storagePool The storagePool name for this request. + * @param \Google\Cloud\Compute\V1\StoragePool $storagePoolResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdateStoragePoolRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $storagePool, \Google\Cloud\Compute\V1\StoragePool $storagePoolResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setStoragePool($storagePool) + ->setStoragePoolResource($storagePoolResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $storage_pool + * The storagePool name for this request. + * @type \Google\Cloud\Compute\V1\StoragePool $storage_pool_resource + * The body resource for this request + * @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); + } + + /** + * 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 storagePool name for this request. + * + * Generated from protobuf field string storage_pool = 360473440 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getStoragePool() + { + return $this->storage_pool; + } + + /** + * The storagePool name for this request. + * + * Generated from protobuf field string storage_pool = 360473440 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setStoragePool($var) + { + GPBUtil::checkString($var, True); + $this->storage_pool = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.StoragePool storage_pool_resource = 157179405 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\StoragePool|null + */ + public function getStoragePoolResource() + { + return $this->storage_pool_resource; + } + + public function hasStoragePoolResource() + { + return isset($this->storage_pool_resource); + } + + public function clearStoragePoolResource() + { + unset($this->storage_pool_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.StoragePool storage_pool_resource = 157179405 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\StoragePool $var + * @return $this + */ + public function setStoragePoolResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\StoragePool::class); + $this->storage_pool_resource = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateUrlMapRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateUrlMapRequest.php new file mode 100644 index 000000000000..3ad6e740758f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UpdateUrlMapRequest.php @@ -0,0 +1,206 @@ +google.cloud.compute.v1.UpdateUrlMapRequest + */ +class UpdateUrlMapRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $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; + */ + protected $request_id = null; + /** + * Name of the UrlMap resource to update. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url_map = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMap url_map_resource = 168675425 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url_map_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $urlMap Name of the UrlMap resource to update. + * @param \Google\Cloud\Compute\V1\UrlMap $urlMapResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\UpdateUrlMapRequest + * + * @experimental + */ + public static function build(string $project, string $urlMap, \Google\Cloud\Compute\V1\UrlMap $urlMapResource): self + { + return (new self()) + ->setProject($project) + ->setUrlMap($urlMap) + ->setUrlMapResource($urlMapResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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 $url_map + * Name of the UrlMap resource to update. + * @type \Google\Cloud\Compute\V1\UrlMap $url_map_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the UrlMap resource to update. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUrlMap() + { + return $this->url_map; + } + + /** + * Name of the UrlMap resource to update. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUrlMap($var) + { + GPBUtil::checkString($var, True); + $this->url_map = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMap url_map_resource = 168675425 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\UrlMap|null + */ + public function getUrlMapResource() + { + return $this->url_map_resource; + } + + public function hasUrlMapResource() + { + return isset($this->url_map_resource); + } + + public function clearUrlMapResource() + { + unset($this->url_map_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMap url_map_resource = 168675425 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\UrlMap $var + * @return $this + */ + public function setUrlMapResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\UrlMap::class); + $this->url_map_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMap.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMap.php new file mode 100644 index 000000000000..a062d59c949c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMap.php @@ -0,0 +1,663 @@ +google.cloud.compute.v1.UrlMap + */ +class UrlMap extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. Only one of defaultRouteAction or defaultUrlRedirect must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within defaultRouteAction. defaultRouteAction has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRouteAction default_route_action = 378919466; + */ + protected $default_route_action = null; + /** + * The full or partial URL of the defaultService resource to which traffic is directed if none of the hostRules match. If defaultRouteAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. If defaultService is specified, then set either defaultUrlRedirect , or defaultRouteAction.weightedBackendService Don't set both. defaultService has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * + * Generated from protobuf field optional string default_service = 370242231; + */ + protected $default_service = null; + /** + * When none of the specified hostRules match, the request is redirected to a URL specified by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. Not supported when the URL map is bound to a target gRPC proxy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRedirectAction default_url_redirect = 359503338; + */ + protected $default_url_redirect = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field is ignored when inserting a UrlMap. An up-to-date fingerprint must be provided in order to update the UrlMap, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a UrlMap. + * + * Generated from protobuf field optional string fingerprint = 234678500; + */ + protected $fingerprint = null; + /** + * Specifies changes to request and response headers that need to take effect for the selected backendService. The headerAction specified here take effect after headerAction specified under pathMatcher. headerAction is not supported for load balancers that have their loadBalancingScheme set to EXTERNAL. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352; + */ + protected $header_action = null; + /** + * The list of host rules to use against the URL. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HostRule host_rules = 311804832; + */ + private $host_rules; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#urlMaps for url maps. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * The list of named PathMatchers to use against the URL. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PathMatcher path_matchers = 271664219; + */ + private $path_matchers; + /** + * [Output Only] URL of the region where the regional URL map resides. This field is not applicable to global URL maps. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * The list of expected URL mapping tests. Request to update the UrlMap succeeds only if all test cases pass. You can specify a maximum of 100 tests per UrlMap. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.UrlMapTest tests = 110251553; + */ + private $tests; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type \Google\Cloud\Compute\V1\HttpRouteAction $default_route_action + * defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. Only one of defaultRouteAction or defaultUrlRedirect must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within defaultRouteAction. defaultRouteAction has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * @type string $default_service + * The full or partial URL of the defaultService resource to which traffic is directed if none of the hostRules match. If defaultRouteAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. If defaultService is specified, then set either defaultUrlRedirect , or defaultRouteAction.weightedBackendService Don't set both. defaultService has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * @type \Google\Cloud\Compute\V1\HttpRedirectAction $default_url_redirect + * When none of the specified hostRules match, the request is redirected to a URL specified by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. Not supported when the URL map is bound to a target gRPC proxy. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type string $fingerprint + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field is ignored when inserting a UrlMap. An up-to-date fingerprint must be provided in order to update the UrlMap, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a UrlMap. + * @type \Google\Cloud\Compute\V1\HttpHeaderAction $header_action + * Specifies changes to request and response headers that need to take effect for the selected backendService. The headerAction specified here take effect after headerAction specified under pathMatcher. headerAction is not supported for load balancers that have their loadBalancingScheme set to EXTERNAL. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * @type array<\Google\Cloud\Compute\V1\HostRule>|\Google\Protobuf\Internal\RepeatedField $host_rules + * The list of host rules to use against the URL. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of the resource. Always compute#urlMaps for url maps. + * @type string $name + * 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 array<\Google\Cloud\Compute\V1\PathMatcher>|\Google\Protobuf\Internal\RepeatedField $path_matchers + * The list of named PathMatchers to use against the URL. + * @type string $region + * [Output Only] URL of the region where the regional URL map resides. This field is not applicable to global URL maps. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type array<\Google\Cloud\Compute\V1\UrlMapTest>|\Google\Protobuf\Internal\RepeatedField $tests + * The list of expected URL mapping tests. Request to update the UrlMap succeeds only if all test cases pass. You can specify a maximum of 100 tests per UrlMap. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. Only one of defaultRouteAction or defaultUrlRedirect must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within defaultRouteAction. defaultRouteAction has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRouteAction default_route_action = 378919466; + * @return \Google\Cloud\Compute\V1\HttpRouteAction|null + */ + public function getDefaultRouteAction() + { + return $this->default_route_action; + } + + public function hasDefaultRouteAction() + { + return isset($this->default_route_action); + } + + public function clearDefaultRouteAction() + { + unset($this->default_route_action); + } + + /** + * defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. Only one of defaultRouteAction or defaultUrlRedirect must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within defaultRouteAction. defaultRouteAction has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRouteAction default_route_action = 378919466; + * @param \Google\Cloud\Compute\V1\HttpRouteAction $var + * @return $this + */ + public function setDefaultRouteAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HttpRouteAction::class); + $this->default_route_action = $var; + + return $this; + } + + /** + * The full or partial URL of the defaultService resource to which traffic is directed if none of the hostRules match. If defaultRouteAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. If defaultService is specified, then set either defaultUrlRedirect , or defaultRouteAction.weightedBackendService Don't set both. defaultService has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * + * Generated from protobuf field optional string default_service = 370242231; + * @return string + */ + public function getDefaultService() + { + return isset($this->default_service) ? $this->default_service : ''; + } + + public function hasDefaultService() + { + return isset($this->default_service); + } + + public function clearDefaultService() + { + unset($this->default_service); + } + + /** + * The full or partial URL of the defaultService resource to which traffic is directed if none of the hostRules match. If defaultRouteAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. If defaultService is specified, then set either defaultUrlRedirect , or defaultRouteAction.weightedBackendService Don't set both. defaultService has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true. + * + * Generated from protobuf field optional string default_service = 370242231; + * @param string $var + * @return $this + */ + public function setDefaultService($var) + { + GPBUtil::checkString($var, True); + $this->default_service = $var; + + return $this; + } + + /** + * When none of the specified hostRules match, the request is redirected to a URL specified by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. Not supported when the URL map is bound to a target gRPC proxy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRedirectAction default_url_redirect = 359503338; + * @return \Google\Cloud\Compute\V1\HttpRedirectAction|null + */ + public function getDefaultUrlRedirect() + { + return $this->default_url_redirect; + } + + public function hasDefaultUrlRedirect() + { + return isset($this->default_url_redirect); + } + + public function clearDefaultUrlRedirect() + { + unset($this->default_url_redirect); + } + + /** + * When none of the specified hostRules match, the request is redirected to a URL specified by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. Not supported when the URL map is bound to a target gRPC proxy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpRedirectAction default_url_redirect = 359503338; + * @param \Google\Cloud\Compute\V1\HttpRedirectAction $var + * @return $this + */ + public function setDefaultUrlRedirect($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HttpRedirectAction::class); + $this->default_url_redirect = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field is ignored when inserting a UrlMap. An up-to-date fingerprint must be provided in order to update the UrlMap, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a UrlMap. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @return string + */ + public function getFingerprint() + { + return isset($this->fingerprint) ? $this->fingerprint : ''; + } + + public function hasFingerprint() + { + return isset($this->fingerprint); + } + + public function clearFingerprint() + { + unset($this->fingerprint); + } + + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field is ignored when inserting a UrlMap. An up-to-date fingerprint must be provided in order to update the UrlMap, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a UrlMap. + * + * Generated from protobuf field optional string fingerprint = 234678500; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->fingerprint = $var; + + return $this; + } + + /** + * Specifies changes to request and response headers that need to take effect for the selected backendService. The headerAction specified here take effect after headerAction specified under pathMatcher. headerAction is not supported for load balancers that have their loadBalancingScheme set to EXTERNAL. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352; + * @return \Google\Cloud\Compute\V1\HttpHeaderAction|null + */ + public function getHeaderAction() + { + return $this->header_action; + } + + public function hasHeaderAction() + { + return isset($this->header_action); + } + + public function clearHeaderAction() + { + unset($this->header_action); + } + + /** + * Specifies changes to request and response headers that need to take effect for the selected backendService. The headerAction specified here take effect after headerAction specified under pathMatcher. headerAction is not supported for load balancers that have their loadBalancingScheme set to EXTERNAL. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352; + * @param \Google\Cloud\Compute\V1\HttpHeaderAction $var + * @return $this + */ + public function setHeaderAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HttpHeaderAction::class); + $this->header_action = $var; + + return $this; + } + + /** + * The list of host rules to use against the URL. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HostRule host_rules = 311804832; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHostRules() + { + return $this->host_rules; + } + + /** + * The list of host rules to use against the URL. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.HostRule host_rules = 311804832; + * @param array<\Google\Cloud\Compute\V1\HostRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHostRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\HostRule::class); + $this->host_rules = $arr; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#urlMaps for url maps. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#urlMaps for url maps. + * + * 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; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * The list of named PathMatchers to use against the URL. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PathMatcher path_matchers = 271664219; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPathMatchers() + { + return $this->path_matchers; + } + + /** + * The list of named PathMatchers to use against the URL. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.PathMatcher path_matchers = 271664219; + * @param array<\Google\Cloud\Compute\V1\PathMatcher>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPathMatchers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\PathMatcher::class); + $this->path_matchers = $arr; + + return $this; + } + + /** + * [Output Only] URL of the region where the regional URL map resides. This field is not applicable to global URL maps. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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 regional URL map resides. This field is not applicable to global URL maps. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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] Server-defined URL for the 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 the 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; + } + + /** + * The list of expected URL mapping tests. Request to update the UrlMap succeeds only if all test cases pass. You can specify a maximum of 100 tests per UrlMap. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.UrlMapTest tests = 110251553; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTests() + { + return $this->tests; + } + + /** + * The list of expected URL mapping tests. Request to update the UrlMap succeeds only if all test cases pass. You can specify a maximum of 100 tests per UrlMap. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.UrlMapTest tests = 110251553; + * @param array<\Google\Cloud\Compute\V1\UrlMapTest>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTests($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\UrlMapTest::class); + $this->tests = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapList.php new file mode 100644 index 000000000000..d764594c42b1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.UrlMapList + */ +class UrlMapList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of UrlMap resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.UrlMap items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\UrlMap>|\Google\Protobuf\Internal\RepeatedField $items + * A list of UrlMap 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 UrlMap resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.UrlMap items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of UrlMap resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.UrlMap items = 100526016; + * @param array<\Google\Cloud\Compute\V1\UrlMap>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\UrlMap::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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapReference.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapReference.php new file mode 100644 index 000000000000..e0701c8d77d6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapReference.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.UrlMapReference + */ +class UrlMapReference extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string url_map = 367020684; + */ + protected $url_map = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $url_map + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional string url_map = 367020684; + * @return string + */ + public function getUrlMap() + { + return isset($this->url_map) ? $this->url_map : ''; + } + + public function hasUrlMap() + { + return isset($this->url_map); + } + + public function clearUrlMap() + { + unset($this->url_map); + } + + /** + * Generated from protobuf field optional string url_map = 367020684; + * @param string $var + * @return $this + */ + public function setUrlMap($var) + { + GPBUtil::checkString($var, True); + $this->url_map = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapTest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapTest.php new file mode 100644 index 000000000000..32ea3d397393 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapTest.php @@ -0,0 +1,331 @@ +google.cloud.compute.v1.UrlMapTest + */ +class UrlMapTest extends \Google\Protobuf\Internal\Message +{ + /** + * Description of this test case. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * The expected output URL evaluated by the load balancer containing the scheme, host, path and query parameters. For rules that forward requests to backends, the test passes only when expectedOutputUrl matches the request forwarded by the load balancer to backends. For rules with urlRewrite, the test verifies that the forwarded request matches hostRewrite and pathPrefixRewrite in the urlRewrite action. When service is specified, expectedOutputUrl`s scheme is ignored. For rules with urlRedirect, the test passes only if expectedOutputUrl matches the URL in the load balancer's redirect response. If urlRedirect specifies https_redirect, the test passes only if the scheme in expectedOutputUrl is also set to HTTPS. If urlRedirect specifies strip_query, the test passes only if expectedOutputUrl does not contain any query parameters. expectedOutputUrl is optional when service is specified. + * + * Generated from protobuf field optional string expected_output_url = 433967384; + */ + protected $expected_output_url = null; + /** + * For rules with urlRedirect, the test passes only if expectedRedirectResponseCode matches the HTTP status code in load balancer's redirect response. expectedRedirectResponseCode cannot be set when service is set. + * + * Generated from protobuf field optional int32 expected_redirect_response_code = 18888047; + */ + protected $expected_redirect_response_code = null; + /** + * HTTP headers for this request. If headers contains a host header, then host must also match the header value. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.UrlMapTestHeader headers = 258436998; + */ + private $headers; + /** + * Host portion of the URL. If headers contains a host header, then host must also match the header value. + * + * Generated from protobuf field optional string host = 3208616; + */ + protected $host = null; + /** + * Path portion of the URL. + * + * Generated from protobuf field optional string path = 3433509; + */ + protected $path = null; + /** + * Expected BackendService or BackendBucket resource the given URL should be mapped to. The service field cannot be set if expectedRedirectResponseCode is set. + * + * Generated from protobuf field optional string service = 373540533; + */ + protected $service = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $description + * Description of this test case. + * @type string $expected_output_url + * The expected output URL evaluated by the load balancer containing the scheme, host, path and query parameters. For rules that forward requests to backends, the test passes only when expectedOutputUrl matches the request forwarded by the load balancer to backends. For rules with urlRewrite, the test verifies that the forwarded request matches hostRewrite and pathPrefixRewrite in the urlRewrite action. When service is specified, expectedOutputUrl`s scheme is ignored. For rules with urlRedirect, the test passes only if expectedOutputUrl matches the URL in the load balancer's redirect response. If urlRedirect specifies https_redirect, the test passes only if the scheme in expectedOutputUrl is also set to HTTPS. If urlRedirect specifies strip_query, the test passes only if expectedOutputUrl does not contain any query parameters. expectedOutputUrl is optional when service is specified. + * @type int $expected_redirect_response_code + * For rules with urlRedirect, the test passes only if expectedRedirectResponseCode matches the HTTP status code in load balancer's redirect response. expectedRedirectResponseCode cannot be set when service is set. + * @type array<\Google\Cloud\Compute\V1\UrlMapTestHeader>|\Google\Protobuf\Internal\RepeatedField $headers + * HTTP headers for this request. If headers contains a host header, then host must also match the header value. + * @type string $host + * Host portion of the URL. If headers contains a host header, then host must also match the header value. + * @type string $path + * Path portion of the URL. + * @type string $service + * Expected BackendService or BackendBucket resource the given URL should be mapped to. The service field cannot be set if expectedRedirectResponseCode is set. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Description of this test case. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * Description of this test case. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The expected output URL evaluated by the load balancer containing the scheme, host, path and query parameters. For rules that forward requests to backends, the test passes only when expectedOutputUrl matches the request forwarded by the load balancer to backends. For rules with urlRewrite, the test verifies that the forwarded request matches hostRewrite and pathPrefixRewrite in the urlRewrite action. When service is specified, expectedOutputUrl`s scheme is ignored. For rules with urlRedirect, the test passes only if expectedOutputUrl matches the URL in the load balancer's redirect response. If urlRedirect specifies https_redirect, the test passes only if the scheme in expectedOutputUrl is also set to HTTPS. If urlRedirect specifies strip_query, the test passes only if expectedOutputUrl does not contain any query parameters. expectedOutputUrl is optional when service is specified. + * + * Generated from protobuf field optional string expected_output_url = 433967384; + * @return string + */ + public function getExpectedOutputUrl() + { + return isset($this->expected_output_url) ? $this->expected_output_url : ''; + } + + public function hasExpectedOutputUrl() + { + return isset($this->expected_output_url); + } + + public function clearExpectedOutputUrl() + { + unset($this->expected_output_url); + } + + /** + * The expected output URL evaluated by the load balancer containing the scheme, host, path and query parameters. For rules that forward requests to backends, the test passes only when expectedOutputUrl matches the request forwarded by the load balancer to backends. For rules with urlRewrite, the test verifies that the forwarded request matches hostRewrite and pathPrefixRewrite in the urlRewrite action. When service is specified, expectedOutputUrl`s scheme is ignored. For rules with urlRedirect, the test passes only if expectedOutputUrl matches the URL in the load balancer's redirect response. If urlRedirect specifies https_redirect, the test passes only if the scheme in expectedOutputUrl is also set to HTTPS. If urlRedirect specifies strip_query, the test passes only if expectedOutputUrl does not contain any query parameters. expectedOutputUrl is optional when service is specified. + * + * Generated from protobuf field optional string expected_output_url = 433967384; + * @param string $var + * @return $this + */ + public function setExpectedOutputUrl($var) + { + GPBUtil::checkString($var, True); + $this->expected_output_url = $var; + + return $this; + } + + /** + * For rules with urlRedirect, the test passes only if expectedRedirectResponseCode matches the HTTP status code in load balancer's redirect response. expectedRedirectResponseCode cannot be set when service is set. + * + * Generated from protobuf field optional int32 expected_redirect_response_code = 18888047; + * @return int + */ + public function getExpectedRedirectResponseCode() + { + return isset($this->expected_redirect_response_code) ? $this->expected_redirect_response_code : 0; + } + + public function hasExpectedRedirectResponseCode() + { + return isset($this->expected_redirect_response_code); + } + + public function clearExpectedRedirectResponseCode() + { + unset($this->expected_redirect_response_code); + } + + /** + * For rules with urlRedirect, the test passes only if expectedRedirectResponseCode matches the HTTP status code in load balancer's redirect response. expectedRedirectResponseCode cannot be set when service is set. + * + * Generated from protobuf field optional int32 expected_redirect_response_code = 18888047; + * @param int $var + * @return $this + */ + public function setExpectedRedirectResponseCode($var) + { + GPBUtil::checkInt32($var); + $this->expected_redirect_response_code = $var; + + return $this; + } + + /** + * HTTP headers for this request. If headers contains a host header, then host must also match the header value. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.UrlMapTestHeader headers = 258436998; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * HTTP headers for this request. If headers contains a host header, then host must also match the header value. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.UrlMapTestHeader headers = 258436998; + * @param array<\Google\Cloud\Compute\V1\UrlMapTestHeader>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHeaders($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\UrlMapTestHeader::class); + $this->headers = $arr; + + return $this; + } + + /** + * Host portion of the URL. If headers contains a host header, then host must also match the header value. + * + * Generated from protobuf field optional string host = 3208616; + * @return string + */ + public function getHost() + { + return isset($this->host) ? $this->host : ''; + } + + public function hasHost() + { + return isset($this->host); + } + + public function clearHost() + { + unset($this->host); + } + + /** + * Host portion of the URL. If headers contains a host header, then host must also match the header value. + * + * Generated from protobuf field optional string host = 3208616; + * @param string $var + * @return $this + */ + public function setHost($var) + { + GPBUtil::checkString($var, True); + $this->host = $var; + + return $this; + } + + /** + * Path portion of the URL. + * + * Generated from protobuf field optional string path = 3433509; + * @return string + */ + public function getPath() + { + return isset($this->path) ? $this->path : ''; + } + + public function hasPath() + { + return isset($this->path); + } + + public function clearPath() + { + unset($this->path); + } + + /** + * Path portion of the URL. + * + * Generated from protobuf field optional string path = 3433509; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + + /** + * Expected BackendService or BackendBucket resource the given URL should be mapped to. The service field cannot be set if expectedRedirectResponseCode is set. + * + * Generated from protobuf field optional string service = 373540533; + * @return string + */ + public function getService() + { + return isset($this->service) ? $this->service : ''; + } + + public function hasService() + { + return isset($this->service); + } + + public function clearService() + { + unset($this->service); + } + + /** + * Expected BackendService or BackendBucket resource the given URL should be mapped to. The service field cannot be set if expectedRedirectResponseCode is set. + * + * Generated from protobuf field optional string service = 373540533; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapTestHeader.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapTestHeader.php new file mode 100644 index 000000000000..9d8cf2bc069f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapTestHeader.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.UrlMapTestHeader + */ +class UrlMapTestHeader extends \Google\Protobuf\Internal\Message +{ + /** + * Header name. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * Header value. + * + * Generated from protobuf field optional string value = 111972721; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Header name. + * @type string $value + * Header value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Header name. + * + * 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); + } + + /** + * Header name. + * + * 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; + } + + /** + * Header value. + * + * Generated from protobuf field optional string value = 111972721; + * @return string + */ + public function getValue() + { + return isset($this->value) ? $this->value : ''; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * Header value. + * + * Generated from protobuf field optional string value = 111972721; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapValidationResult.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapValidationResult.php new file mode 100644 index 000000000000..4fda4934aaff --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapValidationResult.php @@ -0,0 +1,175 @@ +google.cloud.compute.v1.UrlMapValidationResult + */ +class UrlMapValidationResult extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated string load_errors = 310147300; + */ + private $load_errors; + /** + * Whether the given UrlMap can be successfully loaded. If false, 'loadErrors' indicates the reasons. + * + * Generated from protobuf field optional bool load_succeeded = 128326216; + */ + protected $load_succeeded = null; + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.TestFailure test_failures = 505934134; + */ + private $test_failures; + /** + * If successfully loaded, this field indicates whether the test passed. If false, 'testFailures's indicate the reason of failure. + * + * Generated from protobuf field optional bool test_passed = 192708797; + */ + protected $test_passed = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $load_errors + * @type bool $load_succeeded + * Whether the given UrlMap can be successfully loaded. If false, 'loadErrors' indicates the reasons. + * @type array<\Google\Cloud\Compute\V1\TestFailure>|\Google\Protobuf\Internal\RepeatedField $test_failures + * @type bool $test_passed + * If successfully loaded, this field indicates whether the test passed. If false, 'testFailures's indicate the reason of failure. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated string load_errors = 310147300; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLoadErrors() + { + return $this->load_errors; + } + + /** + * Generated from protobuf field repeated string load_errors = 310147300; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLoadErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->load_errors = $arr; + + return $this; + } + + /** + * Whether the given UrlMap can be successfully loaded. If false, 'loadErrors' indicates the reasons. + * + * Generated from protobuf field optional bool load_succeeded = 128326216; + * @return bool + */ + public function getLoadSucceeded() + { + return isset($this->load_succeeded) ? $this->load_succeeded : false; + } + + public function hasLoadSucceeded() + { + return isset($this->load_succeeded); + } + + public function clearLoadSucceeded() + { + unset($this->load_succeeded); + } + + /** + * Whether the given UrlMap can be successfully loaded. If false, 'loadErrors' indicates the reasons. + * + * Generated from protobuf field optional bool load_succeeded = 128326216; + * @param bool $var + * @return $this + */ + public function setLoadSucceeded($var) + { + GPBUtil::checkBool($var); + $this->load_succeeded = $var; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.TestFailure test_failures = 505934134; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTestFailures() + { + return $this->test_failures; + } + + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.TestFailure test_failures = 505934134; + * @param array<\Google\Cloud\Compute\V1\TestFailure>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTestFailures($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\TestFailure::class); + $this->test_failures = $arr; + + return $this; + } + + /** + * If successfully loaded, this field indicates whether the test passed. If false, 'testFailures's indicate the reason of failure. + * + * Generated from protobuf field optional bool test_passed = 192708797; + * @return bool + */ + public function getTestPassed() + { + return isset($this->test_passed) ? $this->test_passed : false; + } + + public function hasTestPassed() + { + return isset($this->test_passed); + } + + public function clearTestPassed() + { + unset($this->test_passed); + } + + /** + * If successfully loaded, this field indicates whether the test passed. If false, 'testFailures's indicate the reason of failure. + * + * Generated from protobuf field optional bool test_passed = 192708797; + * @param bool $var + * @return $this + */ + public function setTestPassed($var) + { + GPBUtil::checkBool($var); + $this->test_passed = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapsAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapsAggregatedList.php new file mode 100644 index 000000000000..f0e4a1880b16 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapsAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.UrlMapsAggregatedList + */ +class UrlMapsAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of UrlMapsScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 UrlMapsScopedList 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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 UrlMapsScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of UrlMapsScopedList 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\UrlMapsScopedList::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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapsScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapsScopedList.php new file mode 100644 index 000000000000..42ce675ab9e5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapsScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.UrlMapsScopedList + */ +class UrlMapsScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * A list of UrlMaps contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.UrlMap url_maps = 103352167; + */ + private $url_maps; + /** + * Informational warning which replaces the list of backend services when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\UrlMap>|\Google\Protobuf\Internal\RepeatedField $url_maps + * A list of UrlMaps contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * Informational warning which replaces the list of backend services when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of UrlMaps contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.UrlMap url_maps = 103352167; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUrlMaps() + { + return $this->url_maps; + } + + /** + * A list of UrlMaps contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.UrlMap url_maps = 103352167; + * @param array<\Google\Cloud\Compute\V1\UrlMap>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUrlMaps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\UrlMap::class); + $this->url_maps = $arr; + + return $this; + } + + /** + * Informational warning which replaces the list of backend services 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); + } + + /** + * Informational warning which replaces the list of backend services 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapsValidateRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapsValidateRequest.php new file mode 100644 index 000000000000..14a78719a69a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapsValidateRequest.php @@ -0,0 +1,114 @@ +google.cloud.compute.v1.UrlMapsValidateRequest + */ +class UrlMapsValidateRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies the load balancer type(s) this validation request is for. Use EXTERNAL_MANAGED for global external Application Load Balancers and regional external Application Load Balancers. Use EXTERNAL for classic Application Load Balancers. Use INTERNAL_MANAGED for internal Application Load Balancers. For more information, refer to Choosing a load balancer. If unspecified, the load balancing scheme will be inferred from the backend service resources this URL map references. If that can not be inferred (for example, this URL map only references backend buckets, or this Url map is for rewrites and redirects only and doesn't reference any backends), EXTERNAL will be used as the default type. If specified, the scheme(s) must not conflict with the load balancing scheme of the backend service resources this Url map references. + * Check the LoadBalancingSchemes enum for the list of possible values. + * + * Generated from protobuf field repeated string load_balancing_schemes = 6308527; + */ + private $load_balancing_schemes; + /** + * Content of the UrlMap to be validated. + * + * Generated from protobuf field optional .google.cloud.compute.v1.UrlMap resource = 195806222; + */ + protected $resource = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $load_balancing_schemes + * Specifies the load balancer type(s) this validation request is for. Use EXTERNAL_MANAGED for global external Application Load Balancers and regional external Application Load Balancers. Use EXTERNAL for classic Application Load Balancers. Use INTERNAL_MANAGED for internal Application Load Balancers. For more information, refer to Choosing a load balancer. If unspecified, the load balancing scheme will be inferred from the backend service resources this URL map references. If that can not be inferred (for example, this URL map only references backend buckets, or this Url map is for rewrites and redirects only and doesn't reference any backends), EXTERNAL will be used as the default type. If specified, the scheme(s) must not conflict with the load balancing scheme of the backend service resources this Url map references. + * Check the LoadBalancingSchemes enum for the list of possible values. + * @type \Google\Cloud\Compute\V1\UrlMap $resource + * Content of the UrlMap to be validated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies the load balancer type(s) this validation request is for. Use EXTERNAL_MANAGED for global external Application Load Balancers and regional external Application Load Balancers. Use EXTERNAL for classic Application Load Balancers. Use INTERNAL_MANAGED for internal Application Load Balancers. For more information, refer to Choosing a load balancer. If unspecified, the load balancing scheme will be inferred from the backend service resources this URL map references. If that can not be inferred (for example, this URL map only references backend buckets, or this Url map is for rewrites and redirects only and doesn't reference any backends), EXTERNAL will be used as the default type. If specified, the scheme(s) must not conflict with the load balancing scheme of the backend service resources this Url map references. + * Check the LoadBalancingSchemes enum for the list of possible values. + * + * Generated from protobuf field repeated string load_balancing_schemes = 6308527; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLoadBalancingSchemes() + { + return $this->load_balancing_schemes; + } + + /** + * Specifies the load balancer type(s) this validation request is for. Use EXTERNAL_MANAGED for global external Application Load Balancers and regional external Application Load Balancers. Use EXTERNAL for classic Application Load Balancers. Use INTERNAL_MANAGED for internal Application Load Balancers. For more information, refer to Choosing a load balancer. If unspecified, the load balancing scheme will be inferred from the backend service resources this URL map references. If that can not be inferred (for example, this URL map only references backend buckets, or this Url map is for rewrites and redirects only and doesn't reference any backends), EXTERNAL will be used as the default type. If specified, the scheme(s) must not conflict with the load balancing scheme of the backend service resources this Url map references. + * Check the LoadBalancingSchemes enum for the list of possible values. + * + * Generated from protobuf field repeated string load_balancing_schemes = 6308527; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLoadBalancingSchemes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->load_balancing_schemes = $arr; + + return $this; + } + + /** + * Content of the UrlMap to be validated. + * + * Generated from protobuf field optional .google.cloud.compute.v1.UrlMap resource = 195806222; + * @return \Google\Cloud\Compute\V1\UrlMap|null + */ + public function getResource() + { + return $this->resource; + } + + public function hasResource() + { + return isset($this->resource); + } + + public function clearResource() + { + unset($this->resource); + } + + /** + * Content of the UrlMap to be validated. + * + * Generated from protobuf field optional .google.cloud.compute.v1.UrlMap resource = 195806222; + * @param \Google\Cloud\Compute\V1\UrlMap $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\UrlMap::class); + $this->resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapsValidateRequest/LoadBalancingSchemes.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapsValidateRequest/LoadBalancingSchemes.php new file mode 100644 index 000000000000..2d8e2d77ce7f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapsValidateRequest/LoadBalancingSchemes.php @@ -0,0 +1,70 @@ +google.cloud.compute.v1.UrlMapsValidateRequest.LoadBalancingSchemes + */ +class LoadBalancingSchemes +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_LOAD_BALANCING_SCHEMES = 0; + */ + const UNDEFINED_LOAD_BALANCING_SCHEMES = 0; + /** + * Signifies that this will be used for classic Application Load Balancers. + * + * Generated from protobuf enum EXTERNAL = 35607499; + */ + const EXTERNAL = 35607499; + /** + * Signifies that this will be used for Envoy-based global external Application Load Balancers. + * + * Generated from protobuf enum EXTERNAL_MANAGED = 512006923; + */ + const EXTERNAL_MANAGED = 512006923; + /** + * If unspecified, the validation will try to infer the scheme from the backend service resources this Url map references. If the inference is not possible, EXTERNAL will be used as the default type. + * + * Generated from protobuf enum LOAD_BALANCING_SCHEME_UNSPECIFIED = 526507452; + */ + const LOAD_BALANCING_SCHEME_UNSPECIFIED = 526507452; + + private static $valueToName = [ + self::UNDEFINED_LOAD_BALANCING_SCHEMES => 'UNDEFINED_LOAD_BALANCING_SCHEMES', + self::EXTERNAL => 'EXTERNAL', + self::EXTERNAL_MANAGED => 'EXTERNAL_MANAGED', + self::LOAD_BALANCING_SCHEME_UNSPECIFIED => 'LOAD_BALANCING_SCHEME_UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LoadBalancingSchemes::class, \Google\Cloud\Compute\V1\UrlMapsValidateRequest_LoadBalancingSchemes::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapsValidateResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapsValidateResponse.php new file mode 100644 index 000000000000..9c963924f032 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMapsValidateResponse.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.UrlMapsValidateResponse + */ +class UrlMapsValidateResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional .google.cloud.compute.v1.UrlMapValidationResult result = 139315229; + */ + protected $result = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\UrlMapValidationResult $result + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.UrlMapValidationResult result = 139315229; + * @return \Google\Cloud\Compute\V1\UrlMapValidationResult|null + */ + public function getResult() + { + return $this->result; + } + + public function hasResult() + { + return isset($this->result); + } + + public function clearResult() + { + unset($this->result); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.UrlMapValidationResult result = 139315229; + * @param \Google\Cloud\Compute\V1\UrlMapValidationResult $var + * @return $this + */ + public function setResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\UrlMapValidationResult::class); + $this->result = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlRewrite.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlRewrite.php new file mode 100644 index 000000000000..cc6e0ee5f4c0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlRewrite.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.UrlRewrite + */ +class UrlRewrite extends \Google\Protobuf\Internal\Message +{ + /** + * Before forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. The value must be from 1 to 255 characters. + * + * Generated from protobuf field optional string host_rewrite = 159819253; + */ + protected $host_rewrite = null; + /** + * Before forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. The value must be from 1 to 1024 characters. + * + * Generated from protobuf field optional string path_prefix_rewrite = 41186361; + */ + protected $path_prefix_rewrite = null; + /** + * If specified, the pattern rewrites the URL path (based on the :path header) using the HTTP template syntax. A corresponding path_template_match must be specified. Any template variables must exist in the path_template_match field. - -At least one variable must be specified in the path_template_match field - You can omit variables from the rewritten URL - The * and ** operators cannot be matched unless they have a corresponding variable name - e.g. {format=*} or {var=**}. For example, a path_template_match of /static/{format=**} could be rewritten as /static/content/{format} to prefix /content to the URL. Variables can also be re-ordered in a rewrite, so that /{country}/{format}/{suffix=**} can be rewritten as /content/{format}/{country}/{suffix}. At least one non-empty routeRules[].matchRules[].path_template_match is required. Only one of path_prefix_rewrite or path_template_rewrite may be specified. + * + * Generated from protobuf field optional string path_template_rewrite = 423409569; + */ + protected $path_template_rewrite = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $host_rewrite + * Before forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. The value must be from 1 to 255 characters. + * @type string $path_prefix_rewrite + * Before forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. The value must be from 1 to 1024 characters. + * @type string $path_template_rewrite + * If specified, the pattern rewrites the URL path (based on the :path header) using the HTTP template syntax. A corresponding path_template_match must be specified. Any template variables must exist in the path_template_match field. - -At least one variable must be specified in the path_template_match field - You can omit variables from the rewritten URL - The * and ** operators cannot be matched unless they have a corresponding variable name - e.g. {format=*} or {var=**}. For example, a path_template_match of /static/{format=**} could be rewritten as /static/content/{format} to prefix /content to the URL. Variables can also be re-ordered in a rewrite, so that /{country}/{format}/{suffix=**} can be rewritten as /content/{format}/{country}/{suffix}. At least one non-empty routeRules[].matchRules[].path_template_match is required. Only one of path_prefix_rewrite or path_template_rewrite may be specified. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Before forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. The value must be from 1 to 255 characters. + * + * Generated from protobuf field optional string host_rewrite = 159819253; + * @return string + */ + public function getHostRewrite() + { + return isset($this->host_rewrite) ? $this->host_rewrite : ''; + } + + public function hasHostRewrite() + { + return isset($this->host_rewrite); + } + + public function clearHostRewrite() + { + unset($this->host_rewrite); + } + + /** + * Before forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. The value must be from 1 to 255 characters. + * + * Generated from protobuf field optional string host_rewrite = 159819253; + * @param string $var + * @return $this + */ + public function setHostRewrite($var) + { + GPBUtil::checkString($var, True); + $this->host_rewrite = $var; + + return $this; + } + + /** + * Before forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. The value must be from 1 to 1024 characters. + * + * Generated from protobuf field optional string path_prefix_rewrite = 41186361; + * @return string + */ + public function getPathPrefixRewrite() + { + return isset($this->path_prefix_rewrite) ? $this->path_prefix_rewrite : ''; + } + + public function hasPathPrefixRewrite() + { + return isset($this->path_prefix_rewrite); + } + + public function clearPathPrefixRewrite() + { + unset($this->path_prefix_rewrite); + } + + /** + * Before forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. The value must be from 1 to 1024 characters. + * + * Generated from protobuf field optional string path_prefix_rewrite = 41186361; + * @param string $var + * @return $this + */ + public function setPathPrefixRewrite($var) + { + GPBUtil::checkString($var, True); + $this->path_prefix_rewrite = $var; + + return $this; + } + + /** + * If specified, the pattern rewrites the URL path (based on the :path header) using the HTTP template syntax. A corresponding path_template_match must be specified. Any template variables must exist in the path_template_match field. - -At least one variable must be specified in the path_template_match field - You can omit variables from the rewritten URL - The * and ** operators cannot be matched unless they have a corresponding variable name - e.g. {format=*} or {var=**}. For example, a path_template_match of /static/{format=**} could be rewritten as /static/content/{format} to prefix /content to the URL. Variables can also be re-ordered in a rewrite, so that /{country}/{format}/{suffix=**} can be rewritten as /content/{format}/{country}/{suffix}. At least one non-empty routeRules[].matchRules[].path_template_match is required. Only one of path_prefix_rewrite or path_template_rewrite may be specified. + * + * Generated from protobuf field optional string path_template_rewrite = 423409569; + * @return string + */ + public function getPathTemplateRewrite() + { + return isset($this->path_template_rewrite) ? $this->path_template_rewrite : ''; + } + + public function hasPathTemplateRewrite() + { + return isset($this->path_template_rewrite); + } + + public function clearPathTemplateRewrite() + { + unset($this->path_template_rewrite); + } + + /** + * If specified, the pattern rewrites the URL path (based on the :path header) using the HTTP template syntax. A corresponding path_template_match must be specified. Any template variables must exist in the path_template_match field. - -At least one variable must be specified in the path_template_match field - You can omit variables from the rewritten URL - The * and ** operators cannot be matched unless they have a corresponding variable name - e.g. {format=*} or {var=**}. For example, a path_template_match of /static/{format=**} could be rewritten as /static/content/{format} to prefix /content to the URL. Variables can also be re-ordered in a rewrite, so that /{country}/{format}/{suffix=**} can be rewritten as /content/{format}/{country}/{suffix}. At least one non-empty routeRules[].matchRules[].path_template_match is required. Only one of path_prefix_rewrite or path_template_rewrite may be specified. + * + * Generated from protobuf field optional string path_template_rewrite = 423409569; + * @param string $var + * @return $this + */ + public function setPathTemplateRewrite($var) + { + GPBUtil::checkString($var, True); + $this->path_template_rewrite = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetwork.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetwork.php new file mode 100644 index 000000000000..c016b0f21c22 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetwork.php @@ -0,0 +1,479 @@ +google.cloud.compute.v1.UsableSubnetwork + */ +class UsableSubnetwork extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The external IPv6 address range that is assigned to this subnetwork. + * + * Generated from protobuf field optional string external_ipv6_prefix = 139299190; + */ + protected $external_ipv6_prefix = null; + /** + * [Output Only] The internal IPv6 address range that is assigned to this subnetwork. + * + * Generated from protobuf field optional string internal_ipv6_prefix = 506270056; + */ + protected $internal_ipv6_prefix = null; + /** + * The range of internal addresses that are owned by this subnetwork. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + */ + protected $ip_cidr_range = null; + /** + * The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack. + * Check the Ipv6AccessType enum for the list of possible values. + * + * Generated from protobuf field optional string ipv6_access_type = 504658653; + */ + protected $ipv6_access_type = null; + /** + * Network URL. + * + * Generated from protobuf field optional string network = 232872494; + */ + protected $network = null; + /** + * The purpose of the resource. This field can be either PRIVATE, GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, or PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. Subnets with purpose set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks that are reserved for Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. + * Check the Purpose enum for the list of possible values. + * + * Generated from protobuf field optional string purpose = 316407070; + */ + protected $purpose = null; + /** + * The role of subnetwork. Currently, this field is only used when purpose is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. This field can be updated with a patch request. + * Check the Role enum for the list of possible values. + * + * Generated from protobuf field optional string role = 3506294; + */ + protected $role = null; + /** + * Secondary IP ranges. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.UsableSubnetworkSecondaryRange secondary_ip_ranges = 136658915; + */ + private $secondary_ip_ranges; + /** + * The stack type for the subnet. If set to IPV4_ONLY, new VMs in the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and IPv6 addresses. If not specified, IPV4_ONLY is used. This field can be both set at resource creation time and updated using patch. + * Check the StackType enum for the list of possible values. + * + * Generated from protobuf field optional string stack_type = 425908881; + */ + protected $stack_type = null; + /** + * Subnetwork URL. + * + * Generated from protobuf field optional string subnetwork = 307827694; + */ + protected $subnetwork = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $external_ipv6_prefix + * [Output Only] The external IPv6 address range that is assigned to this subnetwork. + * @type string $internal_ipv6_prefix + * [Output Only] The internal IPv6 address range that is assigned to this subnetwork. + * @type string $ip_cidr_range + * The range of internal addresses that are owned by this subnetwork. + * @type string $ipv6_access_type + * The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack. + * Check the Ipv6AccessType enum for the list of possible values. + * @type string $network + * Network URL. + * @type string $purpose + * The purpose of the resource. This field can be either PRIVATE, GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, or PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. Subnets with purpose set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks that are reserved for Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. + * Check the Purpose enum for the list of possible values. + * @type string $role + * The role of subnetwork. Currently, this field is only used when purpose is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. This field can be updated with a patch request. + * Check the Role enum for the list of possible values. + * @type array<\Google\Cloud\Compute\V1\UsableSubnetworkSecondaryRange>|\Google\Protobuf\Internal\RepeatedField $secondary_ip_ranges + * Secondary IP ranges. + * @type string $stack_type + * The stack type for the subnet. If set to IPV4_ONLY, new VMs in the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and IPv6 addresses. If not specified, IPV4_ONLY is used. This field can be both set at resource creation time and updated using patch. + * Check the StackType enum for the list of possible values. + * @type string $subnetwork + * Subnetwork URL. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] The external IPv6 address range that is assigned to this subnetwork. + * + * Generated from protobuf field optional string external_ipv6_prefix = 139299190; + * @return string + */ + public function getExternalIpv6Prefix() + { + return isset($this->external_ipv6_prefix) ? $this->external_ipv6_prefix : ''; + } + + public function hasExternalIpv6Prefix() + { + return isset($this->external_ipv6_prefix); + } + + public function clearExternalIpv6Prefix() + { + unset($this->external_ipv6_prefix); + } + + /** + * [Output Only] The external IPv6 address range that is assigned to this subnetwork. + * + * Generated from protobuf field optional string external_ipv6_prefix = 139299190; + * @param string $var + * @return $this + */ + public function setExternalIpv6Prefix($var) + { + GPBUtil::checkString($var, True); + $this->external_ipv6_prefix = $var; + + return $this; + } + + /** + * [Output Only] The internal IPv6 address range that is assigned to this subnetwork. + * + * Generated from protobuf field optional string internal_ipv6_prefix = 506270056; + * @return string + */ + public function getInternalIpv6Prefix() + { + return isset($this->internal_ipv6_prefix) ? $this->internal_ipv6_prefix : ''; + } + + public function hasInternalIpv6Prefix() + { + return isset($this->internal_ipv6_prefix); + } + + public function clearInternalIpv6Prefix() + { + unset($this->internal_ipv6_prefix); + } + + /** + * [Output Only] The internal IPv6 address range that is assigned to this subnetwork. + * + * Generated from protobuf field optional string internal_ipv6_prefix = 506270056; + * @param string $var + * @return $this + */ + public function setInternalIpv6Prefix($var) + { + GPBUtil::checkString($var, True); + $this->internal_ipv6_prefix = $var; + + return $this; + } + + /** + * The range of internal addresses that are owned by this subnetwork. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + * @return string + */ + public function getIpCidrRange() + { + return isset($this->ip_cidr_range) ? $this->ip_cidr_range : ''; + } + + public function hasIpCidrRange() + { + return isset($this->ip_cidr_range); + } + + public function clearIpCidrRange() + { + unset($this->ip_cidr_range); + } + + /** + * The range of internal addresses that are owned by this subnetwork. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + * @param string $var + * @return $this + */ + public function setIpCidrRange($var) + { + GPBUtil::checkString($var, True); + $this->ip_cidr_range = $var; + + return $this; + } + + /** + * The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack. + * Check the Ipv6AccessType enum for the list of possible values. + * + * Generated from protobuf field optional string ipv6_access_type = 504658653; + * @return string + */ + public function getIpv6AccessType() + { + return isset($this->ipv6_access_type) ? $this->ipv6_access_type : ''; + } + + public function hasIpv6AccessType() + { + return isset($this->ipv6_access_type); + } + + public function clearIpv6AccessType() + { + unset($this->ipv6_access_type); + } + + /** + * The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack. + * Check the Ipv6AccessType enum for the list of possible values. + * + * Generated from protobuf field optional string ipv6_access_type = 504658653; + * @param string $var + * @return $this + */ + public function setIpv6AccessType($var) + { + GPBUtil::checkString($var, True); + $this->ipv6_access_type = $var; + + return $this; + } + + /** + * Network URL. + * + * Generated from protobuf field optional string network = 232872494; + * @return string + */ + public function getNetwork() + { + return isset($this->network) ? $this->network : ''; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * Network URL. + * + * Generated from protobuf field optional string network = 232872494; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * The purpose of the resource. This field can be either PRIVATE, GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, or PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. Subnets with purpose set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks that are reserved for Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. + * Check the Purpose enum for the list of possible values. + * + * Generated from protobuf field optional string purpose = 316407070; + * @return string + */ + public function getPurpose() + { + return isset($this->purpose) ? $this->purpose : ''; + } + + public function hasPurpose() + { + return isset($this->purpose); + } + + public function clearPurpose() + { + unset($this->purpose); + } + + /** + * The purpose of the resource. This field can be either PRIVATE, GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, or PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. Subnets with purpose set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks that are reserved for Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. + * Check the Purpose enum for the list of possible values. + * + * Generated from protobuf field optional string purpose = 316407070; + * @param string $var + * @return $this + */ + public function setPurpose($var) + { + GPBUtil::checkString($var, True); + $this->purpose = $var; + + return $this; + } + + /** + * The role of subnetwork. Currently, this field is only used when purpose is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. This field can be updated with a patch request. + * Check the Role enum for the list of possible values. + * + * Generated from protobuf field optional string role = 3506294; + * @return string + */ + public function getRole() + { + return isset($this->role) ? $this->role : ''; + } + + public function hasRole() + { + return isset($this->role); + } + + public function clearRole() + { + unset($this->role); + } + + /** + * The role of subnetwork. Currently, this field is only used when purpose is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. This field can be updated with a patch request. + * Check the Role enum for the list of possible values. + * + * Generated from protobuf field optional string role = 3506294; + * @param string $var + * @return $this + */ + public function setRole($var) + { + GPBUtil::checkString($var, True); + $this->role = $var; + + return $this; + } + + /** + * Secondary IP ranges. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.UsableSubnetworkSecondaryRange secondary_ip_ranges = 136658915; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSecondaryIpRanges() + { + return $this->secondary_ip_ranges; + } + + /** + * Secondary IP ranges. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.UsableSubnetworkSecondaryRange secondary_ip_ranges = 136658915; + * @param array<\Google\Cloud\Compute\V1\UsableSubnetworkSecondaryRange>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSecondaryIpRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\UsableSubnetworkSecondaryRange::class); + $this->secondary_ip_ranges = $arr; + + return $this; + } + + /** + * The stack type for the subnet. If set to IPV4_ONLY, new VMs in the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and IPv6 addresses. If not specified, IPV4_ONLY is used. This field can be both set at resource creation time and updated using patch. + * Check the StackType enum for the list of possible values. + * + * Generated from protobuf field optional string stack_type = 425908881; + * @return string + */ + public function getStackType() + { + return isset($this->stack_type) ? $this->stack_type : ''; + } + + public function hasStackType() + { + return isset($this->stack_type); + } + + public function clearStackType() + { + unset($this->stack_type); + } + + /** + * The stack type for the subnet. If set to IPV4_ONLY, new VMs in the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and IPv6 addresses. If not specified, IPV4_ONLY is used. This field can be both set at resource creation time and updated using patch. + * Check the StackType enum for the list of possible values. + * + * Generated from protobuf field optional string stack_type = 425908881; + * @param string $var + * @return $this + */ + public function setStackType($var) + { + GPBUtil::checkString($var, True); + $this->stack_type = $var; + + return $this; + } + + /** + * Subnetwork URL. + * + * Generated from protobuf field optional string subnetwork = 307827694; + * @return string + */ + public function getSubnetwork() + { + return isset($this->subnetwork) ? $this->subnetwork : ''; + } + + public function hasSubnetwork() + { + return isset($this->subnetwork); + } + + public function clearSubnetwork() + { + unset($this->subnetwork); + } + + /** + * Subnetwork URL. + * + * Generated from protobuf field optional string subnetwork = 307827694; + * @param string $var + * @return $this + */ + public function setSubnetwork($var) + { + GPBUtil::checkString($var, True); + $this->subnetwork = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetwork/Ipv6AccessType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetwork/Ipv6AccessType.php new file mode 100644 index 000000000000..131558f5e294 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetwork/Ipv6AccessType.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.UsableSubnetwork.Ipv6AccessType + */ +class Ipv6AccessType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_IPV6_ACCESS_TYPE = 0; + */ + const UNDEFINED_IPV6_ACCESS_TYPE = 0; + /** + * VMs on this subnet will be assigned IPv6 addresses that are accessible via the Internet, as well as the VPC network. + * + * Generated from protobuf enum EXTERNAL = 35607499; + */ + const EXTERNAL = 35607499; + /** + * VMs on this subnet will be assigned IPv6 addresses that are only accessible over the VPC network. + * + * Generated from protobuf enum INTERNAL = 279295677; + */ + const INTERNAL = 279295677; + + private static $valueToName = [ + self::UNDEFINED_IPV6_ACCESS_TYPE => 'UNDEFINED_IPV6_ACCESS_TYPE', + self::EXTERNAL => 'EXTERNAL', + self::INTERNAL => 'INTERNAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Ipv6AccessType::class, \Google\Cloud\Compute\V1\UsableSubnetwork_Ipv6AccessType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetwork/Purpose.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetwork/Purpose.php new file mode 100644 index 000000000000..6cd650148467 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetwork/Purpose.php @@ -0,0 +1,103 @@ +google.cloud.compute.v1.UsableSubnetwork.Purpose + */ +class Purpose +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PURPOSE = 0; + */ + const UNDEFINED_PURPOSE = 0; + /** + * Subnet reserved for Global Envoy-based Load Balancing. + * + * Generated from protobuf enum GLOBAL_MANAGED_PROXY = 236463602; + */ + const GLOBAL_MANAGED_PROXY = 236463602; + /** + * Subnet reserved for Internal HTTP(S) Load Balancing. This is a legacy purpose, please use REGIONAL_MANAGED_PROXY instead. + * + * Generated from protobuf enum INTERNAL_HTTPS_LOAD_BALANCER = 248748889; + */ + const INTERNAL_HTTPS_LOAD_BALANCER = 248748889; + /** + * Regular user created or automatically created subnet. + * + * Generated from protobuf enum PRIVATE = 403485027; + */ + const PBPRIVATE = 403485027; + /** + * Subnetwork used as source range for Private NAT Gateways. + * + * Generated from protobuf enum PRIVATE_NAT = 367764517; + */ + const PRIVATE_NAT = 367764517; + /** + * Regular user created or automatically created subnet. + * + * Generated from protobuf enum PRIVATE_RFC_1918 = 254902107; + */ + const PRIVATE_RFC_1918 = 254902107; + /** + * Subnetworks created for Private Service Connect in the producer network. + * + * Generated from protobuf enum PRIVATE_SERVICE_CONNECT = 48134724; + */ + const PRIVATE_SERVICE_CONNECT = 48134724; + /** + * Subnetwork used for Regional Envoy-based Load Balancing. + * + * Generated from protobuf enum REGIONAL_MANAGED_PROXY = 153049966; + */ + const REGIONAL_MANAGED_PROXY = 153049966; + + private static $valueToName = [ + self::UNDEFINED_PURPOSE => 'UNDEFINED_PURPOSE', + self::GLOBAL_MANAGED_PROXY => 'GLOBAL_MANAGED_PROXY', + self::INTERNAL_HTTPS_LOAD_BALANCER => 'INTERNAL_HTTPS_LOAD_BALANCER', + self::PBPRIVATE => 'PRIVATE', + self::PRIVATE_NAT => 'PRIVATE_NAT', + self::PRIVATE_RFC_1918 => 'PRIVATE_RFC_1918', + self::PRIVATE_SERVICE_CONNECT => 'PRIVATE_SERVICE_CONNECT', + self::REGIONAL_MANAGED_PROXY => 'REGIONAL_MANAGED_PROXY', + ]; + + 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)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Purpose::class, \Google\Cloud\Compute\V1\UsableSubnetwork_Purpose::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetwork/Role.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetwork/Role.php new file mode 100644 index 000000000000..70f612761a0d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetwork/Role.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.UsableSubnetwork.Role + */ +class Role +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ROLE = 0; + */ + const UNDEFINED_ROLE = 0; + /** + * The ACTIVE subnet that is currently used. + * + * Generated from protobuf enum ACTIVE = 314733318; + */ + const ACTIVE = 314733318; + /** + * The BACKUP subnet that could be promoted to ACTIVE. + * + * Generated from protobuf enum BACKUP = 341010882; + */ + const BACKUP = 341010882; + + private static $valueToName = [ + self::UNDEFINED_ROLE => 'UNDEFINED_ROLE', + self::ACTIVE => 'ACTIVE', + self::BACKUP => 'BACKUP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Role::class, \Google\Cloud\Compute\V1\UsableSubnetwork_Role::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetwork/StackType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetwork/StackType.php new file mode 100644 index 000000000000..40c3a4593ea0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetwork/StackType.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.UsableSubnetwork.StackType + */ +class StackType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STACK_TYPE = 0; + */ + const UNDEFINED_STACK_TYPE = 0; + /** + * New VMs in this subnet can have both IPv4 and IPv6 addresses. + * + * Generated from protobuf enum IPV4_IPV6 = 22197249; + */ + const IPV4_IPV6 = 22197249; + /** + * New VMs in this subnet will only be assigned IPv4 addresses. + * + * Generated from protobuf enum IPV4_ONLY = 22373798; + */ + const IPV4_ONLY = 22373798; + + private static $valueToName = [ + self::UNDEFINED_STACK_TYPE => 'UNDEFINED_STACK_TYPE', + self::IPV4_IPV6 => 'IPV4_IPV6', + self::IPV4_ONLY => 'IPV4_ONLY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StackType::class, \Google\Cloud\Compute\V1\UsableSubnetwork_StackType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetworkSecondaryRange.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetworkSecondaryRange.php new file mode 100644 index 000000000000..c39bbac9b2d5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetworkSecondaryRange.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.UsableSubnetworkSecondaryRange + */ +class UsableSubnetworkSecondaryRange extends \Google\Protobuf\Internal\Message +{ + /** + * The range of IP addresses belonging to this subnetwork secondary range. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + */ + protected $ip_cidr_range = null; + /** + * The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork. + * + * Generated from protobuf field optional string range_name = 332216397; + */ + protected $range_name = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $ip_cidr_range + * The range of IP addresses belonging to this subnetwork secondary range. + * @type string $range_name + * The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The range of IP addresses belonging to this subnetwork secondary range. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + * @return string + */ + public function getIpCidrRange() + { + return isset($this->ip_cidr_range) ? $this->ip_cidr_range : ''; + } + + public function hasIpCidrRange() + { + return isset($this->ip_cidr_range); + } + + public function clearIpCidrRange() + { + unset($this->ip_cidr_range); + } + + /** + * The range of IP addresses belonging to this subnetwork secondary range. + * + * Generated from protobuf field optional string ip_cidr_range = 98117322; + * @param string $var + * @return $this + */ + public function setIpCidrRange($var) + { + GPBUtil::checkString($var, True); + $this->ip_cidr_range = $var; + + return $this; + } + + /** + * The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork. + * + * Generated from protobuf field optional string range_name = 332216397; + * @return string + */ + public function getRangeName() + { + return isset($this->range_name) ? $this->range_name : ''; + } + + public function hasRangeName() + { + return isset($this->range_name); + } + + public function clearRangeName() + { + unset($this->range_name); + } + + /** + * The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork. + * + * Generated from protobuf field optional string range_name = 332216397; + * @param string $var + * @return $this + */ + public function setRangeName($var) + { + GPBUtil::checkString($var, True); + $this->range_name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetworksAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetworksAggregatedList.php new file mode 100644 index 000000000000..dd62c9908aa4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetworksAggregatedList.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.UsableSubnetworksAggregatedList + */ +class UsableSubnetworksAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * [Output] A list of usable subnetwork URLs. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.UsableSubnetwork items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#usableSubnetworksAggregatedList for aggregated lists of usable subnetworks. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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. In special cases listUsable may return 0 subnetworks and nextPageToken which still should be used to get the next page of results. + * + * Generated from protobuf field optional string next_page_token = 79797525; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type array<\Google\Cloud\Compute\V1\UsableSubnetwork>|\Google\Protobuf\Internal\RepeatedField $items + * [Output] A list of usable subnetwork URLs. + * @type string $kind + * [Output Only] Type of resource. Always compute#usableSubnetworksAggregatedList for aggregated lists of usable subnetworks. + * @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. In special cases listUsable may return 0 subnetworks and nextPageToken which still should be used to get the next page of 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] The unique identifier for the resource. This identifier is 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] The unique identifier for the resource. This identifier is 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; + } + + /** + * [Output] A list of usable subnetwork URLs. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.UsableSubnetwork items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * [Output] A list of usable subnetwork URLs. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.UsableSubnetwork items = 100526016; + * @param array<\Google\Cloud\Compute\V1\UsableSubnetwork>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\UsableSubnetwork::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#usableSubnetworksAggregatedList for aggregated lists of usable subnetworks. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#usableSubnetworksAggregatedList for aggregated lists of usable subnetworks. + * + * 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. In special cases listUsable may return 0 subnetworks and nextPageToken which still should be used to get the next page of 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. In special cases listUsable may return 0 subnetworks and nextPageToken which still should be used to get the next page of 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsageExportLocation.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsageExportLocation.php new file mode 100644 index 000000000000..063bc5e2dc0b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsageExportLocation.php @@ -0,0 +1,121 @@ +google.cloud.compute.v1.UsageExportLocation + */ +class UsageExportLocation extends \Google\Protobuf\Internal\Message +{ + /** + * The name of an existing bucket in Cloud Storage where the usage report object is stored. The Google Service Account is granted write access to this bucket. This can either be the bucket name by itself, such as example-bucket, or the bucket name with gs:// or https://storage.googleapis.com/ in front of it, such as gs://example-bucket. + * + * Generated from protobuf field optional string bucket_name = 283610048; + */ + protected $bucket_name = null; + /** + * An optional prefix for the name of the usage report object stored in bucketName. If not supplied, defaults to usage_gce. The report is stored as a CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the usage according to Pacific Time. If you supply a prefix, it should conform to Cloud Storage object naming conventions. + * + * Generated from protobuf field optional string report_name_prefix = 320198715; + */ + protected $report_name_prefix = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $bucket_name + * The name of an existing bucket in Cloud Storage where the usage report object is stored. The Google Service Account is granted write access to this bucket. This can either be the bucket name by itself, such as example-bucket, or the bucket name with gs:// or https://storage.googleapis.com/ in front of it, such as gs://example-bucket. + * @type string $report_name_prefix + * An optional prefix for the name of the usage report object stored in bucketName. If not supplied, defaults to usage_gce. The report is stored as a CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the usage according to Pacific Time. If you supply a prefix, it should conform to Cloud Storage object naming conventions. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The name of an existing bucket in Cloud Storage where the usage report object is stored. The Google Service Account is granted write access to this bucket. This can either be the bucket name by itself, such as example-bucket, or the bucket name with gs:// or https://storage.googleapis.com/ in front of it, such as gs://example-bucket. + * + * Generated from protobuf field optional string bucket_name = 283610048; + * @return string + */ + public function getBucketName() + { + return isset($this->bucket_name) ? $this->bucket_name : ''; + } + + public function hasBucketName() + { + return isset($this->bucket_name); + } + + public function clearBucketName() + { + unset($this->bucket_name); + } + + /** + * The name of an existing bucket in Cloud Storage where the usage report object is stored. The Google Service Account is granted write access to this bucket. This can either be the bucket name by itself, such as example-bucket, or the bucket name with gs:// or https://storage.googleapis.com/ in front of it, such as gs://example-bucket. + * + * Generated from protobuf field optional string bucket_name = 283610048; + * @param string $var + * @return $this + */ + public function setBucketName($var) + { + GPBUtil::checkString($var, True); + $this->bucket_name = $var; + + return $this; + } + + /** + * An optional prefix for the name of the usage report object stored in bucketName. If not supplied, defaults to usage_gce. The report is stored as a CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the usage according to Pacific Time. If you supply a prefix, it should conform to Cloud Storage object naming conventions. + * + * Generated from protobuf field optional string report_name_prefix = 320198715; + * @return string + */ + public function getReportNamePrefix() + { + return isset($this->report_name_prefix) ? $this->report_name_prefix : ''; + } + + public function hasReportNamePrefix() + { + return isset($this->report_name_prefix); + } + + public function clearReportNamePrefix() + { + unset($this->report_name_prefix); + } + + /** + * An optional prefix for the name of the usage report object stored in bucketName. If not supplied, defaults to usage_gce. The report is stored as a CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the usage according to Pacific Time. If you supply a prefix, it should conform to Cloud Storage object naming conventions. + * + * Generated from protobuf field optional string report_name_prefix = 320198715; + * @param string $var + * @return $this + */ + public function setReportNamePrefix($var) + { + GPBUtil::checkString($var, True); + $this->report_name_prefix = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ValidateRegionUrlMapRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ValidateRegionUrlMapRequest.php new file mode 100644 index 000000000000..4d46b7b19db7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ValidateRegionUrlMapRequest.php @@ -0,0 +1,198 @@ +google.cloud.compute.v1.ValidateRegionUrlMapRequest + */ +class ValidateRegionUrlMapRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionUrlMapsValidateRequest region_url_maps_validate_request_resource = 56632858 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_url_maps_validate_request_resource = null; + /** + * Name of the UrlMap resource to be validated as. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url_map = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $urlMap Name of the UrlMap resource to be validated as. + * @param \Google\Cloud\Compute\V1\RegionUrlMapsValidateRequest $regionUrlMapsValidateRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\ValidateRegionUrlMapRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $urlMap, \Google\Cloud\Compute\V1\RegionUrlMapsValidateRequest $regionUrlMapsValidateRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setUrlMap($urlMap) + ->setRegionUrlMapsValidateRequestResource($regionUrlMapsValidateRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region scoping this request. + * @type \Google\Cloud\Compute\V1\RegionUrlMapsValidateRequest $region_url_maps_validate_request_resource + * The body resource for this request + * @type string $url_map + * Name of the UrlMap resource to be validated as. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the region scoping this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Name of the region scoping 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; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionUrlMapsValidateRequest region_url_maps_validate_request_resource = 56632858 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionUrlMapsValidateRequest|null + */ + public function getRegionUrlMapsValidateRequestResource() + { + return $this->region_url_maps_validate_request_resource; + } + + public function hasRegionUrlMapsValidateRequestResource() + { + return isset($this->region_url_maps_validate_request_resource); + } + + public function clearRegionUrlMapsValidateRequestResource() + { + unset($this->region_url_maps_validate_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionUrlMapsValidateRequest region_url_maps_validate_request_resource = 56632858 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionUrlMapsValidateRequest $var + * @return $this + */ + public function setRegionUrlMapsValidateRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionUrlMapsValidateRequest::class); + $this->region_url_maps_validate_request_resource = $var; + + return $this; + } + + /** + * Name of the UrlMap resource to be validated as. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUrlMap() + { + return $this->url_map; + } + + /** + * Name of the UrlMap resource to be validated as. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUrlMap($var) + { + GPBUtil::checkString($var, True); + $this->url_map = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ValidateUrlMapRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ValidateUrlMapRequest.php new file mode 100644 index 000000000000..616049e90364 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ValidateUrlMapRequest.php @@ -0,0 +1,162 @@ +google.cloud.compute.v1.ValidateUrlMapRequest + */ +class ValidateUrlMapRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the UrlMap resource to be validated as. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url_map = ''; + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMapsValidateRequest url_maps_validate_request_resource = 395913455 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $url_maps_validate_request_resource = null; + + /** + * @param string $project Project ID for this request. + * @param string $urlMap Name of the UrlMap resource to be validated as. + * @param \Google\Cloud\Compute\V1\UrlMapsValidateRequest $urlMapsValidateRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\ValidateUrlMapRequest + * + * @experimental + */ + public static function build(string $project, string $urlMap, \Google\Cloud\Compute\V1\UrlMapsValidateRequest $urlMapsValidateRequestResource): self + { + return (new self()) + ->setProject($project) + ->setUrlMap($urlMap) + ->setUrlMapsValidateRequestResource($urlMapsValidateRequestResource); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $url_map + * Name of the UrlMap resource to be validated as. + * @type \Google\Cloud\Compute\V1\UrlMapsValidateRequest $url_maps_validate_request_resource + * The body resource for this request + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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; + } + + /** + * Name of the UrlMap resource to be validated as. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getUrlMap() + { + return $this->url_map; + } + + /** + * Name of the UrlMap resource to be validated as. + * + * Generated from protobuf field string url_map = 367020684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setUrlMap($var) + { + GPBUtil::checkString($var, True); + $this->url_map = $var; + + return $this; + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMapsValidateRequest url_maps_validate_request_resource = 395913455 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\UrlMapsValidateRequest|null + */ + public function getUrlMapsValidateRequestResource() + { + return $this->url_maps_validate_request_resource; + } + + public function hasUrlMapsValidateRequestResource() + { + return isset($this->url_maps_validate_request_resource); + } + + public function clearUrlMapsValidateRequestResource() + { + unset($this->url_maps_validate_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.UrlMapsValidateRequest url_maps_validate_request_resource = 395913455 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\UrlMapsValidateRequest $var + * @return $this + */ + public function setUrlMapsValidateRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\UrlMapsValidateRequest::class); + $this->url_maps_validate_request_resource = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VmEndpointNatMappings.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VmEndpointNatMappings.php new file mode 100644 index 000000000000..ffa533b3368f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VmEndpointNatMappings.php @@ -0,0 +1,104 @@ +google.cloud.compute.v1.VmEndpointNatMappings + */ +class VmEndpointNatMappings extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the VM instance which the endpoint belongs to + * + * Generated from protobuf field optional string instance_name = 227947509; + */ + protected $instance_name = null; + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings interface_nat_mappings = 256196617; + */ + private $interface_nat_mappings; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_name + * Name of the VM instance which the endpoint belongs to + * @type array<\Google\Cloud\Compute\V1\VmEndpointNatMappingsInterfaceNatMappings>|\Google\Protobuf\Internal\RepeatedField $interface_nat_mappings + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the VM instance which the endpoint belongs to + * + * Generated from protobuf field optional string instance_name = 227947509; + * @return string + */ + public function getInstanceName() + { + return isset($this->instance_name) ? $this->instance_name : ''; + } + + public function hasInstanceName() + { + return isset($this->instance_name); + } + + public function clearInstanceName() + { + unset($this->instance_name); + } + + /** + * Name of the VM instance which the endpoint belongs to + * + * Generated from protobuf field optional string instance_name = 227947509; + * @param string $var + * @return $this + */ + public function setInstanceName($var) + { + GPBUtil::checkString($var, True); + $this->instance_name = $var; + + return $this; + } + + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings interface_nat_mappings = 256196617; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInterfaceNatMappings() + { + return $this->interface_nat_mappings; + } + + /** + * Generated from protobuf field repeated .google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings interface_nat_mappings = 256196617; + * @param array<\Google\Cloud\Compute\V1\VmEndpointNatMappingsInterfaceNatMappings>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInterfaceNatMappings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\VmEndpointNatMappingsInterfaceNatMappings::class); + $this->interface_nat_mappings = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VmEndpointNatMappingsInterfaceNatMappings.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VmEndpointNatMappingsInterfaceNatMappings.php new file mode 100644 index 000000000000..5f3539e10a13 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VmEndpointNatMappingsInterfaceNatMappings.php @@ -0,0 +1,311 @@ +google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings + */ +class VmEndpointNatMappingsInterfaceNatMappings extends \Google\Protobuf\Internal\Message +{ + /** + * List of all drain IP:port-range mappings assigned to this interface. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + * + * Generated from protobuf field repeated string drain_nat_ip_port_ranges = 395440577; + */ + private $drain_nat_ip_port_ranges; + /** + * A list of all IP:port-range mappings assigned to this interface. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + * + * Generated from protobuf field repeated string nat_ip_port_ranges = 531830810; + */ + private $nat_ip_port_ranges; + /** + * Total number of drain ports across all NAT IPs allocated to this interface. It equals to the aggregated port number in the field drain_nat_ip_port_ranges. + * + * Generated from protobuf field optional int32 num_total_drain_nat_ports = 335532793; + */ + protected $num_total_drain_nat_ports = null; + /** + * Total number of ports across all NAT IPs allocated to this interface. It equals to the aggregated port number in the field nat_ip_port_ranges. + * + * Generated from protobuf field optional int32 num_total_nat_ports = 299904384; + */ + protected $num_total_nat_ports = null; + /** + * Information about mappings provided by rules in this NAT. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings rule_mappings = 486192968; + */ + private $rule_mappings; + /** + * Alias IP range for this interface endpoint. It will be a private (RFC 1918) IP range. Examples: "10.33.4.55/32", or "192.168.5.0/24". + * + * Generated from protobuf field optional string source_alias_ip_range = 440340952; + */ + protected $source_alias_ip_range = null; + /** + * Primary IP of the VM for this NIC. + * + * Generated from protobuf field optional string source_virtual_ip = 149836159; + */ + protected $source_virtual_ip = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $drain_nat_ip_port_ranges + * List of all drain IP:port-range mappings assigned to this interface. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + * @type array|\Google\Protobuf\Internal\RepeatedField $nat_ip_port_ranges + * A list of all IP:port-range mappings assigned to this interface. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + * @type int $num_total_drain_nat_ports + * Total number of drain ports across all NAT IPs allocated to this interface. It equals to the aggregated port number in the field drain_nat_ip_port_ranges. + * @type int $num_total_nat_ports + * Total number of ports across all NAT IPs allocated to this interface. It equals to the aggregated port number in the field nat_ip_port_ranges. + * @type array<\Google\Cloud\Compute\V1\VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings>|\Google\Protobuf\Internal\RepeatedField $rule_mappings + * Information about mappings provided by rules in this NAT. + * @type string $source_alias_ip_range + * Alias IP range for this interface endpoint. It will be a private (RFC 1918) IP range. Examples: "10.33.4.55/32", or "192.168.5.0/24". + * @type string $source_virtual_ip + * Primary IP of the VM for this NIC. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * List of all drain IP:port-range mappings assigned to this interface. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + * + * Generated from protobuf field repeated string drain_nat_ip_port_ranges = 395440577; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDrainNatIpPortRanges() + { + return $this->drain_nat_ip_port_ranges; + } + + /** + * List of all drain IP:port-range mappings assigned to this interface. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + * + * Generated from protobuf field repeated string drain_nat_ip_port_ranges = 395440577; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDrainNatIpPortRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->drain_nat_ip_port_ranges = $arr; + + return $this; + } + + /** + * A list of all IP:port-range mappings assigned to this interface. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + * + * Generated from protobuf field repeated string nat_ip_port_ranges = 531830810; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNatIpPortRanges() + { + return $this->nat_ip_port_ranges; + } + + /** + * A list of all IP:port-range mappings assigned to this interface. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + * + * Generated from protobuf field repeated string nat_ip_port_ranges = 531830810; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNatIpPortRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->nat_ip_port_ranges = $arr; + + return $this; + } + + /** + * Total number of drain ports across all NAT IPs allocated to this interface. It equals to the aggregated port number in the field drain_nat_ip_port_ranges. + * + * Generated from protobuf field optional int32 num_total_drain_nat_ports = 335532793; + * @return int + */ + public function getNumTotalDrainNatPorts() + { + return isset($this->num_total_drain_nat_ports) ? $this->num_total_drain_nat_ports : 0; + } + + public function hasNumTotalDrainNatPorts() + { + return isset($this->num_total_drain_nat_ports); + } + + public function clearNumTotalDrainNatPorts() + { + unset($this->num_total_drain_nat_ports); + } + + /** + * Total number of drain ports across all NAT IPs allocated to this interface. It equals to the aggregated port number in the field drain_nat_ip_port_ranges. + * + * Generated from protobuf field optional int32 num_total_drain_nat_ports = 335532793; + * @param int $var + * @return $this + */ + public function setNumTotalDrainNatPorts($var) + { + GPBUtil::checkInt32($var); + $this->num_total_drain_nat_ports = $var; + + return $this; + } + + /** + * Total number of ports across all NAT IPs allocated to this interface. It equals to the aggregated port number in the field nat_ip_port_ranges. + * + * Generated from protobuf field optional int32 num_total_nat_ports = 299904384; + * @return int + */ + public function getNumTotalNatPorts() + { + return isset($this->num_total_nat_ports) ? $this->num_total_nat_ports : 0; + } + + public function hasNumTotalNatPorts() + { + return isset($this->num_total_nat_ports); + } + + public function clearNumTotalNatPorts() + { + unset($this->num_total_nat_ports); + } + + /** + * Total number of ports across all NAT IPs allocated to this interface. It equals to the aggregated port number in the field nat_ip_port_ranges. + * + * Generated from protobuf field optional int32 num_total_nat_ports = 299904384; + * @param int $var + * @return $this + */ + public function setNumTotalNatPorts($var) + { + GPBUtil::checkInt32($var); + $this->num_total_nat_ports = $var; + + return $this; + } + + /** + * Information about mappings provided by rules in this NAT. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings rule_mappings = 486192968; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRuleMappings() + { + return $this->rule_mappings; + } + + /** + * Information about mappings provided by rules in this NAT. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings rule_mappings = 486192968; + * @param array<\Google\Cloud\Compute\V1\VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRuleMappings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings::class); + $this->rule_mappings = $arr; + + return $this; + } + + /** + * Alias IP range for this interface endpoint. It will be a private (RFC 1918) IP range. Examples: "10.33.4.55/32", or "192.168.5.0/24". + * + * Generated from protobuf field optional string source_alias_ip_range = 440340952; + * @return string + */ + public function getSourceAliasIpRange() + { + return isset($this->source_alias_ip_range) ? $this->source_alias_ip_range : ''; + } + + public function hasSourceAliasIpRange() + { + return isset($this->source_alias_ip_range); + } + + public function clearSourceAliasIpRange() + { + unset($this->source_alias_ip_range); + } + + /** + * Alias IP range for this interface endpoint. It will be a private (RFC 1918) IP range. Examples: "10.33.4.55/32", or "192.168.5.0/24". + * + * Generated from protobuf field optional string source_alias_ip_range = 440340952; + * @param string $var + * @return $this + */ + public function setSourceAliasIpRange($var) + { + GPBUtil::checkString($var, True); + $this->source_alias_ip_range = $var; + + return $this; + } + + /** + * Primary IP of the VM for this NIC. + * + * Generated from protobuf field optional string source_virtual_ip = 149836159; + * @return string + */ + public function getSourceVirtualIp() + { + return isset($this->source_virtual_ip) ? $this->source_virtual_ip : ''; + } + + public function hasSourceVirtualIp() + { + return isset($this->source_virtual_ip); + } + + public function clearSourceVirtualIp() + { + unset($this->source_virtual_ip); + } + + /** + * Primary IP of the VM for this NIC. + * + * Generated from protobuf field optional string source_virtual_ip = 149836159; + * @param string $var + * @return $this + */ + public function setSourceVirtualIp($var) + { + GPBUtil::checkString($var, True); + $this->source_virtual_ip = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings.php new file mode 100644 index 000000000000..a476d240816d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings.php @@ -0,0 +1,233 @@ +google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings + */ +class VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings extends \Google\Protobuf\Internal\Message +{ + /** + * List of all drain IP:port-range mappings assigned to this interface by this rule. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + * + * Generated from protobuf field repeated string drain_nat_ip_port_ranges = 395440577; + */ + private $drain_nat_ip_port_ranges; + /** + * A list of all IP:port-range mappings assigned to this interface by this rule. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + * + * Generated from protobuf field repeated string nat_ip_port_ranges = 531830810; + */ + private $nat_ip_port_ranges; + /** + * Total number of drain ports across all NAT IPs allocated to this interface by this rule. It equals the aggregated port number in the field drain_nat_ip_port_ranges. + * + * Generated from protobuf field optional int32 num_total_drain_nat_ports = 335532793; + */ + protected $num_total_drain_nat_ports = null; + /** + * Total number of ports across all NAT IPs allocated to this interface by this rule. It equals the aggregated port number in the field nat_ip_port_ranges. + * + * Generated from protobuf field optional int32 num_total_nat_ports = 299904384; + */ + protected $num_total_nat_ports = null; + /** + * Rule number of the NAT Rule. + * + * Generated from protobuf field optional int32 rule_number = 535211500; + */ + protected $rule_number = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $drain_nat_ip_port_ranges + * List of all drain IP:port-range mappings assigned to this interface by this rule. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + * @type array|\Google\Protobuf\Internal\RepeatedField $nat_ip_port_ranges + * A list of all IP:port-range mappings assigned to this interface by this rule. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + * @type int $num_total_drain_nat_ports + * Total number of drain ports across all NAT IPs allocated to this interface by this rule. It equals the aggregated port number in the field drain_nat_ip_port_ranges. + * @type int $num_total_nat_ports + * Total number of ports across all NAT IPs allocated to this interface by this rule. It equals the aggregated port number in the field nat_ip_port_ranges. + * @type int $rule_number + * Rule number of the NAT Rule. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * List of all drain IP:port-range mappings assigned to this interface by this rule. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + * + * Generated from protobuf field repeated string drain_nat_ip_port_ranges = 395440577; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDrainNatIpPortRanges() + { + return $this->drain_nat_ip_port_ranges; + } + + /** + * List of all drain IP:port-range mappings assigned to this interface by this rule. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + * + * Generated from protobuf field repeated string drain_nat_ip_port_ranges = 395440577; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDrainNatIpPortRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->drain_nat_ip_port_ranges = $arr; + + return $this; + } + + /** + * A list of all IP:port-range mappings assigned to this interface by this rule. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + * + * Generated from protobuf field repeated string nat_ip_port_ranges = 531830810; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNatIpPortRanges() + { + return $this->nat_ip_port_ranges; + } + + /** + * A list of all IP:port-range mappings assigned to this interface by this rule. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + * + * Generated from protobuf field repeated string nat_ip_port_ranges = 531830810; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNatIpPortRanges($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->nat_ip_port_ranges = $arr; + + return $this; + } + + /** + * Total number of drain ports across all NAT IPs allocated to this interface by this rule. It equals the aggregated port number in the field drain_nat_ip_port_ranges. + * + * Generated from protobuf field optional int32 num_total_drain_nat_ports = 335532793; + * @return int + */ + public function getNumTotalDrainNatPorts() + { + return isset($this->num_total_drain_nat_ports) ? $this->num_total_drain_nat_ports : 0; + } + + public function hasNumTotalDrainNatPorts() + { + return isset($this->num_total_drain_nat_ports); + } + + public function clearNumTotalDrainNatPorts() + { + unset($this->num_total_drain_nat_ports); + } + + /** + * Total number of drain ports across all NAT IPs allocated to this interface by this rule. It equals the aggregated port number in the field drain_nat_ip_port_ranges. + * + * Generated from protobuf field optional int32 num_total_drain_nat_ports = 335532793; + * @param int $var + * @return $this + */ + public function setNumTotalDrainNatPorts($var) + { + GPBUtil::checkInt32($var); + $this->num_total_drain_nat_ports = $var; + + return $this; + } + + /** + * Total number of ports across all NAT IPs allocated to this interface by this rule. It equals the aggregated port number in the field nat_ip_port_ranges. + * + * Generated from protobuf field optional int32 num_total_nat_ports = 299904384; + * @return int + */ + public function getNumTotalNatPorts() + { + return isset($this->num_total_nat_ports) ? $this->num_total_nat_ports : 0; + } + + public function hasNumTotalNatPorts() + { + return isset($this->num_total_nat_ports); + } + + public function clearNumTotalNatPorts() + { + unset($this->num_total_nat_ports); + } + + /** + * Total number of ports across all NAT IPs allocated to this interface by this rule. It equals the aggregated port number in the field nat_ip_port_ranges. + * + * Generated from protobuf field optional int32 num_total_nat_ports = 299904384; + * @param int $var + * @return $this + */ + public function setNumTotalNatPorts($var) + { + GPBUtil::checkInt32($var); + $this->num_total_nat_ports = $var; + + return $this; + } + + /** + * Rule number of the NAT Rule. + * + * Generated from protobuf field optional int32 rule_number = 535211500; + * @return int + */ + public function getRuleNumber() + { + return isset($this->rule_number) ? $this->rule_number : 0; + } + + public function hasRuleNumber() + { + return isset($this->rule_number); + } + + public function clearRuleNumber() + { + unset($this->rule_number); + } + + /** + * Rule number of the NAT Rule. + * + * Generated from protobuf field optional int32 rule_number = 535211500; + * @param int $var + * @return $this + */ + public function setRuleNumber($var) + { + GPBUtil::checkInt32($var); + $this->rule_number = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VmEndpointNatMappingsList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VmEndpointNatMappingsList.php new file mode 100644 index 000000000000..408901e98ba1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VmEndpointNatMappingsList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.VmEndpointNatMappingsList + */ +class VmEndpointNatMappingsList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of resource. Always compute#vmEndpointNatMappingsList for lists of Nat mappings of VM endpoints. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] A list of Nat mapping information of VM endpoints. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VmEndpointNatMappings result = 139315229; + */ + private $result; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of resource. Always compute#vmEndpointNatMappingsList for lists of Nat mappings of VM endpoints. + * @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 array<\Google\Cloud\Compute\V1\VmEndpointNatMappings>|\Google\Protobuf\Internal\RepeatedField $result + * [Output Only] A list of Nat mapping information of VM endpoints. + * @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] The unique identifier for the resource. This identifier is 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] The unique identifier for the resource. This identifier is 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; + } + + /** + * [Output Only] Type of resource. Always compute#vmEndpointNatMappingsList for lists of Nat mappings of VM endpoints. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#vmEndpointNatMappingsList for lists of Nat mappings of VM endpoints. + * + * 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] A list of Nat mapping information of VM endpoints. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VmEndpointNatMappings result = 139315229; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResult() + { + return $this->result; + } + + /** + * [Output Only] A list of Nat mapping information of VM endpoints. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VmEndpointNatMappings result = 139315229; + * @param array<\Google\Cloud\Compute\V1\VmEndpointNatMappings>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResult($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\VmEndpointNatMappings::class); + $this->result = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGateway.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGateway.php new file mode 100644 index 000000000000..198ce0a2d0eb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGateway.php @@ -0,0 +1,593 @@ +google.cloud.compute.v1.VpnGateway + */ +class VpnGateway extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * The IP family of the gateway IPs for the HA-VPN gateway interfaces. If not specified, IPV4 will be used. + * Check the GatewayIpVersion enum for the list of possible values. + * + * Generated from protobuf field optional string gateway_ip_version = 65074843; + */ + protected $gateway_ip_version = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of resource. Always compute#vpnGateway for VPN gateways. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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 a VpnGateway. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + */ + protected $label_fingerprint = null; + /** + * 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. + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * URL of the network to which this VPN gateway is attached. Provided by the client when the VPN gateway is created. + * + * Generated from protobuf field optional string network = 232872494; + */ + protected $network = null; + /** + * [Output Only] URL of the region where the VPN gateway resides. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * The stack type for this VPN gateway to identify the IP protocols that are enabled. Possible values are: IPV4_ONLY, IPV4_IPV6. If not specified, IPV4_ONLY will be used. + * Check the StackType enum for the list of possible values. + * + * Generated from protobuf field optional string stack_type = 425908881; + */ + protected $stack_type = null; + /** + * The list of VPN interfaces associated with this VPN gateway. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VpnGatewayVpnGatewayInterface vpn_interfaces = 91842181; + */ + private $vpn_interfaces; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type string $gateway_ip_version + * The IP family of the gateway IPs for the HA-VPN gateway interfaces. If not specified, IPV4 will be used. + * Check the GatewayIpVersion enum for the list of possible values. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @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 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 + * 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 string $network + * URL of the network to which this VPN gateway is attached. Provided by the client when the VPN gateway is created. + * @type string $region + * [Output Only] URL of the region where the VPN gateway resides. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $stack_type + * The stack type for this VPN gateway to identify the IP protocols that are enabled. Possible values are: IPV4_ONLY, IPV4_IPV6. If not specified, IPV4_ONLY will be used. + * Check the StackType enum for the list of possible values. + * @type array<\Google\Cloud\Compute\V1\VpnGatewayVpnGatewayInterface>|\Google\Protobuf\Internal\RepeatedField $vpn_interfaces + * The list of VPN interfaces associated with this VPN gateway. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * The IP family of the gateway IPs for the HA-VPN gateway interfaces. If not specified, IPV4 will be used. + * Check the GatewayIpVersion enum for the list of possible values. + * + * Generated from protobuf field optional string gateway_ip_version = 65074843; + * @return string + */ + public function getGatewayIpVersion() + { + return isset($this->gateway_ip_version) ? $this->gateway_ip_version : ''; + } + + public function hasGatewayIpVersion() + { + return isset($this->gateway_ip_version); + } + + public function clearGatewayIpVersion() + { + unset($this->gateway_ip_version); + } + + /** + * The IP family of the gateway IPs for the HA-VPN gateway interfaces. If not specified, IPV4 will be used. + * Check the GatewayIpVersion enum for the list of possible values. + * + * Generated from protobuf field optional string gateway_ip_version = 65074843; + * @param string $var + * @return $this + */ + public function setGatewayIpVersion($var) + { + GPBUtil::checkString($var, True); + $this->gateway_ip_version = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#vpnGateway for VPN gateways. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#vpnGateway for VPN gateways. + * + * 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; + } + + /** + * 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 + */ + public function getLabelFingerprint() + { + return isset($this->label_fingerprint) ? $this->label_fingerprint : ''; + } + + public function hasLabelFingerprint() + { + return isset($this->label_fingerprint); + } + + public function clearLabelFingerprint() + { + unset($this->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 a VpnGateway. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @param string $var + * @return $this + */ + public function setLabelFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->label_fingerprint = $var; + + return $this; + } + + /** + * 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. + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->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. + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * URL of the network to which this VPN gateway is attached. Provided by the client when the VPN gateway is created. + * + * Generated from protobuf field optional string network = 232872494; + * @return string + */ + public function getNetwork() + { + return isset($this->network) ? $this->network : ''; + } + + public function hasNetwork() + { + return isset($this->network); + } + + public function clearNetwork() + { + unset($this->network); + } + + /** + * URL of the network to which this VPN gateway is attached. Provided by the client when the VPN gateway is created. + * + * Generated from protobuf field optional string network = 232872494; + * @param string $var + * @return $this + */ + public function setNetwork($var) + { + GPBUtil::checkString($var, True); + $this->network = $var; + + return $this; + } + + /** + * [Output Only] URL of the region where the VPN gateway resides. + * + * 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 VPN gateway resides. + * + * 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] Server-defined URL for the 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 the 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; + } + + /** + * The stack type for this VPN gateway to identify the IP protocols that are enabled. Possible values are: IPV4_ONLY, IPV4_IPV6. If not specified, IPV4_ONLY will be used. + * Check the StackType enum for the list of possible values. + * + * Generated from protobuf field optional string stack_type = 425908881; + * @return string + */ + public function getStackType() + { + return isset($this->stack_type) ? $this->stack_type : ''; + } + + public function hasStackType() + { + return isset($this->stack_type); + } + + public function clearStackType() + { + unset($this->stack_type); + } + + /** + * The stack type for this VPN gateway to identify the IP protocols that are enabled. Possible values are: IPV4_ONLY, IPV4_IPV6. If not specified, IPV4_ONLY will be used. + * Check the StackType enum for the list of possible values. + * + * Generated from protobuf field optional string stack_type = 425908881; + * @param string $var + * @return $this + */ + public function setStackType($var) + { + GPBUtil::checkString($var, True); + $this->stack_type = $var; + + return $this; + } + + /** + * The list of VPN interfaces associated with this VPN gateway. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VpnGatewayVpnGatewayInterface vpn_interfaces = 91842181; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVpnInterfaces() + { + return $this->vpn_interfaces; + } + + /** + * The list of VPN interfaces associated with this VPN gateway. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VpnGatewayVpnGatewayInterface vpn_interfaces = 91842181; + * @param array<\Google\Cloud\Compute\V1\VpnGatewayVpnGatewayInterface>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVpnInterfaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\VpnGatewayVpnGatewayInterface::class); + $this->vpn_interfaces = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGateway/GatewayIpVersion.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGateway/GatewayIpVersion.php new file mode 100644 index 000000000000..1e6439ddd805 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGateway/GatewayIpVersion.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.VpnGateway.GatewayIpVersion + */ +class GatewayIpVersion +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_GATEWAY_IP_VERSION = 0; + */ + const UNDEFINED_GATEWAY_IP_VERSION = 0; + /** + * Every HA-VPN gateway interface is configured with an IPv4 address. + * + * Generated from protobuf enum IPV4 = 2254341; + */ + const IPV4 = 2254341; + /** + * Every HA-VPN gateway interface is configured with an IPv6 address. + * + * Generated from protobuf enum IPV6 = 2254343; + */ + const IPV6 = 2254343; + + private static $valueToName = [ + self::UNDEFINED_GATEWAY_IP_VERSION => 'UNDEFINED_GATEWAY_IP_VERSION', + self::IPV4 => 'IPV4', + self::IPV6 => 'IPV6', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GatewayIpVersion::class, \Google\Cloud\Compute\V1\VpnGateway_GatewayIpVersion::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGateway/StackType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGateway/StackType.php new file mode 100644 index 000000000000..9bba987f1434 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGateway/StackType.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.VpnGateway.StackType + */ +class StackType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STACK_TYPE = 0; + */ + const UNDEFINED_STACK_TYPE = 0; + /** + * Enable VPN gateway with both IPv4 and IPv6 protocols. + * + * Generated from protobuf enum IPV4_IPV6 = 22197249; + */ + const IPV4_IPV6 = 22197249; + /** + * Enable VPN gateway with only IPv4 protocol. + * + * Generated from protobuf enum IPV4_ONLY = 22373798; + */ + const IPV4_ONLY = 22373798; + + private static $valueToName = [ + self::UNDEFINED_STACK_TYPE => 'UNDEFINED_STACK_TYPE', + self::IPV4_IPV6 => 'IPV4_IPV6', + self::IPV4_ONLY => 'IPV4_ONLY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StackType::class, \Google\Cloud\Compute\V1\VpnGateway_StackType::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayAggregatedList.php new file mode 100644 index 000000000000..48ab61859ccd --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.VpnGatewayAggregatedList + */ +class VpnGatewayAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of VpnGateway resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#vpnGateway for VPN gateways. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 VpnGateway resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#vpnGateway for VPN gateways. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 VpnGateway resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of VpnGateway 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\VpnGatewaysScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#vpnGateway for VPN gateways. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#vpnGateway for VPN gateways. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayList.php new file mode 100644 index 000000000000..e8f3c09a57f8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.VpnGatewayList + */ +class VpnGatewayList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of VpnGateway resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VpnGateway items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#vpnGateway for VPN gateways. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\VpnGateway>|\Google\Protobuf\Internal\RepeatedField $items + * A list of VpnGateway resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#vpnGateway for VPN gateways. + * @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 VpnGateway resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VpnGateway items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of VpnGateway resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VpnGateway items = 100526016; + * @param array<\Google\Cloud\Compute\V1\VpnGateway>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\VpnGateway::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#vpnGateway for VPN gateways. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#vpnGateway for VPN gateways. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatus.php new file mode 100644 index 000000000000..961ca3140e69 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatus.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.VpnGatewayStatus + */ +class VpnGatewayStatus extends \Google\Protobuf\Internal\Message +{ + /** + * List of VPN connection for this VpnGateway. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VpnGatewayStatusVpnConnection vpn_connections = 439334538; + */ + private $vpn_connections; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\VpnGatewayStatusVpnConnection>|\Google\Protobuf\Internal\RepeatedField $vpn_connections + * List of VPN connection for this VpnGateway. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * List of VPN connection for this VpnGateway. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VpnGatewayStatusVpnConnection vpn_connections = 439334538; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVpnConnections() + { + return $this->vpn_connections; + } + + /** + * List of VPN connection for this VpnGateway. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VpnGatewayStatusVpnConnection vpn_connections = 439334538; + * @param array<\Google\Cloud\Compute\V1\VpnGatewayStatusVpnConnection>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVpnConnections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\VpnGatewayStatusVpnConnection::class); + $this->vpn_connections = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatusHighAvailabilityRequirementState.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatusHighAvailabilityRequirementState.php new file mode 100644 index 000000000000..fd2c5c8dab40 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatusHighAvailabilityRequirementState.php @@ -0,0 +1,129 @@ +google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState + */ +class VpnGatewayStatusHighAvailabilityRequirementState extends \Google\Protobuf\Internal\Message +{ + /** + * Indicates the high availability requirement state for the VPN connection. Valid values are CONNECTION_REDUNDANCY_MET, CONNECTION_REDUNDANCY_NOT_MET. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + */ + protected $state = null; + /** + * Indicates the reason why the VPN connection does not meet the high availability redundancy criteria/requirement. Valid values is INCOMPLETE_TUNNELS_COVERAGE. + * Check the UnsatisfiedReason enum for the list of possible values. + * + * Generated from protobuf field optional string unsatisfied_reason = 55016330; + */ + protected $unsatisfied_reason = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $state + * Indicates the high availability requirement state for the VPN connection. Valid values are CONNECTION_REDUNDANCY_MET, CONNECTION_REDUNDANCY_NOT_MET. + * Check the State enum for the list of possible values. + * @type string $unsatisfied_reason + * Indicates the reason why the VPN connection does not meet the high availability redundancy criteria/requirement. Valid values is INCOMPLETE_TUNNELS_COVERAGE. + * Check the UnsatisfiedReason enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Indicates the high availability requirement state for the VPN connection. Valid values are CONNECTION_REDUNDANCY_MET, CONNECTION_REDUNDANCY_NOT_MET. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @return string + */ + public function getState() + { + return isset($this->state) ? $this->state : ''; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * Indicates the high availability requirement state for the VPN connection. Valid values are CONNECTION_REDUNDANCY_MET, CONNECTION_REDUNDANCY_NOT_MET. + * Check the State enum for the list of possible values. + * + * Generated from protobuf field optional string state = 109757585; + * @param string $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkString($var, True); + $this->state = $var; + + return $this; + } + + /** + * Indicates the reason why the VPN connection does not meet the high availability redundancy criteria/requirement. Valid values is INCOMPLETE_TUNNELS_COVERAGE. + * Check the UnsatisfiedReason enum for the list of possible values. + * + * Generated from protobuf field optional string unsatisfied_reason = 55016330; + * @return string + */ + public function getUnsatisfiedReason() + { + return isset($this->unsatisfied_reason) ? $this->unsatisfied_reason : ''; + } + + public function hasUnsatisfiedReason() + { + return isset($this->unsatisfied_reason); + } + + public function clearUnsatisfiedReason() + { + unset($this->unsatisfied_reason); + } + + /** + * Indicates the reason why the VPN connection does not meet the high availability redundancy criteria/requirement. Valid values is INCOMPLETE_TUNNELS_COVERAGE. + * Check the UnsatisfiedReason enum for the list of possible values. + * + * Generated from protobuf field optional string unsatisfied_reason = 55016330; + * @param string $var + * @return $this + */ + public function setUnsatisfiedReason($var) + { + GPBUtil::checkString($var, True); + $this->unsatisfied_reason = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatusHighAvailabilityRequirementState/State.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatusHighAvailabilityRequirementState/State.php new file mode 100644 index 000000000000..ffe4c1df51f8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatusHighAvailabilityRequirementState/State.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.State + */ +class State +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATE = 0; + */ + const UNDEFINED_STATE = 0; + /** + * VPN tunnels are configured with adequate redundancy from Cloud VPN gateway to the peer VPN gateway. For both GCP-to-non-GCP and GCP-to-GCP connections, the adequate redundancy is a pre-requirement for users to get 99.99% availability on GCP side; please note that for any connection, end-to-end 99.99% availability is subject to proper configuration on the peer VPN gateway. + * + * Generated from protobuf enum CONNECTION_REDUNDANCY_MET = 505242907; + */ + const CONNECTION_REDUNDANCY_MET = 505242907; + /** + * VPN tunnels are not configured with adequate redundancy from the Cloud VPN gateway to the peer gateway + * + * Generated from protobuf enum CONNECTION_REDUNDANCY_NOT_MET = 511863311; + */ + const CONNECTION_REDUNDANCY_NOT_MET = 511863311; + + private static $valueToName = [ + self::UNDEFINED_STATE => 'UNDEFINED_STATE', + self::CONNECTION_REDUNDANCY_MET => 'CONNECTION_REDUNDANCY_MET', + self::CONNECTION_REDUNDANCY_NOT_MET => 'CONNECTION_REDUNDANCY_NOT_MET', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Compute\V1\VpnGatewayStatusHighAvailabilityRequirementState_State::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatusHighAvailabilityRequirementState/UnsatisfiedReason.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatusHighAvailabilityRequirementState/UnsatisfiedReason.php new file mode 100644 index 000000000000..1d3d68c1da45 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatusHighAvailabilityRequirementState/UnsatisfiedReason.php @@ -0,0 +1,55 @@ +google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.UnsatisfiedReason + */ +class UnsatisfiedReason +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_UNSATISFIED_REASON = 0; + */ + const UNDEFINED_UNSATISFIED_REASON = 0; + /** + * Generated from protobuf enum INCOMPLETE_TUNNELS_COVERAGE = 55917437; + */ + const INCOMPLETE_TUNNELS_COVERAGE = 55917437; + + private static $valueToName = [ + self::UNDEFINED_UNSATISFIED_REASON => 'UNDEFINED_UNSATISFIED_REASON', + self::INCOMPLETE_TUNNELS_COVERAGE => 'INCOMPLETE_TUNNELS_COVERAGE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(UnsatisfiedReason::class, \Google\Cloud\Compute\V1\VpnGatewayStatusHighAvailabilityRequirementState_UnsatisfiedReason::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatusTunnel.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatusTunnel.php new file mode 100644 index 000000000000..e595e651818a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatusTunnel.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.VpnGatewayStatusTunnel + */ +class VpnGatewayStatusTunnel extends \Google\Protobuf\Internal\Message +{ + /** + * The VPN gateway interface this VPN tunnel is associated with. + * + * Generated from protobuf field optional uint32 local_gateway_interface = 158764330; + */ + protected $local_gateway_interface = null; + /** + * The peer gateway interface this VPN tunnel is connected to, the peer gateway could either be an external VPN gateway or a Google Cloud VPN gateway. + * + * Generated from protobuf field optional uint32 peer_gateway_interface = 214380385; + */ + protected $peer_gateway_interface = null; + /** + * URL reference to the VPN tunnel. + * + * Generated from protobuf field optional string tunnel_url = 78975256; + */ + protected $tunnel_url = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $local_gateway_interface + * The VPN gateway interface this VPN tunnel is associated with. + * @type int $peer_gateway_interface + * The peer gateway interface this VPN tunnel is connected to, the peer gateway could either be an external VPN gateway or a Google Cloud VPN gateway. + * @type string $tunnel_url + * URL reference to the VPN tunnel. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The VPN gateway interface this VPN tunnel is associated with. + * + * Generated from protobuf field optional uint32 local_gateway_interface = 158764330; + * @return int + */ + public function getLocalGatewayInterface() + { + return isset($this->local_gateway_interface) ? $this->local_gateway_interface : 0; + } + + public function hasLocalGatewayInterface() + { + return isset($this->local_gateway_interface); + } + + public function clearLocalGatewayInterface() + { + unset($this->local_gateway_interface); + } + + /** + * The VPN gateway interface this VPN tunnel is associated with. + * + * Generated from protobuf field optional uint32 local_gateway_interface = 158764330; + * @param int $var + * @return $this + */ + public function setLocalGatewayInterface($var) + { + GPBUtil::checkUint32($var); + $this->local_gateway_interface = $var; + + return $this; + } + + /** + * The peer gateway interface this VPN tunnel is connected to, the peer gateway could either be an external VPN gateway or a Google Cloud VPN gateway. + * + * Generated from protobuf field optional uint32 peer_gateway_interface = 214380385; + * @return int + */ + public function getPeerGatewayInterface() + { + return isset($this->peer_gateway_interface) ? $this->peer_gateway_interface : 0; + } + + public function hasPeerGatewayInterface() + { + return isset($this->peer_gateway_interface); + } + + public function clearPeerGatewayInterface() + { + unset($this->peer_gateway_interface); + } + + /** + * The peer gateway interface this VPN tunnel is connected to, the peer gateway could either be an external VPN gateway or a Google Cloud VPN gateway. + * + * Generated from protobuf field optional uint32 peer_gateway_interface = 214380385; + * @param int $var + * @return $this + */ + public function setPeerGatewayInterface($var) + { + GPBUtil::checkUint32($var); + $this->peer_gateway_interface = $var; + + return $this; + } + + /** + * URL reference to the VPN tunnel. + * + * Generated from protobuf field optional string tunnel_url = 78975256; + * @return string + */ + public function getTunnelUrl() + { + return isset($this->tunnel_url) ? $this->tunnel_url : ''; + } + + public function hasTunnelUrl() + { + return isset($this->tunnel_url); + } + + public function clearTunnelUrl() + { + unset($this->tunnel_url); + } + + /** + * URL reference to the VPN tunnel. + * + * Generated from protobuf field optional string tunnel_url = 78975256; + * @param string $var + * @return $this + */ + public function setTunnelUrl($var) + { + GPBUtil::checkString($var, True); + $this->tunnel_url = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatusVpnConnection.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatusVpnConnection.php new file mode 100644 index 000000000000..f44ae0e51774 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayStatusVpnConnection.php @@ -0,0 +1,199 @@ +google.cloud.compute.v1.VpnGatewayStatusVpnConnection + */ +class VpnGatewayStatusVpnConnection extends \Google\Protobuf\Internal\Message +{ + /** + * URL reference to the peer external VPN gateways to which the VPN tunnels in this VPN connection are connected. This field is mutually exclusive with peer_gcp_gateway. + * + * Generated from protobuf field optional string peer_external_gateway = 384956173; + */ + protected $peer_external_gateway = null; + /** + * URL reference to the peer side VPN gateways to which the VPN tunnels in this VPN connection are connected. This field is mutually exclusive with peer_gcp_gateway. + * + * Generated from protobuf field optional string peer_gcp_gateway = 281867452; + */ + protected $peer_gcp_gateway = null; + /** + * HighAvailabilityRequirementState for the VPN connection. + * + * Generated from protobuf field optional .google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState state = 109757585; + */ + protected $state = null; + /** + * List of VPN tunnels that are in this VPN connection. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VpnGatewayStatusTunnel tunnels = 104561931; + */ + private $tunnels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $peer_external_gateway + * URL reference to the peer external VPN gateways to which the VPN tunnels in this VPN connection are connected. This field is mutually exclusive with peer_gcp_gateway. + * @type string $peer_gcp_gateway + * URL reference to the peer side VPN gateways to which the VPN tunnels in this VPN connection are connected. This field is mutually exclusive with peer_gcp_gateway. + * @type \Google\Cloud\Compute\V1\VpnGatewayStatusHighAvailabilityRequirementState $state + * HighAvailabilityRequirementState for the VPN connection. + * @type array<\Google\Cloud\Compute\V1\VpnGatewayStatusTunnel>|\Google\Protobuf\Internal\RepeatedField $tunnels + * List of VPN tunnels that are in this VPN connection. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * URL reference to the peer external VPN gateways to which the VPN tunnels in this VPN connection are connected. This field is mutually exclusive with peer_gcp_gateway. + * + * Generated from protobuf field optional string peer_external_gateway = 384956173; + * @return string + */ + public function getPeerExternalGateway() + { + return isset($this->peer_external_gateway) ? $this->peer_external_gateway : ''; + } + + public function hasPeerExternalGateway() + { + return isset($this->peer_external_gateway); + } + + public function clearPeerExternalGateway() + { + unset($this->peer_external_gateway); + } + + /** + * URL reference to the peer external VPN gateways to which the VPN tunnels in this VPN connection are connected. This field is mutually exclusive with peer_gcp_gateway. + * + * Generated from protobuf field optional string peer_external_gateway = 384956173; + * @param string $var + * @return $this + */ + public function setPeerExternalGateway($var) + { + GPBUtil::checkString($var, True); + $this->peer_external_gateway = $var; + + return $this; + } + + /** + * URL reference to the peer side VPN gateways to which the VPN tunnels in this VPN connection are connected. This field is mutually exclusive with peer_gcp_gateway. + * + * Generated from protobuf field optional string peer_gcp_gateway = 281867452; + * @return string + */ + public function getPeerGcpGateway() + { + return isset($this->peer_gcp_gateway) ? $this->peer_gcp_gateway : ''; + } + + public function hasPeerGcpGateway() + { + return isset($this->peer_gcp_gateway); + } + + public function clearPeerGcpGateway() + { + unset($this->peer_gcp_gateway); + } + + /** + * URL reference to the peer side VPN gateways to which the VPN tunnels in this VPN connection are connected. This field is mutually exclusive with peer_gcp_gateway. + * + * Generated from protobuf field optional string peer_gcp_gateway = 281867452; + * @param string $var + * @return $this + */ + public function setPeerGcpGateway($var) + { + GPBUtil::checkString($var, True); + $this->peer_gcp_gateway = $var; + + return $this; + } + + /** + * HighAvailabilityRequirementState for the VPN connection. + * + * Generated from protobuf field optional .google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState state = 109757585; + * @return \Google\Cloud\Compute\V1\VpnGatewayStatusHighAvailabilityRequirementState|null + */ + public function getState() + { + return $this->state; + } + + public function hasState() + { + return isset($this->state); + } + + public function clearState() + { + unset($this->state); + } + + /** + * HighAvailabilityRequirementState for the VPN connection. + * + * Generated from protobuf field optional .google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState state = 109757585; + * @param \Google\Cloud\Compute\V1\VpnGatewayStatusHighAvailabilityRequirementState $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\VpnGatewayStatusHighAvailabilityRequirementState::class); + $this->state = $var; + + return $this; + } + + /** + * List of VPN tunnels that are in this VPN connection. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VpnGatewayStatusTunnel tunnels = 104561931; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTunnels() + { + return $this->tunnels; + } + + /** + * List of VPN tunnels that are in this VPN connection. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VpnGatewayStatusTunnel tunnels = 104561931; + * @param array<\Google\Cloud\Compute\V1\VpnGatewayStatusTunnel>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTunnels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\VpnGatewayStatusTunnel::class); + $this->tunnels = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayVpnGatewayInterface.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayVpnGatewayInterface.php new file mode 100644 index 000000000000..8e8c3d89a3e8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewayVpnGatewayInterface.php @@ -0,0 +1,209 @@ +google.cloud.compute.v1.VpnGatewayVpnGatewayInterface + */ +class VpnGatewayVpnGatewayInterface extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Numeric identifier for this VPN interface associated with the VPN gateway. + * + * Generated from protobuf field optional uint32 id = 3355; + */ + protected $id = null; + /** + * URL of the VLAN attachment (interconnectAttachment) resource for this VPN gateway interface. When the value of this field is present, the VPN gateway is used for HA VPN over Cloud Interconnect; all egress or ingress traffic for this VPN gateway interface goes through the specified VLAN attachment resource. + * + * Generated from protobuf field optional string interconnect_attachment = 308135284; + */ + protected $interconnect_attachment = null; + /** + * [Output Only] IP address for this VPN interface associated with the VPN gateway. The IP address could be either a regional external IP address or a regional internal IP address. The two IP addresses for a VPN gateway must be all regional external or regional internal IP addresses. There cannot be a mix of regional external IP addresses and regional internal IP addresses. For HA VPN over Cloud Interconnect, the IP addresses for both interfaces could either be regional internal IP addresses or regional external IP addresses. For regular (non HA VPN over Cloud Interconnect) HA VPN tunnels, the IP address must be a regional external IP address. + * + * Generated from protobuf field optional string ip_address = 406272220; + */ + protected $ip_address = null; + /** + * [Output Only] IPv6 address for this VPN interface associated with the VPN gateway. The IPv6 address must be a regional external IPv6 address. The format is RFC 5952 format (e.g. 2001:db8::2d9:51:0:0). + * + * Generated from protobuf field optional string ipv6_address = 341563804; + */ + protected $ipv6_address = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $id + * [Output Only] Numeric identifier for this VPN interface associated with the VPN gateway. + * @type string $interconnect_attachment + * URL of the VLAN attachment (interconnectAttachment) resource for this VPN gateway interface. When the value of this field is present, the VPN gateway is used for HA VPN over Cloud Interconnect; all egress or ingress traffic for this VPN gateway interface goes through the specified VLAN attachment resource. + * @type string $ip_address + * [Output Only] IP address for this VPN interface associated with the VPN gateway. The IP address could be either a regional external IP address or a regional internal IP address. The two IP addresses for a VPN gateway must be all regional external or regional internal IP addresses. There cannot be a mix of regional external IP addresses and regional internal IP addresses. For HA VPN over Cloud Interconnect, the IP addresses for both interfaces could either be regional internal IP addresses or regional external IP addresses. For regular (non HA VPN over Cloud Interconnect) HA VPN tunnels, the IP address must be a regional external IP address. + * @type string $ipv6_address + * [Output Only] IPv6 address for this VPN interface associated with the VPN gateway. The IPv6 address must be a regional external IPv6 address. The format is RFC 5952 format (e.g. 2001:db8::2d9:51:0:0). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Numeric identifier for this VPN interface associated with the VPN gateway. + * + * Generated from protobuf field optional uint32 id = 3355; + * @return int + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] Numeric identifier for this VPN interface associated with the VPN gateway. + * + * Generated from protobuf field optional uint32 id = 3355; + * @param int $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint32($var); + $this->id = $var; + + return $this; + } + + /** + * URL of the VLAN attachment (interconnectAttachment) resource for this VPN gateway interface. When the value of this field is present, the VPN gateway is used for HA VPN over Cloud Interconnect; all egress or ingress traffic for this VPN gateway interface goes through the specified VLAN attachment resource. + * + * Generated from protobuf field optional string interconnect_attachment = 308135284; + * @return string + */ + public function getInterconnectAttachment() + { + return isset($this->interconnect_attachment) ? $this->interconnect_attachment : ''; + } + + public function hasInterconnectAttachment() + { + return isset($this->interconnect_attachment); + } + + public function clearInterconnectAttachment() + { + unset($this->interconnect_attachment); + } + + /** + * URL of the VLAN attachment (interconnectAttachment) resource for this VPN gateway interface. When the value of this field is present, the VPN gateway is used for HA VPN over Cloud Interconnect; all egress or ingress traffic for this VPN gateway interface goes through the specified VLAN attachment resource. + * + * Generated from protobuf field optional string interconnect_attachment = 308135284; + * @param string $var + * @return $this + */ + public function setInterconnectAttachment($var) + { + GPBUtil::checkString($var, True); + $this->interconnect_attachment = $var; + + return $this; + } + + /** + * [Output Only] IP address for this VPN interface associated with the VPN gateway. The IP address could be either a regional external IP address or a regional internal IP address. The two IP addresses for a VPN gateway must be all regional external or regional internal IP addresses. There cannot be a mix of regional external IP addresses and regional internal IP addresses. For HA VPN over Cloud Interconnect, the IP addresses for both interfaces could either be regional internal IP addresses or regional external IP addresses. For regular (non HA VPN over Cloud Interconnect) HA VPN tunnels, the IP address must be a regional external IP address. + * + * Generated from protobuf field optional string ip_address = 406272220; + * @return string + */ + public function getIpAddress() + { + return isset($this->ip_address) ? $this->ip_address : ''; + } + + public function hasIpAddress() + { + return isset($this->ip_address); + } + + public function clearIpAddress() + { + unset($this->ip_address); + } + + /** + * [Output Only] IP address for this VPN interface associated with the VPN gateway. The IP address could be either a regional external IP address or a regional internal IP address. The two IP addresses for a VPN gateway must be all regional external or regional internal IP addresses. There cannot be a mix of regional external IP addresses and regional internal IP addresses. For HA VPN over Cloud Interconnect, the IP addresses for both interfaces could either be regional internal IP addresses or regional external IP addresses. For regular (non HA VPN over Cloud Interconnect) HA VPN tunnels, the IP address must be a regional external IP address. + * + * Generated from protobuf field optional string ip_address = 406272220; + * @param string $var + * @return $this + */ + public function setIpAddress($var) + { + GPBUtil::checkString($var, True); + $this->ip_address = $var; + + return $this; + } + + /** + * [Output Only] IPv6 address for this VPN interface associated with the VPN gateway. The IPv6 address must be a regional external IPv6 address. The format is RFC 5952 format (e.g. 2001:db8::2d9:51:0:0). + * + * Generated from protobuf field optional string ipv6_address = 341563804; + * @return string + */ + public function getIpv6Address() + { + return isset($this->ipv6_address) ? $this->ipv6_address : ''; + } + + public function hasIpv6Address() + { + return isset($this->ipv6_address); + } + + public function clearIpv6Address() + { + unset($this->ipv6_address); + } + + /** + * [Output Only] IPv6 address for this VPN interface associated with the VPN gateway. The IPv6 address must be a regional external IPv6 address. The format is RFC 5952 format (e.g. 2001:db8::2d9:51:0:0). + * + * Generated from protobuf field optional string ipv6_address = 341563804; + * @param string $var + * @return $this + */ + public function setIpv6Address($var) + { + GPBUtil::checkString($var, True); + $this->ipv6_address = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewaysGetStatusResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewaysGetStatusResponse.php new file mode 100644 index 000000000000..235bb53e361d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewaysGetStatusResponse.php @@ -0,0 +1,69 @@ +google.cloud.compute.v1.VpnGatewaysGetStatusResponse + */ +class VpnGatewaysGetStatusResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional .google.cloud.compute.v1.VpnGatewayStatus result = 139315229; + */ + protected $result = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Compute\V1\VpnGatewayStatus $result + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.VpnGatewayStatus result = 139315229; + * @return \Google\Cloud\Compute\V1\VpnGatewayStatus|null + */ + public function getResult() + { + return $this->result; + } + + public function hasResult() + { + return isset($this->result); + } + + public function clearResult() + { + unset($this->result); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.VpnGatewayStatus result = 139315229; + * @param \Google\Cloud\Compute\V1\VpnGatewayStatus $var + * @return $this + */ + public function setResult($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\VpnGatewayStatus::class); + $this->result = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewaysScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewaysScopedList.php new file mode 100644 index 000000000000..73f7dd6427c1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGatewaysScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.VpnGatewaysScopedList + */ +class VpnGatewaysScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A list of VPN gateways contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VpnGateway vpn_gateways = 259177882; + */ + private $vpn_gateways; + /** + * [Output Only] Informational warning which replaces the list of addresses when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\VpnGateway>|\Google\Protobuf\Internal\RepeatedField $vpn_gateways + * [Output Only] A list of VPN gateways contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * [Output Only] Informational warning which replaces the list of addresses 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 VPN gateways contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VpnGateway vpn_gateways = 259177882; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVpnGateways() + { + return $this->vpn_gateways; + } + + /** + * [Output Only] A list of VPN gateways contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VpnGateway vpn_gateways = 259177882; + * @param array<\Google\Cloud\Compute\V1\VpnGateway>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVpnGateways($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\VpnGateway::class); + $this->vpn_gateways = $arr; + + return $this; + } + + /** + * [Output Only] Informational warning which replaces the list of addresses 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] Informational warning which replaces the list of addresses 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnTunnel.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnTunnel.php new file mode 100644 index 000000000000..0d39df7c25df --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnTunnel.php @@ -0,0 +1,1063 @@ +google.cloud.compute.v1.VpnTunnel + */ +class VpnTunnel extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] Detailed status message for the VPN tunnel. + * + * Generated from protobuf field optional string detailed_status = 333501025; + */ + protected $detailed_status = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * IKE protocol version to use when establishing the VPN tunnel with the peer VPN gateway. Acceptable IKE versions are 1 or 2. The default version is 2. + * + * Generated from protobuf field optional int32 ike_version = 218376220; + */ + protected $ike_version = null; + /** + * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * A fingerprint for the labels being applied to this VpnTunnel, 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 VpnTunnel. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + */ + protected $label_fingerprint = null; + /** + * 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. + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + /** + * Local traffic selector to use when establishing the VPN tunnel with the peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges must be disjoint. Only IPv4 is supported. + * + * Generated from protobuf field repeated string local_traffic_selector = 317314613; + */ + private $local_traffic_selector; + /** + * 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. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * URL of the peer side external VPN gateway to which this VPN tunnel is connected. Provided by the client when the VPN tunnel is created. This field is exclusive with the field peerGcpGateway. + * + * Generated from protobuf field optional string peer_external_gateway = 384956173; + */ + protected $peer_external_gateway = null; + /** + * The interface ID of the external VPN gateway to which this VPN tunnel is connected. Provided by the client when the VPN tunnel is created. Possible values are: `0`, `1`, `2`, `3`. The number of IDs in use depends on the external VPN gateway redundancy type. + * + * Generated from protobuf field optional int32 peer_external_gateway_interface = 452768391; + */ + protected $peer_external_gateway_interface = null; + /** + * URL of the peer side HA VPN gateway to which this VPN tunnel is connected. Provided by the client when the VPN tunnel is created. This field can be used when creating highly available VPN from VPC network to VPC network, the field is exclusive with the field peerExternalGateway. If provided, the VPN tunnel will automatically use the same vpnGatewayInterface ID in the peer Google Cloud VPN gateway. + * + * Generated from protobuf field optional string peer_gcp_gateway = 281867452; + */ + protected $peer_gcp_gateway = null; + /** + * IP address of the peer VPN gateway. Only IPv4 is supported. + * + * Generated from protobuf field optional string peer_ip = 383249700; + */ + protected $peer_ip = null; + /** + * [Output Only] URL of the region where the VPN tunnel resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * Remote traffic selectors to use when establishing the VPN tunnel with the peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported. + * + * Generated from protobuf field repeated string remote_traffic_selector = 358887098; + */ + private $remote_traffic_selector; + /** + * URL of the router resource to be used for dynamic routing. + * + * Generated from protobuf field optional string router = 148608841; + */ + protected $router = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * Shared secret used to set the secure session between the Cloud VPN gateway and the peer VPN gateway. + * + * Generated from protobuf field optional string shared_secret = 381932490; + */ + protected $shared_secret = null; + /** + * Hash of the shared secret. + * + * Generated from protobuf field optional string shared_secret_hash = 398881891; + */ + protected $shared_secret_hash = null; + /** + * [Output Only] The status of the VPN tunnel, which can be one of the following: - PROVISIONING: Resource is being allocated for the VPN tunnel. - WAITING_FOR_FULL_CONFIG: Waiting to receive all VPN-related configs from the user. Network, TargetVpnGateway, VpnTunnel, ForwardingRule, and Route resources are needed to setup the VPN tunnel. - FIRST_HANDSHAKE: Successful first handshake with the peer VPN. - ESTABLISHED: Secure session is successfully established with the peer VPN. - NETWORK_ERROR: Deprecated, replaced by NO_INCOMING_PACKETS - AUTHORIZATION_ERROR: Auth error (for example, bad shared secret). - NEGOTIATION_FAILURE: Handshake failed. - DEPROVISIONING: Resources are being deallocated for the VPN tunnel. - FAILED: Tunnel creation has failed and the tunnel is not ready to be used. - NO_INCOMING_PACKETS: No incoming packets from peer. - REJECTED: Tunnel configuration was rejected, can be result of being denied access. - ALLOCATING_RESOURCES: Cloud VPN is in the process of allocating all required resources. - STOPPED: Tunnel is stopped due to its Forwarding Rules being deleted for Classic VPN tunnels or the project is in frozen state. - PEER_IDENTITY_MISMATCH: Peer identity does not match peer IP, probably behind NAT. - TS_NARROWING_NOT_ALLOWED: Traffic selector narrowing not allowed for an HA-VPN tunnel. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + /** + * URL of the Target VPN gateway with which this VPN tunnel is associated. Provided by the client when the VPN tunnel is created. + * + * Generated from protobuf field optional string target_vpn_gateway = 532512843; + */ + protected $target_vpn_gateway = null; + /** + * URL of the VPN gateway with which this VPN tunnel is associated. Provided by the client when the VPN tunnel is created. This must be used (instead of target_vpn_gateway) if a High Availability VPN gateway resource is created. + * + * Generated from protobuf field optional string vpn_gateway = 406684153; + */ + protected $vpn_gateway = null; + /** + * The interface ID of the VPN gateway with which this VPN tunnel is associated. Possible values are: `0`, `1`. + * + * Generated from protobuf field optional int32 vpn_gateway_interface = 95979123; + */ + protected $vpn_gateway_interface = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type string $description + * An optional description of this resource. Provide this property when you create the resource. + * @type string $detailed_status + * [Output Only] Detailed status message for the VPN tunnel. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type int $ike_version + * IKE protocol version to use when establishing the VPN tunnel with the peer VPN gateway. Acceptable IKE versions are 1 or 2. The default version is 2. + * @type string $kind + * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + * @type string $label_fingerprint + * A fingerprint for the labels being applied to this VpnTunnel, 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 VpnTunnel. + * @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 array|\Google\Protobuf\Internal\RepeatedField $local_traffic_selector + * Local traffic selector to use when establishing the VPN tunnel with the peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges must be disjoint. Only IPv4 is supported. + * @type string $name + * 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 string $peer_external_gateway + * URL of the peer side external VPN gateway to which this VPN tunnel is connected. Provided by the client when the VPN tunnel is created. This field is exclusive with the field peerGcpGateway. + * @type int $peer_external_gateway_interface + * The interface ID of the external VPN gateway to which this VPN tunnel is connected. Provided by the client when the VPN tunnel is created. Possible values are: `0`, `1`, `2`, `3`. The number of IDs in use depends on the external VPN gateway redundancy type. + * @type string $peer_gcp_gateway + * URL of the peer side HA VPN gateway to which this VPN tunnel is connected. Provided by the client when the VPN tunnel is created. This field can be used when creating highly available VPN from VPC network to VPC network, the field is exclusive with the field peerExternalGateway. If provided, the VPN tunnel will automatically use the same vpnGatewayInterface ID in the peer Google Cloud VPN gateway. + * @type string $peer_ip + * IP address of the peer VPN gateway. Only IPv4 is supported. + * @type string $region + * [Output Only] URL of the region where the VPN tunnel resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * @type array|\Google\Protobuf\Internal\RepeatedField $remote_traffic_selector + * Remote traffic selectors to use when establishing the VPN tunnel with the peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported. + * @type string $router + * URL of the router resource to be used for dynamic routing. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $shared_secret + * Shared secret used to set the secure session between the Cloud VPN gateway and the peer VPN gateway. + * @type string $shared_secret_hash + * Hash of the shared secret. + * @type string $status + * [Output Only] The status of the VPN tunnel, which can be one of the following: - PROVISIONING: Resource is being allocated for the VPN tunnel. - WAITING_FOR_FULL_CONFIG: Waiting to receive all VPN-related configs from the user. Network, TargetVpnGateway, VpnTunnel, ForwardingRule, and Route resources are needed to setup the VPN tunnel. - FIRST_HANDSHAKE: Successful first handshake with the peer VPN. - ESTABLISHED: Secure session is successfully established with the peer VPN. - NETWORK_ERROR: Deprecated, replaced by NO_INCOMING_PACKETS - AUTHORIZATION_ERROR: Auth error (for example, bad shared secret). - NEGOTIATION_FAILURE: Handshake failed. - DEPROVISIONING: Resources are being deallocated for the VPN tunnel. - FAILED: Tunnel creation has failed and the tunnel is not ready to be used. - NO_INCOMING_PACKETS: No incoming packets from peer. - REJECTED: Tunnel configuration was rejected, can be result of being denied access. - ALLOCATING_RESOURCES: Cloud VPN is in the process of allocating all required resources. - STOPPED: Tunnel is stopped due to its Forwarding Rules being deleted for Classic VPN tunnels or the project is in frozen state. - PEER_IDENTITY_MISMATCH: Peer identity does not match peer IP, probably behind NAT. - TS_NARROWING_NOT_ALLOWED: Traffic selector narrowing not allowed for an HA-VPN tunnel. + * Check the Status enum for the list of possible values. + * @type string $target_vpn_gateway + * URL of the Target VPN gateway with which this VPN tunnel is associated. Provided by the client when the VPN tunnel is created. + * @type string $vpn_gateway + * URL of the VPN gateway with which this VPN tunnel is associated. Provided by the client when the VPN tunnel is created. This must be used (instead of target_vpn_gateway) if a High Availability VPN gateway resource is created. + * @type int $vpn_gateway_interface + * The interface ID of the VPN gateway with which this VPN tunnel is associated. Possible values are: `0`, `1`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * An optional description of this resource. Provide this property when you create the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] Detailed status message for the VPN tunnel. + * + * Generated from protobuf field optional string detailed_status = 333501025; + * @return string + */ + public function getDetailedStatus() + { + return isset($this->detailed_status) ? $this->detailed_status : ''; + } + + public function hasDetailedStatus() + { + return isset($this->detailed_status); + } + + public function clearDetailedStatus() + { + unset($this->detailed_status); + } + + /** + * [Output Only] Detailed status message for the VPN tunnel. + * + * Generated from protobuf field optional string detailed_status = 333501025; + * @param string $var + * @return $this + */ + public function setDetailedStatus($var) + { + GPBUtil::checkString($var, True); + $this->detailed_status = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * IKE protocol version to use when establishing the VPN tunnel with the peer VPN gateway. Acceptable IKE versions are 1 or 2. The default version is 2. + * + * Generated from protobuf field optional int32 ike_version = 218376220; + * @return int + */ + public function getIkeVersion() + { + return isset($this->ike_version) ? $this->ike_version : 0; + } + + public function hasIkeVersion() + { + return isset($this->ike_version); + } + + public function clearIkeVersion() + { + unset($this->ike_version); + } + + /** + * IKE protocol version to use when establishing the VPN tunnel with the peer VPN gateway. Acceptable IKE versions are 1 or 2. The default version is 2. + * + * Generated from protobuf field optional int32 ike_version = 218376220; + * @param int $var + * @return $this + */ + public function setIkeVersion($var) + { + GPBUtil::checkInt32($var); + $this->ike_version = $var; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + * + * 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; + } + + /** + * A fingerprint for the labels being applied to this VpnTunnel, 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 VpnTunnel. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @return string + */ + public function getLabelFingerprint() + { + return isset($this->label_fingerprint) ? $this->label_fingerprint : ''; + } + + public function hasLabelFingerprint() + { + return isset($this->label_fingerprint); + } + + public function clearLabelFingerprint() + { + unset($this->label_fingerprint); + } + + /** + * A fingerprint for the labels being applied to this VpnTunnel, 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 VpnTunnel. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @param string $var + * @return $this + */ + public function setLabelFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->label_fingerprint = $var; + + return $this; + } + + /** + * 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. + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->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. + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Local traffic selector to use when establishing the VPN tunnel with the peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges must be disjoint. Only IPv4 is supported. + * + * Generated from protobuf field repeated string local_traffic_selector = 317314613; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLocalTrafficSelector() + { + return $this->local_traffic_selector; + } + + /** + * Local traffic selector to use when establishing the VPN tunnel with the peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges must be disjoint. Only IPv4 is supported. + * + * Generated from protobuf field repeated string local_traffic_selector = 317314613; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLocalTrafficSelector($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->local_traffic_selector = $arr; + + return $this; + } + + /** + * 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. + * + * 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); + } + + /** + * 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. + * + * 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; + } + + /** + * URL of the peer side external VPN gateway to which this VPN tunnel is connected. Provided by the client when the VPN tunnel is created. This field is exclusive with the field peerGcpGateway. + * + * Generated from protobuf field optional string peer_external_gateway = 384956173; + * @return string + */ + public function getPeerExternalGateway() + { + return isset($this->peer_external_gateway) ? $this->peer_external_gateway : ''; + } + + public function hasPeerExternalGateway() + { + return isset($this->peer_external_gateway); + } + + public function clearPeerExternalGateway() + { + unset($this->peer_external_gateway); + } + + /** + * URL of the peer side external VPN gateway to which this VPN tunnel is connected. Provided by the client when the VPN tunnel is created. This field is exclusive with the field peerGcpGateway. + * + * Generated from protobuf field optional string peer_external_gateway = 384956173; + * @param string $var + * @return $this + */ + public function setPeerExternalGateway($var) + { + GPBUtil::checkString($var, True); + $this->peer_external_gateway = $var; + + return $this; + } + + /** + * The interface ID of the external VPN gateway to which this VPN tunnel is connected. Provided by the client when the VPN tunnel is created. Possible values are: `0`, `1`, `2`, `3`. The number of IDs in use depends on the external VPN gateway redundancy type. + * + * Generated from protobuf field optional int32 peer_external_gateway_interface = 452768391; + * @return int + */ + public function getPeerExternalGatewayInterface() + { + return isset($this->peer_external_gateway_interface) ? $this->peer_external_gateway_interface : 0; + } + + public function hasPeerExternalGatewayInterface() + { + return isset($this->peer_external_gateway_interface); + } + + public function clearPeerExternalGatewayInterface() + { + unset($this->peer_external_gateway_interface); + } + + /** + * The interface ID of the external VPN gateway to which this VPN tunnel is connected. Provided by the client when the VPN tunnel is created. Possible values are: `0`, `1`, `2`, `3`. The number of IDs in use depends on the external VPN gateway redundancy type. + * + * Generated from protobuf field optional int32 peer_external_gateway_interface = 452768391; + * @param int $var + * @return $this + */ + public function setPeerExternalGatewayInterface($var) + { + GPBUtil::checkInt32($var); + $this->peer_external_gateway_interface = $var; + + return $this; + } + + /** + * URL of the peer side HA VPN gateway to which this VPN tunnel is connected. Provided by the client when the VPN tunnel is created. This field can be used when creating highly available VPN from VPC network to VPC network, the field is exclusive with the field peerExternalGateway. If provided, the VPN tunnel will automatically use the same vpnGatewayInterface ID in the peer Google Cloud VPN gateway. + * + * Generated from protobuf field optional string peer_gcp_gateway = 281867452; + * @return string + */ + public function getPeerGcpGateway() + { + return isset($this->peer_gcp_gateway) ? $this->peer_gcp_gateway : ''; + } + + public function hasPeerGcpGateway() + { + return isset($this->peer_gcp_gateway); + } + + public function clearPeerGcpGateway() + { + unset($this->peer_gcp_gateway); + } + + /** + * URL of the peer side HA VPN gateway to which this VPN tunnel is connected. Provided by the client when the VPN tunnel is created. This field can be used when creating highly available VPN from VPC network to VPC network, the field is exclusive with the field peerExternalGateway. If provided, the VPN tunnel will automatically use the same vpnGatewayInterface ID in the peer Google Cloud VPN gateway. + * + * Generated from protobuf field optional string peer_gcp_gateway = 281867452; + * @param string $var + * @return $this + */ + public function setPeerGcpGateway($var) + { + GPBUtil::checkString($var, True); + $this->peer_gcp_gateway = $var; + + return $this; + } + + /** + * IP address of the peer VPN gateway. Only IPv4 is supported. + * + * Generated from protobuf field optional string peer_ip = 383249700; + * @return string + */ + public function getPeerIp() + { + return isset($this->peer_ip) ? $this->peer_ip : ''; + } + + public function hasPeerIp() + { + return isset($this->peer_ip); + } + + public function clearPeerIp() + { + unset($this->peer_ip); + } + + /** + * IP address of the peer VPN gateway. Only IPv4 is supported. + * + * Generated from protobuf field optional string peer_ip = 383249700; + * @param string $var + * @return $this + */ + public function setPeerIp($var) + { + GPBUtil::checkString($var, True); + $this->peer_ip = $var; + + return $this; + } + + /** + * [Output Only] URL of the region where the VPN tunnel resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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 VPN tunnel resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + * + * 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; + } + + /** + * Remote traffic selectors to use when establishing the VPN tunnel with the peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported. + * + * Generated from protobuf field repeated string remote_traffic_selector = 358887098; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRemoteTrafficSelector() + { + return $this->remote_traffic_selector; + } + + /** + * Remote traffic selectors to use when establishing the VPN tunnel with the peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported. + * + * Generated from protobuf field repeated string remote_traffic_selector = 358887098; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRemoteTrafficSelector($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->remote_traffic_selector = $arr; + + return $this; + } + + /** + * URL of the router resource to be used for dynamic routing. + * + * Generated from protobuf field optional string router = 148608841; + * @return string + */ + public function getRouter() + { + return isset($this->router) ? $this->router : ''; + } + + public function hasRouter() + { + return isset($this->router); + } + + public function clearRouter() + { + unset($this->router); + } + + /** + * URL of the router resource to be used for dynamic routing. + * + * Generated from protobuf field optional string router = 148608841; + * @param string $var + * @return $this + */ + public function setRouter($var) + { + GPBUtil::checkString($var, True); + $this->router = $var; + + return $this; + } + + /** + * [Output Only] Server-defined URL for the 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 the 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; + } + + /** + * Shared secret used to set the secure session between the Cloud VPN gateway and the peer VPN gateway. + * + * Generated from protobuf field optional string shared_secret = 381932490; + * @return string + */ + public function getSharedSecret() + { + return isset($this->shared_secret) ? $this->shared_secret : ''; + } + + public function hasSharedSecret() + { + return isset($this->shared_secret); + } + + public function clearSharedSecret() + { + unset($this->shared_secret); + } + + /** + * Shared secret used to set the secure session between the Cloud VPN gateway and the peer VPN gateway. + * + * Generated from protobuf field optional string shared_secret = 381932490; + * @param string $var + * @return $this + */ + public function setSharedSecret($var) + { + GPBUtil::checkString($var, True); + $this->shared_secret = $var; + + return $this; + } + + /** + * Hash of the shared secret. + * + * Generated from protobuf field optional string shared_secret_hash = 398881891; + * @return string + */ + public function getSharedSecretHash() + { + return isset($this->shared_secret_hash) ? $this->shared_secret_hash : ''; + } + + public function hasSharedSecretHash() + { + return isset($this->shared_secret_hash); + } + + public function clearSharedSecretHash() + { + unset($this->shared_secret_hash); + } + + /** + * Hash of the shared secret. + * + * Generated from protobuf field optional string shared_secret_hash = 398881891; + * @param string $var + * @return $this + */ + public function setSharedSecretHash($var) + { + GPBUtil::checkString($var, True); + $this->shared_secret_hash = $var; + + return $this; + } + + /** + * [Output Only] The status of the VPN tunnel, which can be one of the following: - PROVISIONING: Resource is being allocated for the VPN tunnel. - WAITING_FOR_FULL_CONFIG: Waiting to receive all VPN-related configs from the user. Network, TargetVpnGateway, VpnTunnel, ForwardingRule, and Route resources are needed to setup the VPN tunnel. - FIRST_HANDSHAKE: Successful first handshake with the peer VPN. - ESTABLISHED: Secure session is successfully established with the peer VPN. - NETWORK_ERROR: Deprecated, replaced by NO_INCOMING_PACKETS - AUTHORIZATION_ERROR: Auth error (for example, bad shared secret). - NEGOTIATION_FAILURE: Handshake failed. - DEPROVISIONING: Resources are being deallocated for the VPN tunnel. - FAILED: Tunnel creation has failed and the tunnel is not ready to be used. - NO_INCOMING_PACKETS: No incoming packets from peer. - REJECTED: Tunnel configuration was rejected, can be result of being denied access. - ALLOCATING_RESOURCES: Cloud VPN is in the process of allocating all required resources. - STOPPED: Tunnel is stopped due to its Forwarding Rules being deleted for Classic VPN tunnels or the project is in frozen state. - PEER_IDENTITY_MISMATCH: Peer identity does not match peer IP, probably behind NAT. - TS_NARROWING_NOT_ALLOWED: Traffic selector narrowing not allowed for an HA-VPN tunnel. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] The status of the VPN tunnel, which can be one of the following: - PROVISIONING: Resource is being allocated for the VPN tunnel. - WAITING_FOR_FULL_CONFIG: Waiting to receive all VPN-related configs from the user. Network, TargetVpnGateway, VpnTunnel, ForwardingRule, and Route resources are needed to setup the VPN tunnel. - FIRST_HANDSHAKE: Successful first handshake with the peer VPN. - ESTABLISHED: Secure session is successfully established with the peer VPN. - NETWORK_ERROR: Deprecated, replaced by NO_INCOMING_PACKETS - AUTHORIZATION_ERROR: Auth error (for example, bad shared secret). - NEGOTIATION_FAILURE: Handshake failed. - DEPROVISIONING: Resources are being deallocated for the VPN tunnel. - FAILED: Tunnel creation has failed and the tunnel is not ready to be used. - NO_INCOMING_PACKETS: No incoming packets from peer. - REJECTED: Tunnel configuration was rejected, can be result of being denied access. - ALLOCATING_RESOURCES: Cloud VPN is in the process of allocating all required resources. - STOPPED: Tunnel is stopped due to its Forwarding Rules being deleted for Classic VPN tunnels or the project is in frozen state. - PEER_IDENTITY_MISMATCH: Peer identity does not match peer IP, probably behind NAT. - TS_NARROWING_NOT_ALLOWED: Traffic selector narrowing not allowed for an HA-VPN tunnel. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + + /** + * URL of the Target VPN gateway with which this VPN tunnel is associated. Provided by the client when the VPN tunnel is created. + * + * Generated from protobuf field optional string target_vpn_gateway = 532512843; + * @return string + */ + public function getTargetVpnGateway() + { + return isset($this->target_vpn_gateway) ? $this->target_vpn_gateway : ''; + } + + public function hasTargetVpnGateway() + { + return isset($this->target_vpn_gateway); + } + + public function clearTargetVpnGateway() + { + unset($this->target_vpn_gateway); + } + + /** + * URL of the Target VPN gateway with which this VPN tunnel is associated. Provided by the client when the VPN tunnel is created. + * + * Generated from protobuf field optional string target_vpn_gateway = 532512843; + * @param string $var + * @return $this + */ + public function setTargetVpnGateway($var) + { + GPBUtil::checkString($var, True); + $this->target_vpn_gateway = $var; + + return $this; + } + + /** + * URL of the VPN gateway with which this VPN tunnel is associated. Provided by the client when the VPN tunnel is created. This must be used (instead of target_vpn_gateway) if a High Availability VPN gateway resource is created. + * + * Generated from protobuf field optional string vpn_gateway = 406684153; + * @return string + */ + public function getVpnGateway() + { + return isset($this->vpn_gateway) ? $this->vpn_gateway : ''; + } + + public function hasVpnGateway() + { + return isset($this->vpn_gateway); + } + + public function clearVpnGateway() + { + unset($this->vpn_gateway); + } + + /** + * URL of the VPN gateway with which this VPN tunnel is associated. Provided by the client when the VPN tunnel is created. This must be used (instead of target_vpn_gateway) if a High Availability VPN gateway resource is created. + * + * Generated from protobuf field optional string vpn_gateway = 406684153; + * @param string $var + * @return $this + */ + public function setVpnGateway($var) + { + GPBUtil::checkString($var, True); + $this->vpn_gateway = $var; + + return $this; + } + + /** + * The interface ID of the VPN gateway with which this VPN tunnel is associated. Possible values are: `0`, `1`. + * + * Generated from protobuf field optional int32 vpn_gateway_interface = 95979123; + * @return int + */ + public function getVpnGatewayInterface() + { + return isset($this->vpn_gateway_interface) ? $this->vpn_gateway_interface : 0; + } + + public function hasVpnGatewayInterface() + { + return isset($this->vpn_gateway_interface); + } + + public function clearVpnGatewayInterface() + { + unset($this->vpn_gateway_interface); + } + + /** + * The interface ID of the VPN gateway with which this VPN tunnel is associated. Possible values are: `0`, `1`. + * + * Generated from protobuf field optional int32 vpn_gateway_interface = 95979123; + * @param int $var + * @return $this + */ + public function setVpnGatewayInterface($var) + { + GPBUtil::checkInt32($var); + $this->vpn_gateway_interface = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnTunnel/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnTunnel/Status.php new file mode 100644 index 000000000000..2e9359f4bfad --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnTunnel/Status.php @@ -0,0 +1,141 @@ +google.cloud.compute.v1.VpnTunnel.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * Cloud VPN is in the process of allocating all required resources (specifically, a borg task). + * + * Generated from protobuf enum ALLOCATING_RESOURCES = 320922816; + */ + const ALLOCATING_RESOURCES = 320922816; + /** + * Auth error (e.g. bad shared secret). + * + * Generated from protobuf enum AUTHORIZATION_ERROR = 23580290; + */ + const AUTHORIZATION_ERROR = 23580290; + /** + * Resources is being deallocated for the VPN tunnel. + * + * Generated from protobuf enum DEPROVISIONING = 428935662; + */ + const DEPROVISIONING = 428935662; + /** + * Secure session is successfully established with peer VPN. + * + * Generated from protobuf enum ESTABLISHED = 88852344; + */ + const ESTABLISHED = 88852344; + /** + * Tunnel creation has failed and the tunnel is not ready to be used. + * + * Generated from protobuf enum FAILED = 455706685; + */ + const FAILED = 455706685; + /** + * Successful first handshake with peer VPN. + * + * Generated from protobuf enum FIRST_HANDSHAKE = 191393000; + */ + const FIRST_HANDSHAKE = 191393000; + /** + * Handshake failed. + * + * Generated from protobuf enum NEGOTIATION_FAILURE = 360325868; + */ + const NEGOTIATION_FAILURE = 360325868; + /** + * Deprecated, replaced by NO_INCOMING_PACKETS + * + * Generated from protobuf enum NETWORK_ERROR = 193912951; + */ + const NETWORK_ERROR = 193912951; + /** + * No incoming packets from peer + * + * Generated from protobuf enum NO_INCOMING_PACKETS = 119983216; + */ + const NO_INCOMING_PACKETS = 119983216; + /** + * Resource is being allocated for the VPN tunnel. + * + * Generated from protobuf enum PROVISIONING = 290896621; + */ + const PROVISIONING = 290896621; + /** + * Tunnel configuration was rejected, can be result of being denylisted. + * + * Generated from protobuf enum REJECTED = 174130302; + */ + const REJECTED = 174130302; + /** + * Tunnel is stopped due to its Forwarding Rules being deleted. + * + * Generated from protobuf enum STOPPED = 444276141; + */ + const STOPPED = 444276141; + /** + * Waiting to receive all VPN-related configs from user. Network, TargetVpnGateway, VpnTunnel, ForwardingRule and Route resources are needed to setup VPN tunnel. + * + * Generated from protobuf enum WAITING_FOR_FULL_CONFIG = 41640522; + */ + const WAITING_FOR_FULL_CONFIG = 41640522; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::ALLOCATING_RESOURCES => 'ALLOCATING_RESOURCES', + self::AUTHORIZATION_ERROR => 'AUTHORIZATION_ERROR', + self::DEPROVISIONING => 'DEPROVISIONING', + self::ESTABLISHED => 'ESTABLISHED', + self::FAILED => 'FAILED', + self::FIRST_HANDSHAKE => 'FIRST_HANDSHAKE', + self::NEGOTIATION_FAILURE => 'NEGOTIATION_FAILURE', + self::NETWORK_ERROR => 'NETWORK_ERROR', + self::NO_INCOMING_PACKETS => 'NO_INCOMING_PACKETS', + self::PROVISIONING => 'PROVISIONING', + self::REJECTED => 'REJECTED', + self::STOPPED => 'STOPPED', + self::WAITING_FOR_FULL_CONFIG => 'WAITING_FOR_FULL_CONFIG', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\VpnTunnel_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnTunnelAggregatedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnTunnelAggregatedList.php new file mode 100644 index 000000000000..d7621fbfabf3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnTunnelAggregatedList.php @@ -0,0 +1,320 @@ +google.cloud.compute.v1.VpnTunnelAggregatedList + */ +class VpnTunnelAggregatedList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of VpnTunnelsScopedList resources. + * + * Generated from protobuf field map items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + */ + private $unreachables; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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 VpnTunnelsScopedList resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + * @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 array|\Google\Protobuf\Internal\RepeatedField $unreachables + * [Output Only] Unreachable resources. + * @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 VpnTunnelsScopedList resources. + * + * Generated from protobuf field map items = 100526016; + * @return \Google\Protobuf\Internal\MapField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of VpnTunnelsScopedList 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\VpnTunnelsScopedList::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + * + * 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] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachables() + { + return $this->unreachables; + } + + /** + * [Output Only] Unreachable resources. + * + * Generated from protobuf field repeated string unreachables = 243372063; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachables($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachables = $arr; + + 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnTunnelList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnTunnelList.php new file mode 100644 index 000000000000..1ed0b01deeb7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnTunnelList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.VpnTunnelList + */ +class VpnTunnelList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of VpnTunnel resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VpnTunnel items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\VpnTunnel>|\Google\Protobuf\Internal\RepeatedField $items + * A list of VpnTunnel resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + * @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 VpnTunnel resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VpnTunnel items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of VpnTunnel resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VpnTunnel items = 100526016; + * @param array<\Google\Cloud\Compute\V1\VpnTunnel>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\VpnTunnel::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnTunnelsScopedList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnTunnelsScopedList.php new file mode 100644 index 000000000000..2b38f71560da --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnTunnelsScopedList.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.VpnTunnelsScopedList + */ +class VpnTunnelsScopedList extends \Google\Protobuf\Internal\Message +{ + /** + * A list of VPN tunnels contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VpnTunnel vpn_tunnels = 163494080; + */ + private $vpn_tunnels; + /** + * Informational warning which replaces the list of addresses when the list is empty. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $warning = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\VpnTunnel>|\Google\Protobuf\Internal\RepeatedField $vpn_tunnels + * A list of VPN tunnels contained in this scope. + * @type \Google\Cloud\Compute\V1\Warning $warning + * Informational warning which replaces the list of addresses when the list is empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of VPN tunnels contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VpnTunnel vpn_tunnels = 163494080; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVpnTunnels() + { + return $this->vpn_tunnels; + } + + /** + * A list of VPN tunnels contained in this scope. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.VpnTunnel vpn_tunnels = 163494080; + * @param array<\Google\Cloud\Compute\V1\VpnTunnel>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVpnTunnels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\VpnTunnel::class); + $this->vpn_tunnels = $arr; + + return $this; + } + + /** + * Informational warning which replaces the list of addresses 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); + } + + /** + * Informational warning which replaces the list of addresses 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WafExpressionSet.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WafExpressionSet.php new file mode 100644 index 000000000000..877303386e84 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WafExpressionSet.php @@ -0,0 +1,144 @@ +google.cloud.compute.v1.WafExpressionSet + */ +class WafExpressionSet extends \Google\Protobuf\Internal\Message +{ + /** + * A list of alternate IDs. The format should be: - E.g. XSS-stable Generic suffix like "stable" is particularly useful if a policy likes to avail newer set of expressions without having to change the policy. A given alias name can't be used for more than one entity set. + * + * Generated from protobuf field repeated string aliases = 159207166; + */ + private $aliases; + /** + * List of available expressions. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.WafExpressionSetExpression expressions = 175554779; + */ + private $expressions; + /** + * Google specified expression set ID. The format should be: - E.g. XSS-20170329 required + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $aliases + * A list of alternate IDs. The format should be: - E.g. XSS-stable Generic suffix like "stable" is particularly useful if a policy likes to avail newer set of expressions without having to change the policy. A given alias name can't be used for more than one entity set. + * @type array<\Google\Cloud\Compute\V1\WafExpressionSetExpression>|\Google\Protobuf\Internal\RepeatedField $expressions + * List of available expressions. + * @type string $id + * Google specified expression set ID. The format should be: - E.g. XSS-20170329 required + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * A list of alternate IDs. The format should be: - E.g. XSS-stable Generic suffix like "stable" is particularly useful if a policy likes to avail newer set of expressions without having to change the policy. A given alias name can't be used for more than one entity set. + * + * Generated from protobuf field repeated string aliases = 159207166; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAliases() + { + return $this->aliases; + } + + /** + * A list of alternate IDs. The format should be: - E.g. XSS-stable Generic suffix like "stable" is particularly useful if a policy likes to avail newer set of expressions without having to change the policy. A given alias name can't be used for more than one entity set. + * + * Generated from protobuf field repeated string aliases = 159207166; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAliases($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->aliases = $arr; + + return $this; + } + + /** + * List of available expressions. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.WafExpressionSetExpression expressions = 175554779; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExpressions() + { + return $this->expressions; + } + + /** + * List of available expressions. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.WafExpressionSetExpression expressions = 175554779; + * @param array<\Google\Cloud\Compute\V1\WafExpressionSetExpression>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExpressions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\WafExpressionSetExpression::class); + $this->expressions = $arr; + + return $this; + } + + /** + * Google specified expression set ID. The format should be: - E.g. XSS-20170329 required + * + * 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); + } + + /** + * Google specified expression set ID. The format should be: - E.g. XSS-20170329 required + * + * 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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WafExpressionSetExpression.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WafExpressionSetExpression.php new file mode 100644 index 000000000000..d0fe342d00eb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WafExpressionSetExpression.php @@ -0,0 +1,120 @@ +google.cloud.compute.v1.WafExpressionSetExpression + */ +class WafExpressionSetExpression extends \Google\Protobuf\Internal\Message +{ + /** + * 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 + * + * Generated from protobuf field optional string id = 3355; + */ + protected $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; + */ + protected $sensitivity = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @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) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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 + * + * 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); + } + + /** + * 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 + * + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WaitGlobalOperationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WaitGlobalOperationRequest.php new file mode 100644 index 000000000000..a6ab400ee05f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WaitGlobalOperationRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.WaitGlobalOperationRequest + */ +class WaitGlobalOperationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the Operations resource to return. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $operation = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + + /** + * @param string $project Project ID for this request. + * @param string $operation Name of the Operations resource to return. + * + * @return \Google\Cloud\Compute\V1\WaitGlobalOperationRequest + * + * @experimental + */ + public static function build(string $project, string $operation): self + { + return (new self()) + ->setProject($project) + ->setOperation($operation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $operation + * Name of the Operations resource to return. + * @type string $project + * Project ID for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the Operations resource to return. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getOperation() + { + return $this->operation; + } + + /** + * Name of the Operations resource to return. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setOperation($var) + { + GPBUtil::checkString($var, True); + $this->operation = $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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WaitRegionOperationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WaitRegionOperationRequest.php new file mode 100644 index 000000000000..dd523f2c3af1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WaitRegionOperationRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.WaitRegionOperationRequest + */ +class WaitRegionOperationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the Operations resource to return. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $operation = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the region for this request. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $operation Name of the Operations resource to return. + * + * @return \Google\Cloud\Compute\V1\WaitRegionOperationRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $operation): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setOperation($operation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $operation + * Name of the Operations resource to return. + * @type string $project + * Project ID for this request. + * @type string $region + * Name of the region for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the Operations resource to return. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getOperation() + { + return $this->operation; + } + + /** + * Name of the Operations resource to return. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setOperation($var) + { + GPBUtil::checkString($var, True); + $this->operation = $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; + } + + /** + * 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; + } + + /** + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WaitZoneOperationRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WaitZoneOperationRequest.php new file mode 100644 index 000000000000..fff4e9a9125d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WaitZoneOperationRequest.php @@ -0,0 +1,152 @@ +google.cloud.compute.v1.WaitZoneOperationRequest + */ +class WaitZoneOperationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the Operations resource to return. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $operation = ''; + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project = ''; + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $zone = ''; + + /** + * @param string $project Project ID for this request. + * @param string $zone Name of the zone for this request. + * @param string $operation Name of the Operations resource to return. + * + * @return \Google\Cloud\Compute\V1\WaitZoneOperationRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $operation): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setOperation($operation); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $operation + * Name of the Operations resource to return. + * @type string $project + * Project ID for this request. + * @type string $zone + * Name of the zone for this request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Name of the Operations resource to return. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getOperation() + { + return $this->operation; + } + + /** + * Name of the Operations resource to return. + * + * Generated from protobuf field string operation = 52090215 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setOperation($var) + { + GPBUtil::checkString($var, True); + $this->operation = $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; + } + + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Name of the zone for this request. + * + * Generated from protobuf field string zone = 3744684 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Warning.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Warning.php new file mode 100644 index 000000000000..a656f924a135 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Warning.php @@ -0,0 +1,159 @@ +google.cloud.compute.v1.Warning + */ +class Warning extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + * Check the Code enum for the list of possible values. + * + * Generated from protobuf field optional string code = 3059181; + */ + protected $code = null; + /** + * [Output Only] Metadata about this warning in key: value format. For example: "data": [ { "key": "scope", "value": "zones/us-east1-d" } + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Data data = 3076010; + */ + private $data; + /** + * [Output Only] A human-readable description of the warning code. + * + * Generated from protobuf field optional string message = 418054151; + */ + protected $message = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $code + * [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + * Check the Code enum for the list of possible values. + * @type array<\Google\Cloud\Compute\V1\Data>|\Google\Protobuf\Internal\RepeatedField $data + * [Output Only] Metadata about this warning in key: value format. For example: "data": [ { "key": "scope", "value": "zones/us-east1-d" } + * @type string $message + * [Output Only] A human-readable description of the warning code. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + * Check the Code enum for the list of possible values. + * + * Generated from protobuf field optional string code = 3059181; + * @return string + */ + public function getCode() + { + return isset($this->code) ? $this->code : ''; + } + + public function hasCode() + { + return isset($this->code); + } + + public function clearCode() + { + unset($this->code); + } + + /** + * [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + * Check the Code enum for the list of possible values. + * + * Generated from protobuf field optional string code = 3059181; + * @param string $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkString($var, True); + $this->code = $var; + + return $this; + } + + /** + * [Output Only] Metadata about this warning in key: value format. For example: "data": [ { "key": "scope", "value": "zones/us-east1-d" } + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Data data = 3076010; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getData() + { + return $this->data; + } + + /** + * [Output Only] Metadata about this warning in key: value format. For example: "data": [ { "key": "scope", "value": "zones/us-east1-d" } + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Data data = 3076010; + * @param array<\Google\Cloud\Compute\V1\Data>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setData($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Data::class); + $this->data = $arr; + + return $this; + } + + /** + * [Output Only] A human-readable description of the warning code. + * + * Generated from protobuf field optional string message = 418054151; + * @return string + */ + public function getMessage() + { + return isset($this->message) ? $this->message : ''; + } + + public function hasMessage() + { + return isset($this->message); + } + + public function clearMessage() + { + unset($this->message); + } + + /** + * [Output Only] A human-readable description of the warning code. + * + * Generated from protobuf field optional string message = 418054151; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Warning/Code.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Warning/Code.php new file mode 100644 index 000000000000..0fbf03d1ccb3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Warning/Code.php @@ -0,0 +1,246 @@ +google.cloud.compute.v1.Warning.Code + */ +class Code +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_CODE = 0; + */ + const UNDEFINED_CODE = 0; + /** + * Warning about failed cleanup of transient changes made by a failed operation. + * + * Generated from protobuf enum CLEANUP_FAILED = 150308440; + */ + const CLEANUP_FAILED = 150308440; + /** + * A link to a deprecated resource was created. + * + * Generated from protobuf enum DEPRECATED_RESOURCE_USED = 391835586; + */ + const DEPRECATED_RESOURCE_USED = 391835586; + /** + * When deploying and at least one of the resources has a type marked as deprecated + * + * Generated from protobuf enum DEPRECATED_TYPE_USED = 346526230; + */ + const DEPRECATED_TYPE_USED = 346526230; + /** + * The user created a boot disk that is larger than image size. + * + * Generated from protobuf enum DISK_SIZE_LARGER_THAN_IMAGE_SIZE = 369442967; + */ + const DISK_SIZE_LARGER_THAN_IMAGE_SIZE = 369442967; + /** + * When deploying and at least one of the resources has a type marked as experimental + * + * Generated from protobuf enum EXPERIMENTAL_TYPE_USED = 451954443; + */ + const EXPERIMENTAL_TYPE_USED = 451954443; + /** + * Warning that is present in an external api call + * + * Generated from protobuf enum EXTERNAL_API_WARNING = 175546307; + */ + const EXTERNAL_API_WARNING = 175546307; + /** + * Warning that value of a field has been overridden. Deprecated unused field. + * + * Generated from protobuf enum FIELD_VALUE_OVERRIDEN = 329669423; + */ + const FIELD_VALUE_OVERRIDEN = 329669423; + /** + * The operation involved use of an injected kernel, which is deprecated. + * + * Generated from protobuf enum INJECTED_KERNELS_DEPRECATED = 417377419; + */ + const INJECTED_KERNELS_DEPRECATED = 417377419; + /** + * A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2. + * + * Generated from protobuf enum INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB = 401542606; + */ + const INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB = 401542606; + /** + * When deploying a deployment with a exceedingly large number of resources + * + * Generated from protobuf enum LARGE_DEPLOYMENT_WARNING = 481440678; + */ + const LARGE_DEPLOYMENT_WARNING = 481440678; + /** + * Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter. + * + * Generated from protobuf enum LIST_OVERHEAD_QUOTA_EXCEED = 47618117; + */ + const LIST_OVERHEAD_QUOTA_EXCEED = 47618117; + /** + * A resource depends on a missing type + * + * Generated from protobuf enum MISSING_TYPE_DEPENDENCY = 344505463; + */ + const MISSING_TYPE_DEPENDENCY = 344505463; + /** + * The route's nextHopIp address is not assigned to an instance on the network. + * + * Generated from protobuf enum NEXT_HOP_ADDRESS_NOT_ASSIGNED = 324964999; + */ + const NEXT_HOP_ADDRESS_NOT_ASSIGNED = 324964999; + /** + * The route's next hop instance cannot ip forward. + * + * Generated from protobuf enum NEXT_HOP_CANNOT_IP_FORWARD = 383382887; + */ + const NEXT_HOP_CANNOT_IP_FORWARD = 383382887; + /** + * The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route. + * + * Generated from protobuf enum NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE = 146748434; + */ + const NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE = 146748434; + /** + * The route's nextHopInstance URL refers to an instance that does not exist. + * + * Generated from protobuf enum NEXT_HOP_INSTANCE_NOT_FOUND = 464250446; + */ + const NEXT_HOP_INSTANCE_NOT_FOUND = 464250446; + /** + * The route's nextHopInstance URL refers to an instance that is not on the same network as the route. + * + * Generated from protobuf enum NEXT_HOP_INSTANCE_NOT_ON_NETWORK = 243758146; + */ + const NEXT_HOP_INSTANCE_NOT_ON_NETWORK = 243758146; + /** + * The route's next hop instance does not have a status of RUNNING. + * + * Generated from protobuf enum NEXT_HOP_NOT_RUNNING = 417081265; + */ + const NEXT_HOP_NOT_RUNNING = 417081265; + /** + * Error which is not critical. We decided to continue the process despite the mentioned error. + * + * Generated from protobuf enum NOT_CRITICAL_ERROR = 105763924; + */ + const NOT_CRITICAL_ERROR = 105763924; + /** + * No results are present on a particular list page. + * + * Generated from protobuf enum NO_RESULTS_ON_PAGE = 30036744; + */ + const NO_RESULTS_ON_PAGE = 30036744; + /** + * Success is reported, but some results may be missing due to errors + * + * Generated from protobuf enum PARTIAL_SUCCESS = 39966469; + */ + const PARTIAL_SUCCESS = 39966469; + /** + * The user attempted to use a resource that requires a TOS they have not accepted. + * + * Generated from protobuf enum REQUIRED_TOS_AGREEMENT = 3745539; + */ + const REQUIRED_TOS_AGREEMENT = 3745539; + /** + * Warning that a resource is in use. + * + * Generated from protobuf enum RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING = 496728641; + */ + const RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING = 496728641; + /** + * One or more of the resources set to auto-delete could not be deleted because they were in use. + * + * Generated from protobuf enum RESOURCE_NOT_DELETED = 168598460; + */ + const RESOURCE_NOT_DELETED = 168598460; + /** + * When a resource schema validation is ignored. + * + * Generated from protobuf enum SCHEMA_VALIDATION_IGNORED = 275245642; + */ + const SCHEMA_VALIDATION_IGNORED = 275245642; + /** + * Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group. + * + * Generated from protobuf enum SINGLE_INSTANCE_PROPERTY_TEMPLATE = 268305617; + */ + const SINGLE_INSTANCE_PROPERTY_TEMPLATE = 268305617; + /** + * When undeclared properties in the schema are present + * + * Generated from protobuf enum UNDECLARED_PROPERTIES = 390513439; + */ + const UNDECLARED_PROPERTIES = 390513439; + /** + * A given scope cannot be reached. + * + * Generated from protobuf enum UNREACHABLE = 13328052; + */ + const UNREACHABLE = 13328052; + + private static $valueToName = [ + self::UNDEFINED_CODE => 'UNDEFINED_CODE', + self::CLEANUP_FAILED => 'CLEANUP_FAILED', + self::DEPRECATED_RESOURCE_USED => 'DEPRECATED_RESOURCE_USED', + self::DEPRECATED_TYPE_USED => 'DEPRECATED_TYPE_USED', + self::DISK_SIZE_LARGER_THAN_IMAGE_SIZE => 'DISK_SIZE_LARGER_THAN_IMAGE_SIZE', + self::EXPERIMENTAL_TYPE_USED => 'EXPERIMENTAL_TYPE_USED', + self::EXTERNAL_API_WARNING => 'EXTERNAL_API_WARNING', + self::FIELD_VALUE_OVERRIDEN => 'FIELD_VALUE_OVERRIDEN', + self::INJECTED_KERNELS_DEPRECATED => 'INJECTED_KERNELS_DEPRECATED', + self::INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB => 'INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB', + self::LARGE_DEPLOYMENT_WARNING => 'LARGE_DEPLOYMENT_WARNING', + self::LIST_OVERHEAD_QUOTA_EXCEED => 'LIST_OVERHEAD_QUOTA_EXCEED', + self::MISSING_TYPE_DEPENDENCY => 'MISSING_TYPE_DEPENDENCY', + self::NEXT_HOP_ADDRESS_NOT_ASSIGNED => 'NEXT_HOP_ADDRESS_NOT_ASSIGNED', + self::NEXT_HOP_CANNOT_IP_FORWARD => 'NEXT_HOP_CANNOT_IP_FORWARD', + self::NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE => 'NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE', + self::NEXT_HOP_INSTANCE_NOT_FOUND => 'NEXT_HOP_INSTANCE_NOT_FOUND', + self::NEXT_HOP_INSTANCE_NOT_ON_NETWORK => 'NEXT_HOP_INSTANCE_NOT_ON_NETWORK', + self::NEXT_HOP_NOT_RUNNING => 'NEXT_HOP_NOT_RUNNING', + self::NOT_CRITICAL_ERROR => 'NOT_CRITICAL_ERROR', + self::NO_RESULTS_ON_PAGE => 'NO_RESULTS_ON_PAGE', + self::PARTIAL_SUCCESS => 'PARTIAL_SUCCESS', + self::REQUIRED_TOS_AGREEMENT => 'REQUIRED_TOS_AGREEMENT', + self::RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING => 'RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING', + self::RESOURCE_NOT_DELETED => 'RESOURCE_NOT_DELETED', + self::SCHEMA_VALIDATION_IGNORED => 'SCHEMA_VALIDATION_IGNORED', + self::SINGLE_INSTANCE_PROPERTY_TEMPLATE => 'SINGLE_INSTANCE_PROPERTY_TEMPLATE', + self::UNDECLARED_PROPERTIES => 'UNDECLARED_PROPERTIES', + self::UNREACHABLE => 'UNREACHABLE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Code::class, \Google\Cloud\Compute\V1\Warning_Code::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Warnings.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Warnings.php new file mode 100644 index 000000000000..09c309f0e52f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Warnings.php @@ -0,0 +1,158 @@ +google.cloud.compute.v1.Warnings + */ +class Warnings extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + * Check the Code enum for the list of possible values. + * + * Generated from protobuf field optional string code = 3059181; + */ + protected $code = null; + /** + * [Output Only] Metadata about this warning in key: value format. For example: "data": [ { "key": "scope", "value": "zones/us-east1-d" } + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Data data = 3076010; + */ + private $data; + /** + * [Output Only] A human-readable description of the warning code. + * + * Generated from protobuf field optional string message = 418054151; + */ + protected $message = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $code + * [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + * Check the Code enum for the list of possible values. + * @type array<\Google\Cloud\Compute\V1\Data>|\Google\Protobuf\Internal\RepeatedField $data + * [Output Only] Metadata about this warning in key: value format. For example: "data": [ { "key": "scope", "value": "zones/us-east1-d" } + * @type string $message + * [Output Only] A human-readable description of the warning code. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + * Check the Code enum for the list of possible values. + * + * Generated from protobuf field optional string code = 3059181; + * @return string + */ + public function getCode() + { + return isset($this->code) ? $this->code : ''; + } + + public function hasCode() + { + return isset($this->code); + } + + public function clearCode() + { + unset($this->code); + } + + /** + * [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + * Check the Code enum for the list of possible values. + * + * Generated from protobuf field optional string code = 3059181; + * @param string $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkString($var, True); + $this->code = $var; + + return $this; + } + + /** + * [Output Only] Metadata about this warning in key: value format. For example: "data": [ { "key": "scope", "value": "zones/us-east1-d" } + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Data data = 3076010; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getData() + { + return $this->data; + } + + /** + * [Output Only] Metadata about this warning in key: value format. For example: "data": [ { "key": "scope", "value": "zones/us-east1-d" } + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Data data = 3076010; + * @param array<\Google\Cloud\Compute\V1\Data>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setData($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Data::class); + $this->data = $arr; + + return $this; + } + + /** + * [Output Only] A human-readable description of the warning code. + * + * Generated from protobuf field optional string message = 418054151; + * @return string + */ + public function getMessage() + { + return isset($this->message) ? $this->message : ''; + } + + public function hasMessage() + { + return isset($this->message); + } + + public function clearMessage() + { + unset($this->message); + } + + /** + * [Output Only] A human-readable description of the warning code. + * + * Generated from protobuf field optional string message = 418054151; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Warnings/Code.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Warnings/Code.php new file mode 100644 index 000000000000..9bbbb834904e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Warnings/Code.php @@ -0,0 +1,246 @@ +google.cloud.compute.v1.Warnings.Code + */ +class Code +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_CODE = 0; + */ + const UNDEFINED_CODE = 0; + /** + * Warning about failed cleanup of transient changes made by a failed operation. + * + * Generated from protobuf enum CLEANUP_FAILED = 150308440; + */ + const CLEANUP_FAILED = 150308440; + /** + * A link to a deprecated resource was created. + * + * Generated from protobuf enum DEPRECATED_RESOURCE_USED = 391835586; + */ + const DEPRECATED_RESOURCE_USED = 391835586; + /** + * When deploying and at least one of the resources has a type marked as deprecated + * + * Generated from protobuf enum DEPRECATED_TYPE_USED = 346526230; + */ + const DEPRECATED_TYPE_USED = 346526230; + /** + * The user created a boot disk that is larger than image size. + * + * Generated from protobuf enum DISK_SIZE_LARGER_THAN_IMAGE_SIZE = 369442967; + */ + const DISK_SIZE_LARGER_THAN_IMAGE_SIZE = 369442967; + /** + * When deploying and at least one of the resources has a type marked as experimental + * + * Generated from protobuf enum EXPERIMENTAL_TYPE_USED = 451954443; + */ + const EXPERIMENTAL_TYPE_USED = 451954443; + /** + * Warning that is present in an external api call + * + * Generated from protobuf enum EXTERNAL_API_WARNING = 175546307; + */ + const EXTERNAL_API_WARNING = 175546307; + /** + * Warning that value of a field has been overridden. Deprecated unused field. + * + * Generated from protobuf enum FIELD_VALUE_OVERRIDEN = 329669423; + */ + const FIELD_VALUE_OVERRIDEN = 329669423; + /** + * The operation involved use of an injected kernel, which is deprecated. + * + * Generated from protobuf enum INJECTED_KERNELS_DEPRECATED = 417377419; + */ + const INJECTED_KERNELS_DEPRECATED = 417377419; + /** + * A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2. + * + * Generated from protobuf enum INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB = 401542606; + */ + const INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB = 401542606; + /** + * When deploying a deployment with a exceedingly large number of resources + * + * Generated from protobuf enum LARGE_DEPLOYMENT_WARNING = 481440678; + */ + const LARGE_DEPLOYMENT_WARNING = 481440678; + /** + * Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter. + * + * Generated from protobuf enum LIST_OVERHEAD_QUOTA_EXCEED = 47618117; + */ + const LIST_OVERHEAD_QUOTA_EXCEED = 47618117; + /** + * A resource depends on a missing type + * + * Generated from protobuf enum MISSING_TYPE_DEPENDENCY = 344505463; + */ + const MISSING_TYPE_DEPENDENCY = 344505463; + /** + * The route's nextHopIp address is not assigned to an instance on the network. + * + * Generated from protobuf enum NEXT_HOP_ADDRESS_NOT_ASSIGNED = 324964999; + */ + const NEXT_HOP_ADDRESS_NOT_ASSIGNED = 324964999; + /** + * The route's next hop instance cannot ip forward. + * + * Generated from protobuf enum NEXT_HOP_CANNOT_IP_FORWARD = 383382887; + */ + const NEXT_HOP_CANNOT_IP_FORWARD = 383382887; + /** + * The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route. + * + * Generated from protobuf enum NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE = 146748434; + */ + const NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE = 146748434; + /** + * The route's nextHopInstance URL refers to an instance that does not exist. + * + * Generated from protobuf enum NEXT_HOP_INSTANCE_NOT_FOUND = 464250446; + */ + const NEXT_HOP_INSTANCE_NOT_FOUND = 464250446; + /** + * The route's nextHopInstance URL refers to an instance that is not on the same network as the route. + * + * Generated from protobuf enum NEXT_HOP_INSTANCE_NOT_ON_NETWORK = 243758146; + */ + const NEXT_HOP_INSTANCE_NOT_ON_NETWORK = 243758146; + /** + * The route's next hop instance does not have a status of RUNNING. + * + * Generated from protobuf enum NEXT_HOP_NOT_RUNNING = 417081265; + */ + const NEXT_HOP_NOT_RUNNING = 417081265; + /** + * Error which is not critical. We decided to continue the process despite the mentioned error. + * + * Generated from protobuf enum NOT_CRITICAL_ERROR = 105763924; + */ + const NOT_CRITICAL_ERROR = 105763924; + /** + * No results are present on a particular list page. + * + * Generated from protobuf enum NO_RESULTS_ON_PAGE = 30036744; + */ + const NO_RESULTS_ON_PAGE = 30036744; + /** + * Success is reported, but some results may be missing due to errors + * + * Generated from protobuf enum PARTIAL_SUCCESS = 39966469; + */ + const PARTIAL_SUCCESS = 39966469; + /** + * The user attempted to use a resource that requires a TOS they have not accepted. + * + * Generated from protobuf enum REQUIRED_TOS_AGREEMENT = 3745539; + */ + const REQUIRED_TOS_AGREEMENT = 3745539; + /** + * Warning that a resource is in use. + * + * Generated from protobuf enum RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING = 496728641; + */ + const RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING = 496728641; + /** + * One or more of the resources set to auto-delete could not be deleted because they were in use. + * + * Generated from protobuf enum RESOURCE_NOT_DELETED = 168598460; + */ + const RESOURCE_NOT_DELETED = 168598460; + /** + * When a resource schema validation is ignored. + * + * Generated from protobuf enum SCHEMA_VALIDATION_IGNORED = 275245642; + */ + const SCHEMA_VALIDATION_IGNORED = 275245642; + /** + * Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group. + * + * Generated from protobuf enum SINGLE_INSTANCE_PROPERTY_TEMPLATE = 268305617; + */ + const SINGLE_INSTANCE_PROPERTY_TEMPLATE = 268305617; + /** + * When undeclared properties in the schema are present + * + * Generated from protobuf enum UNDECLARED_PROPERTIES = 390513439; + */ + const UNDECLARED_PROPERTIES = 390513439; + /** + * A given scope cannot be reached. + * + * Generated from protobuf enum UNREACHABLE = 13328052; + */ + const UNREACHABLE = 13328052; + + private static $valueToName = [ + self::UNDEFINED_CODE => 'UNDEFINED_CODE', + self::CLEANUP_FAILED => 'CLEANUP_FAILED', + self::DEPRECATED_RESOURCE_USED => 'DEPRECATED_RESOURCE_USED', + self::DEPRECATED_TYPE_USED => 'DEPRECATED_TYPE_USED', + self::DISK_SIZE_LARGER_THAN_IMAGE_SIZE => 'DISK_SIZE_LARGER_THAN_IMAGE_SIZE', + self::EXPERIMENTAL_TYPE_USED => 'EXPERIMENTAL_TYPE_USED', + self::EXTERNAL_API_WARNING => 'EXTERNAL_API_WARNING', + self::FIELD_VALUE_OVERRIDEN => 'FIELD_VALUE_OVERRIDEN', + self::INJECTED_KERNELS_DEPRECATED => 'INJECTED_KERNELS_DEPRECATED', + self::INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB => 'INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB', + self::LARGE_DEPLOYMENT_WARNING => 'LARGE_DEPLOYMENT_WARNING', + self::LIST_OVERHEAD_QUOTA_EXCEED => 'LIST_OVERHEAD_QUOTA_EXCEED', + self::MISSING_TYPE_DEPENDENCY => 'MISSING_TYPE_DEPENDENCY', + self::NEXT_HOP_ADDRESS_NOT_ASSIGNED => 'NEXT_HOP_ADDRESS_NOT_ASSIGNED', + self::NEXT_HOP_CANNOT_IP_FORWARD => 'NEXT_HOP_CANNOT_IP_FORWARD', + self::NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE => 'NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE', + self::NEXT_HOP_INSTANCE_NOT_FOUND => 'NEXT_HOP_INSTANCE_NOT_FOUND', + self::NEXT_HOP_INSTANCE_NOT_ON_NETWORK => 'NEXT_HOP_INSTANCE_NOT_ON_NETWORK', + self::NEXT_HOP_NOT_RUNNING => 'NEXT_HOP_NOT_RUNNING', + self::NOT_CRITICAL_ERROR => 'NOT_CRITICAL_ERROR', + self::NO_RESULTS_ON_PAGE => 'NO_RESULTS_ON_PAGE', + self::PARTIAL_SUCCESS => 'PARTIAL_SUCCESS', + self::REQUIRED_TOS_AGREEMENT => 'REQUIRED_TOS_AGREEMENT', + self::RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING => 'RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING', + self::RESOURCE_NOT_DELETED => 'RESOURCE_NOT_DELETED', + self::SCHEMA_VALIDATION_IGNORED => 'SCHEMA_VALIDATION_IGNORED', + self::SINGLE_INSTANCE_PROPERTY_TEMPLATE => 'SINGLE_INSTANCE_PROPERTY_TEMPLATE', + self::UNDECLARED_PROPERTIES => 'UNDECLARED_PROPERTIES', + self::UNREACHABLE => 'UNREACHABLE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Code::class, \Google\Cloud\Compute\V1\Warnings_Code::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WeightedBackendService.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WeightedBackendService.php new file mode 100644 index 000000000000..a5b382c1846b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WeightedBackendService.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.WeightedBackendService + */ +class WeightedBackendService extends \Google\Protobuf\Internal\Message +{ + /** + * The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the load balancer applies any relevant headerActions specified as part of this backendServiceWeight. + * + * Generated from protobuf field optional string backend_service = 306946058; + */ + protected $backend_service = null; + /** + * Specifies changes to request and response headers that need to take effect for the selected backendService. headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. headerAction is not supported for load balancers that have their loadBalancingScheme set to EXTERNAL. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352; + */ + protected $header_action = null; + /** + * Specifies the fraction of traffic sent to a backend service, computed as weight / (sum of all weightedBackendService weights in routeAction) . The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backend service, subsequent requests are sent to the same backend service as determined by the backend service's session affinity policy. The value must be from 0 to 1000. + * + * Generated from protobuf field optional uint32 weight = 282149496; + */ + protected $weight = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $backend_service + * The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the load balancer applies any relevant headerActions specified as part of this backendServiceWeight. + * @type \Google\Cloud\Compute\V1\HttpHeaderAction $header_action + * Specifies changes to request and response headers that need to take effect for the selected backendService. headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. headerAction is not supported for load balancers that have their loadBalancingScheme set to EXTERNAL. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * @type int $weight + * Specifies the fraction of traffic sent to a backend service, computed as weight / (sum of all weightedBackendService weights in routeAction) . The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backend service, subsequent requests are sent to the same backend service as determined by the backend service's session affinity policy. The value must be from 0 to 1000. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the load balancer applies any relevant headerActions specified as part of this backendServiceWeight. + * + * Generated from protobuf field optional string backend_service = 306946058; + * @return string + */ + public function getBackendService() + { + return isset($this->backend_service) ? $this->backend_service : ''; + } + + public function hasBackendService() + { + return isset($this->backend_service); + } + + public function clearBackendService() + { + unset($this->backend_service); + } + + /** + * The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the load balancer applies any relevant headerActions specified as part of this backendServiceWeight. + * + * Generated from protobuf field optional string backend_service = 306946058; + * @param string $var + * @return $this + */ + public function setBackendService($var) + { + GPBUtil::checkString($var, True); + $this->backend_service = $var; + + return $this; + } + + /** + * Specifies changes to request and response headers that need to take effect for the selected backendService. headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. headerAction is not supported for load balancers that have their loadBalancingScheme set to EXTERNAL. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352; + * @return \Google\Cloud\Compute\V1\HttpHeaderAction|null + */ + public function getHeaderAction() + { + return $this->header_action; + } + + public function hasHeaderAction() + { + return isset($this->header_action); + } + + public function clearHeaderAction() + { + unset($this->header_action); + } + + /** + * Specifies changes to request and response headers that need to take effect for the selected backendService. headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. headerAction is not supported for load balancers that have their loadBalancingScheme set to EXTERNAL. Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true. + * + * Generated from protobuf field optional .google.cloud.compute.v1.HttpHeaderAction header_action = 328077352; + * @param \Google\Cloud\Compute\V1\HttpHeaderAction $var + * @return $this + */ + public function setHeaderAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\HttpHeaderAction::class); + $this->header_action = $var; + + return $this; + } + + /** + * Specifies the fraction of traffic sent to a backend service, computed as weight / (sum of all weightedBackendService weights in routeAction) . The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backend service, subsequent requests are sent to the same backend service as determined by the backend service's session affinity policy. The value must be from 0 to 1000. + * + * Generated from protobuf field optional uint32 weight = 282149496; + * @return int + */ + public function getWeight() + { + return isset($this->weight) ? $this->weight : 0; + } + + public function hasWeight() + { + return isset($this->weight); + } + + public function clearWeight() + { + unset($this->weight); + } + + /** + * Specifies the fraction of traffic sent to a backend service, computed as weight / (sum of all weightedBackendService weights in routeAction) . The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backend service, subsequent requests are sent to the same backend service as determined by the backend service's session affinity policy. The value must be from 0 to 1000. + * + * Generated from protobuf field optional uint32 weight = 282149496; + * @param int $var + * @return $this + */ + public function setWeight($var) + { + GPBUtil::checkUint32($var); + $this->weight = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WithdrawPublicAdvertisedPrefixeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WithdrawPublicAdvertisedPrefixeRequest.php new file mode 100644 index 000000000000..dac4a8d5701b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WithdrawPublicAdvertisedPrefixeRequest.php @@ -0,0 +1,160 @@ +google.cloud.compute.v1.WithdrawPublicAdvertisedPrefixeRequest + */ +class WithdrawPublicAdvertisedPrefixeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The name of the public advertised prefix. It should comply with RFC1035. + * + * Generated from protobuf field string public_advertised_prefix = 101874590 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $public_advertised_prefix = ''; + /** + * 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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $publicAdvertisedPrefix The name of the public advertised prefix. It should comply with RFC1035. + * + * @return \Google\Cloud\Compute\V1\WithdrawPublicAdvertisedPrefixeRequest + * + * @experimental + */ + public static function build(string $project, string $publicAdvertisedPrefix): self + { + return (new self()) + ->setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $public_advertised_prefix + * The name of the public advertised prefix. It should comply with RFC1035. + * @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); + } + + /** + * 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 public advertised prefix. It should comply with RFC1035. + * + * Generated from protobuf field string public_advertised_prefix = 101874590 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPublicAdvertisedPrefix() + { + return $this->public_advertised_prefix; + } + + /** + * The name of the public advertised prefix. It should comply with RFC1035. + * + * Generated from protobuf field string public_advertised_prefix = 101874590 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPublicAdvertisedPrefix($var) + { + GPBUtil::checkString($var, True); + $this->public_advertised_prefix = $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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WithdrawPublicDelegatedPrefixeRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WithdrawPublicDelegatedPrefixeRequest.php new file mode 100644 index 000000000000..5d0a726412fb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/WithdrawPublicDelegatedPrefixeRequest.php @@ -0,0 +1,196 @@ +google.cloud.compute.v1.WithdrawPublicDelegatedPrefixeRequest + */ +class WithdrawPublicDelegatedPrefixeRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "project"]; + */ + protected $project = ''; + /** + * The name of the public delegated prefix. It should comply with RFC1035. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $public_delegated_prefix = ''; + /** + * The name of the region where the public delegated prefix is located. It should comply with RFC1035. + * + * Generated from protobuf field string region = 138946292 [(.google.api.field_behavior) = REQUIRED, (.google.cloud.operation_request_field) = "region"]; + */ + protected $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; + */ + protected $request_id = null; + + /** + * @param string $project Project ID for this request. + * @param string $region The name of the region where the public delegated prefix is located. It should comply with RFC1035. + * @param string $publicDelegatedPrefix The name of the public delegated prefix. It should comply with RFC1035. + * + * @return \Google\Cloud\Compute\V1\WithdrawPublicDelegatedPrefixeRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $publicDelegatedPrefix): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setPublicDelegatedPrefix($publicDelegatedPrefix); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project + * Project ID for this request. + * @type string $public_delegated_prefix + * The name of the public delegated prefix. It should comply with RFC1035. + * @type string $region + * The name of the region where the public delegated prefix is located. It should comply with RFC1035. + * @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); + } + + /** + * 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 public delegated prefix. It should comply with RFC1035. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getPublicDelegatedPrefix() + { + return $this->public_delegated_prefix; + } + + /** + * The name of the public delegated prefix. It should comply with RFC1035. + * + * Generated from protobuf field string public_delegated_prefix = 204238440 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setPublicDelegatedPrefix($var) + { + GPBUtil::checkString($var, True); + $this->public_delegated_prefix = $var; + + return $this; + } + + /** + * The name of the region where the public delegated prefix is located. It should comply with RFC1035. + * + * 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 where the public delegated prefix is located. It should comply with RFC1035. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/XpnHostList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/XpnHostList.php new file mode 100644 index 000000000000..816740c08dcb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/XpnHostList.php @@ -0,0 +1,286 @@ +google.cloud.compute.v1.XpnHostList + */ +class XpnHostList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * [Output Only] A list of shared VPC host project URLs. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Project items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#xpnHostList for lists of shared VPC hosts. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\Project>|\Google\Protobuf\Internal\RepeatedField $items + * [Output Only] A list of shared VPC host project URLs. + * @type string $kind + * [Output Only] Type of resource. Always compute#xpnHostList for lists of shared VPC hosts. + * @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; + } + + /** + * [Output Only] A list of shared VPC host project URLs. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Project items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * [Output Only] A list of shared VPC host project URLs. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Project items = 100526016; + * @param array<\Google\Cloud\Compute\V1\Project>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Project::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#xpnHostList for lists of shared VPC hosts. + * + * 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); + } + + /** + * [Output Only] Type of resource. Always compute#xpnHostList for lists of shared VPC hosts. + * + * 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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/XpnResourceId.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/XpnResourceId.php new file mode 100644 index 000000000000..638f0d858964 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/XpnResourceId.php @@ -0,0 +1,125 @@ +google.cloud.compute.v1.XpnResourceId + */ +class XpnResourceId extends \Google\Protobuf\Internal\Message +{ + /** + * The ID of the service resource. In the case of projects, this field supports project id (e.g., my-project-123) and project number (e.g. 12345678). + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * The type of the service resource. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * The ID of the service resource. In the case of projects, this field supports project id (e.g., my-project-123) and project number (e.g. 12345678). + * @type string $type + * The type of the service resource. + * Check the Type enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The ID of the service resource. In the case of projects, this field supports project id (e.g., my-project-123) and project number (e.g. 12345678). + * + * 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); + } + + /** + * The ID of the service resource. In the case of projects, this field supports project id (e.g., my-project-123) and project number (e.g. 12345678). + * + * 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; + } + + /** + * The type of the service resource. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @return string + */ + public function getType() + { + return isset($this->type) ? $this->type : ''; + } + + public function hasType() + { + return isset($this->type); + } + + public function clearType() + { + unset($this->type); + } + + /** + * The type of the service resource. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/XpnResourceId/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/XpnResourceId/Type.php new file mode 100644 index 000000000000..8a2fca195b91 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/XpnResourceId/Type.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.XpnResourceId.Type + */ +class Type +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TYPE = 0; + */ + const UNDEFINED_TYPE = 0; + /** + * Generated from protobuf enum PROJECT = 408671993; + */ + const PROJECT = 408671993; + /** + * Generated from protobuf enum XPN_RESOURCE_TYPE_UNSPECIFIED = 151607034; + */ + const XPN_RESOURCE_TYPE_UNSPECIFIED = 151607034; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::PROJECT => 'PROJECT', + self::XPN_RESOURCE_TYPE_UNSPECIFIED => 'XPN_RESOURCE_TYPE_UNSPECIFIED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Type::class, \Google\Cloud\Compute\V1\XpnResourceId_Type::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Zone.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Zone.php new file mode 100644 index 000000000000..ac170333e45f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Zone.php @@ -0,0 +1,511 @@ +google.cloud.compute.v1.Zone + */ +class Zone extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Available cpu/platform selections for the zone. + * + * Generated from protobuf field repeated string available_cpu_platforms = 175536531; + */ + private $available_cpu_platforms; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + */ + protected $creation_timestamp = null; + /** + * [Output Only] The deprecation status associated with this zone. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + */ + protected $deprecated = null; + /** + * [Output Only] Textual description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + */ + protected $id = null; + /** + * [Output Only] Type of the resource. Always compute#zone for zones. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * [Output Only] Name of the resource. + * + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * [Output Only] Full URL reference to the region which hosts the zone. + * + * Generated from protobuf field optional string region = 138946292; + */ + protected $region = null; + /** + * [Output Only] Server-defined URL for the resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Status of the zone, either UP or DOWN. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + */ + protected $status = null; + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool supports_pzs = 83983214; + */ + protected $supports_pzs = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $available_cpu_platforms + * [Output Only] Available cpu/platform selections for the zone. + * @type string $creation_timestamp + * [Output Only] Creation timestamp in RFC3339 text format. + * @type \Google\Cloud\Compute\V1\DeprecationStatus $deprecated + * [Output Only] The deprecation status associated with this zone. + * @type string $description + * [Output Only] Textual description of the resource. + * @type int|string $id + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * @type string $kind + * [Output Only] Type of the resource. Always compute#zone for zones. + * @type string $name + * [Output Only] Name of the resource. + * @type string $region + * [Output Only] Full URL reference to the region which hosts the zone. + * @type string $self_link + * [Output Only] Server-defined URL for the resource. + * @type string $status + * [Output Only] Status of the zone, either UP or DOWN. + * Check the Status enum for the list of possible values. + * @type bool $supports_pzs + * [Output Only] Reserved for future use. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Available cpu/platform selections for the zone. + * + * Generated from protobuf field repeated string available_cpu_platforms = 175536531; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAvailableCpuPlatforms() + { + return $this->available_cpu_platforms; + } + + /** + * [Output Only] Available cpu/platform selections for the zone. + * + * Generated from protobuf field repeated string available_cpu_platforms = 175536531; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAvailableCpuPlatforms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->available_cpu_platforms = $arr; + + return $this; + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @return string + */ + public function getCreationTimestamp() + { + return isset($this->creation_timestamp) ? $this->creation_timestamp : ''; + } + + public function hasCreationTimestamp() + { + return isset($this->creation_timestamp); + } + + public function clearCreationTimestamp() + { + unset($this->creation_timestamp); + } + + /** + * [Output Only] Creation timestamp in RFC3339 text format. + * + * Generated from protobuf field optional string creation_timestamp = 30525366; + * @param string $var + * @return $this + */ + public function setCreationTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->creation_timestamp = $var; + + return $this; + } + + /** + * [Output Only] The deprecation status associated with this zone. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + * @return \Google\Cloud\Compute\V1\DeprecationStatus|null + */ + public function getDeprecated() + { + return $this->deprecated; + } + + public function hasDeprecated() + { + return isset($this->deprecated); + } + + public function clearDeprecated() + { + unset($this->deprecated); + } + + /** + * [Output Only] The deprecation status associated with this zone. + * + * Generated from protobuf field optional .google.cloud.compute.v1.DeprecationStatus deprecated = 515138995; + * @param \Google\Cloud\Compute\V1\DeprecationStatus $var + * @return $this + */ + public function setDeprecated($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\DeprecationStatus::class); + $this->deprecated = $var; + + return $this; + } + + /** + * [Output Only] Textual description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @return string + */ + public function getDescription() + { + return isset($this->description) ? $this->description : ''; + } + + public function hasDescription() + { + return isset($this->description); + } + + public function clearDescription() + { + unset($this->description); + } + + /** + * [Output Only] Textual description of the resource. + * + * Generated from protobuf field optional string description = 422937596; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @return int|string + */ + public function getId() + { + return isset($this->id) ? $this->id : 0; + } + + public function hasId() + { + return isset($this->id); + } + + public function clearId() + { + unset($this->id); + } + + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. + * + * Generated from protobuf field optional uint64 id = 3355; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkUint64($var); + $this->id = $var; + + return $this; + } + + /** + * [Output Only] Type of the resource. Always compute#zone for zones. + * + * 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); + } + + /** + * [Output Only] Type of the resource. Always compute#zone for zones. + * + * 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] Name of the resource. + * + * 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); + } + + /** + * [Output Only] Name of the resource. + * + * 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; + } + + /** + * [Output Only] Full URL reference to the region which hosts the zone. + * + * 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] Full URL reference to the region which hosts the zone. + * + * 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] Server-defined URL for the 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 the 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] Status of the zone, either UP or DOWN. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @return string + */ + public function getStatus() + { + return isset($this->status) ? $this->status : ''; + } + + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + + /** + * [Output Only] Status of the zone, either UP or DOWN. + * Check the Status enum for the list of possible values. + * + * Generated from protobuf field optional string status = 181260274; + * @param string $var + * @return $this + */ + public function setStatus($var) + { + GPBUtil::checkString($var, True); + $this->status = $var; + + return $this; + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool supports_pzs = 83983214; + * @return bool + */ + public function getSupportsPzs() + { + return isset($this->supports_pzs) ? $this->supports_pzs : false; + } + + public function hasSupportsPzs() + { + return isset($this->supports_pzs); + } + + public function clearSupportsPzs() + { + unset($this->supports_pzs); + } + + /** + * [Output Only] Reserved for future use. + * + * Generated from protobuf field optional bool supports_pzs = 83983214; + * @param bool $var + * @return $this + */ + public function setSupportsPzs($var) + { + GPBUtil::checkBool($var); + $this->supports_pzs = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Zone/Status.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Zone/Status.php new file mode 100644 index 000000000000..a1ba07981f56 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Zone/Status.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.Zone.Status + */ +class Status +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_STATUS = 0; + */ + const UNDEFINED_STATUS = 0; + /** + * Generated from protobuf enum DOWN = 2104482; + */ + const DOWN = 2104482; + /** + * Generated from protobuf enum UP = 2715; + */ + const UP = 2715; + + private static $valueToName = [ + self::UNDEFINED_STATUS => 'UNDEFINED_STATUS', + self::DOWN => 'DOWN', + self::UP => 'UP', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Status::class, \Google\Cloud\Compute\V1\Zone_Status::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ZoneList.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ZoneList.php new file mode 100644 index 000000000000..3e7eef263caa --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ZoneList.php @@ -0,0 +1,287 @@ +google.cloud.compute.v1.ZoneList + */ +class ZoneList extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Unique identifier for the resource; defined by the server. + * + * Generated from protobuf field optional string id = 3355; + */ + protected $id = null; + /** + * A list of Zone resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Zone items = 100526016; + */ + private $items; + /** + * Type of resource. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $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; + */ + protected $next_page_token = null; + /** + * [Output Only] Server-defined URL for this resource. + * + * Generated from protobuf field optional string self_link = 456214797; + */ + protected $self_link = null; + /** + * [Output Only] Informational warning message. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Warning warning = 50704284; + */ + protected $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\Cloud\Compute\V1\Zone>|\Google\Protobuf\Internal\RepeatedField $items + * A list of Zone 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 Zone resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Zone items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of Zone resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Zone items = 100526016; + * @param array<\Google\Cloud\Compute\V1\Zone>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Zone::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/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ZoneSetLabelsRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ZoneSetLabelsRequest.php new file mode 100644 index 000000000000..9b2bf910ddc4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ZoneSetLabelsRequest.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.ZoneSetLabelsRequest + */ +class ZoneSetLabelsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The fingerprint of the previous set of labels for this resource, used to detect conflicts. 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. Make a get() request to the resource to get the latest fingerprint. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + */ + protected $label_fingerprint = null; + /** + * The labels to set for this resource. + * + * Generated from protobuf field map labels = 500195327; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $label_fingerprint + * The fingerprint of the previous set of labels for this resource, used to detect conflicts. 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. Make a get() request to the resource to get the latest fingerprint. + * @type array|\Google\Protobuf\Internal\MapField $labels + * The labels to set for this resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The fingerprint of the previous set of labels for this resource, used to detect conflicts. 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. Make a get() request to the resource to get the latest fingerprint. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @return string + */ + public function getLabelFingerprint() + { + return isset($this->label_fingerprint) ? $this->label_fingerprint : ''; + } + + public function hasLabelFingerprint() + { + return isset($this->label_fingerprint); + } + + public function clearLabelFingerprint() + { + unset($this->label_fingerprint); + } + + /** + * The fingerprint of the previous set of labels for this resource, used to detect conflicts. 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. Make a get() request to the resource to get the latest fingerprint. + * + * Generated from protobuf field optional string label_fingerprint = 178124825; + * @param string $var + * @return $this + */ + public function setLabelFingerprint($var) + { + GPBUtil::checkString($var, True); + $this->label_fingerprint = $var; + + return $this; + } + + /** + * The labels to set for this resource. + * + * Generated from protobuf field map labels = 500195327; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * The labels to set for this resource. + * + * Generated from protobuf field map labels = 500195327; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ZoneSetPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ZoneSetPolicyRequest.php new file mode 100644 index 000000000000..722230f9c1a4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ZoneSetPolicyRequest.php @@ -0,0 +1,154 @@ +google.cloud.compute.v1.ZoneSetPolicyRequest + */ +class ZoneSetPolicyRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use 'policy' to specify bindings. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Binding bindings = 403251854; + */ + private $bindings; + /** + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + * + * Generated from protobuf field optional string etag = 3123477; + */ + protected $etag = null; + /** + * REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Policy policy = 91071794; + */ + protected $policy = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\Binding>|\Google\Protobuf\Internal\RepeatedField $bindings + * Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use 'policy' to specify bindings. + * @type string $etag + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + * @type \Google\Cloud\Compute\V1\Policy $policy + * REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use 'policy' to specify bindings. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Binding bindings = 403251854; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBindings() + { + return $this->bindings; + } + + /** + * Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use 'policy' to specify bindings. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Binding bindings = 403251854; + * @param array<\Google\Cloud\Compute\V1\Binding>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBindings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\Binding::class); + $this->bindings = $arr; + + return $this; + } + + /** + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + * + * Generated from protobuf field optional string etag = 3123477; + * @return string + */ + public function getEtag() + { + return isset($this->etag) ? $this->etag : ''; + } + + public function hasEtag() + { + return isset($this->etag); + } + + public function clearEtag() + { + unset($this->etag); + } + + /** + * Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + * + * Generated from protobuf field optional string etag = 3123477; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Policy policy = 91071794; + * @return \Google\Cloud\Compute\V1\Policy|null + */ + public function getPolicy() + { + return $this->policy; + } + + public function hasPolicy() + { + return isset($this->policy); + } + + public function clearPolicy() + { + unset($this->policy); + } + + /** + * REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Policy policy = 91071794; + * @param \Google\Cloud\Compute\V1\Policy $var + * @return $this + */ + public function setPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Policy::class); + $this->policy = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/samples/V1/AcceleratorTypesClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/AcceleratorTypesClient/aggregated_list.php new file mode 100644 index 000000000000..bf495357d531 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AcceleratorTypesClient/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_AcceleratorTypes_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/AcceleratorTypesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/AcceleratorTypesClient/get.php new file mode 100644 index 000000000000..8ab1271cf2cf --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AcceleratorTypesClient/get.php @@ -0,0 +1,69 @@ +get($acceleratorType, $project, $zone); + 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 +{ + $acceleratorType = '[ACCELERATOR_TYPE]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + get_sample($acceleratorType, $project, $zone); +} +// [END compute_v1_generated_AcceleratorTypes_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/AcceleratorTypesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/AcceleratorTypesClient/list.php new file mode 100644 index 000000000000..f54d30512b00 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AcceleratorTypesClient/list.php @@ -0,0 +1,70 @@ +list($project, $zone); + + 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]'; + $zone = '[ZONE]'; + + list_sample($project, $zone); +} +// [END compute_v1_generated_AcceleratorTypes_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/aggregated_list.php new file mode 100644 index 000000000000..05b685a9e04b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/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_Addresses_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/delete.php new file mode 100644 index 000000000000..7fe2632a0551 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/delete.php @@ -0,0 +1,78 @@ +delete($address, $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 +{ + $address = '[ADDRESS]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + delete_sample($address, $project, $region); +} +// [END compute_v1_generated_Addresses_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/get.php new file mode 100644 index 000000000000..0626878e4e48 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/get.php @@ -0,0 +1,69 @@ +get($address, $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 +{ + $address = '[ADDRESS]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($address, $project, $region); +} +// [END compute_v1_generated_Addresses_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/insert.php new file mode 100644 index 000000000000..b87ebb3d8095 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/insert.php @@ -0,0 +1,80 @@ +insert($addressResource, $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_Addresses_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/list.php new file mode 100644 index 000000000000..ba00fc505586 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/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_Addresses_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/move.php b/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/move.php new file mode 100644 index 000000000000..5e4f5da6f003 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/move.php @@ -0,0 +1,87 @@ +move( + $address, + $project, + $region, + $regionAddressesMoveRequestResource + ); + $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 +{ + $address = '[ADDRESS]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + move_sample($address, $project, $region); +} +// [END compute_v1_generated_Addresses_Move_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/set_labels.php b/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/set_labels.php new file mode 100644 index 000000000000..429e8ca92580 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/set_labels.php @@ -0,0 +1,87 @@ +setLabels( + $project, + $region, + $regionSetLabelsRequestResource, + $resource + ); + $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]'; + $resource = '[RESOURCE]'; + + set_labels_sample($project, $region, $resource); +} +// [END compute_v1_generated_Addresses_SetLabels_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/aggregated_list.php new file mode 100644 index 000000000000..aed1178f7e68 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/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_Autoscalers_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/delete.php new file mode 100644 index 000000000000..1a3a3ed9fce0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/delete.php @@ -0,0 +1,78 @@ +delete($autoscaler, $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 +{ + $autoscaler = '[AUTOSCALER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + delete_sample($autoscaler, $project, $zone); +} +// [END compute_v1_generated_Autoscalers_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/get.php new file mode 100644 index 000000000000..a6451a6134ed --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/get.php @@ -0,0 +1,69 @@ +get($autoscaler, $project, $zone); + 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 +{ + $autoscaler = '[AUTOSCALER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + get_sample($autoscaler, $project, $zone); +} +// [END compute_v1_generated_Autoscalers_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/insert.php new file mode 100644 index 000000000000..8cf9e36d7e0f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/insert.php @@ -0,0 +1,80 @@ +insert($autoscalerResource, $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 +{ + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + insert_sample($project, $zone); +} +// [END compute_v1_generated_Autoscalers_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/list.php new file mode 100644 index 000000000000..4fb2c501a4dc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/list.php @@ -0,0 +1,70 @@ +list($project, $zone); + + 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]'; + $zone = '[ZONE]'; + + list_sample($project, $zone); +} +// [END compute_v1_generated_Autoscalers_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/patch.php new file mode 100644 index 000000000000..919fe30bdbd4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/patch.php @@ -0,0 +1,80 @@ +patch($autoscalerResource, $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 +{ + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + patch_sample($project, $zone); +} +// [END compute_v1_generated_Autoscalers_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/update.php b/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/update.php new file mode 100644 index 000000000000..cfef72114b16 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/update.php @@ -0,0 +1,80 @@ +update($autoscalerResource, $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 +{ + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + update_sample($project, $zone); +} +// [END compute_v1_generated_Autoscalers_Update_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/add_signed_url_key.php b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/add_signed_url_key.php new file mode 100644 index 000000000000..a0ba5b44e497 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/add_signed_url_key.php @@ -0,0 +1,80 @@ +addSignedUrlKey($backendBucket, $project, $signedUrlKeyResource); + $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 +{ + $backendBucket = '[BACKEND_BUCKET]'; + $project = '[PROJECT]'; + + add_signed_url_key_sample($backendBucket, $project); +} +// [END compute_v1_generated_BackendBuckets_AddSignedUrlKey_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/delete.php new file mode 100644 index 000000000000..16eaccf54466 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/delete.php @@ -0,0 +1,76 @@ +delete($backendBucket, $project); + $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 +{ + $backendBucket = '[BACKEND_BUCKET]'; + $project = '[PROJECT]'; + + delete_sample($backendBucket, $project); +} +// [END compute_v1_generated_BackendBuckets_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/delete_signed_url_key.php b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/delete_signed_url_key.php new file mode 100644 index 000000000000..01c0d1d9eb84 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/delete_signed_url_key.php @@ -0,0 +1,81 @@ +deleteSignedUrlKey($backendBucket, $keyName, $project); + $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 +{ + $backendBucket = '[BACKEND_BUCKET]'; + $keyName = '[KEY_NAME]'; + $project = '[PROJECT]'; + + delete_signed_url_key_sample($backendBucket, $keyName, $project); +} +// [END compute_v1_generated_BackendBuckets_DeleteSignedUrlKey_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/get.php new file mode 100644 index 000000000000..abe6b2ae6b8e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/get.php @@ -0,0 +1,67 @@ +get($backendBucket, $project); + 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 +{ + $backendBucket = '[BACKEND_BUCKET]'; + $project = '[PROJECT]'; + + get_sample($backendBucket, $project); +} +// [END compute_v1_generated_BackendBuckets_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/get_iam_policy.php new file mode 100644 index 000000000000..f2a425c58433 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/get_iam_policy.php @@ -0,0 +1,67 @@ +getIamPolicy($project, $resource); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + get_iam_policy_sample($project, $resource); +} +// [END compute_v1_generated_BackendBuckets_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/insert.php new file mode 100644 index 000000000000..952f0a6af87d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/insert.php @@ -0,0 +1,78 @@ +insert($backendBucketResource, $project); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_BackendBuckets_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/list.php new file mode 100644 index 000000000000..9584ceacc72b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_BackendBuckets_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/patch.php new file mode 100644 index 000000000000..e7a7d2662aa0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/patch.php @@ -0,0 +1,80 @@ +patch($backendBucket, $backendBucketResource, $project); + $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 +{ + $backendBucket = '[BACKEND_BUCKET]'; + $project = '[PROJECT]'; + + patch_sample($backendBucket, $project); +} +// [END compute_v1_generated_BackendBuckets_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/set_edge_security_policy.php b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/set_edge_security_policy.php new file mode 100644 index 000000000000..f52628e35639 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/set_edge_security_policy.php @@ -0,0 +1,84 @@ +setEdgeSecurityPolicy( + $backendBucket, + $project, + $securityPolicyReferenceResource + ); + $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 +{ + $backendBucket = '[BACKEND_BUCKET]'; + $project = '[PROJECT]'; + + set_edge_security_policy_sample($backendBucket, $project); +} +// [END compute_v1_generated_BackendBuckets_SetEdgeSecurityPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/set_iam_policy.php new file mode 100644 index 000000000000..d387dec5516f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/set_iam_policy.php @@ -0,0 +1,75 @@ +setIamPolicy( + $globalSetPolicyRequestResource, + $project, + $resource + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + set_iam_policy_sample($project, $resource); +} +// [END compute_v1_generated_BackendBuckets_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/test_iam_permissions.php new file mode 100644 index 000000000000..9698a1cb43bd --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/test_iam_permissions.php @@ -0,0 +1,75 @@ +testIamPermissions( + $project, + $resource, + $testPermissionsRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + test_iam_permissions_sample($project, $resource); +} +// [END compute_v1_generated_BackendBuckets_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/update.php b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/update.php new file mode 100644 index 000000000000..4d39df631143 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/update.php @@ -0,0 +1,80 @@ +update($backendBucket, $backendBucketResource, $project); + $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 +{ + $backendBucket = '[BACKEND_BUCKET]'; + $project = '[PROJECT]'; + + update_sample($backendBucket, $project); +} +// [END compute_v1_generated_BackendBuckets_Update_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/add_signed_url_key.php b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/add_signed_url_key.php new file mode 100644 index 000000000000..e90aef0ba150 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/add_signed_url_key.php @@ -0,0 +1,84 @@ +addSignedUrlKey( + $backendService, + $project, + $signedUrlKeyResource + ); + $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 +{ + $backendService = '[BACKEND_SERVICE]'; + $project = '[PROJECT]'; + + add_signed_url_key_sample($backendService, $project); +} +// [END compute_v1_generated_BackendServices_AddSignedUrlKey_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/aggregated_list.php new file mode 100644 index 000000000000..d80713d0f4ce --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/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_BackendServices_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/delete.php new file mode 100644 index 000000000000..d69cf76e5f61 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/delete.php @@ -0,0 +1,76 @@ +delete($backendService, $project); + $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 +{ + $backendService = '[BACKEND_SERVICE]'; + $project = '[PROJECT]'; + + delete_sample($backendService, $project); +} +// [END compute_v1_generated_BackendServices_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/delete_signed_url_key.php b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/delete_signed_url_key.php new file mode 100644 index 000000000000..ecd4b57a5aee --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/delete_signed_url_key.php @@ -0,0 +1,81 @@ +deleteSignedUrlKey($backendService, $keyName, $project); + $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 +{ + $backendService = '[BACKEND_SERVICE]'; + $keyName = '[KEY_NAME]'; + $project = '[PROJECT]'; + + delete_signed_url_key_sample($backendService, $keyName, $project); +} +// [END compute_v1_generated_BackendServices_DeleteSignedUrlKey_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/get.php new file mode 100644 index 000000000000..694c8a6005ba --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/get.php @@ -0,0 +1,67 @@ +get($backendService, $project); + 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 +{ + $backendService = '[BACKEND_SERVICE]'; + $project = '[PROJECT]'; + + get_sample($backendService, $project); +} +// [END compute_v1_generated_BackendServices_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/get_health.php b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/get_health.php new file mode 100644 index 000000000000..9f90986857b6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/get_health.php @@ -0,0 +1,75 @@ +getHealth( + $backendService, + $project, + $resourceGroupReferenceResource + ); + 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 +{ + $backendService = '[BACKEND_SERVICE]'; + $project = '[PROJECT]'; + + get_health_sample($backendService, $project); +} +// [END compute_v1_generated_BackendServices_GetHealth_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/get_iam_policy.php new file mode 100644 index 000000000000..12a4daedc25e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/get_iam_policy.php @@ -0,0 +1,67 @@ +getIamPolicy($project, $resource); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + get_iam_policy_sample($project, $resource); +} +// [END compute_v1_generated_BackendServices_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/insert.php new file mode 100644 index 000000000000..5d3eb119c8a7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/insert.php @@ -0,0 +1,78 @@ +insert($backendServiceResource, $project); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_BackendServices_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/list.php new file mode 100644 index 000000000000..1a335a236658 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_BackendServices_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/list_usable.php b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/list_usable.php new file mode 100644 index 000000000000..29fb3f53045a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/list_usable.php @@ -0,0 +1,68 @@ +listUsable($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]'; + + list_usable_sample($project); +} +// [END compute_v1_generated_BackendServices_ListUsable_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/patch.php new file mode 100644 index 000000000000..ef039986427d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/patch.php @@ -0,0 +1,80 @@ +patch($backendService, $backendServiceResource, $project); + $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 +{ + $backendService = '[BACKEND_SERVICE]'; + $project = '[PROJECT]'; + + patch_sample($backendService, $project); +} +// [END compute_v1_generated_BackendServices_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/set_edge_security_policy.php b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/set_edge_security_policy.php new file mode 100644 index 000000000000..79ccbe6bdf3f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/set_edge_security_policy.php @@ -0,0 +1,84 @@ +setEdgeSecurityPolicy( + $backendService, + $project, + $securityPolicyReferenceResource + ); + $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 +{ + $backendService = '[BACKEND_SERVICE]'; + $project = '[PROJECT]'; + + set_edge_security_policy_sample($backendService, $project); +} +// [END compute_v1_generated_BackendServices_SetEdgeSecurityPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/set_iam_policy.php new file mode 100644 index 000000000000..70510ebc73ba --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/set_iam_policy.php @@ -0,0 +1,75 @@ +setIamPolicy( + $globalSetPolicyRequestResource, + $project, + $resource + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + set_iam_policy_sample($project, $resource); +} +// [END compute_v1_generated_BackendServices_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/set_security_policy.php b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/set_security_policy.php new file mode 100644 index 000000000000..3519aafb5e39 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/set_security_policy.php @@ -0,0 +1,84 @@ +setSecurityPolicy( + $backendService, + $project, + $securityPolicyReferenceResource + ); + $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 +{ + $backendService = '[BACKEND_SERVICE]'; + $project = '[PROJECT]'; + + set_security_policy_sample($backendService, $project); +} +// [END compute_v1_generated_BackendServices_SetSecurityPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/test_iam_permissions.php new file mode 100644 index 000000000000..62aabfe6213f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/test_iam_permissions.php @@ -0,0 +1,75 @@ +testIamPermissions( + $project, + $resource, + $testPermissionsRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + test_iam_permissions_sample($project, $resource); +} +// [END compute_v1_generated_BackendServices_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/update.php b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/update.php new file mode 100644 index 000000000000..5d740e9e0d47 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/update.php @@ -0,0 +1,80 @@ +update($backendService, $backendServiceResource, $project); + $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 +{ + $backendService = '[BACKEND_SERVICE]'; + $project = '[PROJECT]'; + + update_sample($backendService, $project); +} +// [END compute_v1_generated_BackendServices_Update_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/DiskTypesClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/DiskTypesClient/aggregated_list.php new file mode 100644 index 000000000000..46aa3efb7059 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DiskTypesClient/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_DiskTypes_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/DiskTypesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/DiskTypesClient/get.php new file mode 100644 index 000000000000..730c5842e877 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DiskTypesClient/get.php @@ -0,0 +1,69 @@ +get($diskType, $project, $zone); + 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 +{ + $diskType = '[DISK_TYPE]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + get_sample($diskType, $project, $zone); +} +// [END compute_v1_generated_DiskTypes_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/DiskTypesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/DiskTypesClient/list.php new file mode 100644 index 000000000000..79a99bdec048 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DiskTypesClient/list.php @@ -0,0 +1,70 @@ +list($project, $zone); + + 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]'; + $zone = '[ZONE]'; + + list_sample($project, $zone); +} +// [END compute_v1_generated_DiskTypes_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/DisksClient/add_resource_policies.php b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/add_resource_policies.php new file mode 100644 index 000000000000..5267b7f671c2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/add_resource_policies.php @@ -0,0 +1,87 @@ +addResourcePolicies( + $disk, + $disksAddResourcePoliciesRequestResource, + $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]'; + + add_resource_policies_sample($disk, $project, $zone); +} +// [END compute_v1_generated_Disks_AddResourcePolicies_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/DisksClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/aggregated_list.php new file mode 100644 index 000000000000..024c7d3e1628 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/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_Disks_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/DisksClient/bulk_insert.php b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/bulk_insert.php new file mode 100644 index 000000000000..18e2c9798e3d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/bulk_insert.php @@ -0,0 +1,80 @@ +bulkInsert($bulkInsertDiskResourceResource, $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 +{ + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + bulk_insert_sample($project, $zone); +} +// [END compute_v1_generated_Disks_BulkInsert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/DisksClient/create_snapshot.php b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/create_snapshot.php new file mode 100644 index 000000000000..885a4430ee94 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/create_snapshot.php @@ -0,0 +1,82 @@ +createSnapshot($disk, $project, $snapshotResource, $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]'; + + create_snapshot_sample($disk, $project, $zone); +} +// [END compute_v1_generated_Disks_CreateSnapshot_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/DisksClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/delete.php new file mode 100644 index 000000000000..8a60ddf0f661 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/delete.php @@ -0,0 +1,78 @@ +delete($disk, $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]'; + + delete_sample($disk, $project, $zone); +} +// [END compute_v1_generated_Disks_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/DisksClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/get.php new file mode 100644 index 000000000000..e235405b4bea --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/get.php @@ -0,0 +1,69 @@ +get($disk, $project, $zone); + 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 +{ + $disk = '[DISK]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + get_sample($disk, $project, $zone); +} +// [END compute_v1_generated_Disks_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/DisksClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/get_iam_policy.php new file mode 100644 index 000000000000..51217b608304 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/get_iam_policy.php @@ -0,0 +1,69 @@ +getIamPolicy($project, $resource, $zone); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + $zone = '[ZONE]'; + + get_iam_policy_sample($project, $resource, $zone); +} +// [END compute_v1_generated_Disks_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/DisksClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/insert.php new file mode 100644 index 000000000000..8b89dcf057bb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/insert.php @@ -0,0 +1,80 @@ +insert($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 +{ + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + insert_sample($project, $zone); +} +// [END compute_v1_generated_Disks_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/DisksClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/list.php new file mode 100644 index 000000000000..60f5106ed925 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/list.php @@ -0,0 +1,70 @@ +list($project, $zone); + + 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]'; + $zone = '[ZONE]'; + + list_sample($project, $zone); +} +// [END compute_v1_generated_Disks_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/DisksClient/remove_resource_policies.php b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/remove_resource_policies.php new file mode 100644 index 000000000000..31a093571e8e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/remove_resource_policies.php @@ -0,0 +1,87 @@ +removeResourcePolicies( + $disk, + $disksRemoveResourcePoliciesRequestResource, + $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]'; + + remove_resource_policies_sample($disk, $project, $zone); +} +// [END compute_v1_generated_Disks_RemoveResourcePolicies_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/DisksClient/resize.php b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/resize.php new file mode 100644 index 000000000000..70587946191a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/resize.php @@ -0,0 +1,82 @@ +resize($disk, $disksResizeRequestResource, $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]'; + + resize_sample($disk, $project, $zone); +} +// [END compute_v1_generated_Disks_Resize_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/DisksClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/set_iam_policy.php new file mode 100644 index 000000000000..11d879064486 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/set_iam_policy.php @@ -0,0 +1,73 @@ +setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + $zone = '[ZONE]'; + + set_iam_policy_sample($project, $resource, $zone); +} +// [END compute_v1_generated_Disks_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/DisksClient/set_labels.php b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/set_labels.php new file mode 100644 index 000000000000..c6429d502e45 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/set_labels.php @@ -0,0 +1,82 @@ +setLabels($project, $resource, $zone, $zoneSetLabelsRequestResource); + $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]'; + $resource = '[RESOURCE]'; + $zone = '[ZONE]'; + + set_labels_sample($project, $resource, $zone); +} +// [END compute_v1_generated_Disks_SetLabels_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/DisksClient/start_async_replication.php b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/start_async_replication.php new file mode 100644 index 000000000000..ccc0bdaf1166 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/start_async_replication.php @@ -0,0 +1,87 @@ +startAsyncReplication( + $disk, + $disksStartAsyncReplicationRequestResource, + $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]'; + + start_async_replication_sample($disk, $project, $zone); +} +// [END compute_v1_generated_Disks_StartAsyncReplication_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/DisksClient/stop_async_replication.php b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/stop_async_replication.php new file mode 100644 index 000000000000..6e793d23401a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/stop_async_replication.php @@ -0,0 +1,78 @@ +stopAsyncReplication($disk, $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]'; + + stop_async_replication_sample($disk, $project, $zone); +} +// [END compute_v1_generated_Disks_StopAsyncReplication_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/DisksClient/stop_group_async_replication.php b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/stop_group_async_replication.php new file mode 100644 index 000000000000..a173c94295ba --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/stop_group_async_replication.php @@ -0,0 +1,84 @@ +stopGroupAsyncReplication( + $disksStopGroupAsyncReplicationResourceResource, + $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 +{ + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + stop_group_async_replication_sample($project, $zone); +} +// [END compute_v1_generated_Disks_StopGroupAsyncReplication_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/DisksClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/test_iam_permissions.php new file mode 100644 index 000000000000..de7160c5a187 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +testIamPermissions( + $project, + $resource, + $testPermissionsRequestResource, + $zone + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + $zone = '[ZONE]'; + + test_iam_permissions_sample($project, $resource, $zone); +} +// [END compute_v1_generated_Disks_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/DisksClient/update.php b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/update.php new file mode 100644 index 000000000000..f073d20b8bda --- /dev/null +++ b/owl-bot-staging/Compute/V1/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/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/delete.php new file mode 100644 index 000000000000..1527f6afa142 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/delete.php @@ -0,0 +1,76 @@ +delete($externalVpnGateway, $project); + $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 +{ + $externalVpnGateway = '[EXTERNAL_VPN_GATEWAY]'; + $project = '[PROJECT]'; + + delete_sample($externalVpnGateway, $project); +} +// [END compute_v1_generated_ExternalVpnGateways_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/get.php new file mode 100644 index 000000000000..6950b6fb325d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/get.php @@ -0,0 +1,67 @@ +get($externalVpnGateway, $project); + 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 +{ + $externalVpnGateway = '[EXTERNAL_VPN_GATEWAY]'; + $project = '[PROJECT]'; + + get_sample($externalVpnGateway, $project); +} +// [END compute_v1_generated_ExternalVpnGateways_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/insert.php new file mode 100644 index 000000000000..41bce9b89528 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/insert.php @@ -0,0 +1,78 @@ +insert($externalVpnGatewayResource, $project); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_ExternalVpnGateways_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/list.php new file mode 100644 index 000000000000..6ec72abf99b5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_ExternalVpnGateways_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/set_labels.php b/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/set_labels.php new file mode 100644 index 000000000000..a26387afe4e7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/set_labels.php @@ -0,0 +1,84 @@ +setLabels( + $globalSetLabelsRequestResource, + $project, + $resource + ); + $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]'; + $resource = '[RESOURCE]'; + + set_labels_sample($project, $resource); +} +// [END compute_v1_generated_ExternalVpnGateways_SetLabels_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/test_iam_permissions.php new file mode 100644 index 000000000000..91d251b7c8b6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/test_iam_permissions.php @@ -0,0 +1,75 @@ +testIamPermissions( + $project, + $resource, + $testPermissionsRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + test_iam_permissions_sample($project, $resource); +} +// [END compute_v1_generated_ExternalVpnGateways_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/add_association.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/add_association.php new file mode 100644 index 000000000000..60d12ea7de69 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/add_association.php @@ -0,0 +1,81 @@ +addAssociation( + $firewallPolicy, + $firewallPolicyAssociationResource + ); + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + + add_association_sample($firewallPolicy); +} +// [END compute_v1_generated_FirewallPolicies_AddAssociation_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/add_rule.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/add_rule.php new file mode 100644 index 000000000000..b3cddb42f3c3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/add_rule.php @@ -0,0 +1,78 @@ +addRule($firewallPolicy, $firewallPolicyRuleResource); + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + + add_rule_sample($firewallPolicy); +} +// [END compute_v1_generated_FirewallPolicies_AddRule_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/clone_rules.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/clone_rules.php new file mode 100644 index 000000000000..837f44a811d0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/clone_rules.php @@ -0,0 +1,74 @@ +cloneRules($firewallPolicy); + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + + clone_rules_sample($firewallPolicy); +} +// [END compute_v1_generated_FirewallPolicies_CloneRules_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/delete.php new file mode 100644 index 000000000000..5c50f3428cef --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/delete.php @@ -0,0 +1,74 @@ +delete($firewallPolicy); + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + + delete_sample($firewallPolicy); +} +// [END compute_v1_generated_FirewallPolicies_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/get.php new file mode 100644 index 000000000000..8b14d2ba94e5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/get.php @@ -0,0 +1,65 @@ +get($firewallPolicy); + 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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + + get_sample($firewallPolicy); +} +// [END compute_v1_generated_FirewallPolicies_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/get_association.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/get_association.php new file mode 100644 index 000000000000..721fa0d635b1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/get_association.php @@ -0,0 +1,65 @@ +getAssociation($firewallPolicy); + 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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + + get_association_sample($firewallPolicy); +} +// [END compute_v1_generated_FirewallPolicies_GetAssociation_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/get_iam_policy.php new file mode 100644 index 000000000000..cd02f68c0d82 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/get_iam_policy.php @@ -0,0 +1,65 @@ +getIamPolicy($resource); + 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 +{ + $resource = '[RESOURCE]'; + + get_iam_policy_sample($resource); +} +// [END compute_v1_generated_FirewallPolicies_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/get_rule.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/get_rule.php new file mode 100644 index 000000000000..9d22c9c17995 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/get_rule.php @@ -0,0 +1,65 @@ +getRule($firewallPolicy); + 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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + + get_rule_sample($firewallPolicy); +} +// [END compute_v1_generated_FirewallPolicies_GetRule_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/insert.php new file mode 100644 index 000000000000..89f3621b7ca0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/insert.php @@ -0,0 +1,78 @@ +insert($firewallPolicyResource, $parentId); + $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 +{ + $parentId = '[PARENT_ID]'; + + insert_sample($parentId); +} +// [END compute_v1_generated_FirewallPolicies_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/list.php new file mode 100644 index 000000000000..ecc18a71ed20 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/list.php @@ -0,0 +1,56 @@ +list(); + + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END compute_v1_generated_FirewallPolicies_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/list_associations.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/list_associations.php new file mode 100644 index 000000000000..99013b94f2d1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/list_associations.php @@ -0,0 +1,53 @@ +listAssociations(); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END compute_v1_generated_FirewallPolicies_ListAssociations_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/move.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/move.php new file mode 100644 index 000000000000..8883b4d1f14e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/move.php @@ -0,0 +1,76 @@ +move($firewallPolicy, $parentId); + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $parentId = '[PARENT_ID]'; + + move_sample($firewallPolicy, $parentId); +} +// [END compute_v1_generated_FirewallPolicies_Move_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/patch.php new file mode 100644 index 000000000000..abf075ff4d71 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/patch.php @@ -0,0 +1,78 @@ +patch($firewallPolicy, $firewallPolicyResource); + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + + patch_sample($firewallPolicy); +} +// [END compute_v1_generated_FirewallPolicies_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/patch_rule.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/patch_rule.php new file mode 100644 index 000000000000..5a323c5805c1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/patch_rule.php @@ -0,0 +1,78 @@ +patchRule($firewallPolicy, $firewallPolicyRuleResource); + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + + patch_rule_sample($firewallPolicy); +} +// [END compute_v1_generated_FirewallPolicies_PatchRule_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/remove_association.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/remove_association.php new file mode 100644 index 000000000000..09c80c6de2ff --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/remove_association.php @@ -0,0 +1,74 @@ +removeAssociation($firewallPolicy); + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + + remove_association_sample($firewallPolicy); +} +// [END compute_v1_generated_FirewallPolicies_RemoveAssociation_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/remove_rule.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/remove_rule.php new file mode 100644 index 000000000000..15aa017f3c78 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/remove_rule.php @@ -0,0 +1,74 @@ +removeRule($firewallPolicy); + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + + remove_rule_sample($firewallPolicy); +} +// [END compute_v1_generated_FirewallPolicies_RemoveRule_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/set_iam_policy.php new file mode 100644 index 000000000000..541e0a4f9bd7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/set_iam_policy.php @@ -0,0 +1,72 @@ +setIamPolicy( + $globalOrganizationSetPolicyRequestResource, + $resource + ); + 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 +{ + $resource = '[RESOURCE]'; + + set_iam_policy_sample($resource); +} +// [END compute_v1_generated_FirewallPolicies_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/test_iam_permissions.php new file mode 100644 index 000000000000..2e79f6bb20fd --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/test_iam_permissions.php @@ -0,0 +1,69 @@ +testIamPermissions($resource, $testPermissionsRequestResource); + 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 +{ + $resource = '[RESOURCE]'; + + test_iam_permissions_sample($resource); +} +// [END compute_v1_generated_FirewallPolicies_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/delete.php new file mode 100644 index 000000000000..8d7ae0565693 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/delete.php @@ -0,0 +1,76 @@ +delete($firewall, $project); + $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 +{ + $firewall = '[FIREWALL]'; + $project = '[PROJECT]'; + + delete_sample($firewall, $project); +} +// [END compute_v1_generated_Firewalls_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/get.php new file mode 100644 index 000000000000..0081437b6e21 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/get.php @@ -0,0 +1,67 @@ +get($firewall, $project); + 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 +{ + $firewall = '[FIREWALL]'; + $project = '[PROJECT]'; + + get_sample($firewall, $project); +} +// [END compute_v1_generated_Firewalls_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/insert.php new file mode 100644 index 000000000000..1ad536c9009e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/insert.php @@ -0,0 +1,78 @@ +insert($firewallResource, $project); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_Firewalls_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/list.php new file mode 100644 index 000000000000..ecdc3227ca0b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_Firewalls_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/patch.php new file mode 100644 index 000000000000..39bf2a8b2c35 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/patch.php @@ -0,0 +1,80 @@ +patch($firewall, $firewallResource, $project); + $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 +{ + $firewall = '[FIREWALL]'; + $project = '[PROJECT]'; + + patch_sample($firewall, $project); +} +// [END compute_v1_generated_Firewalls_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/update.php b/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/update.php new file mode 100644 index 000000000000..be57b8c3da12 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/update.php @@ -0,0 +1,80 @@ +update($firewall, $firewallResource, $project); + $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 +{ + $firewall = '[FIREWALL]'; + $project = '[PROJECT]'; + + update_sample($firewall, $project); +} +// [END compute_v1_generated_Firewalls_Update_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/aggregated_list.php new file mode 100644 index 000000000000..5f414da2d05c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/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_ForwardingRules_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/delete.php new file mode 100644 index 000000000000..d14487d243d9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/delete.php @@ -0,0 +1,78 @@ +delete($forwardingRule, $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 +{ + $forwardingRule = '[FORWARDING_RULE]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + delete_sample($forwardingRule, $project, $region); +} +// [END compute_v1_generated_ForwardingRules_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/get.php new file mode 100644 index 000000000000..dcc7b015bae5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/get.php @@ -0,0 +1,69 @@ +get($forwardingRule, $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 +{ + $forwardingRule = '[FORWARDING_RULE]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($forwardingRule, $project, $region); +} +// [END compute_v1_generated_ForwardingRules_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/insert.php new file mode 100644 index 000000000000..4976b68e63e8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/insert.php @@ -0,0 +1,80 @@ +insert($forwardingRuleResource, $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_ForwardingRules_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/list.php new file mode 100644 index 000000000000..d1d2298d0267 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/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_ForwardingRules_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/patch.php new file mode 100644 index 000000000000..c46ae8e587bb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/patch.php @@ -0,0 +1,87 @@ +patch( + $forwardingRule, + $forwardingRuleResource, + $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 +{ + $forwardingRule = '[FORWARDING_RULE]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + patch_sample($forwardingRule, $project, $region); +} +// [END compute_v1_generated_ForwardingRules_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/set_labels.php b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/set_labels.php new file mode 100644 index 000000000000..fe5f3cb93679 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/set_labels.php @@ -0,0 +1,87 @@ +setLabels( + $project, + $region, + $regionSetLabelsRequestResource, + $resource + ); + $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]'; + $resource = '[RESOURCE]'; + + set_labels_sample($project, $region, $resource); +} +// [END compute_v1_generated_ForwardingRules_SetLabels_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/set_target.php b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/set_target.php new file mode 100644 index 000000000000..5efd59301390 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/set_target.php @@ -0,0 +1,87 @@ +setTarget( + $forwardingRule, + $project, + $region, + $targetReferenceResource + ); + $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 +{ + $forwardingRule = '[FORWARDING_RULE]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + set_target_sample($forwardingRule, $project, $region); +} +// [END compute_v1_generated_ForwardingRules_SetTarget_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/delete.php new file mode 100644 index 000000000000..6ba6d5b5da2b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/delete.php @@ -0,0 +1,76 @@ +delete($address, $project); + $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 +{ + $address = '[ADDRESS]'; + $project = '[PROJECT]'; + + delete_sample($address, $project); +} +// [END compute_v1_generated_GlobalAddresses_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/get.php new file mode 100644 index 000000000000..24259785e239 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/get.php @@ -0,0 +1,67 @@ +get($address, $project); + 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 +{ + $address = '[ADDRESS]'; + $project = '[PROJECT]'; + + get_sample($address, $project); +} +// [END compute_v1_generated_GlobalAddresses_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/insert.php new file mode 100644 index 000000000000..3e110f4db267 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/insert.php @@ -0,0 +1,78 @@ +insert($addressResource, $project); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_GlobalAddresses_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/list.php new file mode 100644 index 000000000000..e932a788b143 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_GlobalAddresses_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/move.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/move.php new file mode 100644 index 000000000000..939851f09392 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/move.php @@ -0,0 +1,80 @@ +move($address, $globalAddressesMoveRequestResource, $project); + $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 +{ + $address = '[ADDRESS]'; + $project = '[PROJECT]'; + + move_sample($address, $project); +} +// [END compute_v1_generated_GlobalAddresses_Move_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/set_labels.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/set_labels.php new file mode 100644 index 000000000000..d2ca8c3f1768 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/set_labels.php @@ -0,0 +1,80 @@ +setLabels($globalSetLabelsRequestResource, $project, $resource); + $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]'; + $resource = '[RESOURCE]'; + + set_labels_sample($project, $resource); +} +// [END compute_v1_generated_GlobalAddresses_SetLabels_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/delete.php new file mode 100644 index 000000000000..b94ca91d2435 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/delete.php @@ -0,0 +1,76 @@ +delete($forwardingRule, $project); + $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 +{ + $forwardingRule = '[FORWARDING_RULE]'; + $project = '[PROJECT]'; + + delete_sample($forwardingRule, $project); +} +// [END compute_v1_generated_GlobalForwardingRules_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/get.php new file mode 100644 index 000000000000..6d73356c8b5c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/get.php @@ -0,0 +1,67 @@ +get($forwardingRule, $project); + 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 +{ + $forwardingRule = '[FORWARDING_RULE]'; + $project = '[PROJECT]'; + + get_sample($forwardingRule, $project); +} +// [END compute_v1_generated_GlobalForwardingRules_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/insert.php new file mode 100644 index 000000000000..e3c0622ee745 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/insert.php @@ -0,0 +1,78 @@ +insert($forwardingRuleResource, $project); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_GlobalForwardingRules_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/list.php new file mode 100644 index 000000000000..4b7c6c4b7f26 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_GlobalForwardingRules_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/patch.php new file mode 100644 index 000000000000..e736d29c3c3f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/patch.php @@ -0,0 +1,80 @@ +patch($forwardingRule, $forwardingRuleResource, $project); + $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 +{ + $forwardingRule = '[FORWARDING_RULE]'; + $project = '[PROJECT]'; + + patch_sample($forwardingRule, $project); +} +// [END compute_v1_generated_GlobalForwardingRules_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/set_labels.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/set_labels.php new file mode 100644 index 000000000000..5170d139b0e4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/set_labels.php @@ -0,0 +1,84 @@ +setLabels( + $globalSetLabelsRequestResource, + $project, + $resource + ); + $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]'; + $resource = '[RESOURCE]'; + + set_labels_sample($project, $resource); +} +// [END compute_v1_generated_GlobalForwardingRules_SetLabels_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/set_target.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/set_target.php new file mode 100644 index 000000000000..bc816d5e6906 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/set_target.php @@ -0,0 +1,84 @@ +setTarget( + $forwardingRule, + $project, + $targetReferenceResource + ); + $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 +{ + $forwardingRule = '[FORWARDING_RULE]'; + $project = '[PROJECT]'; + + set_target_sample($forwardingRule, $project); +} +// [END compute_v1_generated_GlobalForwardingRules_SetTarget_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/attach_network_endpoints.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/attach_network_endpoints.php new file mode 100644 index 000000000000..350aa4f42e27 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/attach_network_endpoints.php @@ -0,0 +1,84 @@ +attachNetworkEndpoints( + $globalNetworkEndpointGroupsAttachEndpointsRequestResource, + $networkEndpointGroup, + $project + ); + $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 +{ + $networkEndpointGroup = '[NETWORK_ENDPOINT_GROUP]'; + $project = '[PROJECT]'; + + attach_network_endpoints_sample($networkEndpointGroup, $project); +} +// [END compute_v1_generated_GlobalNetworkEndpointGroups_AttachNetworkEndpoints_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/delete.php new file mode 100644 index 000000000000..c9c21b113219 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/delete.php @@ -0,0 +1,76 @@ +delete($networkEndpointGroup, $project); + $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 +{ + $networkEndpointGroup = '[NETWORK_ENDPOINT_GROUP]'; + $project = '[PROJECT]'; + + delete_sample($networkEndpointGroup, $project); +} +// [END compute_v1_generated_GlobalNetworkEndpointGroups_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/detach_network_endpoints.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/detach_network_endpoints.php new file mode 100644 index 000000000000..7b2d7c4d6a5e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/detach_network_endpoints.php @@ -0,0 +1,84 @@ +detachNetworkEndpoints( + $globalNetworkEndpointGroupsDetachEndpointsRequestResource, + $networkEndpointGroup, + $project + ); + $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 +{ + $networkEndpointGroup = '[NETWORK_ENDPOINT_GROUP]'; + $project = '[PROJECT]'; + + detach_network_endpoints_sample($networkEndpointGroup, $project); +} +// [END compute_v1_generated_GlobalNetworkEndpointGroups_DetachNetworkEndpoints_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/get.php new file mode 100644 index 000000000000..b1d7c4d37d1b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/get.php @@ -0,0 +1,67 @@ +get($networkEndpointGroup, $project); + 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 +{ + $networkEndpointGroup = '[NETWORK_ENDPOINT_GROUP]'; + $project = '[PROJECT]'; + + get_sample($networkEndpointGroup, $project); +} +// [END compute_v1_generated_GlobalNetworkEndpointGroups_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/insert.php new file mode 100644 index 000000000000..0d5b2ba45baf --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/insert.php @@ -0,0 +1,78 @@ +insert($networkEndpointGroupResource, $project); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_GlobalNetworkEndpointGroups_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/list.php new file mode 100644 index 000000000000..cd4e36d77e14 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_GlobalNetworkEndpointGroups_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/list_network_endpoints.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/list_network_endpoints.php new file mode 100644 index 000000000000..92876111b136 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/list_network_endpoints.php @@ -0,0 +1,73 @@ +listNetworkEndpoints( + $networkEndpointGroup, + $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 +{ + $networkEndpointGroup = '[NETWORK_ENDPOINT_GROUP]'; + $project = '[PROJECT]'; + + list_network_endpoints_sample($networkEndpointGroup, $project); +} +// [END compute_v1_generated_GlobalNetworkEndpointGroups_ListNetworkEndpoints_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/aggregated_list.php new file mode 100644 index 000000000000..9f28d3caabd0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/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_GlobalOperations_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/delete.php new file mode 100644 index 000000000000..025b1b81008f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/delete.php @@ -0,0 +1,67 @@ +delete($operation, $project); + 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 +{ + $operation = '[OPERATION]'; + $project = '[PROJECT]'; + + delete_sample($operation, $project); +} +// [END compute_v1_generated_GlobalOperations_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/get.php new file mode 100644 index 000000000000..380bc6fd95ca --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/get.php @@ -0,0 +1,67 @@ +get($operation, $project); + 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 +{ + $operation = '[OPERATION]'; + $project = '[PROJECT]'; + + get_sample($operation, $project); +} +// [END compute_v1_generated_GlobalOperations_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/list.php new file mode 100644 index 000000000000..ec724838f5a0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_GlobalOperations_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/wait.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/wait.php new file mode 100644 index 000000000000..b612567682fe --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/wait.php @@ -0,0 +1,67 @@ +wait($operation, $project); + 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 +{ + $operation = '[OPERATION]'; + $project = '[PROJECT]'; + + wait_sample($operation, $project); +} +// [END compute_v1_generated_GlobalOperations_Wait_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalOrganizationOperationsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalOrganizationOperationsClient/delete.php new file mode 100644 index 000000000000..269200a38f8e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalOrganizationOperationsClient/delete.php @@ -0,0 +1,65 @@ +delete($operation); + 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 +{ + $operation = '[OPERATION]'; + + delete_sample($operation); +} +// [END compute_v1_generated_GlobalOrganizationOperations_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalOrganizationOperationsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalOrganizationOperationsClient/get.php new file mode 100644 index 000000000000..92ed5683afbc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalOrganizationOperationsClient/get.php @@ -0,0 +1,65 @@ +get($operation); + 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 +{ + $operation = '[OPERATION]'; + + get_sample($operation); +} +// [END compute_v1_generated_GlobalOrganizationOperations_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalOrganizationOperationsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalOrganizationOperationsClient/list.php new file mode 100644 index 000000000000..dc848f71d894 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalOrganizationOperationsClient/list.php @@ -0,0 +1,56 @@ +list(); + + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END compute_v1_generated_GlobalOrganizationOperations_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/delete.php new file mode 100644 index 000000000000..7f62c08e559c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/delete.php @@ -0,0 +1,76 @@ +delete($project, $publicDelegatedPrefix); + $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]'; + $publicDelegatedPrefix = '[PUBLIC_DELEGATED_PREFIX]'; + + delete_sample($project, $publicDelegatedPrefix); +} +// [END compute_v1_generated_GlobalPublicDelegatedPrefixes_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/get.php new file mode 100644 index 000000000000..a031f293c930 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/get.php @@ -0,0 +1,67 @@ +get($project, $publicDelegatedPrefix); + 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 +{ + $project = '[PROJECT]'; + $publicDelegatedPrefix = '[PUBLIC_DELEGATED_PREFIX]'; + + get_sample($project, $publicDelegatedPrefix); +} +// [END compute_v1_generated_GlobalPublicDelegatedPrefixes_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/insert.php new file mode 100644 index 000000000000..0b74cff0d378 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/insert.php @@ -0,0 +1,78 @@ +insert($project, $publicDelegatedPrefixResource); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_GlobalPublicDelegatedPrefixes_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/list.php new file mode 100644 index 000000000000..e2fe1970eb47 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_GlobalPublicDelegatedPrefixes_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/patch.php new file mode 100644 index 000000000000..0cc287568683 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/patch.php @@ -0,0 +1,84 @@ +patch( + $project, + $publicDelegatedPrefix, + $publicDelegatedPrefixResource + ); + $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]'; + $publicDelegatedPrefix = '[PUBLIC_DELEGATED_PREFIX]'; + + patch_sample($project, $publicDelegatedPrefix); +} +// [END compute_v1_generated_GlobalPublicDelegatedPrefixes_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/aggregated_list.php new file mode 100644 index 000000000000..3adc7f7bcfcf --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/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_HealthChecks_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/delete.php new file mode 100644 index 000000000000..e050a1619f53 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/delete.php @@ -0,0 +1,76 @@ +delete($healthCheck, $project); + $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 +{ + $healthCheck = '[HEALTH_CHECK]'; + $project = '[PROJECT]'; + + delete_sample($healthCheck, $project); +} +// [END compute_v1_generated_HealthChecks_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/get.php new file mode 100644 index 000000000000..dac29b138148 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/get.php @@ -0,0 +1,67 @@ +get($healthCheck, $project); + 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 +{ + $healthCheck = '[HEALTH_CHECK]'; + $project = '[PROJECT]'; + + get_sample($healthCheck, $project); +} +// [END compute_v1_generated_HealthChecks_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/insert.php new file mode 100644 index 000000000000..65b7943172aa --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/insert.php @@ -0,0 +1,78 @@ +insert($healthCheckResource, $project); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_HealthChecks_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/list.php new file mode 100644 index 000000000000..236d90f7fcad --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_HealthChecks_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/patch.php new file mode 100644 index 000000000000..e7a11dfa15c1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/patch.php @@ -0,0 +1,80 @@ +patch($healthCheck, $healthCheckResource, $project); + $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 +{ + $healthCheck = '[HEALTH_CHECK]'; + $project = '[PROJECT]'; + + patch_sample($healthCheck, $project); +} +// [END compute_v1_generated_HealthChecks_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/update.php b/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/update.php new file mode 100644 index 000000000000..6acb299157ea --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/update.php @@ -0,0 +1,80 @@ +update($healthCheck, $healthCheckResource, $project); + $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 +{ + $healthCheck = '[HEALTH_CHECK]'; + $project = '[PROJECT]'; + + update_sample($healthCheck, $project); +} +// [END compute_v1_generated_HealthChecks_Update_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ImageFamilyViewsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/ImageFamilyViewsClient/get.php new file mode 100644 index 000000000000..2fe7bff0ae44 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImageFamilyViewsClient/get.php @@ -0,0 +1,69 @@ +get($family, $project, $zone); + 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 +{ + $family = '[FAMILY]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + get_sample($family, $project, $zone); +} +// [END compute_v1_generated_ImageFamilyViews_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/delete.php new file mode 100644 index 000000000000..9a14ff60d3e8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/delete.php @@ -0,0 +1,76 @@ +delete($image, $project); + $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 +{ + $image = '[IMAGE]'; + $project = '[PROJECT]'; + + delete_sample($image, $project); +} +// [END compute_v1_generated_Images_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/deprecate.php b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/deprecate.php new file mode 100644 index 000000000000..c8098e32815c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/deprecate.php @@ -0,0 +1,80 @@ +deprecate($deprecationStatusResource, $image, $project); + $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 +{ + $image = '[IMAGE]'; + $project = '[PROJECT]'; + + deprecate_sample($image, $project); +} +// [END compute_v1_generated_Images_Deprecate_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/get.php new file mode 100644 index 000000000000..7817780cd153 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/get.php @@ -0,0 +1,67 @@ +get($image, $project); + 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 +{ + $image = '[IMAGE]'; + $project = '[PROJECT]'; + + get_sample($image, $project); +} +// [END compute_v1_generated_Images_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/get_from_family.php b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/get_from_family.php new file mode 100644 index 000000000000..1dea36a03317 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/get_from_family.php @@ -0,0 +1,67 @@ +getFromFamily($family, $project); + 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 +{ + $family = '[FAMILY]'; + $project = '[PROJECT]'; + + get_from_family_sample($family, $project); +} +// [END compute_v1_generated_Images_GetFromFamily_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/get_iam_policy.php new file mode 100644 index 000000000000..4486dd176241 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/get_iam_policy.php @@ -0,0 +1,67 @@ +getIamPolicy($project, $resource); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + get_iam_policy_sample($project, $resource); +} +// [END compute_v1_generated_Images_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/insert.php new file mode 100644 index 000000000000..4e73718c53e0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/insert.php @@ -0,0 +1,78 @@ +insert($imageResource, $project); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_Images_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/list.php new file mode 100644 index 000000000000..1004d80a472a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_Images_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/patch.php new file mode 100644 index 000000000000..6eabddb27434 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/patch.php @@ -0,0 +1,80 @@ +patch($image, $imageResource, $project); + $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 +{ + $image = '[IMAGE]'; + $project = '[PROJECT]'; + + patch_sample($image, $project); +} +// [END compute_v1_generated_Images_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/set_iam_policy.php new file mode 100644 index 000000000000..babd53b5ef4d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/set_iam_policy.php @@ -0,0 +1,71 @@ +setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + set_iam_policy_sample($project, $resource); +} +// [END compute_v1_generated_Images_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/set_labels.php b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/set_labels.php new file mode 100644 index 000000000000..d1eddc5130d4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/set_labels.php @@ -0,0 +1,80 @@ +setLabels($globalSetLabelsRequestResource, $project, $resource); + $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]'; + $resource = '[RESOURCE]'; + + set_labels_sample($project, $resource); +} +// [END compute_v1_generated_Images_SetLabels_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/test_iam_permissions.php new file mode 100644 index 000000000000..17129c0d8b65 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/test_iam_permissions.php @@ -0,0 +1,71 @@ +testIamPermissions($project, $resource, $testPermissionsRequestResource); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + test_iam_permissions_sample($project, $resource); +} +// [END compute_v1_generated_Images_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/cancel.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/cancel.php new file mode 100644 index 000000000000..3646ae02c227 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/cancel.php @@ -0,0 +1,89 @@ +cancel( + $instanceGroupManager, + $project, + $resizeRequest, + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $resizeRequest = '[RESIZE_REQUEST]'; + $zone = '[ZONE]'; + + cancel_sample($instanceGroupManager, $project, $resizeRequest, $zone); +} +// [END compute_v1_generated_InstanceGroupManagerResizeRequests_Cancel_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/delete.php new file mode 100644 index 000000000000..2a37cc86ce28 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/delete.php @@ -0,0 +1,89 @@ +delete( + $instanceGroupManager, + $project, + $resizeRequest, + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $resizeRequest = '[RESIZE_REQUEST]'; + $zone = '[ZONE]'; + + delete_sample($instanceGroupManager, $project, $resizeRequest, $zone); +} +// [END compute_v1_generated_InstanceGroupManagerResizeRequests_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/get.php new file mode 100644 index 000000000000..eb562b7b4435 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/get.php @@ -0,0 +1,80 @@ +zone scoping this request. Name should conform to RFC1035. + */ +function get_sample( + string $instanceGroupManager, + string $project, + string $resizeRequest, + string $zone +): void { + // Create a client. + $instanceGroupManagerResizeRequestsClient = new InstanceGroupManagerResizeRequestsClient(); + + // Call the API and handle any network failures. + try { + /** @var InstanceGroupManagerResizeRequest $response */ + $response = $instanceGroupManagerResizeRequestsClient->get( + $instanceGroupManager, + $project, + $resizeRequest, + $zone + ); + 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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $resizeRequest = '[RESIZE_REQUEST]'; + $zone = '[ZONE]'; + + get_sample($instanceGroupManager, $project, $resizeRequest, $zone); +} +// [END compute_v1_generated_InstanceGroupManagerResizeRequests_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/insert.php new file mode 100644 index 000000000000..f02c8379c094 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/insert.php @@ -0,0 +1,87 @@ +insert( + $instanceGroupManager, + $instanceGroupManagerResizeRequestResource, + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + insert_sample($instanceGroupManager, $project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagerResizeRequests_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/list.php new file mode 100644 index 000000000000..a9583e0f1fee --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/list.php @@ -0,0 +1,72 @@ +list($instanceGroupManager, $project, $zone); + + 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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + list_sample($instanceGroupManager, $project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagerResizeRequests_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/abandon_instances.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/abandon_instances.php new file mode 100644 index 000000000000..2c954d0c6c7c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/abandon_instances.php @@ -0,0 +1,90 @@ +abandonInstances( + $instanceGroupManager, + $instanceGroupManagersAbandonInstancesRequestResource, + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + abandon_instances_sample($instanceGroupManager, $project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_AbandonInstances_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/aggregated_list.php new file mode 100644 index 000000000000..01ff8fd54681 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/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_InstanceGroupManagers_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/apply_updates_to_instances.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/apply_updates_to_instances.php new file mode 100644 index 000000000000..63821323e705 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/apply_updates_to_instances.php @@ -0,0 +1,90 @@ +applyUpdatesToInstances( + $instanceGroupManager, + $instanceGroupManagersApplyUpdatesRequestResource, + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + apply_updates_to_instances_sample($instanceGroupManager, $project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_ApplyUpdatesToInstances_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/create_instances.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/create_instances.php new file mode 100644 index 000000000000..6d30d9dc1450 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/create_instances.php @@ -0,0 +1,90 @@ +createInstances( + $instanceGroupManager, + $instanceGroupManagersCreateInstancesRequestResource, + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + create_instances_sample($instanceGroupManager, $project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_CreateInstances_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/delete.php new file mode 100644 index 000000000000..21b558fd87e9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/delete.php @@ -0,0 +1,78 @@ +delete($instanceGroupManager, $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + delete_sample($instanceGroupManager, $project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/delete_instances.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/delete_instances.php new file mode 100644 index 000000000000..41f2e26c14e9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/delete_instances.php @@ -0,0 +1,90 @@ +deleteInstances( + $instanceGroupManager, + $instanceGroupManagersDeleteInstancesRequestResource, + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + delete_instances_sample($instanceGroupManager, $project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_DeleteInstances_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/delete_per_instance_configs.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/delete_per_instance_configs.php new file mode 100644 index 000000000000..7421a54d50f8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/delete_per_instance_configs.php @@ -0,0 +1,90 @@ +deletePerInstanceConfigs( + $instanceGroupManager, + $instanceGroupManagersDeletePerInstanceConfigsReqResource, + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + delete_per_instance_configs_sample($instanceGroupManager, $project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_DeletePerInstanceConfigs_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/get.php new file mode 100644 index 000000000000..4d2d9d98a897 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/get.php @@ -0,0 +1,69 @@ +get($instanceGroupManager, $project, $zone); + 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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + get_sample($instanceGroupManager, $project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/insert.php new file mode 100644 index 000000000000..f2a96d342276 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/insert.php @@ -0,0 +1,80 @@ +insert($instanceGroupManagerResource, $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 +{ + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + insert_sample($project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/list.php new file mode 100644 index 000000000000..4b3a557e637c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/list.php @@ -0,0 +1,70 @@ +list($project, $zone); + + 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]'; + $zone = '[ZONE]'; + + list_sample($project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/list_errors.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/list_errors.php new file mode 100644 index 000000000000..496a45dc935a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/list_errors.php @@ -0,0 +1,72 @@ +listErrors($instanceGroupManager, $project, $zone); + + 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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + list_errors_sample($instanceGroupManager, $project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_ListErrors_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/list_managed_instances.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/list_managed_instances.php new file mode 100644 index 000000000000..102c9cbe220f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/list_managed_instances.php @@ -0,0 +1,79 @@ +listManagedInstances( + $instanceGroupManager, + $project, + $zone + ); + + 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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + list_managed_instances_sample($instanceGroupManager, $project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_ListManagedInstances_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/list_per_instance_configs.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/list_per_instance_configs.php new file mode 100644 index 000000000000..3f278e91ae36 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/list_per_instance_configs.php @@ -0,0 +1,79 @@ +listPerInstanceConfigs( + $instanceGroupManager, + $project, + $zone + ); + + 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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + list_per_instance_configs_sample($instanceGroupManager, $project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_ListPerInstanceConfigs_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/patch.php new file mode 100644 index 000000000000..2075c13e6bfe --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/patch.php @@ -0,0 +1,87 @@ +patch( + $instanceGroupManager, + $instanceGroupManagerResource, + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + patch_sample($instanceGroupManager, $project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/patch_per_instance_configs.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/patch_per_instance_configs.php new file mode 100644 index 000000000000..f5ffebca2a08 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/patch_per_instance_configs.php @@ -0,0 +1,90 @@ +patchPerInstanceConfigs( + $instanceGroupManager, + $instanceGroupManagersPatchPerInstanceConfigsReqResource, + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + patch_per_instance_configs_sample($instanceGroupManager, $project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_PatchPerInstanceConfigs_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/recreate_instances.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/recreate_instances.php new file mode 100644 index 000000000000..1e8fc0126d57 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/recreate_instances.php @@ -0,0 +1,90 @@ +recreateInstances( + $instanceGroupManager, + $instanceGroupManagersRecreateInstancesRequestResource, + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + recreate_instances_sample($instanceGroupManager, $project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_RecreateInstances_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/resize.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/resize.php new file mode 100644 index 000000000000..947a25e90232 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/resize.php @@ -0,0 +1,84 @@ +resize($instanceGroupManager, $project, $size, $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $size = 0; + $zone = '[ZONE]'; + + resize_sample($instanceGroupManager, $project, $size, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_Resize_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/set_instance_template.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/set_instance_template.php new file mode 100644 index 000000000000..2d508faa7701 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/set_instance_template.php @@ -0,0 +1,90 @@ +setInstanceTemplate( + $instanceGroupManager, + $instanceGroupManagersSetInstanceTemplateRequestResource, + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + set_instance_template_sample($instanceGroupManager, $project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_SetInstanceTemplate_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/set_target_pools.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/set_target_pools.php new file mode 100644 index 000000000000..5899ee8105ad --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/set_target_pools.php @@ -0,0 +1,90 @@ +setTargetPools( + $instanceGroupManager, + $instanceGroupManagersSetTargetPoolsRequestResource, + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + set_target_pools_sample($instanceGroupManager, $project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_SetTargetPools_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/update_per_instance_configs.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/update_per_instance_configs.php new file mode 100644 index 000000000000..8206f73bad0a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/update_per_instance_configs.php @@ -0,0 +1,90 @@ +updatePerInstanceConfigs( + $instanceGroupManager, + $instanceGroupManagersUpdatePerInstanceConfigsReqResource, + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + update_per_instance_configs_sample($instanceGroupManager, $project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_UpdatePerInstanceConfigs_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/add_instances.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/add_instances.php new file mode 100644 index 000000000000..c5244d93fc27 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/add_instances.php @@ -0,0 +1,87 @@ +addInstances( + $instanceGroup, + $instanceGroupsAddInstancesRequestResource, + $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 +{ + $instanceGroup = '[INSTANCE_GROUP]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + add_instances_sample($instanceGroup, $project, $zone); +} +// [END compute_v1_generated_InstanceGroups_AddInstances_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/aggregated_list.php new file mode 100644 index 000000000000..766509e1405b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/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_InstanceGroups_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/delete.php new file mode 100644 index 000000000000..fde200540b24 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/delete.php @@ -0,0 +1,78 @@ +delete($instanceGroup, $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 +{ + $instanceGroup = '[INSTANCE_GROUP]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + delete_sample($instanceGroup, $project, $zone); +} +// [END compute_v1_generated_InstanceGroups_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/get.php new file mode 100644 index 000000000000..239593fa3f6f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/get.php @@ -0,0 +1,69 @@ +get($instanceGroup, $project, $zone); + 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 +{ + $instanceGroup = '[INSTANCE_GROUP]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + get_sample($instanceGroup, $project, $zone); +} +// [END compute_v1_generated_InstanceGroups_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/insert.php new file mode 100644 index 000000000000..e10502fdf001 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/insert.php @@ -0,0 +1,80 @@ +insert($instanceGroupResource, $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 +{ + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + insert_sample($project, $zone); +} +// [END compute_v1_generated_InstanceGroups_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/list.php new file mode 100644 index 000000000000..00aecbf0d9cc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/list.php @@ -0,0 +1,70 @@ +list($project, $zone); + + 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]'; + $zone = '[ZONE]'; + + list_sample($project, $zone); +} +// [END compute_v1_generated_InstanceGroups_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/list_instances.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/list_instances.php new file mode 100644 index 000000000000..1b28e0117f7b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/list_instances.php @@ -0,0 +1,81 @@ +listInstances( + $instanceGroup, + $instanceGroupsListInstancesRequestResource, + $project, + $zone + ); + + 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 +{ + $instanceGroup = '[INSTANCE_GROUP]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + list_instances_sample($instanceGroup, $project, $zone); +} +// [END compute_v1_generated_InstanceGroups_ListInstances_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/remove_instances.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/remove_instances.php new file mode 100644 index 000000000000..c54d750747be --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/remove_instances.php @@ -0,0 +1,87 @@ +removeInstances( + $instanceGroup, + $instanceGroupsRemoveInstancesRequestResource, + $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 +{ + $instanceGroup = '[INSTANCE_GROUP]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + remove_instances_sample($instanceGroup, $project, $zone); +} +// [END compute_v1_generated_InstanceGroups_RemoveInstances_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/set_named_ports.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/set_named_ports.php new file mode 100644 index 000000000000..36b40bd4395d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/set_named_ports.php @@ -0,0 +1,87 @@ +setNamedPorts( + $instanceGroup, + $instanceGroupsSetNamedPortsRequestResource, + $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 +{ + $instanceGroup = '[INSTANCE_GROUP]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + set_named_ports_sample($instanceGroup, $project, $zone); +} +// [END compute_v1_generated_InstanceGroups_SetNamedPorts_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceSettingsServiceClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceSettingsServiceClient/get.php new file mode 100644 index 000000000000..7e15d801afd4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceSettingsServiceClient/get.php @@ -0,0 +1,67 @@ +get($project, $zone); + 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 +{ + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + get_sample($project, $zone); +} +// [END compute_v1_generated_InstanceSettingsService_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceSettingsServiceClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceSettingsServiceClient/patch.php new file mode 100644 index 000000000000..fd51e68f9d7a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceSettingsServiceClient/patch.php @@ -0,0 +1,80 @@ +patch($instanceSettingsResource, $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 +{ + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + patch_sample($project, $zone); +} +// [END compute_v1_generated_InstanceSettingsService_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/aggregated_list.php new file mode 100644 index 000000000000..c920157d41cd --- /dev/null +++ b/owl-bot-staging/Compute/V1/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/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/delete.php new file mode 100644 index 000000000000..b11c4f2505f6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/delete.php @@ -0,0 +1,76 @@ +delete($instanceTemplate, $project); + $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]'; + + delete_sample($instanceTemplate, $project); +} +// [END compute_v1_generated_InstanceTemplates_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/get.php new file mode 100644 index 000000000000..878faef903b7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/get.php @@ -0,0 +1,67 @@ +get($instanceTemplate, $project); + 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]'; + + get_sample($instanceTemplate, $project); +} +// [END compute_v1_generated_InstanceTemplates_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/get_iam_policy.php new file mode 100644 index 000000000000..2c2442ed2a9a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/get_iam_policy.php @@ -0,0 +1,67 @@ +getIamPolicy($project, $resource); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + get_iam_policy_sample($project, $resource); +} +// [END compute_v1_generated_InstanceTemplates_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/insert.php new file mode 100644 index 000000000000..d319694d6372 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/insert.php @@ -0,0 +1,78 @@ +insert($instanceTemplateResource, $project); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_InstanceTemplates_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/list.php new file mode 100644 index 000000000000..e73ab34ec67c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_InstanceTemplates_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/set_iam_policy.php new file mode 100644 index 000000000000..14ea9da71de2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/set_iam_policy.php @@ -0,0 +1,75 @@ +setIamPolicy( + $globalSetPolicyRequestResource, + $project, + $resource + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + set_iam_policy_sample($project, $resource); +} +// [END compute_v1_generated_InstanceTemplates_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/test_iam_permissions.php new file mode 100644 index 000000000000..45cd97dc86f1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/test_iam_permissions.php @@ -0,0 +1,75 @@ +testIamPermissions( + $project, + $resource, + $testPermissionsRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + test_iam_permissions_sample($project, $resource); +} +// [END compute_v1_generated_InstanceTemplates_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/add_access_config.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/add_access_config.php new file mode 100644 index 000000000000..22e4943eed09 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/add_access_config.php @@ -0,0 +1,94 @@ +addAccessConfig( + $accessConfigResource, + $instance, + $networkInterface, + $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]'; + $networkInterface = '[NETWORK_INTERFACE]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + add_access_config_sample($instance, $networkInterface, $project, $zone); +} +// [END compute_v1_generated_Instances_AddAccessConfig_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/add_resource_policies.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/add_resource_policies.php new file mode 100644 index 000000000000..0a3fbc058fab --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/add_resource_policies.php @@ -0,0 +1,87 @@ +addResourcePolicies( + $instance, + $instancesAddResourcePoliciesRequestResource, + $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]'; + + add_resource_policies_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_AddResourcePolicies_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/aggregated_list.php new file mode 100644 index 000000000000..1b7488d034ec --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/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_Instances_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/attach_disk.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/attach_disk.php new file mode 100644 index 000000000000..d104263bf7ce --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/attach_disk.php @@ -0,0 +1,82 @@ +attachDisk($attachedDiskResource, $instance, $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]'; + + attach_disk_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_AttachDisk_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/bulk_insert.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/bulk_insert.php new file mode 100644 index 000000000000..06820944fae9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/bulk_insert.php @@ -0,0 +1,80 @@ +bulkInsert($bulkInsertInstanceResourceResource, $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 +{ + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + bulk_insert_sample($project, $zone); +} +// [END compute_v1_generated_Instances_BulkInsert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/delete.php new file mode 100644 index 000000000000..af0dd2bb0943 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/delete.php @@ -0,0 +1,78 @@ +delete($instance, $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]'; + + delete_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/delete_access_config.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/delete_access_config.php new file mode 100644 index 000000000000..a052650cd27c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/delete_access_config.php @@ -0,0 +1,93 @@ +deleteAccessConfig( + $accessConfig, + $instance, + $networkInterface, + $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 +{ + $accessConfig = '[ACCESS_CONFIG]'; + $instance = '[INSTANCE]'; + $networkInterface = '[NETWORK_INTERFACE]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + delete_access_config_sample($accessConfig, $instance, $networkInterface, $project, $zone); +} +// [END compute_v1_generated_Instances_DeleteAccessConfig_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/detach_disk.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/detach_disk.php new file mode 100644 index 000000000000..4f37e9526707 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/detach_disk.php @@ -0,0 +1,84 @@ +detachDisk($deviceName, $instance, $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 +{ + $deviceName = '[DEVICE_NAME]'; + $instance = '[INSTANCE]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + detach_disk_sample($deviceName, $instance, $project, $zone); +} +// [END compute_v1_generated_Instances_DetachDisk_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get.php new file mode 100644 index 000000000000..af7b1714ec77 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get.php @@ -0,0 +1,69 @@ +get($instance, $project, $zone); + 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 +{ + $instance = '[INSTANCE]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + get_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_effective_firewalls.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_effective_firewalls.php new file mode 100644 index 000000000000..b8fe72d75539 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_effective_firewalls.php @@ -0,0 +1,75 @@ +getEffectiveFirewalls($instance, $networkInterface, $project, $zone); + 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 +{ + $instance = '[INSTANCE]'; + $networkInterface = '[NETWORK_INTERFACE]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + get_effective_firewalls_sample($instance, $networkInterface, $project, $zone); +} +// [END compute_v1_generated_Instances_GetEffectiveFirewalls_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_guest_attributes.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_guest_attributes.php new file mode 100644 index 000000000000..f8a117e7f8b5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_guest_attributes.php @@ -0,0 +1,69 @@ +getGuestAttributes($instance, $project, $zone); + 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 +{ + $instance = '[INSTANCE]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + get_guest_attributes_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_GetGuestAttributes_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_iam_policy.php new file mode 100644 index 000000000000..a844367b620c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_iam_policy.php @@ -0,0 +1,69 @@ +getIamPolicy($project, $resource, $zone); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + $zone = '[ZONE]'; + + get_iam_policy_sample($project, $resource, $zone); +} +// [END compute_v1_generated_Instances_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_screenshot.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_screenshot.php new file mode 100644 index 000000000000..7e93bcf769c2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_screenshot.php @@ -0,0 +1,69 @@ +getScreenshot($instance, $project, $zone); + 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 +{ + $instance = '[INSTANCE]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + get_screenshot_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_GetScreenshot_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_serial_port_output.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_serial_port_output.php new file mode 100644 index 000000000000..41991404edb3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_serial_port_output.php @@ -0,0 +1,69 @@ +getSerialPortOutput($instance, $project, $zone); + 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 +{ + $instance = '[INSTANCE]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + get_serial_port_output_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_GetSerialPortOutput_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_shielded_instance_identity.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_shielded_instance_identity.php new file mode 100644 index 000000000000..cf1592f0d098 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_shielded_instance_identity.php @@ -0,0 +1,72 @@ +getShieldedInstanceIdentity($instance, $project, $zone); + 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 +{ + $instance = '[INSTANCE]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + get_shielded_instance_identity_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_GetShieldedInstanceIdentity_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/insert.php new file mode 100644 index 000000000000..ae263fbf67d5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/insert.php @@ -0,0 +1,80 @@ +insert($instanceResource, $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 +{ + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + insert_sample($project, $zone); +} +// [END compute_v1_generated_Instances_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/list.php new file mode 100644 index 000000000000..46a2290c00d6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/list.php @@ -0,0 +1,70 @@ +list($project, $zone); + + 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]'; + $zone = '[ZONE]'; + + list_sample($project, $zone); +} +// [END compute_v1_generated_Instances_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/list_referrers.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/list_referrers.php new file mode 100644 index 000000000000..07f900c80177 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/list_referrers.php @@ -0,0 +1,72 @@ +listReferrers($instance, $project, $zone); + + 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 +{ + $instance = '[INSTANCE]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + list_referrers_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_ListReferrers_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/perform_maintenance.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/perform_maintenance.php new file mode 100644 index 000000000000..8f028a29cd26 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/perform_maintenance.php @@ -0,0 +1,78 @@ +performMaintenance($instance, $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]'; + + perform_maintenance_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_PerformMaintenance_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/remove_resource_policies.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/remove_resource_policies.php new file mode 100644 index 000000000000..f7720f252bcb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/remove_resource_policies.php @@ -0,0 +1,87 @@ +removeResourcePolicies( + $instance, + $instancesRemoveResourcePoliciesRequestResource, + $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]'; + + remove_resource_policies_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_RemoveResourcePolicies_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/reset.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/reset.php new file mode 100644 index 000000000000..a48baf83b597 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/reset.php @@ -0,0 +1,78 @@ +reset($instance, $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]'; + + reset_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_Reset_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/resume.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/resume.php new file mode 100644 index 000000000000..929f9bd832e1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/resume.php @@ -0,0 +1,78 @@ +resume($instance, $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]'; + + resume_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_Resume_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/send_diagnostic_interrupt.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/send_diagnostic_interrupt.php new file mode 100644 index 000000000000..95e43e3b6086 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/send_diagnostic_interrupt.php @@ -0,0 +1,69 @@ +sendDiagnosticInterrupt($instance, $project, $zone); + 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 +{ + $instance = '[INSTANCE]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + send_diagnostic_interrupt_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_SendDiagnosticInterrupt_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_deletion_protection.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_deletion_protection.php new file mode 100644 index 000000000000..18008a4ff123 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_deletion_protection.php @@ -0,0 +1,78 @@ +setDeletionProtection($project, $resource, $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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + $zone = '[ZONE]'; + + set_deletion_protection_sample($project, $resource, $zone); +} +// [END compute_v1_generated_Instances_SetDeletionProtection_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_disk_auto_delete.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_disk_auto_delete.php new file mode 100644 index 000000000000..eaf5184ea06d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_disk_auto_delete.php @@ -0,0 +1,93 @@ +setDiskAutoDelete( + $autoDelete, + $deviceName, + $instance, + $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 +{ + $autoDelete = false; + $deviceName = '[DEVICE_NAME]'; + $instance = '[INSTANCE]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + set_disk_auto_delete_sample($autoDelete, $deviceName, $instance, $project, $zone); +} +// [END compute_v1_generated_Instances_SetDiskAutoDelete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_iam_policy.php new file mode 100644 index 000000000000..ea82147083cc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_iam_policy.php @@ -0,0 +1,78 @@ +setIamPolicy( + $project, + $resource, + $zone, + $zoneSetPolicyRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + $zone = '[ZONE]'; + + set_iam_policy_sample($project, $resource, $zone); +} +// [END compute_v1_generated_Instances_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_labels.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_labels.php new file mode 100644 index 000000000000..e5d28a335b7f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_labels.php @@ -0,0 +1,87 @@ +setLabels( + $instance, + $instancesSetLabelsRequestResource, + $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_labels_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_SetLabels_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_machine_resources.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_machine_resources.php new file mode 100644 index 000000000000..0a1f4ea47d34 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_machine_resources.php @@ -0,0 +1,87 @@ +setMachineResources( + $instance, + $instancesSetMachineResourcesRequestResource, + $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_machine_resources_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_SetMachineResources_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_machine_type.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_machine_type.php new file mode 100644 index 000000000000..4c1ff0dbe37b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_machine_type.php @@ -0,0 +1,87 @@ +setMachineType( + $instance, + $instancesSetMachineTypeRequestResource, + $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_machine_type_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_SetMachineType_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_metadata.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_metadata.php new file mode 100644 index 000000000000..24300563418e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_metadata.php @@ -0,0 +1,82 @@ +setMetadata($instance, $metadataResource, $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_metadata_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_SetMetadata_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_min_cpu_platform.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_min_cpu_platform.php new file mode 100644 index 000000000000..f517a4d8534a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_min_cpu_platform.php @@ -0,0 +1,87 @@ +setMinCpuPlatform( + $instance, + $instancesSetMinCpuPlatformRequestResource, + $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_min_cpu_platform_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_SetMinCpuPlatform_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_name.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_name.php new file mode 100644 index 000000000000..d056630e8fb2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/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/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_scheduling.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_scheduling.php new file mode 100644 index 000000000000..b036f2dc471b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_scheduling.php @@ -0,0 +1,82 @@ +setScheduling($instance, $project, $schedulingResource, $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_scheduling_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_SetScheduling_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_security_policy.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_security_policy.php new file mode 100644 index 000000000000..395efacb55ad --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_security_policy.php @@ -0,0 +1,87 @@ +setSecurityPolicy( + $instance, + $instancesSetSecurityPolicyRequestResource, + $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_security_policy_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_SetSecurityPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_service_account.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_service_account.php new file mode 100644 index 000000000000..ce728985ff3d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_service_account.php @@ -0,0 +1,87 @@ +setServiceAccount( + $instance, + $instancesSetServiceAccountRequestResource, + $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_service_account_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_SetServiceAccount_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_shielded_instance_integrity_policy.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_shielded_instance_integrity_policy.php new file mode 100644 index 000000000000..18e67b654286 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_shielded_instance_integrity_policy.php @@ -0,0 +1,90 @@ +setShieldedInstanceIntegrityPolicy( + $instance, + $project, + $shieldedInstanceIntegrityPolicyResource, + $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_shielded_instance_integrity_policy_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_SetShieldedInstanceIntegrityPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_tags.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_tags.php new file mode 100644 index 000000000000..9f3616c7a82d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_tags.php @@ -0,0 +1,82 @@ +setTags($instance, $project, $tagsResource, $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_tags_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_SetTags_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/simulate_maintenance_event.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/simulate_maintenance_event.php new file mode 100644 index 000000000000..b5142e6b472c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/simulate_maintenance_event.php @@ -0,0 +1,78 @@ +simulateMaintenanceEvent($instance, $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]'; + + simulate_maintenance_event_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_SimulateMaintenanceEvent_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/start.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/start.php new file mode 100644 index 000000000000..bd3167505405 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/start.php @@ -0,0 +1,78 @@ +start($instance, $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]'; + + start_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_Start_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/start_with_encryption_key.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/start_with_encryption_key.php new file mode 100644 index 000000000000..8648a02a95b9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/start_with_encryption_key.php @@ -0,0 +1,87 @@ +startWithEncryptionKey( + $instance, + $instancesStartWithEncryptionKeyRequestResource, + $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]'; + + start_with_encryption_key_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_StartWithEncryptionKey_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/stop.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/stop.php new file mode 100644 index 000000000000..76d818afae6e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/stop.php @@ -0,0 +1,78 @@ +stop($instance, $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]'; + + stop_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_Stop_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/suspend.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/suspend.php new file mode 100644 index 000000000000..4ef378fc3d1a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/suspend.php @@ -0,0 +1,78 @@ +suspend($instance, $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]'; + + suspend_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_Suspend_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/test_iam_permissions.php new file mode 100644 index 000000000000..1046dbbdd815 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +testIamPermissions( + $project, + $resource, + $testPermissionsRequestResource, + $zone + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + $zone = '[ZONE]'; + + test_iam_permissions_sample($project, $resource, $zone); +} +// [END compute_v1_generated_Instances_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update.php new file mode 100644 index 000000000000..56db67799b68 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update.php @@ -0,0 +1,82 @@ +update($instance, $instanceResource, $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]'; + + update_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_Update_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update_access_config.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update_access_config.php new file mode 100644 index 000000000000..ceaf04b1b883 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update_access_config.php @@ -0,0 +1,94 @@ +updateAccessConfig( + $accessConfigResource, + $instance, + $networkInterface, + $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]'; + $networkInterface = '[NETWORK_INTERFACE]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + update_access_config_sample($instance, $networkInterface, $project, $zone); +} +// [END compute_v1_generated_Instances_UpdateAccessConfig_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update_display_device.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update_display_device.php new file mode 100644 index 000000000000..ef1fce53931f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update_display_device.php @@ -0,0 +1,87 @@ +updateDisplayDevice( + $displayDeviceResource, + $instance, + $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]'; + + update_display_device_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_UpdateDisplayDevice_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update_network_interface.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update_network_interface.php new file mode 100644 index 000000000000..662fe76609e8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update_network_interface.php @@ -0,0 +1,94 @@ +updateNetworkInterface( + $instance, + $networkInterface, + $networkInterfaceResource, + $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]'; + $networkInterface = '[NETWORK_INTERFACE]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + update_network_interface_sample($instance, $networkInterface, $project, $zone); +} +// [END compute_v1_generated_Instances_UpdateNetworkInterface_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update_shielded_instance_config.php b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update_shielded_instance_config.php new file mode 100644 index 000000000000..0cac2923feee --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update_shielded_instance_config.php @@ -0,0 +1,90 @@ +updateShieldedInstanceConfig( + $instance, + $project, + $shieldedInstanceConfigResource, + $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]'; + + update_shielded_instance_config_sample($instance, $project, $zone); +} +// [END compute_v1_generated_Instances_UpdateShieldedInstanceConfig_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/aggregated_list.php new file mode 100644 index 000000000000..3145f1f9557b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/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_InstantSnapshots_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/delete.php new file mode 100644 index 000000000000..a0365b8d709b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/delete.php @@ -0,0 +1,78 @@ +delete($instantSnapshot, $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 +{ + $instantSnapshot = '[INSTANT_SNAPSHOT]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + delete_sample($instantSnapshot, $project, $zone); +} +// [END compute_v1_generated_InstantSnapshots_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/get.php new file mode 100644 index 000000000000..ee64acebdd66 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/get.php @@ -0,0 +1,69 @@ +get($instantSnapshot, $project, $zone); + 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 +{ + $instantSnapshot = '[INSTANT_SNAPSHOT]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + get_sample($instantSnapshot, $project, $zone); +} +// [END compute_v1_generated_InstantSnapshots_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/get_iam_policy.php new file mode 100644 index 000000000000..e80fe05bc1d4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/get_iam_policy.php @@ -0,0 +1,69 @@ +getIamPolicy($project, $resource, $zone); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + $zone = '[ZONE]'; + + get_iam_policy_sample($project, $resource, $zone); +} +// [END compute_v1_generated_InstantSnapshots_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/insert.php new file mode 100644 index 000000000000..c76978234d25 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/insert.php @@ -0,0 +1,80 @@ +insert($instantSnapshotResource, $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 +{ + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + insert_sample($project, $zone); +} +// [END compute_v1_generated_InstantSnapshots_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/list.php new file mode 100644 index 000000000000..3c6d08fd85c0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/list.php @@ -0,0 +1,70 @@ +list($project, $zone); + + 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]'; + $zone = '[ZONE]'; + + list_sample($project, $zone); +} +// [END compute_v1_generated_InstantSnapshots_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/set_iam_policy.php new file mode 100644 index 000000000000..93512a1834cb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/set_iam_policy.php @@ -0,0 +1,78 @@ +setIamPolicy( + $project, + $resource, + $zone, + $zoneSetPolicyRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + $zone = '[ZONE]'; + + set_iam_policy_sample($project, $resource, $zone); +} +// [END compute_v1_generated_InstantSnapshots_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/set_labels.php b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/set_labels.php new file mode 100644 index 000000000000..9cf50c847daa --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/set_labels.php @@ -0,0 +1,87 @@ +setLabels( + $project, + $resource, + $zone, + $zoneSetLabelsRequestResource + ); + $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]'; + $resource = '[RESOURCE]'; + $zone = '[ZONE]'; + + set_labels_sample($project, $resource, $zone); +} +// [END compute_v1_generated_InstantSnapshots_SetLabels_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/test_iam_permissions.php new file mode 100644 index 000000000000..0ccd513b5ccb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +testIamPermissions( + $project, + $resource, + $testPermissionsRequestResource, + $zone + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + $zone = '[ZONE]'; + + test_iam_permissions_sample($project, $resource, $zone); +} +// [END compute_v1_generated_InstantSnapshots_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/aggregated_list.php new file mode 100644 index 000000000000..846391c15a63 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/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_InterconnectAttachments_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/delete.php new file mode 100644 index 000000000000..68dc92cfafac --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/delete.php @@ -0,0 +1,78 @@ +delete($interconnectAttachment, $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 +{ + $interconnectAttachment = '[INTERCONNECT_ATTACHMENT]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + delete_sample($interconnectAttachment, $project, $region); +} +// [END compute_v1_generated_InterconnectAttachments_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/get.php new file mode 100644 index 000000000000..d695077c5403 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/get.php @@ -0,0 +1,69 @@ +get($interconnectAttachment, $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 +{ + $interconnectAttachment = '[INTERCONNECT_ATTACHMENT]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($interconnectAttachment, $project, $region); +} +// [END compute_v1_generated_InterconnectAttachments_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/insert.php new file mode 100644 index 000000000000..c4e9e4b1f321 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/insert.php @@ -0,0 +1,84 @@ +insert( + $interconnectAttachmentResource, + $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_InterconnectAttachments_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/list.php new file mode 100644 index 000000000000..b478e09a6761 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/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_InterconnectAttachments_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/patch.php new file mode 100644 index 000000000000..8bdfe10ef1f3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/patch.php @@ -0,0 +1,87 @@ +patch( + $interconnectAttachment, + $interconnectAttachmentResource, + $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 +{ + $interconnectAttachment = '[INTERCONNECT_ATTACHMENT]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + patch_sample($interconnectAttachment, $project, $region); +} +// [END compute_v1_generated_InterconnectAttachments_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/set_labels.php b/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/set_labels.php new file mode 100644 index 000000000000..413c9626eda4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/set_labels.php @@ -0,0 +1,87 @@ +setLabels( + $project, + $region, + $regionSetLabelsRequestResource, + $resource + ); + $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]'; + $resource = '[RESOURCE]'; + + set_labels_sample($project, $region, $resource); +} +// [END compute_v1_generated_InterconnectAttachments_SetLabels_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InterconnectLocationsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/InterconnectLocationsClient/get.php new file mode 100644 index 000000000000..6575cd2d6040 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectLocationsClient/get.php @@ -0,0 +1,67 @@ +get($interconnectLocation, $project); + 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 +{ + $interconnectLocation = '[INTERCONNECT_LOCATION]'; + $project = '[PROJECT]'; + + get_sample($interconnectLocation, $project); +} +// [END compute_v1_generated_InterconnectLocations_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InterconnectLocationsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/InterconnectLocationsClient/list.php new file mode 100644 index 000000000000..d67f224e0fa3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectLocationsClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_InterconnectLocations_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InterconnectRemoteLocationsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/InterconnectRemoteLocationsClient/get.php new file mode 100644 index 000000000000..ab167454a66a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectRemoteLocationsClient/get.php @@ -0,0 +1,67 @@ +get($interconnectRemoteLocation, $project); + 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 +{ + $interconnectRemoteLocation = '[INTERCONNECT_REMOTE_LOCATION]'; + $project = '[PROJECT]'; + + get_sample($interconnectRemoteLocation, $project); +} +// [END compute_v1_generated_InterconnectRemoteLocations_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InterconnectRemoteLocationsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/InterconnectRemoteLocationsClient/list.php new file mode 100644 index 000000000000..8fa90154d22d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectRemoteLocationsClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_InterconnectRemoteLocations_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/delete.php new file mode 100644 index 000000000000..9e8c6fb518e8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/delete.php @@ -0,0 +1,76 @@ +delete($interconnect, $project); + $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 +{ + $interconnect = '[INTERCONNECT]'; + $project = '[PROJECT]'; + + delete_sample($interconnect, $project); +} +// [END compute_v1_generated_Interconnects_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/get.php new file mode 100644 index 000000000000..14fccd35975b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/get.php @@ -0,0 +1,67 @@ +get($interconnect, $project); + 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 +{ + $interconnect = '[INTERCONNECT]'; + $project = '[PROJECT]'; + + get_sample($interconnect, $project); +} +// [END compute_v1_generated_Interconnects_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/get_diagnostics.php b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/get_diagnostics.php new file mode 100644 index 000000000000..5a678773c772 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/get_diagnostics.php @@ -0,0 +1,67 @@ +getDiagnostics($interconnect, $project); + 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 +{ + $interconnect = '[INTERCONNECT]'; + $project = '[PROJECT]'; + + get_diagnostics_sample($interconnect, $project); +} +// [END compute_v1_generated_Interconnects_GetDiagnostics_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/get_macsec_config.php b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/get_macsec_config.php new file mode 100644 index 000000000000..2e3c5e4d58d2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/get_macsec_config.php @@ -0,0 +1,67 @@ +getMacsecConfig($interconnect, $project); + 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 +{ + $interconnect = '[INTERCONNECT]'; + $project = '[PROJECT]'; + + get_macsec_config_sample($interconnect, $project); +} +// [END compute_v1_generated_Interconnects_GetMacsecConfig_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/insert.php new file mode 100644 index 000000000000..b68f3a64b660 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/insert.php @@ -0,0 +1,78 @@ +insert($interconnectResource, $project); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_Interconnects_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/list.php new file mode 100644 index 000000000000..465bfc09916c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_Interconnects_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/patch.php new file mode 100644 index 000000000000..74878514dbce --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/patch.php @@ -0,0 +1,80 @@ +patch($interconnect, $interconnectResource, $project); + $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 +{ + $interconnect = '[INTERCONNECT]'; + $project = '[PROJECT]'; + + patch_sample($interconnect, $project); +} +// [END compute_v1_generated_Interconnects_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/set_labels.php b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/set_labels.php new file mode 100644 index 000000000000..af8ec1dc2c38 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/set_labels.php @@ -0,0 +1,80 @@ +setLabels($globalSetLabelsRequestResource, $project, $resource); + $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]'; + $resource = '[RESOURCE]'; + + set_labels_sample($project, $resource); +} +// [END compute_v1_generated_Interconnects_SetLabels_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/LicenseCodesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/LicenseCodesClient/get.php new file mode 100644 index 000000000000..9cd580cbf76d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/LicenseCodesClient/get.php @@ -0,0 +1,67 @@ +get($licenseCode, $project); + 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 +{ + $licenseCode = '[LICENSE_CODE]'; + $project = '[PROJECT]'; + + get_sample($licenseCode, $project); +} +// [END compute_v1_generated_LicenseCodes_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/LicenseCodesClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/LicenseCodesClient/test_iam_permissions.php new file mode 100644 index 000000000000..453cce07c767 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/LicenseCodesClient/test_iam_permissions.php @@ -0,0 +1,75 @@ +testIamPermissions( + $project, + $resource, + $testPermissionsRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + test_iam_permissions_sample($project, $resource); +} +// [END compute_v1_generated_LicenseCodes_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/delete.php new file mode 100644 index 000000000000..7731c4464440 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/delete.php @@ -0,0 +1,76 @@ +delete($license, $project); + $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 +{ + $license = '[LICENSE]'; + $project = '[PROJECT]'; + + delete_sample($license, $project); +} +// [END compute_v1_generated_Licenses_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/get.php new file mode 100644 index 000000000000..9a0fc3fd297c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/get.php @@ -0,0 +1,67 @@ +get($license, $project); + 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 +{ + $license = '[LICENSE]'; + $project = '[PROJECT]'; + + get_sample($license, $project); +} +// [END compute_v1_generated_Licenses_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/get_iam_policy.php new file mode 100644 index 000000000000..4887e1506702 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/get_iam_policy.php @@ -0,0 +1,67 @@ +getIamPolicy($project, $resource); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + get_iam_policy_sample($project, $resource); +} +// [END compute_v1_generated_Licenses_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/insert.php new file mode 100644 index 000000000000..b3c8bd03c18b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/insert.php @@ -0,0 +1,78 @@ +insert($licenseResource, $project); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_Licenses_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/list.php new file mode 100644 index 000000000000..d6239284e332 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_Licenses_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/set_iam_policy.php new file mode 100644 index 000000000000..f4d2557d2b53 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/set_iam_policy.php @@ -0,0 +1,71 @@ +setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + set_iam_policy_sample($project, $resource); +} +// [END compute_v1_generated_Licenses_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/test_iam_permissions.php new file mode 100644 index 000000000000..da106ed1c8da --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/test_iam_permissions.php @@ -0,0 +1,75 @@ +testIamPermissions( + $project, + $resource, + $testPermissionsRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + test_iam_permissions_sample($project, $resource); +} +// [END compute_v1_generated_Licenses_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/delete.php new file mode 100644 index 000000000000..d6193f03f0f3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/delete.php @@ -0,0 +1,76 @@ +delete($machineImage, $project); + $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 +{ + $machineImage = '[MACHINE_IMAGE]'; + $project = '[PROJECT]'; + + delete_sample($machineImage, $project); +} +// [END compute_v1_generated_MachineImages_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/get.php new file mode 100644 index 000000000000..af17cd5ab092 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/get.php @@ -0,0 +1,67 @@ +get($machineImage, $project); + 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 +{ + $machineImage = '[MACHINE_IMAGE]'; + $project = '[PROJECT]'; + + get_sample($machineImage, $project); +} +// [END compute_v1_generated_MachineImages_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/get_iam_policy.php new file mode 100644 index 000000000000..48af1d0b6370 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/get_iam_policy.php @@ -0,0 +1,67 @@ +getIamPolicy($project, $resource); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + get_iam_policy_sample($project, $resource); +} +// [END compute_v1_generated_MachineImages_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/insert.php new file mode 100644 index 000000000000..5c2e247f612b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/insert.php @@ -0,0 +1,78 @@ +insert($machineImageResource, $project); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_MachineImages_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/list.php new file mode 100644 index 000000000000..2197ef4d687e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_MachineImages_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/set_iam_policy.php new file mode 100644 index 000000000000..d7e4cb7a6080 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/set_iam_policy.php @@ -0,0 +1,75 @@ +setIamPolicy( + $globalSetPolicyRequestResource, + $project, + $resource + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + set_iam_policy_sample($project, $resource); +} +// [END compute_v1_generated_MachineImages_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/test_iam_permissions.php new file mode 100644 index 000000000000..b7ae28dd1426 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/test_iam_permissions.php @@ -0,0 +1,75 @@ +testIamPermissions( + $project, + $resource, + $testPermissionsRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + test_iam_permissions_sample($project, $resource); +} +// [END compute_v1_generated_MachineImages_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/MachineTypesClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/MachineTypesClient/aggregated_list.php new file mode 100644 index 000000000000..999c69f5e715 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/MachineTypesClient/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_MachineTypes_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/MachineTypesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/MachineTypesClient/get.php new file mode 100644 index 000000000000..a7e25ca18926 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/MachineTypesClient/get.php @@ -0,0 +1,69 @@ +get($machineType, $project, $zone); + 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 +{ + $machineType = '[MACHINE_TYPE]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + get_sample($machineType, $project, $zone); +} +// [END compute_v1_generated_MachineTypes_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/MachineTypesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/MachineTypesClient/list.php new file mode 100644 index 000000000000..6432411b43fc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/MachineTypesClient/list.php @@ -0,0 +1,70 @@ +list($project, $zone); + + 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]'; + $zone = '[ZONE]'; + + list_sample($project, $zone); +} +// [END compute_v1_generated_MachineTypes_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/aggregated_list.php new file mode 100644 index 000000000000..ab4e32d487ee --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/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_NetworkAttachments_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/delete.php new file mode 100644 index 000000000000..a6b2b9570f30 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/delete.php @@ -0,0 +1,78 @@ +delete($networkAttachment, $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 +{ + $networkAttachment = '[NETWORK_ATTACHMENT]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + delete_sample($networkAttachment, $project, $region); +} +// [END compute_v1_generated_NetworkAttachments_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/get.php new file mode 100644 index 000000000000..ed6ee8708720 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/get.php @@ -0,0 +1,69 @@ +get($networkAttachment, $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 +{ + $networkAttachment = '[NETWORK_ATTACHMENT]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($networkAttachment, $project, $region); +} +// [END compute_v1_generated_NetworkAttachments_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/get_iam_policy.php new file mode 100644 index 000000000000..b1750a17fc91 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/get_iam_policy.php @@ -0,0 +1,69 @@ +getIamPolicy($project, $region, $resource); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + get_iam_policy_sample($project, $region, $resource); +} +// [END compute_v1_generated_NetworkAttachments_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/insert.php new file mode 100644 index 000000000000..55b0249ef43c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/insert.php @@ -0,0 +1,80 @@ +insert($networkAttachmentResource, $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_NetworkAttachments_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/list.php new file mode 100644 index 000000000000..a802981dd7e0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/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_NetworkAttachments_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/patch.php new file mode 100644 index 000000000000..ff981afe3d2b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/patch.php @@ -0,0 +1,87 @@ +patch( + $networkAttachment, + $networkAttachmentResource, + $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 +{ + $networkAttachment = '[NETWORK_ATTACHMENT]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + patch_sample($networkAttachment, $project, $region); +} +// [END compute_v1_generated_NetworkAttachments_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/set_iam_policy.php new file mode 100644 index 000000000000..6df4cf7a8ab6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/set_iam_policy.php @@ -0,0 +1,78 @@ +setIamPolicy( + $project, + $region, + $regionSetPolicyRequestResource, + $resource + ); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + set_iam_policy_sample($project, $region, $resource); +} +// [END compute_v1_generated_NetworkAttachments_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/test_iam_permissions.php new file mode 100644 index 000000000000..942e80a8657d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +testIamPermissions( + $project, + $region, + $resource, + $testPermissionsRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + test_iam_permissions_sample($project, $region, $resource); +} +// [END compute_v1_generated_NetworkAttachments_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/aggregated_list.php new file mode 100644 index 000000000000..85b8337e7a15 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/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_NetworkEdgeSecurityServices_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/delete.php new file mode 100644 index 000000000000..0f1f7d5ea8e5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/delete.php @@ -0,0 +1,82 @@ +delete( + $networkEdgeSecurityService, + $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 +{ + $networkEdgeSecurityService = '[NETWORK_EDGE_SECURITY_SERVICE]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + delete_sample($networkEdgeSecurityService, $project, $region); +} +// [END compute_v1_generated_NetworkEdgeSecurityServices_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/get.php new file mode 100644 index 000000000000..157efb4f2b5e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/get.php @@ -0,0 +1,69 @@ +get($networkEdgeSecurityService, $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 +{ + $networkEdgeSecurityService = '[NETWORK_EDGE_SECURITY_SERVICE]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($networkEdgeSecurityService, $project, $region); +} +// [END compute_v1_generated_NetworkEdgeSecurityServices_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/insert.php new file mode 100644 index 000000000000..cabbc254374d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/insert.php @@ -0,0 +1,84 @@ +insert( + $networkEdgeSecurityServiceResource, + $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_NetworkEdgeSecurityServices_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/patch.php new file mode 100644 index 000000000000..643e566f654c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/patch.php @@ -0,0 +1,87 @@ +patch( + $networkEdgeSecurityService, + $networkEdgeSecurityServiceResource, + $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 +{ + $networkEdgeSecurityService = '[NETWORK_EDGE_SECURITY_SERVICE]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + patch_sample($networkEdgeSecurityService, $project, $region); +} +// [END compute_v1_generated_NetworkEdgeSecurityServices_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/aggregated_list.php new file mode 100644 index 000000000000..56d903da4535 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/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_NetworkEndpointGroups_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/attach_network_endpoints.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/attach_network_endpoints.php new file mode 100644 index 000000000000..f0dcfd5bf6cb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/attach_network_endpoints.php @@ -0,0 +1,90 @@ +attachNetworkEndpoints( + $networkEndpointGroup, + $networkEndpointGroupsAttachEndpointsRequestResource, + $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 +{ + $networkEndpointGroup = '[NETWORK_ENDPOINT_GROUP]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + attach_network_endpoints_sample($networkEndpointGroup, $project, $zone); +} +// [END compute_v1_generated_NetworkEndpointGroups_AttachNetworkEndpoints_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/delete.php new file mode 100644 index 000000000000..3e9bc40df71f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/delete.php @@ -0,0 +1,78 @@ +delete($networkEndpointGroup, $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 +{ + $networkEndpointGroup = '[NETWORK_ENDPOINT_GROUP]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + delete_sample($networkEndpointGroup, $project, $zone); +} +// [END compute_v1_generated_NetworkEndpointGroups_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/detach_network_endpoints.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/detach_network_endpoints.php new file mode 100644 index 000000000000..192d4573ed8b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/detach_network_endpoints.php @@ -0,0 +1,90 @@ +detachNetworkEndpoints( + $networkEndpointGroup, + $networkEndpointGroupsDetachEndpointsRequestResource, + $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 +{ + $networkEndpointGroup = '[NETWORK_ENDPOINT_GROUP]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + detach_network_endpoints_sample($networkEndpointGroup, $project, $zone); +} +// [END compute_v1_generated_NetworkEndpointGroups_DetachNetworkEndpoints_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/get.php new file mode 100644 index 000000000000..530dd6373cd2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/get.php @@ -0,0 +1,69 @@ +get($networkEndpointGroup, $project, $zone); + 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 +{ + $networkEndpointGroup = '[NETWORK_ENDPOINT_GROUP]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + get_sample($networkEndpointGroup, $project, $zone); +} +// [END compute_v1_generated_NetworkEndpointGroups_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/insert.php new file mode 100644 index 000000000000..f73fff660f9d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/insert.php @@ -0,0 +1,80 @@ +insert($networkEndpointGroupResource, $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 +{ + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + insert_sample($project, $zone); +} +// [END compute_v1_generated_NetworkEndpointGroups_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/list.php new file mode 100644 index 000000000000..35b59c2a43d3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/list.php @@ -0,0 +1,70 @@ +list($project, $zone); + + 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]'; + $zone = '[ZONE]'; + + list_sample($project, $zone); +} +// [END compute_v1_generated_NetworkEndpointGroups_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/list_network_endpoints.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/list_network_endpoints.php new file mode 100644 index 000000000000..6c8c3156ae71 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/list_network_endpoints.php @@ -0,0 +1,84 @@ +listNetworkEndpoints( + $networkEndpointGroup, + $networkEndpointGroupsListEndpointsRequestResource, + $project, + $zone + ); + + 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 +{ + $networkEndpointGroup = '[NETWORK_ENDPOINT_GROUP]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + list_network_endpoints_sample($networkEndpointGroup, $project, $zone); +} +// [END compute_v1_generated_NetworkEndpointGroups_ListNetworkEndpoints_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/test_iam_permissions.php new file mode 100644 index 000000000000..a476e3ae62d1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +testIamPermissions( + $project, + $resource, + $testPermissionsRequestResource, + $zone + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + $zone = '[ZONE]'; + + test_iam_permissions_sample($project, $resource, $zone); +} +// [END compute_v1_generated_NetworkEndpointGroups_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/add_association.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/add_association.php new file mode 100644 index 000000000000..767081facb2d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/add_association.php @@ -0,0 +1,84 @@ +addAssociation( + $firewallPolicy, + $firewallPolicyAssociationResource, + $project + ); + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $project = '[PROJECT]'; + + add_association_sample($firewallPolicy, $project); +} +// [END compute_v1_generated_NetworkFirewallPolicies_AddAssociation_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/add_rule.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/add_rule.php new file mode 100644 index 000000000000..27f40c4b91e8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/add_rule.php @@ -0,0 +1,84 @@ +addRule( + $firewallPolicy, + $firewallPolicyRuleResource, + $project + ); + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $project = '[PROJECT]'; + + add_rule_sample($firewallPolicy, $project); +} +// [END compute_v1_generated_NetworkFirewallPolicies_AddRule_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/clone_rules.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/clone_rules.php new file mode 100644 index 000000000000..2189b6778389 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/clone_rules.php @@ -0,0 +1,76 @@ +cloneRules($firewallPolicy, $project); + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $project = '[PROJECT]'; + + clone_rules_sample($firewallPolicy, $project); +} +// [END compute_v1_generated_NetworkFirewallPolicies_CloneRules_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/delete.php new file mode 100644 index 000000000000..797be64b5678 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/delete.php @@ -0,0 +1,76 @@ +delete($firewallPolicy, $project); + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $project = '[PROJECT]'; + + delete_sample($firewallPolicy, $project); +} +// [END compute_v1_generated_NetworkFirewallPolicies_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/get.php new file mode 100644 index 000000000000..aef04bf75c85 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/get.php @@ -0,0 +1,67 @@ +get($firewallPolicy, $project); + 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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $project = '[PROJECT]'; + + get_sample($firewallPolicy, $project); +} +// [END compute_v1_generated_NetworkFirewallPolicies_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/get_association.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/get_association.php new file mode 100644 index 000000000000..d7af2e502bff --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/get_association.php @@ -0,0 +1,67 @@ +getAssociation($firewallPolicy, $project); + 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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $project = '[PROJECT]'; + + get_association_sample($firewallPolicy, $project); +} +// [END compute_v1_generated_NetworkFirewallPolicies_GetAssociation_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/get_iam_policy.php new file mode 100644 index 000000000000..2fb20297e0f2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/get_iam_policy.php @@ -0,0 +1,67 @@ +getIamPolicy($project, $resource); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + get_iam_policy_sample($project, $resource); +} +// [END compute_v1_generated_NetworkFirewallPolicies_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/get_rule.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/get_rule.php new file mode 100644 index 000000000000..d939dbe4ff4f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/get_rule.php @@ -0,0 +1,67 @@ +getRule($firewallPolicy, $project); + 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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $project = '[PROJECT]'; + + get_rule_sample($firewallPolicy, $project); +} +// [END compute_v1_generated_NetworkFirewallPolicies_GetRule_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/insert.php new file mode 100644 index 000000000000..ff07d8491602 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/insert.php @@ -0,0 +1,78 @@ +insert($firewallPolicyResource, $project); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_NetworkFirewallPolicies_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/list.php new file mode 100644 index 000000000000..7c6fb67617f3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_NetworkFirewallPolicies_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/patch.php new file mode 100644 index 000000000000..f841f48d1f65 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/patch.php @@ -0,0 +1,84 @@ +patch( + $firewallPolicy, + $firewallPolicyResource, + $project + ); + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $project = '[PROJECT]'; + + patch_sample($firewallPolicy, $project); +} +// [END compute_v1_generated_NetworkFirewallPolicies_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/patch_rule.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/patch_rule.php new file mode 100644 index 000000000000..727779f32005 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/patch_rule.php @@ -0,0 +1,84 @@ +patchRule( + $firewallPolicy, + $firewallPolicyRuleResource, + $project + ); + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $project = '[PROJECT]'; + + patch_rule_sample($firewallPolicy, $project); +} +// [END compute_v1_generated_NetworkFirewallPolicies_PatchRule_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/remove_association.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/remove_association.php new file mode 100644 index 000000000000..e375ad7acfd4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/remove_association.php @@ -0,0 +1,76 @@ +removeAssociation($firewallPolicy, $project); + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $project = '[PROJECT]'; + + remove_association_sample($firewallPolicy, $project); +} +// [END compute_v1_generated_NetworkFirewallPolicies_RemoveAssociation_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/remove_rule.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/remove_rule.php new file mode 100644 index 000000000000..e3ad6ecee26d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/remove_rule.php @@ -0,0 +1,76 @@ +removeRule($firewallPolicy, $project); + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $project = '[PROJECT]'; + + remove_rule_sample($firewallPolicy, $project); +} +// [END compute_v1_generated_NetworkFirewallPolicies_RemoveRule_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/set_iam_policy.php new file mode 100644 index 000000000000..9ec31a284551 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/set_iam_policy.php @@ -0,0 +1,75 @@ +setIamPolicy( + $globalSetPolicyRequestResource, + $project, + $resource + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + set_iam_policy_sample($project, $resource); +} +// [END compute_v1_generated_NetworkFirewallPolicies_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/test_iam_permissions.php new file mode 100644 index 000000000000..9fbb4c854143 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/test_iam_permissions.php @@ -0,0 +1,75 @@ +testIamPermissions( + $project, + $resource, + $testPermissionsRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + test_iam_permissions_sample($project, $resource); +} +// [END compute_v1_generated_NetworkFirewallPolicies_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/add_peering.php b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/add_peering.php new file mode 100644 index 000000000000..24dfe460f2fe --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/add_peering.php @@ -0,0 +1,80 @@ +addPeering($network, $networksAddPeeringRequestResource, $project); + $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 +{ + $network = '[NETWORK]'; + $project = '[PROJECT]'; + + add_peering_sample($network, $project); +} +// [END compute_v1_generated_Networks_AddPeering_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/delete.php new file mode 100644 index 000000000000..af5facecc0f0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/delete.php @@ -0,0 +1,76 @@ +delete($network, $project); + $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 +{ + $network = '[NETWORK]'; + $project = '[PROJECT]'; + + delete_sample($network, $project); +} +// [END compute_v1_generated_Networks_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/get.php new file mode 100644 index 000000000000..61f9fee4342c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/get.php @@ -0,0 +1,67 @@ +get($network, $project); + 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 +{ + $network = '[NETWORK]'; + $project = '[PROJECT]'; + + get_sample($network, $project); +} +// [END compute_v1_generated_Networks_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/get_effective_firewalls.php b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/get_effective_firewalls.php new file mode 100644 index 000000000000..3ec95b9d38dd --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/get_effective_firewalls.php @@ -0,0 +1,67 @@ +getEffectiveFirewalls($network, $project); + 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 +{ + $network = '[NETWORK]'; + $project = '[PROJECT]'; + + get_effective_firewalls_sample($network, $project); +} +// [END compute_v1_generated_Networks_GetEffectiveFirewalls_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/insert.php new file mode 100644 index 000000000000..6cded37a862f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/insert.php @@ -0,0 +1,78 @@ +insert($networkResource, $project); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_Networks_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/list.php new file mode 100644 index 000000000000..7ef62dfe0b57 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_Networks_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/list_peering_routes.php b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/list_peering_routes.php new file mode 100644 index 000000000000..46b87a32386c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/list_peering_routes.php @@ -0,0 +1,70 @@ +listPeeringRoutes($network, $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 +{ + $network = '[NETWORK]'; + $project = '[PROJECT]'; + + list_peering_routes_sample($network, $project); +} +// [END compute_v1_generated_Networks_ListPeeringRoutes_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/patch.php new file mode 100644 index 000000000000..238d210b56f4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/patch.php @@ -0,0 +1,80 @@ +patch($network, $networkResource, $project); + $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 +{ + $network = '[NETWORK]'; + $project = '[PROJECT]'; + + patch_sample($network, $project); +} +// [END compute_v1_generated_Networks_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/remove_peering.php b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/remove_peering.php new file mode 100644 index 000000000000..eb61e188b8f4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/remove_peering.php @@ -0,0 +1,84 @@ +removePeering( + $network, + $networksRemovePeeringRequestResource, + $project + ); + $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 +{ + $network = '[NETWORK]'; + $project = '[PROJECT]'; + + remove_peering_sample($network, $project); +} +// [END compute_v1_generated_Networks_RemovePeering_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/switch_to_custom_mode.php b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/switch_to_custom_mode.php new file mode 100644 index 000000000000..bc0c1c1e09b1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/switch_to_custom_mode.php @@ -0,0 +1,76 @@ +switchToCustomMode($network, $project); + $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 +{ + $network = '[NETWORK]'; + $project = '[PROJECT]'; + + switch_to_custom_mode_sample($network, $project); +} +// [END compute_v1_generated_Networks_SwitchToCustomMode_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/update_peering.php b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/update_peering.php new file mode 100644 index 000000000000..fc6105dc9e71 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/update_peering.php @@ -0,0 +1,84 @@ +updatePeering( + $network, + $networksUpdatePeeringRequestResource, + $project + ); + $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 +{ + $network = '[NETWORK]'; + $project = '[PROJECT]'; + + update_peering_sample($network, $project); +} +// [END compute_v1_generated_Networks_UpdatePeering_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/add_nodes.php b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/add_nodes.php new file mode 100644 index 000000000000..cb8ca395ff39 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/add_nodes.php @@ -0,0 +1,87 @@ +addNodes( + $nodeGroup, + $nodeGroupsAddNodesRequestResource, + $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 +{ + $nodeGroup = '[NODE_GROUP]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + add_nodes_sample($nodeGroup, $project, $zone); +} +// [END compute_v1_generated_NodeGroups_AddNodes_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/aggregated_list.php new file mode 100644 index 000000000000..5e793d4c70b8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/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_NodeGroups_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/delete.php new file mode 100644 index 000000000000..8d93625cc79c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/delete.php @@ -0,0 +1,78 @@ +delete($nodeGroup, $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 +{ + $nodeGroup = '[NODE_GROUP]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + delete_sample($nodeGroup, $project, $zone); +} +// [END compute_v1_generated_NodeGroups_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/delete_nodes.php b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/delete_nodes.php new file mode 100644 index 000000000000..c91cd1b32455 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/delete_nodes.php @@ -0,0 +1,87 @@ +deleteNodes( + $nodeGroup, + $nodeGroupsDeleteNodesRequestResource, + $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 +{ + $nodeGroup = '[NODE_GROUP]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + delete_nodes_sample($nodeGroup, $project, $zone); +} +// [END compute_v1_generated_NodeGroups_DeleteNodes_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/get.php new file mode 100644 index 000000000000..39b7a4954721 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/get.php @@ -0,0 +1,69 @@ +get($nodeGroup, $project, $zone); + 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 +{ + $nodeGroup = '[NODE_GROUP]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + get_sample($nodeGroup, $project, $zone); +} +// [END compute_v1_generated_NodeGroups_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/get_iam_policy.php new file mode 100644 index 000000000000..0223b655ed64 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/get_iam_policy.php @@ -0,0 +1,69 @@ +getIamPolicy($project, $resource, $zone); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + $zone = '[ZONE]'; + + get_iam_policy_sample($project, $resource, $zone); +} +// [END compute_v1_generated_NodeGroups_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/insert.php new file mode 100644 index 000000000000..747fee985e98 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/insert.php @@ -0,0 +1,82 @@ +insert($initialNodeCount, $nodeGroupResource, $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 +{ + $initialNodeCount = 0; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + insert_sample($initialNodeCount, $project, $zone); +} +// [END compute_v1_generated_NodeGroups_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/list.php new file mode 100644 index 000000000000..6012b3a60504 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/list.php @@ -0,0 +1,70 @@ +list($project, $zone); + + 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]'; + $zone = '[ZONE]'; + + list_sample($project, $zone); +} +// [END compute_v1_generated_NodeGroups_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/list_nodes.php b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/list_nodes.php new file mode 100644 index 000000000000..4430b1c6d80f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/list_nodes.php @@ -0,0 +1,72 @@ +listNodes($nodeGroup, $project, $zone); + + 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 +{ + $nodeGroup = '[NODE_GROUP]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + list_nodes_sample($nodeGroup, $project, $zone); +} +// [END compute_v1_generated_NodeGroups_ListNodes_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/patch.php new file mode 100644 index 000000000000..697577d69652 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/patch.php @@ -0,0 +1,82 @@ +patch($nodeGroup, $nodeGroupResource, $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 +{ + $nodeGroup = '[NODE_GROUP]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + patch_sample($nodeGroup, $project, $zone); +} +// [END compute_v1_generated_NodeGroups_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/perform_maintenance.php b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/perform_maintenance.php new file mode 100644 index 000000000000..aef9adf0c70b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/perform_maintenance.php @@ -0,0 +1,87 @@ +performMaintenance( + $nodeGroup, + $nodeGroupsPerformMaintenanceRequestResource, + $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 +{ + $nodeGroup = '[NODE_GROUP]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + perform_maintenance_sample($nodeGroup, $project, $zone); +} +// [END compute_v1_generated_NodeGroups_PerformMaintenance_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/set_iam_policy.php new file mode 100644 index 000000000000..cd8d23d9e564 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/set_iam_policy.php @@ -0,0 +1,78 @@ +setIamPolicy( + $project, + $resource, + $zone, + $zoneSetPolicyRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + $zone = '[ZONE]'; + + set_iam_policy_sample($project, $resource, $zone); +} +// [END compute_v1_generated_NodeGroups_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/set_node_template.php b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/set_node_template.php new file mode 100644 index 000000000000..08b4b2df5c2c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/set_node_template.php @@ -0,0 +1,87 @@ +setNodeTemplate( + $nodeGroup, + $nodeGroupsSetNodeTemplateRequestResource, + $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 +{ + $nodeGroup = '[NODE_GROUP]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + set_node_template_sample($nodeGroup, $project, $zone); +} +// [END compute_v1_generated_NodeGroups_SetNodeTemplate_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/simulate_maintenance_event.php b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/simulate_maintenance_event.php new file mode 100644 index 000000000000..b19e64c48b40 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/simulate_maintenance_event.php @@ -0,0 +1,87 @@ +simulateMaintenanceEvent( + $nodeGroup, + $nodeGroupsSimulateMaintenanceEventRequestResource, + $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 +{ + $nodeGroup = '[NODE_GROUP]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + simulate_maintenance_event_sample($nodeGroup, $project, $zone); +} +// [END compute_v1_generated_NodeGroups_SimulateMaintenanceEvent_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/test_iam_permissions.php new file mode 100644 index 000000000000..d5a57f0ff92b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +testIamPermissions( + $project, + $resource, + $testPermissionsRequestResource, + $zone + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + $zone = '[ZONE]'; + + test_iam_permissions_sample($project, $resource, $zone); +} +// [END compute_v1_generated_NodeGroups_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/aggregated_list.php new file mode 100644 index 000000000000..dd8e28b73ec7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/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_NodeTemplates_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/delete.php new file mode 100644 index 000000000000..51aa5569b004 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/delete.php @@ -0,0 +1,78 @@ +delete($nodeTemplate, $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 +{ + $nodeTemplate = '[NODE_TEMPLATE]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + delete_sample($nodeTemplate, $project, $region); +} +// [END compute_v1_generated_NodeTemplates_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/get.php new file mode 100644 index 000000000000..51ad11b12d5b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/get.php @@ -0,0 +1,69 @@ +get($nodeTemplate, $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 +{ + $nodeTemplate = '[NODE_TEMPLATE]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($nodeTemplate, $project, $region); +} +// [END compute_v1_generated_NodeTemplates_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/get_iam_policy.php new file mode 100644 index 000000000000..84f3a3ca0613 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/get_iam_policy.php @@ -0,0 +1,69 @@ +getIamPolicy($project, $region, $resource); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + get_iam_policy_sample($project, $region, $resource); +} +// [END compute_v1_generated_NodeTemplates_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/insert.php new file mode 100644 index 000000000000..d863d4e794e9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/insert.php @@ -0,0 +1,80 @@ +insert($nodeTemplateResource, $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_NodeTemplates_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/list.php new file mode 100644 index 000000000000..b082a1f726d5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/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_NodeTemplates_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/set_iam_policy.php new file mode 100644 index 000000000000..64500cc963ff --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/set_iam_policy.php @@ -0,0 +1,78 @@ +setIamPolicy( + $project, + $region, + $regionSetPolicyRequestResource, + $resource + ); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + set_iam_policy_sample($project, $region, $resource); +} +// [END compute_v1_generated_NodeTemplates_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/test_iam_permissions.php new file mode 100644 index 000000000000..3dbee6338de1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +testIamPermissions( + $project, + $region, + $resource, + $testPermissionsRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + test_iam_permissions_sample($project, $region, $resource); +} +// [END compute_v1_generated_NodeTemplates_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeTypesClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/NodeTypesClient/aggregated_list.php new file mode 100644 index 000000000000..e0af5543f6f8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeTypesClient/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_NodeTypes_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeTypesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/NodeTypesClient/get.php new file mode 100644 index 000000000000..43eddac1338e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeTypesClient/get.php @@ -0,0 +1,69 @@ +get($nodeType, $project, $zone); + 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 +{ + $nodeType = '[NODE_TYPE]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + get_sample($nodeType, $project, $zone); +} +// [END compute_v1_generated_NodeTypes_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NodeTypesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/NodeTypesClient/list.php new file mode 100644 index 000000000000..d27f95d6975d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeTypesClient/list.php @@ -0,0 +1,70 @@ +list($project, $zone); + + 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]'; + $zone = '[ZONE]'; + + list_sample($project, $zone); +} +// [END compute_v1_generated_NodeTypes_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/aggregated_list.php new file mode 100644 index 000000000000..bc0025611f5d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/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_PacketMirrorings_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/delete.php new file mode 100644 index 000000000000..e3c5c5125ffd --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/delete.php @@ -0,0 +1,78 @@ +delete($packetMirroring, $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 +{ + $packetMirroring = '[PACKET_MIRRORING]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + delete_sample($packetMirroring, $project, $region); +} +// [END compute_v1_generated_PacketMirrorings_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/get.php new file mode 100644 index 000000000000..4284f39b0e5c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/get.php @@ -0,0 +1,69 @@ +get($packetMirroring, $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 +{ + $packetMirroring = '[PACKET_MIRRORING]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($packetMirroring, $project, $region); +} +// [END compute_v1_generated_PacketMirrorings_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/insert.php new file mode 100644 index 000000000000..1569368c3e75 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/insert.php @@ -0,0 +1,80 @@ +insert($packetMirroringResource, $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_PacketMirrorings_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/list.php new file mode 100644 index 000000000000..7a1305f9e65e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/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_PacketMirrorings_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/patch.php new file mode 100644 index 000000000000..d1ab787f6662 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/patch.php @@ -0,0 +1,87 @@ +patch( + $packetMirroring, + $packetMirroringResource, + $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 +{ + $packetMirroring = '[PACKET_MIRRORING]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + patch_sample($packetMirroring, $project, $region); +} +// [END compute_v1_generated_PacketMirrorings_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/test_iam_permissions.php new file mode 100644 index 000000000000..b58865594b3f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +testIamPermissions( + $project, + $region, + $resource, + $testPermissionsRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + test_iam_permissions_sample($project, $region, $resource); +} +// [END compute_v1_generated_PacketMirrorings_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/disable_xpn_host.php b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/disable_xpn_host.php new file mode 100644 index 000000000000..23a0ca5f061f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/disable_xpn_host.php @@ -0,0 +1,74 @@ +disableXpnHost($project); + $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]'; + + disable_xpn_host_sample($project); +} +// [END compute_v1_generated_Projects_DisableXpnHost_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/disable_xpn_resource.php b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/disable_xpn_resource.php new file mode 100644 index 000000000000..04015503bfd9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/disable_xpn_resource.php @@ -0,0 +1,81 @@ +disableXpnResource( + $project, + $projectsDisableXpnResourceRequestResource + ); + $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]'; + + disable_xpn_resource_sample($project); +} +// [END compute_v1_generated_Projects_DisableXpnResource_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/enable_xpn_host.php b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/enable_xpn_host.php new file mode 100644 index 000000000000..d0ff3b0f2d2a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/enable_xpn_host.php @@ -0,0 +1,74 @@ +enableXpnHost($project); + $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]'; + + enable_xpn_host_sample($project); +} +// [END compute_v1_generated_Projects_EnableXpnHost_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/enable_xpn_resource.php b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/enable_xpn_resource.php new file mode 100644 index 000000000000..b6a6d4952932 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/enable_xpn_resource.php @@ -0,0 +1,78 @@ +enableXpnResource($project, $projectsEnableXpnResourceRequestResource); + $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]'; + + enable_xpn_resource_sample($project); +} +// [END compute_v1_generated_Projects_EnableXpnResource_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/get.php new file mode 100644 index 000000000000..3598af58d463 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/get.php @@ -0,0 +1,65 @@ +get($project); + 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 +{ + $project = '[PROJECT]'; + + get_sample($project); +} +// [END compute_v1_generated_Projects_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/get_xpn_host.php b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/get_xpn_host.php new file mode 100644 index 000000000000..b93286adc19b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/get_xpn_host.php @@ -0,0 +1,65 @@ +getXpnHost($project); + 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 +{ + $project = '[PROJECT]'; + + get_xpn_host_sample($project); +} +// [END compute_v1_generated_Projects_GetXpnHost_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/get_xpn_resources.php b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/get_xpn_resources.php new file mode 100644 index 000000000000..40fa6650dc87 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/get_xpn_resources.php @@ -0,0 +1,68 @@ +getXpnResources($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]'; + + get_xpn_resources_sample($project); +} +// [END compute_v1_generated_Projects_GetXpnResources_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/list_xpn_hosts.php b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/list_xpn_hosts.php new file mode 100644 index 000000000000..c308cb7f0947 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/list_xpn_hosts.php @@ -0,0 +1,72 @@ +listXpnHosts($project, $projectsListXpnHostsRequestResource); + + 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]'; + + list_xpn_hosts_sample($project); +} +// [END compute_v1_generated_Projects_ListXpnHosts_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/move_disk.php b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/move_disk.php new file mode 100644 index 000000000000..d5d78ede3b3f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/move_disk.php @@ -0,0 +1,78 @@ +moveDisk($diskMoveRequestResource, $project); + $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]'; + + move_disk_sample($project); +} +// [END compute_v1_generated_Projects_MoveDisk_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/move_instance.php b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/move_instance.php new file mode 100644 index 000000000000..b06641de7fd3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/move_instance.php @@ -0,0 +1,78 @@ +moveInstance($instanceMoveRequestResource, $project); + $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]'; + + move_instance_sample($project); +} +// [END compute_v1_generated_Projects_MoveInstance_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/set_cloud_armor_tier.php b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/set_cloud_armor_tier.php new file mode 100644 index 000000000000..b299afcc8ba2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/set_cloud_armor_tier.php @@ -0,0 +1,78 @@ +setCloudArmorTier($project, $projectsSetCloudArmorTierRequestResource); + $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]'; + + set_cloud_armor_tier_sample($project); +} +// [END compute_v1_generated_Projects_SetCloudArmorTier_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/set_common_instance_metadata.php b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/set_common_instance_metadata.php new file mode 100644 index 000000000000..6bf7abd8e1d9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/set_common_instance_metadata.php @@ -0,0 +1,78 @@ +setCommonInstanceMetadata($metadataResource, $project); + $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]'; + + set_common_instance_metadata_sample($project); +} +// [END compute_v1_generated_Projects_SetCommonInstanceMetadata_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/set_default_network_tier.php b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/set_default_network_tier.php new file mode 100644 index 000000000000..47596d9f4110 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/set_default_network_tier.php @@ -0,0 +1,81 @@ +setDefaultNetworkTier( + $project, + $projectsSetDefaultNetworkTierRequestResource + ); + $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]'; + + set_default_network_tier_sample($project); +} +// [END compute_v1_generated_Projects_SetDefaultNetworkTier_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/set_usage_export_bucket.php b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/set_usage_export_bucket.php new file mode 100644 index 000000000000..86549c91eede --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/set_usage_export_bucket.php @@ -0,0 +1,78 @@ +setUsageExportBucket($project, $usageExportLocationResource); + $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]'; + + set_usage_export_bucket_sample($project); +} +// [END compute_v1_generated_Projects_SetUsageExportBucket_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/announce.php b/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/announce.php new file mode 100644 index 000000000000..d65398449e2a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/announce.php @@ -0,0 +1,76 @@ +announce($project, $publicAdvertisedPrefix); + $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]'; + $publicAdvertisedPrefix = '[PUBLIC_ADVERTISED_PREFIX]'; + + announce_sample($project, $publicAdvertisedPrefix); +} +// [END compute_v1_generated_PublicAdvertisedPrefixes_Announce_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/delete.php new file mode 100644 index 000000000000..d5d0f98e8533 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/delete.php @@ -0,0 +1,76 @@ +delete($project, $publicAdvertisedPrefix); + $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]'; + $publicAdvertisedPrefix = '[PUBLIC_ADVERTISED_PREFIX]'; + + delete_sample($project, $publicAdvertisedPrefix); +} +// [END compute_v1_generated_PublicAdvertisedPrefixes_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/get.php new file mode 100644 index 000000000000..8b73c119828b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/get.php @@ -0,0 +1,67 @@ +get($project, $publicAdvertisedPrefix); + 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 +{ + $project = '[PROJECT]'; + $publicAdvertisedPrefix = '[PUBLIC_ADVERTISED_PREFIX]'; + + get_sample($project, $publicAdvertisedPrefix); +} +// [END compute_v1_generated_PublicAdvertisedPrefixes_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/insert.php new file mode 100644 index 000000000000..1df7cbfe3f55 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/insert.php @@ -0,0 +1,78 @@ +insert($project, $publicAdvertisedPrefixResource); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_PublicAdvertisedPrefixes_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/list.php new file mode 100644 index 000000000000..73c4d526baff --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_PublicAdvertisedPrefixes_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/patch.php new file mode 100644 index 000000000000..5e8acf36cfd2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/patch.php @@ -0,0 +1,84 @@ +patch( + $project, + $publicAdvertisedPrefix, + $publicAdvertisedPrefixResource + ); + $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]'; + $publicAdvertisedPrefix = '[PUBLIC_ADVERTISED_PREFIX]'; + + patch_sample($project, $publicAdvertisedPrefix); +} +// [END compute_v1_generated_PublicAdvertisedPrefixes_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/withdraw.php b/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/withdraw.php new file mode 100644 index 000000000000..f06d498376ba --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/withdraw.php @@ -0,0 +1,76 @@ +withdraw($project, $publicAdvertisedPrefix); + $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]'; + $publicAdvertisedPrefix = '[PUBLIC_ADVERTISED_PREFIX]'; + + withdraw_sample($project, $publicAdvertisedPrefix); +} +// [END compute_v1_generated_PublicAdvertisedPrefixes_Withdraw_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/aggregated_list.php new file mode 100644 index 000000000000..d7d25e86b44c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/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_PublicDelegatedPrefixes_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/announce.php b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/announce.php new file mode 100644 index 000000000000..088df26a9f97 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/announce.php @@ -0,0 +1,78 @@ +announce($project, $publicDelegatedPrefix, $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]'; + $publicDelegatedPrefix = '[PUBLIC_DELEGATED_PREFIX]'; + $region = '[REGION]'; + + announce_sample($project, $publicDelegatedPrefix, $region); +} +// [END compute_v1_generated_PublicDelegatedPrefixes_Announce_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/delete.php new file mode 100644 index 000000000000..52c7ab37cab5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/delete.php @@ -0,0 +1,78 @@ +delete($project, $publicDelegatedPrefix, $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]'; + $publicDelegatedPrefix = '[PUBLIC_DELEGATED_PREFIX]'; + $region = '[REGION]'; + + delete_sample($project, $publicDelegatedPrefix, $region); +} +// [END compute_v1_generated_PublicDelegatedPrefixes_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/get.php new file mode 100644 index 000000000000..08515c74a84a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/get.php @@ -0,0 +1,69 @@ +get($project, $publicDelegatedPrefix, $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 +{ + $project = '[PROJECT]'; + $publicDelegatedPrefix = '[PUBLIC_DELEGATED_PREFIX]'; + $region = '[REGION]'; + + get_sample($project, $publicDelegatedPrefix, $region); +} +// [END compute_v1_generated_PublicDelegatedPrefixes_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/insert.php new file mode 100644 index 000000000000..436ec4974d39 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/insert.php @@ -0,0 +1,84 @@ +insert( + $project, + $publicDelegatedPrefixResource, + $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_PublicDelegatedPrefixes_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/list.php new file mode 100644 index 000000000000..46608a89fabf --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/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_PublicDelegatedPrefixes_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/patch.php new file mode 100644 index 000000000000..7b0738685421 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/patch.php @@ -0,0 +1,87 @@ +patch( + $project, + $publicDelegatedPrefix, + $publicDelegatedPrefixResource, + $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]'; + $publicDelegatedPrefix = '[PUBLIC_DELEGATED_PREFIX]'; + $region = '[REGION]'; + + patch_sample($project, $publicDelegatedPrefix, $region); +} +// [END compute_v1_generated_PublicDelegatedPrefixes_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/withdraw.php b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/withdraw.php new file mode 100644 index 000000000000..c3aed28b1497 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/withdraw.php @@ -0,0 +1,78 @@ +withdraw($project, $publicDelegatedPrefix, $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]'; + $publicDelegatedPrefix = '[PUBLIC_DELEGATED_PREFIX]'; + $region = '[REGION]'; + + withdraw_sample($project, $publicDelegatedPrefix, $region); +} +// [END compute_v1_generated_PublicDelegatedPrefixes_Withdraw_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/delete.php new file mode 100644 index 000000000000..a07e9e697611 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/delete.php @@ -0,0 +1,78 @@ +delete($autoscaler, $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 +{ + $autoscaler = '[AUTOSCALER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + delete_sample($autoscaler, $project, $region); +} +// [END compute_v1_generated_RegionAutoscalers_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/get.php new file mode 100644 index 000000000000..5c04fe5ed84c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/get.php @@ -0,0 +1,69 @@ +get($autoscaler, $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 +{ + $autoscaler = '[AUTOSCALER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($autoscaler, $project, $region); +} +// [END compute_v1_generated_RegionAutoscalers_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/insert.php new file mode 100644 index 000000000000..eb0b1427e32d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/insert.php @@ -0,0 +1,80 @@ +insert($autoscalerResource, $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_RegionAutoscalers_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/list.php new file mode 100644 index 000000000000..6b7c3d73edaa --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/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_RegionAutoscalers_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/patch.php new file mode 100644 index 000000000000..d0fd40cc0a88 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/patch.php @@ -0,0 +1,80 @@ +patch($autoscalerResource, $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]'; + + patch_sample($project, $region); +} +// [END compute_v1_generated_RegionAutoscalers_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/update.php b/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/update.php new file mode 100644 index 000000000000..a6f7e00c845e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/update.php @@ -0,0 +1,80 @@ +update($autoscalerResource, $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]'; + + update_sample($project, $region); +} +// [END compute_v1_generated_RegionAutoscalers_Update_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/delete.php new file mode 100644 index 000000000000..7da78ec7e3b6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/delete.php @@ -0,0 +1,78 @@ +delete($backendService, $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 +{ + $backendService = '[BACKEND_SERVICE]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + delete_sample($backendService, $project, $region); +} +// [END compute_v1_generated_RegionBackendServices_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/get.php new file mode 100644 index 000000000000..252f4350d0f8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/get.php @@ -0,0 +1,69 @@ +get($backendService, $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 +{ + $backendService = '[BACKEND_SERVICE]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($backendService, $project, $region); +} +// [END compute_v1_generated_RegionBackendServices_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/get_health.php b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/get_health.php new file mode 100644 index 000000000000..0c6e0c888ab8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/get_health.php @@ -0,0 +1,78 @@ +getHealth( + $backendService, + $project, + $region, + $resourceGroupReferenceResource + ); + 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 +{ + $backendService = '[BACKEND_SERVICE]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_health_sample($backendService, $project, $region); +} +// [END compute_v1_generated_RegionBackendServices_GetHealth_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/get_iam_policy.php new file mode 100644 index 000000000000..6efc360e828e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/get_iam_policy.php @@ -0,0 +1,69 @@ +getIamPolicy($project, $region, $resource); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + get_iam_policy_sample($project, $region, $resource); +} +// [END compute_v1_generated_RegionBackendServices_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/insert.php new file mode 100644 index 000000000000..4d345b1ee780 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/insert.php @@ -0,0 +1,80 @@ +insert($backendServiceResource, $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_RegionBackendServices_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/list.php new file mode 100644 index 000000000000..bef40b7183c6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/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_RegionBackendServices_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/list_usable.php b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/list_usable.php new file mode 100644 index 000000000000..b88fc091f254 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/list_usable.php @@ -0,0 +1,70 @@ +listUsable($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_usable_sample($project, $region); +} +// [END compute_v1_generated_RegionBackendServices_ListUsable_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/patch.php new file mode 100644 index 000000000000..a9f1886844ee --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/patch.php @@ -0,0 +1,87 @@ +patch( + $backendService, + $backendServiceResource, + $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 +{ + $backendService = '[BACKEND_SERVICE]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + patch_sample($backendService, $project, $region); +} +// [END compute_v1_generated_RegionBackendServices_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/set_iam_policy.php new file mode 100644 index 000000000000..6328e4b0112f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/set_iam_policy.php @@ -0,0 +1,78 @@ +setIamPolicy( + $project, + $region, + $regionSetPolicyRequestResource, + $resource + ); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + set_iam_policy_sample($project, $region, $resource); +} +// [END compute_v1_generated_RegionBackendServices_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/set_security_policy.php b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/set_security_policy.php new file mode 100644 index 000000000000..3bfdb199d969 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/set_security_policy.php @@ -0,0 +1,87 @@ +setSecurityPolicy( + $backendService, + $project, + $region, + $securityPolicyReferenceResource + ); + $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 +{ + $backendService = '[BACKEND_SERVICE]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + set_security_policy_sample($backendService, $project, $region); +} +// [END compute_v1_generated_RegionBackendServices_SetSecurityPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/test_iam_permissions.php new file mode 100644 index 000000000000..a728ffacd370 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +testIamPermissions( + $project, + $region, + $resource, + $testPermissionsRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + test_iam_permissions_sample($project, $region, $resource); +} +// [END compute_v1_generated_RegionBackendServices_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/update.php b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/update.php new file mode 100644 index 000000000000..4a51ff942bc5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/update.php @@ -0,0 +1,87 @@ +update( + $backendService, + $backendServiceResource, + $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 +{ + $backendService = '[BACKEND_SERVICE]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + update_sample($backendService, $project, $region); +} +// [END compute_v1_generated_RegionBackendServices_Update_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/aggregated_list.php new file mode 100644 index 000000000000..63b6833aea79 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/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_RegionCommitments_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/get.php new file mode 100644 index 000000000000..c5da5cd5a749 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/get.php @@ -0,0 +1,69 @@ +get($commitment, $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 +{ + $commitment = '[COMMITMENT]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($commitment, $project, $region); +} +// [END compute_v1_generated_RegionCommitments_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/insert.php new file mode 100644 index 000000000000..5221d430b621 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/insert.php @@ -0,0 +1,80 @@ +insert($commitmentResource, $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_RegionCommitments_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/list.php new file mode 100644 index 000000000000..edade3d7c1dc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/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_RegionCommitments_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/update.php b/owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/update.php new file mode 100644 index 000000000000..4432fa352465 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/update.php @@ -0,0 +1,82 @@ +update($commitment, $commitmentResource, $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 +{ + $commitment = '[COMMITMENT]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + update_sample($commitment, $project, $region); +} +// [END compute_v1_generated_RegionCommitments_Update_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionDiskTypesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionDiskTypesClient/get.php new file mode 100644 index 000000000000..960fd2955279 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDiskTypesClient/get.php @@ -0,0 +1,69 @@ +get($diskType, $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 +{ + $diskType = '[DISK_TYPE]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($diskType, $project, $region); +} +// [END compute_v1_generated_RegionDiskTypes_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionDiskTypesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionDiskTypesClient/list.php new file mode 100644 index 000000000000..081d97ba8627 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDiskTypesClient/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_RegionDiskTypes_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/add_resource_policies.php b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/add_resource_policies.php new file mode 100644 index 000000000000..90c2ab2e77ab --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/add_resource_policies.php @@ -0,0 +1,87 @@ +addResourcePolicies( + $disk, + $project, + $region, + $regionDisksAddResourcePoliciesRequestResource + ); + $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]'; + + add_resource_policies_sample($disk, $project, $region); +} +// [END compute_v1_generated_RegionDisks_AddResourcePolicies_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/bulk_insert.php b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/bulk_insert.php new file mode 100644 index 000000000000..6e1259190736 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/bulk_insert.php @@ -0,0 +1,80 @@ +bulkInsert($bulkInsertDiskResourceResource, $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]'; + + bulk_insert_sample($project, $region); +} +// [END compute_v1_generated_RegionDisks_BulkInsert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/create_snapshot.php b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/create_snapshot.php new file mode 100644 index 000000000000..dc191d01286f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/create_snapshot.php @@ -0,0 +1,82 @@ +createSnapshot($disk, $project, $region, $snapshotResource); + $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]'; + + create_snapshot_sample($disk, $project, $region); +} +// [END compute_v1_generated_RegionDisks_CreateSnapshot_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/delete.php new file mode 100644 index 000000000000..50428f0762f5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/delete.php @@ -0,0 +1,78 @@ +delete($disk, $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]'; + + delete_sample($disk, $project, $region); +} +// [END compute_v1_generated_RegionDisks_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/get.php new file mode 100644 index 000000000000..aee12026ccb0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/get.php @@ -0,0 +1,69 @@ +get($disk, $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 +{ + $disk = '[DISK]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($disk, $project, $region); +} +// [END compute_v1_generated_RegionDisks_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/get_iam_policy.php new file mode 100644 index 000000000000..22b0340c0d67 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/get_iam_policy.php @@ -0,0 +1,69 @@ +getIamPolicy($project, $region, $resource); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + get_iam_policy_sample($project, $region, $resource); +} +// [END compute_v1_generated_RegionDisks_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/insert.php new file mode 100644 index 000000000000..9d16f2728d9c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/insert.php @@ -0,0 +1,80 @@ +insert($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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + + insert_sample($project, $region); +} +// [END compute_v1_generated_RegionDisks_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/list.php new file mode 100644 index 000000000000..0217c30242fb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/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_RegionDisks_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/remove_resource_policies.php b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/remove_resource_policies.php new file mode 100644 index 000000000000..a59163bcc844 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/remove_resource_policies.php @@ -0,0 +1,87 @@ +removeResourcePolicies( + $disk, + $project, + $region, + $regionDisksRemoveResourcePoliciesRequestResource + ); + $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]'; + + remove_resource_policies_sample($disk, $project, $region); +} +// [END compute_v1_generated_RegionDisks_RemoveResourcePolicies_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/resize.php b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/resize.php new file mode 100644 index 000000000000..7fad984f2502 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/resize.php @@ -0,0 +1,82 @@ +resize($disk, $project, $region, $regionDisksResizeRequestResource); + $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]'; + + resize_sample($disk, $project, $region); +} +// [END compute_v1_generated_RegionDisks_Resize_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/set_iam_policy.php new file mode 100644 index 000000000000..bbc33b937958 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/set_iam_policy.php @@ -0,0 +1,78 @@ +setIamPolicy( + $project, + $region, + $regionSetPolicyRequestResource, + $resource + ); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + set_iam_policy_sample($project, $region, $resource); +} +// [END compute_v1_generated_RegionDisks_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/set_labels.php b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/set_labels.php new file mode 100644 index 000000000000..7caa31ca875f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/set_labels.php @@ -0,0 +1,87 @@ +setLabels( + $project, + $region, + $regionSetLabelsRequestResource, + $resource + ); + $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]'; + $resource = '[RESOURCE]'; + + set_labels_sample($project, $region, $resource); +} +// [END compute_v1_generated_RegionDisks_SetLabels_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/start_async_replication.php b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/start_async_replication.php new file mode 100644 index 000000000000..7ae87de40702 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/start_async_replication.php @@ -0,0 +1,87 @@ +startAsyncReplication( + $disk, + $project, + $region, + $regionDisksStartAsyncReplicationRequestResource + ); + $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]'; + + start_async_replication_sample($disk, $project, $region); +} +// [END compute_v1_generated_RegionDisks_StartAsyncReplication_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/stop_async_replication.php b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/stop_async_replication.php new file mode 100644 index 000000000000..94379277cca2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/stop_async_replication.php @@ -0,0 +1,78 @@ +stopAsyncReplication($disk, $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]'; + + stop_async_replication_sample($disk, $project, $region); +} +// [END compute_v1_generated_RegionDisks_StopAsyncReplication_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/stop_group_async_replication.php b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/stop_group_async_replication.php new file mode 100644 index 000000000000..4d9967d3b599 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/stop_group_async_replication.php @@ -0,0 +1,84 @@ +stopGroupAsyncReplication( + $disksStopGroupAsyncReplicationResourceResource, + $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]'; + + stop_group_async_replication_sample($project, $region); +} +// [END compute_v1_generated_RegionDisks_StopGroupAsyncReplication_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/test_iam_permissions.php new file mode 100644 index 000000000000..b42775ae5045 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +testIamPermissions( + $project, + $region, + $resource, + $testPermissionsRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + test_iam_permissions_sample($project, $region, $resource); +} +// [END compute_v1_generated_RegionDisks_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/update.php b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/update.php new file mode 100644 index 000000000000..48259e25c0bf --- /dev/null +++ b/owl-bot-staging/Compute/V1/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/owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/delete.php new file mode 100644 index 000000000000..3a6dc61116f5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/delete.php @@ -0,0 +1,78 @@ +delete($healthCheckService, $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 +{ + $healthCheckService = '[HEALTH_CHECK_SERVICE]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + delete_sample($healthCheckService, $project, $region); +} +// [END compute_v1_generated_RegionHealthCheckServices_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/get.php new file mode 100644 index 000000000000..2f480374bb7f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/get.php @@ -0,0 +1,69 @@ +get($healthCheckService, $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 +{ + $healthCheckService = '[HEALTH_CHECK_SERVICE]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($healthCheckService, $project, $region); +} +// [END compute_v1_generated_RegionHealthCheckServices_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/insert.php new file mode 100644 index 000000000000..1e3d865a6bfc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/insert.php @@ -0,0 +1,84 @@ +insert( + $healthCheckServiceResource, + $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_RegionHealthCheckServices_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/list.php new file mode 100644 index 000000000000..32ea64c578d4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/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_RegionHealthCheckServices_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/patch.php new file mode 100644 index 000000000000..a080b776088e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/patch.php @@ -0,0 +1,87 @@ +patch( + $healthCheckService, + $healthCheckServiceResource, + $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 +{ + $healthCheckService = '[HEALTH_CHECK_SERVICE]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + patch_sample($healthCheckService, $project, $region); +} +// [END compute_v1_generated_RegionHealthCheckServices_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/delete.php new file mode 100644 index 000000000000..f77b9e57445c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/delete.php @@ -0,0 +1,78 @@ +delete($healthCheck, $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 +{ + $healthCheck = '[HEALTH_CHECK]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + delete_sample($healthCheck, $project, $region); +} +// [END compute_v1_generated_RegionHealthChecks_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/get.php new file mode 100644 index 000000000000..67efe947c029 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/get.php @@ -0,0 +1,69 @@ +get($healthCheck, $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 +{ + $healthCheck = '[HEALTH_CHECK]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($healthCheck, $project, $region); +} +// [END compute_v1_generated_RegionHealthChecks_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/insert.php new file mode 100644 index 000000000000..5aa452551dab --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/insert.php @@ -0,0 +1,80 @@ +insert($healthCheckResource, $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_RegionHealthChecks_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/list.php new file mode 100644 index 000000000000..cb08ff59f299 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/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_RegionHealthChecks_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/patch.php new file mode 100644 index 000000000000..15c10e558600 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/patch.php @@ -0,0 +1,82 @@ +patch($healthCheck, $healthCheckResource, $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 +{ + $healthCheck = '[HEALTH_CHECK]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + patch_sample($healthCheck, $project, $region); +} +// [END compute_v1_generated_RegionHealthChecks_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/update.php b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/update.php new file mode 100644 index 000000000000..7463353bd420 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/update.php @@ -0,0 +1,87 @@ +update( + $healthCheck, + $healthCheckResource, + $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 +{ + $healthCheck = '[HEALTH_CHECK]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + update_sample($healthCheck, $project, $region); +} +// [END compute_v1_generated_RegionHealthChecks_Update_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/abandon_instances.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/abandon_instances.php new file mode 100644 index 000000000000..8ceb395e99d0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/abandon_instances.php @@ -0,0 +1,90 @@ +abandonInstances( + $instanceGroupManager, + $project, + $region, + $regionInstanceGroupManagersAbandonInstancesRequestResource + ); + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + abandon_instances_sample($instanceGroupManager, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroupManagers_AbandonInstances_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/apply_updates_to_instances.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/apply_updates_to_instances.php new file mode 100644 index 000000000000..774c98b01f6e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/apply_updates_to_instances.php @@ -0,0 +1,90 @@ +applyUpdatesToInstances( + $instanceGroupManager, + $project, + $region, + $regionInstanceGroupManagersApplyUpdatesRequestResource + ); + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + apply_updates_to_instances_sample($instanceGroupManager, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroupManagers_ApplyUpdatesToInstances_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/create_instances.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/create_instances.php new file mode 100644 index 000000000000..7f57cdef64ed --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/create_instances.php @@ -0,0 +1,90 @@ +createInstances( + $instanceGroupManager, + $project, + $region, + $regionInstanceGroupManagersCreateInstancesRequestResource + ); + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + create_instances_sample($instanceGroupManager, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroupManagers_CreateInstances_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/delete.php new file mode 100644 index 000000000000..fc5e44ffeffc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/delete.php @@ -0,0 +1,78 @@ +delete($instanceGroupManager, $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + delete_sample($instanceGroupManager, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroupManagers_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/delete_instances.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/delete_instances.php new file mode 100644 index 000000000000..6a3e5c3504e4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/delete_instances.php @@ -0,0 +1,90 @@ +deleteInstances( + $instanceGroupManager, + $project, + $region, + $regionInstanceGroupManagersDeleteInstancesRequestResource + ); + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + delete_instances_sample($instanceGroupManager, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroupManagers_DeleteInstances_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/delete_per_instance_configs.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/delete_per_instance_configs.php new file mode 100644 index 000000000000..5162a000aa85 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/delete_per_instance_configs.php @@ -0,0 +1,90 @@ +deletePerInstanceConfigs( + $instanceGroupManager, + $project, + $region, + $regionInstanceGroupManagerDeleteInstanceConfigReqResource + ); + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + delete_per_instance_configs_sample($instanceGroupManager, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroupManagers_DeletePerInstanceConfigs_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/get.php new file mode 100644 index 000000000000..864a0fba5207 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/get.php @@ -0,0 +1,69 @@ +get($instanceGroupManager, $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($instanceGroupManager, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroupManagers_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/insert.php new file mode 100644 index 000000000000..80ea285dae67 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/insert.php @@ -0,0 +1,84 @@ +insert( + $instanceGroupManagerResource, + $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_RegionInstanceGroupManagers_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/list.php new file mode 100644 index 000000000000..34f8273529c8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/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_RegionInstanceGroupManagers_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/list_errors.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/list_errors.php new file mode 100644 index 000000000000..839aa3e4ad77 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/list_errors.php @@ -0,0 +1,76 @@ +listErrors( + $instanceGroupManager, + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + list_errors_sample($instanceGroupManager, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroupManagers_ListErrors_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/list_managed_instances.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/list_managed_instances.php new file mode 100644 index 000000000000..727cf68c0401 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/list_managed_instances.php @@ -0,0 +1,79 @@ +listManagedInstances( + $instanceGroupManager, + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + list_managed_instances_sample($instanceGroupManager, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroupManagers_ListManagedInstances_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/list_per_instance_configs.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/list_per_instance_configs.php new file mode 100644 index 000000000000..08c93dcb8e98 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/list_per_instance_configs.php @@ -0,0 +1,79 @@ +listPerInstanceConfigs( + $instanceGroupManager, + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + list_per_instance_configs_sample($instanceGroupManager, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroupManagers_ListPerInstanceConfigs_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/patch.php new file mode 100644 index 000000000000..32078e74a141 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/patch.php @@ -0,0 +1,87 @@ +patch( + $instanceGroupManager, + $instanceGroupManagerResource, + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + patch_sample($instanceGroupManager, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroupManagers_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/patch_per_instance_configs.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/patch_per_instance_configs.php new file mode 100644 index 000000000000..967340f6373f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/patch_per_instance_configs.php @@ -0,0 +1,90 @@ +patchPerInstanceConfigs( + $instanceGroupManager, + $project, + $region, + $regionInstanceGroupManagerPatchInstanceConfigReqResource + ); + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + patch_per_instance_configs_sample($instanceGroupManager, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroupManagers_PatchPerInstanceConfigs_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/recreate_instances.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/recreate_instances.php new file mode 100644 index 000000000000..508e65b68d2f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/recreate_instances.php @@ -0,0 +1,90 @@ +recreateInstances( + $instanceGroupManager, + $project, + $region, + $regionInstanceGroupManagersRecreateRequestResource + ); + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + recreate_instances_sample($instanceGroupManager, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroupManagers_RecreateInstances_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/resize.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/resize.php new file mode 100644 index 000000000000..0e68b27c98f9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/resize.php @@ -0,0 +1,89 @@ +resize( + $instanceGroupManager, + $project, + $region, + $size + ); + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + $size = 0; + + resize_sample($instanceGroupManager, $project, $region, $size); +} +// [END compute_v1_generated_RegionInstanceGroupManagers_Resize_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/set_instance_template.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/set_instance_template.php new file mode 100644 index 000000000000..42c197ba135f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/set_instance_template.php @@ -0,0 +1,90 @@ +setInstanceTemplate( + $instanceGroupManager, + $project, + $region, + $regionInstanceGroupManagersSetTemplateRequestResource + ); + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + set_instance_template_sample($instanceGroupManager, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroupManagers_SetInstanceTemplate_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/set_target_pools.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/set_target_pools.php new file mode 100644 index 000000000000..3d19ba40783c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/set_target_pools.php @@ -0,0 +1,90 @@ +setTargetPools( + $instanceGroupManager, + $project, + $region, + $regionInstanceGroupManagersSetTargetPoolsRequestResource + ); + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + set_target_pools_sample($instanceGroupManager, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroupManagers_SetTargetPools_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/update_per_instance_configs.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/update_per_instance_configs.php new file mode 100644 index 000000000000..11d1b579527b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/update_per_instance_configs.php @@ -0,0 +1,90 @@ +updatePerInstanceConfigs( + $instanceGroupManager, + $project, + $region, + $regionInstanceGroupManagerUpdateInstanceConfigReqResource + ); + $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 +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + update_per_instance_configs_sample($instanceGroupManager, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroupManagers_UpdatePerInstanceConfigs_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupsClient/get.php new file mode 100644 index 000000000000..c3fe81021c14 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupsClient/get.php @@ -0,0 +1,69 @@ +get($instanceGroup, $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 +{ + $instanceGroup = '[INSTANCE_GROUP]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($instanceGroup, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroups_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupsClient/list.php new file mode 100644 index 000000000000..b1b2aff9c48e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupsClient/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_RegionInstanceGroups_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupsClient/list_instances.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupsClient/list_instances.php new file mode 100644 index 000000000000..075b73fd8019 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupsClient/list_instances.php @@ -0,0 +1,81 @@ +listInstances( + $instanceGroup, + $project, + $region, + $regionInstanceGroupsListInstancesRequestResource + ); + + 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 +{ + $instanceGroup = '[INSTANCE_GROUP]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + list_instances_sample($instanceGroup, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroups_ListInstances_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupsClient/set_named_ports.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupsClient/set_named_ports.php new file mode 100644 index 000000000000..b8959e389997 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupsClient/set_named_ports.php @@ -0,0 +1,87 @@ +setNamedPorts( + $instanceGroup, + $project, + $region, + $regionInstanceGroupsSetNamedPortsRequestResource + ); + $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 +{ + $instanceGroup = '[INSTANCE_GROUP]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + set_named_ports_sample($instanceGroup, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroups_SetNamedPorts_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceTemplatesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceTemplatesClient/delete.php new file mode 100644 index 000000000000..9c3bba71b925 --- /dev/null +++ b/owl-bot-staging/Compute/V1/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/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceTemplatesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceTemplatesClient/get.php new file mode 100644 index 000000000000..32e37a024e93 --- /dev/null +++ b/owl-bot-staging/Compute/V1/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/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceTemplatesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceTemplatesClient/insert.php new file mode 100644 index 000000000000..a28c7e7c687d --- /dev/null +++ b/owl-bot-staging/Compute/V1/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/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceTemplatesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceTemplatesClient/list.php new file mode 100644 index 000000000000..ad307ee8e0ca --- /dev/null +++ b/owl-bot-staging/Compute/V1/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/owl-bot-staging/Compute/V1/samples/V1/RegionInstancesClient/bulk_insert.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstancesClient/bulk_insert.php new file mode 100644 index 000000000000..a68aef1e212f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstancesClient/bulk_insert.php @@ -0,0 +1,84 @@ +bulkInsert( + $bulkInsertInstanceResourceResource, + $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]'; + + bulk_insert_sample($project, $region); +} +// [END compute_v1_generated_RegionInstances_BulkInsert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/delete.php new file mode 100644 index 000000000000..12de23a26123 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/delete.php @@ -0,0 +1,78 @@ +delete($instantSnapshot, $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 +{ + $instantSnapshot = '[INSTANT_SNAPSHOT]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + delete_sample($instantSnapshot, $project, $region); +} +// [END compute_v1_generated_RegionInstantSnapshots_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/get.php new file mode 100644 index 000000000000..85aae225855c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/get.php @@ -0,0 +1,69 @@ +get($instantSnapshot, $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 +{ + $instantSnapshot = '[INSTANT_SNAPSHOT]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($instantSnapshot, $project, $region); +} +// [END compute_v1_generated_RegionInstantSnapshots_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/get_iam_policy.php new file mode 100644 index 000000000000..7ddcac8aa434 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/get_iam_policy.php @@ -0,0 +1,69 @@ +getIamPolicy($project, $region, $resource); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + get_iam_policy_sample($project, $region, $resource); +} +// [END compute_v1_generated_RegionInstantSnapshots_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/insert.php new file mode 100644 index 000000000000..5ee1e53b5d77 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/insert.php @@ -0,0 +1,80 @@ +insert($instantSnapshotResource, $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_RegionInstantSnapshots_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/list.php new file mode 100644 index 000000000000..925b6f22cd6e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/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_RegionInstantSnapshots_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/set_iam_policy.php new file mode 100644 index 000000000000..96a8dacb4f30 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/set_iam_policy.php @@ -0,0 +1,78 @@ +setIamPolicy( + $project, + $region, + $regionSetPolicyRequestResource, + $resource + ); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + set_iam_policy_sample($project, $region, $resource); +} +// [END compute_v1_generated_RegionInstantSnapshots_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/set_labels.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/set_labels.php new file mode 100644 index 000000000000..354be8553632 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/set_labels.php @@ -0,0 +1,87 @@ +setLabels( + $project, + $region, + $regionSetLabelsRequestResource, + $resource + ); + $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]'; + $resource = '[RESOURCE]'; + + set_labels_sample($project, $region, $resource); +} +// [END compute_v1_generated_RegionInstantSnapshots_SetLabels_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/test_iam_permissions.php new file mode 100644 index 000000000000..8415996b5e02 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +testIamPermissions( + $project, + $region, + $resource, + $testPermissionsRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + test_iam_permissions_sample($project, $region, $resource); +} +// [END compute_v1_generated_RegionInstantSnapshots_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/attach_network_endpoints.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/attach_network_endpoints.php new file mode 100644 index 000000000000..53697e83d325 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/attach_network_endpoints.php @@ -0,0 +1,90 @@ +attachNetworkEndpoints( + $networkEndpointGroup, + $project, + $region, + $regionNetworkEndpointGroupsAttachEndpointsRequestResource + ); + $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 +{ + $networkEndpointGroup = '[NETWORK_ENDPOINT_GROUP]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + attach_network_endpoints_sample($networkEndpointGroup, $project, $region); +} +// [END compute_v1_generated_RegionNetworkEndpointGroups_AttachNetworkEndpoints_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/delete.php new file mode 100644 index 000000000000..a2129612c90f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/delete.php @@ -0,0 +1,78 @@ +delete($networkEndpointGroup, $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 +{ + $networkEndpointGroup = '[NETWORK_ENDPOINT_GROUP]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + delete_sample($networkEndpointGroup, $project, $region); +} +// [END compute_v1_generated_RegionNetworkEndpointGroups_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/detach_network_endpoints.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/detach_network_endpoints.php new file mode 100644 index 000000000000..1b3df5680cde --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/detach_network_endpoints.php @@ -0,0 +1,90 @@ +detachNetworkEndpoints( + $networkEndpointGroup, + $project, + $region, + $regionNetworkEndpointGroupsDetachEndpointsRequestResource + ); + $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 +{ + $networkEndpointGroup = '[NETWORK_ENDPOINT_GROUP]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + detach_network_endpoints_sample($networkEndpointGroup, $project, $region); +} +// [END compute_v1_generated_RegionNetworkEndpointGroups_DetachNetworkEndpoints_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/get.php new file mode 100644 index 000000000000..6e0204bc7721 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/get.php @@ -0,0 +1,69 @@ +get($networkEndpointGroup, $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 +{ + $networkEndpointGroup = '[NETWORK_ENDPOINT_GROUP]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($networkEndpointGroup, $project, $region); +} +// [END compute_v1_generated_RegionNetworkEndpointGroups_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/insert.php new file mode 100644 index 000000000000..b9cb75da4e3f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/insert.php @@ -0,0 +1,84 @@ +insert( + $networkEndpointGroupResource, + $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_RegionNetworkEndpointGroups_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/list.php new file mode 100644 index 000000000000..dc25a7b085e9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/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_RegionNetworkEndpointGroups_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/list_network_endpoints.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/list_network_endpoints.php new file mode 100644 index 000000000000..2e9ad42df986 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/list_network_endpoints.php @@ -0,0 +1,79 @@ +listNetworkEndpoints( + $networkEndpointGroup, + $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 +{ + $networkEndpointGroup = '[NETWORK_ENDPOINT_GROUP]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + list_network_endpoints_sample($networkEndpointGroup, $project, $region); +} +// [END compute_v1_generated_RegionNetworkEndpointGroups_ListNetworkEndpoints_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/add_association.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/add_association.php new file mode 100644 index 000000000000..4a3417238044 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/add_association.php @@ -0,0 +1,87 @@ +addAssociation( + $firewallPolicy, + $firewallPolicyAssociationResource, + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + add_association_sample($firewallPolicy, $project, $region); +} +// [END compute_v1_generated_RegionNetworkFirewallPolicies_AddAssociation_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/add_rule.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/add_rule.php new file mode 100644 index 000000000000..1644a2e1321d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/add_rule.php @@ -0,0 +1,87 @@ +addRule( + $firewallPolicy, + $firewallPolicyRuleResource, + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + add_rule_sample($firewallPolicy, $project, $region); +} +// [END compute_v1_generated_RegionNetworkFirewallPolicies_AddRule_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/clone_rules.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/clone_rules.php new file mode 100644 index 000000000000..7228df2a8419 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/clone_rules.php @@ -0,0 +1,78 @@ +cloneRules($firewallPolicy, $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + clone_rules_sample($firewallPolicy, $project, $region); +} +// [END compute_v1_generated_RegionNetworkFirewallPolicies_CloneRules_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/delete.php new file mode 100644 index 000000000000..5e2df73dcd71 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/delete.php @@ -0,0 +1,78 @@ +delete($firewallPolicy, $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + delete_sample($firewallPolicy, $project, $region); +} +// [END compute_v1_generated_RegionNetworkFirewallPolicies_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get.php new file mode 100644 index 000000000000..7af80e0c3c2b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get.php @@ -0,0 +1,69 @@ +get($firewallPolicy, $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($firewallPolicy, $project, $region); +} +// [END compute_v1_generated_RegionNetworkFirewallPolicies_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get_association.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get_association.php new file mode 100644 index 000000000000..2a559028ca7b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get_association.php @@ -0,0 +1,73 @@ +getAssociation( + $firewallPolicy, + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_association_sample($firewallPolicy, $project, $region); +} +// [END compute_v1_generated_RegionNetworkFirewallPolicies_GetAssociation_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get_effective_firewalls.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get_effective_firewalls.php new file mode 100644 index 000000000000..da3a081479e0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get_effective_firewalls.php @@ -0,0 +1,73 @@ +getEffectiveFirewalls( + $network, + $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 +{ + $network = '[NETWORK]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_effective_firewalls_sample($network, $project, $region); +} +// [END compute_v1_generated_RegionNetworkFirewallPolicies_GetEffectiveFirewalls_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get_iam_policy.php new file mode 100644 index 000000000000..ebe62d483abc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get_iam_policy.php @@ -0,0 +1,69 @@ +getIamPolicy($project, $region, $resource); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + get_iam_policy_sample($project, $region, $resource); +} +// [END compute_v1_generated_RegionNetworkFirewallPolicies_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get_rule.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get_rule.php new file mode 100644 index 000000000000..a89e10c1a582 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get_rule.php @@ -0,0 +1,69 @@ +getRule($firewallPolicy, $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_rule_sample($firewallPolicy, $project, $region); +} +// [END compute_v1_generated_RegionNetworkFirewallPolicies_GetRule_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/insert.php new file mode 100644 index 000000000000..d4686b4bd10e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/insert.php @@ -0,0 +1,84 @@ +insert( + $firewallPolicyResource, + $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_RegionNetworkFirewallPolicies_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/list.php new file mode 100644 index 000000000000..ee35f59bca00 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/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_RegionNetworkFirewallPolicies_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/patch.php new file mode 100644 index 000000000000..ae67bef0ba2b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/patch.php @@ -0,0 +1,87 @@ +patch( + $firewallPolicy, + $firewallPolicyResource, + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + patch_sample($firewallPolicy, $project, $region); +} +// [END compute_v1_generated_RegionNetworkFirewallPolicies_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/patch_rule.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/patch_rule.php new file mode 100644 index 000000000000..c5fb94e808c4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/patch_rule.php @@ -0,0 +1,87 @@ +patchRule( + $firewallPolicy, + $firewallPolicyRuleResource, + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + patch_rule_sample($firewallPolicy, $project, $region); +} +// [END compute_v1_generated_RegionNetworkFirewallPolicies_PatchRule_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/remove_association.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/remove_association.php new file mode 100644 index 000000000000..60b6a90f00d4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/remove_association.php @@ -0,0 +1,82 @@ +removeAssociation( + $firewallPolicy, + $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + remove_association_sample($firewallPolicy, $project, $region); +} +// [END compute_v1_generated_RegionNetworkFirewallPolicies_RemoveAssociation_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/remove_rule.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/remove_rule.php new file mode 100644 index 000000000000..399eff4b15a9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/remove_rule.php @@ -0,0 +1,78 @@ +removeRule($firewallPolicy, $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 +{ + $firewallPolicy = '[FIREWALL_POLICY]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + remove_rule_sample($firewallPolicy, $project, $region); +} +// [END compute_v1_generated_RegionNetworkFirewallPolicies_RemoveRule_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/set_iam_policy.php new file mode 100644 index 000000000000..d0fd3e1d11b6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/set_iam_policy.php @@ -0,0 +1,78 @@ +setIamPolicy( + $project, + $region, + $regionSetPolicyRequestResource, + $resource + ); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + set_iam_policy_sample($project, $region, $resource); +} +// [END compute_v1_generated_RegionNetworkFirewallPolicies_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/test_iam_permissions.php new file mode 100644 index 000000000000..3547aef405ed --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +testIamPermissions( + $project, + $region, + $resource, + $testPermissionsRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + test_iam_permissions_sample($project, $region, $resource); +} +// [END compute_v1_generated_RegionNetworkFirewallPolicies_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNotificationEndpointsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNotificationEndpointsClient/delete.php new file mode 100644 index 000000000000..4c89382439af --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNotificationEndpointsClient/delete.php @@ -0,0 +1,78 @@ +delete($notificationEndpoint, $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 +{ + $notificationEndpoint = '[NOTIFICATION_ENDPOINT]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + delete_sample($notificationEndpoint, $project, $region); +} +// [END compute_v1_generated_RegionNotificationEndpoints_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNotificationEndpointsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNotificationEndpointsClient/get.php new file mode 100644 index 000000000000..3012cf8386a5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNotificationEndpointsClient/get.php @@ -0,0 +1,69 @@ +get($notificationEndpoint, $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 +{ + $notificationEndpoint = '[NOTIFICATION_ENDPOINT]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($notificationEndpoint, $project, $region); +} +// [END compute_v1_generated_RegionNotificationEndpoints_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNotificationEndpointsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNotificationEndpointsClient/insert.php new file mode 100644 index 000000000000..11b5cb6d98ad --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNotificationEndpointsClient/insert.php @@ -0,0 +1,84 @@ +insert( + $notificationEndpointResource, + $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_RegionNotificationEndpoints_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionNotificationEndpointsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionNotificationEndpointsClient/list.php new file mode 100644 index 000000000000..f7b3bd065eab --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNotificationEndpointsClient/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_RegionNotificationEndpoints_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionOperationsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/RegionOperationsClient/delete.php new file mode 100644 index 000000000000..26f503d2d29a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionOperationsClient/delete.php @@ -0,0 +1,69 @@ +delete($operation, $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 +{ + $operation = '[OPERATION]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + delete_sample($operation, $project, $region); +} +// [END compute_v1_generated_RegionOperations_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionOperationsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionOperationsClient/get.php new file mode 100644 index 000000000000..3e0849ceac23 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionOperationsClient/get.php @@ -0,0 +1,69 @@ +get($operation, $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 +{ + $operation = '[OPERATION]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($operation, $project, $region); +} +// [END compute_v1_generated_RegionOperations_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionOperationsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionOperationsClient/list.php new file mode 100644 index 000000000000..8a7f24c2e9e3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionOperationsClient/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_RegionOperations_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionOperationsClient/wait.php b/owl-bot-staging/Compute/V1/samples/V1/RegionOperationsClient/wait.php new file mode 100644 index 000000000000..d787ca1b1574 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionOperationsClient/wait.php @@ -0,0 +1,69 @@ +wait($operation, $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 +{ + $operation = '[OPERATION]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + wait_sample($operation, $project, $region); +} +// [END compute_v1_generated_RegionOperations_Wait_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/add_rule.php b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/add_rule.php new file mode 100644 index 000000000000..8c546d820e38 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/add_rule.php @@ -0,0 +1,87 @@ +addRule( + $project, + $region, + $securityPolicy, + $securityPolicyRuleResource + ); + $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]'; + $securityPolicy = '[SECURITY_POLICY]'; + + add_rule_sample($project, $region, $securityPolicy); +} +// [END compute_v1_generated_RegionSecurityPolicies_AddRule_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/delete.php new file mode 100644 index 000000000000..b9030f5cc925 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/delete.php @@ -0,0 +1,78 @@ +delete($project, $region, $securityPolicy); + $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]'; + $securityPolicy = '[SECURITY_POLICY]'; + + delete_sample($project, $region, $securityPolicy); +} +// [END compute_v1_generated_RegionSecurityPolicies_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/get.php new file mode 100644 index 000000000000..b8972ec733b7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/get.php @@ -0,0 +1,69 @@ +get($project, $region, $securityPolicy); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $securityPolicy = '[SECURITY_POLICY]'; + + get_sample($project, $region, $securityPolicy); +} +// [END compute_v1_generated_RegionSecurityPolicies_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/get_rule.php b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/get_rule.php new file mode 100644 index 000000000000..9e6f61608dc2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/get_rule.php @@ -0,0 +1,69 @@ +getRule($project, $region, $securityPolicy); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $securityPolicy = '[SECURITY_POLICY]'; + + get_rule_sample($project, $region, $securityPolicy); +} +// [END compute_v1_generated_RegionSecurityPolicies_GetRule_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/insert.php new file mode 100644 index 000000000000..e4b8dad44892 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/insert.php @@ -0,0 +1,80 @@ +insert($project, $region, $securityPolicyResource); + $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_RegionSecurityPolicies_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/list.php new file mode 100644 index 000000000000..2f0986091b41 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/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_RegionSecurityPolicies_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/patch.php new file mode 100644 index 000000000000..b90751b5c8d5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/patch.php @@ -0,0 +1,87 @@ +patch( + $project, + $region, + $securityPolicy, + $securityPolicyResource + ); + $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]'; + $securityPolicy = '[SECURITY_POLICY]'; + + patch_sample($project, $region, $securityPolicy); +} +// [END compute_v1_generated_RegionSecurityPolicies_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/patch_rule.php b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/patch_rule.php new file mode 100644 index 000000000000..125750a0dd15 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/patch_rule.php @@ -0,0 +1,87 @@ +patchRule( + $project, + $region, + $securityPolicy, + $securityPolicyRuleResource + ); + $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]'; + $securityPolicy = '[SECURITY_POLICY]'; + + patch_rule_sample($project, $region, $securityPolicy); +} +// [END compute_v1_generated_RegionSecurityPolicies_PatchRule_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/remove_rule.php b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/remove_rule.php new file mode 100644 index 000000000000..5acfca79fac7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/remove_rule.php @@ -0,0 +1,78 @@ +removeRule($project, $region, $securityPolicy); + $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]'; + $securityPolicy = '[SECURITY_POLICY]'; + + remove_rule_sample($project, $region, $securityPolicy); +} +// [END compute_v1_generated_RegionSecurityPolicies_RemoveRule_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionSslCertificatesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/RegionSslCertificatesClient/delete.php new file mode 100644 index 000000000000..9d4b307da4de --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSslCertificatesClient/delete.php @@ -0,0 +1,78 @@ +delete($project, $region, $sslCertificate); + $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]'; + $sslCertificate = '[SSL_CERTIFICATE]'; + + delete_sample($project, $region, $sslCertificate); +} +// [END compute_v1_generated_RegionSslCertificates_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionSslCertificatesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionSslCertificatesClient/get.php new file mode 100644 index 000000000000..13a8436f6670 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSslCertificatesClient/get.php @@ -0,0 +1,69 @@ +get($project, $region, $sslCertificate); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $sslCertificate = '[SSL_CERTIFICATE]'; + + get_sample($project, $region, $sslCertificate); +} +// [END compute_v1_generated_RegionSslCertificates_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionSslCertificatesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/RegionSslCertificatesClient/insert.php new file mode 100644 index 000000000000..32837843d189 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSslCertificatesClient/insert.php @@ -0,0 +1,80 @@ +insert($project, $region, $sslCertificateResource); + $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_RegionSslCertificates_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionSslCertificatesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionSslCertificatesClient/list.php new file mode 100644 index 000000000000..06ea13c0e50e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSslCertificatesClient/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_RegionSslCertificates_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/delete.php new file mode 100644 index 000000000000..f4c36e45298f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/delete.php @@ -0,0 +1,78 @@ +delete($project, $region, $sslPolicy); + $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]'; + $sslPolicy = '[SSL_POLICY]'; + + delete_sample($project, $region, $sslPolicy); +} +// [END compute_v1_generated_RegionSslPolicies_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/get.php new file mode 100644 index 000000000000..22b4ab2b7ec4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/get.php @@ -0,0 +1,69 @@ +get($project, $region, $sslPolicy); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $sslPolicy = '[SSL_POLICY]'; + + get_sample($project, $region, $sslPolicy); +} +// [END compute_v1_generated_RegionSslPolicies_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/insert.php new file mode 100644 index 000000000000..07c87bc467b2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/insert.php @@ -0,0 +1,80 @@ +insert($project, $region, $sslPolicyResource); + $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_RegionSslPolicies_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/list.php new file mode 100644 index 000000000000..f30cfcb4be29 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/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_RegionSslPolicies_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/list_available_features.php b/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/list_available_features.php new file mode 100644 index 000000000000..880fd019b82c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/list_available_features.php @@ -0,0 +1,67 @@ +listAvailableFeatures($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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + + list_available_features_sample($project, $region); +} +// [END compute_v1_generated_RegionSslPolicies_ListAvailableFeatures_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/patch.php new file mode 100644 index 000000000000..942697f12562 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/patch.php @@ -0,0 +1,82 @@ +patch($project, $region, $sslPolicy, $sslPolicyResource); + $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]'; + $sslPolicy = '[SSL_POLICY]'; + + patch_sample($project, $region, $sslPolicy); +} +// [END compute_v1_generated_RegionSslPolicies_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/delete.php new file mode 100644 index 000000000000..065a4e089056 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/delete.php @@ -0,0 +1,78 @@ +delete($project, $region, $targetHttpProxy); + $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]'; + $targetHttpProxy = '[TARGET_HTTP_PROXY]'; + + delete_sample($project, $region, $targetHttpProxy); +} +// [END compute_v1_generated_RegionTargetHttpProxies_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/get.php new file mode 100644 index 000000000000..495c31e921aa --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/get.php @@ -0,0 +1,69 @@ +get($project, $region, $targetHttpProxy); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $targetHttpProxy = '[TARGET_HTTP_PROXY]'; + + get_sample($project, $region, $targetHttpProxy); +} +// [END compute_v1_generated_RegionTargetHttpProxies_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/insert.php new file mode 100644 index 000000000000..af843cd16f2b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/insert.php @@ -0,0 +1,80 @@ +insert($project, $region, $targetHttpProxyResource); + $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_RegionTargetHttpProxies_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/list.php new file mode 100644 index 000000000000..36fb312a0a84 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/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_RegionTargetHttpProxies_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/set_url_map.php b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/set_url_map.php new file mode 100644 index 000000000000..55b6ff0146b6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/set_url_map.php @@ -0,0 +1,87 @@ +setUrlMap( + $project, + $region, + $targetHttpProxy, + $urlMapReferenceResource + ); + $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]'; + $targetHttpProxy = '[TARGET_HTTP_PROXY]'; + + set_url_map_sample($project, $region, $targetHttpProxy); +} +// [END compute_v1_generated_RegionTargetHttpProxies_SetUrlMap_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/delete.php new file mode 100644 index 000000000000..d4b5026e2b9a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/delete.php @@ -0,0 +1,78 @@ +delete($project, $region, $targetHttpsProxy); + $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]'; + $targetHttpsProxy = '[TARGET_HTTPS_PROXY]'; + + delete_sample($project, $region, $targetHttpsProxy); +} +// [END compute_v1_generated_RegionTargetHttpsProxies_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/get.php new file mode 100644 index 000000000000..d0c382c7cf6c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/get.php @@ -0,0 +1,69 @@ +get($project, $region, $targetHttpsProxy); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $targetHttpsProxy = '[TARGET_HTTPS_PROXY]'; + + get_sample($project, $region, $targetHttpsProxy); +} +// [END compute_v1_generated_RegionTargetHttpsProxies_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/insert.php new file mode 100644 index 000000000000..eb1f4ecfcd1a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/insert.php @@ -0,0 +1,80 @@ +insert($project, $region, $targetHttpsProxyResource); + $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_RegionTargetHttpsProxies_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/list.php new file mode 100644 index 000000000000..33fe7fe00180 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/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_RegionTargetHttpsProxies_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/patch.php new file mode 100644 index 000000000000..995738896f5c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/patch.php @@ -0,0 +1,87 @@ +patch( + $project, + $region, + $targetHttpsProxy, + $targetHttpsProxyResource + ); + $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]'; + $targetHttpsProxy = '[TARGET_HTTPS_PROXY]'; + + patch_sample($project, $region, $targetHttpsProxy); +} +// [END compute_v1_generated_RegionTargetHttpsProxies_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/set_ssl_certificates.php b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/set_ssl_certificates.php new file mode 100644 index 000000000000..f9af43098c72 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/set_ssl_certificates.php @@ -0,0 +1,90 @@ +setSslCertificates( + $project, + $region, + $regionTargetHttpsProxiesSetSslCertificatesRequestResource, + $targetHttpsProxy + ); + $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]'; + $targetHttpsProxy = '[TARGET_HTTPS_PROXY]'; + + set_ssl_certificates_sample($project, $region, $targetHttpsProxy); +} +// [END compute_v1_generated_RegionTargetHttpsProxies_SetSslCertificates_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/set_url_map.php b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/set_url_map.php new file mode 100644 index 000000000000..0fb97d9626a0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/set_url_map.php @@ -0,0 +1,87 @@ +setUrlMap( + $project, + $region, + $targetHttpsProxy, + $urlMapReferenceResource + ); + $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]'; + $targetHttpsProxy = '[TARGET_HTTPS_PROXY]'; + + set_url_map_sample($project, $region, $targetHttpsProxy); +} +// [END compute_v1_generated_RegionTargetHttpsProxies_SetUrlMap_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionTargetTcpProxiesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetTcpProxiesClient/delete.php new file mode 100644 index 000000000000..1cedda7a524a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetTcpProxiesClient/delete.php @@ -0,0 +1,78 @@ +delete($project, $region, $targetTcpProxy); + $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]'; + $targetTcpProxy = '[TARGET_TCP_PROXY]'; + + delete_sample($project, $region, $targetTcpProxy); +} +// [END compute_v1_generated_RegionTargetTcpProxies_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionTargetTcpProxiesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetTcpProxiesClient/get.php new file mode 100644 index 000000000000..73c6cd83530c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetTcpProxiesClient/get.php @@ -0,0 +1,69 @@ +get($project, $region, $targetTcpProxy); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $targetTcpProxy = '[TARGET_TCP_PROXY]'; + + get_sample($project, $region, $targetTcpProxy); +} +// [END compute_v1_generated_RegionTargetTcpProxies_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionTargetTcpProxiesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetTcpProxiesClient/insert.php new file mode 100644 index 000000000000..44d764bd2d47 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetTcpProxiesClient/insert.php @@ -0,0 +1,80 @@ +insert($project, $region, $targetTcpProxyResource); + $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_RegionTargetTcpProxies_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionTargetTcpProxiesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetTcpProxiesClient/list.php new file mode 100644 index 000000000000..8f342a738679 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetTcpProxiesClient/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_RegionTargetTcpProxies_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/delete.php new file mode 100644 index 000000000000..f6013a4db377 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/delete.php @@ -0,0 +1,78 @@ +delete($project, $region, $urlMap); + $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]'; + $urlMap = '[URL_MAP]'; + + delete_sample($project, $region, $urlMap); +} +// [END compute_v1_generated_RegionUrlMaps_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/get.php new file mode 100644 index 000000000000..86926b18b7a4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/get.php @@ -0,0 +1,69 @@ +get($project, $region, $urlMap); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $urlMap = '[URL_MAP]'; + + get_sample($project, $region, $urlMap); +} +// [END compute_v1_generated_RegionUrlMaps_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/insert.php new file mode 100644 index 000000000000..5693072750be --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/insert.php @@ -0,0 +1,80 @@ +insert($project, $region, $urlMapResource); + $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_RegionUrlMaps_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/list.php new file mode 100644 index 000000000000..77bbf3d331cc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/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_RegionUrlMaps_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/patch.php new file mode 100644 index 000000000000..19e10f430ded --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/patch.php @@ -0,0 +1,82 @@ +patch($project, $region, $urlMap, $urlMapResource); + $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]'; + $urlMap = '[URL_MAP]'; + + patch_sample($project, $region, $urlMap); +} +// [END compute_v1_generated_RegionUrlMaps_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/update.php b/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/update.php new file mode 100644 index 000000000000..0968fbd16966 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/update.php @@ -0,0 +1,82 @@ +update($project, $region, $urlMap, $urlMapResource); + $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]'; + $urlMap = '[URL_MAP]'; + + update_sample($project, $region, $urlMap); +} +// [END compute_v1_generated_RegionUrlMaps_Update_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/validate.php b/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/validate.php new file mode 100644 index 000000000000..9faa97de1576 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/validate.php @@ -0,0 +1,78 @@ +validate( + $project, + $region, + $regionUrlMapsValidateRequestResource, + $urlMap + ); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $urlMap = '[URL_MAP]'; + + validate_sample($project, $region, $urlMap); +} +// [END compute_v1_generated_RegionUrlMaps_Validate_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionZonesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionZonesClient/list.php new file mode 100644 index 000000000000..4cc788d0fc08 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionZonesClient/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_RegionZones_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RegionsClient/get.php new file mode 100644 index 000000000000..2240734a6a13 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionsClient/get.php @@ -0,0 +1,67 @@ +get($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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + + get_sample($project, $region); +} +// [END compute_v1_generated_Regions_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RegionsClient/list.php new file mode 100644 index 000000000000..a9de81aeaee4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionsClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_Regions_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/aggregated_list.php new file mode 100644 index 000000000000..1ac98010d874 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/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_Reservations_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/delete.php new file mode 100644 index 000000000000..eb06142dae37 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/delete.php @@ -0,0 +1,78 @@ +delete($project, $reservation, $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 +{ + $project = '[PROJECT]'; + $reservation = '[RESERVATION]'; + $zone = '[ZONE]'; + + delete_sample($project, $reservation, $zone); +} +// [END compute_v1_generated_Reservations_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/get.php new file mode 100644 index 000000000000..a6e62d0138b3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/get.php @@ -0,0 +1,69 @@ +get($project, $reservation, $zone); + 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 +{ + $project = '[PROJECT]'; + $reservation = '[RESERVATION]'; + $zone = '[ZONE]'; + + get_sample($project, $reservation, $zone); +} +// [END compute_v1_generated_Reservations_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/get_iam_policy.php new file mode 100644 index 000000000000..10c93722f671 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/get_iam_policy.php @@ -0,0 +1,69 @@ +getIamPolicy($project, $resource, $zone); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + $zone = '[ZONE]'; + + get_iam_policy_sample($project, $resource, $zone); +} +// [END compute_v1_generated_Reservations_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/insert.php new file mode 100644 index 000000000000..4b1a340950ee --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/insert.php @@ -0,0 +1,80 @@ +insert($project, $reservationResource, $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 +{ + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + insert_sample($project, $zone); +} +// [END compute_v1_generated_Reservations_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/list.php new file mode 100644 index 000000000000..12b492ad17a3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/list.php @@ -0,0 +1,70 @@ +list($project, $zone); + + 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]'; + $zone = '[ZONE]'; + + list_sample($project, $zone); +} +// [END compute_v1_generated_Reservations_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/resize.php b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/resize.php new file mode 100644 index 000000000000..0273ca6cf46d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/resize.php @@ -0,0 +1,87 @@ +resize( + $project, + $reservation, + $reservationsResizeRequestResource, + $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 +{ + $project = '[PROJECT]'; + $reservation = '[RESERVATION]'; + $zone = '[ZONE]'; + + resize_sample($project, $reservation, $zone); +} +// [END compute_v1_generated_Reservations_Resize_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/set_iam_policy.php new file mode 100644 index 000000000000..97a2545b68fc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/set_iam_policy.php @@ -0,0 +1,78 @@ +setIamPolicy( + $project, + $resource, + $zone, + $zoneSetPolicyRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + $zone = '[ZONE]'; + + set_iam_policy_sample($project, $resource, $zone); +} +// [END compute_v1_generated_Reservations_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/test_iam_permissions.php new file mode 100644 index 000000000000..d8c047d2be23 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +testIamPermissions( + $project, + $resource, + $testPermissionsRequestResource, + $zone + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + $zone = '[ZONE]'; + + test_iam_permissions_sample($project, $resource, $zone); +} +// [END compute_v1_generated_Reservations_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/update.php b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/update.php new file mode 100644 index 000000000000..56edf907a800 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/update.php @@ -0,0 +1,82 @@ +update($project, $reservation, $reservationResource, $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 +{ + $project = '[PROJECT]'; + $reservation = '[RESERVATION]'; + $zone = '[ZONE]'; + + update_sample($project, $reservation, $zone); +} +// [END compute_v1_generated_Reservations_Update_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/aggregated_list.php new file mode 100644 index 000000000000..342ddfffaea0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/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_ResourcePolicies_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/delete.php new file mode 100644 index 000000000000..89b2c52896d8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/delete.php @@ -0,0 +1,78 @@ +delete($project, $region, $resourcePolicy); + $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]'; + $resourcePolicy = '[RESOURCE_POLICY]'; + + delete_sample($project, $region, $resourcePolicy); +} +// [END compute_v1_generated_ResourcePolicies_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/get.php new file mode 100644 index 000000000000..b660c1a810ae --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/get.php @@ -0,0 +1,69 @@ +get($project, $region, $resourcePolicy); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resourcePolicy = '[RESOURCE_POLICY]'; + + get_sample($project, $region, $resourcePolicy); +} +// [END compute_v1_generated_ResourcePolicies_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/get_iam_policy.php new file mode 100644 index 000000000000..7bad0bea7453 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/get_iam_policy.php @@ -0,0 +1,69 @@ +getIamPolicy($project, $region, $resource); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + get_iam_policy_sample($project, $region, $resource); +} +// [END compute_v1_generated_ResourcePolicies_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/insert.php new file mode 100644 index 000000000000..0d4ba5599049 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/insert.php @@ -0,0 +1,80 @@ +insert($project, $region, $resourcePolicyResource); + $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_ResourcePolicies_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/list.php new file mode 100644 index 000000000000..07ff8bb0bf4a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/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_ResourcePolicies_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/patch.php new file mode 100644 index 000000000000..f734b8f10112 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/patch.php @@ -0,0 +1,87 @@ +patch( + $project, + $region, + $resourcePolicy, + $resourcePolicyResource + ); + $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]'; + $resourcePolicy = '[RESOURCE_POLICY]'; + + patch_sample($project, $region, $resourcePolicy); +} +// [END compute_v1_generated_ResourcePolicies_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/set_iam_policy.php new file mode 100644 index 000000000000..a4e93922d45c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/set_iam_policy.php @@ -0,0 +1,78 @@ +setIamPolicy( + $project, + $region, + $regionSetPolicyRequestResource, + $resource + ); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + set_iam_policy_sample($project, $region, $resource); +} +// [END compute_v1_generated_ResourcePolicies_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/test_iam_permissions.php new file mode 100644 index 000000000000..aad19cbea206 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +testIamPermissions( + $project, + $region, + $resource, + $testPermissionsRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + test_iam_permissions_sample($project, $region, $resource); +} +// [END compute_v1_generated_ResourcePolicies_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/aggregated_list.php new file mode 100644 index 000000000000..6e67e03c9729 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/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_Routers_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/delete.php new file mode 100644 index 000000000000..18ab364f1c50 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/delete.php @@ -0,0 +1,78 @@ +delete($project, $region, $router); + $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]'; + $router = '[ROUTER]'; + + delete_sample($project, $region, $router); +} +// [END compute_v1_generated_Routers_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/get.php new file mode 100644 index 000000000000..35a880c2dcfa --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/get.php @@ -0,0 +1,69 @@ +get($project, $region, $router); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $router = '[ROUTER]'; + + get_sample($project, $region, $router); +} +// [END compute_v1_generated_Routers_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/get_nat_ip_info.php b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/get_nat_ip_info.php new file mode 100644 index 000000000000..89a5f508ca3c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/get_nat_ip_info.php @@ -0,0 +1,69 @@ +getNatIpInfo($project, $region, $router); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $router = '[ROUTER]'; + + get_nat_ip_info_sample($project, $region, $router); +} +// [END compute_v1_generated_Routers_GetNatIpInfo_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/get_nat_mapping_info.php b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/get_nat_mapping_info.php new file mode 100644 index 000000000000..17683f0c0273 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/get_nat_mapping_info.php @@ -0,0 +1,72 @@ +getNatMappingInfo($project, $region, $router); + + 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]'; + $router = '[ROUTER]'; + + get_nat_mapping_info_sample($project, $region, $router); +} +// [END compute_v1_generated_Routers_GetNatMappingInfo_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/get_router_status.php b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/get_router_status.php new file mode 100644 index 000000000000..e66637d8a479 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/get_router_status.php @@ -0,0 +1,69 @@ +getRouterStatus($project, $region, $router); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $router = '[ROUTER]'; + + get_router_status_sample($project, $region, $router); +} +// [END compute_v1_generated_Routers_GetRouterStatus_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/insert.php new file mode 100644 index 000000000000..0480956b1e55 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/insert.php @@ -0,0 +1,80 @@ +insert($project, $region, $routerResource); + $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_Routers_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/list.php new file mode 100644 index 000000000000..0ef548a404c5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/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_Routers_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/patch.php new file mode 100644 index 000000000000..743c3679ff9f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/patch.php @@ -0,0 +1,82 @@ +patch($project, $region, $router, $routerResource); + $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]'; + $router = '[ROUTER]'; + + patch_sample($project, $region, $router); +} +// [END compute_v1_generated_Routers_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/preview.php b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/preview.php new file mode 100644 index 000000000000..b7afa3850614 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/preview.php @@ -0,0 +1,73 @@ +preview($project, $region, $router, $routerResource); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $router = '[ROUTER]'; + + preview_sample($project, $region, $router); +} +// [END compute_v1_generated_Routers_Preview_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/update.php b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/update.php new file mode 100644 index 000000000000..016bd3400ae6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/update.php @@ -0,0 +1,82 @@ +update($project, $region, $router, $routerResource); + $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]'; + $router = '[ROUTER]'; + + update_sample($project, $region, $router); +} +// [END compute_v1_generated_Routers_Update_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RoutesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/RoutesClient/delete.php new file mode 100644 index 000000000000..7d78b0d29787 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutesClient/delete.php @@ -0,0 +1,76 @@ +delete($project, $route); + $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]'; + $route = '[ROUTE]'; + + delete_sample($project, $route); +} +// [END compute_v1_generated_Routes_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RoutesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/RoutesClient/get.php new file mode 100644 index 000000000000..fc1f97d82953 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutesClient/get.php @@ -0,0 +1,67 @@ +get($project, $route); + 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 +{ + $project = '[PROJECT]'; + $route = '[ROUTE]'; + + get_sample($project, $route); +} +// [END compute_v1_generated_Routes_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RoutesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/RoutesClient/insert.php new file mode 100644 index 000000000000..d38907d9300c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutesClient/insert.php @@ -0,0 +1,78 @@ +insert($project, $routeResource); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_Routes_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RoutesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/RoutesClient/list.php new file mode 100644 index 000000000000..b9a1648891a3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutesClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_Routes_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/add_rule.php b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/add_rule.php new file mode 100644 index 000000000000..42013569e279 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/add_rule.php @@ -0,0 +1,84 @@ +addRule( + $project, + $securityPolicy, + $securityPolicyRuleResource + ); + $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]'; + $securityPolicy = '[SECURITY_POLICY]'; + + add_rule_sample($project, $securityPolicy); +} +// [END compute_v1_generated_SecurityPolicies_AddRule_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/aggregated_list.php new file mode 100644 index 000000000000..e294f6d04341 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/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_SecurityPolicies_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/delete.php new file mode 100644 index 000000000000..304913cd2f55 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/delete.php @@ -0,0 +1,76 @@ +delete($project, $securityPolicy); + $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]'; + $securityPolicy = '[SECURITY_POLICY]'; + + delete_sample($project, $securityPolicy); +} +// [END compute_v1_generated_SecurityPolicies_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/get.php new file mode 100644 index 000000000000..3a055462f0c2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/get.php @@ -0,0 +1,67 @@ +get($project, $securityPolicy); + 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 +{ + $project = '[PROJECT]'; + $securityPolicy = '[SECURITY_POLICY]'; + + get_sample($project, $securityPolicy); +} +// [END compute_v1_generated_SecurityPolicies_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/get_rule.php b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/get_rule.php new file mode 100644 index 000000000000..5ac3d4a1f16f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/get_rule.php @@ -0,0 +1,67 @@ +getRule($project, $securityPolicy); + 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 +{ + $project = '[PROJECT]'; + $securityPolicy = '[SECURITY_POLICY]'; + + get_rule_sample($project, $securityPolicy); +} +// [END compute_v1_generated_SecurityPolicies_GetRule_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/insert.php new file mode 100644 index 000000000000..ee77131c6db3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/insert.php @@ -0,0 +1,78 @@ +insert($project, $securityPolicyResource); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_SecurityPolicies_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/list.php new file mode 100644 index 000000000000..150cc2c2bf03 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_SecurityPolicies_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/list_preconfigured_expression_sets.php b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/list_preconfigured_expression_sets.php new file mode 100644 index 000000000000..84e63d266bf5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/list_preconfigured_expression_sets.php @@ -0,0 +1,65 @@ +listPreconfiguredExpressionSets($project); + 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 +{ + $project = '[PROJECT]'; + + list_preconfigured_expression_sets_sample($project); +} +// [END compute_v1_generated_SecurityPolicies_ListPreconfiguredExpressionSets_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/patch.php new file mode 100644 index 000000000000..3c5457f56afc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/patch.php @@ -0,0 +1,80 @@ +patch($project, $securityPolicy, $securityPolicyResource); + $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]'; + $securityPolicy = '[SECURITY_POLICY]'; + + patch_sample($project, $securityPolicy); +} +// [END compute_v1_generated_SecurityPolicies_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/patch_rule.php b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/patch_rule.php new file mode 100644 index 000000000000..711e25ceff38 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/patch_rule.php @@ -0,0 +1,84 @@ +patchRule( + $project, + $securityPolicy, + $securityPolicyRuleResource + ); + $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]'; + $securityPolicy = '[SECURITY_POLICY]'; + + patch_rule_sample($project, $securityPolicy); +} +// [END compute_v1_generated_SecurityPolicies_PatchRule_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/remove_rule.php b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/remove_rule.php new file mode 100644 index 000000000000..96ed533922e7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/remove_rule.php @@ -0,0 +1,76 @@ +removeRule($project, $securityPolicy); + $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]'; + $securityPolicy = '[SECURITY_POLICY]'; + + remove_rule_sample($project, $securityPolicy); +} +// [END compute_v1_generated_SecurityPolicies_RemoveRule_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/set_labels.php b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/set_labels.php new file mode 100644 index 000000000000..ad5cc23e2ab9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/set_labels.php @@ -0,0 +1,84 @@ +setLabels( + $globalSetLabelsRequestResource, + $project, + $resource + ); + $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]'; + $resource = '[RESOURCE]'; + + set_labels_sample($project, $resource); +} +// [END compute_v1_generated_SecurityPolicies_SetLabels_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/aggregated_list.php new file mode 100644 index 000000000000..072afbed4f95 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/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_ServiceAttachments_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/delete.php new file mode 100644 index 000000000000..b49a5610d3ee --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/delete.php @@ -0,0 +1,78 @@ +delete($project, $region, $serviceAttachment); + $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]'; + $serviceAttachment = '[SERVICE_ATTACHMENT]'; + + delete_sample($project, $region, $serviceAttachment); +} +// [END compute_v1_generated_ServiceAttachments_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/get.php new file mode 100644 index 000000000000..204c3f235f4d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/get.php @@ -0,0 +1,69 @@ +get($project, $region, $serviceAttachment); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $serviceAttachment = '[SERVICE_ATTACHMENT]'; + + get_sample($project, $region, $serviceAttachment); +} +// [END compute_v1_generated_ServiceAttachments_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/get_iam_policy.php new file mode 100644 index 000000000000..df92c18ced06 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/get_iam_policy.php @@ -0,0 +1,69 @@ +getIamPolicy($project, $region, $resource); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + get_iam_policy_sample($project, $region, $resource); +} +// [END compute_v1_generated_ServiceAttachments_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/insert.php new file mode 100644 index 000000000000..d20db72ceb4c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/insert.php @@ -0,0 +1,80 @@ +insert($project, $region, $serviceAttachmentResource); + $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_ServiceAttachments_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/list.php new file mode 100644 index 000000000000..33d70101c631 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/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_ServiceAttachments_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/patch.php new file mode 100644 index 000000000000..39908dddefc3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/patch.php @@ -0,0 +1,87 @@ +patch( + $project, + $region, + $serviceAttachment, + $serviceAttachmentResource + ); + $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]'; + $serviceAttachment = '[SERVICE_ATTACHMENT]'; + + patch_sample($project, $region, $serviceAttachment); +} +// [END compute_v1_generated_ServiceAttachments_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/set_iam_policy.php new file mode 100644 index 000000000000..221147f00349 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/set_iam_policy.php @@ -0,0 +1,78 @@ +setIamPolicy( + $project, + $region, + $regionSetPolicyRequestResource, + $resource + ); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + set_iam_policy_sample($project, $region, $resource); +} +// [END compute_v1_generated_ServiceAttachments_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/test_iam_permissions.php new file mode 100644 index 000000000000..9aab33c5cc77 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +testIamPermissions( + $project, + $region, + $resource, + $testPermissionsRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + test_iam_permissions_sample($project, $region, $resource); +} +// [END compute_v1_generated_ServiceAttachments_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SnapshotSettingsServiceClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/SnapshotSettingsServiceClient/get.php new file mode 100644 index 000000000000..7cabaafa424b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SnapshotSettingsServiceClient/get.php @@ -0,0 +1,65 @@ +get($project); + 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 +{ + $project = '[PROJECT]'; + + get_sample($project); +} +// [END compute_v1_generated_SnapshotSettingsService_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SnapshotSettingsServiceClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/SnapshotSettingsServiceClient/patch.php new file mode 100644 index 000000000000..4bb43c365c37 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SnapshotSettingsServiceClient/patch.php @@ -0,0 +1,78 @@ +patch($project, $snapshotSettingsResource); + $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]'; + + patch_sample($project); +} +// [END compute_v1_generated_SnapshotSettingsService_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/delete.php new file mode 100644 index 000000000000..f36bc68bac0e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/delete.php @@ -0,0 +1,76 @@ +delete($project, $snapshot); + $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]'; + $snapshot = '[SNAPSHOT]'; + + delete_sample($project, $snapshot); +} +// [END compute_v1_generated_Snapshots_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/get.php new file mode 100644 index 000000000000..52a54d0212f9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/get.php @@ -0,0 +1,67 @@ +get($project, $snapshot); + 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 +{ + $project = '[PROJECT]'; + $snapshot = '[SNAPSHOT]'; + + get_sample($project, $snapshot); +} +// [END compute_v1_generated_Snapshots_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/get_iam_policy.php new file mode 100644 index 000000000000..db52b51244ef --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/get_iam_policy.php @@ -0,0 +1,67 @@ +getIamPolicy($project, $resource); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + get_iam_policy_sample($project, $resource); +} +// [END compute_v1_generated_Snapshots_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/insert.php new file mode 100644 index 000000000000..d2a18965110f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/insert.php @@ -0,0 +1,78 @@ +insert($project, $snapshotResource); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_Snapshots_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/list.php new file mode 100644 index 000000000000..cddc3ad62411 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_Snapshots_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/set_iam_policy.php new file mode 100644 index 000000000000..e94a8a965367 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/set_iam_policy.php @@ -0,0 +1,71 @@ +setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + set_iam_policy_sample($project, $resource); +} +// [END compute_v1_generated_Snapshots_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/set_labels.php b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/set_labels.php new file mode 100644 index 000000000000..88e47cc9d316 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/set_labels.php @@ -0,0 +1,80 @@ +setLabels($globalSetLabelsRequestResource, $project, $resource); + $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]'; + $resource = '[RESOURCE]'; + + set_labels_sample($project, $resource); +} +// [END compute_v1_generated_Snapshots_SetLabels_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/test_iam_permissions.php new file mode 100644 index 000000000000..9aaf520fc54c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/test_iam_permissions.php @@ -0,0 +1,75 @@ +testIamPermissions( + $project, + $resource, + $testPermissionsRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + + test_iam_permissions_sample($project, $resource); +} +// [END compute_v1_generated_Snapshots_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/aggregated_list.php new file mode 100644 index 000000000000..91c7e88a76d6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/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_SslCertificates_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/delete.php new file mode 100644 index 000000000000..2a006b8d08f0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/delete.php @@ -0,0 +1,76 @@ +delete($project, $sslCertificate); + $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]'; + $sslCertificate = '[SSL_CERTIFICATE]'; + + delete_sample($project, $sslCertificate); +} +// [END compute_v1_generated_SslCertificates_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/get.php new file mode 100644 index 000000000000..f7397f7dfb81 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/get.php @@ -0,0 +1,67 @@ +get($project, $sslCertificate); + 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 +{ + $project = '[PROJECT]'; + $sslCertificate = '[SSL_CERTIFICATE]'; + + get_sample($project, $sslCertificate); +} +// [END compute_v1_generated_SslCertificates_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/insert.php new file mode 100644 index 000000000000..dc3f7cd60bcd --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/insert.php @@ -0,0 +1,78 @@ +insert($project, $sslCertificateResource); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_SslCertificates_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/list.php new file mode 100644 index 000000000000..8df6ed8bc401 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_SslCertificates_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/aggregated_list.php new file mode 100644 index 000000000000..fd704c31cbfa --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/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_SslPolicies_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/delete.php new file mode 100644 index 000000000000..d844cc918fde --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/delete.php @@ -0,0 +1,76 @@ +delete($project, $sslPolicy); + $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]'; + $sslPolicy = '[SSL_POLICY]'; + + delete_sample($project, $sslPolicy); +} +// [END compute_v1_generated_SslPolicies_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/get.php new file mode 100644 index 000000000000..038e0763b64c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/get.php @@ -0,0 +1,67 @@ +get($project, $sslPolicy); + 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 +{ + $project = '[PROJECT]'; + $sslPolicy = '[SSL_POLICY]'; + + get_sample($project, $sslPolicy); +} +// [END compute_v1_generated_SslPolicies_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/insert.php new file mode 100644 index 000000000000..b11b25c4fe68 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/insert.php @@ -0,0 +1,78 @@ +insert($project, $sslPolicyResource); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_SslPolicies_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/list.php new file mode 100644 index 000000000000..10d7a9ea46bd --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_SslPolicies_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/list_available_features.php b/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/list_available_features.php new file mode 100644 index 000000000000..6ce6f892fe18 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/list_available_features.php @@ -0,0 +1,65 @@ +listAvailableFeatures($project); + 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 +{ + $project = '[PROJECT]'; + + list_available_features_sample($project); +} +// [END compute_v1_generated_SslPolicies_ListAvailableFeatures_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/patch.php new file mode 100644 index 000000000000..21306767883f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/patch.php @@ -0,0 +1,80 @@ +patch($project, $sslPolicy, $sslPolicyResource); + $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]'; + $sslPolicy = '[SSL_POLICY]'; + + patch_sample($project, $sslPolicy); +} +// [END compute_v1_generated_SslPolicies_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/StoragePoolTypesClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolTypesClient/aggregated_list.php new file mode 100644 index 000000000000..3433f29781e1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolTypesClient/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_StoragePoolTypes_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/StoragePoolTypesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolTypesClient/get.php new file mode 100644 index 000000000000..13112067289f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolTypesClient/get.php @@ -0,0 +1,69 @@ +get($project, $storagePoolType, $zone); + 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 +{ + $project = '[PROJECT]'; + $storagePoolType = '[STORAGE_POOL_TYPE]'; + $zone = '[ZONE]'; + + get_sample($project, $storagePoolType, $zone); +} +// [END compute_v1_generated_StoragePoolTypes_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/StoragePoolTypesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolTypesClient/list.php new file mode 100644 index 000000000000..a21a0947a5a8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolTypesClient/list.php @@ -0,0 +1,70 @@ +list($project, $zone); + + 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]'; + $zone = '[ZONE]'; + + list_sample($project, $zone); +} +// [END compute_v1_generated_StoragePoolTypes_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/aggregated_list.php new file mode 100644 index 000000000000..b5c86c924463 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/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_StoragePools_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/delete.php new file mode 100644 index 000000000000..190e28a52b7e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/delete.php @@ -0,0 +1,78 @@ +delete($project, $storagePool, $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 +{ + $project = '[PROJECT]'; + $storagePool = '[STORAGE_POOL]'; + $zone = '[ZONE]'; + + delete_sample($project, $storagePool, $zone); +} +// [END compute_v1_generated_StoragePools_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/get.php new file mode 100644 index 000000000000..41174f76f0f8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/get.php @@ -0,0 +1,69 @@ +get($project, $storagePool, $zone); + 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 +{ + $project = '[PROJECT]'; + $storagePool = '[STORAGE_POOL]'; + $zone = '[ZONE]'; + + get_sample($project, $storagePool, $zone); +} +// [END compute_v1_generated_StoragePools_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/get_iam_policy.php new file mode 100644 index 000000000000..17860c59fff9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/get_iam_policy.php @@ -0,0 +1,69 @@ +getIamPolicy($project, $resource, $zone); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + $zone = '[ZONE]'; + + get_iam_policy_sample($project, $resource, $zone); +} +// [END compute_v1_generated_StoragePools_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/insert.php new file mode 100644 index 000000000000..42a79ce37a24 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/insert.php @@ -0,0 +1,80 @@ +insert($project, $storagePoolResource, $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 +{ + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + insert_sample($project, $zone); +} +// [END compute_v1_generated_StoragePools_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/list.php new file mode 100644 index 000000000000..56998977d58f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/list.php @@ -0,0 +1,67 @@ +list($project, $zone); + 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 +{ + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + list_sample($project, $zone); +} +// [END compute_v1_generated_StoragePools_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/list_disks.php b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/list_disks.php new file mode 100644 index 000000000000..c29debf06152 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/list_disks.php @@ -0,0 +1,69 @@ +listDisks($project, $storagePool, $zone); + 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 +{ + $project = '[PROJECT]'; + $storagePool = '[STORAGE_POOL]'; + $zone = '[ZONE]'; + + list_disks_sample($project, $storagePool, $zone); +} +// [END compute_v1_generated_StoragePools_ListDisks_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/set_iam_policy.php new file mode 100644 index 000000000000..26c4568415b1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/set_iam_policy.php @@ -0,0 +1,78 @@ +setIamPolicy( + $project, + $resource, + $zone, + $zoneSetPolicyRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + $zone = '[ZONE]'; + + set_iam_policy_sample($project, $resource, $zone); +} +// [END compute_v1_generated_StoragePools_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/test_iam_permissions.php new file mode 100644 index 000000000000..cc205dd335fd --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +testIamPermissions( + $project, + $resource, + $testPermissionsRequestResource, + $zone + ); + 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 +{ + $project = '[PROJECT]'; + $resource = '[RESOURCE]'; + $zone = '[ZONE]'; + + test_iam_permissions_sample($project, $resource, $zone); +} +// [END compute_v1_generated_StoragePools_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/update.php b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/update.php new file mode 100644 index 000000000000..0056fd9dac69 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/update.php @@ -0,0 +1,82 @@ +update($project, $storagePool, $storagePoolResource, $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 +{ + $project = '[PROJECT]'; + $storagePool = '[STORAGE_POOL]'; + $zone = '[ZONE]'; + + update_sample($project, $storagePool, $zone); +} +// [END compute_v1_generated_StoragePools_Update_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/aggregated_list.php new file mode 100644 index 000000000000..ad5119e39f9a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/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_Subnetworks_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/delete.php new file mode 100644 index 000000000000..03be2e297416 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/delete.php @@ -0,0 +1,78 @@ +delete($project, $region, $subnetwork); + $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]'; + $subnetwork = '[SUBNETWORK]'; + + delete_sample($project, $region, $subnetwork); +} +// [END compute_v1_generated_Subnetworks_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/expand_ip_cidr_range.php b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/expand_ip_cidr_range.php new file mode 100644 index 000000000000..346244367d6a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/expand_ip_cidr_range.php @@ -0,0 +1,87 @@ +expandIpCidrRange( + $project, + $region, + $subnetwork, + $subnetworksExpandIpCidrRangeRequestResource + ); + $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]'; + $subnetwork = '[SUBNETWORK]'; + + expand_ip_cidr_range_sample($project, $region, $subnetwork); +} +// [END compute_v1_generated_Subnetworks_ExpandIpCidrRange_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/get.php new file mode 100644 index 000000000000..bc1ceaab345f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/get.php @@ -0,0 +1,69 @@ +get($project, $region, $subnetwork); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $subnetwork = '[SUBNETWORK]'; + + get_sample($project, $region, $subnetwork); +} +// [END compute_v1_generated_Subnetworks_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/get_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/get_iam_policy.php new file mode 100644 index 000000000000..83077d929f53 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/get_iam_policy.php @@ -0,0 +1,69 @@ +getIamPolicy($project, $region, $resource); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + get_iam_policy_sample($project, $region, $resource); +} +// [END compute_v1_generated_Subnetworks_GetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/insert.php new file mode 100644 index 000000000000..b0ebbb26ac72 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/insert.php @@ -0,0 +1,80 @@ +insert($project, $region, $subnetworkResource); + $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_Subnetworks_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/list.php new file mode 100644 index 000000000000..cd9bae47a1e4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/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_Subnetworks_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/list_usable.php b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/list_usable.php new file mode 100644 index 000000000000..0ad1dabadc04 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/list_usable.php @@ -0,0 +1,68 @@ +listUsable($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]'; + + list_usable_sample($project); +} +// [END compute_v1_generated_Subnetworks_ListUsable_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/patch.php new file mode 100644 index 000000000000..5023f61825ab --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/patch.php @@ -0,0 +1,82 @@ +patch($project, $region, $subnetwork, $subnetworkResource); + $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]'; + $subnetwork = '[SUBNETWORK]'; + + patch_sample($project, $region, $subnetwork); +} +// [END compute_v1_generated_Subnetworks_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/set_iam_policy.php b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/set_iam_policy.php new file mode 100644 index 000000000000..a0935ccee596 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/set_iam_policy.php @@ -0,0 +1,78 @@ +setIamPolicy( + $project, + $region, + $regionSetPolicyRequestResource, + $resource + ); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + set_iam_policy_sample($project, $region, $resource); +} +// [END compute_v1_generated_Subnetworks_SetIamPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/set_private_ip_google_access.php b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/set_private_ip_google_access.php new file mode 100644 index 000000000000..84adcd7c37a2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/set_private_ip_google_access.php @@ -0,0 +1,90 @@ +setPrivateIpGoogleAccess( + $project, + $region, + $subnetwork, + $subnetworksSetPrivateIpGoogleAccessRequestResource + ); + $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]'; + $subnetwork = '[SUBNETWORK]'; + + set_private_ip_google_access_sample($project, $region, $subnetwork); +} +// [END compute_v1_generated_Subnetworks_SetPrivateIpGoogleAccess_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/test_iam_permissions.php new file mode 100644 index 000000000000..673f77cbca01 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +testIamPermissions( + $project, + $region, + $resource, + $testPermissionsRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + test_iam_permissions_sample($project, $region, $resource); +} +// [END compute_v1_generated_Subnetworks_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/delete.php new file mode 100644 index 000000000000..3b050700bca4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/delete.php @@ -0,0 +1,76 @@ +delete($project, $targetGrpcProxy); + $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]'; + $targetGrpcProxy = '[TARGET_GRPC_PROXY]'; + + delete_sample($project, $targetGrpcProxy); +} +// [END compute_v1_generated_TargetGrpcProxies_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/get.php new file mode 100644 index 000000000000..bb9a321e27b4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/get.php @@ -0,0 +1,67 @@ +get($project, $targetGrpcProxy); + 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 +{ + $project = '[PROJECT]'; + $targetGrpcProxy = '[TARGET_GRPC_PROXY]'; + + get_sample($project, $targetGrpcProxy); +} +// [END compute_v1_generated_TargetGrpcProxies_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/insert.php new file mode 100644 index 000000000000..ee55374e7fca --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/insert.php @@ -0,0 +1,78 @@ +insert($project, $targetGrpcProxyResource); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_TargetGrpcProxies_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/list.php new file mode 100644 index 000000000000..c34ca24782c1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_TargetGrpcProxies_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/patch.php new file mode 100644 index 000000000000..f67e8d5c2372 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/patch.php @@ -0,0 +1,80 @@ +patch($project, $targetGrpcProxy, $targetGrpcProxyResource); + $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]'; + $targetGrpcProxy = '[TARGET_GRPC_PROXY]'; + + patch_sample($project, $targetGrpcProxy); +} +// [END compute_v1_generated_TargetGrpcProxies_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/aggregated_list.php new file mode 100644 index 000000000000..0fba2c7b2c0f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/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_TargetHttpProxies_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/delete.php new file mode 100644 index 000000000000..de8dd43a2721 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/delete.php @@ -0,0 +1,76 @@ +delete($project, $targetHttpProxy); + $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]'; + $targetHttpProxy = '[TARGET_HTTP_PROXY]'; + + delete_sample($project, $targetHttpProxy); +} +// [END compute_v1_generated_TargetHttpProxies_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/get.php new file mode 100644 index 000000000000..f6a37b772378 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/get.php @@ -0,0 +1,67 @@ +get($project, $targetHttpProxy); + 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 +{ + $project = '[PROJECT]'; + $targetHttpProxy = '[TARGET_HTTP_PROXY]'; + + get_sample($project, $targetHttpProxy); +} +// [END compute_v1_generated_TargetHttpProxies_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/insert.php new file mode 100644 index 000000000000..3ba8a1ae1d19 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/insert.php @@ -0,0 +1,78 @@ +insert($project, $targetHttpProxyResource); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_TargetHttpProxies_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/list.php new file mode 100644 index 000000000000..b459e2143330 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_TargetHttpProxies_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/patch.php new file mode 100644 index 000000000000..1171df8c81d7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/patch.php @@ -0,0 +1,80 @@ +patch($project, $targetHttpProxy, $targetHttpProxyResource); + $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]'; + $targetHttpProxy = '[TARGET_HTTP_PROXY]'; + + patch_sample($project, $targetHttpProxy); +} +// [END compute_v1_generated_TargetHttpProxies_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/set_url_map.php b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/set_url_map.php new file mode 100644 index 000000000000..e5f89a759782 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/set_url_map.php @@ -0,0 +1,84 @@ +setUrlMap( + $project, + $targetHttpProxy, + $urlMapReferenceResource + ); + $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]'; + $targetHttpProxy = '[TARGET_HTTP_PROXY]'; + + set_url_map_sample($project, $targetHttpProxy); +} +// [END compute_v1_generated_TargetHttpProxies_SetUrlMap_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/aggregated_list.php new file mode 100644 index 000000000000..89480c5df762 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/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_TargetHttpsProxies_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/delete.php new file mode 100644 index 000000000000..a83f927a4f96 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/delete.php @@ -0,0 +1,76 @@ +delete($project, $targetHttpsProxy); + $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]'; + $targetHttpsProxy = '[TARGET_HTTPS_PROXY]'; + + delete_sample($project, $targetHttpsProxy); +} +// [END compute_v1_generated_TargetHttpsProxies_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/get.php new file mode 100644 index 000000000000..ed239599e40f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/get.php @@ -0,0 +1,67 @@ +get($project, $targetHttpsProxy); + 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 +{ + $project = '[PROJECT]'; + $targetHttpsProxy = '[TARGET_HTTPS_PROXY]'; + + get_sample($project, $targetHttpsProxy); +} +// [END compute_v1_generated_TargetHttpsProxies_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/insert.php new file mode 100644 index 000000000000..9575f17ec44a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/insert.php @@ -0,0 +1,78 @@ +insert($project, $targetHttpsProxyResource); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_TargetHttpsProxies_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/list.php new file mode 100644 index 000000000000..7bb9bb29612a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_TargetHttpsProxies_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/patch.php new file mode 100644 index 000000000000..efac104eeb31 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/patch.php @@ -0,0 +1,84 @@ +patch( + $project, + $targetHttpsProxy, + $targetHttpsProxyResource + ); + $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]'; + $targetHttpsProxy = '[TARGET_HTTPS_PROXY]'; + + patch_sample($project, $targetHttpsProxy); +} +// [END compute_v1_generated_TargetHttpsProxies_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_certificate_map.php b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_certificate_map.php new file mode 100644 index 000000000000..61e20ad3c0f4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_certificate_map.php @@ -0,0 +1,84 @@ +setCertificateMap( + $project, + $targetHttpsProxiesSetCertificateMapRequestResource, + $targetHttpsProxy + ); + $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]'; + $targetHttpsProxy = '[TARGET_HTTPS_PROXY]'; + + set_certificate_map_sample($project, $targetHttpsProxy); +} +// [END compute_v1_generated_TargetHttpsProxies_SetCertificateMap_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_quic_override.php b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_quic_override.php new file mode 100644 index 000000000000..d359a46f07be --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_quic_override.php @@ -0,0 +1,84 @@ +setQuicOverride( + $project, + $targetHttpsProxiesSetQuicOverrideRequestResource, + $targetHttpsProxy + ); + $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]'; + $targetHttpsProxy = '[TARGET_HTTPS_PROXY]'; + + set_quic_override_sample($project, $targetHttpsProxy); +} +// [END compute_v1_generated_TargetHttpsProxies_SetQuicOverride_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_ssl_certificates.php b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_ssl_certificates.php new file mode 100644 index 000000000000..fedd0ee37ead --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_ssl_certificates.php @@ -0,0 +1,84 @@ +setSslCertificates( + $project, + $targetHttpsProxiesSetSslCertificatesRequestResource, + $targetHttpsProxy + ); + $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]'; + $targetHttpsProxy = '[TARGET_HTTPS_PROXY]'; + + set_ssl_certificates_sample($project, $targetHttpsProxy); +} +// [END compute_v1_generated_TargetHttpsProxies_SetSslCertificates_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_ssl_policy.php b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_ssl_policy.php new file mode 100644 index 000000000000..a57510744f50 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_ssl_policy.php @@ -0,0 +1,84 @@ +setSslPolicy( + $project, + $sslPolicyReferenceResource, + $targetHttpsProxy + ); + $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]'; + $targetHttpsProxy = '[TARGET_HTTPS_PROXY]'; + + set_ssl_policy_sample($project, $targetHttpsProxy); +} +// [END compute_v1_generated_TargetHttpsProxies_SetSslPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_url_map.php b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_url_map.php new file mode 100644 index 000000000000..8dbcb9487630 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_url_map.php @@ -0,0 +1,84 @@ +setUrlMap( + $project, + $targetHttpsProxy, + $urlMapReferenceResource + ); + $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]'; + $targetHttpsProxy = '[TARGET_HTTPS_PROXY]'; + + set_url_map_sample($project, $targetHttpsProxy); +} +// [END compute_v1_generated_TargetHttpsProxies_SetUrlMap_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/aggregated_list.php new file mode 100644 index 000000000000..43df08d9bc92 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/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_TargetInstances_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/delete.php new file mode 100644 index 000000000000..3fb3f01c3b5b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/delete.php @@ -0,0 +1,78 @@ +delete($project, $targetInstance, $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 +{ + $project = '[PROJECT]'; + $targetInstance = '[TARGET_INSTANCE]'; + $zone = '[ZONE]'; + + delete_sample($project, $targetInstance, $zone); +} +// [END compute_v1_generated_TargetInstances_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/get.php new file mode 100644 index 000000000000..a48896d05e93 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/get.php @@ -0,0 +1,69 @@ +get($project, $targetInstance, $zone); + 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 +{ + $project = '[PROJECT]'; + $targetInstance = '[TARGET_INSTANCE]'; + $zone = '[ZONE]'; + + get_sample($project, $targetInstance, $zone); +} +// [END compute_v1_generated_TargetInstances_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/insert.php new file mode 100644 index 000000000000..cf49de8c2d1c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/insert.php @@ -0,0 +1,80 @@ +insert($project, $targetInstanceResource, $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 +{ + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + insert_sample($project, $zone); +} +// [END compute_v1_generated_TargetInstances_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/list.php new file mode 100644 index 000000000000..4ab718acea99 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/list.php @@ -0,0 +1,70 @@ +list($project, $zone); + + 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]'; + $zone = '[ZONE]'; + + list_sample($project, $zone); +} +// [END compute_v1_generated_TargetInstances_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/set_security_policy.php b/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/set_security_policy.php new file mode 100644 index 000000000000..24220aa671e1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/set_security_policy.php @@ -0,0 +1,87 @@ +setSecurityPolicy( + $project, + $securityPolicyReferenceResource, + $targetInstance, + $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 +{ + $project = '[PROJECT]'; + $targetInstance = '[TARGET_INSTANCE]'; + $zone = '[ZONE]'; + + set_security_policy_sample($project, $targetInstance, $zone); +} +// [END compute_v1_generated_TargetInstances_SetSecurityPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/add_health_check.php b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/add_health_check.php new file mode 100644 index 000000000000..0591fa6761c1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/add_health_check.php @@ -0,0 +1,87 @@ +addHealthCheck( + $project, + $region, + $targetPool, + $targetPoolsAddHealthCheckRequestResource + ); + $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]'; + $targetPool = '[TARGET_POOL]'; + + add_health_check_sample($project, $region, $targetPool); +} +// [END compute_v1_generated_TargetPools_AddHealthCheck_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/add_instance.php b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/add_instance.php new file mode 100644 index 000000000000..35986e3a7e8f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/add_instance.php @@ -0,0 +1,87 @@ +addInstance( + $project, + $region, + $targetPool, + $targetPoolsAddInstanceRequestResource + ); + $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]'; + $targetPool = '[TARGET_POOL]'; + + add_instance_sample($project, $region, $targetPool); +} +// [END compute_v1_generated_TargetPools_AddInstance_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/aggregated_list.php new file mode 100644 index 000000000000..ffbb3821f104 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/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_TargetPools_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/delete.php new file mode 100644 index 000000000000..e320b869b86d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/delete.php @@ -0,0 +1,78 @@ +delete($project, $region, $targetPool); + $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]'; + $targetPool = '[TARGET_POOL]'; + + delete_sample($project, $region, $targetPool); +} +// [END compute_v1_generated_TargetPools_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/get.php new file mode 100644 index 000000000000..f69e87c9f25e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/get.php @@ -0,0 +1,69 @@ +get($project, $region, $targetPool); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $targetPool = '[TARGET_POOL]'; + + get_sample($project, $region, $targetPool); +} +// [END compute_v1_generated_TargetPools_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/get_health.php b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/get_health.php new file mode 100644 index 000000000000..327b06518958 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/get_health.php @@ -0,0 +1,78 @@ +getHealth( + $instanceReferenceResource, + $project, + $region, + $targetPool + ); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $targetPool = '[TARGET_POOL]'; + + get_health_sample($project, $region, $targetPool); +} +// [END compute_v1_generated_TargetPools_GetHealth_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/insert.php new file mode 100644 index 000000000000..9fe8ea2aa4f2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/insert.php @@ -0,0 +1,80 @@ +insert($project, $region, $targetPoolResource); + $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_TargetPools_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/list.php new file mode 100644 index 000000000000..f1f0b270d2f2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/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_TargetPools_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/remove_health_check.php b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/remove_health_check.php new file mode 100644 index 000000000000..99511d76760d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/remove_health_check.php @@ -0,0 +1,87 @@ +removeHealthCheck( + $project, + $region, + $targetPool, + $targetPoolsRemoveHealthCheckRequestResource + ); + $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]'; + $targetPool = '[TARGET_POOL]'; + + remove_health_check_sample($project, $region, $targetPool); +} +// [END compute_v1_generated_TargetPools_RemoveHealthCheck_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/remove_instance.php b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/remove_instance.php new file mode 100644 index 000000000000..cc3e3fce1e15 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/remove_instance.php @@ -0,0 +1,87 @@ +removeInstance( + $project, + $region, + $targetPool, + $targetPoolsRemoveInstanceRequestResource + ); + $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]'; + $targetPool = '[TARGET_POOL]'; + + remove_instance_sample($project, $region, $targetPool); +} +// [END compute_v1_generated_TargetPools_RemoveInstance_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/set_backup.php b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/set_backup.php new file mode 100644 index 000000000000..2bcf3689b2e4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/set_backup.php @@ -0,0 +1,82 @@ +setBackup($project, $region, $targetPool, $targetReferenceResource); + $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]'; + $targetPool = '[TARGET_POOL]'; + + set_backup_sample($project, $region, $targetPool); +} +// [END compute_v1_generated_TargetPools_SetBackup_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/set_security_policy.php b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/set_security_policy.php new file mode 100644 index 000000000000..ea9c57143674 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/set_security_policy.php @@ -0,0 +1,87 @@ +setSecurityPolicy( + $project, + $region, + $securityPolicyReferenceResource, + $targetPool + ); + $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]'; + $targetPool = '[TARGET_POOL]'; + + set_security_policy_sample($project, $region, $targetPool); +} +// [END compute_v1_generated_TargetPools_SetSecurityPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/delete.php new file mode 100644 index 000000000000..dd3cd9b5e0fc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/delete.php @@ -0,0 +1,76 @@ +delete($project, $targetSslProxy); + $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]'; + $targetSslProxy = '[TARGET_SSL_PROXY]'; + + delete_sample($project, $targetSslProxy); +} +// [END compute_v1_generated_TargetSslProxies_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/get.php new file mode 100644 index 000000000000..e3975a9e9236 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/get.php @@ -0,0 +1,67 @@ +get($project, $targetSslProxy); + 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 +{ + $project = '[PROJECT]'; + $targetSslProxy = '[TARGET_SSL_PROXY]'; + + get_sample($project, $targetSslProxy); +} +// [END compute_v1_generated_TargetSslProxies_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/insert.php new file mode 100644 index 000000000000..cf996d72db20 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/insert.php @@ -0,0 +1,78 @@ +insert($project, $targetSslProxyResource); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_TargetSslProxies_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/list.php new file mode 100644 index 000000000000..b40628b78320 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_TargetSslProxies_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_backend_service.php b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_backend_service.php new file mode 100644 index 000000000000..443a5e14913e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_backend_service.php @@ -0,0 +1,84 @@ +setBackendService( + $project, + $targetSslProxiesSetBackendServiceRequestResource, + $targetSslProxy + ); + $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]'; + $targetSslProxy = '[TARGET_SSL_PROXY]'; + + set_backend_service_sample($project, $targetSslProxy); +} +// [END compute_v1_generated_TargetSslProxies_SetBackendService_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_certificate_map.php b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_certificate_map.php new file mode 100644 index 000000000000..25d0dbb060a9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_certificate_map.php @@ -0,0 +1,84 @@ +setCertificateMap( + $project, + $targetSslProxiesSetCertificateMapRequestResource, + $targetSslProxy + ); + $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]'; + $targetSslProxy = '[TARGET_SSL_PROXY]'; + + set_certificate_map_sample($project, $targetSslProxy); +} +// [END compute_v1_generated_TargetSslProxies_SetCertificateMap_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_proxy_header.php b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_proxy_header.php new file mode 100644 index 000000000000..41f46e8bccf8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_proxy_header.php @@ -0,0 +1,84 @@ +setProxyHeader( + $project, + $targetSslProxiesSetProxyHeaderRequestResource, + $targetSslProxy + ); + $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]'; + $targetSslProxy = '[TARGET_SSL_PROXY]'; + + set_proxy_header_sample($project, $targetSslProxy); +} +// [END compute_v1_generated_TargetSslProxies_SetProxyHeader_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_ssl_certificates.php b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_ssl_certificates.php new file mode 100644 index 000000000000..8fca63fd92ff --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_ssl_certificates.php @@ -0,0 +1,84 @@ +setSslCertificates( + $project, + $targetSslProxiesSetSslCertificatesRequestResource, + $targetSslProxy + ); + $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]'; + $targetSslProxy = '[TARGET_SSL_PROXY]'; + + set_ssl_certificates_sample($project, $targetSslProxy); +} +// [END compute_v1_generated_TargetSslProxies_SetSslCertificates_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_ssl_policy.php b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_ssl_policy.php new file mode 100644 index 000000000000..957bf834d9a6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_ssl_policy.php @@ -0,0 +1,84 @@ +setSslPolicy( + $project, + $sslPolicyReferenceResource, + $targetSslProxy + ); + $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]'; + $targetSslProxy = '[TARGET_SSL_PROXY]'; + + set_ssl_policy_sample($project, $targetSslProxy); +} +// [END compute_v1_generated_TargetSslProxies_SetSslPolicy_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/aggregated_list.php new file mode 100644 index 000000000000..a10d2b2184d5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/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_TargetTcpProxies_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/delete.php new file mode 100644 index 000000000000..2b32af9d3f6d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/delete.php @@ -0,0 +1,76 @@ +delete($project, $targetTcpProxy); + $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]'; + $targetTcpProxy = '[TARGET_TCP_PROXY]'; + + delete_sample($project, $targetTcpProxy); +} +// [END compute_v1_generated_TargetTcpProxies_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/get.php new file mode 100644 index 000000000000..ec9aa125b39a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/get.php @@ -0,0 +1,67 @@ +get($project, $targetTcpProxy); + 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 +{ + $project = '[PROJECT]'; + $targetTcpProxy = '[TARGET_TCP_PROXY]'; + + get_sample($project, $targetTcpProxy); +} +// [END compute_v1_generated_TargetTcpProxies_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/insert.php new file mode 100644 index 000000000000..bfbea8752a51 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/insert.php @@ -0,0 +1,78 @@ +insert($project, $targetTcpProxyResource); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_TargetTcpProxies_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/list.php new file mode 100644 index 000000000000..4870404de24f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_TargetTcpProxies_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/set_backend_service.php b/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/set_backend_service.php new file mode 100644 index 000000000000..0696ae302164 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/set_backend_service.php @@ -0,0 +1,84 @@ +setBackendService( + $project, + $targetTcpProxiesSetBackendServiceRequestResource, + $targetTcpProxy + ); + $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]'; + $targetTcpProxy = '[TARGET_TCP_PROXY]'; + + set_backend_service_sample($project, $targetTcpProxy); +} +// [END compute_v1_generated_TargetTcpProxies_SetBackendService_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/set_proxy_header.php b/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/set_proxy_header.php new file mode 100644 index 000000000000..91a6a6131c66 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/set_proxy_header.php @@ -0,0 +1,84 @@ +setProxyHeader( + $project, + $targetTcpProxiesSetProxyHeaderRequestResource, + $targetTcpProxy + ); + $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]'; + $targetTcpProxy = '[TARGET_TCP_PROXY]'; + + set_proxy_header_sample($project, $targetTcpProxy); +} +// [END compute_v1_generated_TargetTcpProxies_SetProxyHeader_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/aggregated_list.php new file mode 100644 index 000000000000..d3d1f1a2fcc3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/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_TargetVpnGateways_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/delete.php new file mode 100644 index 000000000000..77c9038d392c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/delete.php @@ -0,0 +1,78 @@ +delete($project, $region, $targetVpnGateway); + $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]'; + $targetVpnGateway = '[TARGET_VPN_GATEWAY]'; + + delete_sample($project, $region, $targetVpnGateway); +} +// [END compute_v1_generated_TargetVpnGateways_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/get.php new file mode 100644 index 000000000000..8ba3f864119f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/get.php @@ -0,0 +1,69 @@ +get($project, $region, $targetVpnGateway); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $targetVpnGateway = '[TARGET_VPN_GATEWAY]'; + + get_sample($project, $region, $targetVpnGateway); +} +// [END compute_v1_generated_TargetVpnGateways_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/insert.php new file mode 100644 index 000000000000..178f68fb077c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/insert.php @@ -0,0 +1,80 @@ +insert($project, $region, $targetVpnGatewayResource); + $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_TargetVpnGateways_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/list.php new file mode 100644 index 000000000000..319503d8b50c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/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_TargetVpnGateways_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/set_labels.php b/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/set_labels.php new file mode 100644 index 000000000000..d42ead8bc5a6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/set_labels.php @@ -0,0 +1,87 @@ +setLabels( + $project, + $region, + $regionSetLabelsRequestResource, + $resource + ); + $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]'; + $resource = '[RESOURCE]'; + + set_labels_sample($project, $region, $resource); +} +// [END compute_v1_generated_TargetVpnGateways_SetLabels_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/aggregated_list.php new file mode 100644 index 000000000000..164a928fd180 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/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_UrlMaps_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/delete.php new file mode 100644 index 000000000000..984917f3181d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/delete.php @@ -0,0 +1,76 @@ +delete($project, $urlMap); + $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]'; + $urlMap = '[URL_MAP]'; + + delete_sample($project, $urlMap); +} +// [END compute_v1_generated_UrlMaps_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/get.php new file mode 100644 index 000000000000..7e74123d3d21 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/get.php @@ -0,0 +1,67 @@ +get($project, $urlMap); + 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 +{ + $project = '[PROJECT]'; + $urlMap = '[URL_MAP]'; + + get_sample($project, $urlMap); +} +// [END compute_v1_generated_UrlMaps_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/insert.php new file mode 100644 index 000000000000..48178e172101 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/insert.php @@ -0,0 +1,78 @@ +insert($project, $urlMapResource); + $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]'; + + insert_sample($project); +} +// [END compute_v1_generated_UrlMaps_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/invalidate_cache.php b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/invalidate_cache.php new file mode 100644 index 000000000000..06928f5de1ec --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/invalidate_cache.php @@ -0,0 +1,80 @@ +invalidateCache($cacheInvalidationRuleResource, $project, $urlMap); + $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]'; + $urlMap = '[URL_MAP]'; + + invalidate_cache_sample($project, $urlMap); +} +// [END compute_v1_generated_UrlMaps_InvalidateCache_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/list.php new file mode 100644 index 000000000000..d04e6174d553 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_UrlMaps_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/patch.php b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/patch.php new file mode 100644 index 000000000000..da762f5c90ee --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/patch.php @@ -0,0 +1,80 @@ +patch($project, $urlMap, $urlMapResource); + $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]'; + $urlMap = '[URL_MAP]'; + + patch_sample($project, $urlMap); +} +// [END compute_v1_generated_UrlMaps_Patch_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/update.php b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/update.php new file mode 100644 index 000000000000..ad28ac7f9234 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/update.php @@ -0,0 +1,80 @@ +update($project, $urlMap, $urlMapResource); + $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]'; + $urlMap = '[URL_MAP]'; + + update_sample($project, $urlMap); +} +// [END compute_v1_generated_UrlMaps_Update_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/validate.php b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/validate.php new file mode 100644 index 000000000000..fc4b8fe7705c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/validate.php @@ -0,0 +1,71 @@ +validate($project, $urlMap, $urlMapsValidateRequestResource); + 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 +{ + $project = '[PROJECT]'; + $urlMap = '[URL_MAP]'; + + validate_sample($project, $urlMap); +} +// [END compute_v1_generated_UrlMaps_Validate_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/aggregated_list.php new file mode 100644 index 000000000000..9ca70283eda9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/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_VpnGateways_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/delete.php new file mode 100644 index 000000000000..4fdb740fddfe --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/delete.php @@ -0,0 +1,78 @@ +delete($project, $region, $vpnGateway); + $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]'; + $vpnGateway = '[VPN_GATEWAY]'; + + delete_sample($project, $region, $vpnGateway); +} +// [END compute_v1_generated_VpnGateways_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/get.php new file mode 100644 index 000000000000..d4f7aea2e23c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/get.php @@ -0,0 +1,69 @@ +get($project, $region, $vpnGateway); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $vpnGateway = '[VPN_GATEWAY]'; + + get_sample($project, $region, $vpnGateway); +} +// [END compute_v1_generated_VpnGateways_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/get_status.php b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/get_status.php new file mode 100644 index 000000000000..88f7b04d20a8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/get_status.php @@ -0,0 +1,69 @@ +getStatus($project, $region, $vpnGateway); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $vpnGateway = '[VPN_GATEWAY]'; + + get_status_sample($project, $region, $vpnGateway); +} +// [END compute_v1_generated_VpnGateways_GetStatus_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/insert.php new file mode 100644 index 000000000000..b1d435140ac5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/insert.php @@ -0,0 +1,80 @@ +insert($project, $region, $vpnGatewayResource); + $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_VpnGateways_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/list.php new file mode 100644 index 000000000000..7a1407aec0ab --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/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_VpnGateways_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/set_labels.php b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/set_labels.php new file mode 100644 index 000000000000..c12a05ef6fa8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/set_labels.php @@ -0,0 +1,87 @@ +setLabels( + $project, + $region, + $regionSetLabelsRequestResource, + $resource + ); + $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]'; + $resource = '[RESOURCE]'; + + set_labels_sample($project, $region, $resource); +} +// [END compute_v1_generated_VpnGateways_SetLabels_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/test_iam_permissions.php b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/test_iam_permissions.php new file mode 100644 index 000000000000..6abd280c1457 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/test_iam_permissions.php @@ -0,0 +1,78 @@ +testIamPermissions( + $project, + $region, + $resource, + $testPermissionsRequestResource + ); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + test_iam_permissions_sample($project, $region, $resource); +} +// [END compute_v1_generated_VpnGateways_TestIamPermissions_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/aggregated_list.php b/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/aggregated_list.php new file mode 100644 index 000000000000..57edeba12639 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/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_VpnTunnels_AggregatedList_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/delete.php new file mode 100644 index 000000000000..9d0eb174959d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/delete.php @@ -0,0 +1,78 @@ +delete($project, $region, $vpnTunnel); + $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]'; + $vpnTunnel = '[VPN_TUNNEL]'; + + delete_sample($project, $region, $vpnTunnel); +} +// [END compute_v1_generated_VpnTunnels_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/get.php new file mode 100644 index 000000000000..dd95497e0ab8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/get.php @@ -0,0 +1,69 @@ +get($project, $region, $vpnTunnel); + 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 +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $vpnTunnel = '[VPN_TUNNEL]'; + + get_sample($project, $region, $vpnTunnel); +} +// [END compute_v1_generated_VpnTunnels_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/insert.php b/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/insert.php new file mode 100644 index 000000000000..162204f75f3c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/insert.php @@ -0,0 +1,80 @@ +insert($project, $region, $vpnTunnelResource); + $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_VpnTunnels_Insert_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/list.php new file mode 100644 index 000000000000..1a15c0ea256a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/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_VpnTunnels_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/set_labels.php b/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/set_labels.php new file mode 100644 index 000000000000..cf236b15d125 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/set_labels.php @@ -0,0 +1,87 @@ +setLabels( + $project, + $region, + $regionSetLabelsRequestResource, + $resource + ); + $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]'; + $resource = '[RESOURCE]'; + + set_labels_sample($project, $region, $resource); +} +// [END compute_v1_generated_VpnTunnels_SetLabels_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ZoneOperationsClient/delete.php b/owl-bot-staging/Compute/V1/samples/V1/ZoneOperationsClient/delete.php new file mode 100644 index 000000000000..f8bd5fb121d3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ZoneOperationsClient/delete.php @@ -0,0 +1,69 @@ +delete($operation, $project, $zone); + 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 +{ + $operation = '[OPERATION]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + delete_sample($operation, $project, $zone); +} +// [END compute_v1_generated_ZoneOperations_Delete_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ZoneOperationsClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/ZoneOperationsClient/get.php new file mode 100644 index 000000000000..873c768d32e3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ZoneOperationsClient/get.php @@ -0,0 +1,69 @@ +get($operation, $project, $zone); + 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 +{ + $operation = '[OPERATION]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + get_sample($operation, $project, $zone); +} +// [END compute_v1_generated_ZoneOperations_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ZoneOperationsClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/ZoneOperationsClient/list.php new file mode 100644 index 000000000000..d2b719f1670c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ZoneOperationsClient/list.php @@ -0,0 +1,70 @@ +list($project, $zone); + + 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]'; + $zone = '[ZONE]'; + + list_sample($project, $zone); +} +// [END compute_v1_generated_ZoneOperations_List_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ZoneOperationsClient/wait.php b/owl-bot-staging/Compute/V1/samples/V1/ZoneOperationsClient/wait.php new file mode 100644 index 000000000000..53af5e3281a0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ZoneOperationsClient/wait.php @@ -0,0 +1,69 @@ +wait($operation, $project, $zone); + 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 +{ + $operation = '[OPERATION]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + wait_sample($operation, $project, $zone); +} +// [END compute_v1_generated_ZoneOperations_Wait_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ZonesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/ZonesClient/get.php new file mode 100644 index 000000000000..dcb5cccd96e0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ZonesClient/get.php @@ -0,0 +1,67 @@ +get($project, $zone); + 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 +{ + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + get_sample($project, $zone); +} +// [END compute_v1_generated_Zones_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/ZonesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/ZonesClient/list.php new file mode 100644 index 000000000000..efcb6a602526 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ZonesClient/list.php @@ -0,0 +1,68 @@ +list($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]'; + + list_sample($project); +} +// [END compute_v1_generated_Zones_List_sync] diff --git a/owl-bot-staging/Compute/V1/src/V1/AcceleratorTypesClient.php b/owl-bot-staging/Compute/V1/src/V1/AcceleratorTypesClient.php new file mode 100644 index 000000000000..9b4d8e4d46e7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/AcceleratorTypesClient.php @@ -0,0 +1,34 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/accelerator_types_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/accelerator_types_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/accelerator_types_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of accelerator types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see AcceleratorTypesClient::aggregatedListAsync()} . + * + * @param AggregatedListAcceleratorTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListAcceleratorTypesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Returns the specified accelerator type. + * + * The async variant is {@see AcceleratorTypesClient::getAsync()} . + * + * @param GetAcceleratorTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AcceleratorType + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetAcceleratorTypeRequest $request, array $callOptions = []): AcceleratorType + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of accelerator types that are available to the specified project. + * + * The async variant is {@see AcceleratorTypesClient::listAsync()} . + * + * @param ListAcceleratorTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListAcceleratorTypesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/AddressesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/AddressesClient.php new file mode 100644 index 000000000000..554c54d952df --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/AddressesClient.php @@ -0,0 +1,410 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/addresses_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/addresses_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/addresses_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of addresses. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see AddressesClient::aggregatedListAsync()} . + * + * @param AggregatedListAddressesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListAddressesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified address resource. + * + * The async variant is {@see AddressesClient::deleteAsync()} . + * + * @param DeleteAddressRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteAddressRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified address resource. + * + * The async variant is {@see AddressesClient::getAsync()} . + * + * @param GetAddressRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Address + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetAddressRequest $request, array $callOptions = []): Address + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates an address resource in the specified project by using the data included in the request. + * + * The async variant is {@see AddressesClient::insertAsync()} . + * + * @param InsertAddressRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertAddressRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of addresses contained within the specified region. + * + * The async variant is {@see AddressesClient::listAsync()} . + * + * @param ListAddressesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListAddressesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Moves the specified address resource. + * + * The async variant is {@see AddressesClient::moveAsync()} . + * + * @param MoveAddressRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function move(MoveAddressRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Move', $request, $callOptions)->wait(); + } + + /** + * Sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation. + * + * The async variant is {@see AddressesClient::setLabelsAsync()} . + * + * @param SetLabelsAddressRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setLabels(SetLabelsAddressRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetLabels', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/AutoscalersClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/AutoscalersClient.php new file mode 100644 index 000000000000..63597eac27e6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/AutoscalersClient.php @@ -0,0 +1,410 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/autoscalers_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/autoscalers_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/autoscalers_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of autoscalers. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see AutoscalersClient::aggregatedListAsync()} . + * + * @param AggregatedListAutoscalersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListAutoscalersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified autoscaler. + * + * The async variant is {@see AutoscalersClient::deleteAsync()} . + * + * @param DeleteAutoscalerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteAutoscalerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified autoscaler resource. + * + * The async variant is {@see AutoscalersClient::getAsync()} . + * + * @param GetAutoscalerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Autoscaler + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetAutoscalerRequest $request, array $callOptions = []): Autoscaler + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates an autoscaler in the specified project using the data included in the request. + * + * The async variant is {@see AutoscalersClient::insertAsync()} . + * + * @param InsertAutoscalerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertAutoscalerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of autoscalers contained within the specified zone. + * + * The async variant is {@see AutoscalersClient::listAsync()} . + * + * @param ListAutoscalersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListAutoscalersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * The async variant is {@see AutoscalersClient::patchAsync()} . + * + * @param PatchAutoscalerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchAutoscalerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Updates an autoscaler in the specified project using the data included in the request. + * + * The async variant is {@see AutoscalersClient::updateAsync()} . + * + * @param UpdateAutoscalerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function update(UpdateAutoscalerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Update', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/BackendBucketsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/BackendBucketsClient.php new file mode 100644 index 000000000000..22b1dce6faac --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/BackendBucketsClient.php @@ -0,0 +1,541 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/backend_buckets_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/backend_buckets_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/backend_buckets_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Adds a key for validating requests with signed URLs for this backend bucket. + * + * The async variant is {@see BackendBucketsClient::addSignedUrlKeyAsync()} . + * + * @param AddSignedUrlKeyBackendBucketRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function addSignedUrlKey(AddSignedUrlKeyBackendBucketRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AddSignedUrlKey', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified BackendBucket resource. + * + * The async variant is {@see BackendBucketsClient::deleteAsync()} . + * + * @param DeleteBackendBucketRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteBackendBucketRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Deletes a key for validating requests with signed URLs for this backend bucket. + * + * The async variant is {@see BackendBucketsClient::deleteSignedUrlKeyAsync()} . + * + * @param DeleteSignedUrlKeyBackendBucketRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteSignedUrlKey(DeleteSignedUrlKeyBackendBucketRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteSignedUrlKey', $request, $callOptions)->wait(); + } + + /** + * Returns the specified BackendBucket resource. + * + * The async variant is {@see BackendBucketsClient::getAsync()} . + * + * @param GetBackendBucketRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BackendBucket + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetBackendBucketRequest $request, array $callOptions = []): BackendBucket + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is {@see BackendBucketsClient::getIamPolicyAsync()} . + * + * @param GetIamPolicyBackendBucketRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyBackendBucketRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Creates a BackendBucket resource in the specified project using the data included in the request. + * + * The async variant is {@see BackendBucketsClient::insertAsync()} . + * + * @param InsertBackendBucketRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertBackendBucketRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of BackendBucket resources available to the specified project. + * + * The async variant is {@see BackendBucketsClient::listAsync()} . + * + * @param ListBackendBucketsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListBackendBucketsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * The async variant is {@see BackendBucketsClient::patchAsync()} . + * + * @param PatchBackendBucketRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchBackendBucketRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Sets the edge security policy for the specified backend bucket. + * + * The async variant is {@see BackendBucketsClient::setEdgeSecurityPolicyAsync()} . + * + * @param SetEdgeSecurityPolicyBackendBucketRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setEdgeSecurityPolicy(SetEdgeSecurityPolicyBackendBucketRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetEdgeSecurityPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is {@see BackendBucketsClient::setIamPolicyAsync()} . + * + * @param SetIamPolicyBackendBucketRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyBackendBucketRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is {@see BackendBucketsClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsBackendBucketRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsBackendBucketRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } + + /** + * Updates the specified BackendBucket resource with the data included in the request. + * + * The async variant is {@see BackendBucketsClient::updateAsync()} . + * + * @param UpdateBackendBucketRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function update(UpdateBackendBucketRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Update', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/BackendServicesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/BackendServicesClient.php new file mode 100644 index 000000000000..15012958cd6e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/BackendServicesClient.php @@ -0,0 +1,647 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/backend_services_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/backend_services_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/backend_services_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Adds a key for validating requests with signed URLs for this backend service. + * + * The async variant is {@see BackendServicesClient::addSignedUrlKeyAsync()} . + * + * @param AddSignedUrlKeyBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function addSignedUrlKey(AddSignedUrlKeyBackendServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AddSignedUrlKey', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of all BackendService resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see BackendServicesClient::aggregatedListAsync()} . + * + * @param AggregatedListBackendServicesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListBackendServicesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified BackendService resource. + * + * The async variant is {@see BackendServicesClient::deleteAsync()} . + * + * @param DeleteBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteBackendServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Deletes a key for validating requests with signed URLs for this backend service. + * + * The async variant is {@see BackendServicesClient::deleteSignedUrlKeyAsync()} . + * + * @param DeleteSignedUrlKeyBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteSignedUrlKey(DeleteSignedUrlKeyBackendServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteSignedUrlKey', $request, $callOptions)->wait(); + } + + /** + * Returns the specified BackendService resource. + * + * The async variant is {@see BackendServicesClient::getAsync()} . + * + * @param GetBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BackendService + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetBackendServiceRequest $request, array $callOptions = []): BackendService + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets the most recent health check results for this BackendService. Example request body: { "group": "/zones/us-east1-b/instanceGroups/lb-backend-example" } + * + * The async variant is {@see BackendServicesClient::getHealthAsync()} . + * + * @param GetHealthBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BackendServiceGroupHealth + * + * @throws ApiException Thrown if the API call fails. + */ + public function getHealth(GetHealthBackendServiceRequest $request, array $callOptions = []): BackendServiceGroupHealth + { + return $this->startApiCall('GetHealth', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is {@see BackendServicesClient::getIamPolicyAsync()} . + * + * @param GetIamPolicyBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyBackendServiceRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Creates a BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview . + * + * The async variant is {@see BackendServicesClient::insertAsync()} . + * + * @param InsertBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertBackendServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of BackendService resources available to the specified project. + * + * The async variant is {@see BackendServicesClient::listAsync()} . + * + * @param ListBackendServicesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListBackendServicesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Retrieves an aggregated list of all usable backend services in the specified project. + * + * The async variant is {@see BackendServicesClient::listUsableAsync()} . + * + * @param ListUsableBackendServicesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listUsable(ListUsableBackendServicesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListUsable', $request, $callOptions); + } + + /** + * Patches the specified BackendService resource with the data included in the request. For more information, see Backend services overview. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * The async variant is {@see BackendServicesClient::patchAsync()} . + * + * @param PatchBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchBackendServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Sets the edge security policy for the specified backend service. + * + * The async variant is {@see BackendServicesClient::setEdgeSecurityPolicyAsync()} + * . + * + * @param SetEdgeSecurityPolicyBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setEdgeSecurityPolicy(SetEdgeSecurityPolicyBackendServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetEdgeSecurityPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is {@see BackendServicesClient::setIamPolicyAsync()} . + * + * @param SetIamPolicyBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyBackendServiceRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview + * + * The async variant is {@see BackendServicesClient::setSecurityPolicyAsync()} . + * + * @param SetSecurityPolicyBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setSecurityPolicy(SetSecurityPolicyBackendServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetSecurityPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is {@see BackendServicesClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsBackendServiceRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } + + /** + * Updates the specified BackendService resource with the data included in the request. For more information, see Backend services overview. + * + * The async variant is {@see BackendServicesClient::updateAsync()} . + * + * @param UpdateBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function update(UpdateBackendServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Update', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/DiskTypesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/DiskTypesClient.php new file mode 100644 index 000000000000..2e41d07707eb --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/DiskTypesClient.php @@ -0,0 +1,253 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/disk_types_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/disk_types_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/disk_types_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of disk types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see DiskTypesClient::aggregatedListAsync()} . + * + * @param AggregatedListDiskTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListDiskTypesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Returns the specified disk type. + * + * The async variant is {@see DiskTypesClient::getAsync()} . + * + * @param GetDiskTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DiskType + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetDiskTypeRequest $request, array $callOptions = []): DiskType + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of disk types available to the specified project. + * + * The async variant is {@see DiskTypesClient::listAsync()} . + * + * @param ListDiskTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListDiskTypesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/DisksClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/DisksClient.php new file mode 100644 index 000000000000..c82e54231490 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/DisksClient.php @@ -0,0 +1,698 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/disks_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/disks_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/disks_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. + * + * The async variant is {@see DisksClient::addResourcePoliciesAsync()} . + * + * @param AddResourcePoliciesDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function addResourcePolicies(AddResourcePoliciesDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AddResourcePolicies', $request, $callOptions)->wait(); + } + + /** + * Retrieves an aggregated list of persistent disks. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see DisksClient::aggregatedListAsync()} . + * + * @param AggregatedListDisksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListDisksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Bulk create a set of disks. + * + * The async variant is {@see DisksClient::bulkInsertAsync()} . + * + * @param BulkInsertDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function bulkInsert(BulkInsertDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BulkInsert', $request, $callOptions)->wait(); + } + + /** + * Creates a snapshot of a specified persistent disk. For regular snapshot creation, consider using snapshots.insert instead, as that method supports more features, such as creating snapshots in a project different from the source disk project. + * + * The async variant is {@see DisksClient::createSnapshotAsync()} . + * + * @param CreateSnapshotDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createSnapshot(CreateSnapshotDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateSnapshot', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. + * + * The async variant is {@see DisksClient::deleteAsync()} . + * + * @param DeleteDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified persistent disk. + * + * The async variant is {@see DisksClient::getAsync()} . + * + * @param GetDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Disk + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetDiskRequest $request, array $callOptions = []): Disk + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is {@see DisksClient::getIamPolicyAsync()} . + * + * @param GetIamPolicyDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyDiskRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Creates a persistent disk in the specified project using the data in the request. You can create a disk from a source (sourceImage, sourceSnapshot, or sourceDisk) or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property. + * + * The async variant is {@see DisksClient::insertAsync()} . + * + * @param InsertDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of persistent disks contained within the specified zone. + * + * The async variant is {@see DisksClient::listAsync()} . + * + * @param ListDisksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListDisksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Removes resource policies from a disk. + * + * The async variant is {@see DisksClient::removeResourcePoliciesAsync()} . + * + * @param RemoveResourcePoliciesDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function removeResourcePolicies(RemoveResourcePoliciesDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RemoveResourcePolicies', $request, $callOptions)->wait(); + } + + /** + * Resizes the specified persistent disk. You can only increase the size of the disk. + * + * The async variant is {@see DisksClient::resizeAsync()} . + * + * @param ResizeDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function resize(ResizeDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Resize', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is {@see DisksClient::setIamPolicyAsync()} . + * + * @param SetIamPolicyDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyDiskRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. + * + * The async variant is {@see DisksClient::setLabelsAsync()} . + * + * @param SetLabelsDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setLabels(SetLabelsDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetLabels', $request, $callOptions)->wait(); + } + + /** + * Starts asynchronous replication. Must be invoked on the primary disk. + * + * The async variant is {@see DisksClient::startAsyncReplicationAsync()} . + * + * @param StartAsyncReplicationDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function startAsyncReplication(StartAsyncReplicationDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('StartAsyncReplication', $request, $callOptions)->wait(); + } + + /** + * Stops asynchronous replication. Can be invoked either on the primary or on the secondary disk. + * + * The async variant is {@see DisksClient::stopAsyncReplicationAsync()} . + * + * @param StopAsyncReplicationDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function stopAsyncReplication(StopAsyncReplicationDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('StopAsyncReplication', $request, $callOptions)->wait(); + } + + /** + * Stops asynchronous replication for a consistency group of disks. Can be invoked either in the primary or secondary scope. + * + * The async variant is {@see DisksClient::stopGroupAsyncReplicationAsync()} . + * + * @param StopGroupAsyncReplicationDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function stopGroupAsyncReplication(StopGroupAsyncReplicationDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('StopGroupAsyncReplication', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is {@see DisksClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsDiskRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->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. + * + * The async variant is {@see DisksClient::updateAsync()} . + * + * @param UpdateDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function update(UpdateDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Update', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/ExternalVpnGatewaysClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/ExternalVpnGatewaysClient.php new file mode 100644 index 000000000000..9169d368e38d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/ExternalVpnGatewaysClient.php @@ -0,0 +1,385 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/external_vpn_gateways_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/external_vpn_gateways_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/external_vpn_gateways_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified externalVpnGateway. + * + * The async variant is {@see ExternalVpnGatewaysClient::deleteAsync()} . + * + * @param DeleteExternalVpnGatewayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteExternalVpnGatewayRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified externalVpnGateway. Get a list of available externalVpnGateways by making a list() request. + * + * The async variant is {@see ExternalVpnGatewaysClient::getAsync()} . + * + * @param GetExternalVpnGatewayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ExternalVpnGateway + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetExternalVpnGatewayRequest $request, array $callOptions = []): ExternalVpnGateway + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a ExternalVpnGateway in the specified project using the data included in the request. + * + * The async variant is {@see ExternalVpnGatewaysClient::insertAsync()} . + * + * @param InsertExternalVpnGatewayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertExternalVpnGatewayRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of ExternalVpnGateway available to the specified project. + * + * The async variant is {@see ExternalVpnGatewaysClient::listAsync()} . + * + * @param ListExternalVpnGatewaysRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListExternalVpnGatewaysRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Sets the labels on an ExternalVpnGateway. To learn more about labels, read the Labeling Resources documentation. + * + * The async variant is {@see ExternalVpnGatewaysClient::setLabelsAsync()} . + * + * @param SetLabelsExternalVpnGatewayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setLabels(SetLabelsExternalVpnGatewayRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetLabels', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is {@see ExternalVpnGatewaysClient::testIamPermissionsAsync()} + * . + * + * @param TestIamPermissionsExternalVpnGatewayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsExternalVpnGatewayRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/FirewallPoliciesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/FirewallPoliciesClient.php new file mode 100644 index 000000000000..be994b900a51 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/FirewallPoliciesClient.php @@ -0,0 +1,699 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/firewall_policies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/firewall_policies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/firewall_policies_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOrganizationOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOrganizationOperationsClient object with the same endpoint as + * $this. + * + * @return GlobalOrganizationOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Inserts an association for the specified firewall policy. + * + * The async variant is {@see FirewallPoliciesClient::addAssociationAsync()} . + * + * @param AddAssociationFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function addAssociation(AddAssociationFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AddAssociation', $request, $callOptions)->wait(); + } + + /** + * Inserts a rule into a firewall policy. + * + * The async variant is {@see FirewallPoliciesClient::addRuleAsync()} . + * + * @param AddRuleFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function addRule(AddRuleFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AddRule', $request, $callOptions)->wait(); + } + + /** + * Copies rules to the specified firewall policy. + * + * The async variant is {@see FirewallPoliciesClient::cloneRulesAsync()} . + * + * @param CloneRulesFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function cloneRules(CloneRulesFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CloneRules', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified policy. + * + * The async variant is {@see FirewallPoliciesClient::deleteAsync()} . + * + * @param DeleteFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified firewall policy. + * + * The async variant is {@see FirewallPoliciesClient::getAsync()} . + * + * @param GetFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FirewallPolicy + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetFirewallPolicyRequest $request, array $callOptions = []): FirewallPolicy + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets an association with the specified name. + * + * The async variant is {@see FirewallPoliciesClient::getAssociationAsync()} . + * + * @param GetAssociationFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FirewallPolicyAssociation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAssociation(GetAssociationFirewallPolicyRequest $request, array $callOptions = []): FirewallPolicyAssociation + { + return $this->startApiCall('GetAssociation', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is {@see FirewallPoliciesClient::getIamPolicyAsync()} . + * + * @param GetIamPolicyFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyFirewallPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Gets a rule of the specified priority. + * + * The async variant is {@see FirewallPoliciesClient::getRuleAsync()} . + * + * @param GetRuleFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FirewallPolicyRule + * + * @throws ApiException Thrown if the API call fails. + */ + public function getRule(GetRuleFirewallPolicyRequest $request, array $callOptions = []): FirewallPolicyRule + { + return $this->startApiCall('GetRule', $request, $callOptions)->wait(); + } + + /** + * Creates a new policy in the specified project using the data included in the request. + * + * The async variant is {@see FirewallPoliciesClient::insertAsync()} . + * + * @param InsertFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Lists all the policies that have been configured for the specified folder or organization. + * + * The async variant is {@see FirewallPoliciesClient::listAsync()} . + * + * @param ListFirewallPoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListFirewallPoliciesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Lists associations of a specified target, i.e., organization or folder. + * + * The async variant is {@see FirewallPoliciesClient::listAssociationsAsync()} . + * + * @param ListAssociationsFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FirewallPoliciesListAssociationsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listAssociations(ListAssociationsFirewallPolicyRequest $request, array $callOptions = []): FirewallPoliciesListAssociationsResponse + { + return $this->startApiCall('ListAssociations', $request, $callOptions)->wait(); + } + + /** + * Moves the specified firewall policy. + * + * The async variant is {@see FirewallPoliciesClient::moveAsync()} . + * + * @param MoveFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function move(MoveFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Move', $request, $callOptions)->wait(); + } + + /** + * Patches the specified policy with the data included in the request. + * + * The async variant is {@see FirewallPoliciesClient::patchAsync()} . + * + * @param PatchFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Patches a rule of the specified priority. + * + * The async variant is {@see FirewallPoliciesClient::patchRuleAsync()} . + * + * @param PatchRuleFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patchRule(PatchRuleFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('PatchRule', $request, $callOptions)->wait(); + } + + /** + * Removes an association for the specified firewall policy. + * + * The async variant is {@see FirewallPoliciesClient::removeAssociationAsync()} . + * + * @param RemoveAssociationFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function removeAssociation(RemoveAssociationFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RemoveAssociation', $request, $callOptions)->wait(); + } + + /** + * Deletes a rule of the specified priority. + * + * The async variant is {@see FirewallPoliciesClient::removeRuleAsync()} . + * + * @param RemoveRuleFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function removeRule(RemoveRuleFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RemoveRule', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is {@see FirewallPoliciesClient::setIamPolicyAsync()} . + * + * @param SetIamPolicyFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyFirewallPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is {@see FirewallPoliciesClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsFirewallPolicyRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/FirewallsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/FirewallsClient.php new file mode 100644 index 000000000000..ddb4c4e2739c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/FirewallsClient.php @@ -0,0 +1,383 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/firewalls_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/firewalls_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/firewalls_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified firewall. + * + * The async variant is {@see FirewallsClient::deleteAsync()} . + * + * @param DeleteFirewallRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteFirewallRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified firewall. + * + * The async variant is {@see FirewallsClient::getAsync()} . + * + * @param GetFirewallRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Firewall + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetFirewallRequest $request, array $callOptions = []): Firewall + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a firewall rule in the specified project using the data included in the request. + * + * The async variant is {@see FirewallsClient::insertAsync()} . + * + * @param InsertFirewallRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertFirewallRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of firewall rules available to the specified project. + * + * The async variant is {@see FirewallsClient::listAsync()} . + * + * @param ListFirewallsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListFirewallsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * The async variant is {@see FirewallsClient::patchAsync()} . + * + * @param PatchFirewallRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchFirewallRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Updates the specified firewall rule with the data included in the request. Note that all fields will be updated if using PUT, even fields that are not specified. To update individual fields, please use PATCH instead. + * + * The async variant is {@see FirewallsClient::updateAsync()} . + * + * @param UpdateFirewallRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function update(UpdateFirewallRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Update', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/ForwardingRulesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/ForwardingRulesClient.php new file mode 100644 index 000000000000..4fe7bf9ae6c3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/ForwardingRulesClient.php @@ -0,0 +1,436 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/forwarding_rules_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/forwarding_rules_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/forwarding_rules_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of forwarding rules. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see ForwardingRulesClient::aggregatedListAsync()} . + * + * @param AggregatedListForwardingRulesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListForwardingRulesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified ForwardingRule resource. + * + * The async variant is {@see ForwardingRulesClient::deleteAsync()} . + * + * @param DeleteForwardingRuleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteForwardingRuleRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified ForwardingRule resource. + * + * The async variant is {@see ForwardingRulesClient::getAsync()} . + * + * @param GetForwardingRuleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ForwardingRule + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetForwardingRuleRequest $request, array $callOptions = []): ForwardingRule + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a ForwardingRule resource in the specified project and region using the data included in the request. + * + * The async variant is {@see ForwardingRulesClient::insertAsync()} . + * + * @param InsertForwardingRuleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertForwardingRuleRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of ForwardingRule resources available to the specified project and region. + * + * The async variant is {@see ForwardingRulesClient::listAsync()} . + * + * @param ListForwardingRulesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListForwardingRulesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. + * + * The async variant is {@see ForwardingRulesClient::patchAsync()} . + * + * @param PatchForwardingRuleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchForwardingRuleRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation. + * + * The async variant is {@see ForwardingRulesClient::setLabelsAsync()} . + * + * @param SetLabelsForwardingRuleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setLabels(SetLabelsForwardingRuleRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetLabels', $request, $callOptions)->wait(); + } + + /** + * Changes target URL for forwarding rule. The new target should be of the same type as the old target. + * + * The async variant is {@see ForwardingRulesClient::setTargetAsync()} . + * + * @param SetTargetForwardingRuleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setTarget(SetTargetForwardingRuleRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetTarget', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/GlobalAddressesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/GlobalAddressesClient.php new file mode 100644 index 000000000000..0181f283e39f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/GlobalAddressesClient.php @@ -0,0 +1,383 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/global_addresses_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/global_addresses_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/global_addresses_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified address resource. + * + * The async variant is {@see GlobalAddressesClient::deleteAsync()} . + * + * @param DeleteGlobalAddressRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteGlobalAddressRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified address resource. + * + * The async variant is {@see GlobalAddressesClient::getAsync()} . + * + * @param GetGlobalAddressRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Address + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetGlobalAddressRequest $request, array $callOptions = []): Address + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates an address resource in the specified project by using the data included in the request. + * + * The async variant is {@see GlobalAddressesClient::insertAsync()} . + * + * @param InsertGlobalAddressRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertGlobalAddressRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of global addresses. + * + * The async variant is {@see GlobalAddressesClient::listAsync()} . + * + * @param ListGlobalAddressesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListGlobalAddressesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Moves the specified address resource from one project to another project. + * + * The async variant is {@see GlobalAddressesClient::moveAsync()} . + * + * @param MoveGlobalAddressRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function move(MoveGlobalAddressRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Move', $request, $callOptions)->wait(); + } + + /** + * Sets the labels on a GlobalAddress. To learn more about labels, read the Labeling Resources documentation. + * + * The async variant is {@see GlobalAddressesClient::setLabelsAsync()} . + * + * @param SetLabelsGlobalAddressRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setLabels(SetLabelsGlobalAddressRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetLabels', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/GlobalForwardingRulesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/GlobalForwardingRulesClient.php new file mode 100644 index 000000000000..0116d4dcc701 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/GlobalForwardingRulesClient.php @@ -0,0 +1,409 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/global_forwarding_rules_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/global_forwarding_rules_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/global_forwarding_rules_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified GlobalForwardingRule resource. + * + * The async variant is {@see GlobalForwardingRulesClient::deleteAsync()} . + * + * @param DeleteGlobalForwardingRuleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteGlobalForwardingRuleRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request. + * + * The async variant is {@see GlobalForwardingRulesClient::getAsync()} . + * + * @param GetGlobalForwardingRuleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ForwardingRule + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetGlobalForwardingRuleRequest $request, array $callOptions = []): ForwardingRule + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a GlobalForwardingRule resource in the specified project using the data included in the request. + * + * The async variant is {@see GlobalForwardingRulesClient::insertAsync()} . + * + * @param InsertGlobalForwardingRuleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertGlobalForwardingRuleRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of GlobalForwardingRule resources available to the specified project. + * + * The async variant is {@see GlobalForwardingRulesClient::listAsync()} . + * + * @param ListGlobalForwardingRulesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListGlobalForwardingRulesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. + * + * The async variant is {@see GlobalForwardingRulesClient::patchAsync()} . + * + * @param PatchGlobalForwardingRuleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchGlobalForwardingRuleRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Sets the labels on the specified resource. To learn more about labels, read the Labeling resources documentation. + * + * The async variant is {@see GlobalForwardingRulesClient::setLabelsAsync()} . + * + * @param SetLabelsGlobalForwardingRuleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setLabels(SetLabelsGlobalForwardingRuleRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetLabels', $request, $callOptions)->wait(); + } + + /** + * Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. + * + * The async variant is {@see GlobalForwardingRulesClient::setTargetAsync()} . + * + * @param SetTargetGlobalForwardingRuleRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setTarget(SetTargetGlobalForwardingRuleRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetTarget', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/GlobalNetworkEndpointGroupsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/GlobalNetworkEndpointGroupsClient.php new file mode 100644 index 000000000000..9714dff86c01 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/GlobalNetworkEndpointGroupsClient.php @@ -0,0 +1,412 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/global_network_endpoint_groups_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/global_network_endpoint_groups_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/global_network_endpoint_groups_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Attach a network endpoint to the specified network endpoint group. + * + * The async variant is + * {@see GlobalNetworkEndpointGroupsClient::attachNetworkEndpointsAsync()} . + * + * @param AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function attachNetworkEndpoints(AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AttachNetworkEndpoints', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified network endpoint group.Note that the NEG cannot be deleted if there are backend services referencing it. + * + * The async variant is {@see GlobalNetworkEndpointGroupsClient::deleteAsync()} . + * + * @param DeleteGlobalNetworkEndpointGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteGlobalNetworkEndpointGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Detach the network endpoint from the specified network endpoint group. + * + * The async variant is + * {@see GlobalNetworkEndpointGroupsClient::detachNetworkEndpointsAsync()} . + * + * @param DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function detachNetworkEndpoints(DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DetachNetworkEndpoints', $request, $callOptions)->wait(); + } + + /** + * Returns the specified network endpoint group. + * + * The async variant is {@see GlobalNetworkEndpointGroupsClient::getAsync()} . + * + * @param GetGlobalNetworkEndpointGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NetworkEndpointGroup + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetGlobalNetworkEndpointGroupRequest $request, array $callOptions = []): NetworkEndpointGroup + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a network endpoint group in the specified project using the parameters that are included in the request. + * + * The async variant is {@see GlobalNetworkEndpointGroupsClient::insertAsync()} . + * + * @param InsertGlobalNetworkEndpointGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertGlobalNetworkEndpointGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of network endpoint groups that are located in the specified project. + * + * The async variant is {@see GlobalNetworkEndpointGroupsClient::listAsync()} . + * + * @param ListGlobalNetworkEndpointGroupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListGlobalNetworkEndpointGroupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Lists the network endpoints in the specified network endpoint group. + * + * The async variant is + * {@see GlobalNetworkEndpointGroupsClient::listNetworkEndpointsAsync()} . + * + * @param ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listNetworkEndpoints(ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListNetworkEndpoints', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/GlobalOperationsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/GlobalOperationsClient.php new file mode 100644 index 000000000000..9e885cc76345 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/GlobalOperationsClient.php @@ -0,0 +1,305 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/global_operations_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/global_operations_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/global_operations_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of all operations. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see GlobalOperationsClient::aggregatedListAsync()} . + * + * @param AggregatedListGlobalOperationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListGlobalOperationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified Operations resource. + * + * The async variant is {@see GlobalOperationsClient::deleteAsync()} . + * + * @param DeleteGlobalOperationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DeleteGlobalOperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteGlobalOperationRequest $request, array $callOptions = []): DeleteGlobalOperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified Operations resource. + * + * The async variant is {@see GlobalOperationsClient::getAsync()} . + * + * @param GetGlobalOperationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Operation + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetGlobalOperationRequest $request, array $callOptions = []): Operation + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of Operation resources contained within the specified project. + * + * The async variant is {@see GlobalOperationsClient::listAsync()} . + * + * @param ListGlobalOperationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListGlobalOperationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + * + * The async variant is {@see GlobalOperationsClient::waitAsync()} . + * + * @param WaitGlobalOperationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Operation + * + * @throws ApiException Thrown if the API call fails. + */ + public function wait(WaitGlobalOperationRequest $request, array $callOptions = []): Operation + { + return $this->startApiCall('Wait', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/GlobalOrganizationOperationsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/GlobalOrganizationOperationsClient.php new file mode 100644 index 000000000000..08198881ceb9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/GlobalOrganizationOperationsClient.php @@ -0,0 +1,253 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/global_organization_operations_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/global_organization_operations_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/global_organization_operations_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified Operations resource. + * + * The async variant is {@see GlobalOrganizationOperationsClient::deleteAsync()} . + * + * @param DeleteGlobalOrganizationOperationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DeleteGlobalOrganizationOperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteGlobalOrganizationOperationRequest $request, array $callOptions = []): DeleteGlobalOrganizationOperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified Operations resource. Gets a list of operations by making a `list()` request. + * + * The async variant is {@see GlobalOrganizationOperationsClient::getAsync()} . + * + * @param GetGlobalOrganizationOperationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Operation + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetGlobalOrganizationOperationRequest $request, array $callOptions = []): Operation + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of Operation resources contained within the specified organization. + * + * The async variant is {@see GlobalOrganizationOperationsClient::listAsync()} . + * + * @param ListGlobalOrganizationOperationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListGlobalOrganizationOperationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/GlobalPublicDelegatedPrefixesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/GlobalPublicDelegatedPrefixesClient.php new file mode 100644 index 000000000000..56ddec8635bc --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/GlobalPublicDelegatedPrefixesClient.php @@ -0,0 +1,357 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/global_public_delegated_prefixes_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/global_public_delegated_prefixes_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/global_public_delegated_prefixes_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified global PublicDelegatedPrefix. + * + * The async variant is {@see GlobalPublicDelegatedPrefixesClient::deleteAsync()} . + * + * @param DeleteGlobalPublicDelegatedPrefixeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteGlobalPublicDelegatedPrefixeRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified global PublicDelegatedPrefix resource. + * + * The async variant is {@see GlobalPublicDelegatedPrefixesClient::getAsync()} . + * + * @param GetGlobalPublicDelegatedPrefixeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PublicDelegatedPrefix + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetGlobalPublicDelegatedPrefixeRequest $request, array $callOptions = []): PublicDelegatedPrefix + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a global PublicDelegatedPrefix in the specified project using the parameters that are included in the request. + * + * The async variant is {@see GlobalPublicDelegatedPrefixesClient::insertAsync()} . + * + * @param InsertGlobalPublicDelegatedPrefixeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertGlobalPublicDelegatedPrefixeRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Lists the global PublicDelegatedPrefixes for a project. + * + * The async variant is {@see GlobalPublicDelegatedPrefixesClient::listAsync()} . + * + * @param ListGlobalPublicDelegatedPrefixesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListGlobalPublicDelegatedPrefixesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Patches the specified global PublicDelegatedPrefix resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * The async variant is {@see GlobalPublicDelegatedPrefixesClient::patchAsync()} . + * + * @param PatchGlobalPublicDelegatedPrefixeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchGlobalPublicDelegatedPrefixeRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/HealthChecksClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/HealthChecksClient.php new file mode 100644 index 000000000000..0947a103818a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/HealthChecksClient.php @@ -0,0 +1,409 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/health_checks_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/health_checks_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/health_checks_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves the list of all HealthCheck resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see HealthChecksClient::aggregatedListAsync()} . + * + * @param AggregatedListHealthChecksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListHealthChecksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified HealthCheck resource. + * + * The async variant is {@see HealthChecksClient::deleteAsync()} . + * + * @param DeleteHealthCheckRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteHealthCheckRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified HealthCheck resource. + * + * The async variant is {@see HealthChecksClient::getAsync()} . + * + * @param GetHealthCheckRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return HealthCheck + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetHealthCheckRequest $request, array $callOptions = []): HealthCheck + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a HealthCheck resource in the specified project using the data included in the request. + * + * The async variant is {@see HealthChecksClient::insertAsync()} . + * + * @param InsertHealthCheckRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertHealthCheckRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of HealthCheck resources available to the specified project. + * + * The async variant is {@see HealthChecksClient::listAsync()} . + * + * @param ListHealthChecksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListHealthChecksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * The async variant is {@see HealthChecksClient::patchAsync()} . + * + * @param PatchHealthCheckRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchHealthCheckRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. + * + * The async variant is {@see HealthChecksClient::updateAsync()} . + * + * @param UpdateHealthCheckRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function update(UpdateHealthCheckRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Update', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/ImageFamilyViewsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/ImageFamilyViewsClient.php new file mode 100644 index 000000000000..9279119410c5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/ImageFamilyViewsClient.php @@ -0,0 +1,200 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/image_family_views_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/image_family_views_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/image_family_views_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Returns the latest image that is part of an image family, is not deprecated and is rolled out in the specified zone. + * + * The async variant is {@see ImageFamilyViewsClient::getAsync()} . + * + * @param GetImageFamilyViewRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ImageFamilyView + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetImageFamilyViewRequest $request, array $callOptions = []): ImageFamilyView + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/ImagesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/ImagesClient.php new file mode 100644 index 000000000000..3e642bf6e2fc --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/ImagesClient.php @@ -0,0 +1,515 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/images_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/images_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/images_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified image. + * + * The async variant is {@see ImagesClient::deleteAsync()} . + * + * @param DeleteImageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteImageRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Sets the deprecation status of an image. If an empty request body is given, clears the deprecation status instead. + * + * The async variant is {@see ImagesClient::deprecateAsync()} . + * + * @param DeprecateImageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deprecate(DeprecateImageRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Deprecate', $request, $callOptions)->wait(); + } + + /** + * Returns the specified image. + * + * The async variant is {@see ImagesClient::getAsync()} . + * + * @param GetImageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Image + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetImageRequest $request, array $callOptions = []): Image + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * 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. + * + * The async variant is {@see ImagesClient::getFromFamilyAsync()} . + * + * @param GetFromFamilyImageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Image + * + * @throws ApiException Thrown if the API call fails. + */ + public function getFromFamily(GetFromFamilyImageRequest $request, array $callOptions = []): Image + { + return $this->startApiCall('GetFromFamily', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is {@see ImagesClient::getIamPolicyAsync()} . + * + * @param GetIamPolicyImageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyImageRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Creates an image in the specified project using the data included in the request. + * + * The async variant is {@see ImagesClient::insertAsync()} . + * + * @param InsertImageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertImageRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of custom images available to the specified project. Custom images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. + * + * The async variant is {@see ImagesClient::listAsync()} . + * + * @param ListImagesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListImagesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Patches the specified image with the data included in the request. Only the following fields can be modified: family, description, deprecation status. + * + * The async variant is {@see ImagesClient::patchAsync()} . + * + * @param PatchImageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchImageRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is {@see ImagesClient::setIamPolicyAsync()} . + * + * @param SetIamPolicyImageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyImageRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. + * + * The async variant is {@see ImagesClient::setLabelsAsync()} . + * + * @param SetLabelsImageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setLabels(SetLabelsImageRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetLabels', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is {@see ImagesClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsImageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsImageRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/InstanceGroupManagerResizeRequestsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/InstanceGroupManagerResizeRequestsClient.php new file mode 100644 index 000000000000..a5bb6788c7ce --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/InstanceGroupManagerResizeRequestsClient.php @@ -0,0 +1,363 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/instance_group_manager_resize_requests_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/instance_group_manager_resize_requests_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/instance_group_manager_resize_requests_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Cancels the specified resize request and removes it from the queue. Cancelled resize request does no longer wait for the resources to be provisioned. Cancel is only possible for requests that are accepted in the queue. + * + * The async variant is + * {@see InstanceGroupManagerResizeRequestsClient::cancelAsync()} . + * + * @param CancelInstanceGroupManagerResizeRequestRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function cancel(CancelInstanceGroupManagerResizeRequestRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Cancel', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified, inactive resize request. Requests that are still active cannot be deleted. Deleting request does not delete instances that were provisioned previously. + * + * The async variant is + * {@see InstanceGroupManagerResizeRequestsClient::deleteAsync()} . + * + * @param DeleteInstanceGroupManagerResizeRequestRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteInstanceGroupManagerResizeRequestRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns all of the details about the specified resize request. + * + * The async variant is {@see InstanceGroupManagerResizeRequestsClient::getAsync()} + * . + * + * @param GetInstanceGroupManagerResizeRequestRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return InstanceGroupManagerResizeRequest + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetInstanceGroupManagerResizeRequestRequest $request, array $callOptions = []): InstanceGroupManagerResizeRequest + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a new resize request that starts provisioning VMs immediately or queues VM creation. + * + * The async variant is + * {@see InstanceGroupManagerResizeRequestsClient::insertAsync()} . + * + * @param InsertInstanceGroupManagerResizeRequestRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertInstanceGroupManagerResizeRequestRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of resize requests that are contained in the managed instance group. + * + * The async variant is + * {@see InstanceGroupManagerResizeRequestsClient::listAsync()} . + * + * @param ListInstanceGroupManagerResizeRequestsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListInstanceGroupManagerResizeRequestsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/InstanceGroupManagersClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/InstanceGroupManagersClient.php new file mode 100644 index 000000000000..ea2c108aeabc --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/InstanceGroupManagersClient.php @@ -0,0 +1,759 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/instance_group_managers_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/instance_group_managers_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/instance_group_managers_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. + * + * The async variant is {@see InstanceGroupManagersClient::abandonInstancesAsync()} + * . + * + * @param AbandonInstancesInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function abandonInstances(AbandonInstancesInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AbandonInstances', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of managed instance groups and groups them by zone. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see InstanceGroupManagersClient::aggregatedListAsync()} . + * + * @param AggregatedListInstanceGroupManagersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListInstanceGroupManagersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Applies changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions. + * + * The async variant is + * {@see InstanceGroupManagersClient::applyUpdatesToInstancesAsync()} . + * + * @param ApplyUpdatesToInstancesInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function applyUpdatesToInstances(ApplyUpdatesToInstancesInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ApplyUpdatesToInstances', $request, $callOptions)->wait(); + } + + /** + * Creates instances with per-instance configurations in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. + * + * The async variant is {@see InstanceGroupManagersClient::createInstancesAsync()} + * . + * + * @param CreateInstancesInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createInstances(CreateInstancesInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateInstances', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information. + * + * The async variant is {@see InstanceGroupManagersClient::deleteAsync()} . + * + * @param DeleteInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. + * + * The async variant is {@see InstanceGroupManagersClient::deleteInstancesAsync()} + * . + * + * @param DeleteInstancesInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteInstances(DeleteInstancesInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteInstances', $request, $callOptions)->wait(); + } + + /** + * Deletes selected per-instance configurations for the managed instance group. + * + * The async variant is + * {@see InstanceGroupManagersClient::deletePerInstanceConfigsAsync()} . + * + * @param DeletePerInstanceConfigsInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deletePerInstanceConfigs(DeletePerInstanceConfigsInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeletePerInstanceConfigs', $request, $callOptions)->wait(); + } + + /** + * Returns all of the details about the specified managed instance group. + * + * The async variant is {@see InstanceGroupManagersClient::getAsync()} . + * + * @param GetInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return InstanceGroupManager + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetInstanceGroupManagerRequest $request, array $callOptions = []): InstanceGroupManager + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit. + * + * The async variant is {@see InstanceGroupManagersClient::insertAsync()} . + * + * @param InsertInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of managed instance groups that are contained within the specified project and zone. + * + * The async variant is {@see InstanceGroupManagersClient::listAsync()} . + * + * @param ListInstanceGroupManagersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListInstanceGroupManagersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Lists all errors thrown by actions on instances for a given managed instance group. The filter and orderBy query parameters are not supported. + * + * The async variant is {@see InstanceGroupManagersClient::listErrorsAsync()} . + * + * @param ListErrorsInstanceGroupManagersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listErrors(ListErrorsInstanceGroupManagersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListErrors', $request, $callOptions); + } + + /** + * Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action. The orderBy query parameter is not supported. The `pageToken` query parameter is supported only if the group's `listManagedInstancesResults` field is set to `PAGINATED`. + * + * The async variant is + * {@see InstanceGroupManagersClient::listManagedInstancesAsync()} . + * + * @param ListManagedInstancesInstanceGroupManagersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listManagedInstances(ListManagedInstancesInstanceGroupManagersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListManagedInstances', $request, $callOptions); + } + + /** + * Lists all of the per-instance configurations defined for the managed instance group. The orderBy query parameter is not supported. + * + * The async variant is + * {@see InstanceGroupManagersClient::listPerInstanceConfigsAsync()} . + * + * @param ListPerInstanceConfigsInstanceGroupManagersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listPerInstanceConfigs(ListPerInstanceConfigsInstanceGroupManagersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListPerInstanceConfigs', $request, $callOptions); + } + + /** + * Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. If you update your group to specify a new template or instance configuration, it's possible that your intended specification for each VM in the group is different from the current state of that VM. To learn how to apply an updated configuration to the VMs in a MIG, see Updating instances in a MIG. + * + * The async variant is {@see InstanceGroupManagersClient::patchAsync()} . + * + * @param PatchInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Inserts or patches per-instance configurations for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. + * + * The async variant is + * {@see InstanceGroupManagersClient::patchPerInstanceConfigsAsync()} . + * + * @param PatchPerInstanceConfigsInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patchPerInstanceConfigs(PatchPerInstanceConfigsInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('PatchPerInstanceConfigs', $request, $callOptions)->wait(); + } + + /** + * Flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group's current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking its currentAction field; for more information, see Checking the status of managed instances. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. + * + * The async variant is + * {@see InstanceGroupManagersClient::recreateInstancesAsync()} . + * + * @param RecreateInstancesInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function recreateInstances(RecreateInstancesInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RecreateInstances', $request, $callOptions)->wait(); + } + + /** + * Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. When resizing down, the instance group arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM attributes when making the selection including: + The status of the VM instance. + The health of the VM instance. + The instance template version the VM is based on. + For regional managed instance groups, the location of the VM instance. This list is subject to change. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + * + * The async variant is {@see InstanceGroupManagersClient::resizeAsync()} . + * + * @param ResizeInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function resize(ResizeInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Resize', $request, $callOptions)->wait(); + } + + /** + * Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE. + * + * The async variant is + * {@see InstanceGroupManagersClient::setInstanceTemplateAsync()} . + * + * @param SetInstanceTemplateInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setInstanceTemplate(SetInstanceTemplateInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetInstanceTemplate', $request, $callOptions)->wait(); + } + + /** + * Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group. + * + * The async variant is {@see InstanceGroupManagersClient::setTargetPoolsAsync()} . + * + * @param SetTargetPoolsInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setTargetPools(SetTargetPoolsInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetTargetPools', $request, $callOptions)->wait(); + } + + /** + * Inserts or updates per-instance configurations for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. + * + * The async variant is + * {@see InstanceGroupManagersClient::updatePerInstanceConfigsAsync()} . + * + * @param UpdatePerInstanceConfigsInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updatePerInstanceConfigs(UpdatePerInstanceConfigsInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdatePerInstanceConfigs', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/InstanceGroupsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/InstanceGroupsClient.php new file mode 100644 index 000000000000..f686699f52c9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/InstanceGroupsClient.php @@ -0,0 +1,462 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/instance_groups_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/instance_groups_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/instance_groups_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read Adding instances for more information. + * + * The async variant is {@see InstanceGroupsClient::addInstancesAsync()} . + * + * @param AddInstancesInstanceGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function addInstances(AddInstancesInstanceGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AddInstances', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of instance groups and sorts them by zone. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see InstanceGroupsClient::aggregatedListAsync()} . + * + * @param AggregatedListInstanceGroupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListInstanceGroupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information. + * + * The async variant is {@see InstanceGroupsClient::deleteAsync()} . + * + * @param DeleteInstanceGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteInstanceGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified zonal instance group. Get a list of available zonal instance groups by making a list() request. For managed instance groups, use the instanceGroupManagers or regionInstanceGroupManagers methods instead. + * + * The async variant is {@see InstanceGroupsClient::getAsync()} . + * + * @param GetInstanceGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return InstanceGroup + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetInstanceGroupRequest $request, array $callOptions = []): InstanceGroup + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates an instance group in the specified project using the parameters that are included in the request. + * + * The async variant is {@see InstanceGroupsClient::insertAsync()} . + * + * @param InsertInstanceGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertInstanceGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of zonal instance group resources contained within the specified zone. For managed instance groups, use the instanceGroupManagers or regionInstanceGroupManagers methods instead. + * + * The async variant is {@see InstanceGroupsClient::listAsync()} . + * + * @param ListInstanceGroupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListInstanceGroupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Lists the instances in the specified instance group. The orderBy query parameter is not supported. The filter query parameter is supported, but only for expressions that use `eq` (equal) or `ne` (not equal) operators. + * + * The async variant is {@see InstanceGroupsClient::listInstancesAsync()} . + * + * @param ListInstancesInstanceGroupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listInstances(ListInstancesInstanceGroupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListInstances', $request, $callOptions); + } + + /** + * Removes one or more instances from the specified instance group, but does not delete those instances. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted. + * + * The async variant is {@see InstanceGroupsClient::removeInstancesAsync()} . + * + * @param RemoveInstancesInstanceGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function removeInstances(RemoveInstancesInstanceGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RemoveInstances', $request, $callOptions)->wait(); + } + + /** + * Sets the named ports for the specified instance group. + * + * The async variant is {@see InstanceGroupsClient::setNamedPortsAsync()} . + * + * @param SetNamedPortsInstanceGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setNamedPorts(SetNamedPortsInstanceGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetNamedPorts', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/InstanceSettingsServiceClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/InstanceSettingsServiceClient.php new file mode 100644 index 000000000000..57b78ebc80e5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/InstanceSettingsServiceClient.php @@ -0,0 +1,279 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/instance_settings_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/instance_settings_service_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/instance_settings_service_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Get Instance settings. + * + * The async variant is {@see InstanceSettingsServiceClient::getAsync()} . + * + * @param GetInstanceSettingRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return InstanceSettings + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetInstanceSettingRequest $request, array $callOptions = []): InstanceSettings + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Patch Instance settings + * + * The async variant is {@see InstanceSettingsServiceClient::patchAsync()} . + * + * @param PatchInstanceSettingRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchInstanceSettingRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/InstanceTemplatesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/InstanceTemplatesClient.php new file mode 100644 index 000000000000..e1224d09d420 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/InstanceTemplatesClient.php @@ -0,0 +1,437 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/instance_templates_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/instance_templates_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/instance_templates_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves the list of all InstanceTemplates resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see InstanceTemplatesClient::aggregatedListAsync()} . + * + * @param AggregatedListInstanceTemplatesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListInstanceTemplatesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * 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. + * + * The async variant is {@see InstanceTemplatesClient::deleteAsync()} . + * + * @param DeleteInstanceTemplateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteInstanceTemplateRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified instance template. + * + * The async variant is {@see InstanceTemplatesClient::getAsync()} . + * + * @param GetInstanceTemplateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return InstanceTemplate + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetInstanceTemplateRequest $request, array $callOptions = []): InstanceTemplate + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is {@see InstanceTemplatesClient::getIamPolicyAsync()} . + * + * @param GetIamPolicyInstanceTemplateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyInstanceTemplateRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template. + * + * The async variant is {@see InstanceTemplatesClient::insertAsync()} . + * + * @param InsertInstanceTemplateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertInstanceTemplateRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of instance templates that are contained within the specified project. + * + * The async variant is {@see InstanceTemplatesClient::listAsync()} . + * + * @param ListInstanceTemplatesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListInstanceTemplatesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is {@see InstanceTemplatesClient::setIamPolicyAsync()} . + * + * @param SetIamPolicyInstanceTemplateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyInstanceTemplateRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is {@see InstanceTemplatesClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsInstanceTemplateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsInstanceTemplateRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/InstancesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/InstancesClient.php new file mode 100644 index 000000000000..4752b312f94c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/InstancesClient.php @@ -0,0 +1,1487 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/instances_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/instances_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/instances_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Adds an access config to an instance's network interface. + * + * The async variant is {@see InstancesClient::addAccessConfigAsync()} . + * + * @param AddAccessConfigInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function addAccessConfig(AddAccessConfigInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AddAccessConfig', $request, $callOptions)->wait(); + } + + /** + * Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations. + * + * The async variant is {@see InstancesClient::addResourcePoliciesAsync()} . + * + * @param AddResourcePoliciesInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function addResourcePolicies(AddResourcePoliciesInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AddResourcePolicies', $request, $callOptions)->wait(); + } + + /** + * Retrieves an aggregated list of all of the instances in your project across all regions and zones. The performance of this method degrades when a filter is specified on a project that has a very large number of instances. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see InstancesClient::aggregatedListAsync()} . + * + * @param AggregatedListInstancesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListInstancesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance. + * + * The async variant is {@see InstancesClient::attachDiskAsync()} . + * + * @param AttachDiskInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function attachDisk(AttachDiskInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AttachDisk', $request, $callOptions)->wait(); + } + + /** + * Creates multiple instances. Count specifies the number of instances to create. For more information, see About bulk creation of VMs. + * + * The async variant is {@see InstancesClient::bulkInsertAsync()} . + * + * @param BulkInsertInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function bulkInsert(BulkInsertInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BulkInsert', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified Instance resource. For more information, see Deleting an instance. + * + * The async variant is {@see InstancesClient::deleteAsync()} . + * + * @param DeleteInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Deletes an access config from an instance's network interface. + * + * The async variant is {@see InstancesClient::deleteAccessConfigAsync()} . + * + * @param DeleteAccessConfigInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteAccessConfig(DeleteAccessConfigInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteAccessConfig', $request, $callOptions)->wait(); + } + + /** + * Detaches a disk from an instance. + * + * The async variant is {@see InstancesClient::detachDiskAsync()} . + * + * @param DetachDiskInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function detachDisk(DetachDiskInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DetachDisk', $request, $callOptions)->wait(); + } + + /** + * Returns the specified Instance resource. + * + * The async variant is {@see InstancesClient::getAsync()} . + * + * @param GetInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Instance + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetInstanceRequest $request, array $callOptions = []): Instance + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Returns effective firewalls applied to an interface of the instance. + * + * The async variant is {@see InstancesClient::getEffectiveFirewallsAsync()} . + * + * @param GetEffectiveFirewallsInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return InstancesGetEffectiveFirewallsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function getEffectiveFirewalls(GetEffectiveFirewallsInstanceRequest $request, array $callOptions = []): InstancesGetEffectiveFirewallsResponse + { + return $this->startApiCall('GetEffectiveFirewalls', $request, $callOptions)->wait(); + } + + /** + * Returns the specified guest attributes entry. + * + * The async variant is {@see InstancesClient::getGuestAttributesAsync()} . + * + * @param GetGuestAttributesInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return GuestAttributes + * + * @throws ApiException Thrown if the API call fails. + */ + public function getGuestAttributes(GetGuestAttributesInstanceRequest $request, array $callOptions = []): GuestAttributes + { + return $this->startApiCall('GetGuestAttributes', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is {@see InstancesClient::getIamPolicyAsync()} . + * + * @param GetIamPolicyInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyInstanceRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns the screenshot from the specified instance. + * + * The async variant is {@see InstancesClient::getScreenshotAsync()} . + * + * @param GetScreenshotInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Screenshot + * + * @throws ApiException Thrown if the API call fails. + */ + public function getScreenshot(GetScreenshotInstanceRequest $request, array $callOptions = []): Screenshot + { + return $this->startApiCall('GetScreenshot', $request, $callOptions)->wait(); + } + + /** + * Returns the last 1 MB of serial port output from the specified instance. + * + * The async variant is {@see InstancesClient::getSerialPortOutputAsync()} . + * + * @param GetSerialPortOutputInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SerialPortOutput + * + * @throws ApiException Thrown if the API call fails. + */ + public function getSerialPortOutput(GetSerialPortOutputInstanceRequest $request, array $callOptions = []): SerialPortOutput + { + return $this->startApiCall('GetSerialPortOutput', $request, $callOptions)->wait(); + } + + /** + * Returns the Shielded Instance Identity of an instance + * + * The async variant is {@see InstancesClient::getShieldedInstanceIdentityAsync()} + * . + * + * @param GetShieldedInstanceIdentityInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ShieldedInstanceIdentity + * + * @throws ApiException Thrown if the API call fails. + */ + public function getShieldedInstanceIdentity(GetShieldedInstanceIdentityInstanceRequest $request, array $callOptions = []): ShieldedInstanceIdentity + { + return $this->startApiCall('GetShieldedInstanceIdentity', $request, $callOptions)->wait(); + } + + /** + * Creates an instance resource in the specified project using the data included in the request. + * + * The async variant is {@see InstancesClient::insertAsync()} . + * + * @param InsertInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of instances contained within the specified zone. + * + * The async variant is {@see InstancesClient::listAsync()} . + * + * @param ListInstancesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListInstancesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Retrieves a list of resources that refer to the VM instance specified in the request. For example, if the VM instance is part of a managed or unmanaged instance group, the referrers list includes the instance group. For more information, read Viewing referrers to VM instances. + * + * The async variant is {@see InstancesClient::listReferrersAsync()} . + * + * @param ListReferrersInstancesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listReferrers(ListReferrersInstancesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListReferrers', $request, $callOptions); + } + + /** + * Perform a manual maintenance on the instance. + * + * The async variant is {@see InstancesClient::performMaintenanceAsync()} . + * + * @param PerformMaintenanceInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function performMaintenance(PerformMaintenanceInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('PerformMaintenance', $request, $callOptions)->wait(); + } + + /** + * Removes resource policies from an instance. + * + * The async variant is {@see InstancesClient::removeResourcePoliciesAsync()} . + * + * @param RemoveResourcePoliciesInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function removeResourcePolicies(RemoveResourcePoliciesInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RemoveResourcePolicies', $request, $callOptions)->wait(); + } + + /** + * Performs a reset on the instance. This is a hard reset. The VM does not do a graceful shutdown. For more information, see Resetting an instance. + * + * The async variant is {@see InstancesClient::resetAsync()} . + * + * @param ResetInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function reset(ResetInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Reset', $request, $callOptions)->wait(); + } + + /** + * Resumes an instance that was suspended using the instances().suspend method. + * + * The async variant is {@see InstancesClient::resumeAsync()} . + * + * @param ResumeInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function resume(ResumeInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Resume', $request, $callOptions)->wait(); + } + + /** + * Sends diagnostic interrupt to the instance. + * + * The async variant is {@see InstancesClient::sendDiagnosticInterruptAsync()} . + * + * @param SendDiagnosticInterruptInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SendDiagnosticInterruptInstanceResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function sendDiagnosticInterrupt(SendDiagnosticInterruptInstanceRequest $request, array $callOptions = []): SendDiagnosticInterruptInstanceResponse + { + return $this->startApiCall('SendDiagnosticInterrupt', $request, $callOptions)->wait(); + } + + /** + * Sets deletion protection on the instance. + * + * The async variant is {@see InstancesClient::setDeletionProtectionAsync()} . + * + * @param SetDeletionProtectionInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setDeletionProtection(SetDeletionProtectionInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetDeletionProtection', $request, $callOptions)->wait(); + } + + /** + * Sets the auto-delete flag for a disk attached to an instance. + * + * The async variant is {@see InstancesClient::setDiskAutoDeleteAsync()} . + * + * @param SetDiskAutoDeleteInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setDiskAutoDelete(SetDiskAutoDeleteInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetDiskAutoDelete', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is {@see InstancesClient::setIamPolicyAsync()} . + * + * @param SetIamPolicyInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyInstanceRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. + * + * The async variant is {@see InstancesClient::setLabelsAsync()} . + * + * @param SetLabelsInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setLabels(SetLabelsInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetLabels', $request, $callOptions)->wait(); + } + + /** + * Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. + * + * The async variant is {@see InstancesClient::setMachineResourcesAsync()} . + * + * @param SetMachineResourcesInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setMachineResources(SetMachineResourcesInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetMachineResources', $request, $callOptions)->wait(); + } + + /** + * Changes the machine type for a stopped instance to the machine type specified in the request. + * + * The async variant is {@see InstancesClient::setMachineTypeAsync()} . + * + * @param SetMachineTypeInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setMachineType(SetMachineTypeInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetMachineType', $request, $callOptions)->wait(); + } + + /** + * Sets metadata for the specified instance to the data included in the request. + * + * The async variant is {@see InstancesClient::setMetadataAsync()} . + * + * @param SetMetadataInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setMetadata(SetMetadataInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetMetadata', $request, $callOptions)->wait(); + } + + /** + * Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform. + * + * The async variant is {@see InstancesClient::setMinCpuPlatformAsync()} . + * + * @param SetMinCpuPlatformInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setMinCpuPlatform(SetMinCpuPlatformInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetMinCpuPlatform', $request, $callOptions)->wait(); + } + + /** + * Sets name of an instance. + * + * The async variant is {@see InstancesClient::setNameAsync()} . + * + * @param SetNameInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setName(SetNameInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetName', $request, $callOptions)->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. + * + * The async variant is {@see InstancesClient::setSchedulingAsync()} . + * + * @param SetSchedulingInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setScheduling(SetSchedulingInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetScheduling', $request, $callOptions)->wait(); + } + + /** + * Sets the Google Cloud Armor security policy for the specified instance. For more information, see Google Cloud Armor Overview + * + * The async variant is {@see InstancesClient::setSecurityPolicyAsync()} . + * + * @param SetSecurityPolicyInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setSecurityPolicy(SetSecurityPolicyInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetSecurityPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. + * + * The async variant is {@see InstancesClient::setServiceAccountAsync()} . + * + * @param SetServiceAccountInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setServiceAccount(SetServiceAccountInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetServiceAccount', $request, $callOptions)->wait(); + } + + /** + * Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * The async variant is + * {@see InstancesClient::setShieldedInstanceIntegrityPolicyAsync()} . + * + * @param SetShieldedInstanceIntegrityPolicyInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setShieldedInstanceIntegrityPolicy(SetShieldedInstanceIntegrityPolicyInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetShieldedInstanceIntegrityPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets network tags for the specified instance to the data included in the request. + * + * The async variant is {@see InstancesClient::setTagsAsync()} . + * + * @param SetTagsInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setTags(SetTagsInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetTags', $request, $callOptions)->wait(); + } + + /** + * Simulates a host maintenance event on a VM. For more information, see Simulate a host maintenance event. + * + * The async variant is {@see InstancesClient::simulateMaintenanceEventAsync()} . + * + * @param SimulateMaintenanceEventInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function simulateMaintenanceEvent(SimulateMaintenanceEventInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SimulateMaintenanceEvent', $request, $callOptions)->wait(); + } + + /** + * Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. + * + * The async variant is {@see InstancesClient::startAsync()} . + * + * @param StartInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function start(StartInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Start', $request, $callOptions)->wait(); + } + + /** + * Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. + * + * The async variant is {@see InstancesClient::startWithEncryptionKeyAsync()} . + * + * @param StartWithEncryptionKeyInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function startWithEncryptionKey(StartWithEncryptionKeyInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('StartWithEncryptionKey', $request, $callOptions)->wait(); + } + + /** + * Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. + * + * The async variant is {@see InstancesClient::stopAsync()} . + * + * @param StopInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function stop(StopInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Stop', $request, $callOptions)->wait(); + } + + /** + * This method suspends a running instance, saving its state to persistent storage, and allows you to resume the instance at a later time. Suspended instances have no compute costs (cores or RAM), and incur only storage charges for the saved VM memory and localSSD data. Any charged resources the virtual machine was using, such as persistent disks and static IP addresses, will continue to be charged while the instance is suspended. For more information, see Suspending and resuming an instance. + * + * The async variant is {@see InstancesClient::suspendAsync()} . + * + * @param SuspendInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function suspend(SuspendInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Suspend', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is {@see InstancesClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsInstanceRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } + + /** + * Updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties. + * + * The async variant is {@see InstancesClient::updateAsync()} . + * + * @param UpdateInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function update(UpdateInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Update', $request, $callOptions)->wait(); + } + + /** + * Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * The async variant is {@see InstancesClient::updateAccessConfigAsync()} . + * + * @param UpdateAccessConfigInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateAccessConfig(UpdateAccessConfigInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateAccessConfig', $request, $callOptions)->wait(); + } + + /** + * Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * The async variant is {@see InstancesClient::updateDisplayDeviceAsync()} . + * + * @param UpdateDisplayDeviceInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateDisplayDevice(UpdateDisplayDeviceInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateDisplayDevice', $request, $callOptions)->wait(); + } + + /** + * Updates an instance's network interface. This method can only update an interface's alias IP range and attached network. See Modifying alias IP ranges for an existing instance for instructions on changing alias IP ranges. See Migrating a VM between networks for instructions on migrating an interface. This method follows PATCH semantics. + * + * The async variant is {@see InstancesClient::updateNetworkInterfaceAsync()} . + * + * @param UpdateNetworkInterfaceInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateNetworkInterface(UpdateNetworkInterfaceInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateNetworkInterface', $request, $callOptions)->wait(); + } + + /** + * Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * The async variant is {@see InstancesClient::updateShieldedInstanceConfigAsync()} + * . + * + * @param UpdateShieldedInstanceConfigInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateShieldedInstanceConfig(UpdateShieldedInstanceConfigInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateShieldedInstanceConfig', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/InstantSnapshotsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/InstantSnapshotsClient.php new file mode 100644 index 000000000000..1c5d71f0b965 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/InstantSnapshotsClient.php @@ -0,0 +1,464 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/instant_snapshots_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/instant_snapshots_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/instant_snapshots_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of instantSnapshots. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see InstantSnapshotsClient::aggregatedListAsync()} . + * + * @param AggregatedListInstantSnapshotsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListInstantSnapshotsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified InstantSnapshot resource. Keep in mind that deleting a single instantSnapshot might not necessarily delete all the data on that instantSnapshot. If any data on the instantSnapshot that is marked for deletion is needed for subsequent instantSnapshots, the data will be moved to the next corresponding instantSnapshot. For more information, see Deleting instantSnapshots. + * + * The async variant is {@see InstantSnapshotsClient::deleteAsync()} . + * + * @param DeleteInstantSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteInstantSnapshotRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified InstantSnapshot resource in the specified zone. + * + * The async variant is {@see InstantSnapshotsClient::getAsync()} . + * + * @param GetInstantSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return InstantSnapshot + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetInstantSnapshotRequest $request, array $callOptions = []): InstantSnapshot + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is {@see InstantSnapshotsClient::getIamPolicyAsync()} . + * + * @param GetIamPolicyInstantSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyInstantSnapshotRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Creates an instant snapshot in the specified zone. + * + * The async variant is {@see InstantSnapshotsClient::insertAsync()} . + * + * @param InsertInstantSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertInstantSnapshotRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of InstantSnapshot resources contained within the specified zone. + * + * The async variant is {@see InstantSnapshotsClient::listAsync()} . + * + * @param ListInstantSnapshotsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListInstantSnapshotsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is {@see InstantSnapshotsClient::setIamPolicyAsync()} . + * + * @param SetIamPolicyInstantSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyInstantSnapshotRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the labels on a instantSnapshot in the given zone. To learn more about labels, read the Labeling Resources documentation. + * + * The async variant is {@see InstantSnapshotsClient::setLabelsAsync()} . + * + * @param SetLabelsInstantSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setLabels(SetLabelsInstantSnapshotRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetLabels', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is {@see InstantSnapshotsClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsInstantSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsInstantSnapshotRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/InterconnectAttachmentsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/InterconnectAttachmentsClient.php new file mode 100644 index 000000000000..16831dd0d46d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/InterconnectAttachmentsClient.php @@ -0,0 +1,411 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/interconnect_attachments_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/interconnect_attachments_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/interconnect_attachments_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of interconnect attachments. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see InterconnectAttachmentsClient::aggregatedListAsync()} + * . + * + * @param AggregatedListInterconnectAttachmentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListInterconnectAttachmentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified interconnect attachment. + * + * The async variant is {@see InterconnectAttachmentsClient::deleteAsync()} . + * + * @param DeleteInterconnectAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteInterconnectAttachmentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified interconnect attachment. + * + * The async variant is {@see InterconnectAttachmentsClient::getAsync()} . + * + * @param GetInterconnectAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return InterconnectAttachment + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetInterconnectAttachmentRequest $request, array $callOptions = []): InterconnectAttachment + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates an InterconnectAttachment in the specified project using the data included in the request. + * + * The async variant is {@see InterconnectAttachmentsClient::insertAsync()} . + * + * @param InsertInterconnectAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertInterconnectAttachmentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of interconnect attachments contained within the specified region. + * + * The async variant is {@see InterconnectAttachmentsClient::listAsync()} . + * + * @param ListInterconnectAttachmentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListInterconnectAttachmentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Updates the specified interconnect attachment with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * The async variant is {@see InterconnectAttachmentsClient::patchAsync()} . + * + * @param PatchInterconnectAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchInterconnectAttachmentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Sets the labels on an InterconnectAttachment. To learn more about labels, read the Labeling Resources documentation. + * + * The async variant is {@see InterconnectAttachmentsClient::setLabelsAsync()} . + * + * @param SetLabelsInterconnectAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setLabels(SetLabelsInterconnectAttachmentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetLabels', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/InterconnectLocationsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/InterconnectLocationsClient.php new file mode 100644 index 000000000000..e87dab1baa1c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/InterconnectLocationsClient.php @@ -0,0 +1,227 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/interconnect_locations_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/interconnect_locations_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/interconnect_locations_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request. + * + * The async variant is {@see InterconnectLocationsClient::getAsync()} . + * + * @param GetInterconnectLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return InterconnectLocation + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetInterconnectLocationRequest $request, array $callOptions = []): InterconnectLocation + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of interconnect locations available to the specified project. + * + * The async variant is {@see InterconnectLocationsClient::listAsync()} . + * + * @param ListInterconnectLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListInterconnectLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/InterconnectRemoteLocationsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/InterconnectRemoteLocationsClient.php new file mode 100644 index 000000000000..1b49c6d846f0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/InterconnectRemoteLocationsClient.php @@ -0,0 +1,227 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/interconnect_remote_locations_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/interconnect_remote_locations_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/interconnect_remote_locations_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Returns the details for the specified interconnect remote location. Gets a list of available interconnect remote locations by making a list() request. + * + * The async variant is {@see InterconnectRemoteLocationsClient::getAsync()} . + * + * @param GetInterconnectRemoteLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return InterconnectRemoteLocation + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetInterconnectRemoteLocationRequest $request, array $callOptions = []): InterconnectRemoteLocation + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of interconnect remote locations available to the specified project. + * + * The async variant is {@see InterconnectRemoteLocationsClient::listAsync()} . + * + * @param ListInterconnectRemoteLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListInterconnectRemoteLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/InterconnectsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/InterconnectsClient.php new file mode 100644 index 000000000000..f0408e8fc98f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/InterconnectsClient.php @@ -0,0 +1,437 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/interconnects_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/interconnects_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/interconnects_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified Interconnect. + * + * The async variant is {@see InterconnectsClient::deleteAsync()} . + * + * @param DeleteInterconnectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteInterconnectRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified Interconnect. Get a list of available Interconnects by making a list() request. + * + * The async variant is {@see InterconnectsClient::getAsync()} . + * + * @param GetInterconnectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Interconnect + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetInterconnectRequest $request, array $callOptions = []): Interconnect + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Returns the interconnectDiagnostics for the specified Interconnect. In the event of a global outage, do not use this API to make decisions about where to redirect your network traffic. Unlike a VLAN attachment, which is regional, a Cloud Interconnect connection is a global resource. A global outage can prevent this API from functioning properly. + * + * The async variant is {@see InterconnectsClient::getDiagnosticsAsync()} . + * + * @param GetDiagnosticsInterconnectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return InterconnectsGetDiagnosticsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function getDiagnostics(GetDiagnosticsInterconnectRequest $request, array $callOptions = []): InterconnectsGetDiagnosticsResponse + { + return $this->startApiCall('GetDiagnostics', $request, $callOptions)->wait(); + } + + /** + * Returns the interconnectMacsecConfig for the specified Interconnect. + * + * The async variant is {@see InterconnectsClient::getMacsecConfigAsync()} . + * + * @param GetMacsecConfigInterconnectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return InterconnectsGetMacsecConfigResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function getMacsecConfig(GetMacsecConfigInterconnectRequest $request, array $callOptions = []): InterconnectsGetMacsecConfigResponse + { + return $this->startApiCall('GetMacsecConfig', $request, $callOptions)->wait(); + } + + /** + * Creates an Interconnect in the specified project using the data included in the request. + * + * The async variant is {@see InterconnectsClient::insertAsync()} . + * + * @param InsertInterconnectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertInterconnectRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of Interconnects available to the specified project. + * + * The async variant is {@see InterconnectsClient::listAsync()} . + * + * @param ListInterconnectsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListInterconnectsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Updates the specified Interconnect with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * The async variant is {@see InterconnectsClient::patchAsync()} . + * + * @param PatchInterconnectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchInterconnectRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Sets the labels on an Interconnect. To learn more about labels, read the Labeling Resources documentation. + * + * The async variant is {@see InterconnectsClient::setLabelsAsync()} . + * + * @param SetLabelsInterconnectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setLabels(SetLabelsInterconnectRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetLabels', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/LicenseCodesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/LicenseCodesClient.php new file mode 100644 index 000000000000..eb7c70741f6e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/LicenseCodesClient.php @@ -0,0 +1,227 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/license_codes_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/license_codes_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/license_codes_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * The async variant is {@see LicenseCodesClient::getAsync()} . + * + * @param GetLicenseCodeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return LicenseCode + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetLicenseCodeRequest $request, array $callOptions = []): LicenseCode + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * The async variant is {@see LicenseCodesClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsLicenseCodeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsLicenseCodeRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/LicensesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/LicensesClient.php new file mode 100644 index 000000000000..a6d4378508c4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/LicensesClient.php @@ -0,0 +1,411 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/licenses_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/licenses_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/licenses_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified license. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * The async variant is {@see LicensesClient::deleteAsync()} . + * + * @param DeleteLicenseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteLicenseRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified License resource. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * The async variant is {@see LicensesClient::getAsync()} . + * + * @param GetLicenseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return License + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetLicenseRequest $request, array $callOptions = []): License + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * The async variant is {@see LicensesClient::getIamPolicyAsync()} . + * + * @param GetIamPolicyLicenseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyLicenseRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Create a License resource in the specified project. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * The async variant is {@see LicensesClient::insertAsync()} . + * + * @param InsertLicenseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertLicenseRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of licenses available in the specified project. This method does not get any licenses that belong to other projects, including licenses attached to publicly-available images, like Debian 9. If you want to get a list of publicly-available licenses, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * The async variant is {@see LicensesClient::listAsync()} . + * + * @param ListLicensesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListLicensesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * The async variant is {@see LicensesClient::setIamPolicyAsync()} . + * + * @param SetIamPolicyLicenseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyLicenseRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * The async variant is {@see LicensesClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsLicenseRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsLicenseRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/MachineImagesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/MachineImagesClient.php new file mode 100644 index 000000000000..34f9e7fe6e65 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/MachineImagesClient.php @@ -0,0 +1,411 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/machine_images_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/machine_images_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/machine_images_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified machine image. Deleting a machine image is permanent and cannot be undone. + * + * The async variant is {@see MachineImagesClient::deleteAsync()} . + * + * @param DeleteMachineImageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteMachineImageRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified machine image. + * + * The async variant is {@see MachineImagesClient::getAsync()} . + * + * @param GetMachineImageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return MachineImage + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetMachineImageRequest $request, array $callOptions = []): MachineImage + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is {@see MachineImagesClient::getIamPolicyAsync()} . + * + * @param GetIamPolicyMachineImageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyMachineImageRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Creates a machine image in the specified project using the data that is included in the request. If you are creating a new machine image to update an existing instance, your new machine image should use the same network or, if applicable, the same subnetwork as the original instance. + * + * The async variant is {@see MachineImagesClient::insertAsync()} . + * + * @param InsertMachineImageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertMachineImageRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of machine images that are contained within the specified project. + * + * The async variant is {@see MachineImagesClient::listAsync()} . + * + * @param ListMachineImagesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListMachineImagesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is {@see MachineImagesClient::setIamPolicyAsync()} . + * + * @param SetIamPolicyMachineImageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyMachineImageRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is {@see MachineImagesClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsMachineImageRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsMachineImageRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/MachineTypesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/MachineTypesClient.php new file mode 100644 index 000000000000..e17d8e0c53e8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/MachineTypesClient.php @@ -0,0 +1,253 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/machine_types_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/machine_types_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/machine_types_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of machine types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see MachineTypesClient::aggregatedListAsync()} . + * + * @param AggregatedListMachineTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListMachineTypesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Returns the specified machine type. + * + * The async variant is {@see MachineTypesClient::getAsync()} . + * + * @param GetMachineTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return MachineType + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetMachineTypeRequest $request, array $callOptions = []): MachineType + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of machine types available to the specified project. + * + * The async variant is {@see MachineTypesClient::listAsync()} . + * + * @param ListMachineTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListMachineTypesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/NetworkAttachmentsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/NetworkAttachmentsClient.php new file mode 100644 index 000000000000..a9367ccfbf0c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/NetworkAttachmentsClient.php @@ -0,0 +1,465 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/network_attachments_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/network_attachments_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/network_attachments_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves the list of all NetworkAttachment resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see NetworkAttachmentsClient::aggregatedListAsync()} . + * + * @param AggregatedListNetworkAttachmentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListNetworkAttachmentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified NetworkAttachment in the given scope + * + * The async variant is {@see NetworkAttachmentsClient::deleteAsync()} . + * + * @param DeleteNetworkAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteNetworkAttachmentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified NetworkAttachment resource in the given scope. + * + * The async variant is {@see NetworkAttachmentsClient::getAsync()} . + * + * @param GetNetworkAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NetworkAttachment + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetNetworkAttachmentRequest $request, array $callOptions = []): NetworkAttachment + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is {@see NetworkAttachmentsClient::getIamPolicyAsync()} . + * + * @param GetIamPolicyNetworkAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyNetworkAttachmentRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Creates a NetworkAttachment in the specified project in the given scope using the parameters that are included in the request. + * + * The async variant is {@see NetworkAttachmentsClient::insertAsync()} . + * + * @param InsertNetworkAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertNetworkAttachmentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Lists the NetworkAttachments for a project in the given scope. + * + * The async variant is {@see NetworkAttachmentsClient::listAsync()} . + * + * @param ListNetworkAttachmentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListNetworkAttachmentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Patches the specified NetworkAttachment resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * The async variant is {@see NetworkAttachmentsClient::patchAsync()} . + * + * @param PatchNetworkAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchNetworkAttachmentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is {@see NetworkAttachmentsClient::setIamPolicyAsync()} . + * + * @param SetIamPolicyNetworkAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyNetworkAttachmentRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is {@see NetworkAttachmentsClient::testIamPermissionsAsync()} + * . + * + * @param TestIamPermissionsNetworkAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsNetworkAttachmentRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/NetworkEdgeSecurityServicesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/NetworkEdgeSecurityServicesClient.php new file mode 100644 index 000000000000..66080559c823 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/NetworkEdgeSecurityServicesClient.php @@ -0,0 +1,359 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/network_edge_security_services_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/network_edge_security_services_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/network_edge_security_services_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves the list of all NetworkEdgeSecurityService resources available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is + * {@see NetworkEdgeSecurityServicesClient::aggregatedListAsync()} . + * + * @param AggregatedListNetworkEdgeSecurityServicesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListNetworkEdgeSecurityServicesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified service. + * + * The async variant is {@see NetworkEdgeSecurityServicesClient::deleteAsync()} . + * + * @param DeleteNetworkEdgeSecurityServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteNetworkEdgeSecurityServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Gets a specified NetworkEdgeSecurityService. + * + * The async variant is {@see NetworkEdgeSecurityServicesClient::getAsync()} . + * + * @param GetNetworkEdgeSecurityServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NetworkEdgeSecurityService + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetNetworkEdgeSecurityServiceRequest $request, array $callOptions = []): NetworkEdgeSecurityService + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a new service in the specified project using the data included in the request. + * + * The async variant is {@see NetworkEdgeSecurityServicesClient::insertAsync()} . + * + * @param InsertNetworkEdgeSecurityServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertNetworkEdgeSecurityServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Patches the specified policy with the data included in the request. + * + * The async variant is {@see NetworkEdgeSecurityServicesClient::patchAsync()} . + * + * @param PatchNetworkEdgeSecurityServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchNetworkEdgeSecurityServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/NetworkEndpointGroupsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/NetworkEndpointGroupsClient.php new file mode 100644 index 000000000000..859e04b9bab4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/NetworkEndpointGroupsClient.php @@ -0,0 +1,467 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/network_endpoint_groups_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/network_endpoint_groups_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/network_endpoint_groups_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves the list of network endpoint groups and sorts them by zone. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see NetworkEndpointGroupsClient::aggregatedListAsync()} . + * + * @param AggregatedListNetworkEndpointGroupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListNetworkEndpointGroupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Attach a list of network endpoints to the specified network endpoint group. + * + * The async variant is + * {@see NetworkEndpointGroupsClient::attachNetworkEndpointsAsync()} . + * + * @param AttachNetworkEndpointsNetworkEndpointGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function attachNetworkEndpoints(AttachNetworkEndpointsNetworkEndpointGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AttachNetworkEndpoints', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified network endpoint group. The network endpoints in the NEG and the VM instances they belong to are not terminated when the NEG is deleted. Note that the NEG cannot be deleted if there are backend services referencing it. + * + * The async variant is {@see NetworkEndpointGroupsClient::deleteAsync()} . + * + * @param DeleteNetworkEndpointGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteNetworkEndpointGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Detach a list of network endpoints from the specified network endpoint group. + * + * The async variant is + * {@see NetworkEndpointGroupsClient::detachNetworkEndpointsAsync()} . + * + * @param DetachNetworkEndpointsNetworkEndpointGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function detachNetworkEndpoints(DetachNetworkEndpointsNetworkEndpointGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DetachNetworkEndpoints', $request, $callOptions)->wait(); + } + + /** + * Returns the specified network endpoint group. + * + * The async variant is {@see NetworkEndpointGroupsClient::getAsync()} . + * + * @param GetNetworkEndpointGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NetworkEndpointGroup + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetNetworkEndpointGroupRequest $request, array $callOptions = []): NetworkEndpointGroup + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a network endpoint group in the specified project using the parameters that are included in the request. + * + * The async variant is {@see NetworkEndpointGroupsClient::insertAsync()} . + * + * @param InsertNetworkEndpointGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertNetworkEndpointGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of network endpoint groups that are located in the specified project and zone. + * + * The async variant is {@see NetworkEndpointGroupsClient::listAsync()} . + * + * @param ListNetworkEndpointGroupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListNetworkEndpointGroupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Lists the network endpoints in the specified network endpoint group. + * + * The async variant is + * {@see NetworkEndpointGroupsClient::listNetworkEndpointsAsync()} . + * + * @param ListNetworkEndpointsNetworkEndpointGroupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listNetworkEndpoints(ListNetworkEndpointsNetworkEndpointGroupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListNetworkEndpoints', $request, $callOptions); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is + * {@see NetworkEndpointGroupsClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsNetworkEndpointGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsNetworkEndpointGroupRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/NetworkFirewallPoliciesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/NetworkFirewallPoliciesClient.php new file mode 100644 index 000000000000..272d27983718 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/NetworkFirewallPoliciesClient.php @@ -0,0 +1,651 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/network_firewall_policies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/network_firewall_policies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/network_firewall_policies_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Inserts an association for the specified firewall policy. + * + * The async variant is {@see NetworkFirewallPoliciesClient::addAssociationAsync()} + * . + * + * @param AddAssociationNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function addAssociation(AddAssociationNetworkFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AddAssociation', $request, $callOptions)->wait(); + } + + /** + * Inserts a rule into a firewall policy. + * + * The async variant is {@see NetworkFirewallPoliciesClient::addRuleAsync()} . + * + * @param AddRuleNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function addRule(AddRuleNetworkFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AddRule', $request, $callOptions)->wait(); + } + + /** + * Copies rules to the specified firewall policy. + * + * The async variant is {@see NetworkFirewallPoliciesClient::cloneRulesAsync()} . + * + * @param CloneRulesNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function cloneRules(CloneRulesNetworkFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CloneRules', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified policy. + * + * The async variant is {@see NetworkFirewallPoliciesClient::deleteAsync()} . + * + * @param DeleteNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteNetworkFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified network firewall policy. + * + * The async variant is {@see NetworkFirewallPoliciesClient::getAsync()} . + * + * @param GetNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FirewallPolicy + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetNetworkFirewallPolicyRequest $request, array $callOptions = []): FirewallPolicy + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets an association with the specified name. + * + * The async variant is {@see NetworkFirewallPoliciesClient::getAssociationAsync()} + * . + * + * @param GetAssociationNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FirewallPolicyAssociation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAssociation(GetAssociationNetworkFirewallPolicyRequest $request, array $callOptions = []): FirewallPolicyAssociation + { + return $this->startApiCall('GetAssociation', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is {@see NetworkFirewallPoliciesClient::getIamPolicyAsync()} . + * + * @param GetIamPolicyNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyNetworkFirewallPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Gets a rule of the specified priority. + * + * The async variant is {@see NetworkFirewallPoliciesClient::getRuleAsync()} . + * + * @param GetRuleNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FirewallPolicyRule + * + * @throws ApiException Thrown if the API call fails. + */ + public function getRule(GetRuleNetworkFirewallPolicyRequest $request, array $callOptions = []): FirewallPolicyRule + { + return $this->startApiCall('GetRule', $request, $callOptions)->wait(); + } + + /** + * Creates a new policy in the specified project using the data included in the request. + * + * The async variant is {@see NetworkFirewallPoliciesClient::insertAsync()} . + * + * @param InsertNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertNetworkFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Lists all the policies that have been configured for the specified project. + * + * The async variant is {@see NetworkFirewallPoliciesClient::listAsync()} . + * + * @param ListNetworkFirewallPoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListNetworkFirewallPoliciesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Patches the specified policy with the data included in the request. + * + * The async variant is {@see NetworkFirewallPoliciesClient::patchAsync()} . + * + * @param PatchNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchNetworkFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Patches a rule of the specified priority. + * + * The async variant is {@see NetworkFirewallPoliciesClient::patchRuleAsync()} . + * + * @param PatchRuleNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patchRule(PatchRuleNetworkFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('PatchRule', $request, $callOptions)->wait(); + } + + /** + * Removes an association for the specified firewall policy. + * + * The async variant is + * {@see NetworkFirewallPoliciesClient::removeAssociationAsync()} . + * + * @param RemoveAssociationNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function removeAssociation(RemoveAssociationNetworkFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RemoveAssociation', $request, $callOptions)->wait(); + } + + /** + * Deletes a rule of the specified priority. + * + * The async variant is {@see NetworkFirewallPoliciesClient::removeRuleAsync()} . + * + * @param RemoveRuleNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function removeRule(RemoveRuleNetworkFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RemoveRule', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is {@see NetworkFirewallPoliciesClient::setIamPolicyAsync()} . + * + * @param SetIamPolicyNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyNetworkFirewallPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is + * {@see NetworkFirewallPoliciesClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsNetworkFirewallPolicyRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/NetworksClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/NetworksClient.php new file mode 100644 index 000000000000..212a594fee54 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/NetworksClient.php @@ -0,0 +1,514 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/networks_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/networks_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/networks_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Adds a peering to the specified network. + * + * The async variant is {@see NetworksClient::addPeeringAsync()} . + * + * @param AddPeeringNetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function addPeering(AddPeeringNetworkRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AddPeering', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified network. + * + * The async variant is {@see NetworksClient::deleteAsync()} . + * + * @param DeleteNetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteNetworkRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified network. + * + * The async variant is {@see NetworksClient::getAsync()} . + * + * @param GetNetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Network + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetNetworkRequest $request, array $callOptions = []): Network + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Returns the effective firewalls on a given network. + * + * The async variant is {@see NetworksClient::getEffectiveFirewallsAsync()} . + * + * @param GetEffectiveFirewallsNetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NetworksGetEffectiveFirewallsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function getEffectiveFirewalls(GetEffectiveFirewallsNetworkRequest $request, array $callOptions = []): NetworksGetEffectiveFirewallsResponse + { + return $this->startApiCall('GetEffectiveFirewalls', $request, $callOptions)->wait(); + } + + /** + * Creates a network in the specified project using the data included in the request. + * + * The async variant is {@see NetworksClient::insertAsync()} . + * + * @param InsertNetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertNetworkRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of networks available to the specified project. + * + * The async variant is {@see NetworksClient::listAsync()} . + * + * @param ListNetworksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListNetworksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Lists the peering routes exchanged over peering connection. + * + * The async variant is {@see NetworksClient::listPeeringRoutesAsync()} . + * + * @param ListPeeringRoutesNetworksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listPeeringRoutes(ListPeeringRoutesNetworksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListPeeringRoutes', $request, $callOptions); + } + + /** + * Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode. + * + * The async variant is {@see NetworksClient::patchAsync()} . + * + * @param PatchNetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchNetworkRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Removes a peering from the specified network. + * + * The async variant is {@see NetworksClient::removePeeringAsync()} . + * + * @param RemovePeeringNetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function removePeering(RemovePeeringNetworkRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RemovePeering', $request, $callOptions)->wait(); + } + + /** + * Switches the network mode from auto subnet mode to custom subnet mode. + * + * The async variant is {@see NetworksClient::switchToCustomModeAsync()} . + * + * @param SwitchToCustomModeNetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function switchToCustomMode(SwitchToCustomModeNetworkRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SwitchToCustomMode', $request, $callOptions)->wait(); + } + + /** + * Updates the specified network peering with the data included in the request. You can only modify the NetworkPeering.export_custom_routes field and the NetworkPeering.import_custom_routes field. + * + * The async variant is {@see NetworksClient::updatePeeringAsync()} . + * + * @param UpdatePeeringNetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updatePeering(UpdatePeeringNetworkRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdatePeering', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/NodeGroupsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/NodeGroupsClient.php new file mode 100644 index 000000000000..c88da0607d62 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/NodeGroupsClient.php @@ -0,0 +1,620 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/node_groups_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/node_groups_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/node_groups_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Adds specified number of nodes to the node group. + * + * The async variant is {@see NodeGroupsClient::addNodesAsync()} . + * + * @param AddNodesNodeGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function addNodes(AddNodesNodeGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AddNodes', $request, $callOptions)->wait(); + } + + /** + * Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see NodeGroupsClient::aggregatedListAsync()} . + * + * @param AggregatedListNodeGroupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListNodeGroupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified NodeGroup resource. + * + * The async variant is {@see NodeGroupsClient::deleteAsync()} . + * + * @param DeleteNodeGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteNodeGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Deletes specified nodes from the node group. + * + * The async variant is {@see NodeGroupsClient::deleteNodesAsync()} . + * + * @param DeleteNodesNodeGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteNodes(DeleteNodesNodeGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteNodes', $request, $callOptions)->wait(); + } + + /** + * Returns the specified NodeGroup. Get a list of available NodeGroups by making a list() request. Note: the "nodes" field should not be used. Use nodeGroups.listNodes instead. + * + * The async variant is {@see NodeGroupsClient::getAsync()} . + * + * @param GetNodeGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NodeGroup + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetNodeGroupRequest $request, array $callOptions = []): NodeGroup + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is {@see NodeGroupsClient::getIamPolicyAsync()} . + * + * @param GetIamPolicyNodeGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyNodeGroupRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Creates a NodeGroup resource in the specified project using the data included in the request. + * + * The async variant is {@see NodeGroupsClient::insertAsync()} . + * + * @param InsertNodeGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertNodeGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group. + * + * The async variant is {@see NodeGroupsClient::listAsync()} . + * + * @param ListNodeGroupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListNodeGroupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Lists nodes in the node group. + * + * The async variant is {@see NodeGroupsClient::listNodesAsync()} . + * + * @param ListNodesNodeGroupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listNodes(ListNodesNodeGroupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListNodes', $request, $callOptions); + } + + /** + * Updates the specified node group. + * + * The async variant is {@see NodeGroupsClient::patchAsync()} . + * + * @param PatchNodeGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchNodeGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Perform maintenance on a subset of nodes in the node group. + * + * The async variant is {@see NodeGroupsClient::performMaintenanceAsync()} . + * + * @param PerformMaintenanceNodeGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function performMaintenance(PerformMaintenanceNodeGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('PerformMaintenance', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is {@see NodeGroupsClient::setIamPolicyAsync()} . + * + * @param SetIamPolicyNodeGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyNodeGroupRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Updates the node template of the node group. + * + * The async variant is {@see NodeGroupsClient::setNodeTemplateAsync()} . + * + * @param SetNodeTemplateNodeGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setNodeTemplate(SetNodeTemplateNodeGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetNodeTemplate', $request, $callOptions)->wait(); + } + + /** + * Simulates maintenance event on specified nodes from the node group. + * + * The async variant is {@see NodeGroupsClient::simulateMaintenanceEventAsync()} . + * + * @param SimulateMaintenanceEventNodeGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function simulateMaintenanceEvent(SimulateMaintenanceEventNodeGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SimulateMaintenanceEvent', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is {@see NodeGroupsClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsNodeGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsNodeGroupRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/NodeTemplatesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/NodeTemplatesClient.php new file mode 100644 index 000000000000..b55cab828b30 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/NodeTemplatesClient.php @@ -0,0 +1,438 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/node_templates_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/node_templates_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/node_templates_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of node templates. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see NodeTemplatesClient::aggregatedListAsync()} . + * + * @param AggregatedListNodeTemplatesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListNodeTemplatesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified NodeTemplate resource. + * + * The async variant is {@see NodeTemplatesClient::deleteAsync()} . + * + * @param DeleteNodeTemplateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteNodeTemplateRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified node template. + * + * The async variant is {@see NodeTemplatesClient::getAsync()} . + * + * @param GetNodeTemplateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NodeTemplate + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetNodeTemplateRequest $request, array $callOptions = []): NodeTemplate + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is {@see NodeTemplatesClient::getIamPolicyAsync()} . + * + * @param GetIamPolicyNodeTemplateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyNodeTemplateRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Creates a NodeTemplate resource in the specified project using the data included in the request. + * + * The async variant is {@see NodeTemplatesClient::insertAsync()} . + * + * @param InsertNodeTemplateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertNodeTemplateRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of node templates available to the specified project. + * + * The async variant is {@see NodeTemplatesClient::listAsync()} . + * + * @param ListNodeTemplatesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListNodeTemplatesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is {@see NodeTemplatesClient::setIamPolicyAsync()} . + * + * @param SetIamPolicyNodeTemplateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyNodeTemplateRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is {@see NodeTemplatesClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsNodeTemplateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsNodeTemplateRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/NodeTypesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/NodeTypesClient.php new file mode 100644 index 000000000000..7407ae1f9fc6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/NodeTypesClient.php @@ -0,0 +1,253 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/node_types_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/node_types_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/node_types_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of node types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see NodeTypesClient::aggregatedListAsync()} . + * + * @param AggregatedListNodeTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListNodeTypesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Returns the specified node type. + * + * The async variant is {@see NodeTypesClient::getAsync()} . + * + * @param GetNodeTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NodeType + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetNodeTypeRequest $request, array $callOptions = []): NodeType + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of node types available to the specified project. + * + * The async variant is {@see NodeTypesClient::listAsync()} . + * + * @param ListNodeTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListNodeTypesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/PacketMirroringsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/PacketMirroringsClient.php new file mode 100644 index 000000000000..9ea5c9f3736a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/PacketMirroringsClient.php @@ -0,0 +1,411 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/packet_mirrorings_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/packet_mirrorings_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/packet_mirrorings_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of packetMirrorings. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see PacketMirroringsClient::aggregatedListAsync()} . + * + * @param AggregatedListPacketMirroringsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListPacketMirroringsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified PacketMirroring resource. + * + * The async variant is {@see PacketMirroringsClient::deleteAsync()} . + * + * @param DeletePacketMirroringRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeletePacketMirroringRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified PacketMirroring resource. + * + * The async variant is {@see PacketMirroringsClient::getAsync()} . + * + * @param GetPacketMirroringRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PacketMirroring + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetPacketMirroringRequest $request, array $callOptions = []): PacketMirroring + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a PacketMirroring resource in the specified project and region using the data included in the request. + * + * The async variant is {@see PacketMirroringsClient::insertAsync()} . + * + * @param InsertPacketMirroringRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertPacketMirroringRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of PacketMirroring resources available to the specified project and region. + * + * The async variant is {@see PacketMirroringsClient::listAsync()} . + * + * @param ListPacketMirroringsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListPacketMirroringsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Patches the specified PacketMirroring resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * The async variant is {@see PacketMirroringsClient::patchAsync()} . + * + * @param PatchPacketMirroringRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchPacketMirroringRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is {@see PacketMirroringsClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsPacketMirroringRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsPacketMirroringRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/ProjectsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/ProjectsClient.php new file mode 100644 index 000000000000..d21a28153c4a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/ProjectsClient.php @@ -0,0 +1,591 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/projects_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/projects_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/projects_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Disable this project as a shared VPC host project. + * + * The async variant is {@see ProjectsClient::disableXpnHostAsync()} . + * + * @param DisableXpnHostProjectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function disableXpnHost(DisableXpnHostProjectRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DisableXpnHost', $request, $callOptions)->wait(); + } + + /** + * Disable a service resource (also known as service project) associated with this host project. + * + * The async variant is {@see ProjectsClient::disableXpnResourceAsync()} . + * + * @param DisableXpnResourceProjectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function disableXpnResource(DisableXpnResourceProjectRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DisableXpnResource', $request, $callOptions)->wait(); + } + + /** + * Enable this project as a shared VPC host project. + * + * The async variant is {@see ProjectsClient::enableXpnHostAsync()} . + * + * @param EnableXpnHostProjectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function enableXpnHost(EnableXpnHostProjectRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('EnableXpnHost', $request, $callOptions)->wait(); + } + + /** + * Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project. + * + * The async variant is {@see ProjectsClient::enableXpnResourceAsync()} . + * + * @param EnableXpnResourceProjectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function enableXpnResource(EnableXpnResourceProjectRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('EnableXpnResource', $request, $callOptions)->wait(); + } + + /** + * Returns the specified Project 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. + * + * The async variant is {@see ProjectsClient::getAsync()} . + * + * @param GetProjectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Project + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetProjectRequest $request, array $callOptions = []): Project + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets the shared VPC host project that this project links to. May be empty if no link exists. + * + * The async variant is {@see ProjectsClient::getXpnHostAsync()} . + * + * @param GetXpnHostProjectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Project + * + * @throws ApiException Thrown if the API call fails. + */ + public function getXpnHost(GetXpnHostProjectRequest $request, array $callOptions = []): Project + { + return $this->startApiCall('GetXpnHost', $request, $callOptions)->wait(); + } + + /** + * Gets service resources (a.k.a service project) associated with this host project. + * + * The async variant is {@see ProjectsClient::getXpnResourcesAsync()} . + * + * @param GetXpnResourcesProjectsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function getXpnResources(GetXpnResourcesProjectsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('GetXpnResources', $request, $callOptions); + } + + /** + * Lists all shared VPC host projects visible to the user in an organization. + * + * The async variant is {@see ProjectsClient::listXpnHostsAsync()} . + * + * @param ListXpnHostsProjectsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listXpnHosts(ListXpnHostsProjectsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListXpnHosts', $request, $callOptions); + } + + /** + * Moves a persistent disk from one zone to another. + * + * The async variant is {@see ProjectsClient::moveDiskAsync()} . + * + * @param MoveDiskProjectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function moveDisk(MoveDiskProjectRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('MoveDisk', $request, $callOptions)->wait(); + } + + /** + * Moves an instance and its attached persistent disks from one zone to another. *Note*: Moving VMs or disks by using this method might cause unexpected behavior. For more information, see the [known issue](/compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_moveinstance_api_or_the_causes_unexpected_behavior). [Deprecated] This method is deprecated. See [moving instance across zones](/compute/docs/instances/moving-instance-across-zones) instead. + * + * The async variant is {@see ProjectsClient::moveInstanceAsync()} . + * + * @param MoveInstanceProjectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function moveInstance(MoveInstanceProjectRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('MoveInstance', $request, $callOptions)->wait(); + } + + /** + * Sets the Cloud Armor tier of the project. To set ENTERPRISE or above the billing account of the project must be subscribed to Cloud Armor Enterprise. See Subscribing to Cloud Armor Enterprise for more information. + * + * The async variant is {@see ProjectsClient::setCloudArmorTierAsync()} . + * + * @param SetCloudArmorTierProjectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setCloudArmorTier(SetCloudArmorTierProjectRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetCloudArmorTier', $request, $callOptions)->wait(); + } + + /** + * Sets metadata common to all instances within the specified project using the data included in the request. + * + * The async variant is {@see ProjectsClient::setCommonInstanceMetadataAsync()} . + * + * @param SetCommonInstanceMetadataProjectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setCommonInstanceMetadata(SetCommonInstanceMetadataProjectRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetCommonInstanceMetadata', $request, $callOptions)->wait(); + } + + /** + * Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field. + * + * The async variant is {@see ProjectsClient::setDefaultNetworkTierAsync()} . + * + * @param SetDefaultNetworkTierProjectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setDefaultNetworkTier(SetDefaultNetworkTierProjectRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetDefaultNetworkTier', $request, $callOptions)->wait(); + } + + /** + * Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled. + * + * The async variant is {@see ProjectsClient::setUsageExportBucketAsync()} . + * + * @param SetUsageExportBucketProjectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setUsageExportBucket(SetUsageExportBucketProjectRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetUsageExportBucket', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/PublicAdvertisedPrefixesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/PublicAdvertisedPrefixesClient.php new file mode 100644 index 000000000000..ed7f588b8096 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/PublicAdvertisedPrefixesClient.php @@ -0,0 +1,409 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/public_advertised_prefixes_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/public_advertised_prefixes_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/public_advertised_prefixes_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Announces the specified PublicAdvertisedPrefix + * + * The async variant is {@see PublicAdvertisedPrefixesClient::announceAsync()} . + * + * @param AnnouncePublicAdvertisedPrefixeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function announce(AnnouncePublicAdvertisedPrefixeRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Announce', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified PublicAdvertisedPrefix + * + * The async variant is {@see PublicAdvertisedPrefixesClient::deleteAsync()} . + * + * @param DeletePublicAdvertisedPrefixeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeletePublicAdvertisedPrefixeRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified PublicAdvertisedPrefix resource. + * + * The async variant is {@see PublicAdvertisedPrefixesClient::getAsync()} . + * + * @param GetPublicAdvertisedPrefixeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PublicAdvertisedPrefix + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetPublicAdvertisedPrefixeRequest $request, array $callOptions = []): PublicAdvertisedPrefix + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a PublicAdvertisedPrefix in the specified project using the parameters that are included in the request. + * + * The async variant is {@see PublicAdvertisedPrefixesClient::insertAsync()} . + * + * @param InsertPublicAdvertisedPrefixeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertPublicAdvertisedPrefixeRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Lists the PublicAdvertisedPrefixes for a project. + * + * The async variant is {@see PublicAdvertisedPrefixesClient::listAsync()} . + * + * @param ListPublicAdvertisedPrefixesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListPublicAdvertisedPrefixesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * The async variant is {@see PublicAdvertisedPrefixesClient::patchAsync()} . + * + * @param PatchPublicAdvertisedPrefixeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchPublicAdvertisedPrefixeRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Withdraws the specified PublicAdvertisedPrefix + * + * The async variant is {@see PublicAdvertisedPrefixesClient::withdrawAsync()} . + * + * @param WithdrawPublicAdvertisedPrefixeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function withdraw(WithdrawPublicAdvertisedPrefixeRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Withdraw', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/PublicDelegatedPrefixesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/PublicDelegatedPrefixesClient.php new file mode 100644 index 000000000000..0e81c2c3deef --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/PublicDelegatedPrefixesClient.php @@ -0,0 +1,437 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/public_delegated_prefixes_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/public_delegated_prefixes_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/public_delegated_prefixes_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Lists all PublicDelegatedPrefix resources owned by the specific project across all scopes. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see PublicDelegatedPrefixesClient::aggregatedListAsync()} + * . + * + * @param AggregatedListPublicDelegatedPrefixesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListPublicDelegatedPrefixesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Announces the specified PublicDelegatedPrefix in the given region. + * + * The async variant is {@see PublicDelegatedPrefixesClient::announceAsync()} . + * + * @param AnnouncePublicDelegatedPrefixeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function announce(AnnouncePublicDelegatedPrefixeRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Announce', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified PublicDelegatedPrefix in the given region. + * + * The async variant is {@see PublicDelegatedPrefixesClient::deleteAsync()} . + * + * @param DeletePublicDelegatedPrefixeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeletePublicDelegatedPrefixeRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified PublicDelegatedPrefix resource in the given region. + * + * The async variant is {@see PublicDelegatedPrefixesClient::getAsync()} . + * + * @param GetPublicDelegatedPrefixeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PublicDelegatedPrefix + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetPublicDelegatedPrefixeRequest $request, array $callOptions = []): PublicDelegatedPrefix + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a PublicDelegatedPrefix in the specified project in the given region using the parameters that are included in the request. + * + * The async variant is {@see PublicDelegatedPrefixesClient::insertAsync()} . + * + * @param InsertPublicDelegatedPrefixeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertPublicDelegatedPrefixeRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Lists the PublicDelegatedPrefixes for a project in the given region. + * + * The async variant is {@see PublicDelegatedPrefixesClient::listAsync()} . + * + * @param ListPublicDelegatedPrefixesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListPublicDelegatedPrefixesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Patches the specified PublicDelegatedPrefix resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * The async variant is {@see PublicDelegatedPrefixesClient::patchAsync()} . + * + * @param PatchPublicDelegatedPrefixeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchPublicDelegatedPrefixeRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Withdraws the specified PublicDelegatedPrefix in the given region. + * + * The async variant is {@see PublicDelegatedPrefixesClient::withdrawAsync()} . + * + * @param WithdrawPublicDelegatedPrefixeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function withdraw(WithdrawPublicDelegatedPrefixeRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Withdraw', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionAutoscalersClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionAutoscalersClient.php new file mode 100644 index 000000000000..bc32eb27d907 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionAutoscalersClient.php @@ -0,0 +1,384 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_autoscalers_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_autoscalers_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_autoscalers_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified autoscaler. + * + * The async variant is {@see RegionAutoscalersClient::deleteAsync()} . + * + * @param DeleteRegionAutoscalerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteRegionAutoscalerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified autoscaler. + * + * The async variant is {@see RegionAutoscalersClient::getAsync()} . + * + * @param GetRegionAutoscalerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Autoscaler + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionAutoscalerRequest $request, array $callOptions = []): Autoscaler + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates an autoscaler in the specified project using the data included in the request. + * + * The async variant is {@see RegionAutoscalersClient::insertAsync()} . + * + * @param InsertRegionAutoscalerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertRegionAutoscalerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of autoscalers contained within the specified region. + * + * The async variant is {@see RegionAutoscalersClient::listAsync()} . + * + * @param ListRegionAutoscalersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionAutoscalersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * The async variant is {@see RegionAutoscalersClient::patchAsync()} . + * + * @param PatchRegionAutoscalerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchRegionAutoscalerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Updates an autoscaler in the specified project using the data included in the request. + * + * The async variant is {@see RegionAutoscalersClient::updateAsync()} . + * + * @param UpdateRegionAutoscalerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function update(UpdateRegionAutoscalerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Update', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionBackendServicesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionBackendServicesClient.php new file mode 100644 index 000000000000..5e9f4e3deb42 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionBackendServicesClient.php @@ -0,0 +1,545 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_backend_services_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_backend_services_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_backend_services_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified regional BackendService resource. + * + * The async variant is {@see RegionBackendServicesClient::deleteAsync()} . + * + * @param DeleteRegionBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteRegionBackendServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified regional BackendService resource. + * + * The async variant is {@see RegionBackendServicesClient::getAsync()} . + * + * @param GetRegionBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BackendService + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionBackendServiceRequest $request, array $callOptions = []): BackendService + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets the most recent health check results for this regional BackendService. + * + * The async variant is {@see RegionBackendServicesClient::getHealthAsync()} . + * + * @param GetHealthRegionBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BackendServiceGroupHealth + * + * @throws ApiException Thrown if the API call fails. + */ + public function getHealth(GetHealthRegionBackendServiceRequest $request, array $callOptions = []): BackendServiceGroupHealth + { + return $this->startApiCall('GetHealth', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is {@see RegionBackendServicesClient::getIamPolicyAsync()} . + * + * @param GetIamPolicyRegionBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRegionBackendServiceRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Creates a regional BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview. + * + * The async variant is {@see RegionBackendServicesClient::insertAsync()} . + * + * @param InsertRegionBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertRegionBackendServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of regional BackendService resources available to the specified project in the given region. + * + * The async variant is {@see RegionBackendServicesClient::listAsync()} . + * + * @param ListRegionBackendServicesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionBackendServicesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Retrieves an aggregated list of all usable backend services in the specified project in the given region. + * + * The async variant is {@see RegionBackendServicesClient::listUsableAsync()} . + * + * @param ListUsableRegionBackendServicesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listUsable(ListUsableRegionBackendServicesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListUsable', $request, $callOptions); + } + + /** + * Updates the specified regional BackendService resource with the data included in the request. For more information, see Understanding backend services This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * The async variant is {@see RegionBackendServicesClient::patchAsync()} . + * + * @param PatchRegionBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchRegionBackendServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is {@see RegionBackendServicesClient::setIamPolicyAsync()} . + * + * @param SetIamPolicyRegionBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRegionBackendServiceRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview + * + * The async variant is + * {@see RegionBackendServicesClient::setSecurityPolicyAsync()} . + * + * @param SetSecurityPolicyRegionBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setSecurityPolicy(SetSecurityPolicyRegionBackendServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetSecurityPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is + * {@see RegionBackendServicesClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsRegionBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRegionBackendServiceRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } + + /** + * Updates the specified regional BackendService resource with the data included in the request. For more information, see Backend services overview . + * + * The async variant is {@see RegionBackendServicesClient::updateAsync()} . + * + * @param UpdateRegionBackendServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function update(UpdateRegionBackendServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Update', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionCommitmentsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionCommitmentsClient.php new file mode 100644 index 000000000000..58e3e5fff3e4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionCommitmentsClient.php @@ -0,0 +1,358 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_commitments_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_commitments_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_commitments_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of commitments by region. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see RegionCommitmentsClient::aggregatedListAsync()} . + * + * @param AggregatedListRegionCommitmentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListRegionCommitmentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Returns the specified commitment resource. + * + * The async variant is {@see RegionCommitmentsClient::getAsync()} . + * + * @param GetRegionCommitmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Commitment + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionCommitmentRequest $request, array $callOptions = []): Commitment + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a commitment in the specified project using the data included in the request. + * + * The async variant is {@see RegionCommitmentsClient::insertAsync()} . + * + * @param InsertRegionCommitmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertRegionCommitmentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of commitments contained within the specified region. + * + * The async variant is {@see RegionCommitmentsClient::listAsync()} . + * + * @param ListRegionCommitmentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionCommitmentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Updates the specified commitment 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: auto_renew. + * + * The async variant is {@see RegionCommitmentsClient::updateAsync()} . + * + * @param UpdateRegionCommitmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function update(UpdateRegionCommitmentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Update', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionDiskTypesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionDiskTypesClient.php new file mode 100644 index 000000000000..1e3ed72230fe --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionDiskTypesClient.php @@ -0,0 +1,227 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_disk_types_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_disk_types_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_disk_types_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Returns the specified regional disk type. + * + * The async variant is {@see RegionDiskTypesClient::getAsync()} . + * + * @param GetRegionDiskTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DiskType + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionDiskTypeRequest $request, array $callOptions = []): DiskType + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of regional disk types available to the specified project. + * + * The async variant is {@see RegionDiskTypesClient::listAsync()} . + * + * @param ListRegionDiskTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionDiskTypesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionDisksClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionDisksClient.php new file mode 100644 index 000000000000..31ba4c6746de --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionDisksClient.php @@ -0,0 +1,673 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_disks_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_disks_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_disks_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. + * + * The async variant is {@see RegionDisksClient::addResourcePoliciesAsync()} . + * + * @param AddResourcePoliciesRegionDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function addResourcePolicies(AddResourcePoliciesRegionDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AddResourcePolicies', $request, $callOptions)->wait(); + } + + /** + * Bulk create a set of disks. + * + * The async variant is {@see RegionDisksClient::bulkInsertAsync()} . + * + * @param BulkInsertRegionDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function bulkInsert(BulkInsertRegionDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BulkInsert', $request, $callOptions)->wait(); + } + + /** + * Creates a snapshot of a specified persistent disk. For regular snapshot creation, consider using snapshots.insert instead, as that method supports more features, such as creating snapshots in a project different from the source disk project. + * + * The async variant is {@see RegionDisksClient::createSnapshotAsync()} . + * + * @param CreateSnapshotRegionDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createSnapshot(CreateSnapshotRegionDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateSnapshot', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. + * + * The async variant is {@see RegionDisksClient::deleteAsync()} . + * + * @param DeleteRegionDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteRegionDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns a specified regional persistent disk. + * + * The async variant is {@see RegionDisksClient::getAsync()} . + * + * @param GetRegionDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Disk + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionDiskRequest $request, array $callOptions = []): Disk + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is {@see RegionDisksClient::getIamPolicyAsync()} . + * + * @param GetIamPolicyRegionDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRegionDiskRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Creates a persistent regional disk in the specified project using the data included in the request. + * + * The async variant is {@see RegionDisksClient::insertAsync()} . + * + * @param InsertRegionDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertRegionDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of persistent disks contained within the specified region. + * + * The async variant is {@see RegionDisksClient::listAsync()} . + * + * @param ListRegionDisksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionDisksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Removes resource policies from a regional disk. + * + * The async variant is {@see RegionDisksClient::removeResourcePoliciesAsync()} . + * + * @param RemoveResourcePoliciesRegionDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function removeResourcePolicies(RemoveResourcePoliciesRegionDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RemoveResourcePolicies', $request, $callOptions)->wait(); + } + + /** + * Resizes the specified regional persistent disk. + * + * The async variant is {@see RegionDisksClient::resizeAsync()} . + * + * @param ResizeRegionDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function resize(ResizeRegionDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Resize', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is {@see RegionDisksClient::setIamPolicyAsync()} . + * + * @param SetIamPolicyRegionDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRegionDiskRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the labels on the target regional disk. + * + * The async variant is {@see RegionDisksClient::setLabelsAsync()} . + * + * @param SetLabelsRegionDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setLabels(SetLabelsRegionDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetLabels', $request, $callOptions)->wait(); + } + + /** + * Starts asynchronous replication. Must be invoked on the primary disk. + * + * The async variant is {@see RegionDisksClient::startAsyncReplicationAsync()} . + * + * @param StartAsyncReplicationRegionDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function startAsyncReplication(StartAsyncReplicationRegionDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('StartAsyncReplication', $request, $callOptions)->wait(); + } + + /** + * Stops asynchronous replication. Can be invoked either on the primary or on the secondary disk. + * + * The async variant is {@see RegionDisksClient::stopAsyncReplicationAsync()} . + * + * @param StopAsyncReplicationRegionDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function stopAsyncReplication(StopAsyncReplicationRegionDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('StopAsyncReplication', $request, $callOptions)->wait(); + } + + /** + * Stops asynchronous replication for a consistency group of disks. Can be invoked either in the primary or secondary scope. + * + * The async variant is {@see RegionDisksClient::stopGroupAsyncReplicationAsync()} + * . + * + * @param StopGroupAsyncReplicationRegionDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function stopGroupAsyncReplication(StopGroupAsyncReplicationRegionDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('StopGroupAsyncReplication', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is {@see RegionDisksClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsRegionDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRegionDiskRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->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. + * + * The async variant is {@see RegionDisksClient::updateAsync()} . + * + * @param UpdateRegionDiskRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function update(UpdateRegionDiskRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Update', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionHealthCheckServicesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionHealthCheckServicesClient.php new file mode 100644 index 000000000000..5540172c9190 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionHealthCheckServicesClient.php @@ -0,0 +1,358 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_health_check_services_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_health_check_services_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_health_check_services_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified regional HealthCheckService. + * + * The async variant is {@see RegionHealthCheckServicesClient::deleteAsync()} . + * + * @param DeleteRegionHealthCheckServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteRegionHealthCheckServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified regional HealthCheckService resource. + * + * The async variant is {@see RegionHealthCheckServicesClient::getAsync()} . + * + * @param GetRegionHealthCheckServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return HealthCheckService + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionHealthCheckServiceRequest $request, array $callOptions = []): HealthCheckService + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a regional HealthCheckService resource in the specified project and region using the data included in the request. + * + * The async variant is {@see RegionHealthCheckServicesClient::insertAsync()} . + * + * @param InsertRegionHealthCheckServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertRegionHealthCheckServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Lists all the HealthCheckService resources that have been configured for the specified project in the given region. + * + * The async variant is {@see RegionHealthCheckServicesClient::listAsync()} . + * + * @param ListRegionHealthCheckServicesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionHealthCheckServicesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Updates the specified regional HealthCheckService resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * The async variant is {@see RegionHealthCheckServicesClient::patchAsync()} . + * + * @param PatchRegionHealthCheckServiceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchRegionHealthCheckServiceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionHealthChecksClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionHealthChecksClient.php new file mode 100644 index 000000000000..c925bfa57cba --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionHealthChecksClient.php @@ -0,0 +1,384 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_health_checks_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_health_checks_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_health_checks_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified HealthCheck resource. + * + * The async variant is {@see RegionHealthChecksClient::deleteAsync()} . + * + * @param DeleteRegionHealthCheckRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteRegionHealthCheckRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified HealthCheck resource. + * + * The async variant is {@see RegionHealthChecksClient::getAsync()} . + * + * @param GetRegionHealthCheckRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return HealthCheck + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionHealthCheckRequest $request, array $callOptions = []): HealthCheck + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a HealthCheck resource in the specified project using the data included in the request. + * + * The async variant is {@see RegionHealthChecksClient::insertAsync()} . + * + * @param InsertRegionHealthCheckRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertRegionHealthCheckRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of HealthCheck resources available to the specified project. + * + * The async variant is {@see RegionHealthChecksClient::listAsync()} . + * + * @param ListRegionHealthChecksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionHealthChecksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * The async variant is {@see RegionHealthChecksClient::patchAsync()} . + * + * @param PatchRegionHealthCheckRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchRegionHealthCheckRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. + * + * The async variant is {@see RegionHealthChecksClient::updateAsync()} . + * + * @param UpdateRegionHealthCheckRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function update(UpdateRegionHealthCheckRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Update', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionInstanceGroupManagersClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionInstanceGroupManagersClient.php new file mode 100644 index 000000000000..d02ba9e7125e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionInstanceGroupManagersClient.php @@ -0,0 +1,735 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_instance_group_managers_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_instance_group_managers_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_instance_group_managers_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Flags the specified instances to be immediately removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. + * + * The async variant is + * {@see RegionInstanceGroupManagersClient::abandonInstancesAsync()} . + * + * @param AbandonInstancesRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function abandonInstances(AbandonInstancesRegionInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AbandonInstances', $request, $callOptions)->wait(); + } + + /** + * Apply updates to selected instances the managed instance group. + * + * The async variant is + * {@see RegionInstanceGroupManagersClient::applyUpdatesToInstancesAsync()} . + * + * @param ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function applyUpdatesToInstances(ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ApplyUpdatesToInstances', $request, $callOptions)->wait(); + } + + /** + * Creates instances with per-instance configurations in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. + * + * The async variant is + * {@see RegionInstanceGroupManagersClient::createInstancesAsync()} . + * + * @param CreateInstancesRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createInstances(CreateInstancesRegionInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateInstances', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified managed instance group and all of the instances in that group. + * + * The async variant is {@see RegionInstanceGroupManagersClient::deleteAsync()} . + * + * @param DeleteRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteRegionInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. + * + * The async variant is + * {@see RegionInstanceGroupManagersClient::deleteInstancesAsync()} . + * + * @param DeleteInstancesRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteInstances(DeleteInstancesRegionInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteInstances', $request, $callOptions)->wait(); + } + + /** + * Deletes selected per-instance configurations for the managed instance group. + * + * The async variant is + * {@see RegionInstanceGroupManagersClient::deletePerInstanceConfigsAsync()} . + * + * @param DeletePerInstanceConfigsRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deletePerInstanceConfigs(DeletePerInstanceConfigsRegionInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeletePerInstanceConfigs', $request, $callOptions)->wait(); + } + + /** + * Returns all of the details about the specified managed instance group. + * + * The async variant is {@see RegionInstanceGroupManagersClient::getAsync()} . + * + * @param GetRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return InstanceGroupManager + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionInstanceGroupManagerRequest $request, array $callOptions = []): InstanceGroupManager + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. A regional managed instance group can contain up to 2000 instances. + * + * The async variant is {@see RegionInstanceGroupManagersClient::insertAsync()} . + * + * @param InsertRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertRegionInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of managed instance groups that are contained within the specified region. + * + * The async variant is {@see RegionInstanceGroupManagersClient::listAsync()} . + * + * @param ListRegionInstanceGroupManagersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionInstanceGroupManagersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Lists all errors thrown by actions on instances for a given regional managed instance group. The filter and orderBy query parameters are not supported. + * + * The async variant is {@see RegionInstanceGroupManagersClient::listErrorsAsync()} + * . + * + * @param ListErrorsRegionInstanceGroupManagersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listErrors(ListErrorsRegionInstanceGroupManagersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListErrors', $request, $callOptions); + } + + /** + * Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances. The orderBy query parameter is not supported. The `pageToken` query parameter is supported only if the group's `listManagedInstancesResults` field is set to `PAGINATED`. + * + * The async variant is + * {@see RegionInstanceGroupManagersClient::listManagedInstancesAsync()} . + * + * @param ListManagedInstancesRegionInstanceGroupManagersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listManagedInstances(ListManagedInstancesRegionInstanceGroupManagersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListManagedInstances', $request, $callOptions); + } + + /** + * Lists all of the per-instance configurations defined for the managed instance group. The orderBy query parameter is not supported. + * + * The async variant is + * {@see RegionInstanceGroupManagersClient::listPerInstanceConfigsAsync()} . + * + * @param ListPerInstanceConfigsRegionInstanceGroupManagersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listPerInstanceConfigs(ListPerInstanceConfigsRegionInstanceGroupManagersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListPerInstanceConfigs', $request, $callOptions); + } + + /** + * Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. If you update your group to specify a new template or instance configuration, it's possible that your intended specification for each VM in the group is different from the current state of that VM. To learn how to apply an updated configuration to the VMs in a MIG, see Updating instances in a MIG. + * + * The async variant is {@see RegionInstanceGroupManagersClient::patchAsync()} . + * + * @param PatchRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchRegionInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Inserts or patches per-instance configurations for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. + * + * The async variant is + * {@see RegionInstanceGroupManagersClient::patchPerInstanceConfigsAsync()} . + * + * @param PatchPerInstanceConfigsRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patchPerInstanceConfigs(PatchPerInstanceConfigsRegionInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('PatchPerInstanceConfigs', $request, $callOptions)->wait(); + } + + /** + * Flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group's current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking its currentAction field; for more information, see Checking the status of managed instances. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. + * + * The async variant is + * {@see RegionInstanceGroupManagersClient::recreateInstancesAsync()} . + * + * @param RecreateInstancesRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function recreateInstances(RecreateInstancesRegionInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RecreateInstances', $request, $callOptions)->wait(); + } + + /** + * Changes the intended size of the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances. The resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + * + * The async variant is {@see RegionInstanceGroupManagersClient::resizeAsync()} . + * + * @param ResizeRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function resize(ResizeRegionInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Resize', $request, $callOptions)->wait(); + } + + /** + * Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. + * + * The async variant is + * {@see RegionInstanceGroupManagersClient::setInstanceTemplateAsync()} . + * + * @param SetInstanceTemplateRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setInstanceTemplate(SetInstanceTemplateRegionInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetInstanceTemplate', $request, $callOptions)->wait(); + } + + /** + * Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. + * + * The async variant is + * {@see RegionInstanceGroupManagersClient::setTargetPoolsAsync()} . + * + * @param SetTargetPoolsRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setTargetPools(SetTargetPoolsRegionInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetTargetPools', $request, $callOptions)->wait(); + } + + /** + * Inserts or updates per-instance configurations for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. + * + * The async variant is + * {@see RegionInstanceGroupManagersClient::updatePerInstanceConfigsAsync()} . + * + * @param UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updatePerInstanceConfigs(UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdatePerInstanceConfigs', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionInstanceGroupsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionInstanceGroupsClient.php new file mode 100644 index 000000000000..0b6ed72897f8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionInstanceGroupsClient.php @@ -0,0 +1,332 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_instance_groups_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_instance_groups_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_instance_groups_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Returns the specified instance group resource. + * + * The async variant is {@see RegionInstanceGroupsClient::getAsync()} . + * + * @param GetRegionInstanceGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return InstanceGroup + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionInstanceGroupRequest $request, array $callOptions = []): InstanceGroup + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of instance group resources contained within the specified region. + * + * The async variant is {@see RegionInstanceGroupsClient::listAsync()} . + * + * @param ListRegionInstanceGroupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionInstanceGroupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. The orderBy query parameter is not supported. + * + * The async variant is {@see RegionInstanceGroupsClient::listInstancesAsync()} . + * + * @param ListInstancesRegionInstanceGroupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listInstances(ListInstancesRegionInstanceGroupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListInstances', $request, $callOptions); + } + + /** + * Sets the named ports for the specified regional instance group. + * + * The async variant is {@see RegionInstanceGroupsClient::setNamedPortsAsync()} . + * + * @param SetNamedPortsRegionInstanceGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setNamedPorts(SetNamedPortsRegionInstanceGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetNamedPorts', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionInstanceTemplatesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionInstanceTemplatesClient.php new file mode 100644 index 000000000000..5d5883bfbbf1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionInstanceTemplatesClient.php @@ -0,0 +1,332 @@ + 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 ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. + * + * The async variant is {@see RegionInstanceTemplatesClient::deleteAsync()} . + * + * @param DeleteRegionInstanceTemplateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteRegionInstanceTemplateRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified instance template. + * + * The async variant is {@see RegionInstanceTemplatesClient::getAsync()} . + * + * @param GetRegionInstanceTemplateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return InstanceTemplate + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionInstanceTemplateRequest $request, array $callOptions = []): InstanceTemplate + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates an instance template in the specified project and region using the global instance template whose URL is included in the request. + * + * The async variant is {@see RegionInstanceTemplatesClient::insertAsync()} . + * + * @param InsertRegionInstanceTemplateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertRegionInstanceTemplateRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of instance templates that are contained within the specified project and region. + * + * The async variant is {@see RegionInstanceTemplatesClient::listAsync()} . + * + * @param ListRegionInstanceTemplatesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionInstanceTemplatesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionInstancesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionInstancesClient.php new file mode 100644 index 000000000000..5c80c8ca915f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionInstancesClient.php @@ -0,0 +1,252 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_instances_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_instances_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_instances_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates multiple instances in a given region. Count specifies the number of instances to create. + * + * The async variant is {@see RegionInstancesClient::bulkInsertAsync()} . + * + * @param BulkInsertRegionInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function bulkInsert(BulkInsertRegionInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('BulkInsert', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionInstantSnapshotsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionInstantSnapshotsClient.php new file mode 100644 index 000000000000..2abae1233e2b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionInstantSnapshotsClient.php @@ -0,0 +1,439 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_instant_snapshots_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_instant_snapshots_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_instant_snapshots_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified InstantSnapshot resource. Keep in mind that deleting a single instantSnapshot might not necessarily delete all the data on that instantSnapshot. If any data on the instantSnapshot that is marked for deletion is needed for subsequent instantSnapshots, the data will be moved to the next corresponding instantSnapshot. For more information, see Deleting instantSnapshots. + * + * The async variant is {@see RegionInstantSnapshotsClient::deleteAsync()} . + * + * @param DeleteRegionInstantSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteRegionInstantSnapshotRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified InstantSnapshot resource in the specified region. + * + * The async variant is {@see RegionInstantSnapshotsClient::getAsync()} . + * + * @param GetRegionInstantSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return InstantSnapshot + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionInstantSnapshotRequest $request, array $callOptions = []): InstantSnapshot + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is {@see RegionInstantSnapshotsClient::getIamPolicyAsync()} . + * + * @param GetIamPolicyRegionInstantSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRegionInstantSnapshotRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Creates an instant snapshot in the specified region. + * + * The async variant is {@see RegionInstantSnapshotsClient::insertAsync()} . + * + * @param InsertRegionInstantSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertRegionInstantSnapshotRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of InstantSnapshot resources contained within the specified region. + * + * The async variant is {@see RegionInstantSnapshotsClient::listAsync()} . + * + * @param ListRegionInstantSnapshotsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionInstantSnapshotsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is {@see RegionInstantSnapshotsClient::setIamPolicyAsync()} . + * + * @param SetIamPolicyRegionInstantSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRegionInstantSnapshotRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the labels on a instantSnapshot in the given region. To learn more about labels, read the Labeling Resources documentation. + * + * The async variant is {@see RegionInstantSnapshotsClient::setLabelsAsync()} . + * + * @param SetLabelsRegionInstantSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setLabels(SetLabelsRegionInstantSnapshotRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetLabels', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is + * {@see RegionInstantSnapshotsClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsRegionInstantSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRegionInstantSnapshotRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionNetworkEndpointGroupsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionNetworkEndpointGroupsClient.php new file mode 100644 index 000000000000..4be6e6d69d47 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionNetworkEndpointGroupsClient.php @@ -0,0 +1,413 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_network_endpoint_groups_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_network_endpoint_groups_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_network_endpoint_groups_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Attach a list of network endpoints to the specified network endpoint group. + * + * The async variant is + * {@see RegionNetworkEndpointGroupsClient::attachNetworkEndpointsAsync()} . + * + * @param AttachNetworkEndpointsRegionNetworkEndpointGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function attachNetworkEndpoints(AttachNetworkEndpointsRegionNetworkEndpointGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AttachNetworkEndpoints', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified network endpoint group. Note that the NEG cannot be deleted if it is configured as a backend of a backend service. + * + * The async variant is {@see RegionNetworkEndpointGroupsClient::deleteAsync()} . + * + * @param DeleteRegionNetworkEndpointGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteRegionNetworkEndpointGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Detach the network endpoint from the specified network endpoint group. + * + * The async variant is + * {@see RegionNetworkEndpointGroupsClient::detachNetworkEndpointsAsync()} . + * + * @param DetachNetworkEndpointsRegionNetworkEndpointGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function detachNetworkEndpoints(DetachNetworkEndpointsRegionNetworkEndpointGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DetachNetworkEndpoints', $request, $callOptions)->wait(); + } + + /** + * Returns the specified network endpoint group. + * + * The async variant is {@see RegionNetworkEndpointGroupsClient::getAsync()} . + * + * @param GetRegionNetworkEndpointGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NetworkEndpointGroup + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionNetworkEndpointGroupRequest $request, array $callOptions = []): NetworkEndpointGroup + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a network endpoint group in the specified project using the parameters that are included in the request. + * + * The async variant is {@see RegionNetworkEndpointGroupsClient::insertAsync()} . + * + * @param InsertRegionNetworkEndpointGroupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertRegionNetworkEndpointGroupRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of regional network endpoint groups available to the specified project in the given region. + * + * The async variant is {@see RegionNetworkEndpointGroupsClient::listAsync()} . + * + * @param ListRegionNetworkEndpointGroupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionNetworkEndpointGroupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Lists the network endpoints in the specified network endpoint group. + * + * The async variant is + * {@see RegionNetworkEndpointGroupsClient::listNetworkEndpointsAsync()} . + * + * @param ListNetworkEndpointsRegionNetworkEndpointGroupsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listNetworkEndpoints(ListNetworkEndpointsRegionNetworkEndpointGroupsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListNetworkEndpoints', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionNetworkFirewallPoliciesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionNetworkFirewallPoliciesClient.php new file mode 100644 index 000000000000..18ebb25da543 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionNetworkFirewallPoliciesClient.php @@ -0,0 +1,687 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_network_firewall_policies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_network_firewall_policies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_network_firewall_policies_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Inserts an association for the specified network firewall policy. + * + * The async variant is + * {@see RegionNetworkFirewallPoliciesClient::addAssociationAsync()} . + * + * @param AddAssociationRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function addAssociation(AddAssociationRegionNetworkFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AddAssociation', $request, $callOptions)->wait(); + } + + /** + * Inserts a rule into a network firewall policy. + * + * The async variant is {@see RegionNetworkFirewallPoliciesClient::addRuleAsync()} + * . + * + * @param AddRuleRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function addRule(AddRuleRegionNetworkFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AddRule', $request, $callOptions)->wait(); + } + + /** + * Copies rules to the specified network firewall policy. + * + * The async variant is + * {@see RegionNetworkFirewallPoliciesClient::cloneRulesAsync()} . + * + * @param CloneRulesRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function cloneRules(CloneRulesRegionNetworkFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CloneRules', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified network firewall policy. + * + * The async variant is {@see RegionNetworkFirewallPoliciesClient::deleteAsync()} . + * + * @param DeleteRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteRegionNetworkFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified network firewall policy. + * + * The async variant is {@see RegionNetworkFirewallPoliciesClient::getAsync()} . + * + * @param GetRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FirewallPolicy + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionNetworkFirewallPolicyRequest $request, array $callOptions = []): FirewallPolicy + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets an association with the specified name. + * + * The async variant is + * {@see RegionNetworkFirewallPoliciesClient::getAssociationAsync()} . + * + * @param GetAssociationRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FirewallPolicyAssociation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAssociation(GetAssociationRegionNetworkFirewallPolicyRequest $request, array $callOptions = []): FirewallPolicyAssociation + { + return $this->startApiCall('GetAssociation', $request, $callOptions)->wait(); + } + + /** + * Returns the effective firewalls on a given network. + * + * The async variant is + * {@see RegionNetworkFirewallPoliciesClient::getEffectiveFirewallsAsync()} . + * + * @param GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function getEffectiveFirewalls(GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest $request, array $callOptions = []): RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse + { + return $this->startApiCall('GetEffectiveFirewalls', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is + * {@see RegionNetworkFirewallPoliciesClient::getIamPolicyAsync()} . + * + * @param GetIamPolicyRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyRegionNetworkFirewallPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Gets a rule of the specified priority. + * + * The async variant is {@see RegionNetworkFirewallPoliciesClient::getRuleAsync()} + * . + * + * @param GetRuleRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FirewallPolicyRule + * + * @throws ApiException Thrown if the API call fails. + */ + public function getRule(GetRuleRegionNetworkFirewallPolicyRequest $request, array $callOptions = []): FirewallPolicyRule + { + return $this->startApiCall('GetRule', $request, $callOptions)->wait(); + } + + /** + * Creates a new network firewall policy in the specified project and region. + * + * The async variant is {@see RegionNetworkFirewallPoliciesClient::insertAsync()} . + * + * @param InsertRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertRegionNetworkFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Lists all the network firewall policies that have been configured for the specified project in the given region. + * + * The async variant is {@see RegionNetworkFirewallPoliciesClient::listAsync()} . + * + * @param ListRegionNetworkFirewallPoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionNetworkFirewallPoliciesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Patches the specified network firewall policy. + * + * The async variant is {@see RegionNetworkFirewallPoliciesClient::patchAsync()} . + * + * @param PatchRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchRegionNetworkFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Patches a rule of the specified priority. + * + * The async variant is + * {@see RegionNetworkFirewallPoliciesClient::patchRuleAsync()} . + * + * @param PatchRuleRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patchRule(PatchRuleRegionNetworkFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('PatchRule', $request, $callOptions)->wait(); + } + + /** + * Removes an association for the specified network firewall policy. + * + * The async variant is + * {@see RegionNetworkFirewallPoliciesClient::removeAssociationAsync()} . + * + * @param RemoveAssociationRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function removeAssociation(RemoveAssociationRegionNetworkFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RemoveAssociation', $request, $callOptions)->wait(); + } + + /** + * Deletes a rule of the specified priority. + * + * The async variant is + * {@see RegionNetworkFirewallPoliciesClient::removeRuleAsync()} . + * + * @param RemoveRuleRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function removeRule(RemoveRuleRegionNetworkFirewallPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RemoveRule', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is + * {@see RegionNetworkFirewallPoliciesClient::setIamPolicyAsync()} . + * + * @param SetIamPolicyRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyRegionNetworkFirewallPolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is + * {@see RegionNetworkFirewallPoliciesClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsRegionNetworkFirewallPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsRegionNetworkFirewallPolicyRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionNotificationEndpointsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionNotificationEndpointsClient.php new file mode 100644 index 000000000000..a2b1ccd09108 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionNotificationEndpointsClient.php @@ -0,0 +1,332 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_notification_endpoints_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_notification_endpoints_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_notification_endpoints_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified NotificationEndpoint in the given region + * + * The async variant is {@see RegionNotificationEndpointsClient::deleteAsync()} . + * + * @param DeleteRegionNotificationEndpointRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteRegionNotificationEndpointRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified NotificationEndpoint resource in the given region. + * + * The async variant is {@see RegionNotificationEndpointsClient::getAsync()} . + * + * @param GetRegionNotificationEndpointRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NotificationEndpoint + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionNotificationEndpointRequest $request, array $callOptions = []): NotificationEndpoint + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Create a NotificationEndpoint in the specified project in the given region using the parameters that are included in the request. + * + * The async variant is {@see RegionNotificationEndpointsClient::insertAsync()} . + * + * @param InsertRegionNotificationEndpointRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertRegionNotificationEndpointRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Lists the NotificationEndpoints for a project in the given region. + * + * The async variant is {@see RegionNotificationEndpointsClient::listAsync()} . + * + * @param ListRegionNotificationEndpointsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionNotificationEndpointsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionOperationsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionOperationsClient.php new file mode 100644 index 000000000000..d2e382de470a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionOperationsClient.php @@ -0,0 +1,279 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_operations_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_operations_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_operations_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified region-specific Operations resource. + * + * The async variant is {@see RegionOperationsClient::deleteAsync()} . + * + * @param DeleteRegionOperationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DeleteRegionOperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteRegionOperationRequest $request, array $callOptions = []): DeleteRegionOperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified region-specific Operations resource. + * + * The async variant is {@see RegionOperationsClient::getAsync()} . + * + * @param GetRegionOperationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Operation + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionOperationRequest $request, array $callOptions = []): Operation + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of Operation resources contained within the specified region. + * + * The async variant is {@see RegionOperationsClient::listAsync()} . + * + * @param ListRegionOperationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionOperationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + * + * The async variant is {@see RegionOperationsClient::waitAsync()} . + * + * @param WaitRegionOperationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Operation + * + * @throws ApiException Thrown if the API call fails. + */ + public function wait(WaitRegionOperationRequest $request, array $callOptions = []): Operation + { + return $this->startApiCall('Wait', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionSecurityPoliciesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionSecurityPoliciesClient.php new file mode 100644 index 000000000000..0008ea19f634 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionSecurityPoliciesClient.php @@ -0,0 +1,463 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_security_policies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_security_policies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_security_policies_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Inserts a rule into a security policy. + * + * The async variant is {@see RegionSecurityPoliciesClient::addRuleAsync()} . + * + * @param AddRuleRegionSecurityPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function addRule(AddRuleRegionSecurityPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AddRule', $request, $callOptions)->wait(); + } + + /** + * Deletes the specified policy. + * + * The async variant is {@see RegionSecurityPoliciesClient::deleteAsync()} . + * + * @param DeleteRegionSecurityPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteRegionSecurityPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * List all of the ordered rules present in a single specified policy. + * + * The async variant is {@see RegionSecurityPoliciesClient::getAsync()} . + * + * @param GetRegionSecurityPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SecurityPolicy + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionSecurityPolicyRequest $request, array $callOptions = []): SecurityPolicy + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets a rule at the specified priority. + * + * The async variant is {@see RegionSecurityPoliciesClient::getRuleAsync()} . + * + * @param GetRuleRegionSecurityPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SecurityPolicyRule + * + * @throws ApiException Thrown if the API call fails. + */ + public function getRule(GetRuleRegionSecurityPolicyRequest $request, array $callOptions = []): SecurityPolicyRule + { + return $this->startApiCall('GetRule', $request, $callOptions)->wait(); + } + + /** + * Creates a new policy in the specified project using the data included in the request. + * + * The async variant is {@see RegionSecurityPoliciesClient::insertAsync()} . + * + * @param InsertRegionSecurityPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertRegionSecurityPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * List all the policies that have been configured for the specified project and region. + * + * The async variant is {@see RegionSecurityPoliciesClient::listAsync()} . + * + * @param ListRegionSecurityPoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionSecurityPoliciesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Patches the specified policy with the data included in the request. To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead. + * + * The async variant is {@see RegionSecurityPoliciesClient::patchAsync()} . + * + * @param PatchRegionSecurityPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchRegionSecurityPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Patches a rule at the specified priority. To clear fields in the rule, leave the fields empty and specify them in the updateMask. + * + * The async variant is {@see RegionSecurityPoliciesClient::patchRuleAsync()} . + * + * @param PatchRuleRegionSecurityPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patchRule(PatchRuleRegionSecurityPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('PatchRule', $request, $callOptions)->wait(); + } + + /** + * Deletes a rule at the specified priority. + * + * The async variant is {@see RegionSecurityPoliciesClient::removeRuleAsync()} . + * + * @param RemoveRuleRegionSecurityPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function removeRule(RemoveRuleRegionSecurityPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RemoveRule', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionSslCertificatesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionSslCertificatesClient.php new file mode 100644 index 000000000000..4d261b00664c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionSslCertificatesClient.php @@ -0,0 +1,332 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_ssl_certificates_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_ssl_certificates_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_ssl_certificates_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified SslCertificate resource in the region. + * + * The async variant is {@see RegionSslCertificatesClient::deleteAsync()} . + * + * @param DeleteRegionSslCertificateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteRegionSslCertificateRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified SslCertificate resource in the specified region. Get a list of available SSL certificates by making a list() request. + * + * The async variant is {@see RegionSslCertificatesClient::getAsync()} . + * + * @param GetRegionSslCertificateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SslCertificate + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionSslCertificateRequest $request, array $callOptions = []): SslCertificate + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a SslCertificate resource in the specified project and region using the data included in the request + * + * The async variant is {@see RegionSslCertificatesClient::insertAsync()} . + * + * @param InsertRegionSslCertificateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertRegionSslCertificateRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of SslCertificate resources available to the specified project in the specified region. + * + * The async variant is {@see RegionSslCertificatesClient::listAsync()} . + * + * @param ListRegionSslCertificatesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionSslCertificatesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionSslPoliciesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionSslPoliciesClient.php new file mode 100644 index 000000000000..da867c7fa041 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionSslPoliciesClient.php @@ -0,0 +1,386 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_ssl_policies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_ssl_policies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_ssl_policies_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources. + * + * The async variant is {@see RegionSslPoliciesClient::deleteAsync()} . + * + * @param DeleteRegionSslPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteRegionSslPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Lists all of the ordered rules present in a single specified policy. + * + * The async variant is {@see RegionSslPoliciesClient::getAsync()} . + * + * @param GetRegionSslPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SslPolicy + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionSslPolicyRequest $request, array $callOptions = []): SslPolicy + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a new policy in the specified project and region using the data included in the request. + * + * The async variant is {@see RegionSslPoliciesClient::insertAsync()} . + * + * @param InsertRegionSslPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertRegionSslPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Lists all the SSL policies that have been configured for the specified project and region. + * + * The async variant is {@see RegionSslPoliciesClient::listAsync()} . + * + * @param ListRegionSslPoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionSslPoliciesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Lists all features that can be specified in the SSL policy when using custom profile. + * + * The async variant is + * {@see RegionSslPoliciesClient::listAvailableFeaturesAsync()} . + * + * @param ListAvailableFeaturesRegionSslPoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SslPoliciesListAvailableFeaturesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listAvailableFeatures(ListAvailableFeaturesRegionSslPoliciesRequest $request, array $callOptions = []): SslPoliciesListAvailableFeaturesResponse + { + return $this->startApiCall('ListAvailableFeatures', $request, $callOptions)->wait(); + } + + /** + * Patches the specified SSL policy with the data included in the request. + * + * The async variant is {@see RegionSslPoliciesClient::patchAsync()} . + * + * @param PatchRegionSslPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchRegionSslPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionTargetHttpProxiesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionTargetHttpProxiesClient.php new file mode 100644 index 000000000000..c8723f1a4375 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionTargetHttpProxiesClient.php @@ -0,0 +1,358 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_target_http_proxies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_target_http_proxies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_target_http_proxies_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified TargetHttpProxy resource. + * + * The async variant is {@see RegionTargetHttpProxiesClient::deleteAsync()} . + * + * @param DeleteRegionTargetHttpProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteRegionTargetHttpProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified TargetHttpProxy resource in the specified region. + * + * The async variant is {@see RegionTargetHttpProxiesClient::getAsync()} . + * + * @param GetRegionTargetHttpProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TargetHttpProxy + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionTargetHttpProxyRequest $request, array $callOptions = []): TargetHttpProxy + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a TargetHttpProxy resource in the specified project and region using the data included in the request. + * + * The async variant is {@see RegionTargetHttpProxiesClient::insertAsync()} . + * + * @param InsertRegionTargetHttpProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertRegionTargetHttpProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of TargetHttpProxy resources available to the specified project in the specified region. + * + * The async variant is {@see RegionTargetHttpProxiesClient::listAsync()} . + * + * @param ListRegionTargetHttpProxiesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionTargetHttpProxiesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Changes the URL map for TargetHttpProxy. + * + * The async variant is {@see RegionTargetHttpProxiesClient::setUrlMapAsync()} . + * + * @param SetUrlMapRegionTargetHttpProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setUrlMap(SetUrlMapRegionTargetHttpProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetUrlMap', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionTargetHttpsProxiesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionTargetHttpsProxiesClient.php new file mode 100644 index 000000000000..db79ef3fee75 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionTargetHttpsProxiesClient.php @@ -0,0 +1,411 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_target_https_proxies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_target_https_proxies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_target_https_proxies_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified TargetHttpsProxy resource. + * + * The async variant is {@see RegionTargetHttpsProxiesClient::deleteAsync()} . + * + * @param DeleteRegionTargetHttpsProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteRegionTargetHttpsProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified TargetHttpsProxy resource in the specified region. + * + * The async variant is {@see RegionTargetHttpsProxiesClient::getAsync()} . + * + * @param GetRegionTargetHttpsProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TargetHttpsProxy + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionTargetHttpsProxyRequest $request, array $callOptions = []): TargetHttpsProxy + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a TargetHttpsProxy resource in the specified project and region using the data included in the request. + * + * The async variant is {@see RegionTargetHttpsProxiesClient::insertAsync()} . + * + * @param InsertRegionTargetHttpsProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertRegionTargetHttpsProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of TargetHttpsProxy resources available to the specified project in the specified region. + * + * The async variant is {@see RegionTargetHttpsProxiesClient::listAsync()} . + * + * @param ListRegionTargetHttpsProxiesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionTargetHttpsProxiesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Patches the specified regional TargetHttpsProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * The async variant is {@see RegionTargetHttpsProxiesClient::patchAsync()} . + * + * @param PatchRegionTargetHttpsProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchRegionTargetHttpsProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Replaces SslCertificates for TargetHttpsProxy. + * + * The async variant is + * {@see RegionTargetHttpsProxiesClient::setSslCertificatesAsync()} . + * + * @param SetSslCertificatesRegionTargetHttpsProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setSslCertificates(SetSslCertificatesRegionTargetHttpsProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetSslCertificates', $request, $callOptions)->wait(); + } + + /** + * Changes the URL map for TargetHttpsProxy. + * + * The async variant is {@see RegionTargetHttpsProxiesClient::setUrlMapAsync()} . + * + * @param SetUrlMapRegionTargetHttpsProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setUrlMap(SetUrlMapRegionTargetHttpsProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetUrlMap', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionTargetTcpProxiesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionTargetTcpProxiesClient.php new file mode 100644 index 000000000000..03c8be03b241 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionTargetTcpProxiesClient.php @@ -0,0 +1,332 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_target_tcp_proxies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_target_tcp_proxies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_target_tcp_proxies_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified TargetTcpProxy resource. + * + * The async variant is {@see RegionTargetTcpProxiesClient::deleteAsync()} . + * + * @param DeleteRegionTargetTcpProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteRegionTargetTcpProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified TargetTcpProxy resource. + * + * The async variant is {@see RegionTargetTcpProxiesClient::getAsync()} . + * + * @param GetRegionTargetTcpProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TargetTcpProxy + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionTargetTcpProxyRequest $request, array $callOptions = []): TargetTcpProxy + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a TargetTcpProxy resource in the specified project and region using the data included in the request. + * + * The async variant is {@see RegionTargetTcpProxiesClient::insertAsync()} . + * + * @param InsertRegionTargetTcpProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertRegionTargetTcpProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of TargetTcpProxy resources available to the specified project in a given region. + * + * The async variant is {@see RegionTargetTcpProxiesClient::listAsync()} . + * + * @param ListRegionTargetTcpProxiesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionTargetTcpProxiesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionUrlMapsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionUrlMapsClient.php new file mode 100644 index 000000000000..4eb611558076 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionUrlMapsClient.php @@ -0,0 +1,411 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_url_maps_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_url_maps_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_url_maps_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified UrlMap resource. + * + * The async variant is {@see RegionUrlMapsClient::deleteAsync()} . + * + * @param DeleteRegionUrlMapRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteRegionUrlMapRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified UrlMap resource. + * + * The async variant is {@see RegionUrlMapsClient::getAsync()} . + * + * @param GetRegionUrlMapRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return UrlMap + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionUrlMapRequest $request, array $callOptions = []): UrlMap + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a UrlMap resource in the specified project using the data included in the request. + * + * The async variant is {@see RegionUrlMapsClient::insertAsync()} . + * + * @param InsertRegionUrlMapRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertRegionUrlMapRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of UrlMap resources available to the specified project in the specified region. + * + * The async variant is {@see RegionUrlMapsClient::listAsync()} . + * + * @param ListRegionUrlMapsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionUrlMapsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * The async variant is {@see RegionUrlMapsClient::patchAsync()} . + * + * @param PatchRegionUrlMapRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchRegionUrlMapRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Updates the specified UrlMap resource with the data included in the request. + * + * The async variant is {@see RegionUrlMapsClient::updateAsync()} . + * + * @param UpdateRegionUrlMapRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function update(UpdateRegionUrlMapRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Update', $request, $callOptions)->wait(); + } + + /** + * Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. + * + * The async variant is {@see RegionUrlMapsClient::validateAsync()} . + * + * @param ValidateRegionUrlMapRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return UrlMapsValidateResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function validate(ValidateRegionUrlMapRequest $request, array $callOptions = []): UrlMapsValidateResponse + { + return $this->startApiCall('Validate', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionZonesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionZonesClient.php new file mode 100644 index 000000000000..680b1aa3824a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionZonesClient.php @@ -0,0 +1,200 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_zones_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_zones_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_zones_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves the list of Zone resources under the specific region available to the specified project. + * + * The async variant is {@see RegionZonesClient::listAsync()} . + * + * @param ListRegionZonesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionZonesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RegionsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RegionsClient.php new file mode 100644 index 000000000000..d3a7239ad1fc --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionsClient.php @@ -0,0 +1,227 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/regions_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/regions_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/regions_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * 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. + * + * The async variant is {@see RegionsClient::getAsync()} . + * + * @param GetRegionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Region + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRegionRequest $request, array $callOptions = []): Region + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of region resources available to the specified project. 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 `items.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. + * + * The async variant is {@see RegionsClient::listAsync()} . + * + * @param ListRegionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRegionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/ReservationsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/ReservationsClient.php new file mode 100644 index 000000000000..9748e4bf4915 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/ReservationsClient.php @@ -0,0 +1,490 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/reservations_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/reservations_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/reservations_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of reservations. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see ReservationsClient::aggregatedListAsync()} . + * + * @param AggregatedListReservationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListReservationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified reservation. + * + * The async variant is {@see ReservationsClient::deleteAsync()} . + * + * @param DeleteReservationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteReservationRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Retrieves information about the specified reservation. + * + * The async variant is {@see ReservationsClient::getAsync()} . + * + * @param GetReservationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Reservation + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetReservationRequest $request, array $callOptions = []): Reservation + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is {@see ReservationsClient::getIamPolicyAsync()} . + * + * @param GetIamPolicyReservationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyReservationRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Creates a new reservation. For more information, read Reserving zonal resources. + * + * The async variant is {@see ReservationsClient::insertAsync()} . + * + * @param InsertReservationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertReservationRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * A list of all the reservations that have been configured for the specified project in specified zone. + * + * The async variant is {@see ReservationsClient::listAsync()} . + * + * @param ListReservationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListReservationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Resizes the reservation (applicable to standalone reservations only). For more information, read Modifying reservations. + * + * The async variant is {@see ReservationsClient::resizeAsync()} . + * + * @param ResizeReservationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function resize(ResizeReservationRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Resize', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is {@see ReservationsClient::setIamPolicyAsync()} . + * + * @param SetIamPolicyReservationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyReservationRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is {@see ReservationsClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsReservationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsReservationRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } + + /** + * Update share settings of the reservation. + * + * The async variant is {@see ReservationsClient::updateAsync()} . + * + * @param UpdateReservationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function update(UpdateReservationRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Update', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/ResourcePoliciesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/ResourcePoliciesClient.php new file mode 100644 index 000000000000..60c4ea72aa27 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/ResourcePoliciesClient.php @@ -0,0 +1,464 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/resource_policies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/resource_policies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/resource_policies_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of resource policies. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see ResourcePoliciesClient::aggregatedListAsync()} . + * + * @param AggregatedListResourcePoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListResourcePoliciesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified resource policy. + * + * The async variant is {@see ResourcePoliciesClient::deleteAsync()} . + * + * @param DeleteResourcePolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteResourcePolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Retrieves all information of the specified resource policy. + * + * The async variant is {@see ResourcePoliciesClient::getAsync()} . + * + * @param GetResourcePolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ResourcePolicy + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetResourcePolicyRequest $request, array $callOptions = []): ResourcePolicy + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is {@see ResourcePoliciesClient::getIamPolicyAsync()} . + * + * @param GetIamPolicyResourcePolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyResourcePolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Creates a new resource policy. + * + * The async variant is {@see ResourcePoliciesClient::insertAsync()} . + * + * @param InsertResourcePolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertResourcePolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * A list all the resource policies that have been configured for the specified project in specified region. + * + * The async variant is {@see ResourcePoliciesClient::listAsync()} . + * + * @param ListResourcePoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListResourcePoliciesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Modify the specified resource policy. + * + * The async variant is {@see ResourcePoliciesClient::patchAsync()} . + * + * @param PatchResourcePolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchResourcePolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is {@see ResourcePoliciesClient::setIamPolicyAsync()} . + * + * @param SetIamPolicyResourcePolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyResourcePolicyRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is {@see ResourcePoliciesClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsResourcePolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsResourcePolicyRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RoutersClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RoutersClient.php new file mode 100644 index 000000000000..543ba80f2fd7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RoutersClient.php @@ -0,0 +1,517 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/routers_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/routers_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/routers_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of routers. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see RoutersClient::aggregatedListAsync()} . + * + * @param AggregatedListRoutersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListRoutersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified Router resource. + * + * The async variant is {@see RoutersClient::deleteAsync()} . + * + * @param DeleteRouterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteRouterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified Router resource. + * + * The async variant is {@see RoutersClient::getAsync()} . + * + * @param GetRouterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Router + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRouterRequest $request, array $callOptions = []): Router + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Retrieves runtime NAT IP information. + * + * The async variant is {@see RoutersClient::getNatIpInfoAsync()} . + * + * @param GetNatIpInfoRouterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NatIpInfoResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function getNatIpInfo(GetNatIpInfoRouterRequest $request, array $callOptions = []): NatIpInfoResponse + { + return $this->startApiCall('GetNatIpInfo', $request, $callOptions)->wait(); + } + + /** + * Retrieves runtime Nat mapping information of VM endpoints. + * + * The async variant is {@see RoutersClient::getNatMappingInfoAsync()} . + * + * @param GetNatMappingInfoRoutersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function getNatMappingInfo(GetNatMappingInfoRoutersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('GetNatMappingInfo', $request, $callOptions); + } + + /** + * Retrieves runtime information of the specified router. + * + * The async variant is {@see RoutersClient::getRouterStatusAsync()} . + * + * @param GetRouterStatusRouterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return RouterStatusResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function getRouterStatus(GetRouterStatusRouterRequest $request, array $callOptions = []): RouterStatusResponse + { + return $this->startApiCall('GetRouterStatus', $request, $callOptions)->wait(); + } + + /** + * Creates a Router resource in the specified project and region using the data included in the request. + * + * The async variant is {@see RoutersClient::insertAsync()} . + * + * @param InsertRouterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertRouterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of Router resources available to the specified project. + * + * The async variant is {@see RoutersClient::listAsync()} . + * + * @param ListRoutersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRoutersRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * The async variant is {@see RoutersClient::patchAsync()} . + * + * @param PatchRouterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchRouterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. + * + * The async variant is {@see RoutersClient::previewAsync()} . + * + * @param PreviewRouterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return RoutersPreviewResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function preview(PreviewRouterRequest $request, array $callOptions = []): RoutersPreviewResponse + { + return $this->startApiCall('Preview', $request, $callOptions)->wait(); + } + + /** + * Updates the specified Router resource with the data included in the request. This method conforms to PUT semantics, which requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload. + * + * The async variant is {@see RoutersClient::updateAsync()} . + * + * @param UpdateRouterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function update(UpdateRouterRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Update', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/RoutesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/RoutesClient.php new file mode 100644 index 000000000000..1f7a73e5b13a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RoutesClient.php @@ -0,0 +1,331 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/routes_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/routes_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/routes_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified Route resource. + * + * The async variant is {@see RoutesClient::deleteAsync()} . + * + * @param DeleteRouteRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteRouteRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified Route resource. + * + * The async variant is {@see RoutesClient::getAsync()} . + * + * @param GetRouteRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Route + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetRouteRequest $request, array $callOptions = []): Route + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a Route resource in the specified project using the data included in the request. + * + * The async variant is {@see RoutesClient::insertAsync()} . + * + * @param InsertRouteRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertRouteRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of Route resources available to the specified project. + * + * The async variant is {@see RoutesClient::listAsync()} . + * + * @param ListRoutesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListRoutesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/SecurityPoliciesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/SecurityPoliciesClient.php new file mode 100644 index 000000000000..e15cf45e55c1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/SecurityPoliciesClient.php @@ -0,0 +1,542 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/security_policies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/security_policies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/security_policies_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Inserts a rule into a security policy. + * + * The async variant is {@see SecurityPoliciesClient::addRuleAsync()} . + * + * @param AddRuleSecurityPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function addRule(AddRuleSecurityPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AddRule', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of all SecurityPolicy resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see SecurityPoliciesClient::aggregatedListAsync()} . + * + * @param AggregatedListSecurityPoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListSecurityPoliciesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified policy. + * + * The async variant is {@see SecurityPoliciesClient::deleteAsync()} . + * + * @param DeleteSecurityPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteSecurityPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * List all of the ordered rules present in a single specified policy. + * + * The async variant is {@see SecurityPoliciesClient::getAsync()} . + * + * @param GetSecurityPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SecurityPolicy + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetSecurityPolicyRequest $request, array $callOptions = []): SecurityPolicy + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets a rule at the specified priority. + * + * The async variant is {@see SecurityPoliciesClient::getRuleAsync()} . + * + * @param GetRuleSecurityPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SecurityPolicyRule + * + * @throws ApiException Thrown if the API call fails. + */ + public function getRule(GetRuleSecurityPolicyRequest $request, array $callOptions = []): SecurityPolicyRule + { + return $this->startApiCall('GetRule', $request, $callOptions)->wait(); + } + + /** + * Creates a new policy in the specified project using the data included in the request. + * + * The async variant is {@see SecurityPoliciesClient::insertAsync()} . + * + * @param InsertSecurityPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertSecurityPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * List all the policies that have been configured for the specified project. + * + * The async variant is {@see SecurityPoliciesClient::listAsync()} . + * + * @param ListSecurityPoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListSecurityPoliciesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Gets the current list of preconfigured Web Application Firewall (WAF) expressions. + * + * The async variant is + * {@see SecurityPoliciesClient::listPreconfiguredExpressionSetsAsync()} . + * + * @param ListPreconfiguredExpressionSetsSecurityPoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SecurityPoliciesListPreconfiguredExpressionSetsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listPreconfiguredExpressionSets(ListPreconfiguredExpressionSetsSecurityPoliciesRequest $request, array $callOptions = []): SecurityPoliciesListPreconfiguredExpressionSetsResponse + { + return $this->startApiCall('ListPreconfiguredExpressionSets', $request, $callOptions)->wait(); + } + + /** + * Patches the specified policy with the data included in the request. To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead. + * + * The async variant is {@see SecurityPoliciesClient::patchAsync()} . + * + * @param PatchSecurityPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchSecurityPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Patches a rule at the specified priority. To clear fields in the rule, leave the fields empty and specify them in the updateMask. + * + * The async variant is {@see SecurityPoliciesClient::patchRuleAsync()} . + * + * @param PatchRuleSecurityPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patchRule(PatchRuleSecurityPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('PatchRule', $request, $callOptions)->wait(); + } + + /** + * Deletes a rule at the specified priority. + * + * The async variant is {@see SecurityPoliciesClient::removeRuleAsync()} . + * + * @param RemoveRuleSecurityPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function removeRule(RemoveRuleSecurityPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RemoveRule', $request, $callOptions)->wait(); + } + + /** + * Sets the labels on a security policy. To learn more about labels, read the Labeling Resources documentation. + * + * The async variant is {@see SecurityPoliciesClient::setLabelsAsync()} . + * + * @param SetLabelsSecurityPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setLabels(SetLabelsSecurityPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetLabels', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/ServiceAttachmentsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/ServiceAttachmentsClient.php new file mode 100644 index 000000000000..99c935980d19 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/ServiceAttachmentsClient.php @@ -0,0 +1,465 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/service_attachments_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/service_attachments_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/service_attachments_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves the list of all ServiceAttachment resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see ServiceAttachmentsClient::aggregatedListAsync()} . + * + * @param AggregatedListServiceAttachmentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListServiceAttachmentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified ServiceAttachment in the given scope + * + * The async variant is {@see ServiceAttachmentsClient::deleteAsync()} . + * + * @param DeleteServiceAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteServiceAttachmentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified ServiceAttachment resource in the given scope. + * + * The async variant is {@see ServiceAttachmentsClient::getAsync()} . + * + * @param GetServiceAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ServiceAttachment + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetServiceAttachmentRequest $request, array $callOptions = []): ServiceAttachment + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is {@see ServiceAttachmentsClient::getIamPolicyAsync()} . + * + * @param GetIamPolicyServiceAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyServiceAttachmentRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Creates a ServiceAttachment in the specified project in the given scope using the parameters that are included in the request. + * + * The async variant is {@see ServiceAttachmentsClient::insertAsync()} . + * + * @param InsertServiceAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertServiceAttachmentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Lists the ServiceAttachments for a project in the given scope. + * + * The async variant is {@see ServiceAttachmentsClient::listAsync()} . + * + * @param ListServiceAttachmentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListServiceAttachmentsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Patches the specified ServiceAttachment resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * The async variant is {@see ServiceAttachmentsClient::patchAsync()} . + * + * @param PatchServiceAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchServiceAttachmentRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is {@see ServiceAttachmentsClient::setIamPolicyAsync()} . + * + * @param SetIamPolicyServiceAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyServiceAttachmentRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is {@see ServiceAttachmentsClient::testIamPermissionsAsync()} + * . + * + * @param TestIamPermissionsServiceAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsServiceAttachmentRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/SnapshotSettingsServiceClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/SnapshotSettingsServiceClient.php new file mode 100644 index 000000000000..7417a99bac84 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/SnapshotSettingsServiceClient.php @@ -0,0 +1,278 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/snapshot_settings_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/snapshot_settings_service_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/snapshot_settings_service_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Get snapshot settings. + * + * The async variant is {@see SnapshotSettingsServiceClient::getAsync()} . + * + * @param GetSnapshotSettingRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SnapshotSettings + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetSnapshotSettingRequest $request, array $callOptions = []): SnapshotSettings + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Patch snapshot settings. + * + * The async variant is {@see SnapshotSettingsServiceClient::patchAsync()} . + * + * @param PatchSnapshotSettingRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchSnapshotSettingRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/SnapshotsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/SnapshotsClient.php new file mode 100644 index 000000000000..632a844f7938 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/SnapshotsClient.php @@ -0,0 +1,437 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/snapshots_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/snapshots_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/snapshots_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. For more information, see Deleting snapshots. + * + * The async variant is {@see SnapshotsClient::deleteAsync()} . + * + * @param DeleteSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteSnapshotRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified Snapshot resource. + * + * The async variant is {@see SnapshotsClient::getAsync()} . + * + * @param GetSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Snapshot + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetSnapshotRequest $request, array $callOptions = []): Snapshot + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is {@see SnapshotsClient::getIamPolicyAsync()} . + * + * @param GetIamPolicySnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicySnapshotRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Creates a snapshot in the specified project using the data included in the request. For regular snapshot creation, consider using this method instead of disks.createSnapshot, as this method supports more features, such as creating snapshots in a project different from the source disk project. + * + * The async variant is {@see SnapshotsClient::insertAsync()} . + * + * @param InsertSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertSnapshotRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of Snapshot resources contained within the specified project. + * + * The async variant is {@see SnapshotsClient::listAsync()} . + * + * @param ListSnapshotsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListSnapshotsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is {@see SnapshotsClient::setIamPolicyAsync()} . + * + * @param SetIamPolicySnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicySnapshotRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. + * + * The async variant is {@see SnapshotsClient::setLabelsAsync()} . + * + * @param SetLabelsSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setLabels(SetLabelsSnapshotRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetLabels', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is {@see SnapshotsClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsSnapshotRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsSnapshotRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/SslCertificatesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/SslCertificatesClient.php new file mode 100644 index 000000000000..f11269632b17 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/SslCertificatesClient.php @@ -0,0 +1,357 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/ssl_certificates_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/ssl_certificates_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/ssl_certificates_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves the list of all SslCertificate resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see SslCertificatesClient::aggregatedListAsync()} . + * + * @param AggregatedListSslCertificatesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListSslCertificatesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified SslCertificate resource. + * + * The async variant is {@see SslCertificatesClient::deleteAsync()} . + * + * @param DeleteSslCertificateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteSslCertificateRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified SslCertificate resource. + * + * The async variant is {@see SslCertificatesClient::getAsync()} . + * + * @param GetSslCertificateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SslCertificate + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetSslCertificateRequest $request, array $callOptions = []): SslCertificate + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a SslCertificate resource in the specified project using the data included in the request. + * + * The async variant is {@see SslCertificatesClient::insertAsync()} . + * + * @param InsertSslCertificateRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertSslCertificateRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of SslCertificate resources available to the specified project. + * + * The async variant is {@see SslCertificatesClient::listAsync()} . + * + * @param ListSslCertificatesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListSslCertificatesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/SslPoliciesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/SslPoliciesClient.php new file mode 100644 index 000000000000..c6da050b5786 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/SslPoliciesClient.php @@ -0,0 +1,410 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/ssl_policies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/ssl_policies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/ssl_policies_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves the list of all SslPolicy resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see SslPoliciesClient::aggregatedListAsync()} . + * + * @param AggregatedListSslPoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListSslPoliciesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources. + * + * The async variant is {@see SslPoliciesClient::deleteAsync()} . + * + * @param DeleteSslPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteSslPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Lists all of the ordered rules present in a single specified policy. + * + * The async variant is {@see SslPoliciesClient::getAsync()} . + * + * @param GetSslPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SslPolicy + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetSslPolicyRequest $request, array $callOptions = []): SslPolicy + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Returns the specified SSL policy resource. + * + * The async variant is {@see SslPoliciesClient::insertAsync()} . + * + * @param InsertSslPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertSslPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Lists all the SSL policies that have been configured for the specified project. + * + * The async variant is {@see SslPoliciesClient::listAsync()} . + * + * @param ListSslPoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListSslPoliciesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Lists all features that can be specified in the SSL policy when using custom profile. + * + * The async variant is {@see SslPoliciesClient::listAvailableFeaturesAsync()} . + * + * @param ListAvailableFeaturesSslPoliciesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return SslPoliciesListAvailableFeaturesResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listAvailableFeatures(ListAvailableFeaturesSslPoliciesRequest $request, array $callOptions = []): SslPoliciesListAvailableFeaturesResponse + { + return $this->startApiCall('ListAvailableFeatures', $request, $callOptions)->wait(); + } + + /** + * Patches the specified SSL policy with the data included in the request. + * + * The async variant is {@see SslPoliciesClient::patchAsync()} . + * + * @param PatchSslPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchSslPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/StoragePoolTypesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/StoragePoolTypesClient.php new file mode 100644 index 000000000000..cb07eaaf1f6e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/StoragePoolTypesClient.php @@ -0,0 +1,253 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/storage_pool_types_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/storage_pool_types_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/storage_pool_types_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of storage pool types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see StoragePoolTypesClient::aggregatedListAsync()} . + * + * @param AggregatedListStoragePoolTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListStoragePoolTypesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Returns the specified storage pool type. + * + * The async variant is {@see StoragePoolTypesClient::getAsync()} . + * + * @param GetStoragePoolTypeRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return StoragePoolType + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetStoragePoolTypeRequest $request, array $callOptions = []): StoragePoolType + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of storage pool types available to the specified project. + * + * The async variant is {@see StoragePoolTypesClient::listAsync()} . + * + * @param ListStoragePoolTypesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListStoragePoolTypesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/StoragePoolsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/StoragePoolsClient.php new file mode 100644 index 000000000000..735007a9e3c6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/StoragePoolsClient.php @@ -0,0 +1,492 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/storage_pools_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/storage_pools_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/storage_pools_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of storage pools. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see StoragePoolsClient::aggregatedListAsync()} . + * + * @param AggregatedListStoragePoolsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListStoragePoolsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified storage pool. Deleting a storagePool removes its data permanently and is irreversible. However, deleting a storagePool does not delete any snapshots previously made from the storagePool. You must separately delete snapshots. + * + * The async variant is {@see StoragePoolsClient::deleteAsync()} . + * + * @param DeleteStoragePoolRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteStoragePoolRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns a specified storage pool. Gets a list of available storage pools by making a list() request. + * + * The async variant is {@see StoragePoolsClient::getAsync()} . + * + * @param GetStoragePoolRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return StoragePool + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetStoragePoolRequest $request, array $callOptions = []): StoragePool + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is {@see StoragePoolsClient::getIamPolicyAsync()} . + * + * @param GetIamPolicyStoragePoolRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicyStoragePoolRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Creates a storage pool in the specified project using the data in the request. + * + * The async variant is {@see StoragePoolsClient::insertAsync()} . + * + * @param InsertStoragePoolRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertStoragePoolRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of storage pools contained within the specified zone. + * + * The async variant is {@see StoragePoolsClient::listAsync()} . + * + * @param ListStoragePoolsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return StoragePoolList + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListStoragePoolsRequest $request, array $callOptions = []): StoragePoolList + { + return $this->startApiCall('List', $request, $callOptions)->wait(); + } + + /** + * Lists the disks in a specified storage pool. + * + * The async variant is {@see StoragePoolsClient::listDisksAsync()} . + * + * @param ListDisksStoragePoolsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return StoragePoolListDisks + * + * @throws ApiException Thrown if the API call fails. + */ + public function listDisks(ListDisksStoragePoolsRequest $request, array $callOptions = []): StoragePoolListDisks + { + return $this->startApiCall('ListDisks', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is {@see StoragePoolsClient::setIamPolicyAsync()} . + * + * @param SetIamPolicyStoragePoolRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicyStoragePoolRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is {@see StoragePoolsClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsStoragePoolRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsStoragePoolRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } + + /** + * Updates the specified storagePool 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: size_tb and provisioned_iops. + * + * The async variant is {@see StoragePoolsClient::updateAsync()} . + * + * @param UpdateStoragePoolRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function update(UpdateStoragePoolRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Update', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/SubnetworksClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/SubnetworksClient.php new file mode 100644 index 000000000000..9b17ac4483d4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/SubnetworksClient.php @@ -0,0 +1,542 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/subnetworks_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/subnetworks_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/subnetworks_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of subnetworks. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see SubnetworksClient::aggregatedListAsync()} . + * + * @param AggregatedListSubnetworksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListSubnetworksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified subnetwork. + * + * The async variant is {@see SubnetworksClient::deleteAsync()} . + * + * @param DeleteSubnetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteSubnetworkRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Expands the IP CIDR range of the subnetwork to a specified value. + * + * The async variant is {@see SubnetworksClient::expandIpCidrRangeAsync()} . + * + * @param ExpandIpCidrRangeSubnetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function expandIpCidrRange(ExpandIpCidrRangeSubnetworkRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ExpandIpCidrRange', $request, $callOptions)->wait(); + } + + /** + * Returns the specified subnetwork. + * + * The async variant is {@see SubnetworksClient::getAsync()} . + * + * @param GetSubnetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Subnetwork + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetSubnetworkRequest $request, array $callOptions = []): Subnetwork + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * The async variant is {@see SubnetworksClient::getIamPolicyAsync()} . + * + * @param GetIamPolicySubnetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIamPolicy(GetIamPolicySubnetworkRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('GetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Creates a subnetwork in the specified project using the data included in the request. + * + * The async variant is {@see SubnetworksClient::insertAsync()} . + * + * @param InsertSubnetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertSubnetworkRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of subnetworks available to the specified project. + * + * The async variant is {@see SubnetworksClient::listAsync()} . + * + * @param ListSubnetworksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListSubnetworksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Retrieves an aggregated list of all usable subnetworks in the project. + * + * The async variant is {@see SubnetworksClient::listUsableAsync()} . + * + * @param ListUsableSubnetworksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listUsable(ListUsableSubnetworksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListUsable', $request, $callOptions); + } + + /** + * Patches the specified subnetwork with the data included in the request. Only certain fields can be updated with a patch request as indicated in the field descriptions. You must specify the current fingerprint of the subnetwork resource being patched. + * + * The async variant is {@see SubnetworksClient::patchAsync()} . + * + * @param PatchSubnetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchSubnetworkRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * The async variant is {@see SubnetworksClient::setIamPolicyAsync()} . + * + * @param SetIamPolicySubnetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Policy + * + * @throws ApiException Thrown if the API call fails. + */ + public function setIamPolicy(SetIamPolicySubnetworkRequest $request, array $callOptions = []): Policy + { + return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait(); + } + + /** + * Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. + * + * The async variant is {@see SubnetworksClient::setPrivateIpGoogleAccessAsync()} . + * + * @param SetPrivateIpGoogleAccessSubnetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setPrivateIpGoogleAccess(SetPrivateIpGoogleAccessSubnetworkRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetPrivateIpGoogleAccess', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is {@see SubnetworksClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsSubnetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsSubnetworkRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/TargetGrpcProxiesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/TargetGrpcProxiesClient.php new file mode 100644 index 000000000000..76cfd38b50ad --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/TargetGrpcProxiesClient.php @@ -0,0 +1,357 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/target_grpc_proxies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/target_grpc_proxies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/target_grpc_proxies_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified TargetGrpcProxy in the given scope + * + * The async variant is {@see TargetGrpcProxiesClient::deleteAsync()} . + * + * @param DeleteTargetGrpcProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteTargetGrpcProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified TargetGrpcProxy resource in the given scope. + * + * The async variant is {@see TargetGrpcProxiesClient::getAsync()} . + * + * @param GetTargetGrpcProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TargetGrpcProxy + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetTargetGrpcProxyRequest $request, array $callOptions = []): TargetGrpcProxy + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a TargetGrpcProxy in the specified project in the given scope using the parameters that are included in the request. + * + * The async variant is {@see TargetGrpcProxiesClient::insertAsync()} . + * + * @param InsertTargetGrpcProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertTargetGrpcProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Lists the TargetGrpcProxies for a project in the given scope. + * + * The async variant is {@see TargetGrpcProxiesClient::listAsync()} . + * + * @param ListTargetGrpcProxiesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListTargetGrpcProxiesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Patches the specified TargetGrpcProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * The async variant is {@see TargetGrpcProxiesClient::patchAsync()} . + * + * @param PatchTargetGrpcProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchTargetGrpcProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/TargetHttpProxiesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/TargetHttpProxiesClient.php new file mode 100644 index 000000000000..464d5a83ebac --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/TargetHttpProxiesClient.php @@ -0,0 +1,409 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/target_http_proxies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/target_http_proxies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/target_http_proxies_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves the list of all TargetHttpProxy resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see TargetHttpProxiesClient::aggregatedListAsync()} . + * + * @param AggregatedListTargetHttpProxiesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListTargetHttpProxiesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified TargetHttpProxy resource. + * + * The async variant is {@see TargetHttpProxiesClient::deleteAsync()} . + * + * @param DeleteTargetHttpProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteTargetHttpProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified TargetHttpProxy resource. + * + * The async variant is {@see TargetHttpProxiesClient::getAsync()} . + * + * @param GetTargetHttpProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TargetHttpProxy + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetTargetHttpProxyRequest $request, array $callOptions = []): TargetHttpProxy + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a TargetHttpProxy resource in the specified project using the data included in the request. + * + * The async variant is {@see TargetHttpProxiesClient::insertAsync()} . + * + * @param InsertTargetHttpProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertTargetHttpProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of TargetHttpProxy resources available to the specified project. + * + * The async variant is {@see TargetHttpProxiesClient::listAsync()} . + * + * @param ListTargetHttpProxiesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListTargetHttpProxiesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Patches the specified TargetHttpProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * The async variant is {@see TargetHttpProxiesClient::patchAsync()} . + * + * @param PatchTargetHttpProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchTargetHttpProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Changes the URL map for TargetHttpProxy. + * + * The async variant is {@see TargetHttpProxiesClient::setUrlMapAsync()} . + * + * @param SetUrlMapTargetHttpProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setUrlMap(SetUrlMapTargetHttpProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetUrlMap', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/TargetHttpsProxiesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/TargetHttpsProxiesClient.php new file mode 100644 index 000000000000..4d676e4f3215 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/TargetHttpsProxiesClient.php @@ -0,0 +1,514 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/target_https_proxies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/target_https_proxies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/target_https_proxies_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves the list of all TargetHttpsProxy resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see TargetHttpsProxiesClient::aggregatedListAsync()} . + * + * @param AggregatedListTargetHttpsProxiesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListTargetHttpsProxiesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified TargetHttpsProxy resource. + * + * The async variant is {@see TargetHttpsProxiesClient::deleteAsync()} . + * + * @param DeleteTargetHttpsProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteTargetHttpsProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified TargetHttpsProxy resource. + * + * The async variant is {@see TargetHttpsProxiesClient::getAsync()} . + * + * @param GetTargetHttpsProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TargetHttpsProxy + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetTargetHttpsProxyRequest $request, array $callOptions = []): TargetHttpsProxy + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a TargetHttpsProxy resource in the specified project using the data included in the request. + * + * The async variant is {@see TargetHttpsProxiesClient::insertAsync()} . + * + * @param InsertTargetHttpsProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertTargetHttpsProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of TargetHttpsProxy resources available to the specified project. + * + * The async variant is {@see TargetHttpsProxiesClient::listAsync()} . + * + * @param ListTargetHttpsProxiesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListTargetHttpsProxiesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Patches the specified TargetHttpsProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * The async variant is {@see TargetHttpsProxiesClient::patchAsync()} . + * + * @param PatchTargetHttpsProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchTargetHttpsProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Changes the Certificate Map for TargetHttpsProxy. + * + * The async variant is {@see TargetHttpsProxiesClient::setCertificateMapAsync()} . + * + * @param SetCertificateMapTargetHttpsProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setCertificateMap(SetCertificateMapTargetHttpsProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetCertificateMap', $request, $callOptions)->wait(); + } + + /** + * Sets the QUIC override policy for TargetHttpsProxy. + * + * The async variant is {@see TargetHttpsProxiesClient::setQuicOverrideAsync()} . + * + * @param SetQuicOverrideTargetHttpsProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setQuicOverride(SetQuicOverrideTargetHttpsProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetQuicOverride', $request, $callOptions)->wait(); + } + + /** + * Replaces SslCertificates for TargetHttpsProxy. + * + * The async variant is {@see TargetHttpsProxiesClient::setSslCertificatesAsync()} + * . + * + * @param SetSslCertificatesTargetHttpsProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setSslCertificates(SetSslCertificatesTargetHttpsProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetSslCertificates', $request, $callOptions)->wait(); + } + + /** + * Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the HTTPS proxy load balancer. They do not affect the connection between the load balancer and the backends. + * + * The async variant is {@see TargetHttpsProxiesClient::setSslPolicyAsync()} . + * + * @param SetSslPolicyTargetHttpsProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setSslPolicy(SetSslPolicyTargetHttpsProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetSslPolicy', $request, $callOptions)->wait(); + } + + /** + * Changes the URL map for TargetHttpsProxy. + * + * The async variant is {@see TargetHttpsProxiesClient::setUrlMapAsync()} . + * + * @param SetUrlMapTargetHttpsProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setUrlMap(SetUrlMapTargetHttpsProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetUrlMap', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/TargetInstancesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/TargetInstancesClient.php new file mode 100644 index 000000000000..83b51289b102 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/TargetInstancesClient.php @@ -0,0 +1,384 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/target_instances_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/target_instances_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/target_instances_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of target instances. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see TargetInstancesClient::aggregatedListAsync()} . + * + * @param AggregatedListTargetInstancesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListTargetInstancesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified TargetInstance resource. + * + * The async variant is {@see TargetInstancesClient::deleteAsync()} . + * + * @param DeleteTargetInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteTargetInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified TargetInstance resource. + * + * The async variant is {@see TargetInstancesClient::getAsync()} . + * + * @param GetTargetInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TargetInstance + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetTargetInstanceRequest $request, array $callOptions = []): TargetInstance + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a TargetInstance resource in the specified project and zone using the data included in the request. + * + * The async variant is {@see TargetInstancesClient::insertAsync()} . + * + * @param InsertTargetInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertTargetInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of TargetInstance resources available to the specified project and zone. + * + * The async variant is {@see TargetInstancesClient::listAsync()} . + * + * @param ListTargetInstancesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListTargetInstancesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Sets the Google Cloud Armor security policy for the specified target instance. For more information, see Google Cloud Armor Overview + * + * The async variant is {@see TargetInstancesClient::setSecurityPolicyAsync()} . + * + * @param SetSecurityPolicyTargetInstanceRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setSecurityPolicy(SetSecurityPolicyTargetInstanceRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetSecurityPolicy', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/TargetPoolsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/TargetPoolsClient.php new file mode 100644 index 000000000000..bbd4f7575788 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/TargetPoolsClient.php @@ -0,0 +1,541 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/target_pools_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/target_pools_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/target_pools_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Adds health check URLs to a target pool. + * + * The async variant is {@see TargetPoolsClient::addHealthCheckAsync()} . + * + * @param AddHealthCheckTargetPoolRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function addHealthCheck(AddHealthCheckTargetPoolRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AddHealthCheck', $request, $callOptions)->wait(); + } + + /** + * Adds an instance to a target pool. + * + * The async variant is {@see TargetPoolsClient::addInstanceAsync()} . + * + * @param AddInstanceTargetPoolRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function addInstance(AddInstanceTargetPoolRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AddInstance', $request, $callOptions)->wait(); + } + + /** + * Retrieves an aggregated list of target pools. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see TargetPoolsClient::aggregatedListAsync()} . + * + * @param AggregatedListTargetPoolsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListTargetPoolsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified target pool. + * + * The async variant is {@see TargetPoolsClient::deleteAsync()} . + * + * @param DeleteTargetPoolRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteTargetPoolRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified target pool. + * + * The async variant is {@see TargetPoolsClient::getAsync()} . + * + * @param GetTargetPoolRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TargetPool + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetTargetPoolRequest $request, array $callOptions = []): TargetPool + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Gets the most recent health check results for each IP for the instance that is referenced by the given target pool. + * + * The async variant is {@see TargetPoolsClient::getHealthAsync()} . + * + * @param GetHealthTargetPoolRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TargetPoolInstanceHealth + * + * @throws ApiException Thrown if the API call fails. + */ + public function getHealth(GetHealthTargetPoolRequest $request, array $callOptions = []): TargetPoolInstanceHealth + { + return $this->startApiCall('GetHealth', $request, $callOptions)->wait(); + } + + /** + * Creates a target pool in the specified project and region using the data included in the request. + * + * The async variant is {@see TargetPoolsClient::insertAsync()} . + * + * @param InsertTargetPoolRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertTargetPoolRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of target pools available to the specified project and region. + * + * The async variant is {@see TargetPoolsClient::listAsync()} . + * + * @param ListTargetPoolsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListTargetPoolsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Removes health check URL from a target pool. + * + * The async variant is {@see TargetPoolsClient::removeHealthCheckAsync()} . + * + * @param RemoveHealthCheckTargetPoolRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function removeHealthCheck(RemoveHealthCheckTargetPoolRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RemoveHealthCheck', $request, $callOptions)->wait(); + } + + /** + * Removes instance URL from a target pool. + * + * The async variant is {@see TargetPoolsClient::removeInstanceAsync()} . + * + * @param RemoveInstanceTargetPoolRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function removeInstance(RemoveInstanceTargetPoolRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RemoveInstance', $request, $callOptions)->wait(); + } + + /** + * Changes a backup target pool's configurations. + * + * The async variant is {@see TargetPoolsClient::setBackupAsync()} . + * + * @param SetBackupTargetPoolRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setBackup(SetBackupTargetPoolRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetBackup', $request, $callOptions)->wait(); + } + + /** + * Sets the Google Cloud Armor security policy for the specified target pool. For more information, see Google Cloud Armor Overview + * + * The async variant is {@see TargetPoolsClient::setSecurityPolicyAsync()} . + * + * @param SetSecurityPolicyTargetPoolRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setSecurityPolicy(SetSecurityPolicyTargetPoolRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetSecurityPolicy', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/TargetSslProxiesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/TargetSslProxiesClient.php new file mode 100644 index 000000000000..766d9c7a83c2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/TargetSslProxiesClient.php @@ -0,0 +1,461 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/target_ssl_proxies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/target_ssl_proxies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/target_ssl_proxies_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified TargetSslProxy resource. + * + * The async variant is {@see TargetSslProxiesClient::deleteAsync()} . + * + * @param DeleteTargetSslProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteTargetSslProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified TargetSslProxy resource. + * + * The async variant is {@see TargetSslProxiesClient::getAsync()} . + * + * @param GetTargetSslProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TargetSslProxy + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetTargetSslProxyRequest $request, array $callOptions = []): TargetSslProxy + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a TargetSslProxy resource in the specified project using the data included in the request. + * + * The async variant is {@see TargetSslProxiesClient::insertAsync()} . + * + * @param InsertTargetSslProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertTargetSslProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of TargetSslProxy resources available to the specified project. + * + * The async variant is {@see TargetSslProxiesClient::listAsync()} . + * + * @param ListTargetSslProxiesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListTargetSslProxiesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Changes the BackendService for TargetSslProxy. + * + * The async variant is {@see TargetSslProxiesClient::setBackendServiceAsync()} . + * + * @param SetBackendServiceTargetSslProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setBackendService(SetBackendServiceTargetSslProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetBackendService', $request, $callOptions)->wait(); + } + + /** + * Changes the Certificate Map for TargetSslProxy. + * + * The async variant is {@see TargetSslProxiesClient::setCertificateMapAsync()} . + * + * @param SetCertificateMapTargetSslProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setCertificateMap(SetCertificateMapTargetSslProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetCertificateMap', $request, $callOptions)->wait(); + } + + /** + * Changes the ProxyHeaderType for TargetSslProxy. + * + * The async variant is {@see TargetSslProxiesClient::setProxyHeaderAsync()} . + * + * @param SetProxyHeaderTargetSslProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setProxyHeader(SetProxyHeaderTargetSslProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetProxyHeader', $request, $callOptions)->wait(); + } + + /** + * Changes SslCertificates for TargetSslProxy. + * + * The async variant is {@see TargetSslProxiesClient::setSslCertificatesAsync()} . + * + * @param SetSslCertificatesTargetSslProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setSslCertificates(SetSslCertificatesTargetSslProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetSslCertificates', $request, $callOptions)->wait(); + } + + /** + * Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the load balancer. They do not affect the connection between the load balancer and the backends. + * + * The async variant is {@see TargetSslProxiesClient::setSslPolicyAsync()} . + * + * @param SetSslPolicyTargetSslProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setSslPolicy(SetSslPolicyTargetSslProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetSslPolicy', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/TargetTcpProxiesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/TargetTcpProxiesClient.php new file mode 100644 index 000000000000..fd2bca4e2636 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/TargetTcpProxiesClient.php @@ -0,0 +1,409 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/target_tcp_proxies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/target_tcp_proxies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/target_tcp_proxies_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves the list of all TargetTcpProxy resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see TargetTcpProxiesClient::aggregatedListAsync()} . + * + * @param AggregatedListTargetTcpProxiesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListTargetTcpProxiesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified TargetTcpProxy resource. + * + * The async variant is {@see TargetTcpProxiesClient::deleteAsync()} . + * + * @param DeleteTargetTcpProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteTargetTcpProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified TargetTcpProxy resource. + * + * The async variant is {@see TargetTcpProxiesClient::getAsync()} . + * + * @param GetTargetTcpProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TargetTcpProxy + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetTargetTcpProxyRequest $request, array $callOptions = []): TargetTcpProxy + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a TargetTcpProxy resource in the specified project using the data included in the request. + * + * The async variant is {@see TargetTcpProxiesClient::insertAsync()} . + * + * @param InsertTargetTcpProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertTargetTcpProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of TargetTcpProxy resources available to the specified project. + * + * The async variant is {@see TargetTcpProxiesClient::listAsync()} . + * + * @param ListTargetTcpProxiesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListTargetTcpProxiesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Changes the BackendService for TargetTcpProxy. + * + * The async variant is {@see TargetTcpProxiesClient::setBackendServiceAsync()} . + * + * @param SetBackendServiceTargetTcpProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setBackendService(SetBackendServiceTargetTcpProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetBackendService', $request, $callOptions)->wait(); + } + + /** + * Changes the ProxyHeaderType for TargetTcpProxy. + * + * The async variant is {@see TargetTcpProxiesClient::setProxyHeaderAsync()} . + * + * @param SetProxyHeaderTargetTcpProxyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setProxyHeader(SetProxyHeaderTargetTcpProxyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetProxyHeader', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/TargetVpnGatewaysClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/TargetVpnGatewaysClient.php new file mode 100644 index 000000000000..5566f17d7208 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/TargetVpnGatewaysClient.php @@ -0,0 +1,384 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/target_vpn_gateways_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/target_vpn_gateways_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/target_vpn_gateways_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of target VPN gateways. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see TargetVpnGatewaysClient::aggregatedListAsync()} . + * + * @param AggregatedListTargetVpnGatewaysRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListTargetVpnGatewaysRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified target VPN gateway. + * + * The async variant is {@see TargetVpnGatewaysClient::deleteAsync()} . + * + * @param DeleteTargetVpnGatewayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteTargetVpnGatewayRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified target VPN gateway. + * + * The async variant is {@see TargetVpnGatewaysClient::getAsync()} . + * + * @param GetTargetVpnGatewayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TargetVpnGateway + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetTargetVpnGatewayRequest $request, array $callOptions = []): TargetVpnGateway + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a target VPN gateway in the specified project and region using the data included in the request. + * + * The async variant is {@see TargetVpnGatewaysClient::insertAsync()} . + * + * @param InsertTargetVpnGatewayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertTargetVpnGatewayRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of target VPN gateways available to the specified project and region. + * + * The async variant is {@see TargetVpnGatewaysClient::listAsync()} . + * + * @param ListTargetVpnGatewaysRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListTargetVpnGatewaysRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Sets the labels on a TargetVpnGateway. To learn more about labels, read the Labeling Resources documentation. + * + * The async variant is {@see TargetVpnGatewaysClient::setLabelsAsync()} . + * + * @param SetLabelsTargetVpnGatewayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setLabels(SetLabelsTargetVpnGatewayRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetLabels', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/UrlMapsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/UrlMapsClient.php new file mode 100644 index 000000000000..a8de75642462 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/UrlMapsClient.php @@ -0,0 +1,462 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/url_maps_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/url_maps_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/url_maps_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves the list of all UrlMap resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see UrlMapsClient::aggregatedListAsync()} . + * + * @param AggregatedListUrlMapsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListUrlMapsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified UrlMap resource. + * + * The async variant is {@see UrlMapsClient::deleteAsync()} . + * + * @param DeleteUrlMapRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteUrlMapRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified UrlMap resource. + * + * The async variant is {@see UrlMapsClient::getAsync()} . + * + * @param GetUrlMapRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return UrlMap + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetUrlMapRequest $request, array $callOptions = []): UrlMap + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a UrlMap resource in the specified project using the data included in the request. + * + * The async variant is {@see UrlMapsClient::insertAsync()} . + * + * @param InsertUrlMapRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertUrlMapRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. For more information, see [Invalidating cached content](/cdn/docs/invalidating-cached-content). + * + * The async variant is {@see UrlMapsClient::invalidateCacheAsync()} . + * + * @param InvalidateCacheUrlMapRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function invalidateCache(InvalidateCacheUrlMapRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('InvalidateCache', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of UrlMap resources available to the specified project. + * + * The async variant is {@see UrlMapsClient::listAsync()} . + * + * @param ListUrlMapsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListUrlMapsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * The async variant is {@see UrlMapsClient::patchAsync()} . + * + * @param PatchUrlMapRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function patch(PatchUrlMapRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Patch', $request, $callOptions)->wait(); + } + + /** + * Updates the specified UrlMap resource with the data included in the request. + * + * The async variant is {@see UrlMapsClient::updateAsync()} . + * + * @param UpdateUrlMapRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function update(UpdateUrlMapRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Update', $request, $callOptions)->wait(); + } + + /** + * Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. + * + * The async variant is {@see UrlMapsClient::validateAsync()} . + * + * @param ValidateUrlMapRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return UrlMapsValidateResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function validate(ValidateUrlMapRequest $request, array $callOptions = []): UrlMapsValidateResponse + { + return $this->startApiCall('Validate', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/VpnGatewaysClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/VpnGatewaysClient.php new file mode 100644 index 000000000000..7cbeb448d8f5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/VpnGatewaysClient.php @@ -0,0 +1,438 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/vpn_gateways_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/vpn_gateways_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/vpn_gateways_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of VPN gateways. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see VpnGatewaysClient::aggregatedListAsync()} . + * + * @param AggregatedListVpnGatewaysRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListVpnGatewaysRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified VPN gateway. + * + * The async variant is {@see VpnGatewaysClient::deleteAsync()} . + * + * @param DeleteVpnGatewayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteVpnGatewayRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified VPN gateway. + * + * The async variant is {@see VpnGatewaysClient::getAsync()} . + * + * @param GetVpnGatewayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return VpnGateway + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetVpnGatewayRequest $request, array $callOptions = []): VpnGateway + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Returns the status for the specified VPN gateway. + * + * The async variant is {@see VpnGatewaysClient::getStatusAsync()} . + * + * @param GetStatusVpnGatewayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return VpnGatewaysGetStatusResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function getStatus(GetStatusVpnGatewayRequest $request, array $callOptions = []): VpnGatewaysGetStatusResponse + { + return $this->startApiCall('GetStatus', $request, $callOptions)->wait(); + } + + /** + * Creates a VPN gateway in the specified project and region using the data included in the request. + * + * The async variant is {@see VpnGatewaysClient::insertAsync()} . + * + * @param InsertVpnGatewayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertVpnGatewayRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of VPN gateways available to the specified project and region. + * + * The async variant is {@see VpnGatewaysClient::listAsync()} . + * + * @param ListVpnGatewaysRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListVpnGatewaysRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Sets the labels on a VpnGateway. To learn more about labels, read the Labeling Resources documentation. + * + * The async variant is {@see VpnGatewaysClient::setLabelsAsync()} . + * + * @param SetLabelsVpnGatewayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setLabels(SetLabelsVpnGatewayRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetLabels', $request, $callOptions)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * The async variant is {@see VpnGatewaysClient::testIamPermissionsAsync()} . + * + * @param TestIamPermissionsVpnGatewayRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return TestPermissionsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function testIamPermissions(TestIamPermissionsVpnGatewayRequest $request, array $callOptions = []): TestPermissionsResponse + { + return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/VpnTunnelsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/VpnTunnelsClient.php new file mode 100644 index 000000000000..495b280792a7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/VpnTunnelsClient.php @@ -0,0 +1,384 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/vpn_tunnels_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/vpn_tunnels_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/vpn_tunnels_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Retrieves an aggregated list of VPN tunnels. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * The async variant is {@see VpnTunnelsClient::aggregatedListAsync()} . + * + * @param AggregatedListVpnTunnelsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function aggregatedList(AggregatedListVpnTunnelsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('AggregatedList', $request, $callOptions); + } + + /** + * Deletes the specified VpnTunnel resource. + * + * The async variant is {@see VpnTunnelsClient::deleteAsync()} . + * + * @param DeleteVpnTunnelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteVpnTunnelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified VpnTunnel resource. + * + * The async variant is {@see VpnTunnelsClient::getAsync()} . + * + * @param GetVpnTunnelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return VpnTunnel + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetVpnTunnelRequest $request, array $callOptions = []): VpnTunnel + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Creates a VpnTunnel resource in the specified project and region using the data included in the request. + * + * The async variant is {@see VpnTunnelsClient::insertAsync()} . + * + * @param InsertVpnTunnelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function insert(InsertVpnTunnelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Insert', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of VpnTunnel resources contained in the specified project and region. + * + * The async variant is {@see VpnTunnelsClient::listAsync()} . + * + * @param ListVpnTunnelsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListVpnTunnelsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Sets the labels on a VpnTunnel. To learn more about labels, read the Labeling Resources documentation. + * + * The async variant is {@see VpnTunnelsClient::setLabelsAsync()} . + * + * @param SetLabelsVpnTunnelRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function setLabels(SetLabelsVpnTunnelRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetLabels', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/ZoneOperationsClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/ZoneOperationsClient.php new file mode 100644 index 000000000000..7df6e497df0e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/ZoneOperationsClient.php @@ -0,0 +1,279 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/zone_operations_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/zone_operations_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/zone_operations_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Deletes the specified zone-specific Operations resource. + * + * The async variant is {@see ZoneOperationsClient::deleteAsync()} . + * + * @param DeleteZoneOperationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DeleteZoneOperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteZoneOperationRequest $request, array $callOptions = []): DeleteZoneOperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Retrieves the specified zone-specific Operations resource. + * + * The async variant is {@see ZoneOperationsClient::getAsync()} . + * + * @param GetZoneOperationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Operation + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetZoneOperationRequest $request, array $callOptions = []): Operation + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of Operation resources contained within the specified zone. + * + * The async variant is {@see ZoneOperationsClient::listAsync()} . + * + * @param ListZoneOperationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListZoneOperationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } + + /** + * Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method waits for no more than the 2 minutes and then returns the current state of the operation, which might be `DONE` or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + * + * The async variant is {@see ZoneOperationsClient::waitAsync()} . + * + * @param WaitZoneOperationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Operation + * + * @throws ApiException Thrown if the API call fails. + */ + public function wait(WaitZoneOperationRequest $request, array $callOptions = []): Operation + { + return $this->startApiCall('Wait', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Client/ZonesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/ZonesClient.php new file mode 100644 index 000000000000..dd3c09e99f50 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/ZonesClient.php @@ -0,0 +1,227 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/zones_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/zones_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/zones_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements ClientOptionsTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Returns the specified Zone resource. + * + * The async variant is {@see ZonesClient::getAsync()} . + * + * @param GetZoneRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Zone + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetZoneRequest $request, array $callOptions = []): Zone + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Retrieves the list of Zone resources available to the specified project. + * + * The async variant is {@see ZonesClient::listAsync()} . + * + * @param ListZonesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListZonesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('List', $request, $callOptions); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/DiskTypesClient.php b/owl-bot-staging/Compute/V1/src/V1/DiskTypesClient.php new file mode 100644 index 000000000000..5fe9ad157fa9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/DiskTypesClient.php @@ -0,0 +1,34 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $acceleratorTypesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $acceleratorTypesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\AcceleratorTypesClient}. + */ +class AcceleratorTypesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.AcceleratorTypes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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.readonly', + 'https://www.googleapis.com/auth/compute', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/accelerator_types_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/accelerator_types_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/accelerator_types_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** + * Retrieves an aggregated list of accelerator types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $acceleratorTypesClient = new AcceleratorTypesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $acceleratorTypesClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $acceleratorTypesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $acceleratorTypesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListAcceleratorTypesRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, AcceleratorTypeAggregatedList::class, $request); + } + + /** + * Returns the specified accelerator type. + * + * Sample code: + * ``` + * $acceleratorTypesClient = new AcceleratorTypesClient(); + * try { + * $acceleratorType = 'accelerator_type'; + * $project = 'project'; + * $zone = 'zone'; + * $response = $acceleratorTypesClient->get($acceleratorType, $project, $zone); + * } finally { + * $acceleratorTypesClient->close(); + * } + * ``` + * + * @param string $acceleratorType Name of the accelerator type to return. + * @param string $project Project ID for this request. + * @param string $zone The name of the zone 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\AcceleratorType + * + * @throws ApiException if the remote call fails + */ + public function get($acceleratorType, $project, $zone, array $optionalArgs = []) + { + $request = new GetAcceleratorTypeRequest(); + $requestParamHeaders = []; + $request->setAcceleratorType($acceleratorType); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['accelerator_type'] = $acceleratorType; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', AcceleratorType::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves a list of accelerator types that are available to the specified project. + * + * Sample code: + * ``` + * $acceleratorTypesClient = new AcceleratorTypesClient(); + * try { + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $acceleratorTypesClient->list($project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $acceleratorTypesClient->list($project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $acceleratorTypesClient->close(); + * } + * ``` + * + * @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 $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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, $zone, array $optionalArgs = []) + { + $request = new ListAcceleratorTypesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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, AcceleratorTypeList::class, $request); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/AddressesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/AddressesGapicClient.php new file mode 100644 index 000000000000..c33f5457c54f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/AddressesGapicClient.php @@ -0,0 +1,791 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $addressesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $addressesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\AddressesClient}. + */ +class AddressesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.Addresses'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/addresses_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/addresses_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/addresses_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Retrieves an aggregated list of addresses. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $addressesClient = new AddressesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $addressesClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $addressesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $addressesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListAddressesRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, AddressAggregatedList::class, $request); + } + + /** + * Deletes the specified address resource. + * + * Sample code: + * ``` + * $addressesClient = new AddressesClient(); + * try { + * $address = 'address'; + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $addressesClient->delete($address, $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 = $addressesClient->delete($address, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $addressesClient->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 { + * $addressesClient->close(); + * } + * ``` + * + * @param string $address Name of the address resource to delete. + * @param string $project Project ID for this request. + * @param string $region 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($address, $project, $region, array $optionalArgs = []) + { + $request = new DeleteAddressRequest(); + $requestParamHeaders = []; + $request->setAddress($address); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['address'] = $address; + $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 address resource. + * + * Sample code: + * ``` + * $addressesClient = new AddressesClient(); + * try { + * $address = 'address'; + * $project = 'project'; + * $region = 'region'; + * $response = $addressesClient->get($address, $project, $region); + * } finally { + * $addressesClient->close(); + * } + * ``` + * + * @param string $address Name of the address resource to return. + * @param string $project Project ID for this request. + * @param string $region 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\Address + * + * @throws ApiException if the remote call fails + */ + public function get($address, $project, $region, array $optionalArgs = []) + { + $request = new GetAddressRequest(); + $requestParamHeaders = []; + $request->setAddress($address); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['address'] = $address; + $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', Address::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates an address resource in the specified project by using the data included in the request. + * + * Sample code: + * ``` + * $addressesClient = new AddressesClient(); + * try { + * $addressResource = new Address(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $addressesClient->insert($addressResource, $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 = $addressesClient->insert($addressResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $addressesClient->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 { + * $addressesClient->close(); + * } + * ``` + * + * @param Address $addressResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region 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($addressResource, $project, $region, array $optionalArgs = []) + { + $request = new InsertAddressRequest(); + $requestParamHeaders = []; + $request->setAddressResource($addressResource); + $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 addresses contained within the specified region. + * + * Sample code: + * ``` + * $addressesClient = new AddressesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $addressesClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $addressesClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $addressesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListAddressesRequest(); + $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, AddressList::class, $request); + } + + /** + * Moves the specified address resource. + * + * Sample code: + * ``` + * $addressesClient = new AddressesClient(); + * try { + * $address = 'address'; + * $project = 'project'; + * $region = 'region'; + * $regionAddressesMoveRequestResource = new RegionAddressesMoveRequest(); + * $operationResponse = $addressesClient->move($address, $project, $region, $regionAddressesMoveRequestResource); + * $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 = $addressesClient->move($address, $project, $region, $regionAddressesMoveRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $addressesClient->resumeOperation($operationName, 'move'); + * 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 { + * $addressesClient->close(); + * } + * ``` + * + * @param string $address Name of the address resource to move. + * @param string $project Source project ID which the Address is moved from. + * @param string $region Name of the region for this request. + * @param RegionAddressesMoveRequest $regionAddressesMoveRequestResource The body resource 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 move($address, $project, $region, $regionAddressesMoveRequestResource, array $optionalArgs = []) + { + $request = new MoveAddressRequest(); + $requestParamHeaders = []; + $request->setAddress($address); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionAddressesMoveRequestResource($regionAddressesMoveRequestResource); + $requestParamHeaders['address'] = $address; + $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('Move', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + * ``` + * $addressesClient = new AddressesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + * $resource = 'resource'; + * $operationResponse = $addressesClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + * $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 = $addressesClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $addressesClient->resumeOperation($operationName, 'setLabels'); + * 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 { + * $addressesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The region for this request. + * @param RegionSetLabelsRequest $regionSetLabelsRequestResource The body resource for this request + * @param string $resource Name or id of the resource 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 setLabels($project, $region, $regionSetLabelsRequestResource, $resource, array $optionalArgs = []) + { + $request = new SetLabelsAddressRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + 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('SetLabels', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/AutoscalersGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/AutoscalersGapicClient.php new file mode 100644 index 000000000000..6482593c118b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/AutoscalersGapicClient.php @@ -0,0 +1,793 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $autoscalersClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $autoscalersClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\AutoscalersClient}. + */ +class AutoscalersGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.Autoscalers'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/autoscalers_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/autoscalers_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/autoscalers_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** + * Retrieves an aggregated list of autoscalers. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $autoscalersClient = new AutoscalersClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $autoscalersClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $autoscalersClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $autoscalersClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListAutoscalersRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, AutoscalerAggregatedList::class, $request); + } + + /** + * Deletes the specified autoscaler. + * + * Sample code: + * ``` + * $autoscalersClient = new AutoscalersClient(); + * try { + * $autoscaler = 'autoscaler'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $autoscalersClient->delete($autoscaler, $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 = $autoscalersClient->delete($autoscaler, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $autoscalersClient->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 { + * $autoscalersClient->close(); + * } + * ``` + * + * @param string $autoscaler Name of the autoscaler to delete. + * @param string $project Project ID for this request. + * @param string $zone 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 delete($autoscaler, $project, $zone, array $optionalArgs = []) + { + $request = new DeleteAutoscalerRequest(); + $requestParamHeaders = []; + $request->setAutoscaler($autoscaler); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['autoscaler'] = $autoscaler; + $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('Delete', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns the specified autoscaler resource. + * + * Sample code: + * ``` + * $autoscalersClient = new AutoscalersClient(); + * try { + * $autoscaler = 'autoscaler'; + * $project = 'project'; + * $zone = 'zone'; + * $response = $autoscalersClient->get($autoscaler, $project, $zone); + * } finally { + * $autoscalersClient->close(); + * } + * ``` + * + * @param string $autoscaler Name of the autoscaler to return. + * @param string $project Project ID for this request. + * @param string $zone Name of the zone 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\Autoscaler + * + * @throws ApiException if the remote call fails + */ + public function get($autoscaler, $project, $zone, array $optionalArgs = []) + { + $request = new GetAutoscalerRequest(); + $requestParamHeaders = []; + $request->setAutoscaler($autoscaler); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['autoscaler'] = $autoscaler; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', Autoscaler::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates an autoscaler in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $autoscalersClient = new AutoscalersClient(); + * try { + * $autoscalerResource = new Autoscaler(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $autoscalersClient->insert($autoscalerResource, $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 = $autoscalersClient->insert($autoscalerResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $autoscalersClient->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 { + * $autoscalersClient->close(); + * } + * ``` + * + * @param Autoscaler $autoscalerResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone 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 insert($autoscalerResource, $project, $zone, array $optionalArgs = []) + { + $request = new InsertAutoscalerRequest(); + $requestParamHeaders = []; + $request->setAutoscalerResource($autoscalerResource); + $request->setProject($project); + $request->setZone($zone); + $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('Insert', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Retrieves a list of autoscalers contained within the specified zone. + * + * Sample code: + * ``` + * $autoscalersClient = new AutoscalersClient(); + * try { + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $autoscalersClient->list($project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $autoscalersClient->list($project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $autoscalersClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $zone Name of the zone 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, $zone, array $optionalArgs = []) + { + $request = new ListAutoscalersRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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, AutoscalerList::class, $request); + } + + /** + * Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $autoscalersClient = new AutoscalersClient(); + * try { + * $autoscalerResource = new Autoscaler(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $autoscalersClient->patch($autoscalerResource, $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 = $autoscalersClient->patch($autoscalerResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $autoscalersClient->resumeOperation($operationName, 'patch'); + * 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 { + * $autoscalersClient->close(); + * } + * ``` + * + * @param Autoscaler $autoscalerResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone Name of the zone for this request. + * @param array $optionalArgs { + * Optional. + * + * @type string $autoscaler + * Name of the autoscaler to patch. + * @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 patch($autoscalerResource, $project, $zone, array $optionalArgs = []) + { + $request = new PatchAutoscalerRequest(); + $requestParamHeaders = []; + $request->setAutoscalerResource($autoscalerResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + if (isset($optionalArgs['autoscaler'])) { + $request->setAutoscaler($optionalArgs['autoscaler']); + } + + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Updates an autoscaler in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $autoscalersClient = new AutoscalersClient(); + * try { + * $autoscalerResource = new Autoscaler(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $autoscalersClient->update($autoscalerResource, $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 = $autoscalersClient->update($autoscalerResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $autoscalersClient->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 { + * $autoscalersClient->close(); + * } + * ``` + * + * @param Autoscaler $autoscalerResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone Name of the zone for this request. + * @param array $optionalArgs { + * Optional. + * + * @type string $autoscaler + * Name of the autoscaler to update. + * @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 update($autoscalerResource, $project, $zone, array $optionalArgs = []) + { + $request = new UpdateAutoscalerRequest(); + $requestParamHeaders = []; + $request->setAutoscalerResource($autoscalerResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + if (isset($optionalArgs['autoscaler'])) { + $request->setAutoscaler($optionalArgs['autoscaler']); + } + + 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('Update', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/BackendBucketsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/BackendBucketsGapicClient.php new file mode 100644 index 000000000000..fa93924e9c2e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/BackendBucketsGapicClient.php @@ -0,0 +1,1057 @@ +addSignedUrlKey($backendBucket, $project, $signedUrlKeyResource); + * $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 = $backendBucketsClient->addSignedUrlKey($backendBucket, $project, $signedUrlKeyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $backendBucketsClient->resumeOperation($operationName, 'addSignedUrlKey'); + * 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 { + * $backendBucketsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\BackendBucketsClient}. + */ +class BackendBucketsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.BackendBuckets'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/backend_buckets_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/backend_buckets_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/backend_buckets_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** + * Adds a key for validating requests with signed URLs for this backend bucket. + * + * Sample code: + * ``` + * $backendBucketsClient = new BackendBucketsClient(); + * try { + * $backendBucket = 'backend_bucket'; + * $project = 'project'; + * $signedUrlKeyResource = new SignedUrlKey(); + * $operationResponse = $backendBucketsClient->addSignedUrlKey($backendBucket, $project, $signedUrlKeyResource); + * $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 = $backendBucketsClient->addSignedUrlKey($backendBucket, $project, $signedUrlKeyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $backendBucketsClient->resumeOperation($operationName, 'addSignedUrlKey'); + * 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 { + * $backendBucketsClient->close(); + * } + * ``` + * + * @param string $backendBucket Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @param string $project Project ID for this request. + * @param SignedUrlKey $signedUrlKeyResource The body resource 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 addSignedUrlKey($backendBucket, $project, $signedUrlKeyResource, array $optionalArgs = []) + { + $request = new AddSignedUrlKeyBackendBucketRequest(); + $requestParamHeaders = []; + $request->setBackendBucket($backendBucket); + $request->setProject($project); + $request->setSignedUrlKeyResource($signedUrlKeyResource); + $requestParamHeaders['backend_bucket'] = $backendBucket; + $requestParamHeaders['project'] = $project; + 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('AddSignedUrlKey', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes the specified BackendBucket resource. + * + * Sample code: + * ``` + * $backendBucketsClient = new BackendBucketsClient(); + * try { + * $backendBucket = 'backend_bucket'; + * $project = 'project'; + * $operationResponse = $backendBucketsClient->delete($backendBucket, $project); + * $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 = $backendBucketsClient->delete($backendBucket, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $backendBucketsClient->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 { + * $backendBucketsClient->close(); + * } + * ``` + * + * @param string $backendBucket Name of the BackendBucket resource to delete. + * @param string $project Project ID 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($backendBucket, $project, array $optionalArgs = []) + { + $request = new DeleteBackendBucketRequest(); + $requestParamHeaders = []; + $request->setBackendBucket($backendBucket); + $request->setProject($project); + $requestParamHeaders['backend_bucket'] = $backendBucket; + $requestParamHeaders['project'] = $project; + 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(); + } + + /** + * Deletes a key for validating requests with signed URLs for this backend bucket. + * + * Sample code: + * ``` + * $backendBucketsClient = new BackendBucketsClient(); + * try { + * $backendBucket = 'backend_bucket'; + * $keyName = 'key_name'; + * $project = 'project'; + * $operationResponse = $backendBucketsClient->deleteSignedUrlKey($backendBucket, $keyName, $project); + * $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 = $backendBucketsClient->deleteSignedUrlKey($backendBucket, $keyName, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $backendBucketsClient->resumeOperation($operationName, 'deleteSignedUrlKey'); + * 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 { + * $backendBucketsClient->close(); + * } + * ``` + * + * @param string $backendBucket Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @param string $keyName The name of the Signed URL Key to delete. + * @param string $project Project ID 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 deleteSignedUrlKey($backendBucket, $keyName, $project, array $optionalArgs = []) + { + $request = new DeleteSignedUrlKeyBackendBucketRequest(); + $requestParamHeaders = []; + $request->setBackendBucket($backendBucket); + $request->setKeyName($keyName); + $request->setProject($project); + $requestParamHeaders['backend_bucket'] = $backendBucket; + $requestParamHeaders['project'] = $project; + 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('DeleteSignedUrlKey', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns the specified BackendBucket resource. + * + * Sample code: + * ``` + * $backendBucketsClient = new BackendBucketsClient(); + * try { + * $backendBucket = 'backend_bucket'; + * $project = 'project'; + * $response = $backendBucketsClient->get($backendBucket, $project); + * } finally { + * $backendBucketsClient->close(); + * } + * ``` + * + * @param string $backendBucket Name of the BackendBucket resource to return. + * @param string $project Project ID 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\BackendBucket + * + * @throws ApiException if the remote call fails + */ + public function get($backendBucket, $project, array $optionalArgs = []) + { + $request = new GetBackendBucketRequest(); + $requestParamHeaders = []; + $request->setBackendBucket($backendBucket); + $request->setProject($project); + $requestParamHeaders['backend_bucket'] = $backendBucket; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', BackendBucket::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $backendBucketsClient = new BackendBucketsClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $response = $backendBucketsClient->getIamPolicy($project, $resource); + * } finally { + * $backendBucketsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $resource, array $optionalArgs = []) + { + $request = new GetIamPolicyBackendBucketRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a BackendBucket resource in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $backendBucketsClient = new BackendBucketsClient(); + * try { + * $backendBucketResource = new BackendBucket(); + * $project = 'project'; + * $operationResponse = $backendBucketsClient->insert($backendBucketResource, $project); + * $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 = $backendBucketsClient->insert($backendBucketResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $backendBucketsClient->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 { + * $backendBucketsClient->close(); + * } + * ``` + * + * @param BackendBucket $backendBucketResource The body resource for this request + * @param string $project Project ID 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($backendBucketResource, $project, array $optionalArgs = []) + { + $request = new InsertBackendBucketRequest(); + $requestParamHeaders = []; + $request->setBackendBucketResource($backendBucketResource); + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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 the list of BackendBucket resources available to the specified project. + * + * Sample code: + * ``` + * $backendBucketsClient = new BackendBucketsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $backendBucketsClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $backendBucketsClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $backendBucketsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListBackendBucketsRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, BackendBucketList::class, $request); + } + + /** + * Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $backendBucketsClient = new BackendBucketsClient(); + * try { + * $backendBucket = 'backend_bucket'; + * $backendBucketResource = new BackendBucket(); + * $project = 'project'; + * $operationResponse = $backendBucketsClient->patch($backendBucket, $backendBucketResource, $project); + * $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 = $backendBucketsClient->patch($backendBucket, $backendBucketResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $backendBucketsClient->resumeOperation($operationName, 'patch'); + * 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 { + * $backendBucketsClient->close(); + * } + * ``` + * + * @param string $backendBucket Name of the BackendBucket resource to patch. + * @param BackendBucket $backendBucketResource The body resource for this request + * @param string $project Project ID 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 patch($backendBucket, $backendBucketResource, $project, array $optionalArgs = []) + { + $request = new PatchBackendBucketRequest(); + $requestParamHeaders = []; + $request->setBackendBucket($backendBucket); + $request->setBackendBucketResource($backendBucketResource); + $request->setProject($project); + $requestParamHeaders['backend_bucket'] = $backendBucket; + $requestParamHeaders['project'] = $project; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the edge security policy for the specified backend bucket. + * + * Sample code: + * ``` + * $backendBucketsClient = new BackendBucketsClient(); + * try { + * $backendBucket = 'backend_bucket'; + * $project = 'project'; + * $securityPolicyReferenceResource = new SecurityPolicyReference(); + * $operationResponse = $backendBucketsClient->setEdgeSecurityPolicy($backendBucket, $project, $securityPolicyReferenceResource); + * $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 = $backendBucketsClient->setEdgeSecurityPolicy($backendBucket, $project, $securityPolicyReferenceResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $backendBucketsClient->resumeOperation($operationName, 'setEdgeSecurityPolicy'); + * 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 { + * $backendBucketsClient->close(); + * } + * ``` + * + * @param string $backendBucket Name of the BackendBucket resource to which the security policy should be set. The name should conform to RFC1035. + * @param string $project Project ID for this request. + * @param SecurityPolicyReference $securityPolicyReferenceResource The body resource 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 setEdgeSecurityPolicy($backendBucket, $project, $securityPolicyReferenceResource, array $optionalArgs = []) + { + $request = new SetEdgeSecurityPolicyBackendBucketRequest(); + $requestParamHeaders = []; + $request->setBackendBucket($backendBucket); + $request->setProject($project); + $request->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + $requestParamHeaders['backend_bucket'] = $backendBucket; + $requestParamHeaders['project'] = $project; + 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('SetEdgeSecurityPolicy', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $backendBucketsClient = new BackendBucketsClient(); + * try { + * $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + * $project = 'project'; + * $resource = 'resource'; + * $response = $backendBucketsClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + * } finally { + * $backendBucketsClient->close(); + * } + * ``` + * + * @param GlobalSetPolicyRequest $globalSetPolicyRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($globalSetPolicyRequestResource, $project, $resource, array $optionalArgs = []) + { + $request = new SetIamPolicyBackendBucketRequest(); + $requestParamHeaders = []; + $request->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource); + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $backendBucketsClient = new BackendBucketsClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $response = $backendBucketsClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + * } finally { + * $backendBucketsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $resource, $testPermissionsRequestResource, array $optionalArgs = []) + { + $request = new TestIamPermissionsBackendBucketRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $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 BackendBucket resource with the data included in the request. + * + * Sample code: + * ``` + * $backendBucketsClient = new BackendBucketsClient(); + * try { + * $backendBucket = 'backend_bucket'; + * $backendBucketResource = new BackendBucket(); + * $project = 'project'; + * $operationResponse = $backendBucketsClient->update($backendBucket, $backendBucketResource, $project); + * $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 = $backendBucketsClient->update($backendBucket, $backendBucketResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $backendBucketsClient->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 { + * $backendBucketsClient->close(); + * } + * ``` + * + * @param string $backendBucket Name of the BackendBucket resource to update. + * @param BackendBucket $backendBucketResource The body resource for this request + * @param string $project Project ID 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 update($backendBucket, $backendBucketResource, $project, array $optionalArgs = []) + { + $request = new UpdateBackendBucketRequest(); + $requestParamHeaders = []; + $request->setBackendBucket($backendBucket); + $request->setBackendBucketResource($backendBucketResource); + $request->setProject($project); + $requestParamHeaders['backend_bucket'] = $backendBucket; + $requestParamHeaders['project'] = $project; + 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('Update', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/BackendServicesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/BackendServicesGapicClient.php new file mode 100644 index 000000000000..02cfb74290be --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/BackendServicesGapicClient.php @@ -0,0 +1,1366 @@ +addSignedUrlKey($backendService, $project, $signedUrlKeyResource); + * $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 = $backendServicesClient->addSignedUrlKey($backendService, $project, $signedUrlKeyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $backendServicesClient->resumeOperation($operationName, 'addSignedUrlKey'); + * 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 { + * $backendServicesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\BackendServicesClient}. + */ +class BackendServicesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.BackendServices'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/backend_services_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/backend_services_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/backend_services_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** + * Adds a key for validating requests with signed URLs for this backend service. + * + * Sample code: + * ``` + * $backendServicesClient = new BackendServicesClient(); + * try { + * $backendService = 'backend_service'; + * $project = 'project'; + * $signedUrlKeyResource = new SignedUrlKey(); + * $operationResponse = $backendServicesClient->addSignedUrlKey($backendService, $project, $signedUrlKeyResource); + * $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 = $backendServicesClient->addSignedUrlKey($backendService, $project, $signedUrlKeyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $backendServicesClient->resumeOperation($operationName, 'addSignedUrlKey'); + * 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 { + * $backendServicesClient->close(); + * } + * ``` + * + * @param string $backendService Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @param string $project Project ID for this request. + * @param SignedUrlKey $signedUrlKeyResource The body resource 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 addSignedUrlKey($backendService, $project, $signedUrlKeyResource, array $optionalArgs = []) + { + $request = new AddSignedUrlKeyBackendServiceRequest(); + $requestParamHeaders = []; + $request->setBackendService($backendService); + $request->setProject($project); + $request->setSignedUrlKeyResource($signedUrlKeyResource); + $requestParamHeaders['backend_service'] = $backendService; + $requestParamHeaders['project'] = $project; + 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('AddSignedUrlKey', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Retrieves the list of all BackendService resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $backendServicesClient = new BackendServicesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $backendServicesClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $backendServicesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $backendServicesClient->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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListBackendServicesRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, BackendServiceAggregatedList::class, $request); + } + + /** + * Deletes the specified BackendService resource. + * + * Sample code: + * ``` + * $backendServicesClient = new BackendServicesClient(); + * try { + * $backendService = 'backend_service'; + * $project = 'project'; + * $operationResponse = $backendServicesClient->delete($backendService, $project); + * $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 = $backendServicesClient->delete($backendService, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $backendServicesClient->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 { + * $backendServicesClient->close(); + * } + * ``` + * + * @param string $backendService Name of the BackendService resource to delete. + * @param string $project Project ID 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($backendService, $project, array $optionalArgs = []) + { + $request = new DeleteBackendServiceRequest(); + $requestParamHeaders = []; + $request->setBackendService($backendService); + $request->setProject($project); + $requestParamHeaders['backend_service'] = $backendService; + $requestParamHeaders['project'] = $project; + 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(); + } + + /** + * Deletes a key for validating requests with signed URLs for this backend service. + * + * Sample code: + * ``` + * $backendServicesClient = new BackendServicesClient(); + * try { + * $backendService = 'backend_service'; + * $keyName = 'key_name'; + * $project = 'project'; + * $operationResponse = $backendServicesClient->deleteSignedUrlKey($backendService, $keyName, $project); + * $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 = $backendServicesClient->deleteSignedUrlKey($backendService, $keyName, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $backendServicesClient->resumeOperation($operationName, 'deleteSignedUrlKey'); + * 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 { + * $backendServicesClient->close(); + * } + * ``` + * + * @param string $backendService Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @param string $keyName The name of the Signed URL Key to delete. + * @param string $project Project ID 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 deleteSignedUrlKey($backendService, $keyName, $project, array $optionalArgs = []) + { + $request = new DeleteSignedUrlKeyBackendServiceRequest(); + $requestParamHeaders = []; + $request->setBackendService($backendService); + $request->setKeyName($keyName); + $request->setProject($project); + $requestParamHeaders['backend_service'] = $backendService; + $requestParamHeaders['project'] = $project; + 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('DeleteSignedUrlKey', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns the specified BackendService resource. + * + * Sample code: + * ``` + * $backendServicesClient = new BackendServicesClient(); + * try { + * $backendService = 'backend_service'; + * $project = 'project'; + * $response = $backendServicesClient->get($backendService, $project); + * } finally { + * $backendServicesClient->close(); + * } + * ``` + * + * @param string $backendService Name of the BackendService resource to return. + * @param string $project Project ID 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\BackendService + * + * @throws ApiException if the remote call fails + */ + public function get($backendService, $project, array $optionalArgs = []) + { + $request = new GetBackendServiceRequest(); + $requestParamHeaders = []; + $request->setBackendService($backendService); + $request->setProject($project); + $requestParamHeaders['backend_service'] = $backendService; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', BackendService::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the most recent health check results for this BackendService. Example request body: { "group": "/zones/us-east1-b/instanceGroups/lb-backend-example" } + * + * Sample code: + * ``` + * $backendServicesClient = new BackendServicesClient(); + * try { + * $backendService = 'backend_service'; + * $project = 'project'; + * $resourceGroupReferenceResource = new ResourceGroupReference(); + * $response = $backendServicesClient->getHealth($backendService, $project, $resourceGroupReferenceResource); + * } finally { + * $backendServicesClient->close(); + * } + * ``` + * + * @param string $backendService Name of the BackendService resource to which the queried instance belongs. + * @param string $project + * @param ResourceGroupReference $resourceGroupReferenceResource The body resource 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\BackendServiceGroupHealth + * + * @throws ApiException if the remote call fails + */ + public function getHealth($backendService, $project, $resourceGroupReferenceResource, array $optionalArgs = []) + { + $request = new GetHealthBackendServiceRequest(); + $requestParamHeaders = []; + $request->setBackendService($backendService); + $request->setProject($project); + $request->setResourceGroupReferenceResource($resourceGroupReferenceResource); + $requestParamHeaders['backend_service'] = $backendService; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetHealth', BackendServiceGroupHealth::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $backendServicesClient = new BackendServicesClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $response = $backendServicesClient->getIamPolicy($project, $resource); + * } finally { + * $backendServicesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $resource, array $optionalArgs = []) + { + $request = new GetIamPolicyBackendServiceRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview . + * + * Sample code: + * ``` + * $backendServicesClient = new BackendServicesClient(); + * try { + * $backendServiceResource = new BackendService(); + * $project = 'project'; + * $operationResponse = $backendServicesClient->insert($backendServiceResource, $project); + * $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 = $backendServicesClient->insert($backendServiceResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $backendServicesClient->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 { + * $backendServicesClient->close(); + * } + * ``` + * + * @param BackendService $backendServiceResource The body resource for this request + * @param string $project Project ID 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($backendServiceResource, $project, array $optionalArgs = []) + { + $request = new InsertBackendServiceRequest(); + $requestParamHeaders = []; + $request->setBackendServiceResource($backendServiceResource); + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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 the list of BackendService resources available to the specified project. + * + * Sample code: + * ``` + * $backendServicesClient = new BackendServicesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $backendServicesClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $backendServicesClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $backendServicesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListBackendServicesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, BackendServiceList::class, $request); + } + + /** + * Retrieves an aggregated list of all usable backend services in the specified project. + * + * Sample code: + * ``` + * $backendServicesClient = new BackendServicesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $backendServicesClient->listUsable($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $backendServicesClient->listUsable($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $backendServicesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 listUsable($project, array $optionalArgs = []) + { + $request = new ListUsableBackendServicesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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('ListUsable', $optionalArgs, BackendServiceListUsable::class, $request); + } + + /** + * Patches the specified BackendService resource with the data included in the request. For more information, see Backend services overview. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $backendServicesClient = new BackendServicesClient(); + * try { + * $backendService = 'backend_service'; + * $backendServiceResource = new BackendService(); + * $project = 'project'; + * $operationResponse = $backendServicesClient->patch($backendService, $backendServiceResource, $project); + * $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 = $backendServicesClient->patch($backendService, $backendServiceResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $backendServicesClient->resumeOperation($operationName, 'patch'); + * 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 { + * $backendServicesClient->close(); + * } + * ``` + * + * @param string $backendService Name of the BackendService resource to patch. + * @param BackendService $backendServiceResource The body resource for this request + * @param string $project Project ID 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 patch($backendService, $backendServiceResource, $project, array $optionalArgs = []) + { + $request = new PatchBackendServiceRequest(); + $requestParamHeaders = []; + $request->setBackendService($backendService); + $request->setBackendServiceResource($backendServiceResource); + $request->setProject($project); + $requestParamHeaders['backend_service'] = $backendService; + $requestParamHeaders['project'] = $project; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the edge security policy for the specified backend service. + * + * Sample code: + * ``` + * $backendServicesClient = new BackendServicesClient(); + * try { + * $backendService = 'backend_service'; + * $project = 'project'; + * $securityPolicyReferenceResource = new SecurityPolicyReference(); + * $operationResponse = $backendServicesClient->setEdgeSecurityPolicy($backendService, $project, $securityPolicyReferenceResource); + * $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 = $backendServicesClient->setEdgeSecurityPolicy($backendService, $project, $securityPolicyReferenceResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $backendServicesClient->resumeOperation($operationName, 'setEdgeSecurityPolicy'); + * 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 { + * $backendServicesClient->close(); + * } + * ``` + * + * @param string $backendService Name of the BackendService resource to which the edge security policy should be set. The name should conform to RFC1035. + * @param string $project Project ID for this request. + * @param SecurityPolicyReference $securityPolicyReferenceResource The body resource 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 setEdgeSecurityPolicy($backendService, $project, $securityPolicyReferenceResource, array $optionalArgs = []) + { + $request = new SetEdgeSecurityPolicyBackendServiceRequest(); + $requestParamHeaders = []; + $request->setBackendService($backendService); + $request->setProject($project); + $request->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + $requestParamHeaders['backend_service'] = $backendService; + $requestParamHeaders['project'] = $project; + 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('SetEdgeSecurityPolicy', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $backendServicesClient = new BackendServicesClient(); + * try { + * $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + * $project = 'project'; + * $resource = 'resource'; + * $response = $backendServicesClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + * } finally { + * $backendServicesClient->close(); + * } + * ``` + * + * @param GlobalSetPolicyRequest $globalSetPolicyRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($globalSetPolicyRequestResource, $project, $resource, array $optionalArgs = []) + { + $request = new SetIamPolicyBackendServiceRequest(); + $requestParamHeaders = []; + $request->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource); + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview + * + * Sample code: + * ``` + * $backendServicesClient = new BackendServicesClient(); + * try { + * $backendService = 'backend_service'; + * $project = 'project'; + * $securityPolicyReferenceResource = new SecurityPolicyReference(); + * $operationResponse = $backendServicesClient->setSecurityPolicy($backendService, $project, $securityPolicyReferenceResource); + * $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 = $backendServicesClient->setSecurityPolicy($backendService, $project, $securityPolicyReferenceResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $backendServicesClient->resumeOperation($operationName, 'setSecurityPolicy'); + * 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 { + * $backendServicesClient->close(); + * } + * ``` + * + * @param string $backendService Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. + * @param string $project Project ID for this request. + * @param SecurityPolicyReference $securityPolicyReferenceResource The body resource 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 setSecurityPolicy($backendService, $project, $securityPolicyReferenceResource, array $optionalArgs = []) + { + $request = new SetSecurityPolicyBackendServiceRequest(); + $requestParamHeaders = []; + $request->setBackendService($backendService); + $request->setProject($project); + $request->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + $requestParamHeaders['backend_service'] = $backendService; + $requestParamHeaders['project'] = $project; + 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('SetSecurityPolicy', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $backendServicesClient = new BackendServicesClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $response = $backendServicesClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + * } finally { + * $backendServicesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $resource, $testPermissionsRequestResource, array $optionalArgs = []) + { + $request = new TestIamPermissionsBackendServiceRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $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 BackendService resource with the data included in the request. For more information, see Backend services overview. + * + * Sample code: + * ``` + * $backendServicesClient = new BackendServicesClient(); + * try { + * $backendService = 'backend_service'; + * $backendServiceResource = new BackendService(); + * $project = 'project'; + * $operationResponse = $backendServicesClient->update($backendService, $backendServiceResource, $project); + * $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 = $backendServicesClient->update($backendService, $backendServiceResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $backendServicesClient->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 { + * $backendServicesClient->close(); + * } + * ``` + * + * @param string $backendService Name of the BackendService resource to update. + * @param BackendService $backendServiceResource The body resource for this request + * @param string $project Project ID 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 update($backendService, $backendServiceResource, $project, array $optionalArgs = []) + { + $request = new UpdateBackendServiceRequest(); + $requestParamHeaders = []; + $request->setBackendService($backendService); + $request->setBackendServiceResource($backendServiceResource); + $request->setProject($project); + $requestParamHeaders['backend_service'] = $backendService; + $requestParamHeaders['project'] = $project; + 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('Update', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/DiskTypesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/DiskTypesGapicClient.php new file mode 100644 index 000000000000..2b0b62785796 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/DiskTypesGapicClient.php @@ -0,0 +1,422 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $diskTypesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $diskTypesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\DiskTypesClient}. + */ +class DiskTypesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.DiskTypes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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.readonly', + 'https://www.googleapis.com/auth/compute', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/disk_types_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/disk_types_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/disk_types_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** + * Retrieves an aggregated list of disk types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $diskTypesClient = new DiskTypesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $diskTypesClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $diskTypesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $diskTypesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListDiskTypesRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, DiskTypeAggregatedList::class, $request); + } + + /** + * Returns the specified disk type. + * + * Sample code: + * ``` + * $diskTypesClient = new DiskTypesClient(); + * try { + * $diskType = 'disk_type'; + * $project = 'project'; + * $zone = 'zone'; + * $response = $diskTypesClient->get($diskType, $project, $zone); + * } finally { + * $diskTypesClient->close(); + * } + * ``` + * + * @param string $diskType Name of the disk type to return. + * @param string $project Project ID for this request. + * @param string $zone The name of the zone 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\DiskType + * + * @throws ApiException if the remote call fails + */ + public function get($diskType, $project, $zone, array $optionalArgs = []) + { + $request = new GetDiskTypeRequest(); + $requestParamHeaders = []; + $request->setDiskType($diskType); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['disk_type'] = $diskType; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', DiskType::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves a list of disk types available to the specified project. + * + * Sample code: + * ``` + * $diskTypesClient = new DiskTypesClient(); + * try { + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $diskTypesClient->list($project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $diskTypesClient->list($project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $diskTypesClient->close(); + * } + * ``` + * + * @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 $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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, $zone, array $optionalArgs = []) + { + $request = new ListDiskTypesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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, DiskTypeList::class, $request); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/DisksGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/DisksGapicClient.php new file mode 100644 index 000000000000..05316b0d0563 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/DisksGapicClient.php @@ -0,0 +1,1623 @@ +addResourcePolicies($disk, $disksAddResourcePoliciesRequestResource, $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->addResourcePolicies($disk, $disksAddResourcePoliciesRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $disksClient->resumeOperation($operationName, 'addResourcePolicies'); + * 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(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\DisksClient}. + */ +class DisksGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.Disks'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/disks_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/disks_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/disks_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** + * Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. + * + * Sample code: + * ``` + * $disksClient = new DisksClient(); + * try { + * $disk = 'disk'; + * $disksAddResourcePoliciesRequestResource = new DisksAddResourcePoliciesRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $disksClient->addResourcePolicies($disk, $disksAddResourcePoliciesRequestResource, $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->addResourcePolicies($disk, $disksAddResourcePoliciesRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $disksClient->resumeOperation($operationName, 'addResourcePolicies'); + * 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 DisksAddResourcePoliciesRequest $disksAddResourcePoliciesRequestResource 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 addResourcePolicies($disk, $disksAddResourcePoliciesRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new AddResourcePoliciesDiskRequest(); + $requestParamHeaders = []; + $request->setDisk($disk); + $request->setDisksAddResourcePoliciesRequestResource($disksAddResourcePoliciesRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['disk'] = $disk; + $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('AddResourcePolicies', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Retrieves an aggregated list of persistent disks. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $disksClient = new DisksClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $disksClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $disksClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $disksClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListDisksRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, DiskAggregatedList::class, $request); + } + + /** + * Bulk create a set of disks. + * + * Sample code: + * ``` + * $disksClient = new DisksClient(); + * try { + * $bulkInsertDiskResourceResource = new BulkInsertDiskResource(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $disksClient->bulkInsert($bulkInsertDiskResourceResource, $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->bulkInsert($bulkInsertDiskResourceResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $disksClient->resumeOperation($operationName, 'bulkInsert'); + * 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 BulkInsertDiskResource $bulkInsertDiskResourceResource 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 bulkInsert($bulkInsertDiskResourceResource, $project, $zone, array $optionalArgs = []) + { + $request = new BulkInsertDiskRequest(); + $requestParamHeaders = []; + $request->setBulkInsertDiskResourceResource($bulkInsertDiskResourceResource); + $request->setProject($project); + $request->setZone($zone); + $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('BulkInsert', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Creates a snapshot of a specified persistent disk. For regular snapshot creation, consider using snapshots.insert instead, as that method supports more features, such as creating snapshots in a project different from the source disk project. + * + * Sample code: + * ``` + * $disksClient = new DisksClient(); + * try { + * $disk = 'disk'; + * $project = 'project'; + * $snapshotResource = new Snapshot(); + * $zone = 'zone'; + * $operationResponse = $disksClient->createSnapshot($disk, $project, $snapshotResource, $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->createSnapshot($disk, $project, $snapshotResource, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $disksClient->resumeOperation($operationName, 'createSnapshot'); + * 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 Name of the persistent disk to snapshot. + * @param string $project Project ID for this request. + * @param Snapshot $snapshotResource The body resource for this request + * @param string $zone The name of the zone for this request. + * @param array $optionalArgs { + * Optional. + * + * @type bool $guestFlush + * [Input Only] Whether to attempt an application consistent snapshot by informing the OS to prepare for the snapshot process. + * @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 createSnapshot($disk, $project, $snapshotResource, $zone, array $optionalArgs = []) + { + $request = new CreateSnapshotDiskRequest(); + $requestParamHeaders = []; + $request->setDisk($disk); + $request->setProject($project); + $request->setSnapshotResource($snapshotResource); + $request->setZone($zone); + $requestParamHeaders['disk'] = $disk; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + if (isset($optionalArgs['guestFlush'])) { + $request->setGuestFlush($optionalArgs['guestFlush']); + } + + 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('CreateSnapshot', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. + * + * Sample code: + * ``` + * $disksClient = new DisksClient(); + * try { + * $disk = 'disk'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $disksClient->delete($disk, $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->delete($disk, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $disksClient->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 { + * $disksClient->close(); + * } + * ``` + * + * @param string $disk Name of the persistent disk to delete. + * @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 delete($disk, $project, $zone, array $optionalArgs = []) + { + $request = new DeleteDiskRequest(); + $requestParamHeaders = []; + $request->setDisk($disk); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['disk'] = $disk; + $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('Delete', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns the specified persistent disk. + * + * Sample code: + * ``` + * $disksClient = new DisksClient(); + * try { + * $disk = 'disk'; + * $project = 'project'; + * $zone = 'zone'; + * $response = $disksClient->get($disk, $project, $zone); + * } finally { + * $disksClient->close(); + * } + * ``` + * + * @param string $disk Name of the persistent disk to return. + * @param string $project Project ID for this request. + * @param string $zone The name of the zone 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\Disk + * + * @throws ApiException if the remote call fails + */ + public function get($disk, $project, $zone, array $optionalArgs = []) + { + $request = new GetDiskRequest(); + $requestParamHeaders = []; + $request->setDisk($disk); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['disk'] = $disk; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', Disk::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $disksClient = new DisksClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $zone = 'zone'; + * $response = $disksClient->getIamPolicy($project, $resource, $zone); + * } finally { + * $disksClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param string $zone The name of the zone for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $resource, $zone, array $optionalArgs = []) + { + $request = new GetIamPolicyDiskRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParamHeaders['zone'] = $zone; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a persistent disk in the specified project using the data in the request. You can create a disk from a source (sourceImage, sourceSnapshot, or sourceDisk) or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property. + * + * Sample code: + * ``` + * $disksClient = new DisksClient(); + * try { + * $diskResource = new Disk(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $disksClient->insert($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->insert($diskResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $disksClient->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 { + * $disksClient->close(); + * } + * ``` + * + * @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 $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 $sourceImage + * Source image to restore onto a disk. This field is 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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function insert($diskResource, $project, $zone, array $optionalArgs = []) + { + $request = new InsertDiskRequest(); + $requestParamHeaders = []; + $request->setDiskResource($diskResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['sourceImage'])) { + $request->setSourceImage($optionalArgs['sourceImage']); + } + + $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 persistent disks contained within the specified zone. + * + * Sample code: + * ``` + * $disksClient = new DisksClient(); + * try { + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $disksClient->list($project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $disksClient->list($project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $disksClient->close(); + * } + * ``` + * + * @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 $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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, $zone, array $optionalArgs = []) + { + $request = new ListDisksRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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, DiskList::class, $request); + } + + /** + * Removes resource policies from a disk. + * + * Sample code: + * ``` + * $disksClient = new DisksClient(); + * try { + * $disk = 'disk'; + * $disksRemoveResourcePoliciesRequestResource = new DisksRemoveResourcePoliciesRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $disksClient->removeResourcePolicies($disk, $disksRemoveResourcePoliciesRequestResource, $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->removeResourcePolicies($disk, $disksRemoveResourcePoliciesRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $disksClient->resumeOperation($operationName, 'removeResourcePolicies'); + * 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 DisksRemoveResourcePoliciesRequest $disksRemoveResourcePoliciesRequestResource 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 removeResourcePolicies($disk, $disksRemoveResourcePoliciesRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new RemoveResourcePoliciesDiskRequest(); + $requestParamHeaders = []; + $request->setDisk($disk); + $request->setDisksRemoveResourcePoliciesRequestResource($disksRemoveResourcePoliciesRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['disk'] = $disk; + $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('RemoveResourcePolicies', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Resizes the specified persistent disk. You can only increase the size of the disk. + * + * Sample code: + * ``` + * $disksClient = new DisksClient(); + * try { + * $disk = 'disk'; + * $disksResizeRequestResource = new DisksResizeRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $disksClient->resize($disk, $disksResizeRequestResource, $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->resize($disk, $disksResizeRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $disksClient->resumeOperation($operationName, 'resize'); + * 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 name of the persistent disk. + * @param DisksResizeRequest $disksResizeRequestResource 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 resize($disk, $disksResizeRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new ResizeDiskRequest(); + $requestParamHeaders = []; + $request->setDisk($disk); + $request->setDisksResizeRequestResource($disksResizeRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['disk'] = $disk; + $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('Resize', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $disksClient = new DisksClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $zone = 'zone'; + * $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + * $response = $disksClient->setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource); + * } finally { + * $disksClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param string $zone The name of the zone for this request. + * @param ZoneSetPolicyRequest $zoneSetPolicyRequestResource The body resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource, array $optionalArgs = []) + { + $request = new SetIamPolicyDiskRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setZone($zone); + $request->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + * ``` + * $disksClient = new DisksClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $zone = 'zone'; + * $zoneSetLabelsRequestResource = new ZoneSetLabelsRequest(); + * $operationResponse = $disksClient->setLabels($project, $resource, $zone, $zoneSetLabelsRequestResource); + * $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->setLabels($project, $resource, $zone, $zoneSetLabelsRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $disksClient->resumeOperation($operationName, 'setLabels'); + * 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 $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param string $zone The name of the zone for this request. + * @param ZoneSetLabelsRequest $zoneSetLabelsRequestResource The body resource 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 setLabels($project, $resource, $zone, $zoneSetLabelsRequestResource, array $optionalArgs = []) + { + $request = new SetLabelsDiskRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setZone($zone); + $request->setZoneSetLabelsRequestResource($zoneSetLabelsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $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('SetLabels', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Starts asynchronous replication. Must be invoked on the primary disk. + * + * Sample code: + * ``` + * $disksClient = new DisksClient(); + * try { + * $disk = 'disk'; + * $disksStartAsyncReplicationRequestResource = new DisksStartAsyncReplicationRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $disksClient->startAsyncReplication($disk, $disksStartAsyncReplicationRequestResource, $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->startAsyncReplication($disk, $disksStartAsyncReplicationRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $disksClient->resumeOperation($operationName, 'startAsyncReplication'); + * 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 name of the persistent disk. + * @param DisksStartAsyncReplicationRequest $disksStartAsyncReplicationRequestResource 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 startAsyncReplication($disk, $disksStartAsyncReplicationRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new StartAsyncReplicationDiskRequest(); + $requestParamHeaders = []; + $request->setDisk($disk); + $request->setDisksStartAsyncReplicationRequestResource($disksStartAsyncReplicationRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['disk'] = $disk; + $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('StartAsyncReplication', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Stops asynchronous replication. Can be invoked either on the primary or on the secondary disk. + * + * Sample code: + * ``` + * $disksClient = new DisksClient(); + * try { + * $disk = 'disk'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $disksClient->stopAsyncReplication($disk, $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->stopAsyncReplication($disk, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $disksClient->resumeOperation($operationName, 'stopAsyncReplication'); + * 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 name of the persistent disk. + * @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 stopAsyncReplication($disk, $project, $zone, array $optionalArgs = []) + { + $request = new StopAsyncReplicationDiskRequest(); + $requestParamHeaders = []; + $request->setDisk($disk); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['disk'] = $disk; + $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('StopAsyncReplication', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Stops asynchronous replication for a consistency group of disks. Can be invoked either in the primary or secondary scope. + * + * Sample code: + * ``` + * $disksClient = new DisksClient(); + * try { + * $disksStopGroupAsyncReplicationResourceResource = new DisksStopGroupAsyncReplicationResource(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $disksClient->stopGroupAsyncReplication($disksStopGroupAsyncReplicationResourceResource, $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->stopGroupAsyncReplication($disksStopGroupAsyncReplicationResourceResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $disksClient->resumeOperation($operationName, 'stopGroupAsyncReplication'); + * 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 DisksStopGroupAsyncReplicationResource $disksStopGroupAsyncReplicationResourceResource 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. This must be the zone of the primary or secondary disks in the consistency group. + * @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 stopGroupAsyncReplication($disksStopGroupAsyncReplicationResourceResource, $project, $zone, array $optionalArgs = []) + { + $request = new StopGroupAsyncReplicationDiskRequest(); + $requestParamHeaders = []; + $request->setDisksStopGroupAsyncReplicationResourceResource($disksStopGroupAsyncReplicationResourceResource); + $request->setProject($project); + $request->setZone($zone); + $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('StopGroupAsyncReplication', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $disksClient = new DisksClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $zone = 'zone'; + * $response = $disksClient->testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone); + * } finally { + * $disksClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * @param string $zone The name of the zone 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone, array $optionalArgs = []) + { + $request = new TestIamPermissionsDiskRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $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/owl-bot-staging/Compute/V1/src/V1/Gapic/ExternalVpnGatewaysGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/ExternalVpnGatewaysGapicClient.php new file mode 100644 index 000000000000..72f50a115ed3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/ExternalVpnGatewaysGapicClient.php @@ -0,0 +1,646 @@ +delete($externalVpnGateway, $project); + * $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 = $externalVpnGatewaysClient->delete($externalVpnGateway, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $externalVpnGatewaysClient->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 { + * $externalVpnGatewaysClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\ExternalVpnGatewaysClient}. + */ +class ExternalVpnGatewaysGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.ExternalVpnGateways'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/external_vpn_gateways_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/external_vpn_gateways_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/external_vpn_gateways_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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 externalVpnGateway. + * + * Sample code: + * ``` + * $externalVpnGatewaysClient = new ExternalVpnGatewaysClient(); + * try { + * $externalVpnGateway = 'external_vpn_gateway'; + * $project = 'project'; + * $operationResponse = $externalVpnGatewaysClient->delete($externalVpnGateway, $project); + * $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 = $externalVpnGatewaysClient->delete($externalVpnGateway, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $externalVpnGatewaysClient->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 { + * $externalVpnGatewaysClient->close(); + * } + * ``` + * + * @param string $externalVpnGateway Name of the externalVpnGateways to delete. + * @param string $project Project ID 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($externalVpnGateway, $project, array $optionalArgs = []) + { + $request = new DeleteExternalVpnGatewayRequest(); + $requestParamHeaders = []; + $request->setExternalVpnGateway($externalVpnGateway); + $request->setProject($project); + $requestParamHeaders['external_vpn_gateway'] = $externalVpnGateway; + $requestParamHeaders['project'] = $project; + 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 externalVpnGateway. Get a list of available externalVpnGateways by making a list() request. + * + * Sample code: + * ``` + * $externalVpnGatewaysClient = new ExternalVpnGatewaysClient(); + * try { + * $externalVpnGateway = 'external_vpn_gateway'; + * $project = 'project'; + * $response = $externalVpnGatewaysClient->get($externalVpnGateway, $project); + * } finally { + * $externalVpnGatewaysClient->close(); + * } + * ``` + * + * @param string $externalVpnGateway Name of the externalVpnGateway to return. + * @param string $project Project ID 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\ExternalVpnGateway + * + * @throws ApiException if the remote call fails + */ + public function get($externalVpnGateway, $project, array $optionalArgs = []) + { + $request = new GetExternalVpnGatewayRequest(); + $requestParamHeaders = []; + $request->setExternalVpnGateway($externalVpnGateway); + $request->setProject($project); + $requestParamHeaders['external_vpn_gateway'] = $externalVpnGateway; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', ExternalVpnGateway::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a ExternalVpnGateway in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $externalVpnGatewaysClient = new ExternalVpnGatewaysClient(); + * try { + * $externalVpnGatewayResource = new ExternalVpnGateway(); + * $project = 'project'; + * $operationResponse = $externalVpnGatewaysClient->insert($externalVpnGatewayResource, $project); + * $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 = $externalVpnGatewaysClient->insert($externalVpnGatewayResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $externalVpnGatewaysClient->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 { + * $externalVpnGatewaysClient->close(); + * } + * ``` + * + * @param ExternalVpnGateway $externalVpnGatewayResource The body resource for this request + * @param string $project Project ID 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($externalVpnGatewayResource, $project, array $optionalArgs = []) + { + $request = new InsertExternalVpnGatewayRequest(); + $requestParamHeaders = []; + $request->setExternalVpnGatewayResource($externalVpnGatewayResource); + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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 the list of ExternalVpnGateway available to the specified project. + * + * Sample code: + * ``` + * $externalVpnGatewaysClient = new ExternalVpnGatewaysClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $externalVpnGatewaysClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $externalVpnGatewaysClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $externalVpnGatewaysClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListExternalVpnGatewaysRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, ExternalVpnGatewayList::class, $request); + } + + /** + * Sets the labels on an ExternalVpnGateway. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + * ``` + * $externalVpnGatewaysClient = new ExternalVpnGatewaysClient(); + * try { + * $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + * $project = 'project'; + * $resource = 'resource'; + * $operationResponse = $externalVpnGatewaysClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + * $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 = $externalVpnGatewaysClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $externalVpnGatewaysClient->resumeOperation($operationName, 'setLabels'); + * 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 { + * $externalVpnGatewaysClient->close(); + * } + * ``` + * + * @param GlobalSetLabelsRequest $globalSetLabelsRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource 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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function setLabels($globalSetLabelsRequestResource, $project, $resource, array $optionalArgs = []) + { + $request = new SetLabelsExternalVpnGatewayRequest(); + $requestParamHeaders = []; + $request->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource); + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('SetLabels', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $externalVpnGatewaysClient = new ExternalVpnGatewaysClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $response = $externalVpnGatewaysClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + * } finally { + * $externalVpnGatewaysClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $resource, $testPermissionsRequestResource, array $optionalArgs = []) + { + $request = new TestIamPermissionsExternalVpnGatewayRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/FirewallPoliciesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/FirewallPoliciesGapicClient.php new file mode 100644 index 000000000000..32419d78312c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/FirewallPoliciesGapicClient.php @@ -0,0 +1,1379 @@ +addAssociation($firewallPolicy, $firewallPolicyAssociationResource); + * $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 = $firewallPoliciesClient->addAssociation($firewallPolicy, $firewallPolicyAssociationResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firewallPoliciesClient->resumeOperation($operationName, 'addAssociation'); + * 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 { + * $firewallPoliciesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\FirewallPoliciesClient}. + */ +class FirewallPoliciesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.FirewallPolicies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/firewall_policies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/firewall_policies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/firewall_policies_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOrganizationOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOrganizationOperationsClient object with the same endpoint as + * $this. + * + * @return GlobalOrganizationOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [], + '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); + } + + /** + * Inserts an association for the specified firewall policy. + * + * Sample code: + * ``` + * $firewallPoliciesClient = new FirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $firewallPolicyAssociationResource = new FirewallPolicyAssociation(); + * $operationResponse = $firewallPoliciesClient->addAssociation($firewallPolicy, $firewallPolicyAssociationResource); + * $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 = $firewallPoliciesClient->addAssociation($firewallPolicy, $firewallPolicyAssociationResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firewallPoliciesClient->resumeOperation($operationName, 'addAssociation'); + * 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 { + * $firewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to update. + * @param FirewallPolicyAssociation $firewallPolicyAssociationResource The body resource for this request + * @param array $optionalArgs { + * Optional. + * + * @type bool $replaceExistingAssociation + * Indicates whether or not to replace it if an association of the attachment already exists. This is false by default, in which case an error will be returned if an association already exists. + * @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 addAssociation($firewallPolicy, $firewallPolicyAssociationResource, array $optionalArgs = []) + { + $request = new AddAssociationFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setFirewallPolicyAssociationResource($firewallPolicyAssociationResource); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + if (isset($optionalArgs['replaceExistingAssociation'])) { + $request->setReplaceExistingAssociation($optionalArgs['replaceExistingAssociation']); + } + + 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('AddAssociation', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Inserts a rule into a firewall policy. + * + * Sample code: + * ``` + * $firewallPoliciesClient = new FirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $firewallPolicyRuleResource = new FirewallPolicyRule(); + * $operationResponse = $firewallPoliciesClient->addRule($firewallPolicy, $firewallPolicyRuleResource); + * $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 = $firewallPoliciesClient->addRule($firewallPolicy, $firewallPolicyRuleResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firewallPoliciesClient->resumeOperation($operationName, 'addRule'); + * 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 { + * $firewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to update. + * @param FirewallPolicyRule $firewallPolicyRuleResource The body resource 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 addRule($firewallPolicy, $firewallPolicyRuleResource, array $optionalArgs = []) + { + $request = new AddRuleFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setFirewallPolicyRuleResource($firewallPolicyRuleResource); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + 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('AddRule', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Copies rules to the specified firewall policy. + * + * Sample code: + * ``` + * $firewallPoliciesClient = new FirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $operationResponse = $firewallPoliciesClient->cloneRules($firewallPolicy); + * $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 = $firewallPoliciesClient->cloneRules($firewallPolicy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firewallPoliciesClient->resumeOperation($operationName, 'cloneRules'); + * 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 { + * $firewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to update. + * @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 string $sourceFirewallPolicy + * The firewall policy from which to copy rules. + * @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 cloneRules($firewallPolicy, array $optionalArgs = []) + { + $request = new CloneRulesFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['sourceFirewallPolicy'])) { + $request->setSourceFirewallPolicy($optionalArgs['sourceFirewallPolicy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CloneRules', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes the specified policy. + * + * Sample code: + * ``` + * $firewallPoliciesClient = new FirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $operationResponse = $firewallPoliciesClient->delete($firewallPolicy); + * $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 = $firewallPoliciesClient->delete($firewallPolicy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firewallPoliciesClient->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 { + * $firewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to delete. + * @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($firewallPolicy, array $optionalArgs = []) + { + $request = new DeleteFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + 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 firewall policy. + * + * Sample code: + * ``` + * $firewallPoliciesClient = new FirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $response = $firewallPoliciesClient->get($firewallPolicy); + * } finally { + * $firewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to get. + * @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\FirewallPolicy + * + * @throws ApiException if the remote call fails + */ + public function get($firewallPolicy, array $optionalArgs = []) + { + $request = new GetFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', FirewallPolicy::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets an association with the specified name. + * + * Sample code: + * ``` + * $firewallPoliciesClient = new FirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $response = $firewallPoliciesClient->getAssociation($firewallPolicy); + * } finally { + * $firewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to which the queried rule belongs. + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The name of the association to get from the firewall policy. + * @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\FirewallPolicyAssociation + * + * @throws ApiException if the remote call fails + */ + public function getAssociation($firewallPolicy, array $optionalArgs = []) + { + $request = new GetAssociationFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetAssociation', FirewallPolicyAssociation::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $firewallPoliciesClient = new FirewallPoliciesClient(); + * try { + * $resource = 'resource'; + * $response = $firewallPoliciesClient->getIamPolicy($resource); + * } finally { + * $firewallPoliciesClient->close(); + * } + * ``` + * + * @param string $resource Name or id of the resource for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($resource, array $optionalArgs = []) + { + $request = new GetIamPolicyFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a rule of the specified priority. + * + * Sample code: + * ``` + * $firewallPoliciesClient = new FirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $response = $firewallPoliciesClient->getRule($firewallPolicy); + * } finally { + * $firewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to which the queried rule belongs. + * @param array $optionalArgs { + * Optional. + * + * @type int $priority + * The priority of the rule to get from the firewall policy. + * @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\FirewallPolicyRule + * + * @throws ApiException if the remote call fails + */ + public function getRule($firewallPolicy, array $optionalArgs = []) + { + $request = new GetRuleFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + if (isset($optionalArgs['priority'])) { + $request->setPriority($optionalArgs['priority']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetRule', FirewallPolicyRule::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a new policy in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $firewallPoliciesClient = new FirewallPoliciesClient(); + * try { + * $firewallPolicyResource = new FirewallPolicy(); + * $parentId = 'parent_id'; + * $operationResponse = $firewallPoliciesClient->insert($firewallPolicyResource, $parentId); + * $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 = $firewallPoliciesClient->insert($firewallPolicyResource, $parentId); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firewallPoliciesClient->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 { + * $firewallPoliciesClient->close(); + * } + * ``` + * + * @param FirewallPolicy $firewallPolicyResource The body resource for this request + * @param string $parentId 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. + * @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($firewallPolicyResource, $parentId, array $optionalArgs = []) + { + $request = new InsertFirewallPolicyRequest(); + $request->setFirewallPolicyResource($firewallPolicyResource); + $request->setParentId($parentId); + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + return $this->startOperationsCall('Insert', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Lists all the policies that have been configured for the specified folder or organization. + * + * Sample code: + * ``` + * $firewallPoliciesClient = new FirewallPoliciesClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $firewallPoliciesClient->list(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $firewallPoliciesClient->list(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $firewallPoliciesClient->close(); + * } + * ``` + * + * @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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 string $parentId + * 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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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(array $optionalArgs = []) + { + $request = new ListFirewallPoliciesRequest(); + 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['parentId'])) { + $request->setParentId($optionalArgs['parentId']); + } + + if (isset($optionalArgs['returnPartialSuccess'])) { + $request->setReturnPartialSuccess($optionalArgs['returnPartialSuccess']); + } + + return $this->getPagedListResponse('List', $optionalArgs, FirewallPolicyList::class, $request); + } + + /** + * Lists associations of a specified target, i.e., organization or folder. + * + * Sample code: + * ``` + * $firewallPoliciesClient = new FirewallPoliciesClient(); + * try { + * $response = $firewallPoliciesClient->listAssociations(); + * } finally { + * $firewallPoliciesClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $targetResource + * The target resource to list associations. It is an organization, or a folder. + * @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\FirewallPoliciesListAssociationsResponse + * + * @throws ApiException if the remote call fails + */ + public function listAssociations(array $optionalArgs = []) + { + $request = new ListAssociationsFirewallPolicyRequest(); + if (isset($optionalArgs['targetResource'])) { + $request->setTargetResource($optionalArgs['targetResource']); + } + + return $this->startCall('ListAssociations', FirewallPoliciesListAssociationsResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Moves the specified firewall policy. + * + * Sample code: + * ``` + * $firewallPoliciesClient = new FirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $parentId = 'parent_id'; + * $operationResponse = $firewallPoliciesClient->move($firewallPolicy, $parentId); + * $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 = $firewallPoliciesClient->move($firewallPolicy, $parentId); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firewallPoliciesClient->resumeOperation($operationName, 'move'); + * 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 { + * $firewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to update. + * @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. + * + * @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 move($firewallPolicy, $parentId, array $optionalArgs = []) + { + $request = new MoveFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setParentId($parentId); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + 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('Move', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Patches the specified policy with the data included in the request. + * + * Sample code: + * ``` + * $firewallPoliciesClient = new FirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $firewallPolicyResource = new FirewallPolicy(); + * $operationResponse = $firewallPoliciesClient->patch($firewallPolicy, $firewallPolicyResource); + * $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 = $firewallPoliciesClient->patch($firewallPolicy, $firewallPolicyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firewallPoliciesClient->resumeOperation($operationName, 'patch'); + * 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 { + * $firewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to update. + * @param FirewallPolicy $firewallPolicyResource The body resource 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 patch($firewallPolicy, $firewallPolicyResource, array $optionalArgs = []) + { + $request = new PatchFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setFirewallPolicyResource($firewallPolicyResource); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Patches a rule of the specified priority. + * + * Sample code: + * ``` + * $firewallPoliciesClient = new FirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $firewallPolicyRuleResource = new FirewallPolicyRule(); + * $operationResponse = $firewallPoliciesClient->patchRule($firewallPolicy, $firewallPolicyRuleResource); + * $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 = $firewallPoliciesClient->patchRule($firewallPolicy, $firewallPolicyRuleResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firewallPoliciesClient->resumeOperation($operationName, 'patchRule'); + * 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 { + * $firewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to update. + * @param FirewallPolicyRule $firewallPolicyRuleResource The body resource for this request + * @param array $optionalArgs { + * Optional. + * + * @type int $priority + * The priority of the rule to patch. + * @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 patchRule($firewallPolicy, $firewallPolicyRuleResource, array $optionalArgs = []) + { + $request = new PatchRuleFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setFirewallPolicyRuleResource($firewallPolicyRuleResource); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + if (isset($optionalArgs['priority'])) { + $request->setPriority($optionalArgs['priority']); + } + + 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('PatchRule', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Removes an association for the specified firewall policy. + * + * Sample code: + * ``` + * $firewallPoliciesClient = new FirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $operationResponse = $firewallPoliciesClient->removeAssociation($firewallPolicy); + * $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 = $firewallPoliciesClient->removeAssociation($firewallPolicy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firewallPoliciesClient->resumeOperation($operationName, 'removeAssociation'); + * 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 { + * $firewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to update. + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Name for the attachment that will be removed. + * @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 removeAssociation($firewallPolicy, array $optionalArgs = []) + { + $request = new RemoveAssociationFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + } + + 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('RemoveAssociation', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes a rule of the specified priority. + * + * Sample code: + * ``` + * $firewallPoliciesClient = new FirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $operationResponse = $firewallPoliciesClient->removeRule($firewallPolicy); + * $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 = $firewallPoliciesClient->removeRule($firewallPolicy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firewallPoliciesClient->resumeOperation($operationName, 'removeRule'); + * 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 { + * $firewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to update. + * @param array $optionalArgs { + * Optional. + * + * @type int $priority + * The priority of the rule to remove from the firewall policy. + * @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 removeRule($firewallPolicy, array $optionalArgs = []) + { + $request = new RemoveRuleFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + if (isset($optionalArgs['priority'])) { + $request->setPriority($optionalArgs['priority']); + } + + 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('RemoveRule', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $firewallPoliciesClient = new FirewallPoliciesClient(); + * try { + * $globalOrganizationSetPolicyRequestResource = new GlobalOrganizationSetPolicyRequest(); + * $resource = 'resource'; + * $response = $firewallPoliciesClient->setIamPolicy($globalOrganizationSetPolicyRequestResource, $resource); + * } finally { + * $firewallPoliciesClient->close(); + * } + * ``` + * + * @param GlobalOrganizationSetPolicyRequest $globalOrganizationSetPolicyRequestResource The body resource for this request + * @param string $resource Name or id of the resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($globalOrganizationSetPolicyRequestResource, $resource, array $optionalArgs = []) + { + $request = new SetIamPolicyFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setGlobalOrganizationSetPolicyRequestResource($globalOrganizationSetPolicyRequestResource); + $request->setResource($resource); + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $firewallPoliciesClient = new FirewallPoliciesClient(); + * try { + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $response = $firewallPoliciesClient->testIamPermissions($resource, $testPermissionsRequestResource); + * } finally { + * $firewallPoliciesClient->close(); + * } + * ``` + * + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($resource, $testPermissionsRequestResource, array $optionalArgs = []) + { + $request = new TestIamPermissionsFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/FirewallsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/FirewallsGapicClient.php new file mode 100644 index 000000000000..cb9c5bcf6ba3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/FirewallsGapicClient.php @@ -0,0 +1,678 @@ +delete($firewall, $project); + * $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 = $firewallsClient->delete($firewall, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firewallsClient->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 { + * $firewallsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\FirewallsClient}. + */ +class FirewallsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.Firewalls'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/firewalls_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/firewalls_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/firewalls_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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 firewall. + * + * Sample code: + * ``` + * $firewallsClient = new FirewallsClient(); + * try { + * $firewall = 'firewall'; + * $project = 'project'; + * $operationResponse = $firewallsClient->delete($firewall, $project); + * $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 = $firewallsClient->delete($firewall, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firewallsClient->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 { + * $firewallsClient->close(); + * } + * ``` + * + * @param string $firewall Name of the firewall rule to delete. + * @param string $project Project ID 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($firewall, $project, array $optionalArgs = []) + { + $request = new DeleteFirewallRequest(); + $requestParamHeaders = []; + $request->setFirewall($firewall); + $request->setProject($project); + $requestParamHeaders['firewall'] = $firewall; + $requestParamHeaders['project'] = $project; + 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 firewall. + * + * Sample code: + * ``` + * $firewallsClient = new FirewallsClient(); + * try { + * $firewall = 'firewall'; + * $project = 'project'; + * $response = $firewallsClient->get($firewall, $project); + * } finally { + * $firewallsClient->close(); + * } + * ``` + * + * @param string $firewall Name of the firewall rule to return. + * @param string $project Project ID 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\Firewall + * + * @throws ApiException if the remote call fails + */ + public function get($firewall, $project, array $optionalArgs = []) + { + $request = new GetFirewallRequest(); + $requestParamHeaders = []; + $request->setFirewall($firewall); + $request->setProject($project); + $requestParamHeaders['firewall'] = $firewall; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', Firewall::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a firewall rule in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $firewallsClient = new FirewallsClient(); + * try { + * $firewallResource = new Firewall(); + * $project = 'project'; + * $operationResponse = $firewallsClient->insert($firewallResource, $project); + * $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 = $firewallsClient->insert($firewallResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firewallsClient->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 { + * $firewallsClient->close(); + * } + * ``` + * + * @param Firewall $firewallResource The body resource for this request + * @param string $project Project ID 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($firewallResource, $project, array $optionalArgs = []) + { + $request = new InsertFirewallRequest(); + $requestParamHeaders = []; + $request->setFirewallResource($firewallResource); + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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 the list of firewall rules available to the specified project. + * + * Sample code: + * ``` + * $firewallsClient = new FirewallsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $firewallsClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $firewallsClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $firewallsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListFirewallsRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, FirewallList::class, $request); + } + + /** + * Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $firewallsClient = new FirewallsClient(); + * try { + * $firewall = 'firewall'; + * $firewallResource = new Firewall(); + * $project = 'project'; + * $operationResponse = $firewallsClient->patch($firewall, $firewallResource, $project); + * $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 = $firewallsClient->patch($firewall, $firewallResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firewallsClient->resumeOperation($operationName, 'patch'); + * 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 { + * $firewallsClient->close(); + * } + * ``` + * + * @param string $firewall Name of the firewall rule to patch. + * @param Firewall $firewallResource The body resource for this request + * @param string $project Project ID 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 patch($firewall, $firewallResource, $project, array $optionalArgs = []) + { + $request = new PatchFirewallRequest(); + $requestParamHeaders = []; + $request->setFirewall($firewall); + $request->setFirewallResource($firewallResource); + $request->setProject($project); + $requestParamHeaders['firewall'] = $firewall; + $requestParamHeaders['project'] = $project; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Updates the specified firewall rule with the data included in the request. Note that all fields will be updated if using PUT, even fields that are not specified. To update individual fields, please use PATCH instead. + * + * Sample code: + * ``` + * $firewallsClient = new FirewallsClient(); + * try { + * $firewall = 'firewall'; + * $firewallResource = new Firewall(); + * $project = 'project'; + * $operationResponse = $firewallsClient->update($firewall, $firewallResource, $project); + * $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 = $firewallsClient->update($firewall, $firewallResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $firewallsClient->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 { + * $firewallsClient->close(); + * } + * ``` + * + * @param string $firewall Name of the firewall rule to update. + * @param Firewall $firewallResource The body resource for this request + * @param string $project Project ID 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 update($firewall, $firewallResource, $project, array $optionalArgs = []) + { + $request = new UpdateFirewallRequest(); + $requestParamHeaders = []; + $request->setFirewall($firewall); + $request->setFirewallResource($firewallResource); + $request->setProject($project); + $requestParamHeaders['firewall'] = $firewall; + $requestParamHeaders['project'] = $project; + 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('Update', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/ForwardingRulesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/ForwardingRulesGapicClient.php new file mode 100644 index 000000000000..e31ccd9f8936 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/ForwardingRulesGapicClient.php @@ -0,0 +1,871 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $forwardingRulesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $forwardingRulesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\ForwardingRulesClient}. + */ +class ForwardingRulesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.ForwardingRules'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/forwarding_rules_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/forwarding_rules_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/forwarding_rules_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Retrieves an aggregated list of forwarding rules. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $forwardingRulesClient = new ForwardingRulesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $forwardingRulesClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $forwardingRulesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $forwardingRulesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListForwardingRulesRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, ForwardingRuleAggregatedList::class, $request); + } + + /** + * Deletes the specified ForwardingRule resource. + * + * Sample code: + * ``` + * $forwardingRulesClient = new ForwardingRulesClient(); + * try { + * $forwardingRule = 'forwarding_rule'; + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $forwardingRulesClient->delete($forwardingRule, $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 = $forwardingRulesClient->delete($forwardingRule, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $forwardingRulesClient->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 { + * $forwardingRulesClient->close(); + * } + * ``` + * + * @param string $forwardingRule Name of the ForwardingRule resource to delete. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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($forwardingRule, $project, $region, array $optionalArgs = []) + { + $request = new DeleteForwardingRuleRequest(); + $requestParamHeaders = []; + $request->setForwardingRule($forwardingRule); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['forwarding_rule'] = $forwardingRule; + $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 ForwardingRule resource. + * + * Sample code: + * ``` + * $forwardingRulesClient = new ForwardingRulesClient(); + * try { + * $forwardingRule = 'forwarding_rule'; + * $project = 'project'; + * $region = 'region'; + * $response = $forwardingRulesClient->get($forwardingRule, $project, $region); + * } finally { + * $forwardingRulesClient->close(); + * } + * ``` + * + * @param string $forwardingRule Name of the ForwardingRule resource to return. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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\ForwardingRule + * + * @throws ApiException if the remote call fails + */ + public function get($forwardingRule, $project, $region, array $optionalArgs = []) + { + $request = new GetForwardingRuleRequest(); + $requestParamHeaders = []; + $request->setForwardingRule($forwardingRule); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['forwarding_rule'] = $forwardingRule; + $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', ForwardingRule::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a ForwardingRule resource in the specified project and region using the data included in the request. + * + * Sample code: + * ``` + * $forwardingRulesClient = new ForwardingRulesClient(); + * try { + * $forwardingRuleResource = new ForwardingRule(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $forwardingRulesClient->insert($forwardingRuleResource, $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 = $forwardingRulesClient->insert($forwardingRuleResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $forwardingRulesClient->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 { + * $forwardingRulesClient->close(); + * } + * ``` + * + * @param ForwardingRule $forwardingRuleResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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($forwardingRuleResource, $project, $region, array $optionalArgs = []) + { + $request = new InsertForwardingRuleRequest(); + $requestParamHeaders = []; + $request->setForwardingRuleResource($forwardingRuleResource); + $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 ForwardingRule resources available to the specified project and region. + * + * Sample code: + * ``` + * $forwardingRulesClient = new ForwardingRulesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $forwardingRulesClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $forwardingRulesClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $forwardingRulesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListForwardingRulesRequest(); + $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, ForwardingRuleList::class, $request); + } + + /** + * Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. + * + * Sample code: + * ``` + * $forwardingRulesClient = new ForwardingRulesClient(); + * try { + * $forwardingRule = 'forwarding_rule'; + * $forwardingRuleResource = new ForwardingRule(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $forwardingRulesClient->patch($forwardingRule, $forwardingRuleResource, $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 = $forwardingRulesClient->patch($forwardingRule, $forwardingRuleResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $forwardingRulesClient->resumeOperation($operationName, 'patch'); + * 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 { + * $forwardingRulesClient->close(); + * } + * ``` + * + * @param string $forwardingRule Name of the ForwardingRule resource to patch. + * @param ForwardingRule $forwardingRuleResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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 patch($forwardingRule, $forwardingRuleResource, $project, $region, array $optionalArgs = []) + { + $request = new PatchForwardingRuleRequest(); + $requestParamHeaders = []; + $request->setForwardingRule($forwardingRule); + $request->setForwardingRuleResource($forwardingRuleResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['forwarding_rule'] = $forwardingRule; + $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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + * ``` + * $forwardingRulesClient = new ForwardingRulesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + * $resource = 'resource'; + * $operationResponse = $forwardingRulesClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + * $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 = $forwardingRulesClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $forwardingRulesClient->resumeOperation($operationName, 'setLabels'); + * 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 { + * $forwardingRulesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The region for this request. + * @param RegionSetLabelsRequest $regionSetLabelsRequestResource The body resource for this request + * @param string $resource Name or id of the resource 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 setLabels($project, $region, $regionSetLabelsRequestResource, $resource, array $optionalArgs = []) + { + $request = new SetLabelsForwardingRuleRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + 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('SetLabels', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Changes target URL for forwarding rule. The new target should be of the same type as the old target. + * + * Sample code: + * ``` + * $forwardingRulesClient = new ForwardingRulesClient(); + * try { + * $forwardingRule = 'forwarding_rule'; + * $project = 'project'; + * $region = 'region'; + * $targetReferenceResource = new TargetReference(); + * $operationResponse = $forwardingRulesClient->setTarget($forwardingRule, $project, $region, $targetReferenceResource); + * $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 = $forwardingRulesClient->setTarget($forwardingRule, $project, $region, $targetReferenceResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $forwardingRulesClient->resumeOperation($operationName, 'setTarget'); + * 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 { + * $forwardingRulesClient->close(); + * } + * ``` + * + * @param string $forwardingRule Name of the ForwardingRule resource in which target is to be set. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param TargetReference $targetReferenceResource The body resource 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 setTarget($forwardingRule, $project, $region, $targetReferenceResource, array $optionalArgs = []) + { + $request = new SetTargetForwardingRuleRequest(); + $requestParamHeaders = []; + $request->setForwardingRule($forwardingRule); + $request->setProject($project); + $request->setRegion($region); + $request->setTargetReferenceResource($targetReferenceResource); + $requestParamHeaders['forwarding_rule'] = $forwardingRule; + $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('SetTarget', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalAddressesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalAddressesGapicClient.php new file mode 100644 index 000000000000..263a70ccb0de --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalAddressesGapicClient.php @@ -0,0 +1,674 @@ +delete($address, $project); + * $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 = $globalAddressesClient->delete($address, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $globalAddressesClient->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 { + * $globalAddressesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\GlobalAddressesClient}. + */ +class GlobalAddressesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.GlobalAddresses'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/global_addresses_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/global_addresses_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/global_addresses_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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 address resource. + * + * Sample code: + * ``` + * $globalAddressesClient = new GlobalAddressesClient(); + * try { + * $address = 'address'; + * $project = 'project'; + * $operationResponse = $globalAddressesClient->delete($address, $project); + * $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 = $globalAddressesClient->delete($address, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $globalAddressesClient->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 { + * $globalAddressesClient->close(); + * } + * ``` + * + * @param string $address Name of the address resource to delete. + * @param string $project Project ID 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($address, $project, array $optionalArgs = []) + { + $request = new DeleteGlobalAddressRequest(); + $requestParamHeaders = []; + $request->setAddress($address); + $request->setProject($project); + $requestParamHeaders['address'] = $address; + $requestParamHeaders['project'] = $project; + 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 address resource. + * + * Sample code: + * ``` + * $globalAddressesClient = new GlobalAddressesClient(); + * try { + * $address = 'address'; + * $project = 'project'; + * $response = $globalAddressesClient->get($address, $project); + * } finally { + * $globalAddressesClient->close(); + * } + * ``` + * + * @param string $address Name of the address resource to return. + * @param string $project Project ID 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\Address + * + * @throws ApiException if the remote call fails + */ + public function get($address, $project, array $optionalArgs = []) + { + $request = new GetGlobalAddressRequest(); + $requestParamHeaders = []; + $request->setAddress($address); + $request->setProject($project); + $requestParamHeaders['address'] = $address; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', Address::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates an address resource in the specified project by using the data included in the request. + * + * Sample code: + * ``` + * $globalAddressesClient = new GlobalAddressesClient(); + * try { + * $addressResource = new Address(); + * $project = 'project'; + * $operationResponse = $globalAddressesClient->insert($addressResource, $project); + * $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 = $globalAddressesClient->insert($addressResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $globalAddressesClient->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 { + * $globalAddressesClient->close(); + * } + * ``` + * + * @param Address $addressResource The body resource for this request + * @param string $project Project ID 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($addressResource, $project, array $optionalArgs = []) + { + $request = new InsertGlobalAddressRequest(); + $requestParamHeaders = []; + $request->setAddressResource($addressResource); + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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 global addresses. + * + * Sample code: + * ``` + * $globalAddressesClient = new GlobalAddressesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $globalAddressesClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $globalAddressesClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $globalAddressesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListGlobalAddressesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, AddressList::class, $request); + } + + /** + * Moves the specified address resource from one project to another project. + * + * Sample code: + * ``` + * $globalAddressesClient = new GlobalAddressesClient(); + * try { + * $address = 'address'; + * $globalAddressesMoveRequestResource = new GlobalAddressesMoveRequest(); + * $project = 'project'; + * $operationResponse = $globalAddressesClient->move($address, $globalAddressesMoveRequestResource, $project); + * $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 = $globalAddressesClient->move($address, $globalAddressesMoveRequestResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $globalAddressesClient->resumeOperation($operationName, 'move'); + * 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 { + * $globalAddressesClient->close(); + * } + * ``` + * + * @param string $address Name of the address resource to move. + * @param GlobalAddressesMoveRequest $globalAddressesMoveRequestResource The body resource for this request + * @param string $project Source project ID which the Address is moved from. + * @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 move($address, $globalAddressesMoveRequestResource, $project, array $optionalArgs = []) + { + $request = new MoveGlobalAddressRequest(); + $requestParamHeaders = []; + $request->setAddress($address); + $request->setGlobalAddressesMoveRequestResource($globalAddressesMoveRequestResource); + $request->setProject($project); + $requestParamHeaders['address'] = $address; + $requestParamHeaders['project'] = $project; + 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('Move', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the labels on a GlobalAddress. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + * ``` + * $globalAddressesClient = new GlobalAddressesClient(); + * try { + * $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + * $project = 'project'; + * $resource = 'resource'; + * $operationResponse = $globalAddressesClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + * $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 = $globalAddressesClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $globalAddressesClient->resumeOperation($operationName, 'setLabels'); + * 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 { + * $globalAddressesClient->close(); + * } + * ``` + * + * @param GlobalSetLabelsRequest $globalSetLabelsRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource 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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function setLabels($globalSetLabelsRequestResource, $project, $resource, array $optionalArgs = []) + { + $request = new SetLabelsGlobalAddressRequest(); + $requestParamHeaders = []; + $request->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource); + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('SetLabels', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalForwardingRulesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalForwardingRulesGapicClient.php new file mode 100644 index 000000000000..5483bead6bcd --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalForwardingRulesGapicClient.php @@ -0,0 +1,750 @@ +delete($forwardingRule, $project); + * $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 = $globalForwardingRulesClient->delete($forwardingRule, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $globalForwardingRulesClient->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 { + * $globalForwardingRulesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\GlobalForwardingRulesClient}. + */ +class GlobalForwardingRulesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.GlobalForwardingRules'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/global_forwarding_rules_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/global_forwarding_rules_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/global_forwarding_rules_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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 GlobalForwardingRule resource. + * + * Sample code: + * ``` + * $globalForwardingRulesClient = new GlobalForwardingRulesClient(); + * try { + * $forwardingRule = 'forwarding_rule'; + * $project = 'project'; + * $operationResponse = $globalForwardingRulesClient->delete($forwardingRule, $project); + * $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 = $globalForwardingRulesClient->delete($forwardingRule, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $globalForwardingRulesClient->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 { + * $globalForwardingRulesClient->close(); + * } + * ``` + * + * @param string $forwardingRule Name of the ForwardingRule resource to delete. + * @param string $project Project ID 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($forwardingRule, $project, array $optionalArgs = []) + { + $request = new DeleteGlobalForwardingRuleRequest(); + $requestParamHeaders = []; + $request->setForwardingRule($forwardingRule); + $request->setProject($project); + $requestParamHeaders['forwarding_rule'] = $forwardingRule; + $requestParamHeaders['project'] = $project; + 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 GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request. + * + * Sample code: + * ``` + * $globalForwardingRulesClient = new GlobalForwardingRulesClient(); + * try { + * $forwardingRule = 'forwarding_rule'; + * $project = 'project'; + * $response = $globalForwardingRulesClient->get($forwardingRule, $project); + * } finally { + * $globalForwardingRulesClient->close(); + * } + * ``` + * + * @param string $forwardingRule Name of the ForwardingRule resource to return. + * @param string $project Project ID 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\ForwardingRule + * + * @throws ApiException if the remote call fails + */ + public function get($forwardingRule, $project, array $optionalArgs = []) + { + $request = new GetGlobalForwardingRuleRequest(); + $requestParamHeaders = []; + $request->setForwardingRule($forwardingRule); + $request->setProject($project); + $requestParamHeaders['forwarding_rule'] = $forwardingRule; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', ForwardingRule::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a GlobalForwardingRule resource in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $globalForwardingRulesClient = new GlobalForwardingRulesClient(); + * try { + * $forwardingRuleResource = new ForwardingRule(); + * $project = 'project'; + * $operationResponse = $globalForwardingRulesClient->insert($forwardingRuleResource, $project); + * $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 = $globalForwardingRulesClient->insert($forwardingRuleResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $globalForwardingRulesClient->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 { + * $globalForwardingRulesClient->close(); + * } + * ``` + * + * @param ForwardingRule $forwardingRuleResource The body resource for this request + * @param string $project Project ID 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($forwardingRuleResource, $project, array $optionalArgs = []) + { + $request = new InsertGlobalForwardingRuleRequest(); + $requestParamHeaders = []; + $request->setForwardingRuleResource($forwardingRuleResource); + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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 GlobalForwardingRule resources available to the specified project. + * + * Sample code: + * ``` + * $globalForwardingRulesClient = new GlobalForwardingRulesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $globalForwardingRulesClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $globalForwardingRulesClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $globalForwardingRulesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListGlobalForwardingRulesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, ForwardingRuleList::class, $request); + } + + /** + * Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. + * + * Sample code: + * ``` + * $globalForwardingRulesClient = new GlobalForwardingRulesClient(); + * try { + * $forwardingRule = 'forwarding_rule'; + * $forwardingRuleResource = new ForwardingRule(); + * $project = 'project'; + * $operationResponse = $globalForwardingRulesClient->patch($forwardingRule, $forwardingRuleResource, $project); + * $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 = $globalForwardingRulesClient->patch($forwardingRule, $forwardingRuleResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $globalForwardingRulesClient->resumeOperation($operationName, 'patch'); + * 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 { + * $globalForwardingRulesClient->close(); + * } + * ``` + * + * @param string $forwardingRule Name of the ForwardingRule resource to patch. + * @param ForwardingRule $forwardingRuleResource The body resource for this request + * @param string $project Project ID 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 patch($forwardingRule, $forwardingRuleResource, $project, array $optionalArgs = []) + { + $request = new PatchGlobalForwardingRuleRequest(); + $requestParamHeaders = []; + $request->setForwardingRule($forwardingRule); + $request->setForwardingRuleResource($forwardingRuleResource); + $request->setProject($project); + $requestParamHeaders['forwarding_rule'] = $forwardingRule; + $requestParamHeaders['project'] = $project; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the labels on the specified resource. To learn more about labels, read the Labeling resources documentation. + * + * Sample code: + * ``` + * $globalForwardingRulesClient = new GlobalForwardingRulesClient(); + * try { + * $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + * $project = 'project'; + * $resource = 'resource'; + * $operationResponse = $globalForwardingRulesClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + * $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 = $globalForwardingRulesClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $globalForwardingRulesClient->resumeOperation($operationName, 'setLabels'); + * 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 { + * $globalForwardingRulesClient->close(); + * } + * ``` + * + * @param GlobalSetLabelsRequest $globalSetLabelsRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource 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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function setLabels($globalSetLabelsRequestResource, $project, $resource, array $optionalArgs = []) + { + $request = new SetLabelsGlobalForwardingRuleRequest(); + $requestParamHeaders = []; + $request->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource); + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('SetLabels', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. + * + * Sample code: + * ``` + * $globalForwardingRulesClient = new GlobalForwardingRulesClient(); + * try { + * $forwardingRule = 'forwarding_rule'; + * $project = 'project'; + * $targetReferenceResource = new TargetReference(); + * $operationResponse = $globalForwardingRulesClient->setTarget($forwardingRule, $project, $targetReferenceResource); + * $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 = $globalForwardingRulesClient->setTarget($forwardingRule, $project, $targetReferenceResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $globalForwardingRulesClient->resumeOperation($operationName, 'setTarget'); + * 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 { + * $globalForwardingRulesClient->close(); + * } + * ``` + * + * @param string $forwardingRule Name of the ForwardingRule resource in which target is to be set. + * @param string $project Project ID for this request. + * @param TargetReference $targetReferenceResource The body resource 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 setTarget($forwardingRule, $project, $targetReferenceResource, array $optionalArgs = []) + { + $request = new SetTargetGlobalForwardingRuleRequest(); + $requestParamHeaders = []; + $request->setForwardingRule($forwardingRule); + $request->setProject($project); + $request->setTargetReferenceResource($targetReferenceResource); + $requestParamHeaders['forwarding_rule'] = $forwardingRule; + $requestParamHeaders['project'] = $project; + 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('SetTarget', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalNetworkEndpointGroupsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalNetworkEndpointGroupsGapicClient.php new file mode 100644 index 000000000000..f09af5347121 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalNetworkEndpointGroupsGapicClient.php @@ -0,0 +1,771 @@ +attachNetworkEndpoints($globalNetworkEndpointGroupsAttachEndpointsRequestResource, $networkEndpointGroup, $project); + * $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 = $globalNetworkEndpointGroupsClient->attachNetworkEndpoints($globalNetworkEndpointGroupsAttachEndpointsRequestResource, $networkEndpointGroup, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $globalNetworkEndpointGroupsClient->resumeOperation($operationName, 'attachNetworkEndpoints'); + * 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 { + * $globalNetworkEndpointGroupsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\GlobalNetworkEndpointGroupsClient}. + */ +class GlobalNetworkEndpointGroupsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.GlobalNetworkEndpointGroups'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/global_network_endpoint_groups_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/global_network_endpoint_groups_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/global_network_endpoint_groups_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** + * Attach a network endpoint to the specified network endpoint group. + * + * Sample code: + * ``` + * $globalNetworkEndpointGroupsClient = new GlobalNetworkEndpointGroupsClient(); + * try { + * $globalNetworkEndpointGroupsAttachEndpointsRequestResource = new GlobalNetworkEndpointGroupsAttachEndpointsRequest(); + * $networkEndpointGroup = 'network_endpoint_group'; + * $project = 'project'; + * $operationResponse = $globalNetworkEndpointGroupsClient->attachNetworkEndpoints($globalNetworkEndpointGroupsAttachEndpointsRequestResource, $networkEndpointGroup, $project); + * $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 = $globalNetworkEndpointGroupsClient->attachNetworkEndpoints($globalNetworkEndpointGroupsAttachEndpointsRequestResource, $networkEndpointGroup, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $globalNetworkEndpointGroupsClient->resumeOperation($operationName, 'attachNetworkEndpoints'); + * 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 { + * $globalNetworkEndpointGroupsClient->close(); + * } + * ``` + * + * @param GlobalNetworkEndpointGroupsAttachEndpointsRequest $globalNetworkEndpointGroupsAttachEndpointsRequestResource The body resource for this request + * @param string $networkEndpointGroup The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * @param string $project Project ID 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 attachNetworkEndpoints($globalNetworkEndpointGroupsAttachEndpointsRequestResource, $networkEndpointGroup, $project, array $optionalArgs = []) + { + $request = new AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest(); + $requestParamHeaders = []; + $request->setGlobalNetworkEndpointGroupsAttachEndpointsRequestResource($globalNetworkEndpointGroupsAttachEndpointsRequestResource); + $request->setNetworkEndpointGroup($networkEndpointGroup); + $request->setProject($project); + $requestParamHeaders['network_endpoint_group'] = $networkEndpointGroup; + $requestParamHeaders['project'] = $project; + 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('AttachNetworkEndpoints', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes the specified network endpoint group.Note that the NEG cannot be deleted if there are backend services referencing it. + * + * Sample code: + * ``` + * $globalNetworkEndpointGroupsClient = new GlobalNetworkEndpointGroupsClient(); + * try { + * $networkEndpointGroup = 'network_endpoint_group'; + * $project = 'project'; + * $operationResponse = $globalNetworkEndpointGroupsClient->delete($networkEndpointGroup, $project); + * $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 = $globalNetworkEndpointGroupsClient->delete($networkEndpointGroup, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $globalNetworkEndpointGroupsClient->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 { + * $globalNetworkEndpointGroupsClient->close(); + * } + * ``` + * + * @param string $networkEndpointGroup The name of the network endpoint group to delete. It should comply with RFC1035. + * @param string $project Project ID 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($networkEndpointGroup, $project, array $optionalArgs = []) + { + $request = new DeleteGlobalNetworkEndpointGroupRequest(); + $requestParamHeaders = []; + $request->setNetworkEndpointGroup($networkEndpointGroup); + $request->setProject($project); + $requestParamHeaders['network_endpoint_group'] = $networkEndpointGroup; + $requestParamHeaders['project'] = $project; + 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(); + } + + /** + * Detach the network endpoint from the specified network endpoint group. + * + * Sample code: + * ``` + * $globalNetworkEndpointGroupsClient = new GlobalNetworkEndpointGroupsClient(); + * try { + * $globalNetworkEndpointGroupsDetachEndpointsRequestResource = new GlobalNetworkEndpointGroupsDetachEndpointsRequest(); + * $networkEndpointGroup = 'network_endpoint_group'; + * $project = 'project'; + * $operationResponse = $globalNetworkEndpointGroupsClient->detachNetworkEndpoints($globalNetworkEndpointGroupsDetachEndpointsRequestResource, $networkEndpointGroup, $project); + * $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 = $globalNetworkEndpointGroupsClient->detachNetworkEndpoints($globalNetworkEndpointGroupsDetachEndpointsRequestResource, $networkEndpointGroup, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $globalNetworkEndpointGroupsClient->resumeOperation($operationName, 'detachNetworkEndpoints'); + * 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 { + * $globalNetworkEndpointGroupsClient->close(); + * } + * ``` + * + * @param GlobalNetworkEndpointGroupsDetachEndpointsRequest $globalNetworkEndpointGroupsDetachEndpointsRequestResource The body resource for this request + * @param string $networkEndpointGroup The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + * @param string $project Project ID 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 detachNetworkEndpoints($globalNetworkEndpointGroupsDetachEndpointsRequestResource, $networkEndpointGroup, $project, array $optionalArgs = []) + { + $request = new DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest(); + $requestParamHeaders = []; + $request->setGlobalNetworkEndpointGroupsDetachEndpointsRequestResource($globalNetworkEndpointGroupsDetachEndpointsRequestResource); + $request->setNetworkEndpointGroup($networkEndpointGroup); + $request->setProject($project); + $requestParamHeaders['network_endpoint_group'] = $networkEndpointGroup; + $requestParamHeaders['project'] = $project; + 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('DetachNetworkEndpoints', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns the specified network endpoint group. + * + * Sample code: + * ``` + * $globalNetworkEndpointGroupsClient = new GlobalNetworkEndpointGroupsClient(); + * try { + * $networkEndpointGroup = 'network_endpoint_group'; + * $project = 'project'; + * $response = $globalNetworkEndpointGroupsClient->get($networkEndpointGroup, $project); + * } finally { + * $globalNetworkEndpointGroupsClient->close(); + * } + * ``` + * + * @param string $networkEndpointGroup The name of the network endpoint group. It should comply with RFC1035. + * @param string $project Project ID 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\NetworkEndpointGroup + * + * @throws ApiException if the remote call fails + */ + public function get($networkEndpointGroup, $project, array $optionalArgs = []) + { + $request = new GetGlobalNetworkEndpointGroupRequest(); + $requestParamHeaders = []; + $request->setNetworkEndpointGroup($networkEndpointGroup); + $request->setProject($project); + $requestParamHeaders['network_endpoint_group'] = $networkEndpointGroup; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', NetworkEndpointGroup::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a network endpoint group in the specified project using the parameters that are included in the request. + * + * Sample code: + * ``` + * $globalNetworkEndpointGroupsClient = new GlobalNetworkEndpointGroupsClient(); + * try { + * $networkEndpointGroupResource = new NetworkEndpointGroup(); + * $project = 'project'; + * $operationResponse = $globalNetworkEndpointGroupsClient->insert($networkEndpointGroupResource, $project); + * $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 = $globalNetworkEndpointGroupsClient->insert($networkEndpointGroupResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $globalNetworkEndpointGroupsClient->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 { + * $globalNetworkEndpointGroupsClient->close(); + * } + * ``` + * + * @param NetworkEndpointGroup $networkEndpointGroupResource The body resource for this request + * @param string $project Project ID 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($networkEndpointGroupResource, $project, array $optionalArgs = []) + { + $request = new InsertGlobalNetworkEndpointGroupRequest(); + $requestParamHeaders = []; + $request->setNetworkEndpointGroupResource($networkEndpointGroupResource); + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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 the list of network endpoint groups that are located in the specified project. + * + * Sample code: + * ``` + * $globalNetworkEndpointGroupsClient = new GlobalNetworkEndpointGroupsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $globalNetworkEndpointGroupsClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $globalNetworkEndpointGroupsClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $globalNetworkEndpointGroupsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListGlobalNetworkEndpointGroupsRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, NetworkEndpointGroupList::class, $request); + } + + /** + * Lists the network endpoints in the specified network endpoint group. + * + * Sample code: + * ``` + * $globalNetworkEndpointGroupsClient = new GlobalNetworkEndpointGroupsClient(); + * try { + * $networkEndpointGroup = 'network_endpoint_group'; + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $globalNetworkEndpointGroupsClient->listNetworkEndpoints($networkEndpointGroup, $project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $globalNetworkEndpointGroupsClient->listNetworkEndpoints($networkEndpointGroup, $project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $globalNetworkEndpointGroupsClient->close(); + * } + * ``` + * + * @param string $networkEndpointGroup The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 listNetworkEndpoints($networkEndpointGroup, $project, array $optionalArgs = []) + { + $request = new ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest(); + $requestParamHeaders = []; + $request->setNetworkEndpointGroup($networkEndpointGroup); + $request->setProject($project); + $requestParamHeaders['network_endpoint_group'] = $networkEndpointGroup; + $requestParamHeaders['project'] = $project; + 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('ListNetworkEndpoints', $optionalArgs, NetworkEndpointGroupsListNetworkEndpoints::class, $request); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalOperationsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalOperationsGapicClient.php new file mode 100644 index 000000000000..1d90a239d454 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalOperationsGapicClient.php @@ -0,0 +1,502 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $globalOperationsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $globalOperationsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\GlobalOperationsClient}. + */ +class GlobalOperationsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.GlobalOperations'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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 static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/global_operations_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/global_operations_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/global_operations_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** + * Retrieves an aggregated list of all operations. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $globalOperationsClient = new GlobalOperationsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $globalOperationsClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $globalOperationsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $globalOperationsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListGlobalOperationsRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, OperationAggregatedList::class, $request); + } + + /** + * Deletes the specified Operations resource. + * + * Sample code: + * ``` + * $globalOperationsClient = new GlobalOperationsClient(); + * try { + * $operation = 'operation'; + * $project = 'project'; + * $response = $globalOperationsClient->delete($operation, $project); + * } finally { + * $globalOperationsClient->close(); + * } + * ``` + * + * @param string $operation Name of the Operations resource to delete. + * @param string $project Project ID 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\DeleteGlobalOperationResponse + * + * @throws ApiException if the remote call fails + */ + public function delete($operation, $project, array $optionalArgs = []) + { + $request = new DeleteGlobalOperationRequest(); + $requestParamHeaders = []; + $request->setOperation($operation); + $request->setProject($project); + $requestParamHeaders['operation'] = $operation; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Delete', DeleteGlobalOperationResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves the specified Operations resource. + * + * Sample code: + * ``` + * $globalOperationsClient = new GlobalOperationsClient(); + * try { + * $operation = 'operation'; + * $project = 'project'; + * $response = $globalOperationsClient->get($operation, $project); + * } finally { + * $globalOperationsClient->close(); + * } + * ``` + * + * @param string $operation Name of the Operations resource to return. + * @param string $project Project ID 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\Operation + * + * @throws ApiException if the remote call fails + */ + public function get($operation, $project, array $optionalArgs = []) + { + $request = new GetGlobalOperationRequest(); + $requestParamHeaders = []; + $request->setOperation($operation); + $request->setProject($project); + $requestParamHeaders['operation'] = $operation; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', Operation::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves a list of Operation resources contained within the specified project. + * + * Sample code: + * ``` + * $globalOperationsClient = new GlobalOperationsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $globalOperationsClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $globalOperationsClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $globalOperationsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListGlobalOperationsRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, OperationList::class, $request); + } + + /** + * Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + * + * Sample code: + * ``` + * $globalOperationsClient = new GlobalOperationsClient(); + * try { + * $operation = 'operation'; + * $project = 'project'; + * $response = $globalOperationsClient->wait($operation, $project); + * } finally { + * $globalOperationsClient->close(); + * } + * ``` + * + * @param string $operation Name of the Operations resource to return. + * @param string $project Project ID 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\Operation + * + * @throws ApiException if the remote call fails + */ + public function wait($operation, $project, array $optionalArgs = []) + { + $request = new WaitGlobalOperationRequest(); + $requestParamHeaders = []; + $request->setOperation($operation); + $request->setProject($project); + $requestParamHeaders['operation'] = $operation; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Wait', Operation::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalOrganizationOperationsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalOrganizationOperationsGapicClient.php new file mode 100644 index 000000000000..9465fb035cd3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalOrganizationOperationsGapicClient.php @@ -0,0 +1,351 @@ +delete($operation); + * } finally { + * $globalOrganizationOperationsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\GlobalOrganizationOperationsClient}. + */ +class GlobalOrganizationOperationsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.GlobalOrganizationOperations'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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 static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/global_organization_operations_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/global_organization_operations_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/global_organization_operations_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** + * Deletes the specified Operations resource. + * + * Sample code: + * ``` + * $globalOrganizationOperationsClient = new GlobalOrganizationOperationsClient(); + * try { + * $operation = 'operation'; + * $response = $globalOrganizationOperationsClient->delete($operation); + * } finally { + * $globalOrganizationOperationsClient->close(); + * } + * ``` + * + * @param string $operation Name of the Operations resource to delete. + * @param array $optionalArgs { + * Optional. + * + * @type string $parentId + * Parent ID for 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\Cloud\Compute\V1\DeleteGlobalOrganizationOperationResponse + * + * @throws ApiException if the remote call fails + */ + public function delete($operation, array $optionalArgs = []) + { + $request = new DeleteGlobalOrganizationOperationRequest(); + $requestParamHeaders = []; + $request->setOperation($operation); + $requestParamHeaders['operation'] = $operation; + if (isset($optionalArgs['parentId'])) { + $request->setParentId($optionalArgs['parentId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Delete', DeleteGlobalOrganizationOperationResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves the specified Operations resource. Gets a list of operations by making a `list()` request. + * + * Sample code: + * ``` + * $globalOrganizationOperationsClient = new GlobalOrganizationOperationsClient(); + * try { + * $operation = 'operation'; + * $response = $globalOrganizationOperationsClient->get($operation); + * } finally { + * $globalOrganizationOperationsClient->close(); + * } + * ``` + * + * @param string $operation Name of the Operations resource to return. + * @param array $optionalArgs { + * Optional. + * + * @type string $parentId + * Parent ID for 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\Cloud\Compute\V1\Operation + * + * @throws ApiException if the remote call fails + */ + public function get($operation, array $optionalArgs = []) + { + $request = new GetGlobalOrganizationOperationRequest(); + $requestParamHeaders = []; + $request->setOperation($operation); + $requestParamHeaders['operation'] = $operation; + if (isset($optionalArgs['parentId'])) { + $request->setParentId($optionalArgs['parentId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', Operation::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves a list of Operation resources contained within the specified organization. + * + * Sample code: + * ``` + * $globalOrganizationOperationsClient = new GlobalOrganizationOperationsClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $globalOrganizationOperationsClient->list(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $globalOrganizationOperationsClient->list(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $globalOrganizationOperationsClient->close(); + * } + * ``` + * + * @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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 string $parentId + * Parent ID for this request. + * @type bool $returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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(array $optionalArgs = []) + { + $request = new ListGlobalOrganizationOperationsRequest(); + 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['parentId'])) { + $request->setParentId($optionalArgs['parentId']); + } + + if (isset($optionalArgs['returnPartialSuccess'])) { + $request->setReturnPartialSuccess($optionalArgs['returnPartialSuccess']); + } + + return $this->getPagedListResponse('List', $optionalArgs, OperationList::class, $request); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalPublicDelegatedPrefixesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalPublicDelegatedPrefixesGapicClient.php new file mode 100644 index 000000000000..23d48e4a76f1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalPublicDelegatedPrefixesGapicClient.php @@ -0,0 +1,602 @@ +delete($project, $publicDelegatedPrefix); + * $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 = $globalPublicDelegatedPrefixesClient->delete($project, $publicDelegatedPrefix); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $globalPublicDelegatedPrefixesClient->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 { + * $globalPublicDelegatedPrefixesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\GlobalPublicDelegatedPrefixesClient}. + */ +class GlobalPublicDelegatedPrefixesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.GlobalPublicDelegatedPrefixes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/global_public_delegated_prefixes_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/global_public_delegated_prefixes_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/global_public_delegated_prefixes_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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 global PublicDelegatedPrefix. + * + * Sample code: + * ``` + * $globalPublicDelegatedPrefixesClient = new GlobalPublicDelegatedPrefixesClient(); + * try { + * $project = 'project'; + * $publicDelegatedPrefix = 'public_delegated_prefix'; + * $operationResponse = $globalPublicDelegatedPrefixesClient->delete($project, $publicDelegatedPrefix); + * $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 = $globalPublicDelegatedPrefixesClient->delete($project, $publicDelegatedPrefix); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $globalPublicDelegatedPrefixesClient->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 { + * $globalPublicDelegatedPrefixesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $publicDelegatedPrefix Name of the PublicDelegatedPrefix resource to delete. + * @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($project, $publicDelegatedPrefix, array $optionalArgs = []) + { + $request = new DeleteGlobalPublicDelegatedPrefixeRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setPublicDelegatedPrefix($publicDelegatedPrefix); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['public_delegated_prefix'] = $publicDelegatedPrefix; + 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 global PublicDelegatedPrefix resource. + * + * Sample code: + * ``` + * $globalPublicDelegatedPrefixesClient = new GlobalPublicDelegatedPrefixesClient(); + * try { + * $project = 'project'; + * $publicDelegatedPrefix = 'public_delegated_prefix'; + * $response = $globalPublicDelegatedPrefixesClient->get($project, $publicDelegatedPrefix); + * } finally { + * $globalPublicDelegatedPrefixesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $publicDelegatedPrefix Name of the PublicDelegatedPrefix resource to return. + * @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\PublicDelegatedPrefix + * + * @throws ApiException if the remote call fails + */ + public function get($project, $publicDelegatedPrefix, array $optionalArgs = []) + { + $request = new GetGlobalPublicDelegatedPrefixeRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setPublicDelegatedPrefix($publicDelegatedPrefix); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['public_delegated_prefix'] = $publicDelegatedPrefix; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', PublicDelegatedPrefix::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a global PublicDelegatedPrefix in the specified project using the parameters that are included in the request. + * + * Sample code: + * ``` + * $globalPublicDelegatedPrefixesClient = new GlobalPublicDelegatedPrefixesClient(); + * try { + * $project = 'project'; + * $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + * $operationResponse = $globalPublicDelegatedPrefixesClient->insert($project, $publicDelegatedPrefixResource); + * $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 = $globalPublicDelegatedPrefixesClient->insert($project, $publicDelegatedPrefixResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $globalPublicDelegatedPrefixesClient->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 { + * $globalPublicDelegatedPrefixesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param PublicDelegatedPrefix $publicDelegatedPrefixResource The body resource 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($project, $publicDelegatedPrefixResource, array $optionalArgs = []) + { + $request = new InsertGlobalPublicDelegatedPrefixeRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource); + $requestParamHeaders['project'] = $project; + 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(); + } + + /** + * Lists the global PublicDelegatedPrefixes for a project. + * + * Sample code: + * ``` + * $globalPublicDelegatedPrefixesClient = new GlobalPublicDelegatedPrefixesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $globalPublicDelegatedPrefixesClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $globalPublicDelegatedPrefixesClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $globalPublicDelegatedPrefixesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListGlobalPublicDelegatedPrefixesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, PublicDelegatedPrefixList::class, $request); + } + + /** + * Patches the specified global PublicDelegatedPrefix resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $globalPublicDelegatedPrefixesClient = new GlobalPublicDelegatedPrefixesClient(); + * try { + * $project = 'project'; + * $publicDelegatedPrefix = 'public_delegated_prefix'; + * $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + * $operationResponse = $globalPublicDelegatedPrefixesClient->patch($project, $publicDelegatedPrefix, $publicDelegatedPrefixResource); + * $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 = $globalPublicDelegatedPrefixesClient->patch($project, $publicDelegatedPrefix, $publicDelegatedPrefixResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $globalPublicDelegatedPrefixesClient->resumeOperation($operationName, 'patch'); + * 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 { + * $globalPublicDelegatedPrefixesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $publicDelegatedPrefix Name of the PublicDelegatedPrefix resource to patch. + * @param PublicDelegatedPrefix $publicDelegatedPrefixResource The body resource 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 patch($project, $publicDelegatedPrefix, $publicDelegatedPrefixResource, array $optionalArgs = []) + { + $request = new PatchGlobalPublicDelegatedPrefixeRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setPublicDelegatedPrefix($publicDelegatedPrefix); + $request->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['public_delegated_prefix'] = $publicDelegatedPrefix; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/HealthChecksGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/HealthChecksGapicClient.php new file mode 100644 index 000000000000..34529e45d084 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/HealthChecksGapicClient.php @@ -0,0 +1,764 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $healthChecksClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $healthChecksClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\HealthChecksClient}. + */ +class HealthChecksGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.HealthChecks'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/health_checks_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/health_checks_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/health_checks_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** + * Retrieves the list of all HealthCheck resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $healthChecksClient = new HealthChecksClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $healthChecksClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $healthChecksClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $healthChecksClient->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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListHealthChecksRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, HealthChecksAggregatedList::class, $request); + } + + /** + * Deletes the specified HealthCheck resource. + * + * Sample code: + * ``` + * $healthChecksClient = new HealthChecksClient(); + * try { + * $healthCheck = 'health_check'; + * $project = 'project'; + * $operationResponse = $healthChecksClient->delete($healthCheck, $project); + * $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 = $healthChecksClient->delete($healthCheck, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $healthChecksClient->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 { + * $healthChecksClient->close(); + * } + * ``` + * + * @param string $healthCheck Name of the HealthCheck resource to delete. + * @param string $project Project ID 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($healthCheck, $project, array $optionalArgs = []) + { + $request = new DeleteHealthCheckRequest(); + $requestParamHeaders = []; + $request->setHealthCheck($healthCheck); + $request->setProject($project); + $requestParamHeaders['health_check'] = $healthCheck; + $requestParamHeaders['project'] = $project; + 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 HealthCheck resource. + * + * Sample code: + * ``` + * $healthChecksClient = new HealthChecksClient(); + * try { + * $healthCheck = 'health_check'; + * $project = 'project'; + * $response = $healthChecksClient->get($healthCheck, $project); + * } finally { + * $healthChecksClient->close(); + * } + * ``` + * + * @param string $healthCheck Name of the HealthCheck resource to return. + * @param string $project Project ID 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\HealthCheck + * + * @throws ApiException if the remote call fails + */ + public function get($healthCheck, $project, array $optionalArgs = []) + { + $request = new GetHealthCheckRequest(); + $requestParamHeaders = []; + $request->setHealthCheck($healthCheck); + $request->setProject($project); + $requestParamHeaders['health_check'] = $healthCheck; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', HealthCheck::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a HealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $healthChecksClient = new HealthChecksClient(); + * try { + * $healthCheckResource = new HealthCheck(); + * $project = 'project'; + * $operationResponse = $healthChecksClient->insert($healthCheckResource, $project); + * $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 = $healthChecksClient->insert($healthCheckResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $healthChecksClient->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 { + * $healthChecksClient->close(); + * } + * ``` + * + * @param HealthCheck $healthCheckResource The body resource for this request + * @param string $project Project ID 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($healthCheckResource, $project, array $optionalArgs = []) + { + $request = new InsertHealthCheckRequest(); + $requestParamHeaders = []; + $request->setHealthCheckResource($healthCheckResource); + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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 the list of HealthCheck resources available to the specified project. + * + * Sample code: + * ``` + * $healthChecksClient = new HealthChecksClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $healthChecksClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $healthChecksClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $healthChecksClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListHealthChecksRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, HealthCheckList::class, $request); + } + + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $healthChecksClient = new HealthChecksClient(); + * try { + * $healthCheck = 'health_check'; + * $healthCheckResource = new HealthCheck(); + * $project = 'project'; + * $operationResponse = $healthChecksClient->patch($healthCheck, $healthCheckResource, $project); + * $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 = $healthChecksClient->patch($healthCheck, $healthCheckResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $healthChecksClient->resumeOperation($operationName, 'patch'); + * 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 { + * $healthChecksClient->close(); + * } + * ``` + * + * @param string $healthCheck Name of the HealthCheck resource to patch. + * @param HealthCheck $healthCheckResource The body resource for this request + * @param string $project Project ID 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 patch($healthCheck, $healthCheckResource, $project, array $optionalArgs = []) + { + $request = new PatchHealthCheckRequest(); + $requestParamHeaders = []; + $request->setHealthCheck($healthCheck); + $request->setHealthCheckResource($healthCheckResource); + $request->setProject($project); + $requestParamHeaders['health_check'] = $healthCheck; + $requestParamHeaders['project'] = $project; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $healthChecksClient = new HealthChecksClient(); + * try { + * $healthCheck = 'health_check'; + * $healthCheckResource = new HealthCheck(); + * $project = 'project'; + * $operationResponse = $healthChecksClient->update($healthCheck, $healthCheckResource, $project); + * $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 = $healthChecksClient->update($healthCheck, $healthCheckResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $healthChecksClient->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 { + * $healthChecksClient->close(); + * } + * ``` + * + * @param string $healthCheck Name of the HealthCheck resource to update. + * @param HealthCheck $healthCheckResource The body resource for this request + * @param string $project Project ID 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 update($healthCheck, $healthCheckResource, $project, array $optionalArgs = []) + { + $request = new UpdateHealthCheckRequest(); + $requestParamHeaders = []; + $request->setHealthCheck($healthCheck); + $request->setHealthCheckResource($healthCheckResource); + $request->setProject($project); + $requestParamHeaders['health_check'] = $healthCheck; + $requestParamHeaders['project'] = $project; + 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('Update', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/ImageFamilyViewsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/ImageFamilyViewsGapicClient.php new file mode 100644 index 000000000000..1828a72bb786 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/ImageFamilyViewsGapicClient.php @@ -0,0 +1,224 @@ +get($family, $project, $zone); + * } finally { + * $imageFamilyViewsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\ImageFamilyViewsClient}. + */ +class ImageFamilyViewsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.ImageFamilyViews'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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.readonly', + 'https://www.googleapis.com/auth/compute', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/image_family_views_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/image_family_views_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/image_family_views_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** + * Returns the latest image that is part of an image family, is not deprecated and is rolled out in the specified zone. + * + * Sample code: + * ``` + * $imageFamilyViewsClient = new ImageFamilyViewsClient(); + * try { + * $family = 'family'; + * $project = 'project'; + * $zone = 'zone'; + * $response = $imageFamilyViewsClient->get($family, $project, $zone); + * } finally { + * $imageFamilyViewsClient->close(); + * } + * ``` + * + * @param string $family Name of the image family to search for. + * @param string $project Project ID for this request. + * @param string $zone The name of the zone 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\ImageFamilyView + * + * @throws ApiException if the remote call fails + */ + public function get($family, $project, $zone, array $optionalArgs = []) + { + $request = new GetImageFamilyViewRequest(); + $requestParamHeaders = []; + $request->setFamily($family); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['family'] = $family; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', ImageFamilyView::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/ImagesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/ImagesGapicClient.php new file mode 100644 index 000000000000..fab48bb88844 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/ImagesGapicClient.php @@ -0,0 +1,948 @@ +delete($image, $project); + * $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 = $imagesClient->delete($image, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $imagesClient->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 { + * $imagesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\ImagesClient}. + */ +class ImagesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.Images'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/images_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/images_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/images_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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 image. + * + * Sample code: + * ``` + * $imagesClient = new ImagesClient(); + * try { + * $image = 'image'; + * $project = 'project'; + * $operationResponse = $imagesClient->delete($image, $project); + * $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 = $imagesClient->delete($image, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $imagesClient->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 { + * $imagesClient->close(); + * } + * ``` + * + * @param string $image Name of the image resource to delete. + * @param string $project Project ID 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($image, $project, array $optionalArgs = []) + { + $request = new DeleteImageRequest(); + $requestParamHeaders = []; + $request->setImage($image); + $request->setProject($project); + $requestParamHeaders['image'] = $image; + $requestParamHeaders['project'] = $project; + 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(); + } + + /** + * Sets the deprecation status of an image. If an empty request body is given, clears the deprecation status instead. + * + * Sample code: + * ``` + * $imagesClient = new ImagesClient(); + * try { + * $deprecationStatusResource = new DeprecationStatus(); + * $image = 'image'; + * $project = 'project'; + * $operationResponse = $imagesClient->deprecate($deprecationStatusResource, $image, $project); + * $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 = $imagesClient->deprecate($deprecationStatusResource, $image, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $imagesClient->resumeOperation($operationName, 'deprecate'); + * 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 { + * $imagesClient->close(); + * } + * ``` + * + * @param DeprecationStatus $deprecationStatusResource The body resource for this request + * @param string $image Image name. + * @param string $project Project ID 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 deprecate($deprecationStatusResource, $image, $project, array $optionalArgs = []) + { + $request = new DeprecateImageRequest(); + $requestParamHeaders = []; + $request->setDeprecationStatusResource($deprecationStatusResource); + $request->setImage($image); + $request->setProject($project); + $requestParamHeaders['image'] = $image; + $requestParamHeaders['project'] = $project; + 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('Deprecate', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns the specified image. + * + * Sample code: + * ``` + * $imagesClient = new ImagesClient(); + * try { + * $image = 'image'; + * $project = 'project'; + * $response = $imagesClient->get($image, $project); + * } finally { + * $imagesClient->close(); + * } + * ``` + * + * @param string $image Name of the image resource to return. + * @param string $project Project ID 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\Image + * + * @throws ApiException if the remote call fails + */ + public function get($image, $project, array $optionalArgs = []) + { + $request = new GetImageRequest(); + $requestParamHeaders = []; + $request->setImage($image); + $request->setProject($project); + $requestParamHeaders['image'] = $image; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', Image::class, $optionalArgs, $request)->wait(); + } + + /** + * 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: + * ``` + * $imagesClient = new ImagesClient(); + * try { + * $family = 'family'; + * $project = 'project'; + * $response = $imagesClient->getFromFamily($family, $project); + * } finally { + * $imagesClient->close(); + * } + * ``` + * + * @param string $family Name of the image family to search for. + * @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. + * + * @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\Image + * + * @throws ApiException if the remote call fails + */ + public function getFromFamily($family, $project, array $optionalArgs = []) + { + $request = new GetFromFamilyImageRequest(); + $requestParamHeaders = []; + $request->setFamily($family); + $request->setProject($project); + $requestParamHeaders['family'] = $family; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetFromFamily', Image::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $imagesClient = new ImagesClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $response = $imagesClient->getIamPolicy($project, $resource); + * } finally { + * $imagesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $resource, array $optionalArgs = []) + { + $request = new GetIamPolicyImageRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates an image in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $imagesClient = new ImagesClient(); + * try { + * $imageResource = new Image(); + * $project = 'project'; + * $operationResponse = $imagesClient->insert($imageResource, $project); + * $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 = $imagesClient->insert($imageResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $imagesClient->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 { + * $imagesClient->close(); + * } + * ``` + * + * @param Image $imageResource The body resource for this request + * @param string $project Project ID for this request. + * @param array $optionalArgs { + * Optional. + * + * @type bool $forceCreate + * Force image creation if true. + * @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($imageResource, $project, array $optionalArgs = []) + { + $request = new InsertImageRequest(); + $requestParamHeaders = []; + $request->setImageResource($imageResource); + $request->setProject($project); + $requestParamHeaders['project'] = $project; + if (isset($optionalArgs['forceCreate'])) { + $request->setForceCreate($optionalArgs['forceCreate']); + } + + 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 the list of custom images available to the specified project. Custom images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. + * + * Sample code: + * ``` + * $imagesClient = new ImagesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $imagesClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $imagesClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $imagesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListImagesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, ImageList::class, $request); + } + + /** + * Patches the specified image with the data included in the request. Only the following fields can be modified: family, description, deprecation status. + * + * Sample code: + * ``` + * $imagesClient = new ImagesClient(); + * try { + * $image = 'image'; + * $imageResource = new Image(); + * $project = 'project'; + * $operationResponse = $imagesClient->patch($image, $imageResource, $project); + * $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 = $imagesClient->patch($image, $imageResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $imagesClient->resumeOperation($operationName, 'patch'); + * 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 { + * $imagesClient->close(); + * } + * ``` + * + * @param string $image Name of the image resource to patch. + * @param Image $imageResource The body resource for this request + * @param string $project Project ID 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 patch($image, $imageResource, $project, array $optionalArgs = []) + { + $request = new PatchImageRequest(); + $requestParamHeaders = []; + $request->setImage($image); + $request->setImageResource($imageResource); + $request->setProject($project); + $requestParamHeaders['image'] = $image; + $requestParamHeaders['project'] = $project; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $imagesClient = new ImagesClient(); + * try { + * $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + * $project = 'project'; + * $resource = 'resource'; + * $response = $imagesClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + * } finally { + * $imagesClient->close(); + * } + * ``` + * + * @param GlobalSetPolicyRequest $globalSetPolicyRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($globalSetPolicyRequestResource, $project, $resource, array $optionalArgs = []) + { + $request = new SetIamPolicyImageRequest(); + $requestParamHeaders = []; + $request->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource); + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + * ``` + * $imagesClient = new ImagesClient(); + * try { + * $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + * $project = 'project'; + * $resource = 'resource'; + * $operationResponse = $imagesClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + * $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 = $imagesClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $imagesClient->resumeOperation($operationName, 'setLabels'); + * 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 { + * $imagesClient->close(); + * } + * ``` + * + * @param GlobalSetLabelsRequest $globalSetLabelsRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource 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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function setLabels($globalSetLabelsRequestResource, $project, $resource, array $optionalArgs = []) + { + $request = new SetLabelsImageRequest(); + $requestParamHeaders = []; + $request->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource); + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('SetLabels', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $imagesClient = new ImagesClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $response = $imagesClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + * } finally { + * $imagesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $resource, $testPermissionsRequestResource, array $optionalArgs = []) + { + $request = new TestIamPermissionsImageRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceGroupManagerResizeRequestsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceGroupManagerResizeRequestsGapicClient.php new file mode 100644 index 000000000000..d7307c0349a5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceGroupManagerResizeRequestsGapicClient.php @@ -0,0 +1,642 @@ +cancel($instanceGroupManager, $project, $resizeRequest, $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 = $instanceGroupManagerResizeRequestsClient->cancel($instanceGroupManager, $project, $resizeRequest, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagerResizeRequestsClient->resumeOperation($operationName, 'cancel'); + * 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 { + * $instanceGroupManagerResizeRequestsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\InstanceGroupManagerResizeRequestsClient}. + */ +class InstanceGroupManagerResizeRequestsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.InstanceGroupManagerResizeRequests'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/instance_group_manager_resize_requests_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/instance_group_manager_resize_requests_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/instance_group_manager_resize_requests_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** + * Cancels the specified resize request and removes it from the queue. Cancelled resize request does no longer wait for the resources to be provisioned. Cancel is only possible for requests that are accepted in the queue. + * + * Sample code: + * ``` + * $instanceGroupManagerResizeRequestsClient = new InstanceGroupManagerResizeRequestsClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $resizeRequest = 'resize_request'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupManagerResizeRequestsClient->cancel($instanceGroupManager, $project, $resizeRequest, $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 = $instanceGroupManagerResizeRequestsClient->cancel($instanceGroupManager, $project, $resizeRequest, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagerResizeRequestsClient->resumeOperation($operationName, 'cancel'); + * 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 { + * $instanceGroupManagerResizeRequestsClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. The name should conform to RFC1035 or be a resource ID. + * @param string $project Project ID for this request. + * @param string $resizeRequest The name of the resize request to cancel. The name should conform to RFC1035 or be a resource ID. + * @param string $zone The name of the zone where the managed instance group is located. The name should conform to RFC1035. + * @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 cancel($instanceGroupManager, $project, $resizeRequest, $zone, array $optionalArgs = []) + { + $request = new CancelInstanceGroupManagerResizeRequestRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setResizeRequest($resizeRequest); + $request->setZone($zone); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resize_request'] = $resizeRequest; + $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('Cancel', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes the specified, inactive resize request. Requests that are still active cannot be deleted. Deleting request does not delete instances that were provisioned previously. + * + * Sample code: + * ``` + * $instanceGroupManagerResizeRequestsClient = new InstanceGroupManagerResizeRequestsClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $resizeRequest = 'resize_request'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupManagerResizeRequestsClient->delete($instanceGroupManager, $project, $resizeRequest, $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 = $instanceGroupManagerResizeRequestsClient->delete($instanceGroupManager, $project, $resizeRequest, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagerResizeRequestsClient->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 { + * $instanceGroupManagerResizeRequestsClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. The name should conform to RFC1035 or be a resource ID. + * @param string $project Project ID for this request. + * @param string $resizeRequest The name of the resize request to delete. The name should conform to RFC1035 or be a resource ID. + * @param string $zone The name of the zone where the managed instance group is located. The name should conform to RFC1035. + * @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($instanceGroupManager, $project, $resizeRequest, $zone, array $optionalArgs = []) + { + $request = new DeleteInstanceGroupManagerResizeRequestRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setResizeRequest($resizeRequest); + $request->setZone($zone); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resize_request'] = $resizeRequest; + $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('Delete', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns all of the details about the specified resize request. + * + * Sample code: + * ``` + * $instanceGroupManagerResizeRequestsClient = new InstanceGroupManagerResizeRequestsClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $resizeRequest = 'resize_request'; + * $zone = 'zone'; + * $response = $instanceGroupManagerResizeRequestsClient->get($instanceGroupManager, $project, $resizeRequest, $zone); + * } finally { + * $instanceGroupManagerResizeRequestsClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. Name should conform to RFC1035 or be a resource ID. + * @param string $project Project ID for this request. + * @param string $resizeRequest The name of the resize request. Name should conform to RFC1035 or be a resource ID. + * @param string $zone Name of the href="/compute/docs/regions-zones/#available">zone scoping this request. Name should conform to RFC1035. + * @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\InstanceGroupManagerResizeRequest + * + * @throws ApiException if the remote call fails + */ + public function get($instanceGroupManager, $project, $resizeRequest, $zone, array $optionalArgs = []) + { + $request = new GetInstanceGroupManagerResizeRequestRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setResizeRequest($resizeRequest); + $request->setZone($zone); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resize_request'] = $resizeRequest; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', InstanceGroupManagerResizeRequest::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a new resize request that starts provisioning VMs immediately or queues VM creation. + * + * Sample code: + * ``` + * $instanceGroupManagerResizeRequestsClient = new InstanceGroupManagerResizeRequestsClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $instanceGroupManagerResizeRequestResource = new InstanceGroupManagerResizeRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupManagerResizeRequestsClient->insert($instanceGroupManager, $instanceGroupManagerResizeRequestResource, $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 = $instanceGroupManagerResizeRequestsClient->insert($instanceGroupManager, $instanceGroupManagerResizeRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagerResizeRequestsClient->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 { + * $instanceGroupManagerResizeRequestsClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group to which the resize request will be added. Name should conform to RFC1035 or be a resource ID. + * @param InstanceGroupManagerResizeRequest $instanceGroupManagerResizeRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located and where the resize request will be created. Name should conform to RFC1035. + * @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($instanceGroupManager, $instanceGroupManagerResizeRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new InsertInstanceGroupManagerResizeRequestRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setInstanceGroupManagerResizeRequestResource($instanceGroupManagerResizeRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('Insert', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Retrieves a list of resize requests that are contained in the managed instance group. + * + * Sample code: + * ``` + * $instanceGroupManagerResizeRequestsClient = new InstanceGroupManagerResizeRequestsClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $instanceGroupManagerResizeRequestsClient->list($instanceGroupManager, $project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $instanceGroupManagerResizeRequestsClient->list($instanceGroupManager, $project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $instanceGroupManagerResizeRequestsClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. The name should conform to RFC1035. + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. The name should conform to RFC1035. + * @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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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($instanceGroupManager, $project, $zone, array $optionalArgs = []) + { + $request = new ListInstanceGroupManagerResizeRequestsRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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, InstanceGroupManagerResizeRequestsListResponse::class, $request); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceGroupManagersGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceGroupManagersGapicClient.php new file mode 100644 index 000000000000..107df9e2937c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceGroupManagersGapicClient.php @@ -0,0 +1,1883 @@ +abandonInstances($instanceGroupManager, $instanceGroupManagersAbandonInstancesRequestResource, $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 = $instanceGroupManagersClient->abandonInstances($instanceGroupManager, $instanceGroupManagersAbandonInstancesRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagersClient->resumeOperation($operationName, 'abandonInstances'); + * 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 { + * $instanceGroupManagersClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\InstanceGroupManagersClient}. + */ +class InstanceGroupManagersGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.InstanceGroupManagers'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/instance_group_managers_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/instance_group_managers_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/instance_group_managers_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** + * Flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $instanceGroupManagersAbandonInstancesRequestResource = new InstanceGroupManagersAbandonInstancesRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupManagersClient->abandonInstances($instanceGroupManager, $instanceGroupManagersAbandonInstancesRequestResource, $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 = $instanceGroupManagersClient->abandonInstances($instanceGroupManager, $instanceGroupManagersAbandonInstancesRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagersClient->resumeOperation($operationName, 'abandonInstances'); + * 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 { + * $instanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. + * @param InstanceGroupManagersAbandonInstancesRequest $instanceGroupManagersAbandonInstancesRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. + * @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 abandonInstances($instanceGroupManager, $instanceGroupManagersAbandonInstancesRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new AbandonInstancesInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setInstanceGroupManagersAbandonInstancesRequestResource($instanceGroupManagersAbandonInstancesRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('AbandonInstances', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Retrieves the list of managed instance groups and groups them by zone. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $instanceGroupManagersClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $instanceGroupManagersClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $instanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListInstanceGroupManagersRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, InstanceGroupManagerAggregatedList::class, $request); + } + + /** + * Applies changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $instanceGroupManagersApplyUpdatesRequestResource = new InstanceGroupManagersApplyUpdatesRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupManagersClient->applyUpdatesToInstances($instanceGroupManager, $instanceGroupManagersApplyUpdatesRequestResource, $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 = $instanceGroupManagersClient->applyUpdatesToInstances($instanceGroupManager, $instanceGroupManagersApplyUpdatesRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagersClient->resumeOperation($operationName, 'applyUpdatesToInstances'); + * 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 { + * $instanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group, should conform to RFC1035. + * @param InstanceGroupManagersApplyUpdatesRequest $instanceGroupManagersApplyUpdatesRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. Should conform to RFC1035. + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function applyUpdatesToInstances($instanceGroupManager, $instanceGroupManagersApplyUpdatesRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new ApplyUpdatesToInstancesInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setInstanceGroupManagersApplyUpdatesRequestResource($instanceGroupManagersApplyUpdatesRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('ApplyUpdatesToInstances', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Creates instances with per-instance configurations in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $instanceGroupManagersCreateInstancesRequestResource = new InstanceGroupManagersCreateInstancesRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupManagersClient->createInstances($instanceGroupManager, $instanceGroupManagersCreateInstancesRequestResource, $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 = $instanceGroupManagersClient->createInstances($instanceGroupManager, $instanceGroupManagersCreateInstancesRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagersClient->resumeOperation($operationName, 'createInstances'); + * 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 { + * $instanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param InstanceGroupManagersCreateInstancesRequest $instanceGroupManagersCreateInstancesRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @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. 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 createInstances($instanceGroupManager, $instanceGroupManagersCreateInstancesRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new CreateInstancesInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setInstanceGroupManagersCreateInstancesRequestResource($instanceGroupManagersCreateInstancesRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('CreateInstances', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupManagersClient->delete($instanceGroupManager, $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 = $instanceGroupManagersClient->delete($instanceGroupManager, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagersClient->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 { + * $instanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group to delete. + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. + * @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($instanceGroupManager, $project, $zone, array $optionalArgs = []) + { + $request = new DeleteInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('Delete', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $instanceGroupManagersDeleteInstancesRequestResource = new InstanceGroupManagersDeleteInstancesRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupManagersClient->deleteInstances($instanceGroupManager, $instanceGroupManagersDeleteInstancesRequestResource, $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 = $instanceGroupManagersClient->deleteInstances($instanceGroupManager, $instanceGroupManagersDeleteInstancesRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagersClient->resumeOperation($operationName, 'deleteInstances'); + * 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 { + * $instanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. + * @param InstanceGroupManagersDeleteInstancesRequest $instanceGroupManagersDeleteInstancesRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. + * @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 deleteInstances($instanceGroupManager, $instanceGroupManagersDeleteInstancesRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new DeleteInstancesInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setInstanceGroupManagersDeleteInstancesRequestResource($instanceGroupManagersDeleteInstancesRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('DeleteInstances', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes selected per-instance configurations for the managed instance group. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $instanceGroupManagersDeletePerInstanceConfigsReqResource = new InstanceGroupManagersDeletePerInstanceConfigsReq(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupManagersClient->deletePerInstanceConfigs($instanceGroupManager, $instanceGroupManagersDeletePerInstanceConfigsReqResource, $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 = $instanceGroupManagersClient->deletePerInstanceConfigs($instanceGroupManager, $instanceGroupManagersDeletePerInstanceConfigsReqResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagersClient->resumeOperation($operationName, 'deletePerInstanceConfigs'); + * 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 { + * $instanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param InstanceGroupManagersDeletePerInstanceConfigsReq $instanceGroupManagersDeletePerInstanceConfigsReqResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deletePerInstanceConfigs($instanceGroupManager, $instanceGroupManagersDeletePerInstanceConfigsReqResource, $project, $zone, array $optionalArgs = []) + { + $request = new DeletePerInstanceConfigsInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setInstanceGroupManagersDeletePerInstanceConfigsReqResource($instanceGroupManagersDeletePerInstanceConfigsReqResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeletePerInstanceConfigs', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns all of the details about the specified managed instance group. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $zone = 'zone'; + * $response = $instanceGroupManagersClient->get($instanceGroupManager, $project, $zone); + * } finally { + * $instanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. + * @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\InstanceGroupManager + * + * @throws ApiException if the remote call fails + */ + public function get($instanceGroupManager, $project, $zone, array $optionalArgs = []) + { + $request = new GetInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', InstanceGroupManager::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $instanceGroupManagerResource = new InstanceGroupManager(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupManagersClient->insert($instanceGroupManagerResource, $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 = $instanceGroupManagersClient->insert($instanceGroupManagerResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagersClient->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 { + * $instanceGroupManagersClient->close(); + * } + * ``` + * + * @param InstanceGroupManager $instanceGroupManagerResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where you want to create the managed instance group. + * @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($instanceGroupManagerResource, $project, $zone, array $optionalArgs = []) + { + $request = new InsertInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManagerResource($instanceGroupManagerResource); + $request->setProject($project); + $request->setZone($zone); + $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('Insert', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Retrieves a list of managed instance groups that are contained within the specified project and zone. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $instanceGroupManagersClient->list($project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $instanceGroupManagersClient->list($project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $instanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. + * @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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, $zone, array $optionalArgs = []) + { + $request = new ListInstanceGroupManagersRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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, InstanceGroupManagerList::class, $request); + } + + /** + * Lists all errors thrown by actions on instances for a given managed instance group. The filter and orderBy query parameters are not supported. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $instanceGroupManagersClient->listErrors($instanceGroupManager, $project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $instanceGroupManagersClient->listErrors($instanceGroupManager, $project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $instanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}. + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 listErrors($instanceGroupManager, $project, $zone, array $optionalArgs = []) + { + $request = new ListErrorsInstanceGroupManagersRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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('ListErrors', $optionalArgs, InstanceGroupManagersListErrorsResponse::class, $request); + } + + /** + * Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action. The orderBy query parameter is not supported. The `pageToken` query parameter is supported only if the group's `listManagedInstancesResults` field is set to `PAGINATED`. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $instanceGroupManagersClient->listManagedInstances($instanceGroupManager, $project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $instanceGroupManagersClient->listManagedInstances($instanceGroupManager, $project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $instanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. + * @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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 listManagedInstances($instanceGroupManager, $project, $zone, array $optionalArgs = []) + { + $request = new ListManagedInstancesInstanceGroupManagersRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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('ListManagedInstances', $optionalArgs, InstanceGroupManagersListManagedInstancesResponse::class, $request); + } + + /** + * Lists all of the per-instance configurations defined for the managed instance group. The orderBy query parameter is not supported. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $instanceGroupManagersClient->listPerInstanceConfigs($instanceGroupManager, $project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $instanceGroupManagersClient->listPerInstanceConfigs($instanceGroupManager, $project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $instanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 listPerInstanceConfigs($instanceGroupManager, $project, $zone, array $optionalArgs = []) + { + $request = new ListPerInstanceConfigsInstanceGroupManagersRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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('ListPerInstanceConfigs', $optionalArgs, InstanceGroupManagersListPerInstanceConfigsResp::class, $request); + } + + /** + * Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. If you update your group to specify a new template or instance configuration, it's possible that your intended specification for each VM in the group is different from the current state of that VM. To learn how to apply an updated configuration to the VMs in a MIG, see Updating instances in a MIG. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $instanceGroupManagerResource = new InstanceGroupManager(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupManagersClient->patch($instanceGroupManager, $instanceGroupManagerResource, $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 = $instanceGroupManagersClient->patch($instanceGroupManager, $instanceGroupManagerResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagersClient->resumeOperation($operationName, 'patch'); + * 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 { + * $instanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the instance group manager. + * @param InstanceGroupManager $instanceGroupManagerResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where you want to create the managed instance group. + * @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 patch($instanceGroupManager, $instanceGroupManagerResource, $project, $zone, array $optionalArgs = []) + { + $request = new PatchInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setInstanceGroupManagerResource($instanceGroupManagerResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Inserts or patches per-instance configurations for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $instanceGroupManagersPatchPerInstanceConfigsReqResource = new InstanceGroupManagersPatchPerInstanceConfigsReq(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupManagersClient->patchPerInstanceConfigs($instanceGroupManager, $instanceGroupManagersPatchPerInstanceConfigsReqResource, $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 = $instanceGroupManagersClient->patchPerInstanceConfigs($instanceGroupManager, $instanceGroupManagersPatchPerInstanceConfigsReqResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagersClient->resumeOperation($operationName, 'patchPerInstanceConfigs'); + * 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 { + * $instanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param InstanceGroupManagersPatchPerInstanceConfigsReq $instanceGroupManagersPatchPerInstanceConfigsReqResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @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 patchPerInstanceConfigs($instanceGroupManager, $instanceGroupManagersPatchPerInstanceConfigsReqResource, $project, $zone, array $optionalArgs = []) + { + $request = new PatchPerInstanceConfigsInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setInstanceGroupManagersPatchPerInstanceConfigsReqResource($instanceGroupManagersPatchPerInstanceConfigsReqResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('PatchPerInstanceConfigs', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group's current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking its currentAction field; for more information, see Checking the status of managed instances. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $instanceGroupManagersRecreateInstancesRequestResource = new InstanceGroupManagersRecreateInstancesRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupManagersClient->recreateInstances($instanceGroupManager, $instanceGroupManagersRecreateInstancesRequestResource, $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 = $instanceGroupManagersClient->recreateInstances($instanceGroupManager, $instanceGroupManagersRecreateInstancesRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagersClient->resumeOperation($operationName, 'recreateInstances'); + * 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 { + * $instanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. + * @param InstanceGroupManagersRecreateInstancesRequest $instanceGroupManagersRecreateInstancesRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. + * @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 recreateInstances($instanceGroupManager, $instanceGroupManagersRecreateInstancesRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new RecreateInstancesInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setInstanceGroupManagersRecreateInstancesRequestResource($instanceGroupManagersRecreateInstancesRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('RecreateInstances', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. When resizing down, the instance group arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM attributes when making the selection including: + The status of the VM instance. + The health of the VM instance. + The instance template version the VM is based on. + For regional managed instance groups, the location of the VM instance. This list is subject to change. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $size = 0; + * $zone = 'zone'; + * $operationResponse = $instanceGroupManagersClient->resize($instanceGroupManager, $project, $size, $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 = $instanceGroupManagersClient->resize($instanceGroupManager, $project, $size, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagersClient->resumeOperation($operationName, 'resize'); + * 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 { + * $instanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. + * @param string $project Project ID for this request. + * @param int $size The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. + * @param string $zone The name of the zone where the managed instance group is located. + * @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 resize($instanceGroupManager, $project, $size, $zone, array $optionalArgs = []) + { + $request = new ResizeInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setSize($size); + $request->setZone($zone); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('Resize', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $instanceGroupManagersSetInstanceTemplateRequestResource = new InstanceGroupManagersSetInstanceTemplateRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupManagersClient->setInstanceTemplate($instanceGroupManager, $instanceGroupManagersSetInstanceTemplateRequestResource, $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 = $instanceGroupManagersClient->setInstanceTemplate($instanceGroupManager, $instanceGroupManagersSetInstanceTemplateRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagersClient->resumeOperation($operationName, 'setInstanceTemplate'); + * 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 { + * $instanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. + * @param InstanceGroupManagersSetInstanceTemplateRequest $instanceGroupManagersSetInstanceTemplateRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. + * @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 setInstanceTemplate($instanceGroupManager, $instanceGroupManagersSetInstanceTemplateRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new SetInstanceTemplateInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setInstanceGroupManagersSetInstanceTemplateRequestResource($instanceGroupManagersSetInstanceTemplateRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('SetInstanceTemplate', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $instanceGroupManagersSetTargetPoolsRequestResource = new InstanceGroupManagersSetTargetPoolsRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupManagersClient->setTargetPools($instanceGroupManager, $instanceGroupManagersSetTargetPoolsRequestResource, $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 = $instanceGroupManagersClient->setTargetPools($instanceGroupManager, $instanceGroupManagersSetTargetPoolsRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagersClient->resumeOperation($operationName, 'setTargetPools'); + * 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 { + * $instanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. + * @param InstanceGroupManagersSetTargetPoolsRequest $instanceGroupManagersSetTargetPoolsRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. + * @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 setTargetPools($instanceGroupManager, $instanceGroupManagersSetTargetPoolsRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new SetTargetPoolsInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setInstanceGroupManagersSetTargetPoolsRequestResource($instanceGroupManagersSetTargetPoolsRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('SetTargetPools', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Inserts or updates per-instance configurations for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $instanceGroupManagersUpdatePerInstanceConfigsReqResource = new InstanceGroupManagersUpdatePerInstanceConfigsReq(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupManagersClient->updatePerInstanceConfigs($instanceGroupManager, $instanceGroupManagersUpdatePerInstanceConfigsReqResource, $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 = $instanceGroupManagersClient->updatePerInstanceConfigs($instanceGroupManager, $instanceGroupManagersUpdatePerInstanceConfigsReqResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagersClient->resumeOperation($operationName, 'updatePerInstanceConfigs'); + * 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 { + * $instanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param InstanceGroupManagersUpdatePerInstanceConfigsReq $instanceGroupManagersUpdatePerInstanceConfigsReqResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @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 updatePerInstanceConfigs($instanceGroupManager, $instanceGroupManagersUpdatePerInstanceConfigsReqResource, $project, $zone, array $optionalArgs = []) + { + $request = new UpdatePerInstanceConfigsInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setInstanceGroupManagersUpdatePerInstanceConfigsReqResource($instanceGroupManagersUpdatePerInstanceConfigsReqResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('UpdatePerInstanceConfigs', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceGroupsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceGroupsGapicClient.php new file mode 100644 index 000000000000..0d2ce6ae76c5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceGroupsGapicClient.php @@ -0,0 +1,984 @@ +addInstances($instanceGroup, $instanceGroupsAddInstancesRequestResource, $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 = $instanceGroupsClient->addInstances($instanceGroup, $instanceGroupsAddInstancesRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupsClient->resumeOperation($operationName, 'addInstances'); + * 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 { + * $instanceGroupsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\InstanceGroupsClient}. + */ +class InstanceGroupsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.InstanceGroups'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/instance_groups_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/instance_groups_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/instance_groups_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** + * Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read Adding instances for more information. + * + * Sample code: + * ``` + * $instanceGroupsClient = new InstanceGroupsClient(); + * try { + * $instanceGroup = 'instance_group'; + * $instanceGroupsAddInstancesRequestResource = new InstanceGroupsAddInstancesRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupsClient->addInstances($instanceGroup, $instanceGroupsAddInstancesRequestResource, $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 = $instanceGroupsClient->addInstances($instanceGroup, $instanceGroupsAddInstancesRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupsClient->resumeOperation($operationName, 'addInstances'); + * 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 { + * $instanceGroupsClient->close(); + * } + * ``` + * + * @param string $instanceGroup The name of the instance group where you are adding instances. + * @param InstanceGroupsAddInstancesRequest $instanceGroupsAddInstancesRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the instance group is located. + * @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 addInstances($instanceGroup, $instanceGroupsAddInstancesRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new AddInstancesInstanceGroupRequest(); + $requestParamHeaders = []; + $request->setInstanceGroup($instanceGroup); + $request->setInstanceGroupsAddInstancesRequestResource($instanceGroupsAddInstancesRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group'] = $instanceGroup; + $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('AddInstances', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Retrieves the list of instance groups and sorts them by zone. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $instanceGroupsClient = new InstanceGroupsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $instanceGroupsClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $instanceGroupsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $instanceGroupsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListInstanceGroupsRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, InstanceGroupAggregatedList::class, $request); + } + + /** + * Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information. + * + * Sample code: + * ``` + * $instanceGroupsClient = new InstanceGroupsClient(); + * try { + * $instanceGroup = 'instance_group'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupsClient->delete($instanceGroup, $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 = $instanceGroupsClient->delete($instanceGroup, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupsClient->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 { + * $instanceGroupsClient->close(); + * } + * ``` + * + * @param string $instanceGroup The name of the instance group to delete. + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the instance group is located. + * @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($instanceGroup, $project, $zone, array $optionalArgs = []) + { + $request = new DeleteInstanceGroupRequest(); + $requestParamHeaders = []; + $request->setInstanceGroup($instanceGroup); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group'] = $instanceGroup; + $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('Delete', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns the specified zonal instance group. Get a list of available zonal instance groups by making a list() request. For managed instance groups, use the instanceGroupManagers or regionInstanceGroupManagers methods instead. + * + * Sample code: + * ``` + * $instanceGroupsClient = new InstanceGroupsClient(); + * try { + * $instanceGroup = 'instance_group'; + * $project = 'project'; + * $zone = 'zone'; + * $response = $instanceGroupsClient->get($instanceGroup, $project, $zone); + * } finally { + * $instanceGroupsClient->close(); + * } + * ``` + * + * @param string $instanceGroup The name of the instance group. + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the instance group is located. + * @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\InstanceGroup + * + * @throws ApiException if the remote call fails + */ + public function get($instanceGroup, $project, $zone, array $optionalArgs = []) + { + $request = new GetInstanceGroupRequest(); + $requestParamHeaders = []; + $request->setInstanceGroup($instanceGroup); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group'] = $instanceGroup; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', InstanceGroup::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates an instance group in the specified project using the parameters that are included in the request. + * + * Sample code: + * ``` + * $instanceGroupsClient = new InstanceGroupsClient(); + * try { + * $instanceGroupResource = new InstanceGroup(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupsClient->insert($instanceGroupResource, $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 = $instanceGroupsClient->insert($instanceGroupResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupsClient->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 { + * $instanceGroupsClient->close(); + * } + * ``` + * + * @param InstanceGroup $instanceGroupResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where you want to create the instance group. + * @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($instanceGroupResource, $project, $zone, array $optionalArgs = []) + { + $request = new InsertInstanceGroupRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupResource($instanceGroupResource); + $request->setProject($project); + $request->setZone($zone); + $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('Insert', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Retrieves the list of zonal instance group resources contained within the specified zone. For managed instance groups, use the instanceGroupManagers or regionInstanceGroupManagers methods instead. + * + * Sample code: + * ``` + * $instanceGroupsClient = new InstanceGroupsClient(); + * try { + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $instanceGroupsClient->list($project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $instanceGroupsClient->list($project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $instanceGroupsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the instance group is located. + * @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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, $zone, array $optionalArgs = []) + { + $request = new ListInstanceGroupsRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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, InstanceGroupList::class, $request); + } + + /** + * Lists the instances in the specified instance group. The orderBy query parameter is not supported. The filter query parameter is supported, but only for expressions that use `eq` (equal) or `ne` (not equal) operators. + * + * Sample code: + * ``` + * $instanceGroupsClient = new InstanceGroupsClient(); + * try { + * $instanceGroup = 'instance_group'; + * $instanceGroupsListInstancesRequestResource = new InstanceGroupsListInstancesRequest(); + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $instanceGroupsClient->listInstances($instanceGroup, $instanceGroupsListInstancesRequestResource, $project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $instanceGroupsClient->listInstances($instanceGroup, $instanceGroupsListInstancesRequestResource, $project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $instanceGroupsClient->close(); + * } + * ``` + * + * @param string $instanceGroup The name of the instance group from which you want to generate a list of included instances. + * @param InstanceGroupsListInstancesRequest $instanceGroupsListInstancesRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the instance group is located. + * @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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 listInstances($instanceGroup, $instanceGroupsListInstancesRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new ListInstancesInstanceGroupsRequest(); + $requestParamHeaders = []; + $request->setInstanceGroup($instanceGroup); + $request->setInstanceGroupsListInstancesRequestResource($instanceGroupsListInstancesRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group'] = $instanceGroup; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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('ListInstances', $optionalArgs, InstanceGroupsListInstances::class, $request); + } + + /** + * Removes one or more instances from the specified instance group, but does not delete those instances. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted. + * + * Sample code: + * ``` + * $instanceGroupsClient = new InstanceGroupsClient(); + * try { + * $instanceGroup = 'instance_group'; + * $instanceGroupsRemoveInstancesRequestResource = new InstanceGroupsRemoveInstancesRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupsClient->removeInstances($instanceGroup, $instanceGroupsRemoveInstancesRequestResource, $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 = $instanceGroupsClient->removeInstances($instanceGroup, $instanceGroupsRemoveInstancesRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupsClient->resumeOperation($operationName, 'removeInstances'); + * 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 { + * $instanceGroupsClient->close(); + * } + * ``` + * + * @param string $instanceGroup The name of the instance group where the specified instances will be removed. + * @param InstanceGroupsRemoveInstancesRequest $instanceGroupsRemoveInstancesRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the instance group is located. + * @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 removeInstances($instanceGroup, $instanceGroupsRemoveInstancesRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new RemoveInstancesInstanceGroupRequest(); + $requestParamHeaders = []; + $request->setInstanceGroup($instanceGroup); + $request->setInstanceGroupsRemoveInstancesRequestResource($instanceGroupsRemoveInstancesRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group'] = $instanceGroup; + $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('RemoveInstances', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the named ports for the specified instance group. + * + * Sample code: + * ``` + * $instanceGroupsClient = new InstanceGroupsClient(); + * try { + * $instanceGroup = 'instance_group'; + * $instanceGroupsSetNamedPortsRequestResource = new InstanceGroupsSetNamedPortsRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupsClient->setNamedPorts($instanceGroup, $instanceGroupsSetNamedPortsRequestResource, $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 = $instanceGroupsClient->setNamedPorts($instanceGroup, $instanceGroupsSetNamedPortsRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupsClient->resumeOperation($operationName, 'setNamedPorts'); + * 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 { + * $instanceGroupsClient->close(); + * } + * ``` + * + * @param string $instanceGroup The name of the instance group where the named ports are updated. + * @param InstanceGroupsSetNamedPortsRequest $instanceGroupsSetNamedPortsRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the instance group is located. + * @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 setNamedPorts($instanceGroup, $instanceGroupsSetNamedPortsRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new SetNamedPortsInstanceGroupRequest(); + $requestParamHeaders = []; + $request->setInstanceGroup($instanceGroup); + $request->setInstanceGroupsSetNamedPortsRequestResource($instanceGroupsSetNamedPortsRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance_group'] = $instanceGroup; + $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('SetNamedPorts', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceSettingsServiceGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceSettingsServiceGapicClient.php new file mode 100644 index 000000000000..157f523700e0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceSettingsServiceGapicClient.php @@ -0,0 +1,355 @@ +get($project, $zone); + * } finally { + * $instanceSettingsServiceClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\InstanceSettingsServiceClient}. + */ +class InstanceSettingsServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.InstanceSettingsService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/instance_settings_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/instance_settings_service_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/instance_settings_service_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** + * Get Instance settings. + * + * Sample code: + * ``` + * $instanceSettingsServiceClient = new InstanceSettingsServiceClient(); + * try { + * $project = 'project'; + * $zone = 'zone'; + * $response = $instanceSettingsServiceClient->get($project, $zone); + * } finally { + * $instanceSettingsServiceClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $zone Name of the zone 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\InstanceSettings + * + * @throws ApiException if the remote call fails + */ + public function get($project, $zone, array $optionalArgs = []) + { + $request = new GetInstanceSettingRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', InstanceSettings::class, $optionalArgs, $request)->wait(); + } + + /** + * Patch Instance settings + * + * Sample code: + * ``` + * $instanceSettingsServiceClient = new InstanceSettingsServiceClient(); + * try { + * $instanceSettingsResource = new InstanceSettings(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceSettingsServiceClient->patch($instanceSettingsResource, $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 = $instanceSettingsServiceClient->patch($instanceSettingsResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceSettingsServiceClient->resumeOperation($operationName, 'patch'); + * 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 { + * $instanceSettingsServiceClient->close(); + * } + * ``` + * + * @param InstanceSettings $instanceSettingsResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The zone scoping this request. It should conform to RFC1035. + * @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 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 patch($instanceSettingsResource, $project, $zone, array $optionalArgs = []) + { + $request = new PatchInstanceSettingRequest(); + $requestParamHeaders = []; + $request->setInstanceSettingsResource($instanceSettingsResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceTemplatesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceTemplatesGapicClient.php new file mode 100644 index 000000000000..eefceb373bc3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceTemplatesGapicClient.php @@ -0,0 +1,760 @@ +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(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\InstanceTemplatesClient}. + */ +class InstanceTemplatesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.InstanceTemplates'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/instance_templates_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/instance_templates_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/instance_templates_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** + * Retrieves the list of all InstanceTemplates resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $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. + * + * Sample code: + * ``` + * $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) + * } + * // 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) + * } + * } finally { + * $instanceTemplatesClient->close(); + * } + * ``` + * + * @param string $instanceTemplate The name of the instance template to delete. + * @param string $project Project ID 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, array $optionalArgs = []) + { + $request = new DeleteInstanceTemplateRequest(); + $requestParamHeaders = []; + $request->setInstanceTemplate($instanceTemplate); + $request->setProject($project); + $requestParamHeaders['instance_template'] = $instanceTemplate; + $requestParamHeaders['project'] = $project; + 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: + * ``` + * $instanceTemplatesClient = new InstanceTemplatesClient(); + * try { + * $instanceTemplate = 'instance_template'; + * $project = 'project'; + * $response = $instanceTemplatesClient->get($instanceTemplate, $project); + * } finally { + * $instanceTemplatesClient->close(); + * } + * ``` + * + * @param string $instanceTemplate The name of the instance template. + * @param string $project Project ID 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, array $optionalArgs = []) + { + $request = new GetInstanceTemplateRequest(); + $requestParamHeaders = []; + $request->setInstanceTemplate($instanceTemplate); + $request->setProject($project); + $requestParamHeaders['instance_template'] = $instanceTemplate; + $requestParamHeaders['project'] = $project; + $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(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $instanceTemplatesClient = new InstanceTemplatesClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $response = $instanceTemplatesClient->getIamPolicy($project, $resource); + * } finally { + * $instanceTemplatesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $resource, array $optionalArgs = []) + { + $request = new GetIamPolicyInstanceTemplateRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template. + * + * Sample code: + * ``` + * $instanceTemplatesClient = new InstanceTemplatesClient(); + * try { + * $instanceTemplateResource = new InstanceTemplate(); + * $project = 'project'; + * $operationResponse = $instanceTemplatesClient->insert($instanceTemplateResource, $project); + * $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 = $instanceTemplatesClient->insert($instanceTemplateResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceTemplatesClient->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 { + * $instanceTemplatesClient->close(); + * } + * ``` + * + * @param InstanceTemplate $instanceTemplateResource The body resource for this request + * @param string $project Project ID 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, array $optionalArgs = []) + { + $request = new InsertInstanceTemplateRequest(); + $requestParamHeaders = []; + $request->setInstanceTemplateResource($instanceTemplateResource); + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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. + * + * Sample code: + * ``` + * $instanceTemplatesClient = new InstanceTemplatesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $instanceTemplatesClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $instanceTemplatesClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $instanceTemplatesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListInstanceTemplatesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $instanceTemplatesClient = new InstanceTemplatesClient(); + * try { + * $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + * $project = 'project'; + * $resource = 'resource'; + * $response = $instanceTemplatesClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + * } finally { + * $instanceTemplatesClient->close(); + * } + * ``` + * + * @param GlobalSetPolicyRequest $globalSetPolicyRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($globalSetPolicyRequestResource, $project, $resource, array $optionalArgs = []) + { + $request = new SetIamPolicyInstanceTemplateRequest(); + $requestParamHeaders = []; + $request->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource); + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $instanceTemplatesClient = new InstanceTemplatesClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $response = $instanceTemplatesClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + * } finally { + * $instanceTemplatesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $resource, $testPermissionsRequestResource, array $optionalArgs = []) + { + $request = new TestIamPermissionsInstanceTemplateRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/InstancesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/InstancesGapicClient.php new file mode 100644 index 000000000000..62b218e2e113 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/InstancesGapicClient.php @@ -0,0 +1,3922 @@ +addAccessConfig($accessConfigResource, $instance, $networkInterface, $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->addAccessConfig($accessConfigResource, $instance, $networkInterface, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'addAccessConfig'); + * 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(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\InstancesClient}. + */ +class InstancesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.Instances'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/instances_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/instances_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/instances_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** + * Adds an access config to an instance's network interface. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $accessConfigResource = new AccessConfig(); + * $instance = 'instance'; + * $networkInterface = 'network_interface'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->addAccessConfig($accessConfigResource, $instance, $networkInterface, $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->addAccessConfig($accessConfigResource, $instance, $networkInterface, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'addAccessConfig'); + * 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 AccessConfig $accessConfigResource The body resource for this request + * @param string $instance The instance name for this request. + * @param string $networkInterface The name of the network interface to add to this instance. + * @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 addAccessConfig($accessConfigResource, $instance, $networkInterface, $project, $zone, array $optionalArgs = []) + { + $request = new AddAccessConfigInstanceRequest(); + $requestParamHeaders = []; + $request->setAccessConfigResource($accessConfigResource); + $request->setInstance($instance); + $request->setNetworkInterface($networkInterface); + $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('AddAccessConfig', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $instancesAddResourcePoliciesRequestResource = new InstancesAddResourcePoliciesRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->addResourcePolicies($instance, $instancesAddResourcePoliciesRequestResource, $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->addResourcePolicies($instance, $instancesAddResourcePoliciesRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'addResourcePolicies'); + * 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 InstancesAddResourcePoliciesRequest $instancesAddResourcePoliciesRequestResource 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 addResourcePolicies($instance, $instancesAddResourcePoliciesRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new AddResourcePoliciesInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setInstancesAddResourcePoliciesRequestResource($instancesAddResourcePoliciesRequestResource); + $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('AddResourcePolicies', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Retrieves an aggregated list of all of the instances in your project across all regions and zones. The performance of this method degrades when a filter is specified on a project that has a very large number of instances. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $instancesClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $instancesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $instancesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListInstancesRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, InstanceAggregatedList::class, $request); + } + + /** + * Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $attachedDiskResource = new AttachedDisk(); + * $instance = 'instance'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->attachDisk($attachedDiskResource, $instance, $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->attachDisk($attachedDiskResource, $instance, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'attachDisk'); + * 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 AttachedDisk $attachedDiskResource The body resource for this request + * @param string $instance The instance name 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 bool $forceAttach + * Whether to force attach the regional disk even if it's currently attached to another instance. If you try to force attach a zonal disk to an instance, you will receive an error. + * @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 attachDisk($attachedDiskResource, $instance, $project, $zone, array $optionalArgs = []) + { + $request = new AttachDiskInstanceRequest(); + $requestParamHeaders = []; + $request->setAttachedDiskResource($attachedDiskResource); + $request->setInstance($instance); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance'] = $instance; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + if (isset($optionalArgs['forceAttach'])) { + $request->setForceAttach($optionalArgs['forceAttach']); + } + + 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('AttachDisk', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Creates multiple instances. Count specifies the number of instances to create. For more information, see About bulk creation of VMs. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $bulkInsertInstanceResourceResource = new BulkInsertInstanceResource(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->bulkInsert($bulkInsertInstanceResourceResource, $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->bulkInsert($bulkInsertInstanceResourceResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'bulkInsert'); + * 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 BulkInsertInstanceResource $bulkInsertInstanceResourceResource 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 bulkInsert($bulkInsertInstanceResourceResource, $project, $zone, array $optionalArgs = []) + { + $request = new BulkInsertInstanceRequest(); + $requestParamHeaders = []; + $request->setBulkInsertInstanceResourceResource($bulkInsertInstanceResourceResource); + $request->setProject($project); + $request->setZone($zone); + $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('BulkInsert', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes the specified Instance resource. For more information, see Deleting an instance. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->delete($instance, $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->delete($instance, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->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 { + * $instancesClient->close(); + * } + * ``` + * + * @param string $instance Name of the instance resource to delete. + * @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 delete($instance, $project, $zone, array $optionalArgs = []) + { + $request = new DeleteInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $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('Delete', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes an access config from an instance's network interface. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $accessConfig = 'access_config'; + * $instance = 'instance'; + * $networkInterface = 'network_interface'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->deleteAccessConfig($accessConfig, $instance, $networkInterface, $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->deleteAccessConfig($accessConfig, $instance, $networkInterface, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'deleteAccessConfig'); + * 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 $accessConfig The name of the access config to delete. + * @param string $instance The instance name for this request. + * @param string $networkInterface The name of the network interface. + * @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 deleteAccessConfig($accessConfig, $instance, $networkInterface, $project, $zone, array $optionalArgs = []) + { + $request = new DeleteAccessConfigInstanceRequest(); + $requestParamHeaders = []; + $request->setAccessConfig($accessConfig); + $request->setInstance($instance); + $request->setNetworkInterface($networkInterface); + $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('DeleteAccessConfig', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Detaches a disk from an instance. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $deviceName = 'device_name'; + * $instance = 'instance'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->detachDisk($deviceName, $instance, $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->detachDisk($deviceName, $instance, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'detachDisk'); + * 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 $deviceName The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names. + * @param string $instance Instance name 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 detachDisk($deviceName, $instance, $project, $zone, array $optionalArgs = []) + { + $request = new DetachDiskInstanceRequest(); + $requestParamHeaders = []; + $request->setDeviceName($deviceName); + $request->setInstance($instance); + $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('DetachDisk', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns the specified Instance resource. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $project = 'project'; + * $zone = 'zone'; + * $response = $instancesClient->get($instance, $project, $zone); + * } finally { + * $instancesClient->close(); + * } + * ``` + * + * @param string $instance Name of the instance resource to return. + * @param string $project Project ID for this request. + * @param string $zone The name of the zone 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\Instance + * + * @throws ApiException if the remote call fails + */ + public function get($instance, $project, $zone, array $optionalArgs = []) + { + $request = new GetInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance'] = $instance; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', Instance::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns effective firewalls applied to an interface of the instance. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $networkInterface = 'network_interface'; + * $project = 'project'; + * $zone = 'zone'; + * $response = $instancesClient->getEffectiveFirewalls($instance, $networkInterface, $project, $zone); + * } finally { + * $instancesClient->close(); + * } + * ``` + * + * @param string $instance Name of the instance scoping this request. + * @param string $networkInterface The name of the network interface to get the effective firewalls. + * @param string $project Project ID for this request. + * @param string $zone The name of the zone 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\InstancesGetEffectiveFirewallsResponse + * + * @throws ApiException if the remote call fails + */ + public function getEffectiveFirewalls($instance, $networkInterface, $project, $zone, array $optionalArgs = []) + { + $request = new GetEffectiveFirewallsInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setNetworkInterface($networkInterface); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance'] = $instance; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetEffectiveFirewalls', InstancesGetEffectiveFirewallsResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the specified guest attributes entry. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $project = 'project'; + * $zone = 'zone'; + * $response = $instancesClient->getGuestAttributes($instance, $project, $zone); + * } finally { + * $instancesClient->close(); + * } + * ``` + * + * @param string $instance Name of the instance scoping 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 $queryPath + * Specifies the guest attributes path to be queried. + * @type string $variableKey + * Specifies the key for the guest attributes entry. + * @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\GuestAttributes + * + * @throws ApiException if the remote call fails + */ + public function getGuestAttributes($instance, $project, $zone, array $optionalArgs = []) + { + $request = new GetGuestAttributesInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance'] = $instance; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + if (isset($optionalArgs['queryPath'])) { + $request->setQueryPath($optionalArgs['queryPath']); + } + + if (isset($optionalArgs['variableKey'])) { + $request->setVariableKey($optionalArgs['variableKey']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetGuestAttributes', GuestAttributes::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $zone = 'zone'; + * $response = $instancesClient->getIamPolicy($project, $resource, $zone); + * } finally { + * $instancesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param string $zone The name of the zone for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $resource, $zone, array $optionalArgs = []) + { + $request = new GetIamPolicyInstanceRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParamHeaders['zone'] = $zone; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the screenshot from the specified instance. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $project = 'project'; + * $zone = 'zone'; + * $response = $instancesClient->getScreenshot($instance, $project, $zone); + * } finally { + * $instancesClient->close(); + * } + * ``` + * + * @param string $instance Name of the instance scoping 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 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\Screenshot + * + * @throws ApiException if the remote call fails + */ + public function getScreenshot($instance, $project, $zone, array $optionalArgs = []) + { + $request = new GetScreenshotInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance'] = $instance; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetScreenshot', Screenshot::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the last 1 MB of serial port output from the specified instance. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $project = 'project'; + * $zone = 'zone'; + * $response = $instancesClient->getSerialPortOutput($instance, $project, $zone); + * } finally { + * $instancesClient->close(); + * } + * ``` + * + * @param string $instance Name of the instance 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 int $port + * Specifies which COM or serial port to retrieve data from. + * @type int $start + * Specifies the starting byte position of the output to return. To start with the first byte of output to the specified port, omit this field or set it to `0`. If the output for that byte position is available, this field matches the `start` parameter sent with the request. If the amount of serial console output exceeds the size of the buffer (1 MB), the oldest output is discarded and is no longer available. If the requested start position refers to discarded output, the start position is adjusted to the oldest output still available, and the adjusted start position is returned as the `start` property value. You can also provide a negative start position, which translates to the most recent number of bytes written to the serial port. For example, -3 is interpreted as the most recent 3 bytes written to the serial console. + * @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\SerialPortOutput + * + * @throws ApiException if the remote call fails + */ + public function getSerialPortOutput($instance, $project, $zone, array $optionalArgs = []) + { + $request = new GetSerialPortOutputInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance'] = $instance; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + if (isset($optionalArgs['port'])) { + $request->setPort($optionalArgs['port']); + } + + if (isset($optionalArgs['start'])) { + $request->setStart($optionalArgs['start']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetSerialPortOutput', SerialPortOutput::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the Shielded Instance Identity of an instance + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $project = 'project'; + * $zone = 'zone'; + * $response = $instancesClient->getShieldedInstanceIdentity($instance, $project, $zone); + * } finally { + * $instancesClient->close(); + * } + * ``` + * + * @param string $instance Name or id of the instance scoping 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 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\ShieldedInstanceIdentity + * + * @throws ApiException if the remote call fails + */ + public function getShieldedInstanceIdentity($instance, $project, $zone, array $optionalArgs = []) + { + $request = new GetShieldedInstanceIdentityInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance'] = $instance; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetShieldedInstanceIdentity', ShieldedInstanceIdentity::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates an instance resource in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instanceResource = new Instance(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->insert($instanceResource, $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->insert($instanceResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->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 { + * $instancesClient->close(); + * } + * ``` + * + * @param Instance $instanceResource 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 string $sourceInstanceTemplate + * Specifies instance template to create the instance. This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project /global/instanceTemplates/instanceTemplate - projects/project/global/instanceTemplates/instanceTemplate - global/instanceTemplates/instanceTemplate + * @type string $sourceMachineImage + * Specifies the machine image to use to create the instance. This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to a machine image: - https://www.googleapis.com/compute/v1/projects/project/global/global /machineImages/machineImage - projects/project/global/global/machineImages/machineImage - global/machineImages/machineImage + * @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($instanceResource, $project, $zone, array $optionalArgs = []) + { + $request = new InsertInstanceRequest(); + $requestParamHeaders = []; + $request->setInstanceResource($instanceResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['sourceInstanceTemplate'])) { + $request->setSourceInstanceTemplate($optionalArgs['sourceInstanceTemplate']); + } + + if (isset($optionalArgs['sourceMachineImage'])) { + $request->setSourceMachineImage($optionalArgs['sourceMachineImage']); + } + + $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 the list of instances contained within the specified zone. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $instancesClient->list($project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $instancesClient->list($project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $instancesClient->close(); + * } + * ``` + * + * @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 $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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, $zone, array $optionalArgs = []) + { + $request = new ListInstancesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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, InstanceList::class, $request); + } + + /** + * Retrieves a list of resources that refer to the VM instance specified in the request. For example, if the VM instance is part of a managed or unmanaged instance group, the referrers list includes the instance group. For more information, read Viewing referrers to VM instances. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $instancesClient->listReferrers($instance, $project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $instancesClient->listReferrers($instance, $project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $instancesClient->close(); + * } + * ``` + * + * @param string $instance Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. + * @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 $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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 listReferrers($instance, $project, $zone, array $optionalArgs = []) + { + $request = new ListReferrersInstancesRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance'] = $instance; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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('ListReferrers', $optionalArgs, InstanceListReferrers::class, $request); + } + + /** + * Perform a manual maintenance on the instance. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->performMaintenance($instance, $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->performMaintenance($instance, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'performMaintenance'); + * 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 Name of the instance scoping 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 performMaintenance($instance, $project, $zone, array $optionalArgs = []) + { + $request = new PerformMaintenanceInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $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('PerformMaintenance', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Removes resource policies from an instance. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $instancesRemoveResourcePoliciesRequestResource = new InstancesRemoveResourcePoliciesRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->removeResourcePolicies($instance, $instancesRemoveResourcePoliciesRequestResource, $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->removeResourcePolicies($instance, $instancesRemoveResourcePoliciesRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'removeResourcePolicies'); + * 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 InstancesRemoveResourcePoliciesRequest $instancesRemoveResourcePoliciesRequestResource 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 removeResourcePolicies($instance, $instancesRemoveResourcePoliciesRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new RemoveResourcePoliciesInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setInstancesRemoveResourcePoliciesRequestResource($instancesRemoveResourcePoliciesRequestResource); + $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('RemoveResourcePolicies', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Performs a reset on the instance. This is a hard reset. The VM does not do a graceful shutdown. For more information, see Resetting an instance. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->reset($instance, $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->reset($instance, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'reset'); + * 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 Name of the instance scoping 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 reset($instance, $project, $zone, array $optionalArgs = []) + { + $request = new ResetInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $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('Reset', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Resumes an instance that was suspended using the instances().suspend method. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->resume($instance, $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->resume($instance, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'resume'); + * 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 Name of the instance resource to resume. + * @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 resume($instance, $project, $zone, array $optionalArgs = []) + { + $request = new ResumeInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $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('Resume', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sends diagnostic interrupt to the instance. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $project = 'project'; + * $zone = 'zone'; + * $response = $instancesClient->sendDiagnosticInterrupt($instance, $project, $zone); + * } finally { + * $instancesClient->close(); + * } + * ``` + * + * @param string $instance Name of the instance scoping 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 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\SendDiagnosticInterruptInstanceResponse + * + * @throws ApiException if the remote call fails + */ + public function sendDiagnosticInterrupt($instance, $project, $zone, array $optionalArgs = []) + { + $request = new SendDiagnosticInterruptInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance'] = $instance; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SendDiagnosticInterrupt', SendDiagnosticInterruptInstanceResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Sets deletion protection on the instance. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->setDeletionProtection($project, $resource, $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->setDeletionProtection($project, $resource, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'setDeletionProtection'); + * 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 $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param string $zone The name of the zone for this request. + * @param array $optionalArgs { + * Optional. + * + * @type bool $deletionProtection + * Whether the resource should be protected against deletion. + * @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 setDeletionProtection($project, $resource, $zone, array $optionalArgs = []) + { + $request = new SetDeletionProtectionInstanceRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParamHeaders['zone'] = $zone; + if (isset($optionalArgs['deletionProtection'])) { + $request->setDeletionProtection($optionalArgs['deletionProtection']); + } + + 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('SetDeletionProtection', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the auto-delete flag for a disk attached to an instance. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $autoDelete = false; + * $deviceName = 'device_name'; + * $instance = 'instance'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->setDiskAutoDelete($autoDelete, $deviceName, $instance, $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->setDiskAutoDelete($autoDelete, $deviceName, $instance, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'setDiskAutoDelete'); + * 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 bool $autoDelete Whether to auto-delete the disk when the instance is deleted. + * @param string $deviceName The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names. + * @param string $instance The instance name 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 setDiskAutoDelete($autoDelete, $deviceName, $instance, $project, $zone, array $optionalArgs = []) + { + $request = new SetDiskAutoDeleteInstanceRequest(); + $requestParamHeaders = []; + $request->setAutoDelete($autoDelete); + $request->setDeviceName($deviceName); + $request->setInstance($instance); + $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('SetDiskAutoDelete', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $zone = 'zone'; + * $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + * $response = $instancesClient->setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource); + * } finally { + * $instancesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param string $zone The name of the zone for this request. + * @param ZoneSetPolicyRequest $zoneSetPolicyRequestResource The body resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource, array $optionalArgs = []) + { + $request = new SetIamPolicyInstanceRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setZone($zone); + $request->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $instancesSetLabelsRequestResource = new InstancesSetLabelsRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->setLabels($instance, $instancesSetLabelsRequestResource, $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->setLabels($instance, $instancesSetLabelsRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'setLabels'); + * 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 Name of the instance scoping this request. + * @param InstancesSetLabelsRequest $instancesSetLabelsRequestResource 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 setLabels($instance, $instancesSetLabelsRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new SetLabelsInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setInstancesSetLabelsRequestResource($instancesSetLabelsRequestResource); + $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('SetLabels', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $instancesSetMachineResourcesRequestResource = new InstancesSetMachineResourcesRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->setMachineResources($instance, $instancesSetMachineResourcesRequestResource, $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->setMachineResources($instance, $instancesSetMachineResourcesRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'setMachineResources'); + * 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 Name of the instance scoping this request. + * @param InstancesSetMachineResourcesRequest $instancesSetMachineResourcesRequestResource 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 setMachineResources($instance, $instancesSetMachineResourcesRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new SetMachineResourcesInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setInstancesSetMachineResourcesRequestResource($instancesSetMachineResourcesRequestResource); + $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('SetMachineResources', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Changes the machine type for a stopped instance to the machine type specified in the request. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $instancesSetMachineTypeRequestResource = new InstancesSetMachineTypeRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->setMachineType($instance, $instancesSetMachineTypeRequestResource, $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->setMachineType($instance, $instancesSetMachineTypeRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'setMachineType'); + * 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 Name of the instance scoping this request. + * @param InstancesSetMachineTypeRequest $instancesSetMachineTypeRequestResource 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 setMachineType($instance, $instancesSetMachineTypeRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new SetMachineTypeInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setInstancesSetMachineTypeRequestResource($instancesSetMachineTypeRequestResource); + $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('SetMachineType', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets metadata for the specified instance to the data included in the request. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $metadataResource = new Metadata(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->setMetadata($instance, $metadataResource, $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->setMetadata($instance, $metadataResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'setMetadata'); + * 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 Name of the instance scoping this request. + * @param Metadata $metadataResource 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 setMetadata($instance, $metadataResource, $project, $zone, array $optionalArgs = []) + { + $request = new SetMetadataInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setMetadataResource($metadataResource); + $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('SetMetadata', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $instancesSetMinCpuPlatformRequestResource = new InstancesSetMinCpuPlatformRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->setMinCpuPlatform($instance, $instancesSetMinCpuPlatformRequestResource, $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->setMinCpuPlatform($instance, $instancesSetMinCpuPlatformRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'setMinCpuPlatform'); + * 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 Name of the instance scoping this request. + * @param InstancesSetMinCpuPlatformRequest $instancesSetMinCpuPlatformRequestResource 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 setMinCpuPlatform($instance, $instancesSetMinCpuPlatformRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new SetMinCpuPlatformInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setInstancesSetMinCpuPlatformRequestResource($instancesSetMinCpuPlatformRequestResource); + $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('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. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $project = 'project'; + * $schedulingResource = new Scheduling(); + * $zone = 'zone'; + * $operationResponse = $instancesClient->setScheduling($instance, $project, $schedulingResource, $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->setScheduling($instance, $project, $schedulingResource, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'setScheduling'); + * 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 Instance name for this request. + * @param string $project Project ID for this request. + * @param Scheduling $schedulingResource The body resource 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 setScheduling($instance, $project, $schedulingResource, $zone, array $optionalArgs = []) + { + $request = new SetSchedulingInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setProject($project); + $request->setSchedulingResource($schedulingResource); + $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('SetScheduling', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the Google Cloud Armor security policy for the specified instance. For more information, see Google Cloud Armor Overview + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $instancesSetSecurityPolicyRequestResource = new InstancesSetSecurityPolicyRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->setSecurityPolicy($instance, $instancesSetSecurityPolicyRequestResource, $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->setSecurityPolicy($instance, $instancesSetSecurityPolicyRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'setSecurityPolicy'); + * 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 Name of the Instance resource to which the security policy should be set. The name should conform to RFC1035. + * @param InstancesSetSecurityPolicyRequest $instancesSetSecurityPolicyRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone Name of the zone scoping 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 setSecurityPolicy($instance, $instancesSetSecurityPolicyRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new SetSecurityPolicyInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setInstancesSetSecurityPolicyRequestResource($instancesSetSecurityPolicyRequestResource); + $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('SetSecurityPolicy', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $instancesSetServiceAccountRequestResource = new InstancesSetServiceAccountRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->setServiceAccount($instance, $instancesSetServiceAccountRequestResource, $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->setServiceAccount($instance, $instancesSetServiceAccountRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'setServiceAccount'); + * 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 Name of the instance resource to start. + * @param InstancesSetServiceAccountRequest $instancesSetServiceAccountRequestResource 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 setServiceAccount($instance, $instancesSetServiceAccountRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new SetServiceAccountInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setInstancesSetServiceAccountRequestResource($instancesSetServiceAccountRequestResource); + $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('SetServiceAccount', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $project = 'project'; + * $shieldedInstanceIntegrityPolicyResource = new ShieldedInstanceIntegrityPolicy(); + * $zone = 'zone'; + * $operationResponse = $instancesClient->setShieldedInstanceIntegrityPolicy($instance, $project, $shieldedInstanceIntegrityPolicyResource, $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->setShieldedInstanceIntegrityPolicy($instance, $project, $shieldedInstanceIntegrityPolicyResource, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'setShieldedInstanceIntegrityPolicy'); + * 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 Name or id of the instance scoping this request. + * @param string $project Project ID for this request. + * @param ShieldedInstanceIntegrityPolicy $shieldedInstanceIntegrityPolicyResource The body resource 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 setShieldedInstanceIntegrityPolicy($instance, $project, $shieldedInstanceIntegrityPolicyResource, $zone, array $optionalArgs = []) + { + $request = new SetShieldedInstanceIntegrityPolicyInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setProject($project); + $request->setShieldedInstanceIntegrityPolicyResource($shieldedInstanceIntegrityPolicyResource); + $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('SetShieldedInstanceIntegrityPolicy', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets network tags for the specified instance to the data included in the request. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $project = 'project'; + * $tagsResource = new Tags(); + * $zone = 'zone'; + * $operationResponse = $instancesClient->setTags($instance, $project, $tagsResource, $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->setTags($instance, $project, $tagsResource, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'setTags'); + * 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 Name of the instance scoping this request. + * @param string $project Project ID for this request. + * @param Tags $tagsResource The body resource 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 setTags($instance, $project, $tagsResource, $zone, array $optionalArgs = []) + { + $request = new SetTagsInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setProject($project); + $request->setTagsResource($tagsResource); + $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('SetTags', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Simulates a host maintenance event on a VM. For more information, see Simulate a host maintenance event. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->simulateMaintenanceEvent($instance, $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->simulateMaintenanceEvent($instance, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'simulateMaintenanceEvent'); + * 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 Name of the instance scoping 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 bool $withExtendedNotifications + * Determines whether the customers receive notifications before migration. Only applicable to SF vms. + * @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 simulateMaintenanceEvent($instance, $project, $zone, array $optionalArgs = []) + { + $request = new SimulateMaintenanceEventInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance'] = $instance; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['withExtendedNotifications'])) { + $request->setWithExtendedNotifications($optionalArgs['withExtendedNotifications']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('SimulateMaintenanceEvent', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->start($instance, $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->start($instance, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'start'); + * 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 Name of the instance resource to start. + * @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 start($instance, $project, $zone, array $optionalArgs = []) + { + $request = new StartInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $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('Start', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $instancesStartWithEncryptionKeyRequestResource = new InstancesStartWithEncryptionKeyRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->startWithEncryptionKey($instance, $instancesStartWithEncryptionKeyRequestResource, $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->startWithEncryptionKey($instance, $instancesStartWithEncryptionKeyRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'startWithEncryptionKey'); + * 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 Name of the instance resource to start. + * @param InstancesStartWithEncryptionKeyRequest $instancesStartWithEncryptionKeyRequestResource 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 startWithEncryptionKey($instance, $instancesStartWithEncryptionKeyRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new StartWithEncryptionKeyInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setInstancesStartWithEncryptionKeyRequestResource($instancesStartWithEncryptionKeyRequestResource); + $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('StartWithEncryptionKey', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->stop($instance, $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->stop($instance, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'stop'); + * 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 Name of the instance resource to stop. + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param array $optionalArgs { + * Optional. + * + * @type bool $discardLocalSsd + * This property is required if the instance has any attached Local SSD disks. If false, Local SSD data will be preserved when the instance is suspended. If true, the contents of any attached Local SSD disks will be discarded. + * @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 stop($instance, $project, $zone, array $optionalArgs = []) + { + $request = new StopInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance'] = $instance; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + if (isset($optionalArgs['discardLocalSsd'])) { + $request->setDiscardLocalSsd($optionalArgs['discardLocalSsd']); + } + + 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('Stop', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * This method suspends a running instance, saving its state to persistent storage, and allows you to resume the instance at a later time. Suspended instances have no compute costs (cores or RAM), and incur only storage charges for the saved VM memory and localSSD data. Any charged resources the virtual machine was using, such as persistent disks and static IP addresses, will continue to be charged while the instance is suspended. For more information, see Suspending and resuming an instance. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->suspend($instance, $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->suspend($instance, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'suspend'); + * 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 Name of the instance resource to suspend. + * @param string $project Project ID for this request. + * @param string $zone The name of the zone for this request. + * @param array $optionalArgs { + * Optional. + * + * @type bool $discardLocalSsd + * This property is required if the instance has any attached Local SSD disks. If false, Local SSD data will be preserved when the instance is suspended. If true, the contents of any attached Local SSD disks will be discarded. + * @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 suspend($instance, $project, $zone, array $optionalArgs = []) + { + $request = new SuspendInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance'] = $instance; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + if (isset($optionalArgs['discardLocalSsd'])) { + $request->setDiscardLocalSsd($optionalArgs['discardLocalSsd']); + } + + 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('Suspend', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $zone = 'zone'; + * $response = $instancesClient->testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone); + * } finally { + * $instancesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * @param string $zone The name of the zone 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone, array $optionalArgs = []) + { + $request = new TestIamPermissionsInstanceRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $instanceResource = new Instance(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->update($instance, $instanceResource, $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->update($instance, $instanceResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->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 { + * $instancesClient->close(); + * } + * ``` + * + * @param string $instance Name of the instance resource to update. + * @param Instance $instanceResource 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 $minimalAction + * Specifies the action to take when updating an instance even if the updated properties do not require it. If not specified, then Compute Engine acts based on the minimum action that the updated properties require. + * Check the MinimalAction enum for the list of possible values. + * @type string $mostDisruptiveAllowedAction + * Specifies the most disruptive action that can be taken on the instance as part of the update. Compute Engine returns an error if the instance properties require a more disruptive action as part of the instance update. Valid options from lowest to highest are NO_EFFECT, REFRESH, and RESTART. + * Check the MostDisruptiveAllowedAction enum for the list of possible values. + * @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 update($instance, $instanceResource, $project, $zone, array $optionalArgs = []) + { + $request = new UpdateInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setInstanceResource($instanceResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instance'] = $instance; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + if (isset($optionalArgs['minimalAction'])) { + $request->setMinimalAction($optionalArgs['minimalAction']); + } + + if (isset($optionalArgs['mostDisruptiveAllowedAction'])) { + $request->setMostDisruptiveAllowedAction($optionalArgs['mostDisruptiveAllowedAction']); + } + + 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('Update', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $accessConfigResource = new AccessConfig(); + * $instance = 'instance'; + * $networkInterface = 'network_interface'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->updateAccessConfig($accessConfigResource, $instance, $networkInterface, $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->updateAccessConfig($accessConfigResource, $instance, $networkInterface, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'updateAccessConfig'); + * 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 AccessConfig $accessConfigResource The body resource for this request + * @param string $instance The instance name for this request. + * @param string $networkInterface The name of the network interface where the access config is attached. + * @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 updateAccessConfig($accessConfigResource, $instance, $networkInterface, $project, $zone, array $optionalArgs = []) + { + $request = new UpdateAccessConfigInstanceRequest(); + $requestParamHeaders = []; + $request->setAccessConfigResource($accessConfigResource); + $request->setInstance($instance); + $request->setNetworkInterface($networkInterface); + $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('UpdateAccessConfig', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $displayDeviceResource = new DisplayDevice(); + * $instance = 'instance'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->updateDisplayDevice($displayDeviceResource, $instance, $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->updateDisplayDevice($displayDeviceResource, $instance, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'updateDisplayDevice'); + * 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 DisplayDevice $displayDeviceResource The body resource for this request + * @param string $instance Name of the instance scoping 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 updateDisplayDevice($displayDeviceResource, $instance, $project, $zone, array $optionalArgs = []) + { + $request = new UpdateDisplayDeviceInstanceRequest(); + $requestParamHeaders = []; + $request->setDisplayDeviceResource($displayDeviceResource); + $request->setInstance($instance); + $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('UpdateDisplayDevice', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Updates an instance's network interface. This method can only update an interface's alias IP range and attached network. See Modifying alias IP ranges for an existing instance for instructions on changing alias IP ranges. See Migrating a VM between networks for instructions on migrating an interface. This method follows PATCH semantics. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $networkInterface = 'network_interface'; + * $networkInterfaceResource = new NetworkInterface(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instancesClient->updateNetworkInterface($instance, $networkInterface, $networkInterfaceResource, $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->updateNetworkInterface($instance, $networkInterface, $networkInterfaceResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'updateNetworkInterface'); + * 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 string $networkInterface The name of the network interface to update. + * @param NetworkInterface $networkInterfaceResource 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 updateNetworkInterface($instance, $networkInterface, $networkInterfaceResource, $project, $zone, array $optionalArgs = []) + { + $request = new UpdateNetworkInterfaceInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setNetworkInterface($networkInterface); + $request->setNetworkInterfaceResource($networkInterfaceResource); + $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('UpdateNetworkInterface', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $instancesClient = new InstancesClient(); + * try { + * $instance = 'instance'; + * $project = 'project'; + * $shieldedInstanceConfigResource = new ShieldedInstanceConfig(); + * $zone = 'zone'; + * $operationResponse = $instancesClient->updateShieldedInstanceConfig($instance, $project, $shieldedInstanceConfigResource, $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->updateShieldedInstanceConfig($instance, $project, $shieldedInstanceConfigResource, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instancesClient->resumeOperation($operationName, 'updateShieldedInstanceConfig'); + * 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 Name or id of the instance scoping this request. + * @param string $project Project ID for this request. + * @param ShieldedInstanceConfig $shieldedInstanceConfigResource The body resource 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 updateShieldedInstanceConfig($instance, $project, $shieldedInstanceConfigResource, $zone, array $optionalArgs = []) + { + $request = new UpdateShieldedInstanceConfigInstanceRequest(); + $requestParamHeaders = []; + $request->setInstance($instance); + $request->setProject($project); + $request->setShieldedInstanceConfigResource($shieldedInstanceConfigResource); + $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('UpdateShieldedInstanceConfig', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/InstantSnapshotsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/InstantSnapshotsGapicClient.php new file mode 100644 index 000000000000..48a1ded61a8c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/InstantSnapshotsGapicClient.php @@ -0,0 +1,870 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $instantSnapshotsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $instantSnapshotsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\InstantSnapshotsClient}. + */ +class InstantSnapshotsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.InstantSnapshots'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/instant_snapshots_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/instant_snapshots_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/instant_snapshots_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** + * Retrieves an aggregated list of instantSnapshots. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $instantSnapshotsClient = new InstantSnapshotsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $instantSnapshotsClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $instantSnapshotsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $instantSnapshotsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListInstantSnapshotsRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, InstantSnapshotAggregatedList::class, $request); + } + + /** + * Deletes the specified InstantSnapshot resource. Keep in mind that deleting a single instantSnapshot might not necessarily delete all the data on that instantSnapshot. If any data on the instantSnapshot that is marked for deletion is needed for subsequent instantSnapshots, the data will be moved to the next corresponding instantSnapshot. For more information, see Deleting instantSnapshots. + * + * Sample code: + * ``` + * $instantSnapshotsClient = new InstantSnapshotsClient(); + * try { + * $instantSnapshot = 'instant_snapshot'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instantSnapshotsClient->delete($instantSnapshot, $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 = $instantSnapshotsClient->delete($instantSnapshot, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instantSnapshotsClient->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 { + * $instantSnapshotsClient->close(); + * } + * ``` + * + * @param string $instantSnapshot Name of the InstantSnapshot resource to delete. + * @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 delete($instantSnapshot, $project, $zone, array $optionalArgs = []) + { + $request = new DeleteInstantSnapshotRequest(); + $requestParamHeaders = []; + $request->setInstantSnapshot($instantSnapshot); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instant_snapshot'] = $instantSnapshot; + $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('Delete', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns the specified InstantSnapshot resource in the specified zone. + * + * Sample code: + * ``` + * $instantSnapshotsClient = new InstantSnapshotsClient(); + * try { + * $instantSnapshot = 'instant_snapshot'; + * $project = 'project'; + * $zone = 'zone'; + * $response = $instantSnapshotsClient->get($instantSnapshot, $project, $zone); + * } finally { + * $instantSnapshotsClient->close(); + * } + * ``` + * + * @param string $instantSnapshot Name of the InstantSnapshot resource to return. + * @param string $project Project ID for this request. + * @param string $zone The name of the zone 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\InstantSnapshot + * + * @throws ApiException if the remote call fails + */ + public function get($instantSnapshot, $project, $zone, array $optionalArgs = []) + { + $request = new GetInstantSnapshotRequest(); + $requestParamHeaders = []; + $request->setInstantSnapshot($instantSnapshot); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['instant_snapshot'] = $instantSnapshot; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', InstantSnapshot::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $instantSnapshotsClient = new InstantSnapshotsClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $zone = 'zone'; + * $response = $instantSnapshotsClient->getIamPolicy($project, $resource, $zone); + * } finally { + * $instantSnapshotsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param string $zone The name of the zone for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $resource, $zone, array $optionalArgs = []) + { + $request = new GetIamPolicyInstantSnapshotRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParamHeaders['zone'] = $zone; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates an instant snapshot in the specified zone. + * + * Sample code: + * ``` + * $instantSnapshotsClient = new InstantSnapshotsClient(); + * try { + * $instantSnapshotResource = new InstantSnapshot(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instantSnapshotsClient->insert($instantSnapshotResource, $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 = $instantSnapshotsClient->insert($instantSnapshotResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instantSnapshotsClient->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 { + * $instantSnapshotsClient->close(); + * } + * ``` + * + * @param InstantSnapshot $instantSnapshotResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone 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 insert($instantSnapshotResource, $project, $zone, array $optionalArgs = []) + { + $request = new InsertInstantSnapshotRequest(); + $requestParamHeaders = []; + $request->setInstantSnapshotResource($instantSnapshotResource); + $request->setProject($project); + $request->setZone($zone); + $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('Insert', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Retrieves the list of InstantSnapshot resources contained within the specified zone. + * + * Sample code: + * ``` + * $instantSnapshotsClient = new InstantSnapshotsClient(); + * try { + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $instantSnapshotsClient->list($project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $instantSnapshotsClient->list($project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $instantSnapshotsClient->close(); + * } + * ``` + * + * @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 $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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, $zone, array $optionalArgs = []) + { + $request = new ListInstantSnapshotsRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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, InstantSnapshotList::class, $request); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $instantSnapshotsClient = new InstantSnapshotsClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $zone = 'zone'; + * $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + * $response = $instantSnapshotsClient->setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource); + * } finally { + * $instantSnapshotsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param string $zone The name of the zone for this request. + * @param ZoneSetPolicyRequest $zoneSetPolicyRequestResource The body resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource, array $optionalArgs = []) + { + $request = new SetIamPolicyInstantSnapshotRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setZone($zone); + $request->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Sets the labels on a instantSnapshot in the given zone. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + * ``` + * $instantSnapshotsClient = new InstantSnapshotsClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $zone = 'zone'; + * $zoneSetLabelsRequestResource = new ZoneSetLabelsRequest(); + * $operationResponse = $instantSnapshotsClient->setLabels($project, $resource, $zone, $zoneSetLabelsRequestResource); + * $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 = $instantSnapshotsClient->setLabels($project, $resource, $zone, $zoneSetLabelsRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instantSnapshotsClient->resumeOperation($operationName, 'setLabels'); + * 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 { + * $instantSnapshotsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param string $zone The name of the zone for this request. + * @param ZoneSetLabelsRequest $zoneSetLabelsRequestResource The body resource 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 setLabels($project, $resource, $zone, $zoneSetLabelsRequestResource, array $optionalArgs = []) + { + $request = new SetLabelsInstantSnapshotRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setZone($zone); + $request->setZoneSetLabelsRequestResource($zoneSetLabelsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $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('SetLabels', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $instantSnapshotsClient = new InstantSnapshotsClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $zone = 'zone'; + * $response = $instantSnapshotsClient->testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone); + * } finally { + * $instantSnapshotsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * @param string $zone The name of the zone 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone, array $optionalArgs = []) + { + $request = new TestIamPermissionsInstantSnapshotRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/InterconnectAttachmentsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/InterconnectAttachmentsGapicClient.php new file mode 100644 index 000000000000..29026c1d30c7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/InterconnectAttachmentsGapicClient.php @@ -0,0 +1,796 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $interconnectAttachmentsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $interconnectAttachmentsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\InterconnectAttachmentsClient}. + */ +class InterconnectAttachmentsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.InterconnectAttachments'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/interconnect_attachments_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/interconnect_attachments_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/interconnect_attachments_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Retrieves an aggregated list of interconnect attachments. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $interconnectAttachmentsClient = new InterconnectAttachmentsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $interconnectAttachmentsClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $interconnectAttachmentsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $interconnectAttachmentsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListInterconnectAttachmentsRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, InterconnectAttachmentAggregatedList::class, $request); + } + + /** + * Deletes the specified interconnect attachment. + * + * Sample code: + * ``` + * $interconnectAttachmentsClient = new InterconnectAttachmentsClient(); + * try { + * $interconnectAttachment = 'interconnect_attachment'; + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $interconnectAttachmentsClient->delete($interconnectAttachment, $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 = $interconnectAttachmentsClient->delete($interconnectAttachment, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $interconnectAttachmentsClient->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 { + * $interconnectAttachmentsClient->close(); + * } + * ``` + * + * @param string $interconnectAttachment Name of the interconnect attachment to delete. + * @param string $project Project ID for this request. + * @param string $region 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($interconnectAttachment, $project, $region, array $optionalArgs = []) + { + $request = new DeleteInterconnectAttachmentRequest(); + $requestParamHeaders = []; + $request->setInterconnectAttachment($interconnectAttachment); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['interconnect_attachment'] = $interconnectAttachment; + $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 interconnect attachment. + * + * Sample code: + * ``` + * $interconnectAttachmentsClient = new InterconnectAttachmentsClient(); + * try { + * $interconnectAttachment = 'interconnect_attachment'; + * $project = 'project'; + * $region = 'region'; + * $response = $interconnectAttachmentsClient->get($interconnectAttachment, $project, $region); + * } finally { + * $interconnectAttachmentsClient->close(); + * } + * ``` + * + * @param string $interconnectAttachment Name of the interconnect attachment to return. + * @param string $project Project ID for this request. + * @param string $region 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\InterconnectAttachment + * + * @throws ApiException if the remote call fails + */ + public function get($interconnectAttachment, $project, $region, array $optionalArgs = []) + { + $request = new GetInterconnectAttachmentRequest(); + $requestParamHeaders = []; + $request->setInterconnectAttachment($interconnectAttachment); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['interconnect_attachment'] = $interconnectAttachment; + $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', InterconnectAttachment::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates an InterconnectAttachment in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $interconnectAttachmentsClient = new InterconnectAttachmentsClient(); + * try { + * $interconnectAttachmentResource = new InterconnectAttachment(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $interconnectAttachmentsClient->insert($interconnectAttachmentResource, $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 = $interconnectAttachmentsClient->insert($interconnectAttachmentResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $interconnectAttachmentsClient->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 { + * $interconnectAttachmentsClient->close(); + * } + * ``` + * + * @param InterconnectAttachment $interconnectAttachmentResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region 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 bool $validateOnly + * If true, the request will not be committed. + * @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($interconnectAttachmentResource, $project, $region, array $optionalArgs = []) + { + $request = new InsertInterconnectAttachmentRequest(); + $requestParamHeaders = []; + $request->setInterconnectAttachmentResource($interconnectAttachmentResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('Insert', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Retrieves the list of interconnect attachments contained within the specified region. + * + * Sample code: + * ``` + * $interconnectAttachmentsClient = new InterconnectAttachmentsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $interconnectAttachmentsClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $interconnectAttachmentsClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $interconnectAttachmentsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListInterconnectAttachmentsRequest(); + $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, InterconnectAttachmentList::class, $request); + } + + /** + * Updates the specified interconnect attachment with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $interconnectAttachmentsClient = new InterconnectAttachmentsClient(); + * try { + * $interconnectAttachment = 'interconnect_attachment'; + * $interconnectAttachmentResource = new InterconnectAttachment(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $interconnectAttachmentsClient->patch($interconnectAttachment, $interconnectAttachmentResource, $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 = $interconnectAttachmentsClient->patch($interconnectAttachment, $interconnectAttachmentResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $interconnectAttachmentsClient->resumeOperation($operationName, 'patch'); + * 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 { + * $interconnectAttachmentsClient->close(); + * } + * ``` + * + * @param string $interconnectAttachment Name of the interconnect attachment to patch. + * @param InterconnectAttachment $interconnectAttachmentResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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 patch($interconnectAttachment, $interconnectAttachmentResource, $project, $region, array $optionalArgs = []) + { + $request = new PatchInterconnectAttachmentRequest(); + $requestParamHeaders = []; + $request->setInterconnectAttachment($interconnectAttachment); + $request->setInterconnectAttachmentResource($interconnectAttachmentResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['interconnect_attachment'] = $interconnectAttachment; + $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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the labels on an InterconnectAttachment. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + * ``` + * $interconnectAttachmentsClient = new InterconnectAttachmentsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + * $resource = 'resource'; + * $operationResponse = $interconnectAttachmentsClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + * $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 = $interconnectAttachmentsClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $interconnectAttachmentsClient->resumeOperation($operationName, 'setLabels'); + * 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 { + * $interconnectAttachmentsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The region for this request. + * @param RegionSetLabelsRequest $regionSetLabelsRequestResource The body resource for this request + * @param string $resource Name or id of the resource 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 setLabels($project, $region, $regionSetLabelsRequestResource, $resource, array $optionalArgs = []) + { + $request = new SetLabelsInterconnectAttachmentRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + 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('SetLabels', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/InterconnectLocationsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/InterconnectLocationsGapicClient.php new file mode 100644 index 000000000000..3504416c9852 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/InterconnectLocationsGapicClient.php @@ -0,0 +1,305 @@ +get($interconnectLocation, $project); + * } finally { + * $interconnectLocationsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\InterconnectLocationsClient}. + */ +class InterconnectLocationsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.InterconnectLocations'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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.readonly', + 'https://www.googleapis.com/auth/compute', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/interconnect_locations_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/interconnect_locations_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/interconnect_locations_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** + * Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request. + * + * Sample code: + * ``` + * $interconnectLocationsClient = new InterconnectLocationsClient(); + * try { + * $interconnectLocation = 'interconnect_location'; + * $project = 'project'; + * $response = $interconnectLocationsClient->get($interconnectLocation, $project); + * } finally { + * $interconnectLocationsClient->close(); + * } + * ``` + * + * @param string $interconnectLocation Name of the interconnect location to return. + * @param string $project Project ID 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\InterconnectLocation + * + * @throws ApiException if the remote call fails + */ + public function get($interconnectLocation, $project, array $optionalArgs = []) + { + $request = new GetInterconnectLocationRequest(); + $requestParamHeaders = []; + $request->setInterconnectLocation($interconnectLocation); + $request->setProject($project); + $requestParamHeaders['interconnect_location'] = $interconnectLocation; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', InterconnectLocation::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves the list of interconnect locations available to the specified project. + * + * Sample code: + * ``` + * $interconnectLocationsClient = new InterconnectLocationsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $interconnectLocationsClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $interconnectLocationsClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $interconnectLocationsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListInterconnectLocationsRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, InterconnectLocationList::class, $request); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/InterconnectRemoteLocationsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/InterconnectRemoteLocationsGapicClient.php new file mode 100644 index 000000000000..311ed7e34e0e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/InterconnectRemoteLocationsGapicClient.php @@ -0,0 +1,305 @@ +get($interconnectRemoteLocation, $project); + * } finally { + * $interconnectRemoteLocationsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\InterconnectRemoteLocationsClient}. + */ +class InterconnectRemoteLocationsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.InterconnectRemoteLocations'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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.readonly', + 'https://www.googleapis.com/auth/compute', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/interconnect_remote_locations_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/interconnect_remote_locations_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/interconnect_remote_locations_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** + * Returns the details for the specified interconnect remote location. Gets a list of available interconnect remote locations by making a list() request. + * + * Sample code: + * ``` + * $interconnectRemoteLocationsClient = new InterconnectRemoteLocationsClient(); + * try { + * $interconnectRemoteLocation = 'interconnect_remote_location'; + * $project = 'project'; + * $response = $interconnectRemoteLocationsClient->get($interconnectRemoteLocation, $project); + * } finally { + * $interconnectRemoteLocationsClient->close(); + * } + * ``` + * + * @param string $interconnectRemoteLocation Name of the interconnect remote location to return. + * @param string $project Project ID 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\InterconnectRemoteLocation + * + * @throws ApiException if the remote call fails + */ + public function get($interconnectRemoteLocation, $project, array $optionalArgs = []) + { + $request = new GetInterconnectRemoteLocationRequest(); + $requestParamHeaders = []; + $request->setInterconnectRemoteLocation($interconnectRemoteLocation); + $request->setProject($project); + $requestParamHeaders['interconnect_remote_location'] = $interconnectRemoteLocation; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', InterconnectRemoteLocation::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves the list of interconnect remote locations available to the specified project. + * + * Sample code: + * ``` + * $interconnectRemoteLocationsClient = new InterconnectRemoteLocationsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $interconnectRemoteLocationsClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $interconnectRemoteLocationsClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $interconnectRemoteLocationsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListInterconnectRemoteLocationsRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, InterconnectRemoteLocationList::class, $request); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/InterconnectsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/InterconnectsGapicClient.php new file mode 100644 index 000000000000..02a1b280eec5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/InterconnectsGapicClient.php @@ -0,0 +1,763 @@ +delete($interconnect, $project); + * $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 = $interconnectsClient->delete($interconnect, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $interconnectsClient->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 { + * $interconnectsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\InterconnectsClient}. + */ +class InterconnectsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.Interconnects'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/interconnects_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/interconnects_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/interconnects_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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 Interconnect. + * + * Sample code: + * ``` + * $interconnectsClient = new InterconnectsClient(); + * try { + * $interconnect = 'interconnect'; + * $project = 'project'; + * $operationResponse = $interconnectsClient->delete($interconnect, $project); + * $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 = $interconnectsClient->delete($interconnect, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $interconnectsClient->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 { + * $interconnectsClient->close(); + * } + * ``` + * + * @param string $interconnect Name of the interconnect to delete. + * @param string $project Project ID 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($interconnect, $project, array $optionalArgs = []) + { + $request = new DeleteInterconnectRequest(); + $requestParamHeaders = []; + $request->setInterconnect($interconnect); + $request->setProject($project); + $requestParamHeaders['interconnect'] = $interconnect; + $requestParamHeaders['project'] = $project; + 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 Interconnect. Get a list of available Interconnects by making a list() request. + * + * Sample code: + * ``` + * $interconnectsClient = new InterconnectsClient(); + * try { + * $interconnect = 'interconnect'; + * $project = 'project'; + * $response = $interconnectsClient->get($interconnect, $project); + * } finally { + * $interconnectsClient->close(); + * } + * ``` + * + * @param string $interconnect Name of the interconnect to return. + * @param string $project Project ID 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\Interconnect + * + * @throws ApiException if the remote call fails + */ + public function get($interconnect, $project, array $optionalArgs = []) + { + $request = new GetInterconnectRequest(); + $requestParamHeaders = []; + $request->setInterconnect($interconnect); + $request->setProject($project); + $requestParamHeaders['interconnect'] = $interconnect; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', Interconnect::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the interconnectDiagnostics for the specified Interconnect. In the event of a global outage, do not use this API to make decisions about where to redirect your network traffic. Unlike a VLAN attachment, which is regional, a Cloud Interconnect connection is a global resource. A global outage can prevent this API from functioning properly. + * + * Sample code: + * ``` + * $interconnectsClient = new InterconnectsClient(); + * try { + * $interconnect = 'interconnect'; + * $project = 'project'; + * $response = $interconnectsClient->getDiagnostics($interconnect, $project); + * } finally { + * $interconnectsClient->close(); + * } + * ``` + * + * @param string $interconnect Name of the interconnect resource to query. + * @param string $project Project ID 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\InterconnectsGetDiagnosticsResponse + * + * @throws ApiException if the remote call fails + */ + public function getDiagnostics($interconnect, $project, array $optionalArgs = []) + { + $request = new GetDiagnosticsInterconnectRequest(); + $requestParamHeaders = []; + $request->setInterconnect($interconnect); + $request->setProject($project); + $requestParamHeaders['interconnect'] = $interconnect; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetDiagnostics', InterconnectsGetDiagnosticsResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the interconnectMacsecConfig for the specified Interconnect. + * + * Sample code: + * ``` + * $interconnectsClient = new InterconnectsClient(); + * try { + * $interconnect = 'interconnect'; + * $project = 'project'; + * $response = $interconnectsClient->getMacsecConfig($interconnect, $project); + * } finally { + * $interconnectsClient->close(); + * } + * ``` + * + * @param string $interconnect Name of the interconnect resource to query. + * @param string $project Project ID 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\InterconnectsGetMacsecConfigResponse + * + * @throws ApiException if the remote call fails + */ + public function getMacsecConfig($interconnect, $project, array $optionalArgs = []) + { + $request = new GetMacsecConfigInterconnectRequest(); + $requestParamHeaders = []; + $request->setInterconnect($interconnect); + $request->setProject($project); + $requestParamHeaders['interconnect'] = $interconnect; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetMacsecConfig', InterconnectsGetMacsecConfigResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates an Interconnect in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $interconnectsClient = new InterconnectsClient(); + * try { + * $interconnectResource = new Interconnect(); + * $project = 'project'; + * $operationResponse = $interconnectsClient->insert($interconnectResource, $project); + * $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 = $interconnectsClient->insert($interconnectResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $interconnectsClient->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 { + * $interconnectsClient->close(); + * } + * ``` + * + * @param Interconnect $interconnectResource The body resource for this request + * @param string $project Project ID 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($interconnectResource, $project, array $optionalArgs = []) + { + $request = new InsertInterconnectRequest(); + $requestParamHeaders = []; + $request->setInterconnectResource($interconnectResource); + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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 the list of Interconnects available to the specified project. + * + * Sample code: + * ``` + * $interconnectsClient = new InterconnectsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $interconnectsClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $interconnectsClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $interconnectsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListInterconnectsRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, InterconnectList::class, $request); + } + + /** + * Updates the specified Interconnect with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $interconnectsClient = new InterconnectsClient(); + * try { + * $interconnect = 'interconnect'; + * $interconnectResource = new Interconnect(); + * $project = 'project'; + * $operationResponse = $interconnectsClient->patch($interconnect, $interconnectResource, $project); + * $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 = $interconnectsClient->patch($interconnect, $interconnectResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $interconnectsClient->resumeOperation($operationName, 'patch'); + * 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 { + * $interconnectsClient->close(); + * } + * ``` + * + * @param string $interconnect Name of the interconnect to update. + * @param Interconnect $interconnectResource The body resource for this request + * @param string $project Project ID 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 patch($interconnect, $interconnectResource, $project, array $optionalArgs = []) + { + $request = new PatchInterconnectRequest(); + $requestParamHeaders = []; + $request->setInterconnect($interconnect); + $request->setInterconnectResource($interconnectResource); + $request->setProject($project); + $requestParamHeaders['interconnect'] = $interconnect; + $requestParamHeaders['project'] = $project; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the labels on an Interconnect. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + * ``` + * $interconnectsClient = new InterconnectsClient(); + * try { + * $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + * $project = 'project'; + * $resource = 'resource'; + * $operationResponse = $interconnectsClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + * $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 = $interconnectsClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $interconnectsClient->resumeOperation($operationName, 'setLabels'); + * 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 { + * $interconnectsClient->close(); + * } + * ``` + * + * @param GlobalSetLabelsRequest $globalSetLabelsRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource 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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function setLabels($globalSetLabelsRequestResource, $project, $resource, array $optionalArgs = []) + { + $request = new SetLabelsInterconnectRequest(); + $requestParamHeaders = []; + $request->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource); + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('SetLabels', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/LicenseCodesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/LicenseCodesGapicClient.php new file mode 100644 index 000000000000..fbaf4c01b4ca --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/LicenseCodesGapicClient.php @@ -0,0 +1,268 @@ +get($licenseCode, $project); + * } finally { + * $licenseCodesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\LicenseCodesClient}. + */ +class LicenseCodesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.LicenseCodes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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.readonly', + 'https://www.googleapis.com/auth/compute', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/license_codes_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/license_codes_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/license_codes_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** + * Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * Sample code: + * ``` + * $licenseCodesClient = new LicenseCodesClient(); + * try { + * $licenseCode = 'license_code'; + * $project = 'project'; + * $response = $licenseCodesClient->get($licenseCode, $project); + * } finally { + * $licenseCodesClient->close(); + * } + * ``` + * + * @param string $licenseCode Number corresponding to the License code resource to return. + * @param string $project Project ID 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\LicenseCode + * + * @throws ApiException if the remote call fails + */ + public function get($licenseCode, $project, array $optionalArgs = []) + { + $request = new GetLicenseCodeRequest(); + $requestParamHeaders = []; + $request->setLicenseCode($licenseCode); + $request->setProject($project); + $requestParamHeaders['license_code'] = $licenseCode; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', LicenseCode::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * Sample code: + * ``` + * $licenseCodesClient = new LicenseCodesClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $response = $licenseCodesClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + * } finally { + * $licenseCodesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $resource, $testPermissionsRequestResource, array $optionalArgs = []) + { + $request = new TestIamPermissionsLicenseCodeRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/LicensesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/LicensesGapicClient.php new file mode 100644 index 000000000000..f5ea8e8847f8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/LicensesGapicClient.php @@ -0,0 +1,674 @@ +delete($license, $project); + * $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 = $licensesClient->delete($license, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $licensesClient->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 { + * $licensesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\LicensesClient}. + */ +class LicensesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.Licenses'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/licenses_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/licenses_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/licenses_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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 license. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * Sample code: + * ``` + * $licensesClient = new LicensesClient(); + * try { + * $license = 'license'; + * $project = 'project'; + * $operationResponse = $licensesClient->delete($license, $project); + * $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 = $licensesClient->delete($license, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $licensesClient->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 { + * $licensesClient->close(); + * } + * ``` + * + * @param string $license Name of the license resource to delete. + * @param string $project Project ID 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($license, $project, array $optionalArgs = []) + { + $request = new DeleteLicenseRequest(); + $requestParamHeaders = []; + $request->setLicense($license); + $request->setProject($project); + $requestParamHeaders['license'] = $license; + $requestParamHeaders['project'] = $project; + 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 License resource. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * Sample code: + * ``` + * $licensesClient = new LicensesClient(); + * try { + * $license = 'license'; + * $project = 'project'; + * $response = $licensesClient->get($license, $project); + * } finally { + * $licensesClient->close(); + * } + * ``` + * + * @param string $license Name of the License resource to return. + * @param string $project Project ID 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\License + * + * @throws ApiException if the remote call fails + */ + public function get($license, $project, array $optionalArgs = []) + { + $request = new GetLicenseRequest(); + $requestParamHeaders = []; + $request->setLicense($license); + $request->setProject($project); + $requestParamHeaders['license'] = $license; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', License::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * Sample code: + * ``` + * $licensesClient = new LicensesClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $response = $licensesClient->getIamPolicy($project, $resource); + * } finally { + * $licensesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $resource, array $optionalArgs = []) + { + $request = new GetIamPolicyLicenseRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Create a License resource in the specified project. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * Sample code: + * ``` + * $licensesClient = new LicensesClient(); + * try { + * $licenseResource = new License(); + * $project = 'project'; + * $operationResponse = $licensesClient->insert($licenseResource, $project); + * $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 = $licensesClient->insert($licenseResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $licensesClient->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 { + * $licensesClient->close(); + * } + * ``` + * + * @param License $licenseResource The body resource for this request + * @param string $project Project ID 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($licenseResource, $project, array $optionalArgs = []) + { + $request = new InsertLicenseRequest(); + $requestParamHeaders = []; + $request->setLicenseResource($licenseResource); + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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 the list of licenses available in the specified project. This method does not get any licenses that belong to other projects, including licenses attached to publicly-available images, like Debian 9. If you want to get a list of publicly-available licenses, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * Sample code: + * ``` + * $licensesClient = new LicensesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $licensesClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $licensesClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $licensesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListLicensesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, LicensesListResponse::class, $request); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * Sample code: + * ``` + * $licensesClient = new LicensesClient(); + * try { + * $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + * $project = 'project'; + * $resource = 'resource'; + * $response = $licensesClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + * } finally { + * $licensesClient->close(); + * } + * ``` + * + * @param GlobalSetPolicyRequest $globalSetPolicyRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($globalSetPolicyRequestResource, $project, $resource, array $optionalArgs = []) + { + $request = new SetIamPolicyLicenseRequest(); + $requestParamHeaders = []; + $request->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource); + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. *Caution* This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * Sample code: + * ``` + * $licensesClient = new LicensesClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $response = $licensesClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + * } finally { + * $licensesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $resource, $testPermissionsRequestResource, array $optionalArgs = []) + { + $request = new TestIamPermissionsLicenseRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/MachineImagesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/MachineImagesGapicClient.php new file mode 100644 index 000000000000..4e159a6fde44 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/MachineImagesGapicClient.php @@ -0,0 +1,680 @@ +delete($machineImage, $project); + * $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 = $machineImagesClient->delete($machineImage, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $machineImagesClient->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 { + * $machineImagesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\MachineImagesClient}. + */ +class MachineImagesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.MachineImages'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/machine_images_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/machine_images_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/machine_images_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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 machine image. Deleting a machine image is permanent and cannot be undone. + * + * Sample code: + * ``` + * $machineImagesClient = new MachineImagesClient(); + * try { + * $machineImage = 'machine_image'; + * $project = 'project'; + * $operationResponse = $machineImagesClient->delete($machineImage, $project); + * $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 = $machineImagesClient->delete($machineImage, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $machineImagesClient->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 { + * $machineImagesClient->close(); + * } + * ``` + * + * @param string $machineImage The name of the machine image to delete. + * @param string $project Project ID 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($machineImage, $project, array $optionalArgs = []) + { + $request = new DeleteMachineImageRequest(); + $requestParamHeaders = []; + $request->setMachineImage($machineImage); + $request->setProject($project); + $requestParamHeaders['machine_image'] = $machineImage; + $requestParamHeaders['project'] = $project; + 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 machine image. + * + * Sample code: + * ``` + * $machineImagesClient = new MachineImagesClient(); + * try { + * $machineImage = 'machine_image'; + * $project = 'project'; + * $response = $machineImagesClient->get($machineImage, $project); + * } finally { + * $machineImagesClient->close(); + * } + * ``` + * + * @param string $machineImage The name of the machine image. + * @param string $project Project ID 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\MachineImage + * + * @throws ApiException if the remote call fails + */ + public function get($machineImage, $project, array $optionalArgs = []) + { + $request = new GetMachineImageRequest(); + $requestParamHeaders = []; + $request->setMachineImage($machineImage); + $request->setProject($project); + $requestParamHeaders['machine_image'] = $machineImage; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', MachineImage::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $machineImagesClient = new MachineImagesClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $response = $machineImagesClient->getIamPolicy($project, $resource); + * } finally { + * $machineImagesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $resource, array $optionalArgs = []) + { + $request = new GetIamPolicyMachineImageRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a machine image in the specified project using the data that is included in the request. If you are creating a new machine image to update an existing instance, your new machine image should use the same network or, if applicable, the same subnetwork as the original instance. + * + * Sample code: + * ``` + * $machineImagesClient = new MachineImagesClient(); + * try { + * $machineImageResource = new MachineImage(); + * $project = 'project'; + * $operationResponse = $machineImagesClient->insert($machineImageResource, $project); + * $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 = $machineImagesClient->insert($machineImageResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $machineImagesClient->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 { + * $machineImagesClient->close(); + * } + * ``` + * + * @param MachineImage $machineImageResource The body resource for this request + * @param string $project Project ID 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 string $sourceInstance + * Required. Source instance that is used to create the machine image from. + * @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($machineImageResource, $project, array $optionalArgs = []) + { + $request = new InsertMachineImageRequest(); + $requestParamHeaders = []; + $request->setMachineImageResource($machineImageResource); + $request->setProject($project); + $requestParamHeaders['project'] = $project; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['sourceInstance'])) { + $request->setSourceInstance($optionalArgs['sourceInstance']); + } + + $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 machine images that are contained within the specified project. + * + * Sample code: + * ``` + * $machineImagesClient = new MachineImagesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $machineImagesClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $machineImagesClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $machineImagesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListMachineImagesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, MachineImageList::class, $request); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $machineImagesClient = new MachineImagesClient(); + * try { + * $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + * $project = 'project'; + * $resource = 'resource'; + * $response = $machineImagesClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + * } finally { + * $machineImagesClient->close(); + * } + * ``` + * + * @param GlobalSetPolicyRequest $globalSetPolicyRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($globalSetPolicyRequestResource, $project, $resource, array $optionalArgs = []) + { + $request = new SetIamPolicyMachineImageRequest(); + $requestParamHeaders = []; + $request->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource); + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $machineImagesClient = new MachineImagesClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $response = $machineImagesClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + * } finally { + * $machineImagesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $resource, $testPermissionsRequestResource, array $optionalArgs = []) + { + $request = new TestIamPermissionsMachineImageRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/MachineTypesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/MachineTypesGapicClient.php new file mode 100644 index 000000000000..3ad324e5d3a5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/MachineTypesGapicClient.php @@ -0,0 +1,422 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $machineTypesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $machineTypesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\MachineTypesClient}. + */ +class MachineTypesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.MachineTypes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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.readonly', + 'https://www.googleapis.com/auth/compute', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/machine_types_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/machine_types_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/machine_types_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** + * Retrieves an aggregated list of machine types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $machineTypesClient = new MachineTypesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $machineTypesClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $machineTypesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $machineTypesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListMachineTypesRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, MachineTypeAggregatedList::class, $request); + } + + /** + * Returns the specified machine type. + * + * Sample code: + * ``` + * $machineTypesClient = new MachineTypesClient(); + * try { + * $machineType = 'machine_type'; + * $project = 'project'; + * $zone = 'zone'; + * $response = $machineTypesClient->get($machineType, $project, $zone); + * } finally { + * $machineTypesClient->close(); + * } + * ``` + * + * @param string $machineType Name of the machine type to return. + * @param string $project Project ID for this request. + * @param string $zone The name of the zone 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\MachineType + * + * @throws ApiException if the remote call fails + */ + public function get($machineType, $project, $zone, array $optionalArgs = []) + { + $request = new GetMachineTypeRequest(); + $requestParamHeaders = []; + $request->setMachineType($machineType); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['machine_type'] = $machineType; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', MachineType::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves a list of machine types available to the specified project. + * + * Sample code: + * ``` + * $machineTypesClient = new MachineTypesClient(); + * try { + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $machineTypesClient->list($project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $machineTypesClient->list($project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $machineTypesClient->close(); + * } + * ``` + * + * @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 $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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, $zone, array $optionalArgs = []) + { + $request = new ListMachineTypesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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, MachineTypeList::class, $request); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/NetworkAttachmentsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/NetworkAttachmentsGapicClient.php new file mode 100644 index 000000000000..4ce66d27be3f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/NetworkAttachmentsGapicClient.php @@ -0,0 +1,869 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $networkAttachmentsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $networkAttachmentsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\NetworkAttachmentsClient}. + */ +class NetworkAttachmentsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.NetworkAttachments'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/network_attachments_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/network_attachments_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/network_attachments_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Retrieves the list of all NetworkAttachment resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $networkAttachmentsClient = new NetworkAttachmentsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $networkAttachmentsClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $networkAttachmentsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $networkAttachmentsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListNetworkAttachmentsRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, NetworkAttachmentAggregatedList::class, $request); + } + + /** + * Deletes the specified NetworkAttachment in the given scope + * + * Sample code: + * ``` + * $networkAttachmentsClient = new NetworkAttachmentsClient(); + * try { + * $networkAttachment = 'network_attachment'; + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $networkAttachmentsClient->delete($networkAttachment, $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 = $networkAttachmentsClient->delete($networkAttachment, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkAttachmentsClient->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 { + * $networkAttachmentsClient->close(); + * } + * ``` + * + * @param string $networkAttachment Name of the NetworkAttachment resource to delete. + * @param string $project Project ID for this request. + * @param string $region Name of the region of 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). end_interface: MixerMutationRequestBuilder + * @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($networkAttachment, $project, $region, array $optionalArgs = []) + { + $request = new DeleteNetworkAttachmentRequest(); + $requestParamHeaders = []; + $request->setNetworkAttachment($networkAttachment); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['network_attachment'] = $networkAttachment; + $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 NetworkAttachment resource in the given scope. + * + * Sample code: + * ``` + * $networkAttachmentsClient = new NetworkAttachmentsClient(); + * try { + * $networkAttachment = 'network_attachment'; + * $project = 'project'; + * $region = 'region'; + * $response = $networkAttachmentsClient->get($networkAttachment, $project, $region); + * } finally { + * $networkAttachmentsClient->close(); + * } + * ``` + * + * @param string $networkAttachment Name of the NetworkAttachment resource to return. + * @param string $project Project ID for this request. + * @param string $region Name of the region of 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\NetworkAttachment + * + * @throws ApiException if the remote call fails + */ + public function get($networkAttachment, $project, $region, array $optionalArgs = []) + { + $request = new GetNetworkAttachmentRequest(); + $requestParamHeaders = []; + $request->setNetworkAttachment($networkAttachment); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['network_attachment'] = $networkAttachment; + $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', NetworkAttachment::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $networkAttachmentsClient = new NetworkAttachmentsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resource = 'resource'; + * $response = $networkAttachmentsClient->getIamPolicy($project, $region, $resource); + * } finally { + * $networkAttachmentsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $region, $resource, array $optionalArgs = []) + { + $request = new GetIamPolicyNetworkAttachmentRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a NetworkAttachment in the specified project in the given scope using the parameters that are included in the request. + * + * Sample code: + * ``` + * $networkAttachmentsClient = new NetworkAttachmentsClient(); + * try { + * $networkAttachmentResource = new NetworkAttachment(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $networkAttachmentsClient->insert($networkAttachmentResource, $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 = $networkAttachmentsClient->insert($networkAttachmentResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkAttachmentsClient->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 { + * $networkAttachmentsClient->close(); + * } + * ``` + * + * @param NetworkAttachment $networkAttachmentResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region of 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). end_interface: MixerMutationRequestBuilder + * @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($networkAttachmentResource, $project, $region, array $optionalArgs = []) + { + $request = new InsertNetworkAttachmentRequest(); + $requestParamHeaders = []; + $request->setNetworkAttachmentResource($networkAttachmentResource); + $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(); + } + + /** + * Lists the NetworkAttachments for a project in the given scope. + * + * Sample code: + * ``` + * $networkAttachmentsClient = new NetworkAttachmentsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $networkAttachmentsClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $networkAttachmentsClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $networkAttachmentsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region of 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListNetworkAttachmentsRequest(); + $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, NetworkAttachmentList::class, $request); + } + + /** + * Patches the specified NetworkAttachment resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $networkAttachmentsClient = new NetworkAttachmentsClient(); + * try { + * $networkAttachment = 'network_attachment'; + * $networkAttachmentResource = new NetworkAttachment(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $networkAttachmentsClient->patch($networkAttachment, $networkAttachmentResource, $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 = $networkAttachmentsClient->patch($networkAttachment, $networkAttachmentResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkAttachmentsClient->resumeOperation($operationName, 'patch'); + * 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 { + * $networkAttachmentsClient->close(); + * } + * ``` + * + * @param string $networkAttachment Name of the NetworkAttachment resource to patch. + * @param NetworkAttachment $networkAttachmentResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region 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). end_interface: MixerMutationRequestBuilder + * @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 patch($networkAttachment, $networkAttachmentResource, $project, $region, array $optionalArgs = []) + { + $request = new PatchNetworkAttachmentRequest(); + $requestParamHeaders = []; + $request->setNetworkAttachment($networkAttachment); + $request->setNetworkAttachmentResource($networkAttachmentResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['network_attachment'] = $networkAttachment; + $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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $networkAttachmentsClient = new NetworkAttachmentsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + * $resource = 'resource'; + * $response = $networkAttachmentsClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + * } finally { + * $networkAttachmentsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param RegionSetPolicyRequest $regionSetPolicyRequestResource The body resource for this request + * @param string $resource Name or id of the resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource, array $optionalArgs = []) + { + $request = new SetIamPolicyNetworkAttachmentRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $networkAttachmentsClient = new NetworkAttachmentsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $response = $networkAttachmentsClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + * } finally { + * $networkAttachmentsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $region, $resource, $testPermissionsRequestResource, array $optionalArgs = []) + { + $request = new TestIamPermissionsNetworkAttachmentRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/NetworkEdgeSecurityServicesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/NetworkEdgeSecurityServicesGapicClient.php new file mode 100644 index 000000000000..e9d8744315fe --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/NetworkEdgeSecurityServicesGapicClient.php @@ -0,0 +1,636 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $networkEdgeSecurityServicesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $networkEdgeSecurityServicesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\NetworkEdgeSecurityServicesClient}. + */ +class NetworkEdgeSecurityServicesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.NetworkEdgeSecurityServices'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/network_edge_security_services_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/network_edge_security_services_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/network_edge_security_services_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Retrieves the list of all NetworkEdgeSecurityService resources available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $networkEdgeSecurityServicesClient = new NetworkEdgeSecurityServicesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $networkEdgeSecurityServicesClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $networkEdgeSecurityServicesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $networkEdgeSecurityServicesClient->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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListNetworkEdgeSecurityServicesRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, NetworkEdgeSecurityServiceAggregatedList::class, $request); + } + + /** + * Deletes the specified service. + * + * Sample code: + * ``` + * $networkEdgeSecurityServicesClient = new NetworkEdgeSecurityServicesClient(); + * try { + * $networkEdgeSecurityService = 'network_edge_security_service'; + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $networkEdgeSecurityServicesClient->delete($networkEdgeSecurityService, $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 = $networkEdgeSecurityServicesClient->delete($networkEdgeSecurityService, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkEdgeSecurityServicesClient->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 { + * $networkEdgeSecurityServicesClient->close(); + * } + * ``` + * + * @param string $networkEdgeSecurityService Name of the network edge security service to delete. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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($networkEdgeSecurityService, $project, $region, array $optionalArgs = []) + { + $request = new DeleteNetworkEdgeSecurityServiceRequest(); + $requestParamHeaders = []; + $request->setNetworkEdgeSecurityService($networkEdgeSecurityService); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['network_edge_security_service'] = $networkEdgeSecurityService; + $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(); + } + + /** + * Gets a specified NetworkEdgeSecurityService. + * + * Sample code: + * ``` + * $networkEdgeSecurityServicesClient = new NetworkEdgeSecurityServicesClient(); + * try { + * $networkEdgeSecurityService = 'network_edge_security_service'; + * $project = 'project'; + * $region = 'region'; + * $response = $networkEdgeSecurityServicesClient->get($networkEdgeSecurityService, $project, $region); + * } finally { + * $networkEdgeSecurityServicesClient->close(); + * } + * ``` + * + * @param string $networkEdgeSecurityService Name of the network edge security service to get. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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\NetworkEdgeSecurityService + * + * @throws ApiException if the remote call fails + */ + public function get($networkEdgeSecurityService, $project, $region, array $optionalArgs = []) + { + $request = new GetNetworkEdgeSecurityServiceRequest(); + $requestParamHeaders = []; + $request->setNetworkEdgeSecurityService($networkEdgeSecurityService); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['network_edge_security_service'] = $networkEdgeSecurityService; + $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', NetworkEdgeSecurityService::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a new service in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $networkEdgeSecurityServicesClient = new NetworkEdgeSecurityServicesClient(); + * try { + * $networkEdgeSecurityServiceResource = new NetworkEdgeSecurityService(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $networkEdgeSecurityServicesClient->insert($networkEdgeSecurityServiceResource, $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 = $networkEdgeSecurityServicesClient->insert($networkEdgeSecurityServiceResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkEdgeSecurityServicesClient->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 { + * $networkEdgeSecurityServicesClient->close(); + * } + * ``` + * + * @param NetworkEdgeSecurityService $networkEdgeSecurityServiceResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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 bool $validateOnly + * If true, the request will not be committed. + * @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($networkEdgeSecurityServiceResource, $project, $region, array $optionalArgs = []) + { + $request = new InsertNetworkEdgeSecurityServiceRequest(); + $requestParamHeaders = []; + $request->setNetworkEdgeSecurityServiceResource($networkEdgeSecurityServiceResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('Insert', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Patches the specified policy with the data included in the request. + * + * Sample code: + * ``` + * $networkEdgeSecurityServicesClient = new NetworkEdgeSecurityServicesClient(); + * try { + * $networkEdgeSecurityService = 'network_edge_security_service'; + * $networkEdgeSecurityServiceResource = new NetworkEdgeSecurityService(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $networkEdgeSecurityServicesClient->patch($networkEdgeSecurityService, $networkEdgeSecurityServiceResource, $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 = $networkEdgeSecurityServicesClient->patch($networkEdgeSecurityService, $networkEdgeSecurityServiceResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkEdgeSecurityServicesClient->resumeOperation($operationName, 'patch'); + * 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 { + * $networkEdgeSecurityServicesClient->close(); + * } + * ``` + * + * @param string $networkEdgeSecurityService Name of the network edge security service to update. + * @param NetworkEdgeSecurityService $networkEdgeSecurityServiceResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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 + * 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 patch($networkEdgeSecurityService, $networkEdgeSecurityServiceResource, $project, $region, array $optionalArgs = []) + { + $request = new PatchNetworkEdgeSecurityServiceRequest(); + $requestParamHeaders = []; + $request->setNetworkEdgeSecurityService($networkEdgeSecurityService); + $request->setNetworkEdgeSecurityServiceResource($networkEdgeSecurityServiceResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['network_edge_security_service'] = $networkEdgeSecurityService; + $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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/NetworkEndpointGroupsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/NetworkEndpointGroupsGapicClient.php new file mode 100644 index 000000000000..94a9bdec8735 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/NetworkEndpointGroupsGapicClient.php @@ -0,0 +1,942 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $networkEndpointGroupsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $networkEndpointGroupsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\NetworkEndpointGroupsClient}. + */ +class NetworkEndpointGroupsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.NetworkEndpointGroups'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/network_endpoint_groups_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/network_endpoint_groups_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/network_endpoint_groups_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** + * Retrieves the list of network endpoint groups and sorts them by zone. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $networkEndpointGroupsClient = new NetworkEndpointGroupsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $networkEndpointGroupsClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $networkEndpointGroupsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $networkEndpointGroupsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListNetworkEndpointGroupsRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, NetworkEndpointGroupAggregatedList::class, $request); + } + + /** + * Attach a list of network endpoints to the specified network endpoint group. + * + * Sample code: + * ``` + * $networkEndpointGroupsClient = new NetworkEndpointGroupsClient(); + * try { + * $networkEndpointGroup = 'network_endpoint_group'; + * $networkEndpointGroupsAttachEndpointsRequestResource = new NetworkEndpointGroupsAttachEndpointsRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $networkEndpointGroupsClient->attachNetworkEndpoints($networkEndpointGroup, $networkEndpointGroupsAttachEndpointsRequestResource, $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 = $networkEndpointGroupsClient->attachNetworkEndpoints($networkEndpointGroup, $networkEndpointGroupsAttachEndpointsRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkEndpointGroupsClient->resumeOperation($operationName, 'attachNetworkEndpoints'); + * 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 { + * $networkEndpointGroupsClient->close(); + * } + * ``` + * + * @param string $networkEndpointGroup The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * @param NetworkEndpointGroupsAttachEndpointsRequest $networkEndpointGroupsAttachEndpointsRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @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 attachNetworkEndpoints($networkEndpointGroup, $networkEndpointGroupsAttachEndpointsRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new AttachNetworkEndpointsNetworkEndpointGroupRequest(); + $requestParamHeaders = []; + $request->setNetworkEndpointGroup($networkEndpointGroup); + $request->setNetworkEndpointGroupsAttachEndpointsRequestResource($networkEndpointGroupsAttachEndpointsRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['network_endpoint_group'] = $networkEndpointGroup; + $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('AttachNetworkEndpoints', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes the specified network endpoint group. The network endpoints in the NEG and the VM instances they belong to are not terminated when the NEG is deleted. Note that the NEG cannot be deleted if there are backend services referencing it. + * + * Sample code: + * ``` + * $networkEndpointGroupsClient = new NetworkEndpointGroupsClient(); + * try { + * $networkEndpointGroup = 'network_endpoint_group'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $networkEndpointGroupsClient->delete($networkEndpointGroup, $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 = $networkEndpointGroupsClient->delete($networkEndpointGroup, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkEndpointGroupsClient->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 { + * $networkEndpointGroupsClient->close(); + * } + * ``` + * + * @param string $networkEndpointGroup The name of the network endpoint group to delete. It should comply with RFC1035. + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @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($networkEndpointGroup, $project, $zone, array $optionalArgs = []) + { + $request = new DeleteNetworkEndpointGroupRequest(); + $requestParamHeaders = []; + $request->setNetworkEndpointGroup($networkEndpointGroup); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['network_endpoint_group'] = $networkEndpointGroup; + $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('Delete', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Detach a list of network endpoints from the specified network endpoint group. + * + * Sample code: + * ``` + * $networkEndpointGroupsClient = new NetworkEndpointGroupsClient(); + * try { + * $networkEndpointGroup = 'network_endpoint_group'; + * $networkEndpointGroupsDetachEndpointsRequestResource = new NetworkEndpointGroupsDetachEndpointsRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $networkEndpointGroupsClient->detachNetworkEndpoints($networkEndpointGroup, $networkEndpointGroupsDetachEndpointsRequestResource, $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 = $networkEndpointGroupsClient->detachNetworkEndpoints($networkEndpointGroup, $networkEndpointGroupsDetachEndpointsRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkEndpointGroupsClient->resumeOperation($operationName, 'detachNetworkEndpoints'); + * 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 { + * $networkEndpointGroupsClient->close(); + * } + * ``` + * + * @param string $networkEndpointGroup The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + * @param NetworkEndpointGroupsDetachEndpointsRequest $networkEndpointGroupsDetachEndpointsRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @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 detachNetworkEndpoints($networkEndpointGroup, $networkEndpointGroupsDetachEndpointsRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new DetachNetworkEndpointsNetworkEndpointGroupRequest(); + $requestParamHeaders = []; + $request->setNetworkEndpointGroup($networkEndpointGroup); + $request->setNetworkEndpointGroupsDetachEndpointsRequestResource($networkEndpointGroupsDetachEndpointsRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['network_endpoint_group'] = $networkEndpointGroup; + $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('DetachNetworkEndpoints', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns the specified network endpoint group. + * + * Sample code: + * ``` + * $networkEndpointGroupsClient = new NetworkEndpointGroupsClient(); + * try { + * $networkEndpointGroup = 'network_endpoint_group'; + * $project = 'project'; + * $zone = 'zone'; + * $response = $networkEndpointGroupsClient->get($networkEndpointGroup, $project, $zone); + * } finally { + * $networkEndpointGroupsClient->close(); + * } + * ``` + * + * @param string $networkEndpointGroup The name of the network endpoint group. It should comply with RFC1035. + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @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\NetworkEndpointGroup + * + * @throws ApiException if the remote call fails + */ + public function get($networkEndpointGroup, $project, $zone, array $optionalArgs = []) + { + $request = new GetNetworkEndpointGroupRequest(); + $requestParamHeaders = []; + $request->setNetworkEndpointGroup($networkEndpointGroup); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['network_endpoint_group'] = $networkEndpointGroup; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', NetworkEndpointGroup::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a network endpoint group in the specified project using the parameters that are included in the request. + * + * Sample code: + * ``` + * $networkEndpointGroupsClient = new NetworkEndpointGroupsClient(); + * try { + * $networkEndpointGroupResource = new NetworkEndpointGroup(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $networkEndpointGroupsClient->insert($networkEndpointGroupResource, $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 = $networkEndpointGroupsClient->insert($networkEndpointGroupResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkEndpointGroupsClient->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 { + * $networkEndpointGroupsClient->close(); + * } + * ``` + * + * @param NetworkEndpointGroup $networkEndpointGroupResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where you want to create the network endpoint group. It should comply with RFC1035. + * @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($networkEndpointGroupResource, $project, $zone, array $optionalArgs = []) + { + $request = new InsertNetworkEndpointGroupRequest(); + $requestParamHeaders = []; + $request->setNetworkEndpointGroupResource($networkEndpointGroupResource); + $request->setProject($project); + $request->setZone($zone); + $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('Insert', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Retrieves the list of network endpoint groups that are located in the specified project and zone. + * + * Sample code: + * ``` + * $networkEndpointGroupsClient = new NetworkEndpointGroupsClient(); + * try { + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $networkEndpointGroupsClient->list($project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $networkEndpointGroupsClient->list($project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $networkEndpointGroupsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, $zone, array $optionalArgs = []) + { + $request = new ListNetworkEndpointGroupsRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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, NetworkEndpointGroupList::class, $request); + } + + /** + * Lists the network endpoints in the specified network endpoint group. + * + * Sample code: + * ``` + * $networkEndpointGroupsClient = new NetworkEndpointGroupsClient(); + * try { + * $networkEndpointGroup = 'network_endpoint_group'; + * $networkEndpointGroupsListEndpointsRequestResource = new NetworkEndpointGroupsListEndpointsRequest(); + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $networkEndpointGroupsClient->listNetworkEndpoints($networkEndpointGroup, $networkEndpointGroupsListEndpointsRequestResource, $project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $networkEndpointGroupsClient->listNetworkEndpoints($networkEndpointGroup, $networkEndpointGroupsListEndpointsRequestResource, $project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $networkEndpointGroupsClient->close(); + * } + * ``` + * + * @param string $networkEndpointGroup The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * @param NetworkEndpointGroupsListEndpointsRequest $networkEndpointGroupsListEndpointsRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 listNetworkEndpoints($networkEndpointGroup, $networkEndpointGroupsListEndpointsRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new ListNetworkEndpointsNetworkEndpointGroupsRequest(); + $requestParamHeaders = []; + $request->setNetworkEndpointGroup($networkEndpointGroup); + $request->setNetworkEndpointGroupsListEndpointsRequestResource($networkEndpointGroupsListEndpointsRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['network_endpoint_group'] = $networkEndpointGroup; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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('ListNetworkEndpoints', $optionalArgs, NetworkEndpointGroupsListNetworkEndpoints::class, $request); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $networkEndpointGroupsClient = new NetworkEndpointGroupsClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $zone = 'zone'; + * $response = $networkEndpointGroupsClient->testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone); + * } finally { + * $networkEndpointGroupsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * @param string $zone The name of the zone 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone, array $optionalArgs = []) + { + $request = new TestIamPermissionsNetworkEndpointGroupRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/NetworkFirewallPoliciesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/NetworkFirewallPoliciesGapicClient.php new file mode 100644 index 000000000000..a0d069941e44 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/NetworkFirewallPoliciesGapicClient.php @@ -0,0 +1,1342 @@ +addAssociation($firewallPolicy, $firewallPolicyAssociationResource, $project); + * $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 = $networkFirewallPoliciesClient->addAssociation($firewallPolicy, $firewallPolicyAssociationResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkFirewallPoliciesClient->resumeOperation($operationName, 'addAssociation'); + * 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 { + * $networkFirewallPoliciesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\NetworkFirewallPoliciesClient}. + */ +class NetworkFirewallPoliciesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.NetworkFirewallPolicies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/network_firewall_policies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/network_firewall_policies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/network_firewall_policies_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** + * Inserts an association for the specified firewall policy. + * + * Sample code: + * ``` + * $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $firewallPolicyAssociationResource = new FirewallPolicyAssociation(); + * $project = 'project'; + * $operationResponse = $networkFirewallPoliciesClient->addAssociation($firewallPolicy, $firewallPolicyAssociationResource, $project); + * $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 = $networkFirewallPoliciesClient->addAssociation($firewallPolicy, $firewallPolicyAssociationResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkFirewallPoliciesClient->resumeOperation($operationName, 'addAssociation'); + * 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 { + * $networkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to update. + * @param FirewallPolicyAssociation $firewallPolicyAssociationResource The body resource for this request + * @param string $project Project ID for this request. + * @param array $optionalArgs { + * Optional. + * + * @type bool $replaceExistingAssociation + * Indicates whether or not to replace it if an association of the attachment already exists. This is false by default, in which case an error will be returned if an association already exists. + * @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 addAssociation($firewallPolicy, $firewallPolicyAssociationResource, $project, array $optionalArgs = []) + { + $request = new AddAssociationNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setFirewallPolicyAssociationResource($firewallPolicyAssociationResource); + $request->setProject($project); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $requestParamHeaders['project'] = $project; + if (isset($optionalArgs['replaceExistingAssociation'])) { + $request->setReplaceExistingAssociation($optionalArgs['replaceExistingAssociation']); + } + + 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('AddAssociation', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Inserts a rule into a firewall policy. + * + * Sample code: + * ``` + * $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $firewallPolicyRuleResource = new FirewallPolicyRule(); + * $project = 'project'; + * $operationResponse = $networkFirewallPoliciesClient->addRule($firewallPolicy, $firewallPolicyRuleResource, $project); + * $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 = $networkFirewallPoliciesClient->addRule($firewallPolicy, $firewallPolicyRuleResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkFirewallPoliciesClient->resumeOperation($operationName, 'addRule'); + * 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 { + * $networkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to update. + * @param FirewallPolicyRule $firewallPolicyRuleResource The body resource for this request + * @param string $project Project ID for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $maxPriority + * When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority. + * @type int $minPriority + * When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority. + * @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 addRule($firewallPolicy, $firewallPolicyRuleResource, $project, array $optionalArgs = []) + { + $request = new AddRuleNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setFirewallPolicyRuleResource($firewallPolicyRuleResource); + $request->setProject($project); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $requestParamHeaders['project'] = $project; + if (isset($optionalArgs['maxPriority'])) { + $request->setMaxPriority($optionalArgs['maxPriority']); + } + + if (isset($optionalArgs['minPriority'])) { + $request->setMinPriority($optionalArgs['minPriority']); + } + + 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('AddRule', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Copies rules to the specified firewall policy. + * + * Sample code: + * ``` + * $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $project = 'project'; + * $operationResponse = $networkFirewallPoliciesClient->cloneRules($firewallPolicy, $project); + * $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 = $networkFirewallPoliciesClient->cloneRules($firewallPolicy, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkFirewallPoliciesClient->resumeOperation($operationName, 'cloneRules'); + * 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 { + * $networkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to update. + * @param string $project Project ID 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 string $sourceFirewallPolicy + * The firewall policy from which to copy rules. + * @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 cloneRules($firewallPolicy, $project, array $optionalArgs = []) + { + $request = new CloneRulesNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setProject($project); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $requestParamHeaders['project'] = $project; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['sourceFirewallPolicy'])) { + $request->setSourceFirewallPolicy($optionalArgs['sourceFirewallPolicy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CloneRules', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes the specified policy. + * + * Sample code: + * ``` + * $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $project = 'project'; + * $operationResponse = $networkFirewallPoliciesClient->delete($firewallPolicy, $project); + * $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 = $networkFirewallPoliciesClient->delete($firewallPolicy, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkFirewallPoliciesClient->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 { + * $networkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to delete. + * @param string $project Project ID 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($firewallPolicy, $project, array $optionalArgs = []) + { + $request = new DeleteNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setProject($project); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $requestParamHeaders['project'] = $project; + 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 network firewall policy. + * + * Sample code: + * ``` + * $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $project = 'project'; + * $response = $networkFirewallPoliciesClient->get($firewallPolicy, $project); + * } finally { + * $networkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to get. + * @param string $project Project ID 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\FirewallPolicy + * + * @throws ApiException if the remote call fails + */ + public function get($firewallPolicy, $project, array $optionalArgs = []) + { + $request = new GetNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setProject($project); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', FirewallPolicy::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets an association with the specified name. + * + * Sample code: + * ``` + * $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $project = 'project'; + * $response = $networkFirewallPoliciesClient->getAssociation($firewallPolicy, $project); + * } finally { + * $networkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to which the queried association belongs. + * @param string $project Project ID for this request. + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The name of the association to get from the firewall policy. + * @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\FirewallPolicyAssociation + * + * @throws ApiException if the remote call fails + */ + public function getAssociation($firewallPolicy, $project, array $optionalArgs = []) + { + $request = new GetAssociationNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setProject($project); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $requestParamHeaders['project'] = $project; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetAssociation', FirewallPolicyAssociation::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $response = $networkFirewallPoliciesClient->getIamPolicy($project, $resource); + * } finally { + * $networkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $resource, array $optionalArgs = []) + { + $request = new GetIamPolicyNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a rule of the specified priority. + * + * Sample code: + * ``` + * $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $project = 'project'; + * $response = $networkFirewallPoliciesClient->getRule($firewallPolicy, $project); + * } finally { + * $networkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to which the queried rule belongs. + * @param string $project Project ID for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $priority + * The priority of the rule to get from the firewall policy. + * @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\FirewallPolicyRule + * + * @throws ApiException if the remote call fails + */ + public function getRule($firewallPolicy, $project, array $optionalArgs = []) + { + $request = new GetRuleNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setProject($project); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $requestParamHeaders['project'] = $project; + if (isset($optionalArgs['priority'])) { + $request->setPriority($optionalArgs['priority']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetRule', FirewallPolicyRule::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a new policy in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + * try { + * $firewallPolicyResource = new FirewallPolicy(); + * $project = 'project'; + * $operationResponse = $networkFirewallPoliciesClient->insert($firewallPolicyResource, $project); + * $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 = $networkFirewallPoliciesClient->insert($firewallPolicyResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkFirewallPoliciesClient->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 { + * $networkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param FirewallPolicy $firewallPolicyResource The body resource for this request + * @param string $project Project ID 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($firewallPolicyResource, $project, array $optionalArgs = []) + { + $request = new InsertNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicyResource($firewallPolicyResource); + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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(); + } + + /** + * Lists all the policies that have been configured for the specified project. + * + * Sample code: + * ``` + * $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $networkFirewallPoliciesClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $networkFirewallPoliciesClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $networkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListNetworkFirewallPoliciesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, FirewallPolicyList::class, $request); + } + + /** + * Patches the specified policy with the data included in the request. + * + * Sample code: + * ``` + * $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $firewallPolicyResource = new FirewallPolicy(); + * $project = 'project'; + * $operationResponse = $networkFirewallPoliciesClient->patch($firewallPolicy, $firewallPolicyResource, $project); + * $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 = $networkFirewallPoliciesClient->patch($firewallPolicy, $firewallPolicyResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkFirewallPoliciesClient->resumeOperation($operationName, 'patch'); + * 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 { + * $networkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to update. + * @param FirewallPolicy $firewallPolicyResource The body resource for this request + * @param string $project Project ID 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 patch($firewallPolicy, $firewallPolicyResource, $project, array $optionalArgs = []) + { + $request = new PatchNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setFirewallPolicyResource($firewallPolicyResource); + $request->setProject($project); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $requestParamHeaders['project'] = $project; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Patches a rule of the specified priority. + * + * Sample code: + * ``` + * $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $firewallPolicyRuleResource = new FirewallPolicyRule(); + * $project = 'project'; + * $operationResponse = $networkFirewallPoliciesClient->patchRule($firewallPolicy, $firewallPolicyRuleResource, $project); + * $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 = $networkFirewallPoliciesClient->patchRule($firewallPolicy, $firewallPolicyRuleResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkFirewallPoliciesClient->resumeOperation($operationName, 'patchRule'); + * 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 { + * $networkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to update. + * @param FirewallPolicyRule $firewallPolicyRuleResource The body resource for this request + * @param string $project Project ID for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $priority + * The priority of the rule to patch. + * @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 patchRule($firewallPolicy, $firewallPolicyRuleResource, $project, array $optionalArgs = []) + { + $request = new PatchRuleNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setFirewallPolicyRuleResource($firewallPolicyRuleResource); + $request->setProject($project); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $requestParamHeaders['project'] = $project; + if (isset($optionalArgs['priority'])) { + $request->setPriority($optionalArgs['priority']); + } + + 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('PatchRule', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Removes an association for the specified firewall policy. + * + * Sample code: + * ``` + * $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $project = 'project'; + * $operationResponse = $networkFirewallPoliciesClient->removeAssociation($firewallPolicy, $project); + * $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 = $networkFirewallPoliciesClient->removeAssociation($firewallPolicy, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkFirewallPoliciesClient->resumeOperation($operationName, 'removeAssociation'); + * 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 { + * $networkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to update. + * @param string $project Project ID for this request. + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Name for the attachment that will be removed. + * @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 removeAssociation($firewallPolicy, $project, array $optionalArgs = []) + { + $request = new RemoveAssociationNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setProject($project); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $requestParamHeaders['project'] = $project; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + } + + 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('RemoveAssociation', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes a rule of the specified priority. + * + * Sample code: + * ``` + * $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $project = 'project'; + * $operationResponse = $networkFirewallPoliciesClient->removeRule($firewallPolicy, $project); + * $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 = $networkFirewallPoliciesClient->removeRule($firewallPolicy, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networkFirewallPoliciesClient->resumeOperation($operationName, 'removeRule'); + * 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 { + * $networkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to update. + * @param string $project Project ID for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $priority + * The priority of the rule to remove from the firewall policy. + * @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 removeRule($firewallPolicy, $project, array $optionalArgs = []) + { + $request = new RemoveRuleNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setProject($project); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $requestParamHeaders['project'] = $project; + if (isset($optionalArgs['priority'])) { + $request->setPriority($optionalArgs['priority']); + } + + 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('RemoveRule', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + * try { + * $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + * $project = 'project'; + * $resource = 'resource'; + * $response = $networkFirewallPoliciesClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + * } finally { + * $networkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param GlobalSetPolicyRequest $globalSetPolicyRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($globalSetPolicyRequestResource, $project, $resource, array $optionalArgs = []) + { + $request = new SetIamPolicyNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource); + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $networkFirewallPoliciesClient = new NetworkFirewallPoliciesClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $response = $networkFirewallPoliciesClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + * } finally { + * $networkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $resource, $testPermissionsRequestResource, array $optionalArgs = []) + { + $request = new TestIamPermissionsNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/NetworksGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/NetworksGapicClient.php new file mode 100644 index 000000000000..75e655992ae9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/NetworksGapicClient.php @@ -0,0 +1,1061 @@ +addPeering($network, $networksAddPeeringRequestResource, $project); + * $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 = $networksClient->addPeering($network, $networksAddPeeringRequestResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networksClient->resumeOperation($operationName, 'addPeering'); + * 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 { + * $networksClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\NetworksClient}. + */ +class NetworksGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.Networks'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/networks_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/networks_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/networks_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** + * Adds a peering to the specified network. + * + * Sample code: + * ``` + * $networksClient = new NetworksClient(); + * try { + * $network = 'network'; + * $networksAddPeeringRequestResource = new NetworksAddPeeringRequest(); + * $project = 'project'; + * $operationResponse = $networksClient->addPeering($network, $networksAddPeeringRequestResource, $project); + * $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 = $networksClient->addPeering($network, $networksAddPeeringRequestResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networksClient->resumeOperation($operationName, 'addPeering'); + * 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 { + * $networksClient->close(); + * } + * ``` + * + * @param string $network Name of the network resource to add peering to. + * @param NetworksAddPeeringRequest $networksAddPeeringRequestResource The body resource for this request + * @param string $project Project ID 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 addPeering($network, $networksAddPeeringRequestResource, $project, array $optionalArgs = []) + { + $request = new AddPeeringNetworkRequest(); + $requestParamHeaders = []; + $request->setNetwork($network); + $request->setNetworksAddPeeringRequestResource($networksAddPeeringRequestResource); + $request->setProject($project); + $requestParamHeaders['network'] = $network; + $requestParamHeaders['project'] = $project; + 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('AddPeering', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes the specified network. + * + * Sample code: + * ``` + * $networksClient = new NetworksClient(); + * try { + * $network = 'network'; + * $project = 'project'; + * $operationResponse = $networksClient->delete($network, $project); + * $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 = $networksClient->delete($network, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networksClient->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 { + * $networksClient->close(); + * } + * ``` + * + * @param string $network Name of the network to delete. + * @param string $project Project ID 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($network, $project, array $optionalArgs = []) + { + $request = new DeleteNetworkRequest(); + $requestParamHeaders = []; + $request->setNetwork($network); + $request->setProject($project); + $requestParamHeaders['network'] = $network; + $requestParamHeaders['project'] = $project; + 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 network. + * + * Sample code: + * ``` + * $networksClient = new NetworksClient(); + * try { + * $network = 'network'; + * $project = 'project'; + * $response = $networksClient->get($network, $project); + * } finally { + * $networksClient->close(); + * } + * ``` + * + * @param string $network Name of the network to return. + * @param string $project Project ID 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\Network + * + * @throws ApiException if the remote call fails + */ + public function get($network, $project, array $optionalArgs = []) + { + $request = new GetNetworkRequest(); + $requestParamHeaders = []; + $request->setNetwork($network); + $request->setProject($project); + $requestParamHeaders['network'] = $network; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', Network::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the effective firewalls on a given network. + * + * Sample code: + * ``` + * $networksClient = new NetworksClient(); + * try { + * $network = 'network'; + * $project = 'project'; + * $response = $networksClient->getEffectiveFirewalls($network, $project); + * } finally { + * $networksClient->close(); + * } + * ``` + * + * @param string $network Name of the network for this request. + * @param string $project Project ID 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\NetworksGetEffectiveFirewallsResponse + * + * @throws ApiException if the remote call fails + */ + public function getEffectiveFirewalls($network, $project, array $optionalArgs = []) + { + $request = new GetEffectiveFirewallsNetworkRequest(); + $requestParamHeaders = []; + $request->setNetwork($network); + $request->setProject($project); + $requestParamHeaders['network'] = $network; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetEffectiveFirewalls', NetworksGetEffectiveFirewallsResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a network in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $networksClient = new NetworksClient(); + * try { + * $networkResource = new Network(); + * $project = 'project'; + * $operationResponse = $networksClient->insert($networkResource, $project); + * $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 = $networksClient->insert($networkResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networksClient->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 { + * $networksClient->close(); + * } + * ``` + * + * @param Network $networkResource The body resource for this request + * @param string $project Project ID 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($networkResource, $project, array $optionalArgs = []) + { + $request = new InsertNetworkRequest(); + $requestParamHeaders = []; + $request->setNetworkResource($networkResource); + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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 the list of networks available to the specified project. + * + * Sample code: + * ``` + * $networksClient = new NetworksClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $networksClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $networksClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $networksClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListNetworksRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, NetworkList::class, $request); + } + + /** + * Lists the peering routes exchanged over peering connection. + * + * Sample code: + * ``` + * $networksClient = new NetworksClient(); + * try { + * $network = 'network'; + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $networksClient->listPeeringRoutes($network, $project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $networksClient->listPeeringRoutes($network, $project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $networksClient->close(); + * } + * ``` + * + * @param string $network Name of the network for this request. + * @param string $project Project ID for this request. + * @param array $optionalArgs { + * Optional. + * + * @type string $direction + * The direction of the exchanged routes. + * Check the Direction enum for the list of possible values. + * @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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 string $peeringName + * The response will show routes exchanged over the given peering connection. + * @type string $region + * The region of the request. The response will include all subnet routes, static routes and dynamic routes in the region. + * @type bool $returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 listPeeringRoutes($network, $project, array $optionalArgs = []) + { + $request = new ListPeeringRoutesNetworksRequest(); + $requestParamHeaders = []; + $request->setNetwork($network); + $request->setProject($project); + $requestParamHeaders['network'] = $network; + $requestParamHeaders['project'] = $project; + if (isset($optionalArgs['direction'])) { + $request->setDirection($optionalArgs['direction']); + } + + 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['peeringName'])) { + $request->setPeeringName($optionalArgs['peeringName']); + } + + if (isset($optionalArgs['region'])) { + $request->setRegion($optionalArgs['region']); + } + + 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('ListPeeringRoutes', $optionalArgs, ExchangedPeeringRoutesList::class, $request); + } + + /** + * Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode. + * + * Sample code: + * ``` + * $networksClient = new NetworksClient(); + * try { + * $network = 'network'; + * $networkResource = new Network(); + * $project = 'project'; + * $operationResponse = $networksClient->patch($network, $networkResource, $project); + * $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 = $networksClient->patch($network, $networkResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networksClient->resumeOperation($operationName, 'patch'); + * 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 { + * $networksClient->close(); + * } + * ``` + * + * @param string $network Name of the network to update. + * @param Network $networkResource The body resource for this request + * @param string $project Project ID 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 patch($network, $networkResource, $project, array $optionalArgs = []) + { + $request = new PatchNetworkRequest(); + $requestParamHeaders = []; + $request->setNetwork($network); + $request->setNetworkResource($networkResource); + $request->setProject($project); + $requestParamHeaders['network'] = $network; + $requestParamHeaders['project'] = $project; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Removes a peering from the specified network. + * + * Sample code: + * ``` + * $networksClient = new NetworksClient(); + * try { + * $network = 'network'; + * $networksRemovePeeringRequestResource = new NetworksRemovePeeringRequest(); + * $project = 'project'; + * $operationResponse = $networksClient->removePeering($network, $networksRemovePeeringRequestResource, $project); + * $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 = $networksClient->removePeering($network, $networksRemovePeeringRequestResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networksClient->resumeOperation($operationName, 'removePeering'); + * 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 { + * $networksClient->close(); + * } + * ``` + * + * @param string $network Name of the network resource to remove peering from. + * @param NetworksRemovePeeringRequest $networksRemovePeeringRequestResource The body resource for this request + * @param string $project Project ID 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 removePeering($network, $networksRemovePeeringRequestResource, $project, array $optionalArgs = []) + { + $request = new RemovePeeringNetworkRequest(); + $requestParamHeaders = []; + $request->setNetwork($network); + $request->setNetworksRemovePeeringRequestResource($networksRemovePeeringRequestResource); + $request->setProject($project); + $requestParamHeaders['network'] = $network; + $requestParamHeaders['project'] = $project; + 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('RemovePeering', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Switches the network mode from auto subnet mode to custom subnet mode. + * + * Sample code: + * ``` + * $networksClient = new NetworksClient(); + * try { + * $network = 'network'; + * $project = 'project'; + * $operationResponse = $networksClient->switchToCustomMode($network, $project); + * $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 = $networksClient->switchToCustomMode($network, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networksClient->resumeOperation($operationName, 'switchToCustomMode'); + * 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 { + * $networksClient->close(); + * } + * ``` + * + * @param string $network Name of the network to be updated. + * @param string $project Project ID 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 switchToCustomMode($network, $project, array $optionalArgs = []) + { + $request = new SwitchToCustomModeNetworkRequest(); + $requestParamHeaders = []; + $request->setNetwork($network); + $request->setProject($project); + $requestParamHeaders['network'] = $network; + $requestParamHeaders['project'] = $project; + 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('SwitchToCustomMode', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Updates the specified network peering with the data included in the request. You can only modify the NetworkPeering.export_custom_routes field and the NetworkPeering.import_custom_routes field. + * + * Sample code: + * ``` + * $networksClient = new NetworksClient(); + * try { + * $network = 'network'; + * $networksUpdatePeeringRequestResource = new NetworksUpdatePeeringRequest(); + * $project = 'project'; + * $operationResponse = $networksClient->updatePeering($network, $networksUpdatePeeringRequestResource, $project); + * $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 = $networksClient->updatePeering($network, $networksUpdatePeeringRequestResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $networksClient->resumeOperation($operationName, 'updatePeering'); + * 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 { + * $networksClient->close(); + * } + * ``` + * + * @param string $network Name of the network resource which the updated peering is belonging to. + * @param NetworksUpdatePeeringRequest $networksUpdatePeeringRequestResource The body resource for this request + * @param string $project Project ID 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 updatePeering($network, $networksUpdatePeeringRequestResource, $project, array $optionalArgs = []) + { + $request = new UpdatePeeringNetworkRequest(); + $requestParamHeaders = []; + $request->setNetwork($network); + $request->setNetworksUpdatePeeringRequestResource($networksUpdatePeeringRequestResource); + $request->setProject($project); + $requestParamHeaders['network'] = $network; + $requestParamHeaders['project'] = $project; + 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('UpdatePeering', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/NodeGroupsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/NodeGroupsGapicClient.php new file mode 100644 index 000000000000..1e3cd9c4e2ae --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/NodeGroupsGapicClient.php @@ -0,0 +1,1385 @@ +addNodes($nodeGroup, $nodeGroupsAddNodesRequestResource, $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 = $nodeGroupsClient->addNodes($nodeGroup, $nodeGroupsAddNodesRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $nodeGroupsClient->resumeOperation($operationName, 'addNodes'); + * 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 { + * $nodeGroupsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\NodeGroupsClient}. + */ +class NodeGroupsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.NodeGroups'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/node_groups_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/node_groups_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/node_groups_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** + * Adds specified number of nodes to the node group. + * + * Sample code: + * ``` + * $nodeGroupsClient = new NodeGroupsClient(); + * try { + * $nodeGroup = 'node_group'; + * $nodeGroupsAddNodesRequestResource = new NodeGroupsAddNodesRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $nodeGroupsClient->addNodes($nodeGroup, $nodeGroupsAddNodesRequestResource, $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 = $nodeGroupsClient->addNodes($nodeGroup, $nodeGroupsAddNodesRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $nodeGroupsClient->resumeOperation($operationName, 'addNodes'); + * 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 { + * $nodeGroupsClient->close(); + * } + * ``` + * + * @param string $nodeGroup Name of the NodeGroup resource. + * @param NodeGroupsAddNodesRequest $nodeGroupsAddNodesRequestResource 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 addNodes($nodeGroup, $nodeGroupsAddNodesRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new AddNodesNodeGroupRequest(); + $requestParamHeaders = []; + $request->setNodeGroup($nodeGroup); + $request->setNodeGroupsAddNodesRequestResource($nodeGroupsAddNodesRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['node_group'] = $nodeGroup; + $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('AddNodes', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $nodeGroupsClient = new NodeGroupsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $nodeGroupsClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $nodeGroupsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $nodeGroupsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListNodeGroupsRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, NodeGroupAggregatedList::class, $request); + } + + /** + * Deletes the specified NodeGroup resource. + * + * Sample code: + * ``` + * $nodeGroupsClient = new NodeGroupsClient(); + * try { + * $nodeGroup = 'node_group'; + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $nodeGroupsClient->delete($nodeGroup, $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 = $nodeGroupsClient->delete($nodeGroup, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $nodeGroupsClient->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 { + * $nodeGroupsClient->close(); + * } + * ``` + * + * @param string $nodeGroup Name of the NodeGroup resource to delete. + * @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 delete($nodeGroup, $project, $zone, array $optionalArgs = []) + { + $request = new DeleteNodeGroupRequest(); + $requestParamHeaders = []; + $request->setNodeGroup($nodeGroup); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['node_group'] = $nodeGroup; + $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('Delete', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes specified nodes from the node group. + * + * Sample code: + * ``` + * $nodeGroupsClient = new NodeGroupsClient(); + * try { + * $nodeGroup = 'node_group'; + * $nodeGroupsDeleteNodesRequestResource = new NodeGroupsDeleteNodesRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $nodeGroupsClient->deleteNodes($nodeGroup, $nodeGroupsDeleteNodesRequestResource, $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 = $nodeGroupsClient->deleteNodes($nodeGroup, $nodeGroupsDeleteNodesRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $nodeGroupsClient->resumeOperation($operationName, 'deleteNodes'); + * 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 { + * $nodeGroupsClient->close(); + * } + * ``` + * + * @param string $nodeGroup Name of the NodeGroup resource whose nodes will be deleted. + * @param NodeGroupsDeleteNodesRequest $nodeGroupsDeleteNodesRequestResource 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 deleteNodes($nodeGroup, $nodeGroupsDeleteNodesRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new DeleteNodesNodeGroupRequest(); + $requestParamHeaders = []; + $request->setNodeGroup($nodeGroup); + $request->setNodeGroupsDeleteNodesRequestResource($nodeGroupsDeleteNodesRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['node_group'] = $nodeGroup; + $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('DeleteNodes', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns the specified NodeGroup. Get a list of available NodeGroups by making a list() request. Note: the "nodes" field should not be used. Use nodeGroups.listNodes instead. + * + * Sample code: + * ``` + * $nodeGroupsClient = new NodeGroupsClient(); + * try { + * $nodeGroup = 'node_group'; + * $project = 'project'; + * $zone = 'zone'; + * $response = $nodeGroupsClient->get($nodeGroup, $project, $zone); + * } finally { + * $nodeGroupsClient->close(); + * } + * ``` + * + * @param string $nodeGroup Name of the node group to return. + * @param string $project Project ID for this request. + * @param string $zone The name of the zone 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\NodeGroup + * + * @throws ApiException if the remote call fails + */ + public function get($nodeGroup, $project, $zone, array $optionalArgs = []) + { + $request = new GetNodeGroupRequest(); + $requestParamHeaders = []; + $request->setNodeGroup($nodeGroup); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['node_group'] = $nodeGroup; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', NodeGroup::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $nodeGroupsClient = new NodeGroupsClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $zone = 'zone'; + * $response = $nodeGroupsClient->getIamPolicy($project, $resource, $zone); + * } finally { + * $nodeGroupsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param string $zone The name of the zone for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $resource, $zone, array $optionalArgs = []) + { + $request = new GetIamPolicyNodeGroupRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParamHeaders['zone'] = $zone; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a NodeGroup resource in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $nodeGroupsClient = new NodeGroupsClient(); + * try { + * $initialNodeCount = 0; + * $nodeGroupResource = new NodeGroup(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $nodeGroupsClient->insert($initialNodeCount, $nodeGroupResource, $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 = $nodeGroupsClient->insert($initialNodeCount, $nodeGroupResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $nodeGroupsClient->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 { + * $nodeGroupsClient->close(); + * } + * ``` + * + * @param int $initialNodeCount Initial count of nodes in the node group. + * @param NodeGroup $nodeGroupResource 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 insert($initialNodeCount, $nodeGroupResource, $project, $zone, array $optionalArgs = []) + { + $request = new InsertNodeGroupRequest(); + $requestParamHeaders = []; + $request->setInitialNodeCount($initialNodeCount); + $request->setNodeGroupResource($nodeGroupResource); + $request->setProject($project); + $request->setZone($zone); + $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('Insert', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Retrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group. + * + * Sample code: + * ``` + * $nodeGroupsClient = new NodeGroupsClient(); + * try { + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $nodeGroupsClient->list($project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $nodeGroupsClient->list($project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $nodeGroupsClient->close(); + * } + * ``` + * + * @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 $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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, $zone, array $optionalArgs = []) + { + $request = new ListNodeGroupsRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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, NodeGroupList::class, $request); + } + + /** + * Lists nodes in the node group. + * + * Sample code: + * ``` + * $nodeGroupsClient = new NodeGroupsClient(); + * try { + * $nodeGroup = 'node_group'; + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $nodeGroupsClient->listNodes($nodeGroup, $project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $nodeGroupsClient->listNodes($nodeGroup, $project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $nodeGroupsClient->close(); + * } + * ``` + * + * @param string $nodeGroup Name of the NodeGroup resource whose nodes you want to list. + * @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 $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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 listNodes($nodeGroup, $project, $zone, array $optionalArgs = []) + { + $request = new ListNodesNodeGroupsRequest(); + $requestParamHeaders = []; + $request->setNodeGroup($nodeGroup); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['node_group'] = $nodeGroup; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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('ListNodes', $optionalArgs, NodeGroupsListNodes::class, $request); + } + + /** + * Updates the specified node group. + * + * Sample code: + * ``` + * $nodeGroupsClient = new NodeGroupsClient(); + * try { + * $nodeGroup = 'node_group'; + * $nodeGroupResource = new NodeGroup(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $nodeGroupsClient->patch($nodeGroup, $nodeGroupResource, $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 = $nodeGroupsClient->patch($nodeGroup, $nodeGroupResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $nodeGroupsClient->resumeOperation($operationName, 'patch'); + * 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 { + * $nodeGroupsClient->close(); + * } + * ``` + * + * @param string $nodeGroup Name of the NodeGroup resource to update. + * @param NodeGroup $nodeGroupResource 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 patch($nodeGroup, $nodeGroupResource, $project, $zone, array $optionalArgs = []) + { + $request = new PatchNodeGroupRequest(); + $requestParamHeaders = []; + $request->setNodeGroup($nodeGroup); + $request->setNodeGroupResource($nodeGroupResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['node_group'] = $nodeGroup; + $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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Perform maintenance on a subset of nodes in the node group. + * + * Sample code: + * ``` + * $nodeGroupsClient = new NodeGroupsClient(); + * try { + * $nodeGroup = 'node_group'; + * $nodeGroupsPerformMaintenanceRequestResource = new NodeGroupsPerformMaintenanceRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $nodeGroupsClient->performMaintenance($nodeGroup, $nodeGroupsPerformMaintenanceRequestResource, $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 = $nodeGroupsClient->performMaintenance($nodeGroup, $nodeGroupsPerformMaintenanceRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $nodeGroupsClient->resumeOperation($operationName, 'performMaintenance'); + * 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 { + * $nodeGroupsClient->close(); + * } + * ``` + * + * @param string $nodeGroup Name of the node group scoping this request. + * @param NodeGroupsPerformMaintenanceRequest $nodeGroupsPerformMaintenanceRequestResource 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 performMaintenance($nodeGroup, $nodeGroupsPerformMaintenanceRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new PerformMaintenanceNodeGroupRequest(); + $requestParamHeaders = []; + $request->setNodeGroup($nodeGroup); + $request->setNodeGroupsPerformMaintenanceRequestResource($nodeGroupsPerformMaintenanceRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['node_group'] = $nodeGroup; + $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('PerformMaintenance', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $nodeGroupsClient = new NodeGroupsClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $zone = 'zone'; + * $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + * $response = $nodeGroupsClient->setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource); + * } finally { + * $nodeGroupsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param string $zone The name of the zone for this request. + * @param ZoneSetPolicyRequest $zoneSetPolicyRequestResource The body resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource, array $optionalArgs = []) + { + $request = new SetIamPolicyNodeGroupRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setZone($zone); + $request->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates the node template of the node group. + * + * Sample code: + * ``` + * $nodeGroupsClient = new NodeGroupsClient(); + * try { + * $nodeGroup = 'node_group'; + * $nodeGroupsSetNodeTemplateRequestResource = new NodeGroupsSetNodeTemplateRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $nodeGroupsClient->setNodeTemplate($nodeGroup, $nodeGroupsSetNodeTemplateRequestResource, $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 = $nodeGroupsClient->setNodeTemplate($nodeGroup, $nodeGroupsSetNodeTemplateRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $nodeGroupsClient->resumeOperation($operationName, 'setNodeTemplate'); + * 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 { + * $nodeGroupsClient->close(); + * } + * ``` + * + * @param string $nodeGroup Name of the NodeGroup resource to update. + * @param NodeGroupsSetNodeTemplateRequest $nodeGroupsSetNodeTemplateRequestResource 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 setNodeTemplate($nodeGroup, $nodeGroupsSetNodeTemplateRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new SetNodeTemplateNodeGroupRequest(); + $requestParamHeaders = []; + $request->setNodeGroup($nodeGroup); + $request->setNodeGroupsSetNodeTemplateRequestResource($nodeGroupsSetNodeTemplateRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['node_group'] = $nodeGroup; + $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('SetNodeTemplate', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Simulates maintenance event on specified nodes from the node group. + * + * Sample code: + * ``` + * $nodeGroupsClient = new NodeGroupsClient(); + * try { + * $nodeGroup = 'node_group'; + * $nodeGroupsSimulateMaintenanceEventRequestResource = new NodeGroupsSimulateMaintenanceEventRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $nodeGroupsClient->simulateMaintenanceEvent($nodeGroup, $nodeGroupsSimulateMaintenanceEventRequestResource, $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 = $nodeGroupsClient->simulateMaintenanceEvent($nodeGroup, $nodeGroupsSimulateMaintenanceEventRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $nodeGroupsClient->resumeOperation($operationName, 'simulateMaintenanceEvent'); + * 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 { + * $nodeGroupsClient->close(); + * } + * ``` + * + * @param string $nodeGroup Name of the NodeGroup resource whose nodes will go under maintenance simulation. + * @param NodeGroupsSimulateMaintenanceEventRequest $nodeGroupsSimulateMaintenanceEventRequestResource 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 simulateMaintenanceEvent($nodeGroup, $nodeGroupsSimulateMaintenanceEventRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new SimulateMaintenanceEventNodeGroupRequest(); + $requestParamHeaders = []; + $request->setNodeGroup($nodeGroup); + $request->setNodeGroupsSimulateMaintenanceEventRequestResource($nodeGroupsSimulateMaintenanceEventRequestResource); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['node_group'] = $nodeGroup; + $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('SimulateMaintenanceEvent', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $nodeGroupsClient = new NodeGroupsClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $zone = 'zone'; + * $response = $nodeGroupsClient->testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone); + * } finally { + * $nodeGroupsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * @param string $zone The name of the zone 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone, array $optionalArgs = []) + { + $request = new TestIamPermissionsNodeGroupRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/NodeTemplatesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/NodeTemplatesGapicClient.php new file mode 100644 index 000000000000..7f069021b8fe --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/NodeTemplatesGapicClient.php @@ -0,0 +1,789 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $nodeTemplatesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $nodeTemplatesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\NodeTemplatesClient}. + */ +class NodeTemplatesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.NodeTemplates'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/node_templates_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/node_templates_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/node_templates_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Retrieves an aggregated list of node templates. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $nodeTemplatesClient = new NodeTemplatesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $nodeTemplatesClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $nodeTemplatesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $nodeTemplatesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListNodeTemplatesRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, NodeTemplateAggregatedList::class, $request); + } + + /** + * Deletes the specified NodeTemplate resource. + * + * Sample code: + * ``` + * $nodeTemplatesClient = new NodeTemplatesClient(); + * try { + * $nodeTemplate = 'node_template'; + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $nodeTemplatesClient->delete($nodeTemplate, $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 = $nodeTemplatesClient->delete($nodeTemplate, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $nodeTemplatesClient->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 { + * $nodeTemplatesClient->close(); + * } + * ``` + * + * @param string $nodeTemplate Name of the NodeTemplate resource 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($nodeTemplate, $project, $region, array $optionalArgs = []) + { + $request = new DeleteNodeTemplateRequest(); + $requestParamHeaders = []; + $request->setNodeTemplate($nodeTemplate); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['node_template'] = $nodeTemplate; + $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 node template. + * + * Sample code: + * ``` + * $nodeTemplatesClient = new NodeTemplatesClient(); + * try { + * $nodeTemplate = 'node_template'; + * $project = 'project'; + * $region = 'region'; + * $response = $nodeTemplatesClient->get($nodeTemplate, $project, $region); + * } finally { + * $nodeTemplatesClient->close(); + * } + * ``` + * + * @param string $nodeTemplate Name of the node template to return. + * @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\NodeTemplate + * + * @throws ApiException if the remote call fails + */ + public function get($nodeTemplate, $project, $region, array $optionalArgs = []) + { + $request = new GetNodeTemplateRequest(); + $requestParamHeaders = []; + $request->setNodeTemplate($nodeTemplate); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['node_template'] = $nodeTemplate; + $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', NodeTemplate::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $nodeTemplatesClient = new NodeTemplatesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resource = 'resource'; + * $response = $nodeTemplatesClient->getIamPolicy($project, $region, $resource); + * } finally { + * $nodeTemplatesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $region, $resource, array $optionalArgs = []) + { + $request = new GetIamPolicyNodeTemplateRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a NodeTemplate resource in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $nodeTemplatesClient = new NodeTemplatesClient(); + * try { + * $nodeTemplateResource = new NodeTemplate(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $nodeTemplatesClient->insert($nodeTemplateResource, $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 = $nodeTemplatesClient->insert($nodeTemplateResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $nodeTemplatesClient->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 { + * $nodeTemplatesClient->close(); + * } + * ``` + * + * @param NodeTemplate $nodeTemplateResource 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($nodeTemplateResource, $project, $region, array $optionalArgs = []) + { + $request = new InsertNodeTemplateRequest(); + $requestParamHeaders = []; + $request->setNodeTemplateResource($nodeTemplateResource); + $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 node templates available to the specified project. + * + * Sample code: + * ``` + * $nodeTemplatesClient = new NodeTemplatesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $nodeTemplatesClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $nodeTemplatesClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $nodeTemplatesClient->close(); + * } + * ``` + * + * @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 $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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListNodeTemplatesRequest(); + $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, NodeTemplateList::class, $request); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $nodeTemplatesClient = new NodeTemplatesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + * $resource = 'resource'; + * $response = $nodeTemplatesClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + * } finally { + * $nodeTemplatesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param RegionSetPolicyRequest $regionSetPolicyRequestResource The body resource for this request + * @param string $resource Name or id of the resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource, array $optionalArgs = []) + { + $request = new SetIamPolicyNodeTemplateRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $nodeTemplatesClient = new NodeTemplatesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $response = $nodeTemplatesClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + * } finally { + * $nodeTemplatesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $region, $resource, $testPermissionsRequestResource, array $optionalArgs = []) + { + $request = new TestIamPermissionsNodeTemplateRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/NodeTypesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/NodeTypesGapicClient.php new file mode 100644 index 000000000000..307f926bb71d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/NodeTypesGapicClient.php @@ -0,0 +1,422 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $nodeTypesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $nodeTypesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\NodeTypesClient}. + */ +class NodeTypesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.NodeTypes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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.readonly', + 'https://www.googleapis.com/auth/compute', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/node_types_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/node_types_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/node_types_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** + * Retrieves an aggregated list of node types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $nodeTypesClient = new NodeTypesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $nodeTypesClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $nodeTypesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $nodeTypesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListNodeTypesRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, NodeTypeAggregatedList::class, $request); + } + + /** + * Returns the specified node type. + * + * Sample code: + * ``` + * $nodeTypesClient = new NodeTypesClient(); + * try { + * $nodeType = 'node_type'; + * $project = 'project'; + * $zone = 'zone'; + * $response = $nodeTypesClient->get($nodeType, $project, $zone); + * } finally { + * $nodeTypesClient->close(); + * } + * ``` + * + * @param string $nodeType Name of the node type to return. + * @param string $project Project ID for this request. + * @param string $zone The name of the zone 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\NodeType + * + * @throws ApiException if the remote call fails + */ + public function get($nodeType, $project, $zone, array $optionalArgs = []) + { + $request = new GetNodeTypeRequest(); + $requestParamHeaders = []; + $request->setNodeType($nodeType); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['node_type'] = $nodeType; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', NodeType::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves a list of node types available to the specified project. + * + * Sample code: + * ``` + * $nodeTypesClient = new NodeTypesClient(); + * try { + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $nodeTypesClient->list($project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $nodeTypesClient->list($project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $nodeTypesClient->close(); + * } + * ``` + * + * @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 $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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, $zone, array $optionalArgs = []) + { + $request = new ListNodeTypesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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, NodeTypeList::class, $request); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/PacketMirroringsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/PacketMirroringsGapicClient.php new file mode 100644 index 000000000000..d9ce5b932d63 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/PacketMirroringsGapicClient.php @@ -0,0 +1,762 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $packetMirroringsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $packetMirroringsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\PacketMirroringsClient}. + */ +class PacketMirroringsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.PacketMirrorings'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/packet_mirrorings_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/packet_mirrorings_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/packet_mirrorings_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Retrieves an aggregated list of packetMirrorings. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $packetMirroringsClient = new PacketMirroringsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $packetMirroringsClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $packetMirroringsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $packetMirroringsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListPacketMirroringsRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, PacketMirroringAggregatedList::class, $request); + } + + /** + * Deletes the specified PacketMirroring resource. + * + * Sample code: + * ``` + * $packetMirroringsClient = new PacketMirroringsClient(); + * try { + * $packetMirroring = 'packet_mirroring'; + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $packetMirroringsClient->delete($packetMirroring, $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 = $packetMirroringsClient->delete($packetMirroring, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $packetMirroringsClient->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 { + * $packetMirroringsClient->close(); + * } + * ``` + * + * @param string $packetMirroring Name of the PacketMirroring resource to delete. + * @param string $project Project ID for this request. + * @param string $region 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($packetMirroring, $project, $region, array $optionalArgs = []) + { + $request = new DeletePacketMirroringRequest(); + $requestParamHeaders = []; + $request->setPacketMirroring($packetMirroring); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['packet_mirroring'] = $packetMirroring; + $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 PacketMirroring resource. + * + * Sample code: + * ``` + * $packetMirroringsClient = new PacketMirroringsClient(); + * try { + * $packetMirroring = 'packet_mirroring'; + * $project = 'project'; + * $region = 'region'; + * $response = $packetMirroringsClient->get($packetMirroring, $project, $region); + * } finally { + * $packetMirroringsClient->close(); + * } + * ``` + * + * @param string $packetMirroring Name of the PacketMirroring resource to return. + * @param string $project Project ID for this request. + * @param string $region 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\PacketMirroring + * + * @throws ApiException if the remote call fails + */ + public function get($packetMirroring, $project, $region, array $optionalArgs = []) + { + $request = new GetPacketMirroringRequest(); + $requestParamHeaders = []; + $request->setPacketMirroring($packetMirroring); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['packet_mirroring'] = $packetMirroring; + $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', PacketMirroring::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a PacketMirroring resource in the specified project and region using the data included in the request. + * + * Sample code: + * ``` + * $packetMirroringsClient = new PacketMirroringsClient(); + * try { + * $packetMirroringResource = new PacketMirroring(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $packetMirroringsClient->insert($packetMirroringResource, $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 = $packetMirroringsClient->insert($packetMirroringResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $packetMirroringsClient->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 { + * $packetMirroringsClient->close(); + * } + * ``` + * + * @param PacketMirroring $packetMirroringResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region 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($packetMirroringResource, $project, $region, array $optionalArgs = []) + { + $request = new InsertPacketMirroringRequest(); + $requestParamHeaders = []; + $request->setPacketMirroringResource($packetMirroringResource); + $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 PacketMirroring resources available to the specified project and region. + * + * Sample code: + * ``` + * $packetMirroringsClient = new PacketMirroringsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $packetMirroringsClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $packetMirroringsClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $packetMirroringsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListPacketMirroringsRequest(); + $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, PacketMirroringList::class, $request); + } + + /** + * Patches the specified PacketMirroring resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $packetMirroringsClient = new PacketMirroringsClient(); + * try { + * $packetMirroring = 'packet_mirroring'; + * $packetMirroringResource = new PacketMirroring(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $packetMirroringsClient->patch($packetMirroring, $packetMirroringResource, $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 = $packetMirroringsClient->patch($packetMirroring, $packetMirroringResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $packetMirroringsClient->resumeOperation($operationName, 'patch'); + * 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 { + * $packetMirroringsClient->close(); + * } + * ``` + * + * @param string $packetMirroring Name of the PacketMirroring resource to patch. + * @param PacketMirroring $packetMirroringResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region 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 patch($packetMirroring, $packetMirroringResource, $project, $region, array $optionalArgs = []) + { + $request = new PatchPacketMirroringRequest(); + $requestParamHeaders = []; + $request->setPacketMirroring($packetMirroring); + $request->setPacketMirroringResource($packetMirroringResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['packet_mirroring'] = $packetMirroring; + $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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $packetMirroringsClient = new PacketMirroringsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $response = $packetMirroringsClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + * } finally { + * $packetMirroringsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $region, $resource, $testPermissionsRequestResource, array $optionalArgs = []) + { + $request = new TestIamPermissionsPacketMirroringRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/ProjectsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/ProjectsGapicClient.php new file mode 100644 index 000000000000..be468efc1a77 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/ProjectsGapicClient.php @@ -0,0 +1,1228 @@ +disableXpnHost($project); + * $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 = $projectsClient->disableXpnHost($project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'disableXpnHost'); + * 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 { + * $projectsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\ProjectsClient}. + */ +class ProjectsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.Projects'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/projects_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/projects_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/projects_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** + * Disable this project as a shared VPC host project. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $project = 'project'; + * $operationResponse = $projectsClient->disableXpnHost($project); + * $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 = $projectsClient->disableXpnHost($project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'disableXpnHost'); + * 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 { + * $projectsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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 disableXpnHost($project, array $optionalArgs = []) + { + $request = new DisableXpnHostProjectRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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('DisableXpnHost', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Disable a service resource (also known as service project) associated with this host project. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $project = 'project'; + * $projectsDisableXpnResourceRequestResource = new ProjectsDisableXpnResourceRequest(); + * $operationResponse = $projectsClient->disableXpnResource($project, $projectsDisableXpnResourceRequestResource); + * $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 = $projectsClient->disableXpnResource($project, $projectsDisableXpnResourceRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'disableXpnResource'); + * 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 { + * $projectsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param ProjectsDisableXpnResourceRequest $projectsDisableXpnResourceRequestResource The body resource 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 disableXpnResource($project, $projectsDisableXpnResourceRequestResource, array $optionalArgs = []) + { + $request = new DisableXpnResourceProjectRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setProjectsDisableXpnResourceRequestResource($projectsDisableXpnResourceRequestResource); + $requestParamHeaders['project'] = $project; + 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('DisableXpnResource', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Enable this project as a shared VPC host project. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $project = 'project'; + * $operationResponse = $projectsClient->enableXpnHost($project); + * $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 = $projectsClient->enableXpnHost($project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'enableXpnHost'); + * 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 { + * $projectsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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 enableXpnHost($project, array $optionalArgs = []) + { + $request = new EnableXpnHostProjectRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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('EnableXpnHost', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $project = 'project'; + * $projectsEnableXpnResourceRequestResource = new ProjectsEnableXpnResourceRequest(); + * $operationResponse = $projectsClient->enableXpnResource($project, $projectsEnableXpnResourceRequestResource); + * $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 = $projectsClient->enableXpnResource($project, $projectsEnableXpnResourceRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'enableXpnResource'); + * 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 { + * $projectsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param ProjectsEnableXpnResourceRequest $projectsEnableXpnResourceRequestResource The body resource 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 enableXpnResource($project, $projectsEnableXpnResourceRequestResource, array $optionalArgs = []) + { + $request = new EnableXpnResourceProjectRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setProjectsEnableXpnResourceRequestResource($projectsEnableXpnResourceRequestResource); + $requestParamHeaders['project'] = $project; + 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('EnableXpnResource', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns the specified Project 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: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $project = 'project'; + * $response = $projectsClient->get($project); + * } finally { + * $projectsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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\Project + * + * @throws ApiException if the remote call fails + */ + public function get($project, array $optionalArgs = []) + { + $request = new GetProjectRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', Project::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the shared VPC host project that this project links to. May be empty if no link exists. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $project = 'project'; + * $response = $projectsClient->getXpnHost($project); + * } finally { + * $projectsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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\Project + * + * @throws ApiException if the remote call fails + */ + public function getXpnHost($project, array $optionalArgs = []) + { + $request = new GetXpnHostProjectRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetXpnHost', Project::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets service resources (a.k.a service project) associated with this host project. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $projectsClient->getXpnResources($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $projectsClient->getXpnResources($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $projectsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 getXpnResources($project, array $optionalArgs = []) + { + $request = new GetXpnResourcesProjectsRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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('GetXpnResources', $optionalArgs, ProjectsGetXpnResources::class, $request); + } + + /** + * Lists all shared VPC host projects visible to the user in an organization. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $project = 'project'; + * $projectsListXpnHostsRequestResource = new ProjectsListXpnHostsRequest(); + * // Iterate over pages of elements + * $pagedResponse = $projectsClient->listXpnHosts($project, $projectsListXpnHostsRequestResource); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $projectsClient->listXpnHosts($project, $projectsListXpnHostsRequestResource); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $projectsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param ProjectsListXpnHostsRequest $projectsListXpnHostsRequestResource The body resource 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 listXpnHosts($project, $projectsListXpnHostsRequestResource, array $optionalArgs = []) + { + $request = new ListXpnHostsProjectsRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setProjectsListXpnHostsRequestResource($projectsListXpnHostsRequestResource); + $requestParamHeaders['project'] = $project; + 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('ListXpnHosts', $optionalArgs, XpnHostList::class, $request); + } + + /** + * Moves a persistent disk from one zone to another. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $diskMoveRequestResource = new DiskMoveRequest(); + * $project = 'project'; + * $operationResponse = $projectsClient->moveDisk($diskMoveRequestResource, $project); + * $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 = $projectsClient->moveDisk($diskMoveRequestResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'moveDisk'); + * 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 { + * $projectsClient->close(); + * } + * ``` + * + * @param DiskMoveRequest $diskMoveRequestResource The body resource for this request + * @param string $project Project ID 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 moveDisk($diskMoveRequestResource, $project, array $optionalArgs = []) + { + $request = new MoveDiskProjectRequest(); + $requestParamHeaders = []; + $request->setDiskMoveRequestResource($diskMoveRequestResource); + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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('MoveDisk', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Moves an instance and its attached persistent disks from one zone to another. *Note*: Moving VMs or disks by using this method might cause unexpected behavior. For more information, see the [known issue](/compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_moveinstance_api_or_the_causes_unexpected_behavior). [Deprecated] This method is deprecated. See [moving instance across zones](/compute/docs/instances/moving-instance-across-zones) instead. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $instanceMoveRequestResource = new InstanceMoveRequest(); + * $project = 'project'; + * $operationResponse = $projectsClient->moveInstance($instanceMoveRequestResource, $project); + * $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 = $projectsClient->moveInstance($instanceMoveRequestResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'moveInstance'); + * 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 { + * $projectsClient->close(); + * } + * ``` + * + * @param InstanceMoveRequest $instanceMoveRequestResource The body resource for this request + * @param string $project Project ID 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 moveInstance($instanceMoveRequestResource, $project, array $optionalArgs = []) + { + $request = new MoveInstanceProjectRequest(); + $requestParamHeaders = []; + $request->setInstanceMoveRequestResource($instanceMoveRequestResource); + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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('MoveInstance', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the Cloud Armor tier of the project. To set ENTERPRISE or above the billing account of the project must be subscribed to Cloud Armor Enterprise. See Subscribing to Cloud Armor Enterprise for more information. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $project = 'project'; + * $projectsSetCloudArmorTierRequestResource = new ProjectsSetCloudArmorTierRequest(); + * $operationResponse = $projectsClient->setCloudArmorTier($project, $projectsSetCloudArmorTierRequestResource); + * $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 = $projectsClient->setCloudArmorTier($project, $projectsSetCloudArmorTierRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'setCloudArmorTier'); + * 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 { + * $projectsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param ProjectsSetCloudArmorTierRequest $projectsSetCloudArmorTierRequestResource The body resource 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 setCloudArmorTier($project, $projectsSetCloudArmorTierRequestResource, array $optionalArgs = []) + { + $request = new SetCloudArmorTierProjectRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setProjectsSetCloudArmorTierRequestResource($projectsSetCloudArmorTierRequestResource); + $requestParamHeaders['project'] = $project; + 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('SetCloudArmorTier', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets metadata common to all instances within the specified project using the data included in the request. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $metadataResource = new Metadata(); + * $project = 'project'; + * $operationResponse = $projectsClient->setCommonInstanceMetadata($metadataResource, $project); + * $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 = $projectsClient->setCommonInstanceMetadata($metadataResource, $project); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'setCommonInstanceMetadata'); + * 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 { + * $projectsClient->close(); + * } + * ``` + * + * @param Metadata $metadataResource The body resource for this request + * @param string $project Project ID 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 setCommonInstanceMetadata($metadataResource, $project, array $optionalArgs = []) + { + $request = new SetCommonInstanceMetadataProjectRequest(); + $requestParamHeaders = []; + $request->setMetadataResource($metadataResource); + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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('SetCommonInstanceMetadata', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $project = 'project'; + * $projectsSetDefaultNetworkTierRequestResource = new ProjectsSetDefaultNetworkTierRequest(); + * $operationResponse = $projectsClient->setDefaultNetworkTier($project, $projectsSetDefaultNetworkTierRequestResource); + * $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 = $projectsClient->setDefaultNetworkTier($project, $projectsSetDefaultNetworkTierRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'setDefaultNetworkTier'); + * 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 { + * $projectsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param ProjectsSetDefaultNetworkTierRequest $projectsSetDefaultNetworkTierRequestResource The body resource 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 setDefaultNetworkTier($project, $projectsSetDefaultNetworkTierRequestResource, array $optionalArgs = []) + { + $request = new SetDefaultNetworkTierProjectRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setProjectsSetDefaultNetworkTierRequestResource($projectsSetDefaultNetworkTierRequestResource); + $requestParamHeaders['project'] = $project; + 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('SetDefaultNetworkTier', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled. + * + * Sample code: + * ``` + * $projectsClient = new ProjectsClient(); + * try { + * $project = 'project'; + * $usageExportLocationResource = new UsageExportLocation(); + * $operationResponse = $projectsClient->setUsageExportBucket($project, $usageExportLocationResource); + * $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 = $projectsClient->setUsageExportBucket($project, $usageExportLocationResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $projectsClient->resumeOperation($operationName, 'setUsageExportBucket'); + * 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 { + * $projectsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param UsageExportLocation $usageExportLocationResource The body resource 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 setUsageExportBucket($project, $usageExportLocationResource, array $optionalArgs = []) + { + $request = new SetUsageExportBucketProjectRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setUsageExportLocationResource($usageExportLocationResource); + $requestParamHeaders['project'] = $project; + 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('SetUsageExportBucket', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/PublicAdvertisedPrefixesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/PublicAdvertisedPrefixesGapicClient.php new file mode 100644 index 000000000000..41dd99aaae54 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/PublicAdvertisedPrefixesGapicClient.php @@ -0,0 +1,748 @@ +announce($project, $publicAdvertisedPrefix); + * $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 = $publicAdvertisedPrefixesClient->announce($project, $publicAdvertisedPrefix); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $publicAdvertisedPrefixesClient->resumeOperation($operationName, 'announce'); + * 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 { + * $publicAdvertisedPrefixesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\PublicAdvertisedPrefixesClient}. + */ +class PublicAdvertisedPrefixesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.PublicAdvertisedPrefixes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/public_advertised_prefixes_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/public_advertised_prefixes_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/public_advertised_prefixes_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** + * Announces the specified PublicAdvertisedPrefix + * + * Sample code: + * ``` + * $publicAdvertisedPrefixesClient = new PublicAdvertisedPrefixesClient(); + * try { + * $project = 'project'; + * $publicAdvertisedPrefix = 'public_advertised_prefix'; + * $operationResponse = $publicAdvertisedPrefixesClient->announce($project, $publicAdvertisedPrefix); + * $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 = $publicAdvertisedPrefixesClient->announce($project, $publicAdvertisedPrefix); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $publicAdvertisedPrefixesClient->resumeOperation($operationName, 'announce'); + * 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 { + * $publicAdvertisedPrefixesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $publicAdvertisedPrefix The name of the public advertised prefix. It should comply with RFC1035. + * @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 announce($project, $publicAdvertisedPrefix, array $optionalArgs = []) + { + $request = new AnnouncePublicAdvertisedPrefixeRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['public_advertised_prefix'] = $publicAdvertisedPrefix; + 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('Announce', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes the specified PublicAdvertisedPrefix + * + * Sample code: + * ``` + * $publicAdvertisedPrefixesClient = new PublicAdvertisedPrefixesClient(); + * try { + * $project = 'project'; + * $publicAdvertisedPrefix = 'public_advertised_prefix'; + * $operationResponse = $publicAdvertisedPrefixesClient->delete($project, $publicAdvertisedPrefix); + * $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 = $publicAdvertisedPrefixesClient->delete($project, $publicAdvertisedPrefix); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $publicAdvertisedPrefixesClient->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 { + * $publicAdvertisedPrefixesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $publicAdvertisedPrefix Name of the PublicAdvertisedPrefix resource to delete. + * @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($project, $publicAdvertisedPrefix, array $optionalArgs = []) + { + $request = new DeletePublicAdvertisedPrefixeRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['public_advertised_prefix'] = $publicAdvertisedPrefix; + 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 PublicAdvertisedPrefix resource. + * + * Sample code: + * ``` + * $publicAdvertisedPrefixesClient = new PublicAdvertisedPrefixesClient(); + * try { + * $project = 'project'; + * $publicAdvertisedPrefix = 'public_advertised_prefix'; + * $response = $publicAdvertisedPrefixesClient->get($project, $publicAdvertisedPrefix); + * } finally { + * $publicAdvertisedPrefixesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $publicAdvertisedPrefix Name of the PublicAdvertisedPrefix resource to return. + * @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\PublicAdvertisedPrefix + * + * @throws ApiException if the remote call fails + */ + public function get($project, $publicAdvertisedPrefix, array $optionalArgs = []) + { + $request = new GetPublicAdvertisedPrefixeRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['public_advertised_prefix'] = $publicAdvertisedPrefix; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', PublicAdvertisedPrefix::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a PublicAdvertisedPrefix in the specified project using the parameters that are included in the request. + * + * Sample code: + * ``` + * $publicAdvertisedPrefixesClient = new PublicAdvertisedPrefixesClient(); + * try { + * $project = 'project'; + * $publicAdvertisedPrefixResource = new PublicAdvertisedPrefix(); + * $operationResponse = $publicAdvertisedPrefixesClient->insert($project, $publicAdvertisedPrefixResource); + * $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 = $publicAdvertisedPrefixesClient->insert($project, $publicAdvertisedPrefixResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $publicAdvertisedPrefixesClient->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 { + * $publicAdvertisedPrefixesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param PublicAdvertisedPrefix $publicAdvertisedPrefixResource The body resource 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($project, $publicAdvertisedPrefixResource, array $optionalArgs = []) + { + $request = new InsertPublicAdvertisedPrefixeRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setPublicAdvertisedPrefixResource($publicAdvertisedPrefixResource); + $requestParamHeaders['project'] = $project; + 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(); + } + + /** + * Lists the PublicAdvertisedPrefixes for a project. + * + * Sample code: + * ``` + * $publicAdvertisedPrefixesClient = new PublicAdvertisedPrefixesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $publicAdvertisedPrefixesClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $publicAdvertisedPrefixesClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $publicAdvertisedPrefixesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListPublicAdvertisedPrefixesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, PublicAdvertisedPrefixList::class, $request); + } + + /** + * Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $publicAdvertisedPrefixesClient = new PublicAdvertisedPrefixesClient(); + * try { + * $project = 'project'; + * $publicAdvertisedPrefix = 'public_advertised_prefix'; + * $publicAdvertisedPrefixResource = new PublicAdvertisedPrefix(); + * $operationResponse = $publicAdvertisedPrefixesClient->patch($project, $publicAdvertisedPrefix, $publicAdvertisedPrefixResource); + * $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 = $publicAdvertisedPrefixesClient->patch($project, $publicAdvertisedPrefix, $publicAdvertisedPrefixResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $publicAdvertisedPrefixesClient->resumeOperation($operationName, 'patch'); + * 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 { + * $publicAdvertisedPrefixesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $publicAdvertisedPrefix Name of the PublicAdvertisedPrefix resource to patch. + * @param PublicAdvertisedPrefix $publicAdvertisedPrefixResource The body resource 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 patch($project, $publicAdvertisedPrefix, $publicAdvertisedPrefixResource, array $optionalArgs = []) + { + $request = new PatchPublicAdvertisedPrefixeRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + $request->setPublicAdvertisedPrefixResource($publicAdvertisedPrefixResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['public_advertised_prefix'] = $publicAdvertisedPrefix; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Withdraws the specified PublicAdvertisedPrefix + * + * Sample code: + * ``` + * $publicAdvertisedPrefixesClient = new PublicAdvertisedPrefixesClient(); + * try { + * $project = 'project'; + * $publicAdvertisedPrefix = 'public_advertised_prefix'; + * $operationResponse = $publicAdvertisedPrefixesClient->withdraw($project, $publicAdvertisedPrefix); + * $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 = $publicAdvertisedPrefixesClient->withdraw($project, $publicAdvertisedPrefix); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $publicAdvertisedPrefixesClient->resumeOperation($operationName, 'withdraw'); + * 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 { + * $publicAdvertisedPrefixesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $publicAdvertisedPrefix The name of the public advertised prefix. It should comply with RFC1035. + * @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 withdraw($project, $publicAdvertisedPrefix, array $optionalArgs = []) + { + $request = new WithdrawPublicAdvertisedPrefixeRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['public_advertised_prefix'] = $publicAdvertisedPrefix; + 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('Withdraw', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/PublicDelegatedPrefixesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/PublicDelegatedPrefixesGapicClient.php new file mode 100644 index 000000000000..9b41b7bee72e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/PublicDelegatedPrefixesGapicClient.php @@ -0,0 +1,863 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $publicDelegatedPrefixesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $publicDelegatedPrefixesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\PublicDelegatedPrefixesClient}. + */ +class PublicDelegatedPrefixesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.PublicDelegatedPrefixes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/public_delegated_prefixes_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/public_delegated_prefixes_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/public_delegated_prefixes_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Lists all PublicDelegatedPrefix resources owned by the specific project across all scopes. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $publicDelegatedPrefixesClient = new PublicDelegatedPrefixesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $publicDelegatedPrefixesClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $publicDelegatedPrefixesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $publicDelegatedPrefixesClient->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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListPublicDelegatedPrefixesRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, PublicDelegatedPrefixAggregatedList::class, $request); + } + + /** + * Announces the specified PublicDelegatedPrefix in the given region. + * + * Sample code: + * ``` + * $publicDelegatedPrefixesClient = new PublicDelegatedPrefixesClient(); + * try { + * $project = 'project'; + * $publicDelegatedPrefix = 'public_delegated_prefix'; + * $region = 'region'; + * $operationResponse = $publicDelegatedPrefixesClient->announce($project, $publicDelegatedPrefix, $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 = $publicDelegatedPrefixesClient->announce($project, $publicDelegatedPrefix, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $publicDelegatedPrefixesClient->resumeOperation($operationName, 'announce'); + * 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 { + * $publicDelegatedPrefixesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $publicDelegatedPrefix The name of the public delegated prefix. It should comply with RFC1035. + * @param string $region The name of the region where the public delegated prefix is located. It should comply with RFC1035. + * @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 announce($project, $publicDelegatedPrefix, $region, array $optionalArgs = []) + { + $request = new AnnouncePublicDelegatedPrefixeRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setPublicDelegatedPrefix($publicDelegatedPrefix); + $request->setRegion($region); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['public_delegated_prefix'] = $publicDelegatedPrefix; + $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('Announce', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes the specified PublicDelegatedPrefix in the given region. + * + * Sample code: + * ``` + * $publicDelegatedPrefixesClient = new PublicDelegatedPrefixesClient(); + * try { + * $project = 'project'; + * $publicDelegatedPrefix = 'public_delegated_prefix'; + * $region = 'region'; + * $operationResponse = $publicDelegatedPrefixesClient->delete($project, $publicDelegatedPrefix, $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 = $publicDelegatedPrefixesClient->delete($project, $publicDelegatedPrefix, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $publicDelegatedPrefixesClient->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 { + * $publicDelegatedPrefixesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $publicDelegatedPrefix Name of the PublicDelegatedPrefix resource to delete. + * @param string $region Name of the region of 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($project, $publicDelegatedPrefix, $region, array $optionalArgs = []) + { + $request = new DeletePublicDelegatedPrefixeRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setPublicDelegatedPrefix($publicDelegatedPrefix); + $request->setRegion($region); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['public_delegated_prefix'] = $publicDelegatedPrefix; + $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 PublicDelegatedPrefix resource in the given region. + * + * Sample code: + * ``` + * $publicDelegatedPrefixesClient = new PublicDelegatedPrefixesClient(); + * try { + * $project = 'project'; + * $publicDelegatedPrefix = 'public_delegated_prefix'; + * $region = 'region'; + * $response = $publicDelegatedPrefixesClient->get($project, $publicDelegatedPrefix, $region); + * } finally { + * $publicDelegatedPrefixesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $publicDelegatedPrefix Name of the PublicDelegatedPrefix resource to return. + * @param string $region Name of the region of 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\PublicDelegatedPrefix + * + * @throws ApiException if the remote call fails + */ + public function get($project, $publicDelegatedPrefix, $region, array $optionalArgs = []) + { + $request = new GetPublicDelegatedPrefixeRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setPublicDelegatedPrefix($publicDelegatedPrefix); + $request->setRegion($region); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['public_delegated_prefix'] = $publicDelegatedPrefix; + $requestParamHeaders['region'] = $region; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', PublicDelegatedPrefix::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a PublicDelegatedPrefix in the specified project in the given region using the parameters that are included in the request. + * + * Sample code: + * ``` + * $publicDelegatedPrefixesClient = new PublicDelegatedPrefixesClient(); + * try { + * $project = 'project'; + * $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + * $region = 'region'; + * $operationResponse = $publicDelegatedPrefixesClient->insert($project, $publicDelegatedPrefixResource, $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 = $publicDelegatedPrefixesClient->insert($project, $publicDelegatedPrefixResource, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $publicDelegatedPrefixesClient->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 { + * $publicDelegatedPrefixesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param PublicDelegatedPrefix $publicDelegatedPrefixResource The body resource for this request + * @param string $region Name of the region of 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($project, $publicDelegatedPrefixResource, $region, array $optionalArgs = []) + { + $request = new InsertPublicDelegatedPrefixeRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource); + $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(); + } + + /** + * Lists the PublicDelegatedPrefixes for a project in the given region. + * + * Sample code: + * ``` + * $publicDelegatedPrefixesClient = new PublicDelegatedPrefixesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $publicDelegatedPrefixesClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $publicDelegatedPrefixesClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $publicDelegatedPrefixesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region of 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListPublicDelegatedPrefixesRequest(); + $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, PublicDelegatedPrefixList::class, $request); + } + + /** + * Patches the specified PublicDelegatedPrefix resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $publicDelegatedPrefixesClient = new PublicDelegatedPrefixesClient(); + * try { + * $project = 'project'; + * $publicDelegatedPrefix = 'public_delegated_prefix'; + * $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + * $region = 'region'; + * $operationResponse = $publicDelegatedPrefixesClient->patch($project, $publicDelegatedPrefix, $publicDelegatedPrefixResource, $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 = $publicDelegatedPrefixesClient->patch($project, $publicDelegatedPrefix, $publicDelegatedPrefixResource, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $publicDelegatedPrefixesClient->resumeOperation($operationName, 'patch'); + * 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 { + * $publicDelegatedPrefixesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $publicDelegatedPrefix Name of the PublicDelegatedPrefix resource to patch. + * @param PublicDelegatedPrefix $publicDelegatedPrefixResource The body resource for this request + * @param string $region 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 patch($project, $publicDelegatedPrefix, $publicDelegatedPrefixResource, $region, array $optionalArgs = []) + { + $request = new PatchPublicDelegatedPrefixeRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setPublicDelegatedPrefix($publicDelegatedPrefix); + $request->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource); + $request->setRegion($region); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['public_delegated_prefix'] = $publicDelegatedPrefix; + $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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Withdraws the specified PublicDelegatedPrefix in the given region. + * + * Sample code: + * ``` + * $publicDelegatedPrefixesClient = new PublicDelegatedPrefixesClient(); + * try { + * $project = 'project'; + * $publicDelegatedPrefix = 'public_delegated_prefix'; + * $region = 'region'; + * $operationResponse = $publicDelegatedPrefixesClient->withdraw($project, $publicDelegatedPrefix, $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 = $publicDelegatedPrefixesClient->withdraw($project, $publicDelegatedPrefix, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $publicDelegatedPrefixesClient->resumeOperation($operationName, 'withdraw'); + * 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 { + * $publicDelegatedPrefixesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $publicDelegatedPrefix The name of the public delegated prefix. It should comply with RFC1035. + * @param string $region The name of the region where the public delegated prefix is located. It should comply with RFC1035. + * @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 withdraw($project, $publicDelegatedPrefix, $region, array $optionalArgs = []) + { + $request = new WithdrawPublicDelegatedPrefixeRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setPublicDelegatedPrefix($publicDelegatedPrefix); + $request->setRegion($region); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['public_delegated_prefix'] = $publicDelegatedPrefix; + $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('Withdraw', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionAutoscalersGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionAutoscalersGapicClient.php new file mode 100644 index 000000000000..beb355114705 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionAutoscalersGapicClient.php @@ -0,0 +1,708 @@ +delete($autoscaler, $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 = $regionAutoscalersClient->delete($autoscaler, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionAutoscalersClient->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 { + * $regionAutoscalersClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionAutoscalersClient}. + */ +class RegionAutoscalersGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionAutoscalers'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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_autoscalers_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_autoscalers_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_autoscalers_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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 autoscaler. + * + * Sample code: + * ``` + * $regionAutoscalersClient = new RegionAutoscalersClient(); + * try { + * $autoscaler = 'autoscaler'; + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionAutoscalersClient->delete($autoscaler, $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 = $regionAutoscalersClient->delete($autoscaler, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionAutoscalersClient->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 { + * $regionAutoscalersClient->close(); + * } + * ``` + * + * @param string $autoscaler Name of the autoscaler to delete. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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($autoscaler, $project, $region, array $optionalArgs = []) + { + $request = new DeleteRegionAutoscalerRequest(); + $requestParamHeaders = []; + $request->setAutoscaler($autoscaler); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['autoscaler'] = $autoscaler; + $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 autoscaler. + * + * Sample code: + * ``` + * $regionAutoscalersClient = new RegionAutoscalersClient(); + * try { + * $autoscaler = 'autoscaler'; + * $project = 'project'; + * $region = 'region'; + * $response = $regionAutoscalersClient->get($autoscaler, $project, $region); + * } finally { + * $regionAutoscalersClient->close(); + * } + * ``` + * + * @param string $autoscaler Name of the autoscaler to return. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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\Autoscaler + * + * @throws ApiException if the remote call fails + */ + public function get($autoscaler, $project, $region, array $optionalArgs = []) + { + $request = new GetRegionAutoscalerRequest(); + $requestParamHeaders = []; + $request->setAutoscaler($autoscaler); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['autoscaler'] = $autoscaler; + $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', Autoscaler::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates an autoscaler in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $regionAutoscalersClient = new RegionAutoscalersClient(); + * try { + * $autoscalerResource = new Autoscaler(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionAutoscalersClient->insert($autoscalerResource, $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 = $regionAutoscalersClient->insert($autoscalerResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionAutoscalersClient->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 { + * $regionAutoscalersClient->close(); + * } + * ``` + * + * @param Autoscaler $autoscalerResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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($autoscalerResource, $project, $region, array $optionalArgs = []) + { + $request = new InsertRegionAutoscalerRequest(); + $requestParamHeaders = []; + $request->setAutoscalerResource($autoscalerResource); + $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 autoscalers contained within the specified region. + * + * Sample code: + * ``` + * $regionAutoscalersClient = new RegionAutoscalersClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionAutoscalersClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionAutoscalersClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionAutoscalersClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRegionAutoscalersRequest(); + $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, RegionAutoscalerList::class, $request); + } + + /** + * Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $regionAutoscalersClient = new RegionAutoscalersClient(); + * try { + * $autoscalerResource = new Autoscaler(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionAutoscalersClient->patch($autoscalerResource, $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 = $regionAutoscalersClient->patch($autoscalerResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionAutoscalersClient->resumeOperation($operationName, 'patch'); + * 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 { + * $regionAutoscalersClient->close(); + * } + * ``` + * + * @param Autoscaler $autoscalerResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param array $optionalArgs { + * Optional. + * + * @type string $autoscaler + * Name of the autoscaler to patch. + * @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 patch($autoscalerResource, $project, $region, array $optionalArgs = []) + { + $request = new PatchRegionAutoscalerRequest(); + $requestParamHeaders = []; + $request->setAutoscalerResource($autoscalerResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + if (isset($optionalArgs['autoscaler'])) { + $request->setAutoscaler($optionalArgs['autoscaler']); + } + + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Updates an autoscaler in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $regionAutoscalersClient = new RegionAutoscalersClient(); + * try { + * $autoscalerResource = new Autoscaler(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionAutoscalersClient->update($autoscalerResource, $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 = $regionAutoscalersClient->update($autoscalerResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionAutoscalersClient->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 { + * $regionAutoscalersClient->close(); + * } + * ``` + * + * @param Autoscaler $autoscalerResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param array $optionalArgs { + * Optional. + * + * @type string $autoscaler + * Name of the autoscaler to update. + * @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 update($autoscalerResource, $project, $region, array $optionalArgs = []) + { + $request = new UpdateRegionAutoscalerRequest(); + $requestParamHeaders = []; + $request->setAutoscalerResource($autoscalerResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + if (isset($optionalArgs['autoscaler'])) { + $request->setAutoscaler($optionalArgs['autoscaler']); + } + + 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('Update', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionBackendServicesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionBackendServicesGapicClient.php new file mode 100644 index 000000000000..4bc3bf5f96d5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionBackendServicesGapicClient.php @@ -0,0 +1,1088 @@ +delete($backendService, $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 = $regionBackendServicesClient->delete($backendService, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionBackendServicesClient->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 { + * $regionBackendServicesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionBackendServicesClient}. + */ +class RegionBackendServicesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionBackendServices'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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_backend_services_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_backend_services_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_backend_services_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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 regional BackendService resource. + * + * Sample code: + * ``` + * $regionBackendServicesClient = new RegionBackendServicesClient(); + * try { + * $backendService = 'backend_service'; + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionBackendServicesClient->delete($backendService, $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 = $regionBackendServicesClient->delete($backendService, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionBackendServicesClient->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 { + * $regionBackendServicesClient->close(); + * } + * ``` + * + * @param string $backendService Name of the BackendService resource to delete. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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($backendService, $project, $region, array $optionalArgs = []) + { + $request = new DeleteRegionBackendServiceRequest(); + $requestParamHeaders = []; + $request->setBackendService($backendService); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['backend_service'] = $backendService; + $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 regional BackendService resource. + * + * Sample code: + * ``` + * $regionBackendServicesClient = new RegionBackendServicesClient(); + * try { + * $backendService = 'backend_service'; + * $project = 'project'; + * $region = 'region'; + * $response = $regionBackendServicesClient->get($backendService, $project, $region); + * } finally { + * $regionBackendServicesClient->close(); + * } + * ``` + * + * @param string $backendService Name of the BackendService resource to return. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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\BackendService + * + * @throws ApiException if the remote call fails + */ + public function get($backendService, $project, $region, array $optionalArgs = []) + { + $request = new GetRegionBackendServiceRequest(); + $requestParamHeaders = []; + $request->setBackendService($backendService); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['backend_service'] = $backendService; + $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', BackendService::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the most recent health check results for this regional BackendService. + * + * Sample code: + * ``` + * $regionBackendServicesClient = new RegionBackendServicesClient(); + * try { + * $backendService = 'backend_service'; + * $project = 'project'; + * $region = 'region'; + * $resourceGroupReferenceResource = new ResourceGroupReference(); + * $response = $regionBackendServicesClient->getHealth($backendService, $project, $region, $resourceGroupReferenceResource); + * } finally { + * $regionBackendServicesClient->close(); + * } + * ``` + * + * @param string $backendService Name of the BackendService resource for which to get health. + * @param string $project + * @param string $region Name of the region scoping this request. + * @param ResourceGroupReference $resourceGroupReferenceResource The body resource 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\BackendServiceGroupHealth + * + * @throws ApiException if the remote call fails + */ + public function getHealth($backendService, $project, $region, $resourceGroupReferenceResource, array $optionalArgs = []) + { + $request = new GetHealthRegionBackendServiceRequest(); + $requestParamHeaders = []; + $request->setBackendService($backendService); + $request->setProject($project); + $request->setRegion($region); + $request->setResourceGroupReferenceResource($resourceGroupReferenceResource); + $requestParamHeaders['backend_service'] = $backendService; + $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('GetHealth', BackendServiceGroupHealth::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $regionBackendServicesClient = new RegionBackendServicesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resource = 'resource'; + * $response = $regionBackendServicesClient->getIamPolicy($project, $region, $resource); + * } finally { + * $regionBackendServicesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $region, $resource, array $optionalArgs = []) + { + $request = new GetIamPolicyRegionBackendServiceRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a regional BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview. + * + * Sample code: + * ``` + * $regionBackendServicesClient = new RegionBackendServicesClient(); + * try { + * $backendServiceResource = new BackendService(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionBackendServicesClient->insert($backendServiceResource, $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 = $regionBackendServicesClient->insert($backendServiceResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionBackendServicesClient->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 { + * $regionBackendServicesClient->close(); + * } + * ``` + * + * @param BackendService $backendServiceResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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($backendServiceResource, $project, $region, array $optionalArgs = []) + { + $request = new InsertRegionBackendServiceRequest(); + $requestParamHeaders = []; + $request->setBackendServiceResource($backendServiceResource); + $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 the list of regional BackendService resources available to the specified project in the given region. + * + * Sample code: + * ``` + * $regionBackendServicesClient = new RegionBackendServicesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionBackendServicesClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionBackendServicesClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionBackendServicesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRegionBackendServicesRequest(); + $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, BackendServiceList::class, $request); + } + + /** + * Retrieves an aggregated list of all usable backend services in the specified project in the given region. + * + * Sample code: + * ``` + * $regionBackendServicesClient = new RegionBackendServicesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionBackendServicesClient->listUsable($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionBackendServicesClient->listUsable($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionBackendServicesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. It must be a string that meets the requirements in RFC1035. + * @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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 listUsable($project, $region, array $optionalArgs = []) + { + $request = new ListUsableRegionBackendServicesRequest(); + $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('ListUsable', $optionalArgs, BackendServiceListUsable::class, $request); + } + + /** + * Updates the specified regional BackendService resource with the data included in the request. For more information, see Understanding backend services This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $regionBackendServicesClient = new RegionBackendServicesClient(); + * try { + * $backendService = 'backend_service'; + * $backendServiceResource = new BackendService(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionBackendServicesClient->patch($backendService, $backendServiceResource, $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 = $regionBackendServicesClient->patch($backendService, $backendServiceResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionBackendServicesClient->resumeOperation($operationName, 'patch'); + * 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 { + * $regionBackendServicesClient->close(); + * } + * ``` + * + * @param string $backendService Name of the BackendService resource to patch. + * @param BackendService $backendServiceResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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 patch($backendService, $backendServiceResource, $project, $region, array $optionalArgs = []) + { + $request = new PatchRegionBackendServiceRequest(); + $requestParamHeaders = []; + $request->setBackendService($backendService); + $request->setBackendServiceResource($backendServiceResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['backend_service'] = $backendService; + $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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $regionBackendServicesClient = new RegionBackendServicesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + * $resource = 'resource'; + * $response = $regionBackendServicesClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + * } finally { + * $regionBackendServicesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param RegionSetPolicyRequest $regionSetPolicyRequestResource The body resource for this request + * @param string $resource Name or id of the resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource, array $optionalArgs = []) + { + $request = new SetIamPolicyRegionBackendServiceRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview + * + * Sample code: + * ``` + * $regionBackendServicesClient = new RegionBackendServicesClient(); + * try { + * $backendService = 'backend_service'; + * $project = 'project'; + * $region = 'region'; + * $securityPolicyReferenceResource = new SecurityPolicyReference(); + * $operationResponse = $regionBackendServicesClient->setSecurityPolicy($backendService, $project, $region, $securityPolicyReferenceResource); + * $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 = $regionBackendServicesClient->setSecurityPolicy($backendService, $project, $region, $securityPolicyReferenceResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionBackendServicesClient->resumeOperation($operationName, 'setSecurityPolicy'); + * 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 { + * $regionBackendServicesClient->close(); + * } + * ``` + * + * @param string $backendService Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param SecurityPolicyReference $securityPolicyReferenceResource The body resource 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 setSecurityPolicy($backendService, $project, $region, $securityPolicyReferenceResource, array $optionalArgs = []) + { + $request = new SetSecurityPolicyRegionBackendServiceRequest(); + $requestParamHeaders = []; + $request->setBackendService($backendService); + $request->setProject($project); + $request->setRegion($region); + $request->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + $requestParamHeaders['backend_service'] = $backendService; + $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('SetSecurityPolicy', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $regionBackendServicesClient = new RegionBackendServicesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $response = $regionBackendServicesClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + * } finally { + * $regionBackendServicesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $region, $resource, $testPermissionsRequestResource, array $optionalArgs = []) + { + $request = new TestIamPermissionsRegionBackendServiceRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $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 regional BackendService resource with the data included in the request. For more information, see Backend services overview . + * + * Sample code: + * ``` + * $regionBackendServicesClient = new RegionBackendServicesClient(); + * try { + * $backendService = 'backend_service'; + * $backendServiceResource = new BackendService(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionBackendServicesClient->update($backendService, $backendServiceResource, $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 = $regionBackendServicesClient->update($backendService, $backendServiceResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionBackendServicesClient->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 { + * $regionBackendServicesClient->close(); + * } + * ``` + * + * @param string $backendService Name of the BackendService resource to update. + * @param BackendService $backendServiceResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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 update($backendService, $backendServiceResource, $project, $region, array $optionalArgs = []) + { + $request = new UpdateRegionBackendServiceRequest(); + $requestParamHeaders = []; + $request->setBackendService($backendService); + $request->setBackendServiceResource($backendServiceResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['backend_service'] = $backendService; + $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('Update', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionCommitmentsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionCommitmentsGapicClient.php new file mode 100644 index 000000000000..6c0c9b47c5e1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionCommitmentsGapicClient.php @@ -0,0 +1,643 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionCommitmentsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionCommitmentsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionCommitmentsClient}. + */ +class RegionCommitmentsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionCommitments'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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_commitments_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_commitments_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_commitments_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Retrieves an aggregated list of commitments by region. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $regionCommitmentsClient = new RegionCommitmentsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $regionCommitmentsClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionCommitmentsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionCommitmentsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListRegionCommitmentsRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, CommitmentAggregatedList::class, $request); + } + + /** + * Returns the specified commitment resource. + * + * Sample code: + * ``` + * $regionCommitmentsClient = new RegionCommitmentsClient(); + * try { + * $commitment = 'commitment'; + * $project = 'project'; + * $region = 'region'; + * $response = $regionCommitmentsClient->get($commitment, $project, $region); + * } finally { + * $regionCommitmentsClient->close(); + * } + * ``` + * + * @param string $commitment Name of the commitment to return. + * @param string $project Project ID for this request. + * @param string $region 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\Commitment + * + * @throws ApiException if the remote call fails + */ + public function get($commitment, $project, $region, array $optionalArgs = []) + { + $request = new GetRegionCommitmentRequest(); + $requestParamHeaders = []; + $request->setCommitment($commitment); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['commitment'] = $commitment; + $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', Commitment::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a commitment in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $regionCommitmentsClient = new RegionCommitmentsClient(); + * try { + * $commitmentResource = new Commitment(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionCommitmentsClient->insert($commitmentResource, $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 = $regionCommitmentsClient->insert($commitmentResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionCommitmentsClient->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 { + * $regionCommitmentsClient->close(); + * } + * ``` + * + * @param Commitment $commitmentResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region 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($commitmentResource, $project, $region, array $optionalArgs = []) + { + $request = new InsertRegionCommitmentRequest(); + $requestParamHeaders = []; + $request->setCommitmentResource($commitmentResource); + $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 commitments contained within the specified region. + * + * Sample code: + * ``` + * $regionCommitmentsClient = new RegionCommitmentsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionCommitmentsClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionCommitmentsClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionCommitmentsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRegionCommitmentsRequest(); + $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, CommitmentList::class, $request); + } + + /** + * Updates the specified commitment 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: auto_renew. + * + * Sample code: + * ``` + * $regionCommitmentsClient = new RegionCommitmentsClient(); + * try { + * $commitment = 'commitment'; + * $commitmentResource = new Commitment(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionCommitmentsClient->update($commitment, $commitmentResource, $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 = $regionCommitmentsClient->update($commitment, $commitmentResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionCommitmentsClient->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 { + * $regionCommitmentsClient->close(); + * } + * ``` + * + * @param string $commitment Name of the commitment for which auto renew is being updated. + * @param Commitment $commitmentResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region 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($commitment, $commitmentResource, $project, $region, array $optionalArgs = []) + { + $request = new UpdateRegionCommitmentRequest(); + $requestParamHeaders = []; + $request->setCommitment($commitment); + $request->setCommitmentResource($commitmentResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['commitment'] = $commitment; + $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/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionDiskTypesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionDiskTypesGapicClient.php new file mode 100644 index 000000000000..092c6fb36aab --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionDiskTypesGapicClient.php @@ -0,0 +1,314 @@ +get($diskType, $project, $region); + * } finally { + * $regionDiskTypesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionDiskTypesClient}. + */ +class RegionDiskTypesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionDiskTypes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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.readonly', + 'https://www.googleapis.com/auth/compute', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_disk_types_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_disk_types_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_disk_types_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** + * Returns the specified regional disk type. + * + * Sample code: + * ``` + * $regionDiskTypesClient = new RegionDiskTypesClient(); + * try { + * $diskType = 'disk_type'; + * $project = 'project'; + * $region = 'region'; + * $response = $regionDiskTypesClient->get($diskType, $project, $region); + * } finally { + * $regionDiskTypesClient->close(); + * } + * ``` + * + * @param string $diskType Name of the disk type to return. + * @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\DiskType + * + * @throws ApiException if the remote call fails + */ + public function get($diskType, $project, $region, array $optionalArgs = []) + { + $request = new GetRegionDiskTypeRequest(); + $requestParamHeaders = []; + $request->setDiskType($diskType); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['disk_type'] = $diskType; + $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', DiskType::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves a list of regional disk types available to the specified project. + * + * Sample code: + * ``` + * $regionDiskTypesClient = new RegionDiskTypesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionDiskTypesClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionDiskTypesClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionDiskTypesClient->close(); + * } + * ``` + * + * @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 $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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRegionDiskTypesRequest(); + $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, RegionDiskTypeList::class, $request); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionDisksGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionDisksGapicClient.php new file mode 100644 index 000000000000..82545aacaf4b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionDisksGapicClient.php @@ -0,0 +1,1519 @@ +addResourcePolicies($disk, $project, $region, $regionDisksAddResourcePoliciesRequestResource); + * $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->addResourcePolicies($disk, $project, $region, $regionDisksAddResourcePoliciesRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionDisksClient->resumeOperation($operationName, 'addResourcePolicies'); + * 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(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionDisksClient}. + */ +class RegionDisksGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionDisks'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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_disks_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_disks_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_disks_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. + * + * Sample code: + * ``` + * $regionDisksClient = new RegionDisksClient(); + * try { + * $disk = 'disk'; + * $project = 'project'; + * $region = 'region'; + * $regionDisksAddResourcePoliciesRequestResource = new RegionDisksAddResourcePoliciesRequest(); + * $operationResponse = $regionDisksClient->addResourcePolicies($disk, $project, $region, $regionDisksAddResourcePoliciesRequestResource); + * $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->addResourcePolicies($disk, $project, $region, $regionDisksAddResourcePoliciesRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionDisksClient->resumeOperation($operationName, 'addResourcePolicies'); + * 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 string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param RegionDisksAddResourcePoliciesRequest $regionDisksAddResourcePoliciesRequestResource The body resource 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 addResourcePolicies($disk, $project, $region, $regionDisksAddResourcePoliciesRequestResource, array $optionalArgs = []) + { + $request = new AddResourcePoliciesRegionDiskRequest(); + $requestParamHeaders = []; + $request->setDisk($disk); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionDisksAddResourcePoliciesRequestResource($regionDisksAddResourcePoliciesRequestResource); + $requestParamHeaders['disk'] = $disk; + $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('AddResourcePolicies', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Bulk create a set of disks. + * + * Sample code: + * ``` + * $regionDisksClient = new RegionDisksClient(); + * try { + * $bulkInsertDiskResourceResource = new BulkInsertDiskResource(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionDisksClient->bulkInsert($bulkInsertDiskResourceResource, $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->bulkInsert($bulkInsertDiskResourceResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionDisksClient->resumeOperation($operationName, 'bulkInsert'); + * 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 BulkInsertDiskResource $bulkInsertDiskResourceResource 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 bulkInsert($bulkInsertDiskResourceResource, $project, $region, array $optionalArgs = []) + { + $request = new BulkInsertRegionDiskRequest(); + $requestParamHeaders = []; + $request->setBulkInsertDiskResourceResource($bulkInsertDiskResourceResource); + $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('BulkInsert', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Creates a snapshot of a specified persistent disk. For regular snapshot creation, consider using snapshots.insert instead, as that method supports more features, such as creating snapshots in a project different from the source disk project. + * + * Sample code: + * ``` + * $regionDisksClient = new RegionDisksClient(); + * try { + * $disk = 'disk'; + * $project = 'project'; + * $region = 'region'; + * $snapshotResource = new Snapshot(); + * $operationResponse = $regionDisksClient->createSnapshot($disk, $project, $region, $snapshotResource); + * $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->createSnapshot($disk, $project, $region, $snapshotResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionDisksClient->resumeOperation($operationName, 'createSnapshot'); + * 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 Name of the regional persistent disk to snapshot. + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param Snapshot $snapshotResource The body resource 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 createSnapshot($disk, $project, $region, $snapshotResource, array $optionalArgs = []) + { + $request = new CreateSnapshotRegionDiskRequest(); + $requestParamHeaders = []; + $request->setDisk($disk); + $request->setProject($project); + $request->setRegion($region); + $request->setSnapshotResource($snapshotResource); + $requestParamHeaders['disk'] = $disk; + $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('CreateSnapshot', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. + * + * Sample code: + * ``` + * $regionDisksClient = new RegionDisksClient(); + * try { + * $disk = 'disk'; + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionDisksClient->delete($disk, $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->delete($disk, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionDisksClient->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 { + * $regionDisksClient->close(); + * } + * ``` + * + * @param string $disk Name of the regional persistent disk to delete. + * @param string $project Project ID for this request. + * @param string $region 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($disk, $project, $region, array $optionalArgs = []) + { + $request = new DeleteRegionDiskRequest(); + $requestParamHeaders = []; + $request->setDisk($disk); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['disk'] = $disk; + $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 a specified regional persistent disk. + * + * Sample code: + * ``` + * $regionDisksClient = new RegionDisksClient(); + * try { + * $disk = 'disk'; + * $project = 'project'; + * $region = 'region'; + * $response = $regionDisksClient->get($disk, $project, $region); + * } finally { + * $regionDisksClient->close(); + * } + * ``` + * + * @param string $disk Name of the regional persistent disk to return. + * @param string $project Project ID for this request. + * @param string $region 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\Disk + * + * @throws ApiException if the remote call fails + */ + public function get($disk, $project, $region, array $optionalArgs = []) + { + $request = new GetRegionDiskRequest(); + $requestParamHeaders = []; + $request->setDisk($disk); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['disk'] = $disk; + $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', Disk::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $regionDisksClient = new RegionDisksClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resource = 'resource'; + * $response = $regionDisksClient->getIamPolicy($project, $region, $resource); + * } finally { + * $regionDisksClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $region, $resource, array $optionalArgs = []) + { + $request = new GetIamPolicyRegionDiskRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a persistent regional disk in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $regionDisksClient = new RegionDisksClient(); + * try { + * $diskResource = new Disk(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionDisksClient->insert($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->insert($diskResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionDisksClient->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 { + * $regionDisksClient->close(); + * } + * ``` + * + * @param Disk $diskResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region 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 string $sourceImage + * Source image to restore onto a disk. This field is 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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function insert($diskResource, $project, $region, array $optionalArgs = []) + { + $request = new InsertRegionDiskRequest(); + $requestParamHeaders = []; + $request->setDiskResource($diskResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['sourceImage'])) { + $request->setSourceImage($optionalArgs['sourceImage']); + } + + $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 the list of persistent disks contained within the specified region. + * + * Sample code: + * ``` + * $regionDisksClient = new RegionDisksClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionDisksClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionDisksClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionDisksClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRegionDisksRequest(); + $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, DiskList::class, $request); + } + + /** + * Removes resource policies from a regional disk. + * + * Sample code: + * ``` + * $regionDisksClient = new RegionDisksClient(); + * try { + * $disk = 'disk'; + * $project = 'project'; + * $region = 'region'; + * $regionDisksRemoveResourcePoliciesRequestResource = new RegionDisksRemoveResourcePoliciesRequest(); + * $operationResponse = $regionDisksClient->removeResourcePolicies($disk, $project, $region, $regionDisksRemoveResourcePoliciesRequestResource); + * $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->removeResourcePolicies($disk, $project, $region, $regionDisksRemoveResourcePoliciesRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionDisksClient->resumeOperation($operationName, 'removeResourcePolicies'); + * 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 string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param RegionDisksRemoveResourcePoliciesRequest $regionDisksRemoveResourcePoliciesRequestResource The body resource 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 removeResourcePolicies($disk, $project, $region, $regionDisksRemoveResourcePoliciesRequestResource, array $optionalArgs = []) + { + $request = new RemoveResourcePoliciesRegionDiskRequest(); + $requestParamHeaders = []; + $request->setDisk($disk); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionDisksRemoveResourcePoliciesRequestResource($regionDisksRemoveResourcePoliciesRequestResource); + $requestParamHeaders['disk'] = $disk; + $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('RemoveResourcePolicies', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Resizes the specified regional persistent disk. + * + * Sample code: + * ``` + * $regionDisksClient = new RegionDisksClient(); + * try { + * $disk = 'disk'; + * $project = 'project'; + * $region = 'region'; + * $regionDisksResizeRequestResource = new RegionDisksResizeRequest(); + * $operationResponse = $regionDisksClient->resize($disk, $project, $region, $regionDisksResizeRequestResource); + * $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->resize($disk, $project, $region, $regionDisksResizeRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionDisksClient->resumeOperation($operationName, 'resize'); + * 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 Name of the regional persistent disk. + * @param string $project The project ID for this request. + * @param string $region Name of the region for this request. + * @param RegionDisksResizeRequest $regionDisksResizeRequestResource The body resource 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 resize($disk, $project, $region, $regionDisksResizeRequestResource, array $optionalArgs = []) + { + $request = new ResizeRegionDiskRequest(); + $requestParamHeaders = []; + $request->setDisk($disk); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionDisksResizeRequestResource($regionDisksResizeRequestResource); + $requestParamHeaders['disk'] = $disk; + $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('Resize', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $regionDisksClient = new RegionDisksClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + * $resource = 'resource'; + * $response = $regionDisksClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + * } finally { + * $regionDisksClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param RegionSetPolicyRequest $regionSetPolicyRequestResource The body resource for this request + * @param string $resource Name or id of the resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource, array $optionalArgs = []) + { + $request = new SetIamPolicyRegionDiskRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Sets the labels on the target regional disk. + * + * Sample code: + * ``` + * $regionDisksClient = new RegionDisksClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + * $resource = 'resource'; + * $operationResponse = $regionDisksClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + * $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->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionDisksClient->resumeOperation($operationName, 'setLabels'); + * 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 $project Project ID for this request. + * @param string $region The region for this request. + * @param RegionSetLabelsRequest $regionSetLabelsRequestResource The body resource for this request + * @param string $resource Name or id of the resource 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 setLabels($project, $region, $regionSetLabelsRequestResource, $resource, array $optionalArgs = []) + { + $request = new SetLabelsRegionDiskRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + 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('SetLabels', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Starts asynchronous replication. Must be invoked on the primary disk. + * + * Sample code: + * ``` + * $regionDisksClient = new RegionDisksClient(); + * try { + * $disk = 'disk'; + * $project = 'project'; + * $region = 'region'; + * $regionDisksStartAsyncReplicationRequestResource = new RegionDisksStartAsyncReplicationRequest(); + * $operationResponse = $regionDisksClient->startAsyncReplication($disk, $project, $region, $regionDisksStartAsyncReplicationRequestResource); + * $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->startAsyncReplication($disk, $project, $region, $regionDisksStartAsyncReplicationRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionDisksClient->resumeOperation($operationName, 'startAsyncReplication'); + * 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 name of the persistent disk. + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param RegionDisksStartAsyncReplicationRequest $regionDisksStartAsyncReplicationRequestResource The body resource 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 startAsyncReplication($disk, $project, $region, $regionDisksStartAsyncReplicationRequestResource, array $optionalArgs = []) + { + $request = new StartAsyncReplicationRegionDiskRequest(); + $requestParamHeaders = []; + $request->setDisk($disk); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionDisksStartAsyncReplicationRequestResource($regionDisksStartAsyncReplicationRequestResource); + $requestParamHeaders['disk'] = $disk; + $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('StartAsyncReplication', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Stops asynchronous replication. Can be invoked either on the primary or on the secondary disk. + * + * Sample code: + * ``` + * $regionDisksClient = new RegionDisksClient(); + * try { + * $disk = 'disk'; + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionDisksClient->stopAsyncReplication($disk, $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->stopAsyncReplication($disk, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionDisksClient->resumeOperation($operationName, 'stopAsyncReplication'); + * 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 name of the persistent disk. + * @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 stopAsyncReplication($disk, $project, $region, array $optionalArgs = []) + { + $request = new StopAsyncReplicationRegionDiskRequest(); + $requestParamHeaders = []; + $request->setDisk($disk); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['disk'] = $disk; + $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('StopAsyncReplication', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Stops asynchronous replication for a consistency group of disks. Can be invoked either in the primary or secondary scope. + * + * Sample code: + * ``` + * $regionDisksClient = new RegionDisksClient(); + * try { + * $disksStopGroupAsyncReplicationResourceResource = new DisksStopGroupAsyncReplicationResource(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionDisksClient->stopGroupAsyncReplication($disksStopGroupAsyncReplicationResourceResource, $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->stopGroupAsyncReplication($disksStopGroupAsyncReplicationResourceResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionDisksClient->resumeOperation($operationName, 'stopGroupAsyncReplication'); + * 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 DisksStopGroupAsyncReplicationResource $disksStopGroupAsyncReplicationResourceResource 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. This must be the region of the primary or secondary disks in the consistency group. + * @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 stopGroupAsyncReplication($disksStopGroupAsyncReplicationResourceResource, $project, $region, array $optionalArgs = []) + { + $request = new StopGroupAsyncReplicationRegionDiskRequest(); + $requestParamHeaders = []; + $request->setDisksStopGroupAsyncReplicationResourceResource($disksStopGroupAsyncReplicationResourceResource); + $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('StopGroupAsyncReplication', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $regionDisksClient = new RegionDisksClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $response = $regionDisksClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + * } finally { + * $regionDisksClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $region, $resource, $testPermissionsRequestResource, array $optionalArgs = []) + { + $request = new TestIamPermissionsRegionDiskRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $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/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionHealthCheckServicesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionHealthCheckServicesGapicClient.php new file mode 100644 index 000000000000..5fc35dccf432 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionHealthCheckServicesGapicClient.php @@ -0,0 +1,624 @@ +delete($healthCheckService, $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 = $regionHealthCheckServicesClient->delete($healthCheckService, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionHealthCheckServicesClient->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 { + * $regionHealthCheckServicesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionHealthCheckServicesClient}. + */ +class RegionHealthCheckServicesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionHealthCheckServices'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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_health_check_services_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_health_check_services_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_health_check_services_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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 regional HealthCheckService. + * + * Sample code: + * ``` + * $regionHealthCheckServicesClient = new RegionHealthCheckServicesClient(); + * try { + * $healthCheckService = 'health_check_service'; + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionHealthCheckServicesClient->delete($healthCheckService, $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 = $regionHealthCheckServicesClient->delete($healthCheckService, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionHealthCheckServicesClient->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 { + * $regionHealthCheckServicesClient->close(); + * } + * ``` + * + * @param string $healthCheckService Name of the HealthCheckService to delete. The name must be 1-63 characters long, and comply with RFC1035. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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($healthCheckService, $project, $region, array $optionalArgs = []) + { + $request = new DeleteRegionHealthCheckServiceRequest(); + $requestParamHeaders = []; + $request->setHealthCheckService($healthCheckService); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['health_check_service'] = $healthCheckService; + $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 regional HealthCheckService resource. + * + * Sample code: + * ``` + * $regionHealthCheckServicesClient = new RegionHealthCheckServicesClient(); + * try { + * $healthCheckService = 'health_check_service'; + * $project = 'project'; + * $region = 'region'; + * $response = $regionHealthCheckServicesClient->get($healthCheckService, $project, $region); + * } finally { + * $regionHealthCheckServicesClient->close(); + * } + * ``` + * + * @param string $healthCheckService Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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\HealthCheckService + * + * @throws ApiException if the remote call fails + */ + public function get($healthCheckService, $project, $region, array $optionalArgs = []) + { + $request = new GetRegionHealthCheckServiceRequest(); + $requestParamHeaders = []; + $request->setHealthCheckService($healthCheckService); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['health_check_service'] = $healthCheckService; + $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', HealthCheckService::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a regional HealthCheckService resource in the specified project and region using the data included in the request. + * + * Sample code: + * ``` + * $regionHealthCheckServicesClient = new RegionHealthCheckServicesClient(); + * try { + * $healthCheckServiceResource = new HealthCheckService(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionHealthCheckServicesClient->insert($healthCheckServiceResource, $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 = $regionHealthCheckServicesClient->insert($healthCheckServiceResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionHealthCheckServicesClient->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 { + * $regionHealthCheckServicesClient->close(); + * } + * ``` + * + * @param HealthCheckService $healthCheckServiceResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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($healthCheckServiceResource, $project, $region, array $optionalArgs = []) + { + $request = new InsertRegionHealthCheckServiceRequest(); + $requestParamHeaders = []; + $request->setHealthCheckServiceResource($healthCheckServiceResource); + $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(); + } + + /** + * Lists all the HealthCheckService resources that have been configured for the specified project in the given region. + * + * Sample code: + * ``` + * $regionHealthCheckServicesClient = new RegionHealthCheckServicesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionHealthCheckServicesClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionHealthCheckServicesClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionHealthCheckServicesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRegionHealthCheckServicesRequest(); + $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, HealthCheckServicesList::class, $request); + } + + /** + * Updates the specified regional HealthCheckService resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $regionHealthCheckServicesClient = new RegionHealthCheckServicesClient(); + * try { + * $healthCheckService = 'health_check_service'; + * $healthCheckServiceResource = new HealthCheckService(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionHealthCheckServicesClient->patch($healthCheckService, $healthCheckServiceResource, $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 = $regionHealthCheckServicesClient->patch($healthCheckService, $healthCheckServiceResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionHealthCheckServicesClient->resumeOperation($operationName, 'patch'); + * 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 { + * $regionHealthCheckServicesClient->close(); + * } + * ``` + * + * @param string $healthCheckService Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035. + * @param HealthCheckService $healthCheckServiceResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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 patch($healthCheckService, $healthCheckServiceResource, $project, $region, array $optionalArgs = []) + { + $request = new PatchRegionHealthCheckServiceRequest(); + $requestParamHeaders = []; + $request->setHealthCheckService($healthCheckService); + $request->setHealthCheckServiceResource($healthCheckServiceResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['health_check_service'] = $healthCheckService; + $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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionHealthChecksGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionHealthChecksGapicClient.php new file mode 100644 index 000000000000..af87dc59fde8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionHealthChecksGapicClient.php @@ -0,0 +1,704 @@ +delete($healthCheck, $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 = $regionHealthChecksClient->delete($healthCheck, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionHealthChecksClient->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 { + * $regionHealthChecksClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionHealthChecksClient}. + */ +class RegionHealthChecksGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionHealthChecks'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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_health_checks_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_health_checks_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_health_checks_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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 HealthCheck resource. + * + * Sample code: + * ``` + * $regionHealthChecksClient = new RegionHealthChecksClient(); + * try { + * $healthCheck = 'health_check'; + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionHealthChecksClient->delete($healthCheck, $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 = $regionHealthChecksClient->delete($healthCheck, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionHealthChecksClient->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 { + * $regionHealthChecksClient->close(); + * } + * ``` + * + * @param string $healthCheck Name of the HealthCheck resource to delete. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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($healthCheck, $project, $region, array $optionalArgs = []) + { + $request = new DeleteRegionHealthCheckRequest(); + $requestParamHeaders = []; + $request->setHealthCheck($healthCheck); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['health_check'] = $healthCheck; + $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 HealthCheck resource. + * + * Sample code: + * ``` + * $regionHealthChecksClient = new RegionHealthChecksClient(); + * try { + * $healthCheck = 'health_check'; + * $project = 'project'; + * $region = 'region'; + * $response = $regionHealthChecksClient->get($healthCheck, $project, $region); + * } finally { + * $regionHealthChecksClient->close(); + * } + * ``` + * + * @param string $healthCheck Name of the HealthCheck resource to return. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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\HealthCheck + * + * @throws ApiException if the remote call fails + */ + public function get($healthCheck, $project, $region, array $optionalArgs = []) + { + $request = new GetRegionHealthCheckRequest(); + $requestParamHeaders = []; + $request->setHealthCheck($healthCheck); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['health_check'] = $healthCheck; + $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', HealthCheck::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a HealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $regionHealthChecksClient = new RegionHealthChecksClient(); + * try { + * $healthCheckResource = new HealthCheck(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionHealthChecksClient->insert($healthCheckResource, $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 = $regionHealthChecksClient->insert($healthCheckResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionHealthChecksClient->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 { + * $regionHealthChecksClient->close(); + * } + * ``` + * + * @param HealthCheck $healthCheckResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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($healthCheckResource, $project, $region, array $optionalArgs = []) + { + $request = new InsertRegionHealthCheckRequest(); + $requestParamHeaders = []; + $request->setHealthCheckResource($healthCheckResource); + $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 the list of HealthCheck resources available to the specified project. + * + * Sample code: + * ``` + * $regionHealthChecksClient = new RegionHealthChecksClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionHealthChecksClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionHealthChecksClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionHealthChecksClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRegionHealthChecksRequest(); + $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, HealthCheckList::class, $request); + } + + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $regionHealthChecksClient = new RegionHealthChecksClient(); + * try { + * $healthCheck = 'health_check'; + * $healthCheckResource = new HealthCheck(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionHealthChecksClient->patch($healthCheck, $healthCheckResource, $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 = $regionHealthChecksClient->patch($healthCheck, $healthCheckResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionHealthChecksClient->resumeOperation($operationName, 'patch'); + * 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 { + * $regionHealthChecksClient->close(); + * } + * ``` + * + * @param string $healthCheck Name of the HealthCheck resource to patch. + * @param HealthCheck $healthCheckResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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 patch($healthCheck, $healthCheckResource, $project, $region, array $optionalArgs = []) + { + $request = new PatchRegionHealthCheckRequest(); + $requestParamHeaders = []; + $request->setHealthCheck($healthCheck); + $request->setHealthCheckResource($healthCheckResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['health_check'] = $healthCheck; + $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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $regionHealthChecksClient = new RegionHealthChecksClient(); + * try { + * $healthCheck = 'health_check'; + * $healthCheckResource = new HealthCheck(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionHealthChecksClient->update($healthCheck, $healthCheckResource, $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 = $regionHealthChecksClient->update($healthCheck, $healthCheckResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionHealthChecksClient->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 { + * $regionHealthChecksClient->close(); + * } + * ``` + * + * @param string $healthCheck Name of the HealthCheck resource to update. + * @param HealthCheck $healthCheckResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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 update($healthCheck, $healthCheckResource, $project, $region, array $optionalArgs = []) + { + $request = new UpdateRegionHealthCheckRequest(); + $requestParamHeaders = []; + $request->setHealthCheck($healthCheck); + $request->setHealthCheckResource($healthCheckResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['health_check'] = $healthCheck; + $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('Update', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstanceGroupManagersGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstanceGroupManagersGapicClient.php new file mode 100644 index 000000000000..ecc8c6799d03 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstanceGroupManagersGapicClient.php @@ -0,0 +1,1785 @@ +abandonInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersAbandonInstancesRequestResource); + * $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 = $regionInstanceGroupManagersClient->abandonInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersAbandonInstancesRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceGroupManagersClient->resumeOperation($operationName, 'abandonInstances'); + * 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 { + * $regionInstanceGroupManagersClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionInstanceGroupManagersClient}. + */ +class RegionInstanceGroupManagersGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionInstanceGroupManagers'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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_group_managers_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_instance_group_managers_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_instance_group_managers_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Flags the specified instances to be immediately removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. + * + * Sample code: + * ``` + * $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $region = 'region'; + * $regionInstanceGroupManagersAbandonInstancesRequestResource = new RegionInstanceGroupManagersAbandonInstancesRequest(); + * $operationResponse = $regionInstanceGroupManagersClient->abandonInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersAbandonInstancesRequestResource); + * $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 = $regionInstanceGroupManagersClient->abandonInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersAbandonInstancesRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceGroupManagersClient->resumeOperation($operationName, 'abandonInstances'); + * 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 { + * $regionInstanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager Name of the managed instance group. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param RegionInstanceGroupManagersAbandonInstancesRequest $regionInstanceGroupManagersAbandonInstancesRequestResource The body resource 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 abandonInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersAbandonInstancesRequestResource, array $optionalArgs = []) + { + $request = new AbandonInstancesRegionInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionInstanceGroupManagersAbandonInstancesRequestResource($regionInstanceGroupManagersAbandonInstancesRequestResource); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('AbandonInstances', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Apply updates to selected instances the managed instance group. + * + * Sample code: + * ``` + * $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $region = 'region'; + * $regionInstanceGroupManagersApplyUpdatesRequestResource = new RegionInstanceGroupManagersApplyUpdatesRequest(); + * $operationResponse = $regionInstanceGroupManagersClient->applyUpdatesToInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersApplyUpdatesRequestResource); + * $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 = $regionInstanceGroupManagersClient->applyUpdatesToInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersApplyUpdatesRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceGroupManagersClient->resumeOperation($operationName, 'applyUpdatesToInstances'); + * 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 { + * $regionInstanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group, should conform to RFC1035. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request, should conform to RFC1035. + * @param RegionInstanceGroupManagersApplyUpdatesRequest $regionInstanceGroupManagersApplyUpdatesRequestResource The body resource 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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function applyUpdatesToInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersApplyUpdatesRequestResource, array $optionalArgs = []) + { + $request = new ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionInstanceGroupManagersApplyUpdatesRequestResource($regionInstanceGroupManagersApplyUpdatesRequestResource); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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->startOperationsCall('ApplyUpdatesToInstances', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Creates instances with per-instance configurations in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. + * + * Sample code: + * ``` + * $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $region = 'region'; + * $regionInstanceGroupManagersCreateInstancesRequestResource = new RegionInstanceGroupManagersCreateInstancesRequest(); + * $operationResponse = $regionInstanceGroupManagersClient->createInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersCreateInstancesRequestResource); + * $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 = $regionInstanceGroupManagersClient->createInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersCreateInstancesRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceGroupManagersClient->resumeOperation($operationName, 'createInstances'); + * 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 { + * $regionInstanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param string $project Project ID for this request. + * @param string $region The name of the region where the managed instance group is located. It should conform to RFC1035. + * @param RegionInstanceGroupManagersCreateInstancesRequest $regionInstanceGroupManagersCreateInstancesRequestResource The body resource 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. 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 createInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersCreateInstancesRequestResource, array $optionalArgs = []) + { + $request = new CreateInstancesRegionInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionInstanceGroupManagersCreateInstancesRequestResource($regionInstanceGroupManagersCreateInstancesRequestResource); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('CreateInstances', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes the specified managed instance group and all of the instances in that group. + * + * Sample code: + * ``` + * $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionInstanceGroupManagersClient->delete($instanceGroupManager, $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 = $regionInstanceGroupManagersClient->delete($instanceGroupManager, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceGroupManagersClient->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 { + * $regionInstanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager Name of the managed instance group to delete. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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($instanceGroupManager, $project, $region, array $optionalArgs = []) + { + $request = new DeleteRegionInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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(); + } + + /** + * Flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. + * + * Sample code: + * ``` + * $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $region = 'region'; + * $regionInstanceGroupManagersDeleteInstancesRequestResource = new RegionInstanceGroupManagersDeleteInstancesRequest(); + * $operationResponse = $regionInstanceGroupManagersClient->deleteInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersDeleteInstancesRequestResource); + * $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 = $regionInstanceGroupManagersClient->deleteInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersDeleteInstancesRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceGroupManagersClient->resumeOperation($operationName, 'deleteInstances'); + * 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 { + * $regionInstanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager Name of the managed instance group. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param RegionInstanceGroupManagersDeleteInstancesRequest $regionInstanceGroupManagersDeleteInstancesRequestResource The body resource 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 deleteInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersDeleteInstancesRequestResource, array $optionalArgs = []) + { + $request = new DeleteInstancesRegionInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionInstanceGroupManagersDeleteInstancesRequestResource($regionInstanceGroupManagersDeleteInstancesRequestResource); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('DeleteInstances', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes selected per-instance configurations for the managed instance group. + * + * Sample code: + * ``` + * $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $region = 'region'; + * $regionInstanceGroupManagerDeleteInstanceConfigReqResource = new RegionInstanceGroupManagerDeleteInstanceConfigReq(); + * $operationResponse = $regionInstanceGroupManagersClient->deletePerInstanceConfigs($instanceGroupManager, $project, $region, $regionInstanceGroupManagerDeleteInstanceConfigReqResource); + * $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 = $regionInstanceGroupManagersClient->deletePerInstanceConfigs($instanceGroupManager, $project, $region, $regionInstanceGroupManagerDeleteInstanceConfigReqResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceGroupManagersClient->resumeOperation($operationName, 'deletePerInstanceConfigs'); + * 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 { + * $regionInstanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request, should conform to RFC1035. + * @param RegionInstanceGroupManagerDeleteInstanceConfigReq $regionInstanceGroupManagerDeleteInstanceConfigReqResource The body resource 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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deletePerInstanceConfigs($instanceGroupManager, $project, $region, $regionInstanceGroupManagerDeleteInstanceConfigReqResource, array $optionalArgs = []) + { + $request = new DeletePerInstanceConfigsRegionInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionInstanceGroupManagerDeleteInstanceConfigReqResource($regionInstanceGroupManagerDeleteInstanceConfigReqResource); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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->startOperationsCall('DeletePerInstanceConfigs', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns all of the details about the specified managed instance group. + * + * Sample code: + * ``` + * $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $region = 'region'; + * $response = $regionInstanceGroupManagersClient->get($instanceGroupManager, $project, $region); + * } finally { + * $regionInstanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager Name of the managed instance group to return. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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\InstanceGroupManager + * + * @throws ApiException if the remote call fails + */ + public function get($instanceGroupManager, $project, $region, array $optionalArgs = []) + { + $request = new GetRegionInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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', InstanceGroupManager::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. A regional managed instance group can contain up to 2000 instances. + * + * Sample code: + * ``` + * $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + * try { + * $instanceGroupManagerResource = new InstanceGroupManager(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionInstanceGroupManagersClient->insert($instanceGroupManagerResource, $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 = $regionInstanceGroupManagersClient->insert($instanceGroupManagerResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceGroupManagersClient->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 { + * $regionInstanceGroupManagersClient->close(); + * } + * ``` + * + * @param InstanceGroupManager $instanceGroupManagerResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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($instanceGroupManagerResource, $project, $region, array $optionalArgs = []) + { + $request = new InsertRegionInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManagerResource($instanceGroupManagerResource); + $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 the list of managed instance groups that are contained within the specified region. + * + * Sample code: + * ``` + * $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionInstanceGroupManagersClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionInstanceGroupManagersClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionInstanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRegionInstanceGroupManagersRequest(); + $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, RegionInstanceGroupManagerList::class, $request); + } + + /** + * Lists all errors thrown by actions on instances for a given regional managed instance group. The filter and orderBy query parameters are not supported. + * + * Sample code: + * ``` + * $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionInstanceGroupManagersClient->listErrors($instanceGroupManager, $project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionInstanceGroupManagersClient->listErrors($instanceGroupManager, $project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionInstanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. This should conform to RFC1035. + * @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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 listErrors($instanceGroupManager, $project, $region, array $optionalArgs = []) + { + $request = new ListErrorsRegionInstanceGroupManagersRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('ListErrors', $optionalArgs, RegionInstanceGroupManagersListErrorsResponse::class, $request); + } + + /** + * Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances. The orderBy query parameter is not supported. The `pageToken` query parameter is supported only if the group's `listManagedInstancesResults` field is set to `PAGINATED`. + * + * Sample code: + * ``` + * $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionInstanceGroupManagersClient->listManagedInstances($instanceGroupManager, $project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionInstanceGroupManagersClient->listManagedInstances($instanceGroupManager, $project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionInstanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 listManagedInstances($instanceGroupManager, $project, $region, array $optionalArgs = []) + { + $request = new ListManagedInstancesRegionInstanceGroupManagersRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('ListManagedInstances', $optionalArgs, RegionInstanceGroupManagersListInstancesResponse::class, $request); + } + + /** + * Lists all of the per-instance configurations defined for the managed instance group. The orderBy query parameter is not supported. + * + * Sample code: + * ``` + * $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionInstanceGroupManagersClient->listPerInstanceConfigs($instanceGroupManager, $project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionInstanceGroupManagersClient->listPerInstanceConfigs($instanceGroupManager, $project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionInstanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request, should conform to RFC1035. + * @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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 listPerInstanceConfigs($instanceGroupManager, $project, $region, array $optionalArgs = []) + { + $request = new ListPerInstanceConfigsRegionInstanceGroupManagersRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('ListPerInstanceConfigs', $optionalArgs, RegionInstanceGroupManagersListInstanceConfigsResp::class, $request); + } + + /** + * Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. If you update your group to specify a new template or instance configuration, it's possible that your intended specification for each VM in the group is different from the current state of that VM. To learn how to apply an updated configuration to the VMs in a MIG, see Updating instances in a MIG. + * + * Sample code: + * ``` + * $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $instanceGroupManagerResource = new InstanceGroupManager(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionInstanceGroupManagersClient->patch($instanceGroupManager, $instanceGroupManagerResource, $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 = $regionInstanceGroupManagersClient->patch($instanceGroupManager, $instanceGroupManagerResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceGroupManagersClient->resumeOperation($operationName, 'patch'); + * 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 { + * $regionInstanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the instance group manager. + * @param InstanceGroupManager $instanceGroupManagerResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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 patch($instanceGroupManager, $instanceGroupManagerResource, $project, $region, array $optionalArgs = []) + { + $request = new PatchRegionInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setInstanceGroupManagerResource($instanceGroupManagerResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Inserts or patches per-instance configurations for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. + * + * Sample code: + * ``` + * $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $region = 'region'; + * $regionInstanceGroupManagerPatchInstanceConfigReqResource = new RegionInstanceGroupManagerPatchInstanceConfigReq(); + * $operationResponse = $regionInstanceGroupManagersClient->patchPerInstanceConfigs($instanceGroupManager, $project, $region, $regionInstanceGroupManagerPatchInstanceConfigReqResource); + * $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 = $regionInstanceGroupManagersClient->patchPerInstanceConfigs($instanceGroupManager, $project, $region, $regionInstanceGroupManagerPatchInstanceConfigReqResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceGroupManagersClient->resumeOperation($operationName, 'patchPerInstanceConfigs'); + * 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 { + * $regionInstanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request, should conform to RFC1035. + * @param RegionInstanceGroupManagerPatchInstanceConfigReq $regionInstanceGroupManagerPatchInstanceConfigReqResource The body resource 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 patchPerInstanceConfigs($instanceGroupManager, $project, $region, $regionInstanceGroupManagerPatchInstanceConfigReqResource, array $optionalArgs = []) + { + $request = new PatchPerInstanceConfigsRegionInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionInstanceGroupManagerPatchInstanceConfigReqResource($regionInstanceGroupManagerPatchInstanceConfigReqResource); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('PatchPerInstanceConfigs', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group's current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking its currentAction field; for more information, see Checking the status of managed instances. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request. + * + * Sample code: + * ``` + * $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $region = 'region'; + * $regionInstanceGroupManagersRecreateRequestResource = new RegionInstanceGroupManagersRecreateRequest(); + * $operationResponse = $regionInstanceGroupManagersClient->recreateInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersRecreateRequestResource); + * $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 = $regionInstanceGroupManagersClient->recreateInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersRecreateRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceGroupManagersClient->resumeOperation($operationName, 'recreateInstances'); + * 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 { + * $regionInstanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager Name of the managed instance group. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param RegionInstanceGroupManagersRecreateRequest $regionInstanceGroupManagersRecreateRequestResource The body resource 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 recreateInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersRecreateRequestResource, array $optionalArgs = []) + { + $request = new RecreateInstancesRegionInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionInstanceGroupManagersRecreateRequestResource($regionInstanceGroupManagersRecreateRequestResource); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('RecreateInstances', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Changes the intended size of the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances. The resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + * + * Sample code: + * ``` + * $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $region = 'region'; + * $size = 0; + * $operationResponse = $regionInstanceGroupManagersClient->resize($instanceGroupManager, $project, $region, $size); + * $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 = $regionInstanceGroupManagersClient->resize($instanceGroupManager, $project, $region, $size); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceGroupManagersClient->resumeOperation($operationName, 'resize'); + * 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 { + * $regionInstanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager Name of the managed instance group. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param int $size Number of instances that should exist in this instance group manager. + * @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 resize($instanceGroupManager, $project, $region, $size, array $optionalArgs = []) + { + $request = new ResizeRegionInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setRegion($region); + $request->setSize($size); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('Resize', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. + * + * Sample code: + * ``` + * $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $region = 'region'; + * $regionInstanceGroupManagersSetTemplateRequestResource = new RegionInstanceGroupManagersSetTemplateRequest(); + * $operationResponse = $regionInstanceGroupManagersClient->setInstanceTemplate($instanceGroupManager, $project, $region, $regionInstanceGroupManagersSetTemplateRequestResource); + * $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 = $regionInstanceGroupManagersClient->setInstanceTemplate($instanceGroupManager, $project, $region, $regionInstanceGroupManagersSetTemplateRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceGroupManagersClient->resumeOperation($operationName, 'setInstanceTemplate'); + * 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 { + * $regionInstanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param RegionInstanceGroupManagersSetTemplateRequest $regionInstanceGroupManagersSetTemplateRequestResource The body resource 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 setInstanceTemplate($instanceGroupManager, $project, $region, $regionInstanceGroupManagersSetTemplateRequestResource, array $optionalArgs = []) + { + $request = new SetInstanceTemplateRegionInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionInstanceGroupManagersSetTemplateRequestResource($regionInstanceGroupManagersSetTemplateRequestResource); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('SetInstanceTemplate', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. + * + * Sample code: + * ``` + * $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $region = 'region'; + * $regionInstanceGroupManagersSetTargetPoolsRequestResource = new RegionInstanceGroupManagersSetTargetPoolsRequest(); + * $operationResponse = $regionInstanceGroupManagersClient->setTargetPools($instanceGroupManager, $project, $region, $regionInstanceGroupManagersSetTargetPoolsRequestResource); + * $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 = $regionInstanceGroupManagersClient->setTargetPools($instanceGroupManager, $project, $region, $regionInstanceGroupManagersSetTargetPoolsRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceGroupManagersClient->resumeOperation($operationName, 'setTargetPools'); + * 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 { + * $regionInstanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager Name of the managed instance group. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param RegionInstanceGroupManagersSetTargetPoolsRequest $regionInstanceGroupManagersSetTargetPoolsRequestResource The body resource 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 setTargetPools($instanceGroupManager, $project, $region, $regionInstanceGroupManagersSetTargetPoolsRequestResource, array $optionalArgs = []) + { + $request = new SetTargetPoolsRegionInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionInstanceGroupManagersSetTargetPoolsRequestResource($regionInstanceGroupManagersSetTargetPoolsRequestResource); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('SetTargetPools', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Inserts or updates per-instance configurations for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. + * + * Sample code: + * ``` + * $regionInstanceGroupManagersClient = new RegionInstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $project = 'project'; + * $region = 'region'; + * $regionInstanceGroupManagerUpdateInstanceConfigReqResource = new RegionInstanceGroupManagerUpdateInstanceConfigReq(); + * $operationResponse = $regionInstanceGroupManagersClient->updatePerInstanceConfigs($instanceGroupManager, $project, $region, $regionInstanceGroupManagerUpdateInstanceConfigReqResource); + * $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 = $regionInstanceGroupManagersClient->updatePerInstanceConfigs($instanceGroupManager, $project, $region, $regionInstanceGroupManagerUpdateInstanceConfigReqResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceGroupManagersClient->resumeOperation($operationName, 'updatePerInstanceConfigs'); + * 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 { + * $regionInstanceGroupManagersClient->close(); + * } + * ``` + * + * @param string $instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request, should conform to RFC1035. + * @param RegionInstanceGroupManagerUpdateInstanceConfigReq $regionInstanceGroupManagerUpdateInstanceConfigReqResource The body resource 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 updatePerInstanceConfigs($instanceGroupManager, $project, $region, $regionInstanceGroupManagerUpdateInstanceConfigReqResource, array $optionalArgs = []) + { + $request = new UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionInstanceGroupManagerUpdateInstanceConfigReqResource($regionInstanceGroupManagerUpdateInstanceConfigReqResource); + $requestParamHeaders['instance_group_manager'] = $instanceGroupManager; + $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('UpdatePerInstanceConfigs', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstanceGroupsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstanceGroupsGapicClient.php new file mode 100644 index 000000000000..1316970cbf16 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstanceGroupsGapicClient.php @@ -0,0 +1,547 @@ +get($instanceGroup, $project, $region); + * } finally { + * $regionInstanceGroupsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionInstanceGroupsClient}. + */ +class RegionInstanceGroupsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionInstanceGroups'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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_groups_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_instance_groups_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_instance_groups_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Returns the specified instance group resource. + * + * Sample code: + * ``` + * $regionInstanceGroupsClient = new RegionInstanceGroupsClient(); + * try { + * $instanceGroup = 'instance_group'; + * $project = 'project'; + * $region = 'region'; + * $response = $regionInstanceGroupsClient->get($instanceGroup, $project, $region); + * } finally { + * $regionInstanceGroupsClient->close(); + * } + * ``` + * + * @param string $instanceGroup Name of the instance group resource to return. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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\InstanceGroup + * + * @throws ApiException if the remote call fails + */ + public function get($instanceGroup, $project, $region, array $optionalArgs = []) + { + $request = new GetRegionInstanceGroupRequest(); + $requestParamHeaders = []; + $request->setInstanceGroup($instanceGroup); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['instance_group'] = $instanceGroup; + $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', InstanceGroup::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves the list of instance group resources contained within the specified region. + * + * Sample code: + * ``` + * $regionInstanceGroupsClient = new RegionInstanceGroupsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionInstanceGroupsClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionInstanceGroupsClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionInstanceGroupsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRegionInstanceGroupsRequest(); + $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, RegionInstanceGroupList::class, $request); + } + + /** + * Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. The orderBy query parameter is not supported. + * + * Sample code: + * ``` + * $regionInstanceGroupsClient = new RegionInstanceGroupsClient(); + * try { + * $instanceGroup = 'instance_group'; + * $project = 'project'; + * $region = 'region'; + * $regionInstanceGroupsListInstancesRequestResource = new RegionInstanceGroupsListInstancesRequest(); + * // Iterate over pages of elements + * $pagedResponse = $regionInstanceGroupsClient->listInstances($instanceGroup, $project, $region, $regionInstanceGroupsListInstancesRequestResource); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionInstanceGroupsClient->listInstances($instanceGroup, $project, $region, $regionInstanceGroupsListInstancesRequestResource); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionInstanceGroupsClient->close(); + * } + * ``` + * + * @param string $instanceGroup Name of the regional instance group for which we want to list the instances. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param RegionInstanceGroupsListInstancesRequest $regionInstanceGroupsListInstancesRequestResource The body resource 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 listInstances($instanceGroup, $project, $region, $regionInstanceGroupsListInstancesRequestResource, array $optionalArgs = []) + { + $request = new ListInstancesRegionInstanceGroupsRequest(); + $requestParamHeaders = []; + $request->setInstanceGroup($instanceGroup); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionInstanceGroupsListInstancesRequestResource($regionInstanceGroupsListInstancesRequestResource); + $requestParamHeaders['instance_group'] = $instanceGroup; + $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('ListInstances', $optionalArgs, RegionInstanceGroupsListInstances::class, $request); + } + + /** + * Sets the named ports for the specified regional instance group. + * + * Sample code: + * ``` + * $regionInstanceGroupsClient = new RegionInstanceGroupsClient(); + * try { + * $instanceGroup = 'instance_group'; + * $project = 'project'; + * $region = 'region'; + * $regionInstanceGroupsSetNamedPortsRequestResource = new RegionInstanceGroupsSetNamedPortsRequest(); + * $operationResponse = $regionInstanceGroupsClient->setNamedPorts($instanceGroup, $project, $region, $regionInstanceGroupsSetNamedPortsRequestResource); + * $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 = $regionInstanceGroupsClient->setNamedPorts($instanceGroup, $project, $region, $regionInstanceGroupsSetNamedPortsRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceGroupsClient->resumeOperation($operationName, 'setNamedPorts'); + * 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 { + * $regionInstanceGroupsClient->close(); + * } + * ``` + * + * @param string $instanceGroup The name of the regional instance group where the named ports are updated. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param RegionInstanceGroupsSetNamedPortsRequest $regionInstanceGroupsSetNamedPortsRequestResource The body resource 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 setNamedPorts($instanceGroup, $project, $region, $regionInstanceGroupsSetNamedPortsRequestResource, array $optionalArgs = []) + { + $request = new SetNamedPortsRegionInstanceGroupRequest(); + $requestParamHeaders = []; + $request->setInstanceGroup($instanceGroup); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionInstanceGroupsSetNamedPortsRequestResource($regionInstanceGroupsSetNamedPortsRequestResource); + $requestParamHeaders['instance_group'] = $instanceGroup; + $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('SetNamedPorts', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstanceTemplatesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstanceTemplatesGapicClient.php new file mode 100644 index 000000000000..d083dc59fe18 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstanceTemplatesGapicClient.php @@ -0,0 +1,544 @@ +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(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionInstanceTemplatesClient}. + */ +class RegionInstanceTemplatesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionInstanceTemplates'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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::supportedTransports. */ + private static function supportedTransports() + { + 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstancesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstancesGapicClient.php new file mode 100644 index 000000000000..a1c469e4987a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstancesGapicClient.php @@ -0,0 +1,329 @@ +bulkInsert($bulkInsertInstanceResourceResource, $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 = $regionInstancesClient->bulkInsert($bulkInsertInstanceResourceResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstancesClient->resumeOperation($operationName, 'bulkInsert'); + * 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 { + * $regionInstancesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionInstancesClient}. + */ +class RegionInstancesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionInstances'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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_instances_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_instances_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_instances_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Creates multiple instances in a given region. Count specifies the number of instances to create. + * + * Sample code: + * ``` + * $regionInstancesClient = new RegionInstancesClient(); + * try { + * $bulkInsertInstanceResourceResource = new BulkInsertInstanceResource(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionInstancesClient->bulkInsert($bulkInsertInstanceResourceResource, $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 = $regionInstancesClient->bulkInsert($bulkInsertInstanceResourceResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstancesClient->resumeOperation($operationName, 'bulkInsert'); + * 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 { + * $regionInstancesClient->close(); + * } + * ``` + * + * @param BulkInsertInstanceResource $bulkInsertInstanceResourceResource 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 bulkInsert($bulkInsertInstanceResourceResource, $project, $region, array $optionalArgs = []) + { + $request = new BulkInsertRegionInstanceRequest(); + $requestParamHeaders = []; + $request->setBulkInsertInstanceResourceResource($bulkInsertInstanceResourceResource); + $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('BulkInsert', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstantSnapshotsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstantSnapshotsGapicClient.php new file mode 100644 index 000000000000..8267898300e4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstantSnapshotsGapicClient.php @@ -0,0 +1,785 @@ +delete($instantSnapshot, $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 = $regionInstantSnapshotsClient->delete($instantSnapshot, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstantSnapshotsClient->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 { + * $regionInstantSnapshotsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionInstantSnapshotsClient}. + */ +class RegionInstantSnapshotsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionInstantSnapshots'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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_instant_snapshots_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_instant_snapshots_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_instant_snapshots_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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 InstantSnapshot resource. Keep in mind that deleting a single instantSnapshot might not necessarily delete all the data on that instantSnapshot. If any data on the instantSnapshot that is marked for deletion is needed for subsequent instantSnapshots, the data will be moved to the next corresponding instantSnapshot. For more information, see Deleting instantSnapshots. + * + * Sample code: + * ``` + * $regionInstantSnapshotsClient = new RegionInstantSnapshotsClient(); + * try { + * $instantSnapshot = 'instant_snapshot'; + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionInstantSnapshotsClient->delete($instantSnapshot, $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 = $regionInstantSnapshotsClient->delete($instantSnapshot, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstantSnapshotsClient->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 { + * $regionInstantSnapshotsClient->close(); + * } + * ``` + * + * @param string $instantSnapshot Name of the InstantSnapshot resource 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($instantSnapshot, $project, $region, array $optionalArgs = []) + { + $request = new DeleteRegionInstantSnapshotRequest(); + $requestParamHeaders = []; + $request->setInstantSnapshot($instantSnapshot); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['instant_snapshot'] = $instantSnapshot; + $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 InstantSnapshot resource in the specified region. + * + * Sample code: + * ``` + * $regionInstantSnapshotsClient = new RegionInstantSnapshotsClient(); + * try { + * $instantSnapshot = 'instant_snapshot'; + * $project = 'project'; + * $region = 'region'; + * $response = $regionInstantSnapshotsClient->get($instantSnapshot, $project, $region); + * } finally { + * $regionInstantSnapshotsClient->close(); + * } + * ``` + * + * @param string $instantSnapshot Name of the InstantSnapshot resource to return. + * @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\InstantSnapshot + * + * @throws ApiException if the remote call fails + */ + public function get($instantSnapshot, $project, $region, array $optionalArgs = []) + { + $request = new GetRegionInstantSnapshotRequest(); + $requestParamHeaders = []; + $request->setInstantSnapshot($instantSnapshot); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['instant_snapshot'] = $instantSnapshot; + $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', InstantSnapshot::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $regionInstantSnapshotsClient = new RegionInstantSnapshotsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resource = 'resource'; + * $response = $regionInstantSnapshotsClient->getIamPolicy($project, $region, $resource); + * } finally { + * $regionInstantSnapshotsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $region, $resource, array $optionalArgs = []) + { + $request = new GetIamPolicyRegionInstantSnapshotRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates an instant snapshot in the specified region. + * + * Sample code: + * ``` + * $regionInstantSnapshotsClient = new RegionInstantSnapshotsClient(); + * try { + * $instantSnapshotResource = new InstantSnapshot(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionInstantSnapshotsClient->insert($instantSnapshotResource, $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 = $regionInstantSnapshotsClient->insert($instantSnapshotResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstantSnapshotsClient->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 { + * $regionInstantSnapshotsClient->close(); + * } + * ``` + * + * @param InstantSnapshot $instantSnapshotResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region 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($instantSnapshotResource, $project, $region, array $optionalArgs = []) + { + $request = new InsertRegionInstantSnapshotRequest(); + $requestParamHeaders = []; + $request->setInstantSnapshotResource($instantSnapshotResource); + $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 the list of InstantSnapshot resources contained within the specified region. + * + * Sample code: + * ``` + * $regionInstantSnapshotsClient = new RegionInstantSnapshotsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionInstantSnapshotsClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionInstantSnapshotsClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionInstantSnapshotsClient->close(); + * } + * ``` + * + * @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 $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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRegionInstantSnapshotsRequest(); + $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, InstantSnapshotList::class, $request); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $regionInstantSnapshotsClient = new RegionInstantSnapshotsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + * $resource = 'resource'; + * $response = $regionInstantSnapshotsClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + * } finally { + * $regionInstantSnapshotsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param RegionSetPolicyRequest $regionSetPolicyRequestResource The body resource for this request + * @param string $resource Name or id of the resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource, array $optionalArgs = []) + { + $request = new SetIamPolicyRegionInstantSnapshotRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Sets the labels on a instantSnapshot in the given region. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + * ``` + * $regionInstantSnapshotsClient = new RegionInstantSnapshotsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + * $resource = 'resource'; + * $operationResponse = $regionInstantSnapshotsClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + * $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 = $regionInstantSnapshotsClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstantSnapshotsClient->resumeOperation($operationName, 'setLabels'); + * 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 { + * $regionInstantSnapshotsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The region for this request. + * @param RegionSetLabelsRequest $regionSetLabelsRequestResource The body resource for this request + * @param string $resource Name or id of the resource 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 setLabels($project, $region, $regionSetLabelsRequestResource, $resource, array $optionalArgs = []) + { + $request = new SetLabelsRegionInstantSnapshotRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + 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('SetLabels', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $regionInstantSnapshotsClient = new RegionInstantSnapshotsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $response = $regionInstantSnapshotsClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + * } finally { + * $regionInstantSnapshotsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $region, $resource, $testPermissionsRequestResource, array $optionalArgs = []) + { + $request = new TestIamPermissionsRegionInstantSnapshotRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionNetworkEndpointGroupsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionNetworkEndpointGroupsGapicClient.php new file mode 100644 index 000000000000..9aebfc83c75f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionNetworkEndpointGroupsGapicClient.php @@ -0,0 +1,801 @@ +attachNetworkEndpoints($networkEndpointGroup, $project, $region, $regionNetworkEndpointGroupsAttachEndpointsRequestResource); + * $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 = $regionNetworkEndpointGroupsClient->attachNetworkEndpoints($networkEndpointGroup, $project, $region, $regionNetworkEndpointGroupsAttachEndpointsRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionNetworkEndpointGroupsClient->resumeOperation($operationName, 'attachNetworkEndpoints'); + * 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 { + * $regionNetworkEndpointGroupsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionNetworkEndpointGroupsClient}. + */ +class RegionNetworkEndpointGroupsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionNetworkEndpointGroups'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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_network_endpoint_groups_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_network_endpoint_groups_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_network_endpoint_groups_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Attach a list of network endpoints to the specified network endpoint group. + * + * Sample code: + * ``` + * $regionNetworkEndpointGroupsClient = new RegionNetworkEndpointGroupsClient(); + * try { + * $networkEndpointGroup = 'network_endpoint_group'; + * $project = 'project'; + * $region = 'region'; + * $regionNetworkEndpointGroupsAttachEndpointsRequestResource = new RegionNetworkEndpointGroupsAttachEndpointsRequest(); + * $operationResponse = $regionNetworkEndpointGroupsClient->attachNetworkEndpoints($networkEndpointGroup, $project, $region, $regionNetworkEndpointGroupsAttachEndpointsRequestResource); + * $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 = $regionNetworkEndpointGroupsClient->attachNetworkEndpoints($networkEndpointGroup, $project, $region, $regionNetworkEndpointGroupsAttachEndpointsRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionNetworkEndpointGroupsClient->resumeOperation($operationName, 'attachNetworkEndpoints'); + * 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 { + * $regionNetworkEndpointGroupsClient->close(); + * } + * ``` + * + * @param string $networkEndpointGroup The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * @param string $project Project ID for this request. + * @param string $region The name of the region where you want to create the network endpoint group. It should comply with RFC1035. + * @param RegionNetworkEndpointGroupsAttachEndpointsRequest $regionNetworkEndpointGroupsAttachEndpointsRequestResource The body resource 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 attachNetworkEndpoints($networkEndpointGroup, $project, $region, $regionNetworkEndpointGroupsAttachEndpointsRequestResource, array $optionalArgs = []) + { + $request = new AttachNetworkEndpointsRegionNetworkEndpointGroupRequest(); + $requestParamHeaders = []; + $request->setNetworkEndpointGroup($networkEndpointGroup); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionNetworkEndpointGroupsAttachEndpointsRequestResource($regionNetworkEndpointGroupsAttachEndpointsRequestResource); + $requestParamHeaders['network_endpoint_group'] = $networkEndpointGroup; + $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('AttachNetworkEndpoints', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes the specified network endpoint group. Note that the NEG cannot be deleted if it is configured as a backend of a backend service. + * + * Sample code: + * ``` + * $regionNetworkEndpointGroupsClient = new RegionNetworkEndpointGroupsClient(); + * try { + * $networkEndpointGroup = 'network_endpoint_group'; + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionNetworkEndpointGroupsClient->delete($networkEndpointGroup, $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 = $regionNetworkEndpointGroupsClient->delete($networkEndpointGroup, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionNetworkEndpointGroupsClient->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 { + * $regionNetworkEndpointGroupsClient->close(); + * } + * ``` + * + * @param string $networkEndpointGroup The name of the network endpoint group to delete. It should comply with RFC1035. + * @param string $project Project ID for this request. + * @param string $region The name of the region where the network endpoint group is located. It should comply with RFC1035. + * @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($networkEndpointGroup, $project, $region, array $optionalArgs = []) + { + $request = new DeleteRegionNetworkEndpointGroupRequest(); + $requestParamHeaders = []; + $request->setNetworkEndpointGroup($networkEndpointGroup); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['network_endpoint_group'] = $networkEndpointGroup; + $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(); + } + + /** + * Detach the network endpoint from the specified network endpoint group. + * + * Sample code: + * ``` + * $regionNetworkEndpointGroupsClient = new RegionNetworkEndpointGroupsClient(); + * try { + * $networkEndpointGroup = 'network_endpoint_group'; + * $project = 'project'; + * $region = 'region'; + * $regionNetworkEndpointGroupsDetachEndpointsRequestResource = new RegionNetworkEndpointGroupsDetachEndpointsRequest(); + * $operationResponse = $regionNetworkEndpointGroupsClient->detachNetworkEndpoints($networkEndpointGroup, $project, $region, $regionNetworkEndpointGroupsDetachEndpointsRequestResource); + * $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 = $regionNetworkEndpointGroupsClient->detachNetworkEndpoints($networkEndpointGroup, $project, $region, $regionNetworkEndpointGroupsDetachEndpointsRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionNetworkEndpointGroupsClient->resumeOperation($operationName, 'detachNetworkEndpoints'); + * 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 { + * $regionNetworkEndpointGroupsClient->close(); + * } + * ``` + * + * @param string $networkEndpointGroup The name of the network endpoint group you are detaching network endpoints from. It should comply with RFC1035. + * @param string $project Project ID for this request. + * @param string $region The name of the region where the network endpoint group is located. It should comply with RFC1035. + * @param RegionNetworkEndpointGroupsDetachEndpointsRequest $regionNetworkEndpointGroupsDetachEndpointsRequestResource The body resource 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). end_interface: MixerMutationRequestBuilder + * @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 detachNetworkEndpoints($networkEndpointGroup, $project, $region, $regionNetworkEndpointGroupsDetachEndpointsRequestResource, array $optionalArgs = []) + { + $request = new DetachNetworkEndpointsRegionNetworkEndpointGroupRequest(); + $requestParamHeaders = []; + $request->setNetworkEndpointGroup($networkEndpointGroup); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionNetworkEndpointGroupsDetachEndpointsRequestResource($regionNetworkEndpointGroupsDetachEndpointsRequestResource); + $requestParamHeaders['network_endpoint_group'] = $networkEndpointGroup; + $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('DetachNetworkEndpoints', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns the specified network endpoint group. + * + * Sample code: + * ``` + * $regionNetworkEndpointGroupsClient = new RegionNetworkEndpointGroupsClient(); + * try { + * $networkEndpointGroup = 'network_endpoint_group'; + * $project = 'project'; + * $region = 'region'; + * $response = $regionNetworkEndpointGroupsClient->get($networkEndpointGroup, $project, $region); + * } finally { + * $regionNetworkEndpointGroupsClient->close(); + * } + * ``` + * + * @param string $networkEndpointGroup The name of the network endpoint group. It should comply with RFC1035. + * @param string $project Project ID for this request. + * @param string $region The name of the region where the network endpoint group is located. It should comply with RFC1035. + * @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\NetworkEndpointGroup + * + * @throws ApiException if the remote call fails + */ + public function get($networkEndpointGroup, $project, $region, array $optionalArgs = []) + { + $request = new GetRegionNetworkEndpointGroupRequest(); + $requestParamHeaders = []; + $request->setNetworkEndpointGroup($networkEndpointGroup); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['network_endpoint_group'] = $networkEndpointGroup; + $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', NetworkEndpointGroup::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a network endpoint group in the specified project using the parameters that are included in the request. + * + * Sample code: + * ``` + * $regionNetworkEndpointGroupsClient = new RegionNetworkEndpointGroupsClient(); + * try { + * $networkEndpointGroupResource = new NetworkEndpointGroup(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionNetworkEndpointGroupsClient->insert($networkEndpointGroupResource, $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 = $regionNetworkEndpointGroupsClient->insert($networkEndpointGroupResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionNetworkEndpointGroupsClient->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 { + * $regionNetworkEndpointGroupsClient->close(); + * } + * ``` + * + * @param NetworkEndpointGroup $networkEndpointGroupResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region The name of the region where you want to create the network endpoint group. It should comply with RFC1035. + * @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($networkEndpointGroupResource, $project, $region, array $optionalArgs = []) + { + $request = new InsertRegionNetworkEndpointGroupRequest(); + $requestParamHeaders = []; + $request->setNetworkEndpointGroupResource($networkEndpointGroupResource); + $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 the list of regional network endpoint groups available to the specified project in the given region. + * + * Sample code: + * ``` + * $regionNetworkEndpointGroupsClient = new RegionNetworkEndpointGroupsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionNetworkEndpointGroupsClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionNetworkEndpointGroupsClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionNetworkEndpointGroupsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region where the network endpoint group is located. It should comply with RFC1035. + * @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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRegionNetworkEndpointGroupsRequest(); + $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, NetworkEndpointGroupList::class, $request); + } + + /** + * Lists the network endpoints in the specified network endpoint group. + * + * Sample code: + * ``` + * $regionNetworkEndpointGroupsClient = new RegionNetworkEndpointGroupsClient(); + * try { + * $networkEndpointGroup = 'network_endpoint_group'; + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionNetworkEndpointGroupsClient->listNetworkEndpoints($networkEndpointGroup, $project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionNetworkEndpointGroupsClient->listNetworkEndpoints($networkEndpointGroup, $project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionNetworkEndpointGroupsClient->close(); + * } + * ``` + * + * @param string $networkEndpointGroup The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * @param string $project Project ID for this request. + * @param string $region The name of the region where the network endpoint group is located. It should comply with RFC1035. + * @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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 listNetworkEndpoints($networkEndpointGroup, $project, $region, array $optionalArgs = []) + { + $request = new ListNetworkEndpointsRegionNetworkEndpointGroupsRequest(); + $requestParamHeaders = []; + $request->setNetworkEndpointGroup($networkEndpointGroup); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['network_endpoint_group'] = $networkEndpointGroup; + $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('ListNetworkEndpoints', $optionalArgs, NetworkEndpointGroupsListNetworkEndpoints::class, $request); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionNetworkFirewallPoliciesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionNetworkFirewallPoliciesGapicClient.php new file mode 100644 index 000000000000..c6d192529dd4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionNetworkFirewallPoliciesGapicClient.php @@ -0,0 +1,1456 @@ +addAssociation($firewallPolicy, $firewallPolicyAssociationResource, $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 = $regionNetworkFirewallPoliciesClient->addAssociation($firewallPolicy, $firewallPolicyAssociationResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionNetworkFirewallPoliciesClient->resumeOperation($operationName, 'addAssociation'); + * 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 { + * $regionNetworkFirewallPoliciesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionNetworkFirewallPoliciesClient}. + */ +class RegionNetworkFirewallPoliciesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionNetworkFirewallPolicies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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_network_firewall_policies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_network_firewall_policies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_network_firewall_policies_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Inserts an association for the specified network firewall policy. + * + * Sample code: + * ``` + * $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $firewallPolicyAssociationResource = new FirewallPolicyAssociation(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionNetworkFirewallPoliciesClient->addAssociation($firewallPolicy, $firewallPolicyAssociationResource, $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 = $regionNetworkFirewallPoliciesClient->addAssociation($firewallPolicy, $firewallPolicyAssociationResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionNetworkFirewallPoliciesClient->resumeOperation($operationName, 'addAssociation'); + * 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 { + * $regionNetworkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to update. + * @param FirewallPolicyAssociation $firewallPolicyAssociationResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param array $optionalArgs { + * Optional. + * + * @type bool $replaceExistingAssociation + * Indicates whether or not to replace it if an association already exists. This is false by default, in which case an error will be returned if an association already exists. + * @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 addAssociation($firewallPolicy, $firewallPolicyAssociationResource, $project, $region, array $optionalArgs = []) + { + $request = new AddAssociationRegionNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setFirewallPolicyAssociationResource($firewallPolicyAssociationResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + if (isset($optionalArgs['replaceExistingAssociation'])) { + $request->setReplaceExistingAssociation($optionalArgs['replaceExistingAssociation']); + } + + 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('AddAssociation', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Inserts a rule into a network firewall policy. + * + * Sample code: + * ``` + * $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $firewallPolicyRuleResource = new FirewallPolicyRule(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionNetworkFirewallPoliciesClient->addRule($firewallPolicy, $firewallPolicyRuleResource, $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 = $regionNetworkFirewallPoliciesClient->addRule($firewallPolicy, $firewallPolicyRuleResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionNetworkFirewallPoliciesClient->resumeOperation($operationName, 'addRule'); + * 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 { + * $regionNetworkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to update. + * @param FirewallPolicyRule $firewallPolicyRuleResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $maxPriority + * When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority. + * @type int $minPriority + * When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority. + * @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 addRule($firewallPolicy, $firewallPolicyRuleResource, $project, $region, array $optionalArgs = []) + { + $request = new AddRuleRegionNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setFirewallPolicyRuleResource($firewallPolicyRuleResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + if (isset($optionalArgs['maxPriority'])) { + $request->setMaxPriority($optionalArgs['maxPriority']); + } + + if (isset($optionalArgs['minPriority'])) { + $request->setMinPriority($optionalArgs['minPriority']); + } + + 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('AddRule', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Copies rules to the specified network firewall policy. + * + * Sample code: + * ``` + * $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionNetworkFirewallPoliciesClient->cloneRules($firewallPolicy, $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 = $regionNetworkFirewallPoliciesClient->cloneRules($firewallPolicy, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionNetworkFirewallPoliciesClient->resumeOperation($operationName, 'cloneRules'); + * 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 { + * $regionNetworkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to update. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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 string $sourceFirewallPolicy + * The firewall policy from which to copy rules. + * @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 cloneRules($firewallPolicy, $project, $region, array $optionalArgs = []) + { + $request = new CloneRulesRegionNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['sourceFirewallPolicy'])) { + $request->setSourceFirewallPolicy($optionalArgs['sourceFirewallPolicy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CloneRules', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes the specified network firewall policy. + * + * Sample code: + * ``` + * $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionNetworkFirewallPoliciesClient->delete($firewallPolicy, $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 = $regionNetworkFirewallPoliciesClient->delete($firewallPolicy, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionNetworkFirewallPoliciesClient->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 { + * $regionNetworkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to delete. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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($firewallPolicy, $project, $region, array $optionalArgs = []) + { + $request = new DeleteRegionNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $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 network firewall policy. + * + * Sample code: + * ``` + * $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $project = 'project'; + * $region = 'region'; + * $response = $regionNetworkFirewallPoliciesClient->get($firewallPolicy, $project, $region); + * } finally { + * $regionNetworkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to get. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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\FirewallPolicy + * + * @throws ApiException if the remote call fails + */ + public function get($firewallPolicy, $project, $region, array $optionalArgs = []) + { + $request = new GetRegionNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $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', FirewallPolicy::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets an association with the specified name. + * + * Sample code: + * ``` + * $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $project = 'project'; + * $region = 'region'; + * $response = $regionNetworkFirewallPoliciesClient->getAssociation($firewallPolicy, $project, $region); + * } finally { + * $regionNetworkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to which the queried association belongs. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * The name of the association to get from the firewall policy. + * @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\FirewallPolicyAssociation + * + * @throws ApiException if the remote call fails + */ + public function getAssociation($firewallPolicy, $project, $region, array $optionalArgs = []) + { + $request = new GetAssociationRegionNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetAssociation', FirewallPolicyAssociation::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the effective firewalls on a given network. + * + * Sample code: + * ``` + * $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + * try { + * $network = 'network'; + * $project = 'project'; + * $region = 'region'; + * $response = $regionNetworkFirewallPoliciesClient->getEffectiveFirewalls($network, $project, $region); + * } finally { + * $regionNetworkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $network Network reference + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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\RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse + * + * @throws ApiException if the remote call fails + */ + public function getEffectiveFirewalls($network, $project, $region, array $optionalArgs = []) + { + $request = new GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setNetwork($network); + $request->setProject($project); + $request->setRegion($region); + $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('GetEffectiveFirewalls', RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resource = 'resource'; + * $response = $regionNetworkFirewallPoliciesClient->getIamPolicy($project, $region, $resource); + * } finally { + * $regionNetworkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $region, $resource, array $optionalArgs = []) + { + $request = new GetIamPolicyRegionNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a rule of the specified priority. + * + * Sample code: + * ``` + * $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $project = 'project'; + * $region = 'region'; + * $response = $regionNetworkFirewallPoliciesClient->getRule($firewallPolicy, $project, $region); + * } finally { + * $regionNetworkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to which the queried rule belongs. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $priority + * The priority of the rule to get from the firewall policy. + * @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\FirewallPolicyRule + * + * @throws ApiException if the remote call fails + */ + public function getRule($firewallPolicy, $project, $region, array $optionalArgs = []) + { + $request = new GetRuleRegionNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + if (isset($optionalArgs['priority'])) { + $request->setPriority($optionalArgs['priority']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetRule', FirewallPolicyRule::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a new network firewall policy in the specified project and region. + * + * Sample code: + * ``` + * $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + * try { + * $firewallPolicyResource = new FirewallPolicy(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionNetworkFirewallPoliciesClient->insert($firewallPolicyResource, $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 = $regionNetworkFirewallPoliciesClient->insert($firewallPolicyResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionNetworkFirewallPoliciesClient->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 { + * $regionNetworkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param FirewallPolicy $firewallPolicyResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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($firewallPolicyResource, $project, $region, array $optionalArgs = []) + { + $request = new InsertRegionNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicyResource($firewallPolicyResource); + $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(); + } + + /** + * Lists all the network firewall policies that have been configured for the specified project in the given region. + * + * Sample code: + * ``` + * $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionNetworkFirewallPoliciesClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionNetworkFirewallPoliciesClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionNetworkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRegionNetworkFirewallPoliciesRequest(); + $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, FirewallPolicyList::class, $request); + } + + /** + * Patches the specified network firewall policy. + * + * Sample code: + * ``` + * $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $firewallPolicyResource = new FirewallPolicy(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionNetworkFirewallPoliciesClient->patch($firewallPolicy, $firewallPolicyResource, $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 = $regionNetworkFirewallPoliciesClient->patch($firewallPolicy, $firewallPolicyResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionNetworkFirewallPoliciesClient->resumeOperation($operationName, 'patch'); + * 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 { + * $regionNetworkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to update. + * @param FirewallPolicy $firewallPolicyResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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 patch($firewallPolicy, $firewallPolicyResource, $project, $region, array $optionalArgs = []) + { + $request = new PatchRegionNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setFirewallPolicyResource($firewallPolicyResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Patches a rule of the specified priority. + * + * Sample code: + * ``` + * $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $firewallPolicyRuleResource = new FirewallPolicyRule(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionNetworkFirewallPoliciesClient->patchRule($firewallPolicy, $firewallPolicyRuleResource, $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 = $regionNetworkFirewallPoliciesClient->patchRule($firewallPolicy, $firewallPolicyRuleResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionNetworkFirewallPoliciesClient->resumeOperation($operationName, 'patchRule'); + * 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 { + * $regionNetworkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to update. + * @param FirewallPolicyRule $firewallPolicyRuleResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $priority + * The priority of the rule to patch. + * @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 patchRule($firewallPolicy, $firewallPolicyRuleResource, $project, $region, array $optionalArgs = []) + { + $request = new PatchRuleRegionNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setFirewallPolicyRuleResource($firewallPolicyRuleResource); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + if (isset($optionalArgs['priority'])) { + $request->setPriority($optionalArgs['priority']); + } + + 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('PatchRule', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Removes an association for the specified network firewall policy. + * + * Sample code: + * ``` + * $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionNetworkFirewallPoliciesClient->removeAssociation($firewallPolicy, $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 = $regionNetworkFirewallPoliciesClient->removeAssociation($firewallPolicy, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionNetworkFirewallPoliciesClient->resumeOperation($operationName, 'removeAssociation'); + * 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 { + * $regionNetworkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to update. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param array $optionalArgs { + * Optional. + * + * @type string $name + * Name for the association that will be removed. + * @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 removeAssociation($firewallPolicy, $project, $region, array $optionalArgs = []) + { + $request = new RemoveAssociationRegionNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + if (isset($optionalArgs['name'])) { + $request->setName($optionalArgs['name']); + } + + 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('RemoveAssociation', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes a rule of the specified priority. + * + * Sample code: + * ``` + * $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + * try { + * $firewallPolicy = 'firewall_policy'; + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionNetworkFirewallPoliciesClient->removeRule($firewallPolicy, $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 = $regionNetworkFirewallPoliciesClient->removeRule($firewallPolicy, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionNetworkFirewallPoliciesClient->resumeOperation($operationName, 'removeRule'); + * 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 { + * $regionNetworkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $firewallPolicy Name of the firewall policy to update. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $priority + * The priority of the rule to remove from the firewall policy. + * @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 removeRule($firewallPolicy, $project, $region, array $optionalArgs = []) + { + $request = new RemoveRuleRegionNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setFirewallPolicy($firewallPolicy); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['firewall_policy'] = $firewallPolicy; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + if (isset($optionalArgs['priority'])) { + $request->setPriority($optionalArgs['priority']); + } + + 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('RemoveRule', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + * $resource = 'resource'; + * $response = $regionNetworkFirewallPoliciesClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + * } finally { + * $regionNetworkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param RegionSetPolicyRequest $regionSetPolicyRequestResource The body resource for this request + * @param string $resource Name or id of the resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource, array $optionalArgs = []) + { + $request = new SetIamPolicyRegionNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $regionNetworkFirewallPoliciesClient = new RegionNetworkFirewallPoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $response = $regionNetworkFirewallPoliciesClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + * } finally { + * $regionNetworkFirewallPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $region, $resource, $testPermissionsRequestResource, array $optionalArgs = []) + { + $request = new TestIamPermissionsRegionNetworkFirewallPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionNotificationEndpointsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionNotificationEndpointsGapicClient.php new file mode 100644 index 000000000000..cd7b78a3604c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionNotificationEndpointsGapicClient.php @@ -0,0 +1,544 @@ +delete($notificationEndpoint, $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 = $regionNotificationEndpointsClient->delete($notificationEndpoint, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionNotificationEndpointsClient->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 { + * $regionNotificationEndpointsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionNotificationEndpointsClient}. + */ +class RegionNotificationEndpointsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionNotificationEndpoints'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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_notification_endpoints_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_notification_endpoints_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_notification_endpoints_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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 NotificationEndpoint in the given region + * + * Sample code: + * ``` + * $regionNotificationEndpointsClient = new RegionNotificationEndpointsClient(); + * try { + * $notificationEndpoint = 'notification_endpoint'; + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionNotificationEndpointsClient->delete($notificationEndpoint, $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 = $regionNotificationEndpointsClient->delete($notificationEndpoint, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionNotificationEndpointsClient->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 { + * $regionNotificationEndpointsClient->close(); + * } + * ``` + * + * @param string $notificationEndpoint Name of the NotificationEndpoint resource to delete. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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($notificationEndpoint, $project, $region, array $optionalArgs = []) + { + $request = new DeleteRegionNotificationEndpointRequest(); + $requestParamHeaders = []; + $request->setNotificationEndpoint($notificationEndpoint); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['notification_endpoint'] = $notificationEndpoint; + $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 NotificationEndpoint resource in the given region. + * + * Sample code: + * ``` + * $regionNotificationEndpointsClient = new RegionNotificationEndpointsClient(); + * try { + * $notificationEndpoint = 'notification_endpoint'; + * $project = 'project'; + * $region = 'region'; + * $response = $regionNotificationEndpointsClient->get($notificationEndpoint, $project, $region); + * } finally { + * $regionNotificationEndpointsClient->close(); + * } + * ``` + * + * @param string $notificationEndpoint Name of the NotificationEndpoint resource to return. + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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\NotificationEndpoint + * + * @throws ApiException if the remote call fails + */ + public function get($notificationEndpoint, $project, $region, array $optionalArgs = []) + { + $request = new GetRegionNotificationEndpointRequest(); + $requestParamHeaders = []; + $request->setNotificationEndpoint($notificationEndpoint); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['notification_endpoint'] = $notificationEndpoint; + $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', NotificationEndpoint::class, $optionalArgs, $request)->wait(); + } + + /** + * Create a NotificationEndpoint in the specified project in the given region using the parameters that are included in the request. + * + * Sample code: + * ``` + * $regionNotificationEndpointsClient = new RegionNotificationEndpointsClient(); + * try { + * $notificationEndpointResource = new NotificationEndpoint(); + * $project = 'project'; + * $region = 'region'; + * $operationResponse = $regionNotificationEndpointsClient->insert($notificationEndpointResource, $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 = $regionNotificationEndpointsClient->insert($notificationEndpointResource, $project, $region); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionNotificationEndpointsClient->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 { + * $regionNotificationEndpointsClient->close(); + * } + * ``` + * + * @param NotificationEndpoint $notificationEndpointResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping 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($notificationEndpointResource, $project, $region, array $optionalArgs = []) + { + $request = new InsertRegionNotificationEndpointRequest(); + $requestParamHeaders = []; + $request->setNotificationEndpointResource($notificationEndpointResource); + $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(); + } + + /** + * Lists the NotificationEndpoints for a project in the given region. + * + * Sample code: + * ``` + * $regionNotificationEndpointsClient = new RegionNotificationEndpointsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionNotificationEndpointsClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionNotificationEndpointsClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionNotificationEndpointsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRegionNotificationEndpointsRequest(); + $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, NotificationEndpointList::class, $request); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionOperationsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionOperationsGapicClient.php new file mode 100644 index 000000000000..1c14b34e9e41 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionOperationsGapicClient.php @@ -0,0 +1,410 @@ +delete($operation, $project, $region); + * } finally { + * $regionOperationsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionOperationsClient}. + */ +class RegionOperationsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionOperations'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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 static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_operations_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_operations_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_operations_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** + * Deletes the specified region-specific Operations resource. + * + * Sample code: + * ``` + * $regionOperationsClient = new RegionOperationsClient(); + * try { + * $operation = 'operation'; + * $project = 'project'; + * $region = 'region'; + * $response = $regionOperationsClient->delete($operation, $project, $region); + * } finally { + * $regionOperationsClient->close(); + * } + * ``` + * + * @param string $operation Name of the Operations resource to delete. + * @param string $project Project ID for this request. + * @param string $region 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\DeleteRegionOperationResponse + * + * @throws ApiException if the remote call fails + */ + public function delete($operation, $project, $region, array $optionalArgs = []) + { + $request = new DeleteRegionOperationRequest(); + $requestParamHeaders = []; + $request->setOperation($operation); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['operation'] = $operation; + $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('Delete', DeleteRegionOperationResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves the specified region-specific Operations resource. + * + * Sample code: + * ``` + * $regionOperationsClient = new RegionOperationsClient(); + * try { + * $operation = 'operation'; + * $project = 'project'; + * $region = 'region'; + * $response = $regionOperationsClient->get($operation, $project, $region); + * } finally { + * $regionOperationsClient->close(); + * } + * ``` + * + * @param string $operation Name of the Operations resource to return. + * @param string $project Project ID for this request. + * @param string $region 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\Operation + * + * @throws ApiException if the remote call fails + */ + public function get($operation, $project, $region, array $optionalArgs = []) + { + $request = new GetRegionOperationRequest(); + $requestParamHeaders = []; + $request->setOperation($operation); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['operation'] = $operation; + $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', Operation::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves a list of Operation resources contained within the specified region. + * + * Sample code: + * ``` + * $regionOperationsClient = new RegionOperationsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionOperationsClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionOperationsClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionOperationsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRegionOperationsRequest(); + $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, OperationList::class, $request); + } + + /** + * Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + * + * Sample code: + * ``` + * $regionOperationsClient = new RegionOperationsClient(); + * try { + * $operation = 'operation'; + * $project = 'project'; + * $region = 'region'; + * $response = $regionOperationsClient->wait($operation, $project, $region); + * } finally { + * $regionOperationsClient->close(); + * } + * ``` + * + * @param string $operation Name of the Operations resource to return. + * @param string $project Project ID for this request. + * @param string $region 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\Operation + * + * @throws ApiException if the remote call fails + */ + public function wait($operation, $project, $region, array $optionalArgs = []) + { + $request = new WaitRegionOperationRequest(); + $requestParamHeaders = []; + $request->setOperation($operation); + $request->setProject($project); + $request->setRegion($region); + $requestParamHeaders['operation'] = $operation; + $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('Wait', Operation::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionSecurityPoliciesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionSecurityPoliciesGapicClient.php new file mode 100644 index 000000000000..6033035f8c02 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionSecurityPoliciesGapicClient.php @@ -0,0 +1,941 @@ +addRule($project, $region, $securityPolicy, $securityPolicyRuleResource); + * $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 = $regionSecurityPoliciesClient->addRule($project, $region, $securityPolicy, $securityPolicyRuleResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionSecurityPoliciesClient->resumeOperation($operationName, 'addRule'); + * 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 { + * $regionSecurityPoliciesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionSecurityPoliciesClient}. + */ +class RegionSecurityPoliciesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionSecurityPolicies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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_security_policies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_security_policies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_security_policies_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Inserts a rule into a security policy. + * + * Sample code: + * ``` + * $regionSecurityPoliciesClient = new RegionSecurityPoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $securityPolicy = 'security_policy'; + * $securityPolicyRuleResource = new SecurityPolicyRule(); + * $operationResponse = $regionSecurityPoliciesClient->addRule($project, $region, $securityPolicy, $securityPolicyRuleResource); + * $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 = $regionSecurityPoliciesClient->addRule($project, $region, $securityPolicy, $securityPolicyRuleResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionSecurityPoliciesClient->resumeOperation($operationName, 'addRule'); + * 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 { + * $regionSecurityPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $securityPolicy Name of the security policy to update. + * @param SecurityPolicyRule $securityPolicyRuleResource The body resource for this request + * @param array $optionalArgs { + * Optional. + * + * @type bool $validateOnly + * If true, the request will not be committed. + * @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 addRule($project, $region, $securityPolicy, $securityPolicyRuleResource, array $optionalArgs = []) + { + $request = new AddRuleRegionSecurityPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setSecurityPolicy($securityPolicy); + $request->setSecurityPolicyRuleResource($securityPolicyRuleResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['security_policy'] = $securityPolicy; + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('AddRule', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes the specified policy. + * + * Sample code: + * ``` + * $regionSecurityPoliciesClient = new RegionSecurityPoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $securityPolicy = 'security_policy'; + * $operationResponse = $regionSecurityPoliciesClient->delete($project, $region, $securityPolicy); + * $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 = $regionSecurityPoliciesClient->delete($project, $region, $securityPolicy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionSecurityPoliciesClient->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 { + * $regionSecurityPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $securityPolicy Name of the security policy to delete. + * @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($project, $region, $securityPolicy, array $optionalArgs = []) + { + $request = new DeleteRegionSecurityPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setSecurityPolicy($securityPolicy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['security_policy'] = $securityPolicy; + 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(); + } + + /** + * List all of the ordered rules present in a single specified policy. + * + * Sample code: + * ``` + * $regionSecurityPoliciesClient = new RegionSecurityPoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $securityPolicy = 'security_policy'; + * $response = $regionSecurityPoliciesClient->get($project, $region, $securityPolicy); + * } finally { + * $regionSecurityPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $securityPolicy Name of the security policy to get. + * @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\SecurityPolicy + * + * @throws ApiException if the remote call fails + */ + public function get($project, $region, $securityPolicy, array $optionalArgs = []) + { + $request = new GetRegionSecurityPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setSecurityPolicy($securityPolicy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['security_policy'] = $securityPolicy; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', SecurityPolicy::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a rule at the specified priority. + * + * Sample code: + * ``` + * $regionSecurityPoliciesClient = new RegionSecurityPoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $securityPolicy = 'security_policy'; + * $response = $regionSecurityPoliciesClient->getRule($project, $region, $securityPolicy); + * } finally { + * $regionSecurityPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $securityPolicy Name of the security policy to which the queried rule belongs. + * @param array $optionalArgs { + * Optional. + * + * @type int $priority + * The priority of the rule to get from the security policy. + * @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\SecurityPolicyRule + * + * @throws ApiException if the remote call fails + */ + public function getRule($project, $region, $securityPolicy, array $optionalArgs = []) + { + $request = new GetRuleRegionSecurityPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setSecurityPolicy($securityPolicy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['security_policy'] = $securityPolicy; + if (isset($optionalArgs['priority'])) { + $request->setPriority($optionalArgs['priority']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetRule', SecurityPolicyRule::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a new policy in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $regionSecurityPoliciesClient = new RegionSecurityPoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $securityPolicyResource = new SecurityPolicy(); + * $operationResponse = $regionSecurityPoliciesClient->insert($project, $region, $securityPolicyResource); + * $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 = $regionSecurityPoliciesClient->insert($project, $region, $securityPolicyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionSecurityPoliciesClient->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 { + * $regionSecurityPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param SecurityPolicy $securityPolicyResource The body resource 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 bool $validateOnly + * If true, the request will not be committed. + * @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($project, $region, $securityPolicyResource, array $optionalArgs = []) + { + $request = new InsertRegionSecurityPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setSecurityPolicyResource($securityPolicyResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('Insert', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * List all the policies that have been configured for the specified project and region. + * + * Sample code: + * ``` + * $regionSecurityPoliciesClient = new RegionSecurityPoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionSecurityPoliciesClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionSecurityPoliciesClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionSecurityPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRegionSecurityPoliciesRequest(); + $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, SecurityPolicyList::class, $request); + } + + /** + * Patches the specified policy with the data included in the request. To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead. + * + * Sample code: + * ``` + * $regionSecurityPoliciesClient = new RegionSecurityPoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $securityPolicy = 'security_policy'; + * $securityPolicyResource = new SecurityPolicy(); + * $operationResponse = $regionSecurityPoliciesClient->patch($project, $region, $securityPolicy, $securityPolicyResource); + * $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 = $regionSecurityPoliciesClient->patch($project, $region, $securityPolicy, $securityPolicyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionSecurityPoliciesClient->resumeOperation($operationName, 'patch'); + * 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 { + * $regionSecurityPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $securityPolicy Name of the security policy to update. + * @param SecurityPolicy $securityPolicyResource The body resource 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 string $updateMask + * Indicates fields to be cleared 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 patch($project, $region, $securityPolicy, $securityPolicyResource, array $optionalArgs = []) + { + $request = new PatchRegionSecurityPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setSecurityPolicy($securityPolicy); + $request->setSecurityPolicyResource($securityPolicyResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['security_policy'] = $securityPolicy; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Patches a rule at the specified priority. To clear fields in the rule, leave the fields empty and specify them in the updateMask. + * + * Sample code: + * ``` + * $regionSecurityPoliciesClient = new RegionSecurityPoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $securityPolicy = 'security_policy'; + * $securityPolicyRuleResource = new SecurityPolicyRule(); + * $operationResponse = $regionSecurityPoliciesClient->patchRule($project, $region, $securityPolicy, $securityPolicyRuleResource); + * $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 = $regionSecurityPoliciesClient->patchRule($project, $region, $securityPolicy, $securityPolicyRuleResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionSecurityPoliciesClient->resumeOperation($operationName, 'patchRule'); + * 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 { + * $regionSecurityPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $securityPolicy Name of the security policy to update. + * @param SecurityPolicyRule $securityPolicyRuleResource The body resource for this request + * @param array $optionalArgs { + * Optional. + * + * @type int $priority + * The priority of the rule to patch. + * @type string $updateMask + * Indicates fields to be cleared as part of this request. + * @type bool $validateOnly + * If true, the request will not be committed. + * @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 patchRule($project, $region, $securityPolicy, $securityPolicyRuleResource, array $optionalArgs = []) + { + $request = new PatchRuleRegionSecurityPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setSecurityPolicy($securityPolicy); + $request->setSecurityPolicyRuleResource($securityPolicyRuleResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['security_policy'] = $securityPolicy; + if (isset($optionalArgs['priority'])) { + $request->setPriority($optionalArgs['priority']); + } + + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('PatchRule', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes a rule at the specified priority. + * + * Sample code: + * ``` + * $regionSecurityPoliciesClient = new RegionSecurityPoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $securityPolicy = 'security_policy'; + * $operationResponse = $regionSecurityPoliciesClient->removeRule($project, $region, $securityPolicy); + * $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 = $regionSecurityPoliciesClient->removeRule($project, $region, $securityPolicy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionSecurityPoliciesClient->resumeOperation($operationName, 'removeRule'); + * 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 { + * $regionSecurityPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $securityPolicy Name of the security policy to update. + * @param array $optionalArgs { + * Optional. + * + * @type int $priority + * The priority of the rule to remove from the security policy. + * @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 removeRule($project, $region, $securityPolicy, array $optionalArgs = []) + { + $request = new RemoveRuleRegionSecurityPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setSecurityPolicy($securityPolicy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['security_policy'] = $securityPolicy; + if (isset($optionalArgs['priority'])) { + $request->setPriority($optionalArgs['priority']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('RemoveRule', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionSslCertificatesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionSslCertificatesGapicClient.php new file mode 100644 index 000000000000..12077907c6d2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionSslCertificatesGapicClient.php @@ -0,0 +1,544 @@ +delete($project, $region, $sslCertificate); + * $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 = $regionSslCertificatesClient->delete($project, $region, $sslCertificate); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionSslCertificatesClient->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 { + * $regionSslCertificatesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionSslCertificatesClient}. + */ +class RegionSslCertificatesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionSslCertificates'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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_ssl_certificates_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_ssl_certificates_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_ssl_certificates_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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 SslCertificate resource in the region. + * + * Sample code: + * ``` + * $regionSslCertificatesClient = new RegionSslCertificatesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $sslCertificate = 'ssl_certificate'; + * $operationResponse = $regionSslCertificatesClient->delete($project, $region, $sslCertificate); + * $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 = $regionSslCertificatesClient->delete($project, $region, $sslCertificate); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionSslCertificatesClient->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 { + * $regionSslCertificatesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $sslCertificate Name of the SslCertificate resource to delete. + * @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($project, $region, $sslCertificate, array $optionalArgs = []) + { + $request = new DeleteRegionSslCertificateRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setSslCertificate($sslCertificate); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['ssl_certificate'] = $sslCertificate; + 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 SslCertificate resource in the specified region. Get a list of available SSL certificates by making a list() request. + * + * Sample code: + * ``` + * $regionSslCertificatesClient = new RegionSslCertificatesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $sslCertificate = 'ssl_certificate'; + * $response = $regionSslCertificatesClient->get($project, $region, $sslCertificate); + * } finally { + * $regionSslCertificatesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $sslCertificate Name of the SslCertificate resource to return. + * @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\SslCertificate + * + * @throws ApiException if the remote call fails + */ + public function get($project, $region, $sslCertificate, array $optionalArgs = []) + { + $request = new GetRegionSslCertificateRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setSslCertificate($sslCertificate); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['ssl_certificate'] = $sslCertificate; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', SslCertificate::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a SslCertificate resource in the specified project and region using the data included in the request + * + * Sample code: + * ``` + * $regionSslCertificatesClient = new RegionSslCertificatesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $sslCertificateResource = new SslCertificate(); + * $operationResponse = $regionSslCertificatesClient->insert($project, $region, $sslCertificateResource); + * $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 = $regionSslCertificatesClient->insert($project, $region, $sslCertificateResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionSslCertificatesClient->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 { + * $regionSslCertificatesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param SslCertificate $sslCertificateResource The body resource 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($project, $region, $sslCertificateResource, array $optionalArgs = []) + { + $request = new InsertRegionSslCertificateRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setSslCertificateResource($sslCertificateResource); + $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 the list of SslCertificate resources available to the specified project in the specified region. + * + * Sample code: + * ``` + * $regionSslCertificatesClient = new RegionSslCertificatesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionSslCertificatesClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionSslCertificatesClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionSslCertificatesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRegionSslCertificatesRequest(); + $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, SslCertificateList::class, $request); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionSslPoliciesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionSslPoliciesGapicClient.php new file mode 100644 index 000000000000..c9921f509d37 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionSslPoliciesGapicClient.php @@ -0,0 +1,699 @@ +delete($project, $region, $sslPolicy); + * $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 = $regionSslPoliciesClient->delete($project, $region, $sslPolicy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionSslPoliciesClient->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 { + * $regionSslPoliciesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionSslPoliciesClient}. + */ +class RegionSslPoliciesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionSslPolicies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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_ssl_policies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_ssl_policies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_ssl_policies_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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 SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources. + * + * Sample code: + * ``` + * $regionSslPoliciesClient = new RegionSslPoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $sslPolicy = 'ssl_policy'; + * $operationResponse = $regionSslPoliciesClient->delete($project, $region, $sslPolicy); + * $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 = $regionSslPoliciesClient->delete($project, $region, $sslPolicy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionSslPoliciesClient->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 { + * $regionSslPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $sslPolicy Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. + * @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($project, $region, $sslPolicy, array $optionalArgs = []) + { + $request = new DeleteRegionSslPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setSslPolicy($sslPolicy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['ssl_policy'] = $sslPolicy; + 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(); + } + + /** + * Lists all of the ordered rules present in a single specified policy. + * + * Sample code: + * ``` + * $regionSslPoliciesClient = new RegionSslPoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $sslPolicy = 'ssl_policy'; + * $response = $regionSslPoliciesClient->get($project, $region, $sslPolicy); + * } finally { + * $regionSslPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * @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\SslPolicy + * + * @throws ApiException if the remote call fails + */ + public function get($project, $region, $sslPolicy, array $optionalArgs = []) + { + $request = new GetRegionSslPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setSslPolicy($sslPolicy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['ssl_policy'] = $sslPolicy; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', SslPolicy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a new policy in the specified project and region using the data included in the request. + * + * Sample code: + * ``` + * $regionSslPoliciesClient = new RegionSslPoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $sslPolicyResource = new SslPolicy(); + * $operationResponse = $regionSslPoliciesClient->insert($project, $region, $sslPolicyResource); + * $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 = $regionSslPoliciesClient->insert($project, $region, $sslPolicyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionSslPoliciesClient->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 { + * $regionSslPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param SslPolicy $sslPolicyResource The body resource 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($project, $region, $sslPolicyResource, array $optionalArgs = []) + { + $request = new InsertRegionSslPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setSslPolicyResource($sslPolicyResource); + $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(); + } + + /** + * Lists all the SSL policies that have been configured for the specified project and region. + * + * Sample code: + * ``` + * $regionSslPoliciesClient = new RegionSslPoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionSslPoliciesClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionSslPoliciesClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionSslPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRegionSslPoliciesRequest(); + $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, SslPoliciesList::class, $request); + } + + /** + * Lists all features that can be specified in the SSL policy when using custom profile. + * + * Sample code: + * ``` + * $regionSslPoliciesClient = new RegionSslPoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $response = $regionSslPoliciesClient->listAvailableFeatures($project, $region); + * } finally { + * $regionSslPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * 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 bool $returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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\SslPoliciesListAvailableFeaturesResponse + * + * @throws ApiException if the remote call fails + */ + public function listAvailableFeatures($project, $region, array $optionalArgs = []) + { + $request = new ListAvailableFeaturesRegionSslPoliciesRequest(); + $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->startCall('ListAvailableFeatures', SslPoliciesListAvailableFeaturesResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Patches the specified SSL policy with the data included in the request. + * + * Sample code: + * ``` + * $regionSslPoliciesClient = new RegionSslPoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $sslPolicy = 'ssl_policy'; + * $sslPolicyResource = new SslPolicy(); + * $operationResponse = $regionSslPoliciesClient->patch($project, $region, $sslPolicy, $sslPolicyResource); + * $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 = $regionSslPoliciesClient->patch($project, $region, $sslPolicy, $sslPolicyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionSslPoliciesClient->resumeOperation($operationName, 'patch'); + * 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 { + * $regionSslPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * @param SslPolicy $sslPolicyResource The body resource 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 patch($project, $region, $sslPolicy, $sslPolicyResource, array $optionalArgs = []) + { + $request = new PatchRegionSslPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setSslPolicy($sslPolicy); + $request->setSslPolicyResource($sslPolicyResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['ssl_policy'] = $sslPolicy; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionTargetHttpProxiesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionTargetHttpProxiesGapicClient.php new file mode 100644 index 000000000000..f5b98ce84ada --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionTargetHttpProxiesGapicClient.php @@ -0,0 +1,625 @@ +delete($project, $region, $targetHttpProxy); + * $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 = $regionTargetHttpProxiesClient->delete($project, $region, $targetHttpProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionTargetHttpProxiesClient->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 { + * $regionTargetHttpProxiesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionTargetHttpProxiesClient}. + */ +class RegionTargetHttpProxiesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionTargetHttpProxies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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_target_http_proxies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_target_http_proxies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_target_http_proxies_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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 TargetHttpProxy resource. + * + * Sample code: + * ``` + * $regionTargetHttpProxiesClient = new RegionTargetHttpProxiesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetHttpProxy = 'target_http_proxy'; + * $operationResponse = $regionTargetHttpProxiesClient->delete($project, $region, $targetHttpProxy); + * $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 = $regionTargetHttpProxiesClient->delete($project, $region, $targetHttpProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionTargetHttpProxiesClient->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 { + * $regionTargetHttpProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetHttpProxy Name of the TargetHttpProxy resource to delete. + * @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($project, $region, $targetHttpProxy, array $optionalArgs = []) + { + $request = new DeleteRegionTargetHttpProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetHttpProxy($targetHttpProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['target_http_proxy'] = $targetHttpProxy; + 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 TargetHttpProxy resource in the specified region. + * + * Sample code: + * ``` + * $regionTargetHttpProxiesClient = new RegionTargetHttpProxiesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetHttpProxy = 'target_http_proxy'; + * $response = $regionTargetHttpProxiesClient->get($project, $region, $targetHttpProxy); + * } finally { + * $regionTargetHttpProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetHttpProxy Name of the TargetHttpProxy resource to return. + * @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\TargetHttpProxy + * + * @throws ApiException if the remote call fails + */ + public function get($project, $region, $targetHttpProxy, array $optionalArgs = []) + { + $request = new GetRegionTargetHttpProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetHttpProxy($targetHttpProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['target_http_proxy'] = $targetHttpProxy; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', TargetHttpProxy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a TargetHttpProxy resource in the specified project and region using the data included in the request. + * + * Sample code: + * ``` + * $regionTargetHttpProxiesClient = new RegionTargetHttpProxiesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetHttpProxyResource = new TargetHttpProxy(); + * $operationResponse = $regionTargetHttpProxiesClient->insert($project, $region, $targetHttpProxyResource); + * $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 = $regionTargetHttpProxiesClient->insert($project, $region, $targetHttpProxyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionTargetHttpProxiesClient->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 { + * $regionTargetHttpProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param TargetHttpProxy $targetHttpProxyResource The body resource 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($project, $region, $targetHttpProxyResource, array $optionalArgs = []) + { + $request = new InsertRegionTargetHttpProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetHttpProxyResource($targetHttpProxyResource); + $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 the list of TargetHttpProxy resources available to the specified project in the specified region. + * + * Sample code: + * ``` + * $regionTargetHttpProxiesClient = new RegionTargetHttpProxiesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionTargetHttpProxiesClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionTargetHttpProxiesClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionTargetHttpProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRegionTargetHttpProxiesRequest(); + $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, TargetHttpProxyList::class, $request); + } + + /** + * Changes the URL map for TargetHttpProxy. + * + * Sample code: + * ``` + * $regionTargetHttpProxiesClient = new RegionTargetHttpProxiesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetHttpProxy = 'target_http_proxy'; + * $urlMapReferenceResource = new UrlMapReference(); + * $operationResponse = $regionTargetHttpProxiesClient->setUrlMap($project, $region, $targetHttpProxy, $urlMapReferenceResource); + * $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 = $regionTargetHttpProxiesClient->setUrlMap($project, $region, $targetHttpProxy, $urlMapReferenceResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionTargetHttpProxiesClient->resumeOperation($operationName, 'setUrlMap'); + * 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 { + * $regionTargetHttpProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetHttpProxy Name of the TargetHttpProxy to set a URL map for. + * @param UrlMapReference $urlMapReferenceResource The body resource 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 setUrlMap($project, $region, $targetHttpProxy, $urlMapReferenceResource, array $optionalArgs = []) + { + $request = new SetUrlMapRegionTargetHttpProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetHttpProxy($targetHttpProxy); + $request->setUrlMapReferenceResource($urlMapReferenceResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['target_http_proxy'] = $targetHttpProxy; + 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('SetUrlMap', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionTargetHttpsProxiesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionTargetHttpsProxiesGapicClient.php new file mode 100644 index 000000000000..58209c9fc419 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionTargetHttpsProxiesGapicClient.php @@ -0,0 +1,786 @@ +delete($project, $region, $targetHttpsProxy); + * $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 = $regionTargetHttpsProxiesClient->delete($project, $region, $targetHttpsProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionTargetHttpsProxiesClient->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 { + * $regionTargetHttpsProxiesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionTargetHttpsProxiesClient}. + */ +class RegionTargetHttpsProxiesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionTargetHttpsProxies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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_target_https_proxies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_target_https_proxies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_target_https_proxies_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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 TargetHttpsProxy resource. + * + * Sample code: + * ``` + * $regionTargetHttpsProxiesClient = new RegionTargetHttpsProxiesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetHttpsProxy = 'target_https_proxy'; + * $operationResponse = $regionTargetHttpsProxiesClient->delete($project, $region, $targetHttpsProxy); + * $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 = $regionTargetHttpsProxiesClient->delete($project, $region, $targetHttpsProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionTargetHttpsProxiesClient->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 { + * $regionTargetHttpsProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource to delete. + * @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($project, $region, $targetHttpsProxy, array $optionalArgs = []) + { + $request = new DeleteRegionTargetHttpsProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetHttpsProxy($targetHttpsProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['target_https_proxy'] = $targetHttpsProxy; + 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 TargetHttpsProxy resource in the specified region. + * + * Sample code: + * ``` + * $regionTargetHttpsProxiesClient = new RegionTargetHttpsProxiesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetHttpsProxy = 'target_https_proxy'; + * $response = $regionTargetHttpsProxiesClient->get($project, $region, $targetHttpsProxy); + * } finally { + * $regionTargetHttpsProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource to return. + * @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\TargetHttpsProxy + * + * @throws ApiException if the remote call fails + */ + public function get($project, $region, $targetHttpsProxy, array $optionalArgs = []) + { + $request = new GetRegionTargetHttpsProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetHttpsProxy($targetHttpsProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['target_https_proxy'] = $targetHttpsProxy; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', TargetHttpsProxy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a TargetHttpsProxy resource in the specified project and region using the data included in the request. + * + * Sample code: + * ``` + * $regionTargetHttpsProxiesClient = new RegionTargetHttpsProxiesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetHttpsProxyResource = new TargetHttpsProxy(); + * $operationResponse = $regionTargetHttpsProxiesClient->insert($project, $region, $targetHttpsProxyResource); + * $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 = $regionTargetHttpsProxiesClient->insert($project, $region, $targetHttpsProxyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionTargetHttpsProxiesClient->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 { + * $regionTargetHttpsProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param TargetHttpsProxy $targetHttpsProxyResource The body resource 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($project, $region, $targetHttpsProxyResource, array $optionalArgs = []) + { + $request = new InsertRegionTargetHttpsProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetHttpsProxyResource($targetHttpsProxyResource); + $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 the list of TargetHttpsProxy resources available to the specified project in the specified region. + * + * Sample code: + * ``` + * $regionTargetHttpsProxiesClient = new RegionTargetHttpsProxiesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionTargetHttpsProxiesClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionTargetHttpsProxiesClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionTargetHttpsProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRegionTargetHttpsProxiesRequest(); + $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, TargetHttpsProxyList::class, $request); + } + + /** + * Patches the specified regional TargetHttpsProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $regionTargetHttpsProxiesClient = new RegionTargetHttpsProxiesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetHttpsProxy = 'target_https_proxy'; + * $targetHttpsProxyResource = new TargetHttpsProxy(); + * $operationResponse = $regionTargetHttpsProxiesClient->patch($project, $region, $targetHttpsProxy, $targetHttpsProxyResource); + * $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 = $regionTargetHttpsProxiesClient->patch($project, $region, $targetHttpsProxy, $targetHttpsProxyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionTargetHttpsProxiesClient->resumeOperation($operationName, 'patch'); + * 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 { + * $regionTargetHttpsProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource to patch. + * @param TargetHttpsProxy $targetHttpsProxyResource The body resource 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 patch($project, $region, $targetHttpsProxy, $targetHttpsProxyResource, array $optionalArgs = []) + { + $request = new PatchRegionTargetHttpsProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetHttpsProxy($targetHttpsProxy); + $request->setTargetHttpsProxyResource($targetHttpsProxyResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['target_https_proxy'] = $targetHttpsProxy; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Replaces SslCertificates for TargetHttpsProxy. + * + * Sample code: + * ``` + * $regionTargetHttpsProxiesClient = new RegionTargetHttpsProxiesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $regionTargetHttpsProxiesSetSslCertificatesRequestResource = new RegionTargetHttpsProxiesSetSslCertificatesRequest(); + * $targetHttpsProxy = 'target_https_proxy'; + * $operationResponse = $regionTargetHttpsProxiesClient->setSslCertificates($project, $region, $regionTargetHttpsProxiesSetSslCertificatesRequestResource, $targetHttpsProxy); + * $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 = $regionTargetHttpsProxiesClient->setSslCertificates($project, $region, $regionTargetHttpsProxiesSetSslCertificatesRequestResource, $targetHttpsProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionTargetHttpsProxiesClient->resumeOperation($operationName, 'setSslCertificates'); + * 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 { + * $regionTargetHttpsProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param RegionTargetHttpsProxiesSetSslCertificatesRequest $regionTargetHttpsProxiesSetSslCertificatesRequestResource The body resource for this request + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * @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 setSslCertificates($project, $region, $regionTargetHttpsProxiesSetSslCertificatesRequestResource, $targetHttpsProxy, array $optionalArgs = []) + { + $request = new SetSslCertificatesRegionTargetHttpsProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRegionTargetHttpsProxiesSetSslCertificatesRequestResource($regionTargetHttpsProxiesSetSslCertificatesRequestResource); + $request->setTargetHttpsProxy($targetHttpsProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['target_https_proxy'] = $targetHttpsProxy; + 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('SetSslCertificates', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Changes the URL map for TargetHttpsProxy. + * + * Sample code: + * ``` + * $regionTargetHttpsProxiesClient = new RegionTargetHttpsProxiesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetHttpsProxy = 'target_https_proxy'; + * $urlMapReferenceResource = new UrlMapReference(); + * $operationResponse = $regionTargetHttpsProxiesClient->setUrlMap($project, $region, $targetHttpsProxy, $urlMapReferenceResource); + * $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 = $regionTargetHttpsProxiesClient->setUrlMap($project, $region, $targetHttpsProxy, $urlMapReferenceResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionTargetHttpsProxiesClient->resumeOperation($operationName, 'setUrlMap'); + * 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 { + * $regionTargetHttpsProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetHttpsProxy Name of the TargetHttpsProxy to set a URL map for. + * @param UrlMapReference $urlMapReferenceResource The body resource 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 setUrlMap($project, $region, $targetHttpsProxy, $urlMapReferenceResource, array $optionalArgs = []) + { + $request = new SetUrlMapRegionTargetHttpsProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetHttpsProxy($targetHttpsProxy); + $request->setUrlMapReferenceResource($urlMapReferenceResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['target_https_proxy'] = $targetHttpsProxy; + 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('SetUrlMap', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionTargetTcpProxiesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionTargetTcpProxiesGapicClient.php new file mode 100644 index 000000000000..714555f2b9aa --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionTargetTcpProxiesGapicClient.php @@ -0,0 +1,544 @@ +delete($project, $region, $targetTcpProxy); + * $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 = $regionTargetTcpProxiesClient->delete($project, $region, $targetTcpProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionTargetTcpProxiesClient->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 { + * $regionTargetTcpProxiesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionTargetTcpProxiesClient}. + */ +class RegionTargetTcpProxiesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionTargetTcpProxies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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_target_tcp_proxies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_target_tcp_proxies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_target_tcp_proxies_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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 TargetTcpProxy resource. + * + * Sample code: + * ``` + * $regionTargetTcpProxiesClient = new RegionTargetTcpProxiesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetTcpProxy = 'target_tcp_proxy'; + * $operationResponse = $regionTargetTcpProxiesClient->delete($project, $region, $targetTcpProxy); + * $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 = $regionTargetTcpProxiesClient->delete($project, $region, $targetTcpProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionTargetTcpProxiesClient->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 { + * $regionTargetTcpProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetTcpProxy Name of the TargetTcpProxy resource to delete. + * @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($project, $region, $targetTcpProxy, array $optionalArgs = []) + { + $request = new DeleteRegionTargetTcpProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetTcpProxy($targetTcpProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['target_tcp_proxy'] = $targetTcpProxy; + 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 TargetTcpProxy resource. + * + * Sample code: + * ``` + * $regionTargetTcpProxiesClient = new RegionTargetTcpProxiesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetTcpProxy = 'target_tcp_proxy'; + * $response = $regionTargetTcpProxiesClient->get($project, $region, $targetTcpProxy); + * } finally { + * $regionTargetTcpProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetTcpProxy Name of the TargetTcpProxy resource to return. + * @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\TargetTcpProxy + * + * @throws ApiException if the remote call fails + */ + public function get($project, $region, $targetTcpProxy, array $optionalArgs = []) + { + $request = new GetRegionTargetTcpProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetTcpProxy($targetTcpProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['target_tcp_proxy'] = $targetTcpProxy; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', TargetTcpProxy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a TargetTcpProxy resource in the specified project and region using the data included in the request. + * + * Sample code: + * ``` + * $regionTargetTcpProxiesClient = new RegionTargetTcpProxiesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetTcpProxyResource = new TargetTcpProxy(); + * $operationResponse = $regionTargetTcpProxiesClient->insert($project, $region, $targetTcpProxyResource); + * $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 = $regionTargetTcpProxiesClient->insert($project, $region, $targetTcpProxyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionTargetTcpProxiesClient->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 { + * $regionTargetTcpProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param TargetTcpProxy $targetTcpProxyResource The body resource 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($project, $region, $targetTcpProxyResource, array $optionalArgs = []) + { + $request = new InsertRegionTargetTcpProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetTcpProxyResource($targetTcpProxyResource); + $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 TargetTcpProxy resources available to the specified project in a given region. + * + * Sample code: + * ``` + * $regionTargetTcpProxiesClient = new RegionTargetTcpProxiesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionTargetTcpProxiesClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionTargetTcpProxiesClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionTargetTcpProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRegionTargetTcpProxiesRequest(); + $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, TargetTcpProxyList::class, $request); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionUrlMapsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionUrlMapsGapicClient.php new file mode 100644 index 000000000000..4ec2a7b0358e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionUrlMapsGapicClient.php @@ -0,0 +1,757 @@ +delete($project, $region, $urlMap); + * $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 = $regionUrlMapsClient->delete($project, $region, $urlMap); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionUrlMapsClient->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 { + * $regionUrlMapsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionUrlMapsClient}. + */ +class RegionUrlMapsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionUrlMaps'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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_url_maps_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_url_maps_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_url_maps_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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 UrlMap resource. + * + * Sample code: + * ``` + * $regionUrlMapsClient = new RegionUrlMapsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $urlMap = 'url_map'; + * $operationResponse = $regionUrlMapsClient->delete($project, $region, $urlMap); + * $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 = $regionUrlMapsClient->delete($project, $region, $urlMap); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionUrlMapsClient->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 { + * $regionUrlMapsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $urlMap Name of the UrlMap resource to delete. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * @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($project, $region, $urlMap, array $optionalArgs = []) + { + $request = new DeleteRegionUrlMapRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setUrlMap($urlMap); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['url_map'] = $urlMap; + 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 UrlMap resource. + * + * Sample code: + * ``` + * $regionUrlMapsClient = new RegionUrlMapsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $urlMap = 'url_map'; + * $response = $regionUrlMapsClient->get($project, $region, $urlMap); + * } finally { + * $regionUrlMapsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $urlMap Name of the UrlMap resource to return. + * @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\UrlMap + * + * @throws ApiException if the remote call fails + */ + public function get($project, $region, $urlMap, array $optionalArgs = []) + { + $request = new GetRegionUrlMapRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setUrlMap($urlMap); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['url_map'] = $urlMap; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', UrlMap::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a UrlMap resource in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $regionUrlMapsClient = new RegionUrlMapsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $urlMapResource = new UrlMap(); + * $operationResponse = $regionUrlMapsClient->insert($project, $region, $urlMapResource); + * $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 = $regionUrlMapsClient->insert($project, $region, $urlMapResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionUrlMapsClient->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 { + * $regionUrlMapsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param UrlMap $urlMapResource The body resource for this request + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * @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($project, $region, $urlMapResource, array $optionalArgs = []) + { + $request = new InsertRegionUrlMapRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setUrlMapResource($urlMapResource); + $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 the list of UrlMap resources available to the specified project in the specified region. + * + * Sample code: + * ``` + * $regionUrlMapsClient = new RegionUrlMapsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionUrlMapsClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionUrlMapsClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionUrlMapsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRegionUrlMapsRequest(); + $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, UrlMapList::class, $request); + } + + /** + * Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $regionUrlMapsClient = new RegionUrlMapsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $urlMap = 'url_map'; + * $urlMapResource = new UrlMap(); + * $operationResponse = $regionUrlMapsClient->patch($project, $region, $urlMap, $urlMapResource); + * $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 = $regionUrlMapsClient->patch($project, $region, $urlMap, $urlMapResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionUrlMapsClient->resumeOperation($operationName, 'patch'); + * 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 { + * $regionUrlMapsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $urlMap Name of the UrlMap resource to patch. + * @param UrlMap $urlMapResource The body resource for this request + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * @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 patch($project, $region, $urlMap, $urlMapResource, array $optionalArgs = []) + { + $request = new PatchRegionUrlMapRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setUrlMap($urlMap); + $request->setUrlMapResource($urlMapResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['url_map'] = $urlMap; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Updates the specified UrlMap resource with the data included in the request. + * + * Sample code: + * ``` + * $regionUrlMapsClient = new RegionUrlMapsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $urlMap = 'url_map'; + * $urlMapResource = new UrlMap(); + * $operationResponse = $regionUrlMapsClient->update($project, $region, $urlMap, $urlMapResource); + * $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 = $regionUrlMapsClient->update($project, $region, $urlMap, $urlMapResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionUrlMapsClient->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 { + * $regionUrlMapsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $urlMap Name of the UrlMap resource to update. + * @param UrlMap $urlMapResource The body resource for this request + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * @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($project, $region, $urlMap, $urlMapResource, array $optionalArgs = []) + { + $request = new UpdateRegionUrlMapRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setUrlMap($urlMap); + $request->setUrlMapResource($urlMapResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['url_map'] = $urlMap; + 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('Update', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. + * + * Sample code: + * ``` + * $regionUrlMapsClient = new RegionUrlMapsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $regionUrlMapsValidateRequestResource = new RegionUrlMapsValidateRequest(); + * $urlMap = 'url_map'; + * $response = $regionUrlMapsClient->validate($project, $region, $regionUrlMapsValidateRequestResource, $urlMap); + * } finally { + * $regionUrlMapsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param RegionUrlMapsValidateRequest $regionUrlMapsValidateRequestResource The body resource for this request + * @param string $urlMap Name of the UrlMap resource to be validated as. + * @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\UrlMapsValidateResponse + * + * @throws ApiException if the remote call fails + */ + public function validate($project, $region, $regionUrlMapsValidateRequestResource, $urlMap, array $optionalArgs = []) + { + $request = new ValidateRegionUrlMapRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRegionUrlMapsValidateRequestResource($regionUrlMapsValidateRequestResource); + $request->setUrlMap($urlMap); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['url_map'] = $urlMap; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Validate', UrlMapsValidateResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionZonesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionZonesGapicClient.php new file mode 100644 index 000000000000..7e0e17e18808 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionZonesGapicClient.php @@ -0,0 +1,276 @@ +list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionZonesClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionZonesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionZonesClient}. + */ +class RegionZonesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.RegionZones'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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.readonly', + 'https://www.googleapis.com/auth/compute', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/region_zones_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/region_zones_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/region_zones_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** + * Retrieves the list of Zone resources under the specific region available to the specified project. + * + * Sample code: + * ``` + * $regionZonesClient = new RegionZonesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $regionZonesClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionZonesClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionZonesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRegionZonesRequest(); + $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, ZoneList::class, $request); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionsGapicClient.php new file mode 100644 index 000000000000..989f0f8bffee --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionsGapicClient.php @@ -0,0 +1,305 @@ +get($project, $region); + * } finally { + * $regionsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RegionsClient}. + */ +class RegionsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.Regions'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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.readonly', + 'https://www.googleapis.com/auth/compute', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/regions_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/regions_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/regions_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** + * 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: + * ``` + * $regionsClient = new RegionsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $response = $regionsClient->get($project, $region); + * } finally { + * $regionsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region resource to return. + * @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\Region + * + * @throws ApiException if the remote call fails + */ + public function get($project, $region, array $optionalArgs = []) + { + $request = new GetRegionRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $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', Region::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves the list of region resources available to the specified project. 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 `items.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: + * ``` + * $regionsClient = new RegionsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $regionsClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $regionsClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $regionsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListRegionsRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, RegionList::class, $request); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/ReservationsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/ReservationsGapicClient.php new file mode 100644 index 000000000000..5defc0f39f76 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/ReservationsGapicClient.php @@ -0,0 +1,961 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $reservationsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $reservationsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\ReservationsClient}. + */ +class ReservationsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.Reservations'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/reservations_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/reservations_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/reservations_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** + * Retrieves an aggregated list of reservations. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $reservationsClient = new ReservationsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $reservationsClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $reservationsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $reservationsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListReservationsRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, ReservationAggregatedList::class, $request); + } + + /** + * Deletes the specified reservation. + * + * Sample code: + * ``` + * $reservationsClient = new ReservationsClient(); + * try { + * $project = 'project'; + * $reservation = 'reservation'; + * $zone = 'zone'; + * $operationResponse = $reservationsClient->delete($project, $reservation, $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 = $reservationsClient->delete($project, $reservation, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $reservationsClient->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 { + * $reservationsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $reservation Name of the reservation to delete. + * @param string $zone 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 delete($project, $reservation, $zone, array $optionalArgs = []) + { + $request = new DeleteReservationRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setReservation($reservation); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['reservation'] = $reservation; + $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('Delete', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Retrieves information about the specified reservation. + * + * Sample code: + * ``` + * $reservationsClient = new ReservationsClient(); + * try { + * $project = 'project'; + * $reservation = 'reservation'; + * $zone = 'zone'; + * $response = $reservationsClient->get($project, $reservation, $zone); + * } finally { + * $reservationsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $reservation Name of the reservation to retrieve. + * @param string $zone Name of the zone 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\Reservation + * + * @throws ApiException if the remote call fails + */ + public function get($project, $reservation, $zone, array $optionalArgs = []) + { + $request = new GetReservationRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setReservation($reservation); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['reservation'] = $reservation; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', Reservation::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $reservationsClient = new ReservationsClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $zone = 'zone'; + * $response = $reservationsClient->getIamPolicy($project, $resource, $zone); + * } finally { + * $reservationsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param string $zone The name of the zone for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $resource, $zone, array $optionalArgs = []) + { + $request = new GetIamPolicyReservationRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParamHeaders['zone'] = $zone; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a new reservation. For more information, read Reserving zonal resources. + * + * Sample code: + * ``` + * $reservationsClient = new ReservationsClient(); + * try { + * $project = 'project'; + * $reservationResource = new Reservation(); + * $zone = 'zone'; + * $operationResponse = $reservationsClient->insert($project, $reservationResource, $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 = $reservationsClient->insert($project, $reservationResource, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $reservationsClient->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 { + * $reservationsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param Reservation $reservationResource The body resource for this request + * @param string $zone 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 insert($project, $reservationResource, $zone, array $optionalArgs = []) + { + $request = new InsertReservationRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setReservationResource($reservationResource); + $request->setZone($zone); + $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('Insert', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * A list of all the reservations that have been configured for the specified project in specified zone. + * + * Sample code: + * ``` + * $reservationsClient = new ReservationsClient(); + * try { + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $reservationsClient->list($project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $reservationsClient->list($project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $reservationsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $zone Name of the zone 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, $zone, array $optionalArgs = []) + { + $request = new ListReservationsRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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, ReservationList::class, $request); + } + + /** + * Resizes the reservation (applicable to standalone reservations only). For more information, read Modifying reservations. + * + * Sample code: + * ``` + * $reservationsClient = new ReservationsClient(); + * try { + * $project = 'project'; + * $reservation = 'reservation'; + * $reservationsResizeRequestResource = new ReservationsResizeRequest(); + * $zone = 'zone'; + * $operationResponse = $reservationsClient->resize($project, $reservation, $reservationsResizeRequestResource, $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 = $reservationsClient->resize($project, $reservation, $reservationsResizeRequestResource, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $reservationsClient->resumeOperation($operationName, 'resize'); + * 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 { + * $reservationsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $reservation Name of the reservation to update. + * @param ReservationsResizeRequest $reservationsResizeRequestResource The body resource for this request + * @param string $zone 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 resize($project, $reservation, $reservationsResizeRequestResource, $zone, array $optionalArgs = []) + { + $request = new ResizeReservationRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setReservation($reservation); + $request->setReservationsResizeRequestResource($reservationsResizeRequestResource); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['reservation'] = $reservation; + $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('Resize', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $reservationsClient = new ReservationsClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $zone = 'zone'; + * $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + * $response = $reservationsClient->setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource); + * } finally { + * $reservationsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param string $zone The name of the zone for this request. + * @param ZoneSetPolicyRequest $zoneSetPolicyRequestResource The body resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource, array $optionalArgs = []) + { + $request = new SetIamPolicyReservationRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setZone($zone); + $request->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $reservationsClient = new ReservationsClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $zone = 'zone'; + * $response = $reservationsClient->testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone); + * } finally { + * $reservationsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * @param string $zone The name of the zone 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone, array $optionalArgs = []) + { + $request = new TestIamPermissionsReservationRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Update share settings of the reservation. + * + * Sample code: + * ``` + * $reservationsClient = new ReservationsClient(); + * try { + * $project = 'project'; + * $reservation = 'reservation'; + * $reservationResource = new Reservation(); + * $zone = 'zone'; + * $operationResponse = $reservationsClient->update($project, $reservation, $reservationResource, $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 = $reservationsClient->update($project, $reservation, $reservationResource, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $reservationsClient->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 { + * $reservationsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $reservation Name of the reservation to update. + * @param Reservation $reservationResource The body resource for this request + * @param string $zone 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($project, $reservation, $reservationResource, $zone, array $optionalArgs = []) + { + $request = new UpdateReservationRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setReservation($reservation); + $request->setReservationResource($reservationResource); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['reservation'] = $reservation; + $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/owl-bot-staging/Compute/V1/src/V1/Gapic/ResourcePoliciesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/ResourcePoliciesGapicClient.php new file mode 100644 index 000000000000..f929636dac91 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/ResourcePoliciesGapicClient.php @@ -0,0 +1,875 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $resourcePoliciesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $resourcePoliciesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\ResourcePoliciesClient}. + */ +class ResourcePoliciesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.ResourcePolicies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/resource_policies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/resource_policies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/resource_policies_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Retrieves an aggregated list of resource policies. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $resourcePoliciesClient = new ResourcePoliciesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $resourcePoliciesClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $resourcePoliciesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $resourcePoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListResourcePoliciesRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, ResourcePolicyAggregatedList::class, $request); + } + + /** + * Deletes the specified resource policy. + * + * Sample code: + * ``` + * $resourcePoliciesClient = new ResourcePoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resourcePolicy = 'resource_policy'; + * $operationResponse = $resourcePoliciesClient->delete($project, $region, $resourcePolicy); + * $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 = $resourcePoliciesClient->delete($project, $region, $resourcePolicy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $resourcePoliciesClient->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 { + * $resourcePoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $resourcePolicy Name of the resource policy to delete. + * @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($project, $region, $resourcePolicy, array $optionalArgs = []) + { + $request = new DeleteResourcePolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResourcePolicy($resourcePolicy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource_policy'] = $resourcePolicy; + 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(); + } + + /** + * Retrieves all information of the specified resource policy. + * + * Sample code: + * ``` + * $resourcePoliciesClient = new ResourcePoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resourcePolicy = 'resource_policy'; + * $response = $resourcePoliciesClient->get($project, $region, $resourcePolicy); + * } finally { + * $resourcePoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $resourcePolicy Name of the resource policy to retrieve. + * @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\ResourcePolicy + * + * @throws ApiException if the remote call fails + */ + public function get($project, $region, $resourcePolicy, array $optionalArgs = []) + { + $request = new GetResourcePolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResourcePolicy($resourcePolicy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource_policy'] = $resourcePolicy; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', ResourcePolicy::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $resourcePoliciesClient = new ResourcePoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resource = 'resource'; + * $response = $resourcePoliciesClient->getIamPolicy($project, $region, $resource); + * } finally { + * $resourcePoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $region, $resource, array $optionalArgs = []) + { + $request = new GetIamPolicyResourcePolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a new resource policy. + * + * Sample code: + * ``` + * $resourcePoliciesClient = new ResourcePoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resourcePolicyResource = new ResourcePolicy(); + * $operationResponse = $resourcePoliciesClient->insert($project, $region, $resourcePolicyResource); + * $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 = $resourcePoliciesClient->insert($project, $region, $resourcePolicyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $resourcePoliciesClient->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 { + * $resourcePoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param ResourcePolicy $resourcePolicyResource The body resource 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($project, $region, $resourcePolicyResource, array $optionalArgs = []) + { + $request = new InsertResourcePolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResourcePolicyResource($resourcePolicyResource); + $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(); + } + + /** + * A list all the resource policies that have been configured for the specified project in specified region. + * + * Sample code: + * ``` + * $resourcePoliciesClient = new ResourcePoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $resourcePoliciesClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $resourcePoliciesClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $resourcePoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListResourcePoliciesRequest(); + $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, ResourcePolicyList::class, $request); + } + + /** + * Modify the specified resource policy. + * + * Sample code: + * ``` + * $resourcePoliciesClient = new ResourcePoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resourcePolicy = 'resource_policy'; + * $resourcePolicyResource = new ResourcePolicy(); + * $operationResponse = $resourcePoliciesClient->patch($project, $region, $resourcePolicy, $resourcePolicyResource); + * $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 = $resourcePoliciesClient->patch($project, $region, $resourcePolicy, $resourcePolicyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $resourcePoliciesClient->resumeOperation($operationName, 'patch'); + * 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 { + * $resourcePoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $resourcePolicy Id of the resource policy to patch. + * @param ResourcePolicy $resourcePolicyResource The body resource 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 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 patch($project, $region, $resourcePolicy, $resourcePolicyResource, array $optionalArgs = []) + { + $request = new PatchResourcePolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResourcePolicy($resourcePolicy); + $request->setResourcePolicyResource($resourcePolicyResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource_policy'] = $resourcePolicy; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $resourcePoliciesClient = new ResourcePoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + * $resource = 'resource'; + * $response = $resourcePoliciesClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + * } finally { + * $resourcePoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param RegionSetPolicyRequest $regionSetPolicyRequestResource The body resource for this request + * @param string $resource Name or id of the resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource, array $optionalArgs = []) + { + $request = new SetIamPolicyResourcePolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $resourcePoliciesClient = new ResourcePoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $response = $resourcePoliciesClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + * } finally { + * $resourcePoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $region, $resource, $testPermissionsRequestResource, array $optionalArgs = []) + { + $request = new TestIamPermissionsResourcePolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RoutersGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RoutersGapicClient.php new file mode 100644 index 000000000000..d5fc10b39425 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RoutersGapicClient.php @@ -0,0 +1,1045 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $routersClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $routersClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RoutersClient}. + */ +class RoutersGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.Routers'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/routers_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/routers_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/routers_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Retrieves an aggregated list of routers. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $routersClient = new RoutersClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $routersClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $routersClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $routersClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListRoutersRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, RouterAggregatedList::class, $request); + } + + /** + * Deletes the specified Router resource. + * + * Sample code: + * ``` + * $routersClient = new RoutersClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $router = 'router'; + * $operationResponse = $routersClient->delete($project, $region, $router); + * $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 = $routersClient->delete($project, $region, $router); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $routersClient->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 { + * $routersClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $router Name of the Router resource to delete. + * @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($project, $region, $router, array $optionalArgs = []) + { + $request = new DeleteRouterRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRouter($router); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['router'] = $router; + 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 Router resource. + * + * Sample code: + * ``` + * $routersClient = new RoutersClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $router = 'router'; + * $response = $routersClient->get($project, $region, $router); + * } finally { + * $routersClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $router Name of the Router resource to return. + * @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\Router + * + * @throws ApiException if the remote call fails + */ + public function get($project, $region, $router, array $optionalArgs = []) + { + $request = new GetRouterRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRouter($router); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['router'] = $router; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', Router::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves runtime NAT IP information. + * + * Sample code: + * ``` + * $routersClient = new RoutersClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $router = 'router'; + * $response = $routersClient->getNatIpInfo($project, $region, $router); + * } finally { + * $routersClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $router Name of the Router resource to query for Nat IP information. The name should conform to RFC1035. + * @param array $optionalArgs { + * Optional. + * + * @type string $natName + * Name of the nat service to filter the NAT IP information. If it is omitted, all nats for this router will be returned. Name should conform to RFC1035. + * @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\NatIpInfoResponse + * + * @throws ApiException if the remote call fails + */ + public function getNatIpInfo($project, $region, $router, array $optionalArgs = []) + { + $request = new GetNatIpInfoRouterRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRouter($router); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['router'] = $router; + if (isset($optionalArgs['natName'])) { + $request->setNatName($optionalArgs['natName']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetNatIpInfo', NatIpInfoResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves runtime Nat mapping information of VM endpoints. + * + * Sample code: + * ``` + * $routersClient = new RoutersClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $router = 'router'; + * // Iterate over pages of elements + * $pagedResponse = $routersClient->getNatMappingInfo($project, $region, $router); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $routersClient->getNatMappingInfo($project, $region, $router); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $routersClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $router Name of the Router resource to query for Nat Mapping information of VM endpoints. + * @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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 $natName + * Name of the nat service to filter the Nat Mapping information. If it is omitted, all nats for this router will be returned. Name should conform to RFC1035. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 getNatMappingInfo($project, $region, $router, array $optionalArgs = []) + { + $request = new GetNatMappingInfoRoutersRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRouter($router); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['router'] = $router; + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['maxResults'])) { + $request->setMaxResults($optionalArgs['maxResults']); + } + + if (isset($optionalArgs['natName'])) { + $request->setNatName($optionalArgs['natName']); + } + + 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('GetNatMappingInfo', $optionalArgs, VmEndpointNatMappingsList::class, $request); + } + + /** + * Retrieves runtime information of the specified router. + * + * Sample code: + * ``` + * $routersClient = new RoutersClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $router = 'router'; + * $response = $routersClient->getRouterStatus($project, $region, $router); + * } finally { + * $routersClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $router Name of the Router resource to query. + * @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\RouterStatusResponse + * + * @throws ApiException if the remote call fails + */ + public function getRouterStatus($project, $region, $router, array $optionalArgs = []) + { + $request = new GetRouterStatusRouterRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRouter($router); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['router'] = $router; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetRouterStatus', RouterStatusResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a Router resource in the specified project and region using the data included in the request. + * + * Sample code: + * ``` + * $routersClient = new RoutersClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $routerResource = new Router(); + * $operationResponse = $routersClient->insert($project, $region, $routerResource); + * $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 = $routersClient->insert($project, $region, $routerResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $routersClient->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 { + * $routersClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param Router $routerResource The body resource 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($project, $region, $routerResource, array $optionalArgs = []) + { + $request = new InsertRouterRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRouterResource($routerResource); + $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 Router resources available to the specified project. + * + * Sample code: + * ``` + * $routersClient = new RoutersClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $routersClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $routersClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $routersClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListRoutersRequest(); + $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, RouterList::class, $request); + } + + /** + * Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $routersClient = new RoutersClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $router = 'router'; + * $routerResource = new Router(); + * $operationResponse = $routersClient->patch($project, $region, $router, $routerResource); + * $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 = $routersClient->patch($project, $region, $router, $routerResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $routersClient->resumeOperation($operationName, 'patch'); + * 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 { + * $routersClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $router Name of the Router resource to patch. + * @param Router $routerResource The body resource 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 patch($project, $region, $router, $routerResource, array $optionalArgs = []) + { + $request = new PatchRouterRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRouter($router); + $request->setRouterResource($routerResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['router'] = $router; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. + * + * Sample code: + * ``` + * $routersClient = new RoutersClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $router = 'router'; + * $routerResource = new Router(); + * $response = $routersClient->preview($project, $region, $router, $routerResource); + * } finally { + * $routersClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $router Name of the Router resource to query. + * @param Router $routerResource The body resource 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\RoutersPreviewResponse + * + * @throws ApiException if the remote call fails + */ + public function preview($project, $region, $router, $routerResource, array $optionalArgs = []) + { + $request = new PreviewRouterRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRouter($router); + $request->setRouterResource($routerResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['router'] = $router; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Preview', RoutersPreviewResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Updates the specified Router resource with the data included in the request. This method conforms to PUT semantics, which requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload. + * + * Sample code: + * ``` + * $routersClient = new RoutersClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $router = 'router'; + * $routerResource = new Router(); + * $operationResponse = $routersClient->update($project, $region, $router, $routerResource); + * $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 = $routersClient->update($project, $region, $router, $routerResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $routersClient->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 { + * $routersClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $router Name of the Router resource to update. + * @param Router $routerResource The body resource 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 update($project, $region, $router, $routerResource, array $optionalArgs = []) + { + $request = new UpdateRouterRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRouter($router); + $request->setRouterResource($routerResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['router'] = $router; + 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('Update', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/RoutesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RoutesGapicClient.php new file mode 100644 index 000000000000..5ec45deaf5bf --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RoutesGapicClient.php @@ -0,0 +1,526 @@ +delete($project, $route); + * $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 = $routesClient->delete($project, $route); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $routesClient->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 { + * $routesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\RoutesClient}. + */ +class RoutesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.Routes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/routes_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/routes_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/routes_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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 Route resource. + * + * Sample code: + * ``` + * $routesClient = new RoutesClient(); + * try { + * $project = 'project'; + * $route = 'route'; + * $operationResponse = $routesClient->delete($project, $route); + * $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 = $routesClient->delete($project, $route); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $routesClient->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 { + * $routesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $route Name of the Route resource to delete. + * @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($project, $route, array $optionalArgs = []) + { + $request = new DeleteRouteRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRoute($route); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['route'] = $route; + 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 Route resource. + * + * Sample code: + * ``` + * $routesClient = new RoutesClient(); + * try { + * $project = 'project'; + * $route = 'route'; + * $response = $routesClient->get($project, $route); + * } finally { + * $routesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $route Name of the Route resource to return. + * @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\Route + * + * @throws ApiException if the remote call fails + */ + public function get($project, $route, array $optionalArgs = []) + { + $request = new GetRouteRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRoute($route); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['route'] = $route; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', Route::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a Route resource in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $routesClient = new RoutesClient(); + * try { + * $project = 'project'; + * $routeResource = new Route(); + * $operationResponse = $routesClient->insert($project, $routeResource); + * $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 = $routesClient->insert($project, $routeResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $routesClient->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 { + * $routesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param Route $routeResource The body resource 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($project, $routeResource, array $optionalArgs = []) + { + $request = new InsertRouteRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRouteResource($routeResource); + $requestParamHeaders['project'] = $project; + 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 the list of Route resources available to the specified project. + * + * Sample code: + * ``` + * $routesClient = new RoutesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $routesClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $routesClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $routesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListRoutesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, RouteList::class, $request); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/SecurityPoliciesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/SecurityPoliciesGapicClient.php new file mode 100644 index 000000000000..a31eb9d8e9d9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/SecurityPoliciesGapicClient.php @@ -0,0 +1,1143 @@ +addRule($project, $securityPolicy, $securityPolicyRuleResource); + * $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 = $securityPoliciesClient->addRule($project, $securityPolicy, $securityPolicyRuleResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $securityPoliciesClient->resumeOperation($operationName, 'addRule'); + * 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 { + * $securityPoliciesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\SecurityPoliciesClient}. + */ +class SecurityPoliciesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.SecurityPolicies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/security_policies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/security_policies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/security_policies_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** + * Inserts a rule into a security policy. + * + * Sample code: + * ``` + * $securityPoliciesClient = new SecurityPoliciesClient(); + * try { + * $project = 'project'; + * $securityPolicy = 'security_policy'; + * $securityPolicyRuleResource = new SecurityPolicyRule(); + * $operationResponse = $securityPoliciesClient->addRule($project, $securityPolicy, $securityPolicyRuleResource); + * $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 = $securityPoliciesClient->addRule($project, $securityPolicy, $securityPolicyRuleResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $securityPoliciesClient->resumeOperation($operationName, 'addRule'); + * 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 { + * $securityPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $securityPolicy Name of the security policy to update. + * @param SecurityPolicyRule $securityPolicyRuleResource The body resource for this request + * @param array $optionalArgs { + * Optional. + * + * @type bool $validateOnly + * If true, the request will not be committed. + * @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 addRule($project, $securityPolicy, $securityPolicyRuleResource, array $optionalArgs = []) + { + $request = new AddRuleSecurityPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setSecurityPolicy($securityPolicy); + $request->setSecurityPolicyRuleResource($securityPolicyRuleResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['security_policy'] = $securityPolicy; + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('AddRule', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Retrieves the list of all SecurityPolicy resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $securityPoliciesClient = new SecurityPoliciesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $securityPoliciesClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $securityPoliciesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $securityPoliciesClient->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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListSecurityPoliciesRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, SecurityPoliciesAggregatedList::class, $request); + } + + /** + * Deletes the specified policy. + * + * Sample code: + * ``` + * $securityPoliciesClient = new SecurityPoliciesClient(); + * try { + * $project = 'project'; + * $securityPolicy = 'security_policy'; + * $operationResponse = $securityPoliciesClient->delete($project, $securityPolicy); + * $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 = $securityPoliciesClient->delete($project, $securityPolicy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $securityPoliciesClient->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 { + * $securityPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $securityPolicy Name of the security policy to delete. + * @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($project, $securityPolicy, array $optionalArgs = []) + { + $request = new DeleteSecurityPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setSecurityPolicy($securityPolicy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['security_policy'] = $securityPolicy; + 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(); + } + + /** + * List all of the ordered rules present in a single specified policy. + * + * Sample code: + * ``` + * $securityPoliciesClient = new SecurityPoliciesClient(); + * try { + * $project = 'project'; + * $securityPolicy = 'security_policy'; + * $response = $securityPoliciesClient->get($project, $securityPolicy); + * } finally { + * $securityPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $securityPolicy Name of the security policy to get. + * @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\SecurityPolicy + * + * @throws ApiException if the remote call fails + */ + public function get($project, $securityPolicy, array $optionalArgs = []) + { + $request = new GetSecurityPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setSecurityPolicy($securityPolicy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['security_policy'] = $securityPolicy; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', SecurityPolicy::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets a rule at the specified priority. + * + * Sample code: + * ``` + * $securityPoliciesClient = new SecurityPoliciesClient(); + * try { + * $project = 'project'; + * $securityPolicy = 'security_policy'; + * $response = $securityPoliciesClient->getRule($project, $securityPolicy); + * } finally { + * $securityPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $securityPolicy Name of the security policy to which the queried rule belongs. + * @param array $optionalArgs { + * Optional. + * + * @type int $priority + * The priority of the rule to get from the security policy. + * @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\SecurityPolicyRule + * + * @throws ApiException if the remote call fails + */ + public function getRule($project, $securityPolicy, array $optionalArgs = []) + { + $request = new GetRuleSecurityPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setSecurityPolicy($securityPolicy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['security_policy'] = $securityPolicy; + if (isset($optionalArgs['priority'])) { + $request->setPriority($optionalArgs['priority']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetRule', SecurityPolicyRule::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a new policy in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $securityPoliciesClient = new SecurityPoliciesClient(); + * try { + * $project = 'project'; + * $securityPolicyResource = new SecurityPolicy(); + * $operationResponse = $securityPoliciesClient->insert($project, $securityPolicyResource); + * $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 = $securityPoliciesClient->insert($project, $securityPolicyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $securityPoliciesClient->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 { + * $securityPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param SecurityPolicy $securityPolicyResource The body resource 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 bool $validateOnly + * If true, the request will not be committed. + * @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($project, $securityPolicyResource, array $optionalArgs = []) + { + $request = new InsertSecurityPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setSecurityPolicyResource($securityPolicyResource); + $requestParamHeaders['project'] = $project; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('Insert', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * List all the policies that have been configured for the specified project. + * + * Sample code: + * ``` + * $securityPoliciesClient = new SecurityPoliciesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $securityPoliciesClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $securityPoliciesClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $securityPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListSecurityPoliciesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, SecurityPolicyList::class, $request); + } + + /** + * Gets the current list of preconfigured Web Application Firewall (WAF) expressions. + * + * Sample code: + * ``` + * $securityPoliciesClient = new SecurityPoliciesClient(); + * try { + * $project = 'project'; + * $response = $securityPoliciesClient->listPreconfiguredExpressionSets($project); + * } finally { + * $securityPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * 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 bool $returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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\SecurityPoliciesListPreconfiguredExpressionSetsResponse + * + * @throws ApiException if the remote call fails + */ + public function listPreconfiguredExpressionSets($project, array $optionalArgs = []) + { + $request = new ListPreconfiguredExpressionSetsSecurityPoliciesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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->startCall('ListPreconfiguredExpressionSets', SecurityPoliciesListPreconfiguredExpressionSetsResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Patches the specified policy with the data included in the request. To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead. + * + * Sample code: + * ``` + * $securityPoliciesClient = new SecurityPoliciesClient(); + * try { + * $project = 'project'; + * $securityPolicy = 'security_policy'; + * $securityPolicyResource = new SecurityPolicy(); + * $operationResponse = $securityPoliciesClient->patch($project, $securityPolicy, $securityPolicyResource); + * $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 = $securityPoliciesClient->patch($project, $securityPolicy, $securityPolicyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $securityPoliciesClient->resumeOperation($operationName, 'patch'); + * 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 { + * $securityPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $securityPolicy Name of the security policy to update. + * @param SecurityPolicy $securityPolicyResource The body resource 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 string $updateMask + * Indicates fields to be cleared 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 patch($project, $securityPolicy, $securityPolicyResource, array $optionalArgs = []) + { + $request = new PatchSecurityPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setSecurityPolicy($securityPolicy); + $request->setSecurityPolicyResource($securityPolicyResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['security_policy'] = $securityPolicy; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Patches a rule at the specified priority. To clear fields in the rule, leave the fields empty and specify them in the updateMask. + * + * Sample code: + * ``` + * $securityPoliciesClient = new SecurityPoliciesClient(); + * try { + * $project = 'project'; + * $securityPolicy = 'security_policy'; + * $securityPolicyRuleResource = new SecurityPolicyRule(); + * $operationResponse = $securityPoliciesClient->patchRule($project, $securityPolicy, $securityPolicyRuleResource); + * $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 = $securityPoliciesClient->patchRule($project, $securityPolicy, $securityPolicyRuleResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $securityPoliciesClient->resumeOperation($operationName, 'patchRule'); + * 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 { + * $securityPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $securityPolicy Name of the security policy to update. + * @param SecurityPolicyRule $securityPolicyRuleResource The body resource for this request + * @param array $optionalArgs { + * Optional. + * + * @type int $priority + * The priority of the rule to patch. + * @type string $updateMask + * Indicates fields to be cleared as part of this request. + * @type bool $validateOnly + * If true, the request will not be committed. + * @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 patchRule($project, $securityPolicy, $securityPolicyRuleResource, array $optionalArgs = []) + { + $request = new PatchRuleSecurityPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setSecurityPolicy($securityPolicy); + $request->setSecurityPolicyRuleResource($securityPolicyRuleResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['security_policy'] = $securityPolicy; + if (isset($optionalArgs['priority'])) { + $request->setPriority($optionalArgs['priority']); + } + + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('PatchRule', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Deletes a rule at the specified priority. + * + * Sample code: + * ``` + * $securityPoliciesClient = new SecurityPoliciesClient(); + * try { + * $project = 'project'; + * $securityPolicy = 'security_policy'; + * $operationResponse = $securityPoliciesClient->removeRule($project, $securityPolicy); + * $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 = $securityPoliciesClient->removeRule($project, $securityPolicy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $securityPoliciesClient->resumeOperation($operationName, 'removeRule'); + * 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 { + * $securityPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $securityPolicy Name of the security policy to update. + * @param array $optionalArgs { + * Optional. + * + * @type int $priority + * The priority of the rule to remove from the security policy. + * @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 removeRule($project, $securityPolicy, array $optionalArgs = []) + { + $request = new RemoveRuleSecurityPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setSecurityPolicy($securityPolicy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['security_policy'] = $securityPolicy; + if (isset($optionalArgs['priority'])) { + $request->setPriority($optionalArgs['priority']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('RemoveRule', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the labels on a security policy. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + * ``` + * $securityPoliciesClient = new SecurityPoliciesClient(); + * try { + * $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + * $project = 'project'; + * $resource = 'resource'; + * $operationResponse = $securityPoliciesClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + * $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 = $securityPoliciesClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $securityPoliciesClient->resumeOperation($operationName, 'setLabels'); + * 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 { + * $securityPoliciesClient->close(); + * } + * ``` + * + * @param GlobalSetLabelsRequest $globalSetLabelsRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource 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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function setLabels($globalSetLabelsRequestResource, $project, $resource, array $optionalArgs = []) + { + $request = new SetLabelsSecurityPolicyRequest(); + $requestParamHeaders = []; + $request->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource); + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('SetLabels', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/ServiceAttachmentsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/ServiceAttachmentsGapicClient.php new file mode 100644 index 000000000000..5811f0eacda5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/ServiceAttachmentsGapicClient.php @@ -0,0 +1,869 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $serviceAttachmentsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $serviceAttachmentsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\ServiceAttachmentsClient}. + */ +class ServiceAttachmentsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.ServiceAttachments'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/service_attachments_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/service_attachments_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/service_attachments_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Retrieves the list of all ServiceAttachment resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $serviceAttachmentsClient = new ServiceAttachmentsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $serviceAttachmentsClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $serviceAttachmentsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $serviceAttachmentsClient->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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListServiceAttachmentsRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, ServiceAttachmentAggregatedList::class, $request); + } + + /** + * Deletes the specified ServiceAttachment in the given scope + * + * Sample code: + * ``` + * $serviceAttachmentsClient = new ServiceAttachmentsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $serviceAttachment = 'service_attachment'; + * $operationResponse = $serviceAttachmentsClient->delete($project, $region, $serviceAttachment); + * $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 = $serviceAttachmentsClient->delete($project, $region, $serviceAttachment); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $serviceAttachmentsClient->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 { + * $serviceAttachmentsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region of this request. + * @param string $serviceAttachment Name of the ServiceAttachment resource to delete. + * @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($project, $region, $serviceAttachment, array $optionalArgs = []) + { + $request = new DeleteServiceAttachmentRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setServiceAttachment($serviceAttachment); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['service_attachment'] = $serviceAttachment; + 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 ServiceAttachment resource in the given scope. + * + * Sample code: + * ``` + * $serviceAttachmentsClient = new ServiceAttachmentsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $serviceAttachment = 'service_attachment'; + * $response = $serviceAttachmentsClient->get($project, $region, $serviceAttachment); + * } finally { + * $serviceAttachmentsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region of this request. + * @param string $serviceAttachment Name of the ServiceAttachment resource to return. + * @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\ServiceAttachment + * + * @throws ApiException if the remote call fails + */ + public function get($project, $region, $serviceAttachment, array $optionalArgs = []) + { + $request = new GetServiceAttachmentRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setServiceAttachment($serviceAttachment); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['service_attachment'] = $serviceAttachment; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', ServiceAttachment::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $serviceAttachmentsClient = new ServiceAttachmentsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resource = 'resource'; + * $response = $serviceAttachmentsClient->getIamPolicy($project, $region, $resource); + * } finally { + * $serviceAttachmentsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $region, $resource, array $optionalArgs = []) + { + $request = new GetIamPolicyServiceAttachmentRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a ServiceAttachment in the specified project in the given scope using the parameters that are included in the request. + * + * Sample code: + * ``` + * $serviceAttachmentsClient = new ServiceAttachmentsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $serviceAttachmentResource = new ServiceAttachment(); + * $operationResponse = $serviceAttachmentsClient->insert($project, $region, $serviceAttachmentResource); + * $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 = $serviceAttachmentsClient->insert($project, $region, $serviceAttachmentResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $serviceAttachmentsClient->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 { + * $serviceAttachmentsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region of this request. + * @param ServiceAttachment $serviceAttachmentResource The body resource 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($project, $region, $serviceAttachmentResource, array $optionalArgs = []) + { + $request = new InsertServiceAttachmentRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setServiceAttachmentResource($serviceAttachmentResource); + $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(); + } + + /** + * Lists the ServiceAttachments for a project in the given scope. + * + * Sample code: + * ``` + * $serviceAttachmentsClient = new ServiceAttachmentsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $serviceAttachmentsClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $serviceAttachmentsClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $serviceAttachmentsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region of 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListServiceAttachmentsRequest(); + $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, ServiceAttachmentList::class, $request); + } + + /** + * Patches the specified ServiceAttachment resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $serviceAttachmentsClient = new ServiceAttachmentsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $serviceAttachment = 'service_attachment'; + * $serviceAttachmentResource = new ServiceAttachment(); + * $operationResponse = $serviceAttachmentsClient->patch($project, $region, $serviceAttachment, $serviceAttachmentResource); + * $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 = $serviceAttachmentsClient->patch($project, $region, $serviceAttachment, $serviceAttachmentResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $serviceAttachmentsClient->resumeOperation($operationName, 'patch'); + * 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 { + * $serviceAttachmentsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The region scoping this request and should conform to RFC1035. + * @param string $serviceAttachment The resource id of the ServiceAttachment to patch. It should conform to RFC1035 resource name or be a string form on an unsigned long number. + * @param ServiceAttachment $serviceAttachmentResource The body resource 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 patch($project, $region, $serviceAttachment, $serviceAttachmentResource, array $optionalArgs = []) + { + $request = new PatchServiceAttachmentRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setServiceAttachment($serviceAttachment); + $request->setServiceAttachmentResource($serviceAttachmentResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['service_attachment'] = $serviceAttachment; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $serviceAttachmentsClient = new ServiceAttachmentsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + * $resource = 'resource'; + * $response = $serviceAttachmentsClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + * } finally { + * $serviceAttachmentsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param RegionSetPolicyRequest $regionSetPolicyRequestResource The body resource for this request + * @param string $resource Name or id of the resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource, array $optionalArgs = []) + { + $request = new SetIamPolicyServiceAttachmentRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $serviceAttachmentsClient = new ServiceAttachmentsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $response = $serviceAttachmentsClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + * } finally { + * $serviceAttachmentsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $region, $resource, $testPermissionsRequestResource, array $optionalArgs = []) + { + $request = new TestIamPermissionsServiceAttachmentRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/SnapshotSettingsServiceGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/SnapshotSettingsServiceGapicClient.php new file mode 100644 index 000000000000..30900df159f1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/SnapshotSettingsServiceGapicClient.php @@ -0,0 +1,345 @@ +get($project); + * } finally { + * $snapshotSettingsServiceClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\SnapshotSettingsServiceClient}. + */ +class SnapshotSettingsServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.SnapshotSettingsService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/snapshot_settings_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/snapshot_settings_service_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/snapshot_settings_service_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** + * Get snapshot settings. + * + * Sample code: + * ``` + * $snapshotSettingsServiceClient = new SnapshotSettingsServiceClient(); + * try { + * $project = 'project'; + * $response = $snapshotSettingsServiceClient->get($project); + * } finally { + * $snapshotSettingsServiceClient->close(); + * } + * ``` + * + * @param string $project Project ID 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\SnapshotSettings + * + * @throws ApiException if the remote call fails + */ + public function get($project, array $optionalArgs = []) + { + $request = new GetSnapshotSettingRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', SnapshotSettings::class, $optionalArgs, $request)->wait(); + } + + /** + * Patch snapshot settings. + * + * Sample code: + * ``` + * $snapshotSettingsServiceClient = new SnapshotSettingsServiceClient(); + * try { + * $project = 'project'; + * $snapshotSettingsResource = new SnapshotSettings(); + * $operationResponse = $snapshotSettingsServiceClient->patch($project, $snapshotSettingsResource); + * $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 = $snapshotSettingsServiceClient->patch($project, $snapshotSettingsResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $snapshotSettingsServiceClient->resumeOperation($operationName, 'patch'); + * 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 { + * $snapshotSettingsServiceClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param SnapshotSettings $snapshotSettingsResource The body resource 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 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 patch($project, $snapshotSettingsResource, array $optionalArgs = []) + { + $request = new PatchSnapshotSettingRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setSnapshotSettingsResource($snapshotSettingsResource); + $requestParamHeaders['project'] = $project; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/SnapshotsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/SnapshotsGapicClient.php new file mode 100644 index 000000000000..5ec50e53fd1a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/SnapshotsGapicClient.php @@ -0,0 +1,745 @@ +delete($project, $snapshot); + * $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 = $snapshotsClient->delete($project, $snapshot); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $snapshotsClient->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 { + * $snapshotsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\SnapshotsClient}. + */ +class SnapshotsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.Snapshots'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/snapshots_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/snapshots_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/snapshots_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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 Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. For more information, see Deleting snapshots. + * + * Sample code: + * ``` + * $snapshotsClient = new SnapshotsClient(); + * try { + * $project = 'project'; + * $snapshot = 'snapshot'; + * $operationResponse = $snapshotsClient->delete($project, $snapshot); + * $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 = $snapshotsClient->delete($project, $snapshot); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $snapshotsClient->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 { + * $snapshotsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $snapshot Name of the Snapshot resource to delete. + * @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($project, $snapshot, array $optionalArgs = []) + { + $request = new DeleteSnapshotRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setSnapshot($snapshot); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['snapshot'] = $snapshot; + 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 Snapshot resource. + * + * Sample code: + * ``` + * $snapshotsClient = new SnapshotsClient(); + * try { + * $project = 'project'; + * $snapshot = 'snapshot'; + * $response = $snapshotsClient->get($project, $snapshot); + * } finally { + * $snapshotsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $snapshot Name of the Snapshot resource to return. + * @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\Snapshot + * + * @throws ApiException if the remote call fails + */ + public function get($project, $snapshot, array $optionalArgs = []) + { + $request = new GetSnapshotRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setSnapshot($snapshot); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['snapshot'] = $snapshot; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', Snapshot::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $snapshotsClient = new SnapshotsClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $response = $snapshotsClient->getIamPolicy($project, $resource); + * } finally { + * $snapshotsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $resource, array $optionalArgs = []) + { + $request = new GetIamPolicySnapshotRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a snapshot in the specified project using the data included in the request. For regular snapshot creation, consider using this method instead of disks.createSnapshot, as this method supports more features, such as creating snapshots in a project different from the source disk project. + * + * Sample code: + * ``` + * $snapshotsClient = new SnapshotsClient(); + * try { + * $project = 'project'; + * $snapshotResource = new Snapshot(); + * $operationResponse = $snapshotsClient->insert($project, $snapshotResource); + * $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 = $snapshotsClient->insert($project, $snapshotResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $snapshotsClient->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 { + * $snapshotsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param Snapshot $snapshotResource The body resource 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($project, $snapshotResource, array $optionalArgs = []) + { + $request = new InsertSnapshotRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setSnapshotResource($snapshotResource); + $requestParamHeaders['project'] = $project; + 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 the list of Snapshot resources contained within the specified project. + * + * Sample code: + * ``` + * $snapshotsClient = new SnapshotsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $snapshotsClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $snapshotsClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $snapshotsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListSnapshotsRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, SnapshotList::class, $request); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $snapshotsClient = new SnapshotsClient(); + * try { + * $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + * $project = 'project'; + * $resource = 'resource'; + * $response = $snapshotsClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + * } finally { + * $snapshotsClient->close(); + * } + * ``` + * + * @param GlobalSetPolicyRequest $globalSetPolicyRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($globalSetPolicyRequestResource, $project, $resource, array $optionalArgs = []) + { + $request = new SetIamPolicySnapshotRequest(); + $requestParamHeaders = []; + $request->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource); + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + * ``` + * $snapshotsClient = new SnapshotsClient(); + * try { + * $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + * $project = 'project'; + * $resource = 'resource'; + * $operationResponse = $snapshotsClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + * $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 = $snapshotsClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $snapshotsClient->resumeOperation($operationName, 'setLabels'); + * 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 { + * $snapshotsClient->close(); + * } + * ``` + * + * @param GlobalSetLabelsRequest $globalSetLabelsRequestResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource 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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function setLabels($globalSetLabelsRequestResource, $project, $resource, array $optionalArgs = []) + { + $request = new SetLabelsSnapshotRequest(); + $requestParamHeaders = []; + $request->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource); + $request->setProject($project); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('SetLabels', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $snapshotsClient = new SnapshotsClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $response = $snapshotsClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + * } finally { + * $snapshotsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $resource, $testPermissionsRequestResource, array $optionalArgs = []) + { + $request = new TestIamPermissionsSnapshotRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/SslCertificatesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/SslCertificatesGapicClient.php new file mode 100644 index 000000000000..105e005b85ba --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/SslCertificatesGapicClient.php @@ -0,0 +1,612 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $sslCertificatesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $sslCertificatesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\SslCertificatesClient}. + */ +class SslCertificatesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.SslCertificates'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/ssl_certificates_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/ssl_certificates_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/ssl_certificates_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** + * Retrieves the list of all SslCertificate resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $sslCertificatesClient = new SslCertificatesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $sslCertificatesClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $sslCertificatesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $sslCertificatesClient->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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListSslCertificatesRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, SslCertificateAggregatedList::class, $request); + } + + /** + * Deletes the specified SslCertificate resource. + * + * Sample code: + * ``` + * $sslCertificatesClient = new SslCertificatesClient(); + * try { + * $project = 'project'; + * $sslCertificate = 'ssl_certificate'; + * $operationResponse = $sslCertificatesClient->delete($project, $sslCertificate); + * $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 = $sslCertificatesClient->delete($project, $sslCertificate); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $sslCertificatesClient->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 { + * $sslCertificatesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $sslCertificate Name of the SslCertificate resource to delete. + * @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($project, $sslCertificate, array $optionalArgs = []) + { + $request = new DeleteSslCertificateRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setSslCertificate($sslCertificate); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['ssl_certificate'] = $sslCertificate; + 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 SslCertificate resource. + * + * Sample code: + * ``` + * $sslCertificatesClient = new SslCertificatesClient(); + * try { + * $project = 'project'; + * $sslCertificate = 'ssl_certificate'; + * $response = $sslCertificatesClient->get($project, $sslCertificate); + * } finally { + * $sslCertificatesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $sslCertificate Name of the SslCertificate resource to return. + * @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\SslCertificate + * + * @throws ApiException if the remote call fails + */ + public function get($project, $sslCertificate, array $optionalArgs = []) + { + $request = new GetSslCertificateRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setSslCertificate($sslCertificate); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['ssl_certificate'] = $sslCertificate; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', SslCertificate::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a SslCertificate resource in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $sslCertificatesClient = new SslCertificatesClient(); + * try { + * $project = 'project'; + * $sslCertificateResource = new SslCertificate(); + * $operationResponse = $sslCertificatesClient->insert($project, $sslCertificateResource); + * $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 = $sslCertificatesClient->insert($project, $sslCertificateResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $sslCertificatesClient->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 { + * $sslCertificatesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param SslCertificate $sslCertificateResource The body resource 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($project, $sslCertificateResource, array $optionalArgs = []) + { + $request = new InsertSslCertificateRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setSslCertificateResource($sslCertificateResource); + $requestParamHeaders['project'] = $project; + 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 the list of SslCertificate resources available to the specified project. + * + * Sample code: + * ``` + * $sslCertificatesClient = new SslCertificatesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $sslCertificatesClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $sslCertificatesClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $sslCertificatesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListSslCertificatesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, SslCertificateList::class, $request); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/SslPoliciesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/SslPoliciesGapicClient.php new file mode 100644 index 000000000000..aa6c6b5e0b31 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/SslPoliciesGapicClient.php @@ -0,0 +1,759 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $sslPoliciesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $sslPoliciesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\SslPoliciesClient}. + */ +class SslPoliciesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.SslPolicies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/ssl_policies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/ssl_policies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/ssl_policies_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** + * Retrieves the list of all SslPolicy resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $sslPoliciesClient = new SslPoliciesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $sslPoliciesClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $sslPoliciesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $sslPoliciesClient->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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListSslPoliciesRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, SslPoliciesAggregatedList::class, $request); + } + + /** + * Deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources. + * + * Sample code: + * ``` + * $sslPoliciesClient = new SslPoliciesClient(); + * try { + * $project = 'project'; + * $sslPolicy = 'ssl_policy'; + * $operationResponse = $sslPoliciesClient->delete($project, $sslPolicy); + * $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 = $sslPoliciesClient->delete($project, $sslPolicy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $sslPoliciesClient->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 { + * $sslPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $sslPolicy Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. + * @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($project, $sslPolicy, array $optionalArgs = []) + { + $request = new DeleteSslPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setSslPolicy($sslPolicy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['ssl_policy'] = $sslPolicy; + 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(); + } + + /** + * Lists all of the ordered rules present in a single specified policy. + * + * Sample code: + * ``` + * $sslPoliciesClient = new SslPoliciesClient(); + * try { + * $project = 'project'; + * $sslPolicy = 'ssl_policy'; + * $response = $sslPoliciesClient->get($project, $sslPolicy); + * } finally { + * $sslPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * @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\SslPolicy + * + * @throws ApiException if the remote call fails + */ + public function get($project, $sslPolicy, array $optionalArgs = []) + { + $request = new GetSslPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setSslPolicy($sslPolicy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['ssl_policy'] = $sslPolicy; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', SslPolicy::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the specified SSL policy resource. + * + * Sample code: + * ``` + * $sslPoliciesClient = new SslPoliciesClient(); + * try { + * $project = 'project'; + * $sslPolicyResource = new SslPolicy(); + * $operationResponse = $sslPoliciesClient->insert($project, $sslPolicyResource); + * $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 = $sslPoliciesClient->insert($project, $sslPolicyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $sslPoliciesClient->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 { + * $sslPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param SslPolicy $sslPolicyResource The body resource 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($project, $sslPolicyResource, array $optionalArgs = []) + { + $request = new InsertSslPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setSslPolicyResource($sslPolicyResource); + $requestParamHeaders['project'] = $project; + 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(); + } + + /** + * Lists all the SSL policies that have been configured for the specified project. + * + * Sample code: + * ``` + * $sslPoliciesClient = new SslPoliciesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $sslPoliciesClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $sslPoliciesClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $sslPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListSslPoliciesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, SslPoliciesList::class, $request); + } + + /** + * Lists all features that can be specified in the SSL policy when using custom profile. + * + * Sample code: + * ``` + * $sslPoliciesClient = new SslPoliciesClient(); + * try { + * $project = 'project'; + * $response = $sslPoliciesClient->listAvailableFeatures($project); + * } finally { + * $sslPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * 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 bool $returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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\SslPoliciesListAvailableFeaturesResponse + * + * @throws ApiException if the remote call fails + */ + public function listAvailableFeatures($project, array $optionalArgs = []) + { + $request = new ListAvailableFeaturesSslPoliciesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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->startCall('ListAvailableFeatures', SslPoliciesListAvailableFeaturesResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Patches the specified SSL policy with the data included in the request. + * + * Sample code: + * ``` + * $sslPoliciesClient = new SslPoliciesClient(); + * try { + * $project = 'project'; + * $sslPolicy = 'ssl_policy'; + * $sslPolicyResource = new SslPolicy(); + * $operationResponse = $sslPoliciesClient->patch($project, $sslPolicy, $sslPolicyResource); + * $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 = $sslPoliciesClient->patch($project, $sslPolicy, $sslPolicyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $sslPoliciesClient->resumeOperation($operationName, 'patch'); + * 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 { + * $sslPoliciesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * @param SslPolicy $sslPolicyResource The body resource 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 patch($project, $sslPolicy, $sslPolicyResource, array $optionalArgs = []) + { + $request = new PatchSslPolicyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setSslPolicy($sslPolicy); + $request->setSslPolicyResource($sslPolicyResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['ssl_policy'] = $sslPolicy; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/StoragePoolTypesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/StoragePoolTypesGapicClient.php new file mode 100644 index 000000000000..49784b29bd17 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/StoragePoolTypesGapicClient.php @@ -0,0 +1,422 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $storagePoolTypesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $storagePoolTypesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\StoragePoolTypesClient}. + */ +class StoragePoolTypesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.StoragePoolTypes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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.readonly', + 'https://www.googleapis.com/auth/compute', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/storage_pool_types_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/storage_pool_types_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/storage_pool_types_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** + * Retrieves an aggregated list of storage pool types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $storagePoolTypesClient = new StoragePoolTypesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $storagePoolTypesClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $storagePoolTypesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $storagePoolTypesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListStoragePoolTypesRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, StoragePoolTypeAggregatedList::class, $request); + } + + /** + * Returns the specified storage pool type. + * + * Sample code: + * ``` + * $storagePoolTypesClient = new StoragePoolTypesClient(); + * try { + * $project = 'project'; + * $storagePoolType = 'storage_pool_type'; + * $zone = 'zone'; + * $response = $storagePoolTypesClient->get($project, $storagePoolType, $zone); + * } finally { + * $storagePoolTypesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $storagePoolType Name of the storage pool type to return. + * @param string $zone The name of the zone 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\StoragePoolType + * + * @throws ApiException if the remote call fails + */ + public function get($project, $storagePoolType, $zone, array $optionalArgs = []) + { + $request = new GetStoragePoolTypeRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setStoragePoolType($storagePoolType); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['storage_pool_type'] = $storagePoolType; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', StoragePoolType::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves a list of storage pool types available to the specified project. + * + * Sample code: + * ``` + * $storagePoolTypesClient = new StoragePoolTypesClient(); + * try { + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $storagePoolTypesClient->list($project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $storagePoolTypesClient->list($project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $storagePoolTypesClient->close(); + * } + * ``` + * + * @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 $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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, $zone, array $optionalArgs = []) + { + $request = new ListStoragePoolTypesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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, StoragePoolTypeList::class, $request); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/StoragePoolsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/StoragePoolsGapicClient.php new file mode 100644 index 000000000000..11e57ad5c6f9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/StoragePoolsGapicClient.php @@ -0,0 +1,939 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $storagePoolsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $storagePoolsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\StoragePoolsClient}. + */ +class StoragePoolsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.StoragePools'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/storage_pools_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/storage_pools_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/storage_pools_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** + * Retrieves an aggregated list of storage pools. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $storagePoolsClient = new StoragePoolsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $storagePoolsClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $storagePoolsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $storagePoolsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListStoragePoolsRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, StoragePoolAggregatedList::class, $request); + } + + /** + * Deletes the specified storage pool. Deleting a storagePool removes its data permanently and is irreversible. However, deleting a storagePool does not delete any snapshots previously made from the storagePool. You must separately delete snapshots. + * + * Sample code: + * ``` + * $storagePoolsClient = new StoragePoolsClient(); + * try { + * $project = 'project'; + * $storagePool = 'storage_pool'; + * $zone = 'zone'; + * $operationResponse = $storagePoolsClient->delete($project, $storagePool, $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 = $storagePoolsClient->delete($project, $storagePool, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $storagePoolsClient->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 { + * $storagePoolsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $storagePool Name of the storage pool to delete. + * @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 delete($project, $storagePool, $zone, array $optionalArgs = []) + { + $request = new DeleteStoragePoolRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setStoragePool($storagePool); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['storage_pool'] = $storagePool; + $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('Delete', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns a specified storage pool. Gets a list of available storage pools by making a list() request. + * + * Sample code: + * ``` + * $storagePoolsClient = new StoragePoolsClient(); + * try { + * $project = 'project'; + * $storagePool = 'storage_pool'; + * $zone = 'zone'; + * $response = $storagePoolsClient->get($project, $storagePool, $zone); + * } finally { + * $storagePoolsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $storagePool Name of the storage pool to return. + * @param string $zone The name of the zone 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\StoragePool + * + * @throws ApiException if the remote call fails + */ + public function get($project, $storagePool, $zone, array $optionalArgs = []) + { + $request = new GetStoragePoolRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setStoragePool($storagePool); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['storage_pool'] = $storagePool; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', StoragePool::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $storagePoolsClient = new StoragePoolsClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $zone = 'zone'; + * $response = $storagePoolsClient->getIamPolicy($project, $resource, $zone); + * } finally { + * $storagePoolsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param string $zone The name of the zone for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $resource, $zone, array $optionalArgs = []) + { + $request = new GetIamPolicyStoragePoolRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParamHeaders['zone'] = $zone; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a storage pool in the specified project using the data in the request. + * + * Sample code: + * ``` + * $storagePoolsClient = new StoragePoolsClient(); + * try { + * $project = 'project'; + * $storagePoolResource = new StoragePool(); + * $zone = 'zone'; + * $operationResponse = $storagePoolsClient->insert($project, $storagePoolResource, $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 = $storagePoolsClient->insert($project, $storagePoolResource, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $storagePoolsClient->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 { + * $storagePoolsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param StoragePool $storagePoolResource The body resource 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 insert($project, $storagePoolResource, $zone, array $optionalArgs = []) + { + $request = new InsertStoragePoolRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setStoragePoolResource($storagePoolResource); + $request->setZone($zone); + $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('Insert', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Retrieves a list of storage pools contained within the specified zone. + * + * Sample code: + * ``` + * $storagePoolsClient = new StoragePoolsClient(); + * try { + * $project = 'project'; + * $zone = 'zone'; + * $response = $storagePoolsClient->list($project, $zone); + * } finally { + * $storagePoolsClient->close(); + * } + * ``` + * + * @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 $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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * 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 bool $returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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\StoragePoolList + * + * @throws ApiException if the remote call fails + */ + public function list($project, $zone, array $optionalArgs = []) + { + $request = new ListStoragePoolsRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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->startCall('List', StoragePoolList::class, $optionalArgs, $request)->wait(); + } + + /** + * Lists the disks in a specified storage pool. + * + * Sample code: + * ``` + * $storagePoolsClient = new StoragePoolsClient(); + * try { + * $project = 'project'; + * $storagePool = 'storage_pool'; + * $zone = 'zone'; + * $response = $storagePoolsClient->listDisks($project, $storagePool, $zone); + * } finally { + * $storagePoolsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $storagePool Name of the storage pool to list disks of. + * @param string $zone The name of the zone 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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 + * 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 bool $returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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\StoragePoolListDisks + * + * @throws ApiException if the remote call fails + */ + public function listDisks($project, $storagePool, $zone, array $optionalArgs = []) + { + $request = new ListDisksStoragePoolsRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setStoragePool($storagePool); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['storage_pool'] = $storagePool; + $requestParamHeaders['zone'] = $zone; + 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->startCall('ListDisks', StoragePoolListDisks::class, $optionalArgs, $request)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $storagePoolsClient = new StoragePoolsClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $zone = 'zone'; + * $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + * $response = $storagePoolsClient->setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource); + * } finally { + * $storagePoolsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param string $zone The name of the zone for this request. + * @param ZoneSetPolicyRequest $zoneSetPolicyRequestResource The body resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource, array $optionalArgs = []) + { + $request = new SetIamPolicyStoragePoolRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setZone($zone); + $request->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $storagePoolsClient = new StoragePoolsClient(); + * try { + * $project = 'project'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $zone = 'zone'; + * $response = $storagePoolsClient->testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone); + * } finally { + * $storagePoolsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource for this request + * @param string $zone The name of the zone 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone, array $optionalArgs = []) + { + $request = new TestIamPermissionsStoragePoolRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['resource'] = $resource; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $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 storagePool 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: size_tb and provisioned_iops. + * + * Sample code: + * ``` + * $storagePoolsClient = new StoragePoolsClient(); + * try { + * $project = 'project'; + * $storagePool = 'storage_pool'; + * $storagePoolResource = new StoragePool(); + * $zone = 'zone'; + * $operationResponse = $storagePoolsClient->update($project, $storagePool, $storagePoolResource, $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 = $storagePoolsClient->update($project, $storagePool, $storagePoolResource, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $storagePoolsClient->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 { + * $storagePoolsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $storagePool The storagePool name for this request. + * @param StoragePool $storagePoolResource The body resource 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 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($project, $storagePool, $storagePoolResource, $zone, array $optionalArgs = []) + { + $request = new UpdateStoragePoolRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setStoragePool($storagePool); + $request->setStoragePoolResource($storagePoolResource); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['storage_pool'] = $storagePool; + $requestParamHeaders['zone'] = $zone; + 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/owl-bot-staging/Compute/V1/src/V1/Gapic/SubnetworksGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/SubnetworksGapicClient.php new file mode 100644 index 000000000000..af4d97fb9a01 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/SubnetworksGapicClient.php @@ -0,0 +1,1123 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $subnetworksClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $subnetworksClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\SubnetworksClient}. + */ +class SubnetworksGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.Subnetworks'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/subnetworks_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/subnetworks_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/subnetworks_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Retrieves an aggregated list of subnetworks. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $subnetworksClient = new SubnetworksClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $subnetworksClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $subnetworksClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $subnetworksClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListSubnetworksRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, SubnetworkAggregatedList::class, $request); + } + + /** + * Deletes the specified subnetwork. + * + * Sample code: + * ``` + * $subnetworksClient = new SubnetworksClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $subnetwork = 'subnetwork'; + * $operationResponse = $subnetworksClient->delete($project, $region, $subnetwork); + * $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 = $subnetworksClient->delete($project, $region, $subnetwork); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $subnetworksClient->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 { + * $subnetworksClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $subnetwork Name of the Subnetwork resource to delete. + * @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($project, $region, $subnetwork, array $optionalArgs = []) + { + $request = new DeleteSubnetworkRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setSubnetwork($subnetwork); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['subnetwork'] = $subnetwork; + 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(); + } + + /** + * Expands the IP CIDR range of the subnetwork to a specified value. + * + * Sample code: + * ``` + * $subnetworksClient = new SubnetworksClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $subnetwork = 'subnetwork'; + * $subnetworksExpandIpCidrRangeRequestResource = new SubnetworksExpandIpCidrRangeRequest(); + * $operationResponse = $subnetworksClient->expandIpCidrRange($project, $region, $subnetwork, $subnetworksExpandIpCidrRangeRequestResource); + * $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 = $subnetworksClient->expandIpCidrRange($project, $region, $subnetwork, $subnetworksExpandIpCidrRangeRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $subnetworksClient->resumeOperation($operationName, 'expandIpCidrRange'); + * 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 { + * $subnetworksClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $subnetwork Name of the Subnetwork resource to update. + * @param SubnetworksExpandIpCidrRangeRequest $subnetworksExpandIpCidrRangeRequestResource The body resource 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 expandIpCidrRange($project, $region, $subnetwork, $subnetworksExpandIpCidrRangeRequestResource, array $optionalArgs = []) + { + $request = new ExpandIpCidrRangeSubnetworkRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setSubnetwork($subnetwork); + $request->setSubnetworksExpandIpCidrRangeRequestResource($subnetworksExpandIpCidrRangeRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['subnetwork'] = $subnetwork; + 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('ExpandIpCidrRange', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns the specified subnetwork. + * + * Sample code: + * ``` + * $subnetworksClient = new SubnetworksClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $subnetwork = 'subnetwork'; + * $response = $subnetworksClient->get($project, $region, $subnetwork); + * } finally { + * $subnetworksClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $subnetwork Name of the Subnetwork resource to return. + * @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\Subnetwork + * + * @throws ApiException if the remote call fails + */ + public function get($project, $region, $subnetwork, array $optionalArgs = []) + { + $request = new GetSubnetworkRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setSubnetwork($subnetwork); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['subnetwork'] = $subnetwork; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', Subnetwork::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * Sample code: + * ``` + * $subnetworksClient = new SubnetworksClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resource = 'resource'; + * $response = $subnetworksClient->getIamPolicy($project, $region, $resource); + * } finally { + * $subnetworksClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param array $optionalArgs { + * Optional. + * + * @type int $optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @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\Policy + * + * @throws ApiException if the remote call fails + */ + public function getIamPolicy($project, $region, $resource, array $optionalArgs = []) + { + $request = new GetIamPolicySubnetworkRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['optionsRequestedPolicyVersion'])) { + $request->setOptionsRequestedPolicyVersion($optionalArgs['optionsRequestedPolicyVersion']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a subnetwork in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $subnetworksClient = new SubnetworksClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $subnetworkResource = new Subnetwork(); + * $operationResponse = $subnetworksClient->insert($project, $region, $subnetworkResource); + * $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 = $subnetworksClient->insert($project, $region, $subnetworkResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $subnetworksClient->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 { + * $subnetworksClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param Subnetwork $subnetworkResource The body resource 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($project, $region, $subnetworkResource, array $optionalArgs = []) + { + $request = new InsertSubnetworkRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setSubnetworkResource($subnetworkResource); + $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 subnetworks available to the specified project. + * + * Sample code: + * ``` + * $subnetworksClient = new SubnetworksClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $subnetworksClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $subnetworksClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $subnetworksClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListSubnetworksRequest(); + $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, SubnetworkList::class, $request); + } + + /** + * Retrieves an aggregated list of all usable subnetworks in the project. + * + * Sample code: + * ``` + * $subnetworksClient = new SubnetworksClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $subnetworksClient->listUsable($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $subnetworksClient->listUsable($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $subnetworksClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 listUsable($project, array $optionalArgs = []) + { + $request = new ListUsableSubnetworksRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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('ListUsable', $optionalArgs, UsableSubnetworksAggregatedList::class, $request); + } + + /** + * Patches the specified subnetwork with the data included in the request. Only certain fields can be updated with a patch request as indicated in the field descriptions. You must specify the current fingerprint of the subnetwork resource being patched. + * + * Sample code: + * ``` + * $subnetworksClient = new SubnetworksClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $subnetwork = 'subnetwork'; + * $subnetworkResource = new Subnetwork(); + * $operationResponse = $subnetworksClient->patch($project, $region, $subnetwork, $subnetworkResource); + * $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 = $subnetworksClient->patch($project, $region, $subnetwork, $subnetworkResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $subnetworksClient->resumeOperation($operationName, 'patch'); + * 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 { + * $subnetworksClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $subnetwork Name of the Subnetwork resource to patch. + * @param Subnetwork $subnetworkResource The body resource for this request + * @param array $optionalArgs { + * Optional. + * + * @type int $drainTimeoutSeconds + * The drain timeout specifies the upper bound in seconds on the amount of time allowed to drain connections from the current ACTIVE subnetwork to the current BACKUP subnetwork. The drain timeout is only applicable when the following conditions are true: - the subnetwork being patched has purpose = INTERNAL_HTTPS_LOAD_BALANCER - the subnetwork being patched has role = BACKUP - the patch request is setting the role to ACTIVE. Note that after this patch operation the roles of the ACTIVE and BACKUP subnetworks will be swapped. + * @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 patch($project, $region, $subnetwork, $subnetworkResource, array $optionalArgs = []) + { + $request = new PatchSubnetworkRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setSubnetwork($subnetwork); + $request->setSubnetworkResource($subnetworkResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['subnetwork'] = $subnetwork; + if (isset($optionalArgs['drainTimeoutSeconds'])) { + $request->setDrainTimeoutSeconds($optionalArgs['drainTimeoutSeconds']); + } + + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * Sample code: + * ``` + * $subnetworksClient = new SubnetworksClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + * $resource = 'resource'; + * $response = $subnetworksClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + * } finally { + * $subnetworksClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param RegionSetPolicyRequest $regionSetPolicyRequestResource The body resource for this request + * @param string $resource Name or id of the resource 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\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource, array $optionalArgs = []) + { + $request = new SetIamPolicySubnetworkRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. + * + * Sample code: + * ``` + * $subnetworksClient = new SubnetworksClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $subnetwork = 'subnetwork'; + * $subnetworksSetPrivateIpGoogleAccessRequestResource = new SubnetworksSetPrivateIpGoogleAccessRequest(); + * $operationResponse = $subnetworksClient->setPrivateIpGoogleAccess($project, $region, $subnetwork, $subnetworksSetPrivateIpGoogleAccessRequestResource); + * $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 = $subnetworksClient->setPrivateIpGoogleAccess($project, $region, $subnetwork, $subnetworksSetPrivateIpGoogleAccessRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $subnetworksClient->resumeOperation($operationName, 'setPrivateIpGoogleAccess'); + * 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 { + * $subnetworksClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $subnetwork Name of the Subnetwork resource. + * @param SubnetworksSetPrivateIpGoogleAccessRequest $subnetworksSetPrivateIpGoogleAccessRequestResource The body resource 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 setPrivateIpGoogleAccess($project, $region, $subnetwork, $subnetworksSetPrivateIpGoogleAccessRequestResource, array $optionalArgs = []) + { + $request = new SetPrivateIpGoogleAccessSubnetworkRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setSubnetwork($subnetwork); + $request->setSubnetworksSetPrivateIpGoogleAccessRequestResource($subnetworksSetPrivateIpGoogleAccessRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['subnetwork'] = $subnetwork; + 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('SetPrivateIpGoogleAccess', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $subnetworksClient = new SubnetworksClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $response = $subnetworksClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + * } finally { + * $subnetworksClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $region, $resource, $testPermissionsRequestResource, array $optionalArgs = []) + { + $request = new TestIamPermissionsSubnetworkRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetGrpcProxiesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetGrpcProxiesGapicClient.php new file mode 100644 index 000000000000..aceae20bab36 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetGrpcProxiesGapicClient.php @@ -0,0 +1,602 @@ +delete($project, $targetGrpcProxy); + * $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 = $targetGrpcProxiesClient->delete($project, $targetGrpcProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetGrpcProxiesClient->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 { + * $targetGrpcProxiesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\TargetGrpcProxiesClient}. + */ +class TargetGrpcProxiesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.TargetGrpcProxies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/target_grpc_proxies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/target_grpc_proxies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/target_grpc_proxies_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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 TargetGrpcProxy in the given scope + * + * Sample code: + * ``` + * $targetGrpcProxiesClient = new TargetGrpcProxiesClient(); + * try { + * $project = 'project'; + * $targetGrpcProxy = 'target_grpc_proxy'; + * $operationResponse = $targetGrpcProxiesClient->delete($project, $targetGrpcProxy); + * $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 = $targetGrpcProxiesClient->delete($project, $targetGrpcProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetGrpcProxiesClient->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 { + * $targetGrpcProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $targetGrpcProxy Name of the TargetGrpcProxy resource to delete. + * @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($project, $targetGrpcProxy, array $optionalArgs = []) + { + $request = new DeleteTargetGrpcProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetGrpcProxy($targetGrpcProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_grpc_proxy'] = $targetGrpcProxy; + 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 TargetGrpcProxy resource in the given scope. + * + * Sample code: + * ``` + * $targetGrpcProxiesClient = new TargetGrpcProxiesClient(); + * try { + * $project = 'project'; + * $targetGrpcProxy = 'target_grpc_proxy'; + * $response = $targetGrpcProxiesClient->get($project, $targetGrpcProxy); + * } finally { + * $targetGrpcProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $targetGrpcProxy Name of the TargetGrpcProxy resource to return. + * @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\TargetGrpcProxy + * + * @throws ApiException if the remote call fails + */ + public function get($project, $targetGrpcProxy, array $optionalArgs = []) + { + $request = new GetTargetGrpcProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetGrpcProxy($targetGrpcProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_grpc_proxy'] = $targetGrpcProxy; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', TargetGrpcProxy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a TargetGrpcProxy in the specified project in the given scope using the parameters that are included in the request. + * + * Sample code: + * ``` + * $targetGrpcProxiesClient = new TargetGrpcProxiesClient(); + * try { + * $project = 'project'; + * $targetGrpcProxyResource = new TargetGrpcProxy(); + * $operationResponse = $targetGrpcProxiesClient->insert($project, $targetGrpcProxyResource); + * $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 = $targetGrpcProxiesClient->insert($project, $targetGrpcProxyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetGrpcProxiesClient->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 { + * $targetGrpcProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param TargetGrpcProxy $targetGrpcProxyResource The body resource 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($project, $targetGrpcProxyResource, array $optionalArgs = []) + { + $request = new InsertTargetGrpcProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetGrpcProxyResource($targetGrpcProxyResource); + $requestParamHeaders['project'] = $project; + 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(); + } + + /** + * Lists the TargetGrpcProxies for a project in the given scope. + * + * Sample code: + * ``` + * $targetGrpcProxiesClient = new TargetGrpcProxiesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $targetGrpcProxiesClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $targetGrpcProxiesClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $targetGrpcProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListTargetGrpcProxiesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, TargetGrpcProxyList::class, $request); + } + + /** + * Patches the specified TargetGrpcProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $targetGrpcProxiesClient = new TargetGrpcProxiesClient(); + * try { + * $project = 'project'; + * $targetGrpcProxy = 'target_grpc_proxy'; + * $targetGrpcProxyResource = new TargetGrpcProxy(); + * $operationResponse = $targetGrpcProxiesClient->patch($project, $targetGrpcProxy, $targetGrpcProxyResource); + * $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 = $targetGrpcProxiesClient->patch($project, $targetGrpcProxy, $targetGrpcProxyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetGrpcProxiesClient->resumeOperation($operationName, 'patch'); + * 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 { + * $targetGrpcProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $targetGrpcProxy Name of the TargetGrpcProxy resource to patch. + * @param TargetGrpcProxy $targetGrpcProxyResource The body resource 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 patch($project, $targetGrpcProxy, $targetGrpcProxyResource, array $optionalArgs = []) + { + $request = new PatchTargetGrpcProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetGrpcProxy($targetGrpcProxy); + $request->setTargetGrpcProxyResource($targetGrpcProxyResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_grpc_proxy'] = $targetGrpcProxy; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetHttpProxiesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetHttpProxiesGapicClient.php new file mode 100644 index 000000000000..c6863c0348c8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetHttpProxiesGapicClient.php @@ -0,0 +1,765 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $targetHttpProxiesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $targetHttpProxiesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\TargetHttpProxiesClient}. + */ +class TargetHttpProxiesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.TargetHttpProxies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/target_http_proxies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/target_http_proxies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/target_http_proxies_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** + * Retrieves the list of all TargetHttpProxy resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $targetHttpProxiesClient = new TargetHttpProxiesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $targetHttpProxiesClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $targetHttpProxiesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $targetHttpProxiesClient->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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListTargetHttpProxiesRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, TargetHttpProxyAggregatedList::class, $request); + } + + /** + * Deletes the specified TargetHttpProxy resource. + * + * Sample code: + * ``` + * $targetHttpProxiesClient = new TargetHttpProxiesClient(); + * try { + * $project = 'project'; + * $targetHttpProxy = 'target_http_proxy'; + * $operationResponse = $targetHttpProxiesClient->delete($project, $targetHttpProxy); + * $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 = $targetHttpProxiesClient->delete($project, $targetHttpProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetHttpProxiesClient->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 { + * $targetHttpProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $targetHttpProxy Name of the TargetHttpProxy resource to delete. + * @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($project, $targetHttpProxy, array $optionalArgs = []) + { + $request = new DeleteTargetHttpProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetHttpProxy($targetHttpProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_http_proxy'] = $targetHttpProxy; + 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 TargetHttpProxy resource. + * + * Sample code: + * ``` + * $targetHttpProxiesClient = new TargetHttpProxiesClient(); + * try { + * $project = 'project'; + * $targetHttpProxy = 'target_http_proxy'; + * $response = $targetHttpProxiesClient->get($project, $targetHttpProxy); + * } finally { + * $targetHttpProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $targetHttpProxy Name of the TargetHttpProxy resource to return. + * @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\TargetHttpProxy + * + * @throws ApiException if the remote call fails + */ + public function get($project, $targetHttpProxy, array $optionalArgs = []) + { + $request = new GetTargetHttpProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetHttpProxy($targetHttpProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_http_proxy'] = $targetHttpProxy; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', TargetHttpProxy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a TargetHttpProxy resource in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $targetHttpProxiesClient = new TargetHttpProxiesClient(); + * try { + * $project = 'project'; + * $targetHttpProxyResource = new TargetHttpProxy(); + * $operationResponse = $targetHttpProxiesClient->insert($project, $targetHttpProxyResource); + * $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 = $targetHttpProxiesClient->insert($project, $targetHttpProxyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetHttpProxiesClient->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 { + * $targetHttpProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param TargetHttpProxy $targetHttpProxyResource The body resource 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($project, $targetHttpProxyResource, array $optionalArgs = []) + { + $request = new InsertTargetHttpProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetHttpProxyResource($targetHttpProxyResource); + $requestParamHeaders['project'] = $project; + 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 the list of TargetHttpProxy resources available to the specified project. + * + * Sample code: + * ``` + * $targetHttpProxiesClient = new TargetHttpProxiesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $targetHttpProxiesClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $targetHttpProxiesClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $targetHttpProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListTargetHttpProxiesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, TargetHttpProxyList::class, $request); + } + + /** + * Patches the specified TargetHttpProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $targetHttpProxiesClient = new TargetHttpProxiesClient(); + * try { + * $project = 'project'; + * $targetHttpProxy = 'target_http_proxy'; + * $targetHttpProxyResource = new TargetHttpProxy(); + * $operationResponse = $targetHttpProxiesClient->patch($project, $targetHttpProxy, $targetHttpProxyResource); + * $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 = $targetHttpProxiesClient->patch($project, $targetHttpProxy, $targetHttpProxyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetHttpProxiesClient->resumeOperation($operationName, 'patch'); + * 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 { + * $targetHttpProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $targetHttpProxy Name of the TargetHttpProxy resource to patch. + * @param TargetHttpProxy $targetHttpProxyResource The body resource 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 patch($project, $targetHttpProxy, $targetHttpProxyResource, array $optionalArgs = []) + { + $request = new PatchTargetHttpProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetHttpProxy($targetHttpProxy); + $request->setTargetHttpProxyResource($targetHttpProxyResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_http_proxy'] = $targetHttpProxy; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Changes the URL map for TargetHttpProxy. + * + * Sample code: + * ``` + * $targetHttpProxiesClient = new TargetHttpProxiesClient(); + * try { + * $project = 'project'; + * $targetHttpProxy = 'target_http_proxy'; + * $urlMapReferenceResource = new UrlMapReference(); + * $operationResponse = $targetHttpProxiesClient->setUrlMap($project, $targetHttpProxy, $urlMapReferenceResource); + * $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 = $targetHttpProxiesClient->setUrlMap($project, $targetHttpProxy, $urlMapReferenceResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetHttpProxiesClient->resumeOperation($operationName, 'setUrlMap'); + * 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 { + * $targetHttpProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $targetHttpProxy Name of the TargetHttpProxy to set a URL map for. + * @param UrlMapReference $urlMapReferenceResource The body resource 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 setUrlMap($project, $targetHttpProxy, $urlMapReferenceResource, array $optionalArgs = []) + { + $request = new SetUrlMapTargetHttpProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetHttpProxy($targetHttpProxy); + $request->setUrlMapReferenceResource($urlMapReferenceResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_http_proxy'] = $targetHttpProxy; + 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('SetUrlMap', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetHttpsProxiesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetHttpsProxiesGapicClient.php new file mode 100644 index 000000000000..c9c413666294 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetHttpsProxiesGapicClient.php @@ -0,0 +1,1073 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $targetHttpsProxiesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $targetHttpsProxiesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\TargetHttpsProxiesClient}. + */ +class TargetHttpsProxiesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.TargetHttpsProxies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/target_https_proxies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/target_https_proxies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/target_https_proxies_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** + * Retrieves the list of all TargetHttpsProxy resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $targetHttpsProxiesClient = new TargetHttpsProxiesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $targetHttpsProxiesClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $targetHttpsProxiesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $targetHttpsProxiesClient->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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListTargetHttpsProxiesRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, TargetHttpsProxyAggregatedList::class, $request); + } + + /** + * Deletes the specified TargetHttpsProxy resource. + * + * Sample code: + * ``` + * $targetHttpsProxiesClient = new TargetHttpsProxiesClient(); + * try { + * $project = 'project'; + * $targetHttpsProxy = 'target_https_proxy'; + * $operationResponse = $targetHttpsProxiesClient->delete($project, $targetHttpsProxy); + * $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 = $targetHttpsProxiesClient->delete($project, $targetHttpsProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetHttpsProxiesClient->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 { + * $targetHttpsProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource to delete. + * @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($project, $targetHttpsProxy, array $optionalArgs = []) + { + $request = new DeleteTargetHttpsProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetHttpsProxy($targetHttpsProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_https_proxy'] = $targetHttpsProxy; + 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 TargetHttpsProxy resource. + * + * Sample code: + * ``` + * $targetHttpsProxiesClient = new TargetHttpsProxiesClient(); + * try { + * $project = 'project'; + * $targetHttpsProxy = 'target_https_proxy'; + * $response = $targetHttpsProxiesClient->get($project, $targetHttpsProxy); + * } finally { + * $targetHttpsProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource to return. + * @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\TargetHttpsProxy + * + * @throws ApiException if the remote call fails + */ + public function get($project, $targetHttpsProxy, array $optionalArgs = []) + { + $request = new GetTargetHttpsProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetHttpsProxy($targetHttpsProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_https_proxy'] = $targetHttpsProxy; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', TargetHttpsProxy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a TargetHttpsProxy resource in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $targetHttpsProxiesClient = new TargetHttpsProxiesClient(); + * try { + * $project = 'project'; + * $targetHttpsProxyResource = new TargetHttpsProxy(); + * $operationResponse = $targetHttpsProxiesClient->insert($project, $targetHttpsProxyResource); + * $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 = $targetHttpsProxiesClient->insert($project, $targetHttpsProxyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetHttpsProxiesClient->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 { + * $targetHttpsProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param TargetHttpsProxy $targetHttpsProxyResource The body resource 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($project, $targetHttpsProxyResource, array $optionalArgs = []) + { + $request = new InsertTargetHttpsProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetHttpsProxyResource($targetHttpsProxyResource); + $requestParamHeaders['project'] = $project; + 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 the list of TargetHttpsProxy resources available to the specified project. + * + * Sample code: + * ``` + * $targetHttpsProxiesClient = new TargetHttpsProxiesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $targetHttpsProxiesClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $targetHttpsProxiesClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $targetHttpsProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListTargetHttpsProxiesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, TargetHttpsProxyList::class, $request); + } + + /** + * Patches the specified TargetHttpsProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $targetHttpsProxiesClient = new TargetHttpsProxiesClient(); + * try { + * $project = 'project'; + * $targetHttpsProxy = 'target_https_proxy'; + * $targetHttpsProxyResource = new TargetHttpsProxy(); + * $operationResponse = $targetHttpsProxiesClient->patch($project, $targetHttpsProxy, $targetHttpsProxyResource); + * $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 = $targetHttpsProxiesClient->patch($project, $targetHttpsProxy, $targetHttpsProxyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetHttpsProxiesClient->resumeOperation($operationName, 'patch'); + * 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 { + * $targetHttpsProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource to patch. + * @param TargetHttpsProxy $targetHttpsProxyResource The body resource 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 patch($project, $targetHttpsProxy, $targetHttpsProxyResource, array $optionalArgs = []) + { + $request = new PatchTargetHttpsProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetHttpsProxy($targetHttpsProxy); + $request->setTargetHttpsProxyResource($targetHttpsProxyResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_https_proxy'] = $targetHttpsProxy; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Changes the Certificate Map for TargetHttpsProxy. + * + * Sample code: + * ``` + * $targetHttpsProxiesClient = new TargetHttpsProxiesClient(); + * try { + * $project = 'project'; + * $targetHttpsProxiesSetCertificateMapRequestResource = new TargetHttpsProxiesSetCertificateMapRequest(); + * $targetHttpsProxy = 'target_https_proxy'; + * $operationResponse = $targetHttpsProxiesClient->setCertificateMap($project, $targetHttpsProxiesSetCertificateMapRequestResource, $targetHttpsProxy); + * $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 = $targetHttpsProxiesClient->setCertificateMap($project, $targetHttpsProxiesSetCertificateMapRequestResource, $targetHttpsProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetHttpsProxiesClient->resumeOperation($operationName, 'setCertificateMap'); + * 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 { + * $targetHttpsProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param TargetHttpsProxiesSetCertificateMapRequest $targetHttpsProxiesSetCertificateMapRequestResource The body resource for this request + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource whose CertificateMap is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * @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 setCertificateMap($project, $targetHttpsProxiesSetCertificateMapRequestResource, $targetHttpsProxy, array $optionalArgs = []) + { + $request = new SetCertificateMapTargetHttpsProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetHttpsProxiesSetCertificateMapRequestResource($targetHttpsProxiesSetCertificateMapRequestResource); + $request->setTargetHttpsProxy($targetHttpsProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_https_proxy'] = $targetHttpsProxy; + 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('SetCertificateMap', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the QUIC override policy for TargetHttpsProxy. + * + * Sample code: + * ``` + * $targetHttpsProxiesClient = new TargetHttpsProxiesClient(); + * try { + * $project = 'project'; + * $targetHttpsProxiesSetQuicOverrideRequestResource = new TargetHttpsProxiesSetQuicOverrideRequest(); + * $targetHttpsProxy = 'target_https_proxy'; + * $operationResponse = $targetHttpsProxiesClient->setQuicOverride($project, $targetHttpsProxiesSetQuicOverrideRequestResource, $targetHttpsProxy); + * $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 = $targetHttpsProxiesClient->setQuicOverride($project, $targetHttpsProxiesSetQuicOverrideRequestResource, $targetHttpsProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetHttpsProxiesClient->resumeOperation($operationName, 'setQuicOverride'); + * 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 { + * $targetHttpsProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param TargetHttpsProxiesSetQuicOverrideRequest $targetHttpsProxiesSetQuicOverrideRequestResource The body resource for this request + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035. + * @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 setQuicOverride($project, $targetHttpsProxiesSetQuicOverrideRequestResource, $targetHttpsProxy, array $optionalArgs = []) + { + $request = new SetQuicOverrideTargetHttpsProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetHttpsProxiesSetQuicOverrideRequestResource($targetHttpsProxiesSetQuicOverrideRequestResource); + $request->setTargetHttpsProxy($targetHttpsProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_https_proxy'] = $targetHttpsProxy; + 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('SetQuicOverride', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Replaces SslCertificates for TargetHttpsProxy. + * + * Sample code: + * ``` + * $targetHttpsProxiesClient = new TargetHttpsProxiesClient(); + * try { + * $project = 'project'; + * $targetHttpsProxiesSetSslCertificatesRequestResource = new TargetHttpsProxiesSetSslCertificatesRequest(); + * $targetHttpsProxy = 'target_https_proxy'; + * $operationResponse = $targetHttpsProxiesClient->setSslCertificates($project, $targetHttpsProxiesSetSslCertificatesRequestResource, $targetHttpsProxy); + * $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 = $targetHttpsProxiesClient->setSslCertificates($project, $targetHttpsProxiesSetSslCertificatesRequestResource, $targetHttpsProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetHttpsProxiesClient->resumeOperation($operationName, 'setSslCertificates'); + * 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 { + * $targetHttpsProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param TargetHttpsProxiesSetSslCertificatesRequest $targetHttpsProxiesSetSslCertificatesRequestResource The body resource for this request + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * @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 setSslCertificates($project, $targetHttpsProxiesSetSslCertificatesRequestResource, $targetHttpsProxy, array $optionalArgs = []) + { + $request = new SetSslCertificatesTargetHttpsProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetHttpsProxiesSetSslCertificatesRequestResource($targetHttpsProxiesSetSslCertificatesRequestResource); + $request->setTargetHttpsProxy($targetHttpsProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_https_proxy'] = $targetHttpsProxy; + 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('SetSslCertificates', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the HTTPS proxy load balancer. They do not affect the connection between the load balancer and the backends. + * + * Sample code: + * ``` + * $targetHttpsProxiesClient = new TargetHttpsProxiesClient(); + * try { + * $project = 'project'; + * $sslPolicyReferenceResource = new SslPolicyReference(); + * $targetHttpsProxy = 'target_https_proxy'; + * $operationResponse = $targetHttpsProxiesClient->setSslPolicy($project, $sslPolicyReferenceResource, $targetHttpsProxy); + * $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 = $targetHttpsProxiesClient->setSslPolicy($project, $sslPolicyReferenceResource, $targetHttpsProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetHttpsProxiesClient->resumeOperation($operationName, 'setSslPolicy'); + * 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 { + * $targetHttpsProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param SslPolicyReference $sslPolicyReferenceResource The body resource for this request + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * @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 setSslPolicy($project, $sslPolicyReferenceResource, $targetHttpsProxy, array $optionalArgs = []) + { + $request = new SetSslPolicyTargetHttpsProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setSslPolicyReferenceResource($sslPolicyReferenceResource); + $request->setTargetHttpsProxy($targetHttpsProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_https_proxy'] = $targetHttpsProxy; + 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('SetSslPolicy', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Changes the URL map for TargetHttpsProxy. + * + * Sample code: + * ``` + * $targetHttpsProxiesClient = new TargetHttpsProxiesClient(); + * try { + * $project = 'project'; + * $targetHttpsProxy = 'target_https_proxy'; + * $urlMapReferenceResource = new UrlMapReference(); + * $operationResponse = $targetHttpsProxiesClient->setUrlMap($project, $targetHttpsProxy, $urlMapReferenceResource); + * $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 = $targetHttpsProxiesClient->setUrlMap($project, $targetHttpsProxy, $urlMapReferenceResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetHttpsProxiesClient->resumeOperation($operationName, 'setUrlMap'); + * 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 { + * $targetHttpsProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $targetHttpsProxy Name of the TargetHttpsProxy resource whose URL map is to be set. + * @param UrlMapReference $urlMapReferenceResource The body resource 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 setUrlMap($project, $targetHttpsProxy, $urlMapReferenceResource, array $optionalArgs = []) + { + $request = new SetUrlMapTargetHttpsProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetHttpsProxy($targetHttpsProxy); + $request->setUrlMapReferenceResource($urlMapReferenceResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_https_proxy'] = $targetHttpsProxy; + 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('SetUrlMap', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetInstancesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetInstancesGapicClient.php new file mode 100644 index 000000000000..4fc02b4ba421 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetInstancesGapicClient.php @@ -0,0 +1,710 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $targetInstancesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $targetInstancesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\TargetInstancesClient}. + */ +class TargetInstancesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.TargetInstances'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/target_instances_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/target_instances_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/target_instances_rest_client_config.php', + ], + ], + 'operationsClientClass' => ZoneOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an ZoneOperationsClient object with the same endpoint as $this. + * + * @return ZoneOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + '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, + ]; + } + + /** + * 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); + } + + /** + * Retrieves an aggregated list of target instances. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $targetInstancesClient = new TargetInstancesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $targetInstancesClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $targetInstancesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $targetInstancesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListTargetInstancesRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, TargetInstanceAggregatedList::class, $request); + } + + /** + * Deletes the specified TargetInstance resource. + * + * Sample code: + * ``` + * $targetInstancesClient = new TargetInstancesClient(); + * try { + * $project = 'project'; + * $targetInstance = 'target_instance'; + * $zone = 'zone'; + * $operationResponse = $targetInstancesClient->delete($project, $targetInstance, $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 = $targetInstancesClient->delete($project, $targetInstance, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetInstancesClient->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 { + * $targetInstancesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $targetInstance Name of the TargetInstance resource to delete. + * @param string $zone Name of the zone scoping 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($project, $targetInstance, $zone, array $optionalArgs = []) + { + $request = new DeleteTargetInstanceRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetInstance($targetInstance); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_instance'] = $targetInstance; + $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('Delete', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns the specified TargetInstance resource. + * + * Sample code: + * ``` + * $targetInstancesClient = new TargetInstancesClient(); + * try { + * $project = 'project'; + * $targetInstance = 'target_instance'; + * $zone = 'zone'; + * $response = $targetInstancesClient->get($project, $targetInstance, $zone); + * } finally { + * $targetInstancesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $targetInstance Name of the TargetInstance resource to return. + * @param string $zone Name of the zone scoping 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\TargetInstance + * + * @throws ApiException if the remote call fails + */ + public function get($project, $targetInstance, $zone, array $optionalArgs = []) + { + $request = new GetTargetInstanceRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetInstance($targetInstance); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_instance'] = $targetInstance; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', TargetInstance::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a TargetInstance resource in the specified project and zone using the data included in the request. + * + * Sample code: + * ``` + * $targetInstancesClient = new TargetInstancesClient(); + * try { + * $project = 'project'; + * $targetInstanceResource = new TargetInstance(); + * $zone = 'zone'; + * $operationResponse = $targetInstancesClient->insert($project, $targetInstanceResource, $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 = $targetInstancesClient->insert($project, $targetInstanceResource, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetInstancesClient->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 { + * $targetInstancesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param TargetInstance $targetInstanceResource The body resource for this request + * @param string $zone Name of the zone scoping 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($project, $targetInstanceResource, $zone, array $optionalArgs = []) + { + $request = new InsertTargetInstanceRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetInstanceResource($targetInstanceResource); + $request->setZone($zone); + $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('Insert', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Retrieves a list of TargetInstance resources available to the specified project and zone. + * + * Sample code: + * ``` + * $targetInstancesClient = new TargetInstancesClient(); + * try { + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $targetInstancesClient->list($project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $targetInstancesClient->list($project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $targetInstancesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $zone Name of the zone 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, $zone, array $optionalArgs = []) + { + $request = new ListTargetInstancesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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, TargetInstanceList::class, $request); + } + + /** + * Sets the Google Cloud Armor security policy for the specified target instance. For more information, see Google Cloud Armor Overview + * + * Sample code: + * ``` + * $targetInstancesClient = new TargetInstancesClient(); + * try { + * $project = 'project'; + * $securityPolicyReferenceResource = new SecurityPolicyReference(); + * $targetInstance = 'target_instance'; + * $zone = 'zone'; + * $operationResponse = $targetInstancesClient->setSecurityPolicy($project, $securityPolicyReferenceResource, $targetInstance, $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 = $targetInstancesClient->setSecurityPolicy($project, $securityPolicyReferenceResource, $targetInstance, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetInstancesClient->resumeOperation($operationName, 'setSecurityPolicy'); + * 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 { + * $targetInstancesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param SecurityPolicyReference $securityPolicyReferenceResource The body resource for this request + * @param string $targetInstance Name of the TargetInstance resource to which the security policy should be set. The name should conform to RFC1035. + * @param string $zone Name of the zone scoping 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 setSecurityPolicy($project, $securityPolicyReferenceResource, $targetInstance, $zone, array $optionalArgs = []) + { + $request = new SetSecurityPolicyTargetInstanceRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + $request->setTargetInstance($targetInstance); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_instance'] = $targetInstance; + $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('SetSecurityPolicy', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetPoolsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetPoolsGapicClient.php new file mode 100644 index 000000000000..c7a1ef5b285c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetPoolsGapicClient.php @@ -0,0 +1,1188 @@ +addHealthCheck($project, $region, $targetPool, $targetPoolsAddHealthCheckRequestResource); + * $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 = $targetPoolsClient->addHealthCheck($project, $region, $targetPool, $targetPoolsAddHealthCheckRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetPoolsClient->resumeOperation($operationName, 'addHealthCheck'); + * 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 { + * $targetPoolsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\TargetPoolsClient}. + */ +class TargetPoolsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.TargetPools'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/target_pools_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/target_pools_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/target_pools_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Adds health check URLs to a target pool. + * + * Sample code: + * ``` + * $targetPoolsClient = new TargetPoolsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetPool = 'target_pool'; + * $targetPoolsAddHealthCheckRequestResource = new TargetPoolsAddHealthCheckRequest(); + * $operationResponse = $targetPoolsClient->addHealthCheck($project, $region, $targetPool, $targetPoolsAddHealthCheckRequestResource); + * $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 = $targetPoolsClient->addHealthCheck($project, $region, $targetPool, $targetPoolsAddHealthCheckRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetPoolsClient->resumeOperation($operationName, 'addHealthCheck'); + * 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 { + * $targetPoolsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetPool Name of the target pool to add a health check to. + * @param TargetPoolsAddHealthCheckRequest $targetPoolsAddHealthCheckRequestResource The body resource 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 addHealthCheck($project, $region, $targetPool, $targetPoolsAddHealthCheckRequestResource, array $optionalArgs = []) + { + $request = new AddHealthCheckTargetPoolRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetPool($targetPool); + $request->setTargetPoolsAddHealthCheckRequestResource($targetPoolsAddHealthCheckRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['target_pool'] = $targetPool; + 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('AddHealthCheck', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Adds an instance to a target pool. + * + * Sample code: + * ``` + * $targetPoolsClient = new TargetPoolsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetPool = 'target_pool'; + * $targetPoolsAddInstanceRequestResource = new TargetPoolsAddInstanceRequest(); + * $operationResponse = $targetPoolsClient->addInstance($project, $region, $targetPool, $targetPoolsAddInstanceRequestResource); + * $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 = $targetPoolsClient->addInstance($project, $region, $targetPool, $targetPoolsAddInstanceRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetPoolsClient->resumeOperation($operationName, 'addInstance'); + * 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 { + * $targetPoolsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetPool Name of the TargetPool resource to add instances to. + * @param TargetPoolsAddInstanceRequest $targetPoolsAddInstanceRequestResource The body resource 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 addInstance($project, $region, $targetPool, $targetPoolsAddInstanceRequestResource, array $optionalArgs = []) + { + $request = new AddInstanceTargetPoolRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetPool($targetPool); + $request->setTargetPoolsAddInstanceRequestResource($targetPoolsAddInstanceRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['target_pool'] = $targetPool; + 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('AddInstance', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Retrieves an aggregated list of target pools. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $targetPoolsClient = new TargetPoolsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $targetPoolsClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $targetPoolsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $targetPoolsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListTargetPoolsRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, TargetPoolAggregatedList::class, $request); + } + + /** + * Deletes the specified target pool. + * + * Sample code: + * ``` + * $targetPoolsClient = new TargetPoolsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetPool = 'target_pool'; + * $operationResponse = $targetPoolsClient->delete($project, $region, $targetPool); + * $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 = $targetPoolsClient->delete($project, $region, $targetPool); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetPoolsClient->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 { + * $targetPoolsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetPool Name of the TargetPool resource to delete. + * @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($project, $region, $targetPool, array $optionalArgs = []) + { + $request = new DeleteTargetPoolRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetPool($targetPool); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['target_pool'] = $targetPool; + 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 target pool. + * + * Sample code: + * ``` + * $targetPoolsClient = new TargetPoolsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetPool = 'target_pool'; + * $response = $targetPoolsClient->get($project, $region, $targetPool); + * } finally { + * $targetPoolsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetPool Name of the TargetPool resource to return. + * @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\TargetPool + * + * @throws ApiException if the remote call fails + */ + public function get($project, $region, $targetPool, array $optionalArgs = []) + { + $request = new GetTargetPoolRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetPool($targetPool); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['target_pool'] = $targetPool; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', TargetPool::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the most recent health check results for each IP for the instance that is referenced by the given target pool. + * + * Sample code: + * ``` + * $targetPoolsClient = new TargetPoolsClient(); + * try { + * $instanceReferenceResource = new InstanceReference(); + * $project = 'project'; + * $region = 'region'; + * $targetPool = 'target_pool'; + * $response = $targetPoolsClient->getHealth($instanceReferenceResource, $project, $region, $targetPool); + * } finally { + * $targetPoolsClient->close(); + * } + * ``` + * + * @param InstanceReference $instanceReferenceResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetPool Name of the TargetPool resource to which the queried instance belongs. + * @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\TargetPoolInstanceHealth + * + * @throws ApiException if the remote call fails + */ + public function getHealth($instanceReferenceResource, $project, $region, $targetPool, array $optionalArgs = []) + { + $request = new GetHealthTargetPoolRequest(); + $requestParamHeaders = []; + $request->setInstanceReferenceResource($instanceReferenceResource); + $request->setProject($project); + $request->setRegion($region); + $request->setTargetPool($targetPool); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['target_pool'] = $targetPool; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetHealth', TargetPoolInstanceHealth::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a target pool in the specified project and region using the data included in the request. + * + * Sample code: + * ``` + * $targetPoolsClient = new TargetPoolsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetPoolResource = new TargetPool(); + * $operationResponse = $targetPoolsClient->insert($project, $region, $targetPoolResource); + * $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 = $targetPoolsClient->insert($project, $region, $targetPoolResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetPoolsClient->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 { + * $targetPoolsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param TargetPool $targetPoolResource The body resource 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($project, $region, $targetPoolResource, array $optionalArgs = []) + { + $request = new InsertTargetPoolRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetPoolResource($targetPoolResource); + $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 target pools available to the specified project and region. + * + * Sample code: + * ``` + * $targetPoolsClient = new TargetPoolsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $targetPoolsClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $targetPoolsClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $targetPoolsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListTargetPoolsRequest(); + $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, TargetPoolList::class, $request); + } + + /** + * Removes health check URL from a target pool. + * + * Sample code: + * ``` + * $targetPoolsClient = new TargetPoolsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetPool = 'target_pool'; + * $targetPoolsRemoveHealthCheckRequestResource = new TargetPoolsRemoveHealthCheckRequest(); + * $operationResponse = $targetPoolsClient->removeHealthCheck($project, $region, $targetPool, $targetPoolsRemoveHealthCheckRequestResource); + * $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 = $targetPoolsClient->removeHealthCheck($project, $region, $targetPool, $targetPoolsRemoveHealthCheckRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetPoolsClient->resumeOperation($operationName, 'removeHealthCheck'); + * 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 { + * $targetPoolsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $targetPool Name of the target pool to remove health checks from. + * @param TargetPoolsRemoveHealthCheckRequest $targetPoolsRemoveHealthCheckRequestResource The body resource 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 removeHealthCheck($project, $region, $targetPool, $targetPoolsRemoveHealthCheckRequestResource, array $optionalArgs = []) + { + $request = new RemoveHealthCheckTargetPoolRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetPool($targetPool); + $request->setTargetPoolsRemoveHealthCheckRequestResource($targetPoolsRemoveHealthCheckRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['target_pool'] = $targetPool; + 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('RemoveHealthCheck', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Removes instance URL from a target pool. + * + * Sample code: + * ``` + * $targetPoolsClient = new TargetPoolsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetPool = 'target_pool'; + * $targetPoolsRemoveInstanceRequestResource = new TargetPoolsRemoveInstanceRequest(); + * $operationResponse = $targetPoolsClient->removeInstance($project, $region, $targetPool, $targetPoolsRemoveInstanceRequestResource); + * $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 = $targetPoolsClient->removeInstance($project, $region, $targetPool, $targetPoolsRemoveInstanceRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetPoolsClient->resumeOperation($operationName, 'removeInstance'); + * 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 { + * $targetPoolsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetPool Name of the TargetPool resource to remove instances from. + * @param TargetPoolsRemoveInstanceRequest $targetPoolsRemoveInstanceRequestResource The body resource 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 removeInstance($project, $region, $targetPool, $targetPoolsRemoveInstanceRequestResource, array $optionalArgs = []) + { + $request = new RemoveInstanceTargetPoolRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetPool($targetPool); + $request->setTargetPoolsRemoveInstanceRequestResource($targetPoolsRemoveInstanceRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['target_pool'] = $targetPool; + 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('RemoveInstance', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Changes a backup target pool's configurations. + * + * Sample code: + * ``` + * $targetPoolsClient = new TargetPoolsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetPool = 'target_pool'; + * $targetReferenceResource = new TargetReference(); + * $operationResponse = $targetPoolsClient->setBackup($project, $region, $targetPool, $targetReferenceResource); + * $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 = $targetPoolsClient->setBackup($project, $region, $targetPool, $targetReferenceResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetPoolsClient->resumeOperation($operationName, 'setBackup'); + * 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 { + * $targetPoolsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param string $targetPool Name of the TargetPool resource to set a backup pool for. + * @param TargetReference $targetReferenceResource The body resource for this request + * @param array $optionalArgs { + * Optional. + * + * @type float $failoverRatio + * New failoverRatio value for the target pool. + * @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 setBackup($project, $region, $targetPool, $targetReferenceResource, array $optionalArgs = []) + { + $request = new SetBackupTargetPoolRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetPool($targetPool); + $request->setTargetReferenceResource($targetReferenceResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['target_pool'] = $targetPool; + if (isset($optionalArgs['failoverRatio'])) { + $request->setFailoverRatio($optionalArgs['failoverRatio']); + } + + 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('SetBackup', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the Google Cloud Armor security policy for the specified target pool. For more information, see Google Cloud Armor Overview + * + * Sample code: + * ``` + * $targetPoolsClient = new TargetPoolsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $securityPolicyReferenceResource = new SecurityPolicyReference(); + * $targetPool = 'target_pool'; + * $operationResponse = $targetPoolsClient->setSecurityPolicy($project, $region, $securityPolicyReferenceResource, $targetPool); + * $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 = $targetPoolsClient->setSecurityPolicy($project, $region, $securityPolicyReferenceResource, $targetPool); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetPoolsClient->resumeOperation($operationName, 'setSecurityPolicy'); + * 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 { + * $targetPoolsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region scoping this request. + * @param SecurityPolicyReference $securityPolicyReferenceResource The body resource for this request + * @param string $targetPool Name of the TargetPool resource to which the security policy should be set. The name should conform to RFC1035. + * @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 setSecurityPolicy($project, $region, $securityPolicyReferenceResource, $targetPool, array $optionalArgs = []) + { + $request = new SetSecurityPolicyTargetPoolRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + $request->setTargetPool($targetPool); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['target_pool'] = $targetPool; + 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('SetSecurityPolicy', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetSslProxiesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetSslProxiesGapicClient.php new file mode 100644 index 000000000000..70852d65e59c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetSslProxiesGapicClient.php @@ -0,0 +1,911 @@ +delete($project, $targetSslProxy); + * $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 = $targetSslProxiesClient->delete($project, $targetSslProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetSslProxiesClient->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 { + * $targetSslProxiesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\TargetSslProxiesClient}. + */ +class TargetSslProxiesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.TargetSslProxies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/target_ssl_proxies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/target_ssl_proxies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/target_ssl_proxies_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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 TargetSslProxy resource. + * + * Sample code: + * ``` + * $targetSslProxiesClient = new TargetSslProxiesClient(); + * try { + * $project = 'project'; + * $targetSslProxy = 'target_ssl_proxy'; + * $operationResponse = $targetSslProxiesClient->delete($project, $targetSslProxy); + * $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 = $targetSslProxiesClient->delete($project, $targetSslProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetSslProxiesClient->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 { + * $targetSslProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $targetSslProxy Name of the TargetSslProxy resource to delete. + * @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($project, $targetSslProxy, array $optionalArgs = []) + { + $request = new DeleteTargetSslProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetSslProxy($targetSslProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_ssl_proxy'] = $targetSslProxy; + 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 TargetSslProxy resource. + * + * Sample code: + * ``` + * $targetSslProxiesClient = new TargetSslProxiesClient(); + * try { + * $project = 'project'; + * $targetSslProxy = 'target_ssl_proxy'; + * $response = $targetSslProxiesClient->get($project, $targetSslProxy); + * } finally { + * $targetSslProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $targetSslProxy Name of the TargetSslProxy resource to return. + * @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\TargetSslProxy + * + * @throws ApiException if the remote call fails + */ + public function get($project, $targetSslProxy, array $optionalArgs = []) + { + $request = new GetTargetSslProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetSslProxy($targetSslProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_ssl_proxy'] = $targetSslProxy; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', TargetSslProxy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a TargetSslProxy resource in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $targetSslProxiesClient = new TargetSslProxiesClient(); + * try { + * $project = 'project'; + * $targetSslProxyResource = new TargetSslProxy(); + * $operationResponse = $targetSslProxiesClient->insert($project, $targetSslProxyResource); + * $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 = $targetSslProxiesClient->insert($project, $targetSslProxyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetSslProxiesClient->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 { + * $targetSslProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param TargetSslProxy $targetSslProxyResource The body resource 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($project, $targetSslProxyResource, array $optionalArgs = []) + { + $request = new InsertTargetSslProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetSslProxyResource($targetSslProxyResource); + $requestParamHeaders['project'] = $project; + 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 the list of TargetSslProxy resources available to the specified project. + * + * Sample code: + * ``` + * $targetSslProxiesClient = new TargetSslProxiesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $targetSslProxiesClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $targetSslProxiesClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $targetSslProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListTargetSslProxiesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, TargetSslProxyList::class, $request); + } + + /** + * Changes the BackendService for TargetSslProxy. + * + * Sample code: + * ``` + * $targetSslProxiesClient = new TargetSslProxiesClient(); + * try { + * $project = 'project'; + * $targetSslProxiesSetBackendServiceRequestResource = new TargetSslProxiesSetBackendServiceRequest(); + * $targetSslProxy = 'target_ssl_proxy'; + * $operationResponse = $targetSslProxiesClient->setBackendService($project, $targetSslProxiesSetBackendServiceRequestResource, $targetSslProxy); + * $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 = $targetSslProxiesClient->setBackendService($project, $targetSslProxiesSetBackendServiceRequestResource, $targetSslProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetSslProxiesClient->resumeOperation($operationName, 'setBackendService'); + * 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 { + * $targetSslProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param TargetSslProxiesSetBackendServiceRequest $targetSslProxiesSetBackendServiceRequestResource The body resource for this request + * @param string $targetSslProxy Name of the TargetSslProxy resource whose BackendService resource is to be set. + * @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 setBackendService($project, $targetSslProxiesSetBackendServiceRequestResource, $targetSslProxy, array $optionalArgs = []) + { + $request = new SetBackendServiceTargetSslProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetSslProxiesSetBackendServiceRequestResource($targetSslProxiesSetBackendServiceRequestResource); + $request->setTargetSslProxy($targetSslProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_ssl_proxy'] = $targetSslProxy; + 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('SetBackendService', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Changes the Certificate Map for TargetSslProxy. + * + * Sample code: + * ``` + * $targetSslProxiesClient = new TargetSslProxiesClient(); + * try { + * $project = 'project'; + * $targetSslProxiesSetCertificateMapRequestResource = new TargetSslProxiesSetCertificateMapRequest(); + * $targetSslProxy = 'target_ssl_proxy'; + * $operationResponse = $targetSslProxiesClient->setCertificateMap($project, $targetSslProxiesSetCertificateMapRequestResource, $targetSslProxy); + * $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 = $targetSslProxiesClient->setCertificateMap($project, $targetSslProxiesSetCertificateMapRequestResource, $targetSslProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetSslProxiesClient->resumeOperation($operationName, 'setCertificateMap'); + * 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 { + * $targetSslProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param TargetSslProxiesSetCertificateMapRequest $targetSslProxiesSetCertificateMapRequestResource The body resource for this request + * @param string $targetSslProxy Name of the TargetSslProxy resource whose CertificateMap is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * @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 setCertificateMap($project, $targetSslProxiesSetCertificateMapRequestResource, $targetSslProxy, array $optionalArgs = []) + { + $request = new SetCertificateMapTargetSslProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetSslProxiesSetCertificateMapRequestResource($targetSslProxiesSetCertificateMapRequestResource); + $request->setTargetSslProxy($targetSslProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_ssl_proxy'] = $targetSslProxy; + 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('SetCertificateMap', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Changes the ProxyHeaderType for TargetSslProxy. + * + * Sample code: + * ``` + * $targetSslProxiesClient = new TargetSslProxiesClient(); + * try { + * $project = 'project'; + * $targetSslProxiesSetProxyHeaderRequestResource = new TargetSslProxiesSetProxyHeaderRequest(); + * $targetSslProxy = 'target_ssl_proxy'; + * $operationResponse = $targetSslProxiesClient->setProxyHeader($project, $targetSslProxiesSetProxyHeaderRequestResource, $targetSslProxy); + * $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 = $targetSslProxiesClient->setProxyHeader($project, $targetSslProxiesSetProxyHeaderRequestResource, $targetSslProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetSslProxiesClient->resumeOperation($operationName, 'setProxyHeader'); + * 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 { + * $targetSslProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param TargetSslProxiesSetProxyHeaderRequest $targetSslProxiesSetProxyHeaderRequestResource The body resource for this request + * @param string $targetSslProxy Name of the TargetSslProxy resource whose ProxyHeader is to be set. + * @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 setProxyHeader($project, $targetSslProxiesSetProxyHeaderRequestResource, $targetSslProxy, array $optionalArgs = []) + { + $request = new SetProxyHeaderTargetSslProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetSslProxiesSetProxyHeaderRequestResource($targetSslProxiesSetProxyHeaderRequestResource); + $request->setTargetSslProxy($targetSslProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_ssl_proxy'] = $targetSslProxy; + 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('SetProxyHeader', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Changes SslCertificates for TargetSslProxy. + * + * Sample code: + * ``` + * $targetSslProxiesClient = new TargetSslProxiesClient(); + * try { + * $project = 'project'; + * $targetSslProxiesSetSslCertificatesRequestResource = new TargetSslProxiesSetSslCertificatesRequest(); + * $targetSslProxy = 'target_ssl_proxy'; + * $operationResponse = $targetSslProxiesClient->setSslCertificates($project, $targetSslProxiesSetSslCertificatesRequestResource, $targetSslProxy); + * $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 = $targetSslProxiesClient->setSslCertificates($project, $targetSslProxiesSetSslCertificatesRequestResource, $targetSslProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetSslProxiesClient->resumeOperation($operationName, 'setSslCertificates'); + * 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 { + * $targetSslProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param TargetSslProxiesSetSslCertificatesRequest $targetSslProxiesSetSslCertificatesRequestResource The body resource for this request + * @param string $targetSslProxy Name of the TargetSslProxy resource whose SslCertificate resource is to be set. + * @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 setSslCertificates($project, $targetSslProxiesSetSslCertificatesRequestResource, $targetSslProxy, array $optionalArgs = []) + { + $request = new SetSslCertificatesTargetSslProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetSslProxiesSetSslCertificatesRequestResource($targetSslProxiesSetSslCertificatesRequestResource); + $request->setTargetSslProxy($targetSslProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_ssl_proxy'] = $targetSslProxy; + 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('SetSslCertificates', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the load balancer. They do not affect the connection between the load balancer and the backends. + * + * Sample code: + * ``` + * $targetSslProxiesClient = new TargetSslProxiesClient(); + * try { + * $project = 'project'; + * $sslPolicyReferenceResource = new SslPolicyReference(); + * $targetSslProxy = 'target_ssl_proxy'; + * $operationResponse = $targetSslProxiesClient->setSslPolicy($project, $sslPolicyReferenceResource, $targetSslProxy); + * $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 = $targetSslProxiesClient->setSslPolicy($project, $sslPolicyReferenceResource, $targetSslProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetSslProxiesClient->resumeOperation($operationName, 'setSslPolicy'); + * 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 { + * $targetSslProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param SslPolicyReference $sslPolicyReferenceResource The body resource for this request + * @param string $targetSslProxy Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * @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 setSslPolicy($project, $sslPolicyReferenceResource, $targetSslProxy, array $optionalArgs = []) + { + $request = new SetSslPolicyTargetSslProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setSslPolicyReferenceResource($sslPolicyReferenceResource); + $request->setTargetSslProxy($targetSslProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_ssl_proxy'] = $targetSslProxy; + 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('SetSslPolicy', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetTcpProxiesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetTcpProxiesGapicClient.php new file mode 100644 index 000000000000..adf5a805b06f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetTcpProxiesGapicClient.php @@ -0,0 +1,766 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $targetTcpProxiesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $targetTcpProxiesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\TargetTcpProxiesClient}. + */ +class TargetTcpProxiesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.TargetTcpProxies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/target_tcp_proxies_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/target_tcp_proxies_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/target_tcp_proxies_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** + * Retrieves the list of all TargetTcpProxy resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $targetTcpProxiesClient = new TargetTcpProxiesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $targetTcpProxiesClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $targetTcpProxiesClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $targetTcpProxiesClient->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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListTargetTcpProxiesRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, TargetTcpProxyAggregatedList::class, $request); + } + + /** + * Deletes the specified TargetTcpProxy resource. + * + * Sample code: + * ``` + * $targetTcpProxiesClient = new TargetTcpProxiesClient(); + * try { + * $project = 'project'; + * $targetTcpProxy = 'target_tcp_proxy'; + * $operationResponse = $targetTcpProxiesClient->delete($project, $targetTcpProxy); + * $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 = $targetTcpProxiesClient->delete($project, $targetTcpProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetTcpProxiesClient->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 { + * $targetTcpProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $targetTcpProxy Name of the TargetTcpProxy resource to delete. + * @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($project, $targetTcpProxy, array $optionalArgs = []) + { + $request = new DeleteTargetTcpProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetTcpProxy($targetTcpProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_tcp_proxy'] = $targetTcpProxy; + 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 TargetTcpProxy resource. + * + * Sample code: + * ``` + * $targetTcpProxiesClient = new TargetTcpProxiesClient(); + * try { + * $project = 'project'; + * $targetTcpProxy = 'target_tcp_proxy'; + * $response = $targetTcpProxiesClient->get($project, $targetTcpProxy); + * } finally { + * $targetTcpProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $targetTcpProxy Name of the TargetTcpProxy resource to return. + * @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\TargetTcpProxy + * + * @throws ApiException if the remote call fails + */ + public function get($project, $targetTcpProxy, array $optionalArgs = []) + { + $request = new GetTargetTcpProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetTcpProxy($targetTcpProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_tcp_proxy'] = $targetTcpProxy; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', TargetTcpProxy::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a TargetTcpProxy resource in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $targetTcpProxiesClient = new TargetTcpProxiesClient(); + * try { + * $project = 'project'; + * $targetTcpProxyResource = new TargetTcpProxy(); + * $operationResponse = $targetTcpProxiesClient->insert($project, $targetTcpProxyResource); + * $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 = $targetTcpProxiesClient->insert($project, $targetTcpProxyResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetTcpProxiesClient->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 { + * $targetTcpProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param TargetTcpProxy $targetTcpProxyResource The body resource 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($project, $targetTcpProxyResource, array $optionalArgs = []) + { + $request = new InsertTargetTcpProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetTcpProxyResource($targetTcpProxyResource); + $requestParamHeaders['project'] = $project; + 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 the list of TargetTcpProxy resources available to the specified project. + * + * Sample code: + * ``` + * $targetTcpProxiesClient = new TargetTcpProxiesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $targetTcpProxiesClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $targetTcpProxiesClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $targetTcpProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListTargetTcpProxiesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, TargetTcpProxyList::class, $request); + } + + /** + * Changes the BackendService for TargetTcpProxy. + * + * Sample code: + * ``` + * $targetTcpProxiesClient = new TargetTcpProxiesClient(); + * try { + * $project = 'project'; + * $targetTcpProxiesSetBackendServiceRequestResource = new TargetTcpProxiesSetBackendServiceRequest(); + * $targetTcpProxy = 'target_tcp_proxy'; + * $operationResponse = $targetTcpProxiesClient->setBackendService($project, $targetTcpProxiesSetBackendServiceRequestResource, $targetTcpProxy); + * $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 = $targetTcpProxiesClient->setBackendService($project, $targetTcpProxiesSetBackendServiceRequestResource, $targetTcpProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetTcpProxiesClient->resumeOperation($operationName, 'setBackendService'); + * 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 { + * $targetTcpProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param TargetTcpProxiesSetBackendServiceRequest $targetTcpProxiesSetBackendServiceRequestResource The body resource for this request + * @param string $targetTcpProxy Name of the TargetTcpProxy resource whose BackendService resource is to be set. + * @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 setBackendService($project, $targetTcpProxiesSetBackendServiceRequestResource, $targetTcpProxy, array $optionalArgs = []) + { + $request = new SetBackendServiceTargetTcpProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetTcpProxiesSetBackendServiceRequestResource($targetTcpProxiesSetBackendServiceRequestResource); + $request->setTargetTcpProxy($targetTcpProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_tcp_proxy'] = $targetTcpProxy; + 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('SetBackendService', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Changes the ProxyHeaderType for TargetTcpProxy. + * + * Sample code: + * ``` + * $targetTcpProxiesClient = new TargetTcpProxiesClient(); + * try { + * $project = 'project'; + * $targetTcpProxiesSetProxyHeaderRequestResource = new TargetTcpProxiesSetProxyHeaderRequest(); + * $targetTcpProxy = 'target_tcp_proxy'; + * $operationResponse = $targetTcpProxiesClient->setProxyHeader($project, $targetTcpProxiesSetProxyHeaderRequestResource, $targetTcpProxy); + * $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 = $targetTcpProxiesClient->setProxyHeader($project, $targetTcpProxiesSetProxyHeaderRequestResource, $targetTcpProxy); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetTcpProxiesClient->resumeOperation($operationName, 'setProxyHeader'); + * 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 { + * $targetTcpProxiesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param TargetTcpProxiesSetProxyHeaderRequest $targetTcpProxiesSetProxyHeaderRequestResource The body resource for this request + * @param string $targetTcpProxy Name of the TargetTcpProxy resource whose ProxyHeader is to be set. + * @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 setProxyHeader($project, $targetTcpProxiesSetProxyHeaderRequestResource, $targetTcpProxy, array $optionalArgs = []) + { + $request = new SetProxyHeaderTargetTcpProxyRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setTargetTcpProxiesSetProxyHeaderRequestResource($targetTcpProxiesSetProxyHeaderRequestResource); + $request->setTargetTcpProxy($targetTcpProxy); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['target_tcp_proxy'] = $targetTcpProxy; + 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('SetProxyHeader', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetVpnGatewaysGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetVpnGatewaysGapicClient.php new file mode 100644 index 000000000000..170cb39d2423 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetVpnGatewaysGapicClient.php @@ -0,0 +1,710 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $targetVpnGatewaysClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $targetVpnGatewaysClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\TargetVpnGatewaysClient}. + */ +class TargetVpnGatewaysGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.TargetVpnGateways'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/target_vpn_gateways_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/target_vpn_gateways_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/target_vpn_gateways_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Retrieves an aggregated list of target VPN gateways. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $targetVpnGatewaysClient = new TargetVpnGatewaysClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $targetVpnGatewaysClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $targetVpnGatewaysClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $targetVpnGatewaysClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListTargetVpnGatewaysRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, TargetVpnGatewayAggregatedList::class, $request); + } + + /** + * Deletes the specified target VPN gateway. + * + * Sample code: + * ``` + * $targetVpnGatewaysClient = new TargetVpnGatewaysClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetVpnGateway = 'target_vpn_gateway'; + * $operationResponse = $targetVpnGatewaysClient->delete($project, $region, $targetVpnGateway); + * $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 = $targetVpnGatewaysClient->delete($project, $region, $targetVpnGateway); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetVpnGatewaysClient->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 { + * $targetVpnGatewaysClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $targetVpnGateway Name of the target VPN gateway to delete. + * @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($project, $region, $targetVpnGateway, array $optionalArgs = []) + { + $request = new DeleteTargetVpnGatewayRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetVpnGateway($targetVpnGateway); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['target_vpn_gateway'] = $targetVpnGateway; + 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 target VPN gateway. + * + * Sample code: + * ``` + * $targetVpnGatewaysClient = new TargetVpnGatewaysClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetVpnGateway = 'target_vpn_gateway'; + * $response = $targetVpnGatewaysClient->get($project, $region, $targetVpnGateway); + * } finally { + * $targetVpnGatewaysClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $targetVpnGateway Name of the target VPN gateway to return. + * @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\TargetVpnGateway + * + * @throws ApiException if the remote call fails + */ + public function get($project, $region, $targetVpnGateway, array $optionalArgs = []) + { + $request = new GetTargetVpnGatewayRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetVpnGateway($targetVpnGateway); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['target_vpn_gateway'] = $targetVpnGateway; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', TargetVpnGateway::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a target VPN gateway in the specified project and region using the data included in the request. + * + * Sample code: + * ``` + * $targetVpnGatewaysClient = new TargetVpnGatewaysClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $targetVpnGatewayResource = new TargetVpnGateway(); + * $operationResponse = $targetVpnGatewaysClient->insert($project, $region, $targetVpnGatewayResource); + * $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 = $targetVpnGatewaysClient->insert($project, $region, $targetVpnGatewayResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetVpnGatewaysClient->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 { + * $targetVpnGatewaysClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param TargetVpnGateway $targetVpnGatewayResource The body resource 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($project, $region, $targetVpnGatewayResource, array $optionalArgs = []) + { + $request = new InsertTargetVpnGatewayRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setTargetVpnGatewayResource($targetVpnGatewayResource); + $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 target VPN gateways available to the specified project and region. + * + * Sample code: + * ``` + * $targetVpnGatewaysClient = new TargetVpnGatewaysClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $targetVpnGatewaysClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $targetVpnGatewaysClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $targetVpnGatewaysClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListTargetVpnGatewaysRequest(); + $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, TargetVpnGatewayList::class, $request); + } + + /** + * Sets the labels on a TargetVpnGateway. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + * ``` + * $targetVpnGatewaysClient = new TargetVpnGatewaysClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + * $resource = 'resource'; + * $operationResponse = $targetVpnGatewaysClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + * $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 = $targetVpnGatewaysClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $targetVpnGatewaysClient->resumeOperation($operationName, 'setLabels'); + * 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 { + * $targetVpnGatewaysClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The region for this request. + * @param RegionSetLabelsRequest $regionSetLabelsRequestResource The body resource for this request + * @param string $resource Name or id of the resource 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 setLabels($project, $region, $regionSetLabelsRequestResource, $resource, array $optionalArgs = []) + { + $request = new SetLabelsTargetVpnGatewayRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + 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('SetLabels', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/UrlMapsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/UrlMapsGapicClient.php new file mode 100644 index 000000000000..6236239fdf66 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/UrlMapsGapicClient.php @@ -0,0 +1,890 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $urlMapsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $urlMapsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\UrlMapsClient}. + */ +class UrlMapsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.UrlMaps'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/url_maps_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/url_maps_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/url_maps_rest_client_config.php', + ], + ], + 'operationsClientClass' => GlobalOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * Return an GlobalOperationsClient object with the same endpoint as $this. + * + * @return GlobalOperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** Return the default longrunning operation descriptor config. */ + private function getDefaultOperationDescriptor() + { + return [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + '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); + } + + /** + * Retrieves the list of all UrlMap resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $urlMapsClient = new UrlMapsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $urlMapsClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $urlMapsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $urlMapsClient->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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListUrlMapsRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, UrlMapsAggregatedList::class, $request); + } + + /** + * Deletes the specified UrlMap resource. + * + * Sample code: + * ``` + * $urlMapsClient = new UrlMapsClient(); + * try { + * $project = 'project'; + * $urlMap = 'url_map'; + * $operationResponse = $urlMapsClient->delete($project, $urlMap); + * $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 = $urlMapsClient->delete($project, $urlMap); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $urlMapsClient->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 { + * $urlMapsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $urlMap Name of the UrlMap resource to delete. + * @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($project, $urlMap, array $optionalArgs = []) + { + $request = new DeleteUrlMapRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setUrlMap($urlMap); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['url_map'] = $urlMap; + 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 UrlMap resource. + * + * Sample code: + * ``` + * $urlMapsClient = new UrlMapsClient(); + * try { + * $project = 'project'; + * $urlMap = 'url_map'; + * $response = $urlMapsClient->get($project, $urlMap); + * } finally { + * $urlMapsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $urlMap Name of the UrlMap resource to return. + * @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\UrlMap + * + * @throws ApiException if the remote call fails + */ + public function get($project, $urlMap, array $optionalArgs = []) + { + $request = new GetUrlMapRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setUrlMap($urlMap); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['url_map'] = $urlMap; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', UrlMap::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a UrlMap resource in the specified project using the data included in the request. + * + * Sample code: + * ``` + * $urlMapsClient = new UrlMapsClient(); + * try { + * $project = 'project'; + * $urlMapResource = new UrlMap(); + * $operationResponse = $urlMapsClient->insert($project, $urlMapResource); + * $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 = $urlMapsClient->insert($project, $urlMapResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $urlMapsClient->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 { + * $urlMapsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param UrlMap $urlMapResource The body resource 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($project, $urlMapResource, array $optionalArgs = []) + { + $request = new InsertUrlMapRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setUrlMapResource($urlMapResource); + $requestParamHeaders['project'] = $project; + 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(); + } + + /** + * Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. For more information, see [Invalidating cached content](/cdn/docs/invalidating-cached-content). + * + * Sample code: + * ``` + * $urlMapsClient = new UrlMapsClient(); + * try { + * $cacheInvalidationRuleResource = new CacheInvalidationRule(); + * $project = 'project'; + * $urlMap = 'url_map'; + * $operationResponse = $urlMapsClient->invalidateCache($cacheInvalidationRuleResource, $project, $urlMap); + * $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 = $urlMapsClient->invalidateCache($cacheInvalidationRuleResource, $project, $urlMap); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $urlMapsClient->resumeOperation($operationName, 'invalidateCache'); + * 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 { + * $urlMapsClient->close(); + * } + * ``` + * + * @param CacheInvalidationRule $cacheInvalidationRuleResource The body resource for this request + * @param string $project Project ID for this request. + * @param string $urlMap Name of the UrlMap scoping 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 invalidateCache($cacheInvalidationRuleResource, $project, $urlMap, array $optionalArgs = []) + { + $request = new InvalidateCacheUrlMapRequest(); + $requestParamHeaders = []; + $request->setCacheInvalidationRuleResource($cacheInvalidationRuleResource); + $request->setProject($project); + $request->setUrlMap($urlMap); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['url_map'] = $urlMap; + 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('InvalidateCache', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Retrieves the list of UrlMap resources available to the specified project. + * + * Sample code: + * ``` + * $urlMapsClient = new UrlMapsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $urlMapsClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $urlMapsClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $urlMapsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListUrlMapsRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, UrlMapList::class, $request); + } + + /** + * Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * Sample code: + * ``` + * $urlMapsClient = new UrlMapsClient(); + * try { + * $project = 'project'; + * $urlMap = 'url_map'; + * $urlMapResource = new UrlMap(); + * $operationResponse = $urlMapsClient->patch($project, $urlMap, $urlMapResource); + * $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 = $urlMapsClient->patch($project, $urlMap, $urlMapResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $urlMapsClient->resumeOperation($operationName, 'patch'); + * 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 { + * $urlMapsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $urlMap Name of the UrlMap resource to patch. + * @param UrlMap $urlMapResource The body resource 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 patch($project, $urlMap, $urlMapResource, array $optionalArgs = []) + { + $request = new PatchUrlMapRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setUrlMap($urlMap); + $request->setUrlMapResource($urlMapResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['url_map'] = $urlMap; + 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('Patch', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Updates the specified UrlMap resource with the data included in the request. + * + * Sample code: + * ``` + * $urlMapsClient = new UrlMapsClient(); + * try { + * $project = 'project'; + * $urlMap = 'url_map'; + * $urlMapResource = new UrlMap(); + * $operationResponse = $urlMapsClient->update($project, $urlMap, $urlMapResource); + * $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 = $urlMapsClient->update($project, $urlMap, $urlMapResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $urlMapsClient->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 { + * $urlMapsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $urlMap Name of the UrlMap resource to update. + * @param UrlMap $urlMapResource The body resource 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 update($project, $urlMap, $urlMapResource, array $optionalArgs = []) + { + $request = new UpdateUrlMapRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setUrlMap($urlMap); + $request->setUrlMapResource($urlMapResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['url_map'] = $urlMap; + 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('Update', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. + * + * Sample code: + * ``` + * $urlMapsClient = new UrlMapsClient(); + * try { + * $project = 'project'; + * $urlMap = 'url_map'; + * $urlMapsValidateRequestResource = new UrlMapsValidateRequest(); + * $response = $urlMapsClient->validate($project, $urlMap, $urlMapsValidateRequestResource); + * } finally { + * $urlMapsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $urlMap Name of the UrlMap resource to be validated as. + * @param UrlMapsValidateRequest $urlMapsValidateRequestResource The body resource 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\UrlMapsValidateResponse + * + * @throws ApiException if the remote call fails + */ + public function validate($project, $urlMap, $urlMapsValidateRequestResource, array $optionalArgs = []) + { + $request = new ValidateUrlMapRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setUrlMap($urlMap); + $request->setUrlMapsValidateRequestResource($urlMapsValidateRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['url_map'] = $urlMap; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Validate', UrlMapsValidateResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/VpnGatewaysGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/VpnGatewaysGapicClient.php new file mode 100644 index 000000000000..662e4007460d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/VpnGatewaysGapicClient.php @@ -0,0 +1,812 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $vpnGatewaysClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $vpnGatewaysClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\VpnGatewaysClient}. + */ +class VpnGatewaysGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.VpnGateways'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/vpn_gateways_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/vpn_gateways_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/vpn_gateways_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Retrieves an aggregated list of VPN gateways. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $vpnGatewaysClient = new VpnGatewaysClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $vpnGatewaysClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $vpnGatewaysClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $vpnGatewaysClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListVpnGatewaysRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, VpnGatewayAggregatedList::class, $request); + } + + /** + * Deletes the specified VPN gateway. + * + * Sample code: + * ``` + * $vpnGatewaysClient = new VpnGatewaysClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $vpnGateway = 'vpn_gateway'; + * $operationResponse = $vpnGatewaysClient->delete($project, $region, $vpnGateway); + * $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 = $vpnGatewaysClient->delete($project, $region, $vpnGateway); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $vpnGatewaysClient->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 { + * $vpnGatewaysClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $vpnGateway Name of the VPN gateway to delete. + * @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($project, $region, $vpnGateway, array $optionalArgs = []) + { + $request = new DeleteVpnGatewayRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setVpnGateway($vpnGateway); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['vpn_gateway'] = $vpnGateway; + 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 VPN gateway. + * + * Sample code: + * ``` + * $vpnGatewaysClient = new VpnGatewaysClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $vpnGateway = 'vpn_gateway'; + * $response = $vpnGatewaysClient->get($project, $region, $vpnGateway); + * } finally { + * $vpnGatewaysClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $vpnGateway Name of the VPN gateway to return. + * @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\VpnGateway + * + * @throws ApiException if the remote call fails + */ + public function get($project, $region, $vpnGateway, array $optionalArgs = []) + { + $request = new GetVpnGatewayRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setVpnGateway($vpnGateway); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['vpn_gateway'] = $vpnGateway; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', VpnGateway::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns the status for the specified VPN gateway. + * + * Sample code: + * ``` + * $vpnGatewaysClient = new VpnGatewaysClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $vpnGateway = 'vpn_gateway'; + * $response = $vpnGatewaysClient->getStatus($project, $region, $vpnGateway); + * } finally { + * $vpnGatewaysClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $vpnGateway Name of the VPN gateway to return. + * @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\VpnGatewaysGetStatusResponse + * + * @throws ApiException if the remote call fails + */ + public function getStatus($project, $region, $vpnGateway, array $optionalArgs = []) + { + $request = new GetStatusVpnGatewayRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setVpnGateway($vpnGateway); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['vpn_gateway'] = $vpnGateway; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetStatus', VpnGatewaysGetStatusResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a VPN gateway in the specified project and region using the data included in the request. + * + * Sample code: + * ``` + * $vpnGatewaysClient = new VpnGatewaysClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $vpnGatewayResource = new VpnGateway(); + * $operationResponse = $vpnGatewaysClient->insert($project, $region, $vpnGatewayResource); + * $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 = $vpnGatewaysClient->insert($project, $region, $vpnGatewayResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $vpnGatewaysClient->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 { + * $vpnGatewaysClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param VpnGateway $vpnGatewayResource The body resource 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($project, $region, $vpnGatewayResource, array $optionalArgs = []) + { + $request = new InsertVpnGatewayRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setVpnGatewayResource($vpnGatewayResource); + $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 VPN gateways available to the specified project and region. + * + * Sample code: + * ``` + * $vpnGatewaysClient = new VpnGatewaysClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $vpnGatewaysClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $vpnGatewaysClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $vpnGatewaysClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListVpnGatewaysRequest(); + $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, VpnGatewayList::class, $request); + } + + /** + * Sets the labels on a VpnGateway. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + * ``` + * $vpnGatewaysClient = new VpnGatewaysClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + * $resource = 'resource'; + * $operationResponse = $vpnGatewaysClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + * $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 = $vpnGatewaysClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $vpnGatewaysClient->resumeOperation($operationName, 'setLabels'); + * 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 { + * $vpnGatewaysClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The region for this request. + * @param RegionSetLabelsRequest $regionSetLabelsRequestResource The body resource for this request + * @param string $resource Name or id of the resource 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 setLabels($project, $region, $regionSetLabelsRequestResource, $resource, array $optionalArgs = []) + { + $request = new SetLabelsVpnGatewayRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + 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('SetLabels', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Returns permissions that a caller has on the specified resource. + * + * Sample code: + * ``` + * $vpnGatewaysClient = new VpnGatewaysClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $resource = 'resource'; + * $testPermissionsRequestResource = new TestPermissionsRequest(); + * $response = $vpnGatewaysClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + * } finally { + * $vpnGatewaysClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The name of the region for this request. + * @param string $resource Name or id of the resource for this request. + * @param TestPermissionsRequest $testPermissionsRequestResource The body resource 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\TestPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + public function testIamPermissions($project, $region, $resource, $testPermissionsRequestResource, array $optionalArgs = []) + { + $request = new TestIamPermissionsVpnGatewayRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setResource($resource); + $request->setTestPermissionsRequestResource($testPermissionsRequestResource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('TestIamPermissions', TestPermissionsResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/VpnTunnelsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/VpnTunnelsGapicClient.php new file mode 100644 index 000000000000..f73408698de3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/VpnTunnelsGapicClient.php @@ -0,0 +1,710 @@ +aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $vpnTunnelsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $vpnTunnelsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\VpnTunnelsClient}. + */ +class VpnTunnelsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.VpnTunnels'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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/vpn_tunnels_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/vpn_tunnels_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/vpn_tunnels_rest_client_config.php', + ], + ], + 'operationsClientClass' => RegionOperationsClient::class, + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + 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); + } + + /** + * Retrieves an aggregated list of VPN tunnels. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + * + * Sample code: + * ``` + * $vpnTunnelsClient = new VpnTunnelsClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $vpnTunnelsClient->aggregatedList($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $key => $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $vpnTunnelsClient->aggregatedList($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $vpnTunnelsClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @type int $serviceProjectNumber + * The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + * @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 AggregatedListVpnTunnelsRequest(); + $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']); + } + + if (isset($optionalArgs['serviceProjectNumber'])) { + $request->setServiceProjectNumber($optionalArgs['serviceProjectNumber']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('AggregatedList', $optionalArgs, VpnTunnelAggregatedList::class, $request); + } + + /** + * Deletes the specified VpnTunnel resource. + * + * Sample code: + * ``` + * $vpnTunnelsClient = new VpnTunnelsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $vpnTunnel = 'vpn_tunnel'; + * $operationResponse = $vpnTunnelsClient->delete($project, $region, $vpnTunnel); + * $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 = $vpnTunnelsClient->delete($project, $region, $vpnTunnel); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $vpnTunnelsClient->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 { + * $vpnTunnelsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $vpnTunnel Name of the VpnTunnel resource to delete. + * @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($project, $region, $vpnTunnel, array $optionalArgs = []) + { + $request = new DeleteVpnTunnelRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setVpnTunnel($vpnTunnel); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['vpn_tunnel'] = $vpnTunnel; + 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 VpnTunnel resource. + * + * Sample code: + * ``` + * $vpnTunnelsClient = new VpnTunnelsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $vpnTunnel = 'vpn_tunnel'; + * $response = $vpnTunnelsClient->get($project, $region, $vpnTunnel); + * } finally { + * $vpnTunnelsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param string $vpnTunnel Name of the VpnTunnel resource to return. + * @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\VpnTunnel + * + * @throws ApiException if the remote call fails + */ + public function get($project, $region, $vpnTunnel, array $optionalArgs = []) + { + $request = new GetVpnTunnelRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setVpnTunnel($vpnTunnel); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['vpn_tunnel'] = $vpnTunnel; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', VpnTunnel::class, $optionalArgs, $request)->wait(); + } + + /** + * Creates a VpnTunnel resource in the specified project and region using the data included in the request. + * + * Sample code: + * ``` + * $vpnTunnelsClient = new VpnTunnelsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $vpnTunnelResource = new VpnTunnel(); + * $operationResponse = $vpnTunnelsClient->insert($project, $region, $vpnTunnelResource); + * $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 = $vpnTunnelsClient->insert($project, $region, $vpnTunnelResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $vpnTunnelsClient->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 { + * $vpnTunnelsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region for this request. + * @param VpnTunnel $vpnTunnelResource The body resource 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($project, $region, $vpnTunnelResource, array $optionalArgs = []) + { + $request = new InsertVpnTunnelRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setVpnTunnelResource($vpnTunnelResource); + $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 VpnTunnel resources contained in the specified project and region. + * + * Sample code: + * ``` + * $vpnTunnelsClient = new VpnTunnelsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * // Iterate over pages of elements + * $pagedResponse = $vpnTunnelsClient->list($project, $region); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $vpnTunnelsClient->list($project, $region); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $vpnTunnelsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region Name of the region 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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 ListVpnTunnelsRequest(); + $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, VpnTunnelList::class, $request); + } + + /** + * Sets the labels on a VpnTunnel. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + * ``` + * $vpnTunnelsClient = new VpnTunnelsClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + * $resource = 'resource'; + * $operationResponse = $vpnTunnelsClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + * $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 = $vpnTunnelsClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $vpnTunnelsClient->resumeOperation($operationName, 'setLabels'); + * 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 { + * $vpnTunnelsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $region The region for this request. + * @param RegionSetLabelsRequest $regionSetLabelsRequestResource The body resource for this request + * @param string $resource Name or id of the resource 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 setLabels($project, $region, $regionSetLabelsRequestResource, $resource, array $optionalArgs = []) + { + $request = new SetLabelsVpnTunnelRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setRegion($region); + $request->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource); + $request->setResource($resource); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['region'] = $region; + $requestParamHeaders['resource'] = $resource; + 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('SetLabels', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/ZoneOperationsGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/ZoneOperationsGapicClient.php new file mode 100644 index 000000000000..ebc6ef85827c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/ZoneOperationsGapicClient.php @@ -0,0 +1,410 @@ +delete($operation, $project, $zone); + * } finally { + * $zoneOperationsClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\ZoneOperationsClient}. + */ +class ZoneOperationsGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.ZoneOperations'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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 static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/zone_operations_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/zone_operations_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/zone_operations_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** + * Deletes the specified zone-specific Operations resource. + * + * Sample code: + * ``` + * $zoneOperationsClient = new ZoneOperationsClient(); + * try { + * $operation = 'operation'; + * $project = 'project'; + * $zone = 'zone'; + * $response = $zoneOperationsClient->delete($operation, $project, $zone); + * } finally { + * $zoneOperationsClient->close(); + * } + * ``` + * + * @param string $operation Name of the Operations resource to delete. + * @param string $project Project ID for this request. + * @param string $zone Name of the zone 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\DeleteZoneOperationResponse + * + * @throws ApiException if the remote call fails + */ + public function delete($operation, $project, $zone, array $optionalArgs = []) + { + $request = new DeleteZoneOperationRequest(); + $requestParamHeaders = []; + $request->setOperation($operation); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['operation'] = $operation; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Delete', DeleteZoneOperationResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves the specified zone-specific Operations resource. + * + * Sample code: + * ``` + * $zoneOperationsClient = new ZoneOperationsClient(); + * try { + * $operation = 'operation'; + * $project = 'project'; + * $zone = 'zone'; + * $response = $zoneOperationsClient->get($operation, $project, $zone); + * } finally { + * $zoneOperationsClient->close(); + * } + * ``` + * + * @param string $operation Name of the Operations resource to return. + * @param string $project Project ID for this request. + * @param string $zone Name of the zone 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\Operation + * + * @throws ApiException if the remote call fails + */ + public function get($operation, $project, $zone, array $optionalArgs = []) + { + $request = new GetZoneOperationRequest(); + $requestParamHeaders = []; + $request->setOperation($operation); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['operation'] = $operation; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', Operation::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves a list of Operation resources contained within the specified zone. + * + * Sample code: + * ``` + * $zoneOperationsClient = new ZoneOperationsClient(); + * try { + * $project = 'project'; + * $zone = 'zone'; + * // Iterate over pages of elements + * $pagedResponse = $zoneOperationsClient->list($project, $zone); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $zoneOperationsClient->list($project, $zone); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $zoneOperationsClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $zone Name of the zone for 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, $zone, array $optionalArgs = []) + { + $request = new ListZoneOperationsRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + 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, OperationList::class, $request); + } + + /** + * Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method waits for no more than the 2 minutes and then returns the current state of the operation, which might be `DONE` or still in progress. This method is called on a best-effort basis. Specifically: - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + * + * Sample code: + * ``` + * $zoneOperationsClient = new ZoneOperationsClient(); + * try { + * $operation = 'operation'; + * $project = 'project'; + * $zone = 'zone'; + * $response = $zoneOperationsClient->wait($operation, $project, $zone); + * } finally { + * $zoneOperationsClient->close(); + * } + * ``` + * + * @param string $operation Name of the Operations resource to return. + * @param string $project Project ID for this request. + * @param string $zone Name of the zone 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\Operation + * + * @throws ApiException if the remote call fails + */ + public function wait($operation, $project, $zone, array $optionalArgs = []) + { + $request = new WaitZoneOperationRequest(); + $requestParamHeaders = []; + $request->setOperation($operation); + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['operation'] = $operation; + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Wait', Operation::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/Gapic/ZonesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/ZonesGapicClient.php new file mode 100644 index 000000000000..60ae70e630a8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/ZonesGapicClient.php @@ -0,0 +1,305 @@ +get($project, $zone); + * } finally { + * $zonesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\ZonesClient}. + */ +class ZonesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.Zones'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'compute.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'compute.UNIVERSE_DOMAIN'; + + /** 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.readonly', + 'https://www.googleapis.com/auth/compute', + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/zones_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/zones_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/zones_rest_client_config.php', + ], + ], + ]; + } + + /** Implements GapicClientTrait::defaultTransport. */ + private static function defaultTransport() + { + return 'rest'; + } + + /** Implements GapicClientTrait::supportedTransports. */ + private static function supportedTransports() + { + return [ + 'rest', + ]; + } + + /** + * 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); + } + + /** + * Returns the specified Zone resource. + * + * Sample code: + * ``` + * $zonesClient = new ZonesClient(); + * try { + * $project = 'project'; + * $zone = 'zone'; + * $response = $zonesClient->get($project, $zone); + * } finally { + * $zonesClient->close(); + * } + * ``` + * + * @param string $project Project ID for this request. + * @param string $zone Name of the zone resource to return. + * @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\Zone + * + * @throws ApiException if the remote call fails + */ + public function get($project, $zone, array $optionalArgs = []) + { + $request = new GetZoneRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $request->setZone($zone); + $requestParamHeaders['project'] = $project; + $requestParamHeaders['zone'] = $zone; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', Zone::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves the list of Zone resources available to the specified project. + * + * Sample code: + * ``` + * $zonesClient = new ZonesClient(); + * try { + * $project = 'project'; + * // Iterate over pages of elements + * $pagedResponse = $zonesClient->list($project); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $zonesClient->list($project); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $zonesClient->close(); + * } + * ``` + * + * @param string $project Project ID 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. These two types of filter expressions cannot be mixed in one request. 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 `:*` 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`. You cannot combine constraints on multiple fields using regular expressions. + * @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. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + * @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, array $optionalArgs = []) + { + $request = new ListZonesRequest(); + $requestParamHeaders = []; + $request->setProject($project); + $requestParamHeaders['project'] = $project; + 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, ZoneList::class, $request); + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/GlobalAddressesClient.php b/owl-bot-staging/Compute/V1/src/V1/GlobalAddressesClient.php new file mode 100644 index 000000000000..9c3852a720fc --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/GlobalAddressesClient.php @@ -0,0 +1,34 @@ + [ + 'google.cloud.compute.v1.AcceleratorTypes' => [ + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\AcceleratorTypeAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\AcceleratorType', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'accelerator_type', + 'fieldAccessors' => [ + 'getAcceleratorType', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\AcceleratorTypeList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/accelerator_types_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/accelerator_types_rest_client_config.php new file mode 100644 index 000000000000..161d8ae3cf13 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/accelerator_types_rest_client_config.php @@ -0,0 +1,76 @@ + [ + 'google.cloud.compute.v1.AcceleratorTypes' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/acceleratorTypes', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/acceleratorTypes/{accelerator_type}', + 'placeholders' => [ + 'accelerator_type' => [ + 'getters' => [ + 'getAcceleratorType', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/acceleratorTypes', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/addresses_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/addresses_client_config.json new file mode 100644 index 000000000000..b0c55c62ebb2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/addresses_client_config.json @@ -0,0 +1,80 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Addresses": { + "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": { + "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", + "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" + }, + "Move": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetLabels": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/addresses_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/addresses_descriptor_config.php new file mode 100644 index 000000000000..cf895a421fd7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/addresses_descriptor_config.php @@ -0,0 +1,244 @@ + [ + 'google.cloud.compute.v1.Addresses' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'address', + 'fieldAccessors' => [ + 'getAddress', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Move' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'address', + 'fieldAccessors' => [ + 'getAddress', + ], + ], + ], + ], + 'SetLabels' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\AddressAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Address', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'address', + 'fieldAccessors' => [ + 'getAddress', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\AddressList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/addresses_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/addresses_rest_client_config.php new file mode 100644 index 000000000000..708350604a8c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/addresses_rest_client_config.php @@ -0,0 +1,239 @@ + [ + 'google.cloud.compute.v1.Addresses' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/addresses', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/addresses/{address}', + 'placeholders' => [ + 'address' => [ + 'getters' => [ + 'getAddress', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/addresses/{address}', + 'placeholders' => [ + 'address' => [ + 'getters' => [ + 'getAddress', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/addresses', + 'body' => 'address_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/addresses', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Move' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/addresses/{address}/move', + 'body' => 'region_addresses_move_request_resource', + 'placeholders' => [ + 'address' => [ + 'getters' => [ + 'getAddress', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'SetLabels' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/addresses/{resource}/setLabels', + 'body' => 'region_set_labels_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/autoscalers_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/autoscalers_client_config.json new file mode 100644 index 000000000000..fcfb66bbf6aa --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/autoscalers_client_config.json @@ -0,0 +1,80 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Autoscalers": { + "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": { + "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", + "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" + }, + "Patch": { + "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/owl-bot-staging/Compute/V1/src/V1/resources/autoscalers_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/autoscalers_descriptor_config.php new file mode 100644 index 000000000000..30caf9dea66b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/autoscalers_descriptor_config.php @@ -0,0 +1,232 @@ + [ + 'google.cloud.compute.v1.Autoscalers' => [ + 'Delete' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'autoscaler', + 'fieldAccessors' => [ + 'getAutoscaler', + ], + ], + ], + ], + 'Insert' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\AutoscalerAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Autoscaler', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'autoscaler', + 'fieldAccessors' => [ + 'getAutoscaler', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\AutoscalerList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/autoscalers_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/autoscalers_rest_client_config.php new file mode 100644 index 000000000000..e568b02e624b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/autoscalers_rest_client_config.php @@ -0,0 +1,229 @@ + [ + 'google.cloud.compute.v1.Autoscalers' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/autoscalers', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/autoscalers/{autoscaler}', + 'placeholders' => [ + 'autoscaler' => [ + 'getters' => [ + 'getAutoscaler', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/autoscalers/{autoscaler}', + 'placeholders' => [ + 'autoscaler' => [ + 'getters' => [ + 'getAutoscaler', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/autoscalers', + 'body' => 'autoscaler_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/autoscalers', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/autoscalers', + 'body' => 'autoscaler_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Update' => [ + 'method' => 'put', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/autoscalers', + 'body' => 'autoscaler_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.ZoneOperations' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/backend_buckets_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/backend_buckets_client_config.json new file mode 100644 index 000000000000..eb5599e54ee6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/backend_buckets_client_config.json @@ -0,0 +1,105 @@ +{ + "interfaces": { + "google.cloud.compute.v1.BackendBuckets": { + "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": { + "AddSignedUrlKey": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Delete": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteSignedUrlKey": { + "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" + }, + "GetIamPolicy": { + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetEdgeSecurityPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "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/owl-bot-staging/Compute/V1/src/V1/resources/backend_buckets_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/backend_buckets_descriptor_config.php new file mode 100644 index 000000000000..9237c8896ade --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/backend_buckets_descriptor_config.php @@ -0,0 +1,331 @@ + [ + 'google.cloud.compute.v1.BackendBuckets' => [ + 'AddSignedUrlKey' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'backend_bucket', + 'fieldAccessors' => [ + 'getBackendBucket', + ], + ], + ], + ], + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'backend_bucket', + 'fieldAccessors' => [ + 'getBackendBucket', + ], + ], + ], + ], + 'DeleteSignedUrlKey' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'backend_bucket', + 'fieldAccessors' => [ + 'getBackendBucket', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'backend_bucket', + 'fieldAccessors' => [ + 'getBackendBucket', + ], + ], + ], + ], + 'SetEdgeSecurityPolicy' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'backend_bucket', + 'fieldAccessors' => [ + 'getBackendBucket', + ], + ], + ], + ], + 'Update' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'backend_bucket', + 'fieldAccessors' => [ + 'getBackendBucket', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\BackendBucket', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'backend_bucket', + 'fieldAccessors' => [ + 'getBackendBucket', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\BackendBucketList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/backend_buckets_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/backend_buckets_rest_client_config.php new file mode 100644 index 000000000000..b50134885c3f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/backend_buckets_rest_client_config.php @@ -0,0 +1,292 @@ + [ + 'google.cloud.compute.v1.BackendBuckets' => [ + 'AddSignedUrlKey' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}/addSignedUrlKey', + 'body' => 'signed_url_key_resource', + 'placeholders' => [ + 'backend_bucket' => [ + 'getters' => [ + 'getBackendBucket', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}', + 'placeholders' => [ + 'backend_bucket' => [ + 'getters' => [ + 'getBackendBucket', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'DeleteSignedUrlKey' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}/deleteSignedUrlKey', + 'placeholders' => [ + 'backend_bucket' => [ + 'getters' => [ + 'getBackendBucket', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + 'queryParams' => [ + 'key_name', + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}', + 'placeholders' => [ + 'backend_bucket' => [ + 'getters' => [ + 'getBackendBucket', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendBuckets/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendBuckets', + 'body' => 'backend_bucket_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendBuckets', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}', + 'body' => 'backend_bucket_resource', + 'placeholders' => [ + 'backend_bucket' => [ + 'getters' => [ + 'getBackendBucket', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'SetEdgeSecurityPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}/setEdgeSecurityPolicy', + 'body' => 'security_policy_reference_resource', + 'placeholders' => [ + 'backend_bucket' => [ + 'getters' => [ + 'getBackendBucket', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendBuckets/{resource}/setIamPolicy', + 'body' => 'global_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendBuckets/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'Update' => [ + 'method' => 'put', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}', + 'body' => 'backend_bucket_resource', + 'placeholders' => [ + 'backend_bucket' => [ + 'getters' => [ + 'getBackendBucket', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/backend_services_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/backend_services_client_config.json new file mode 100644 index 000000000000..79af18b0f8bd --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/backend_services_client_config.json @@ -0,0 +1,125 @@ +{ + "interfaces": { + "google.cloud.compute.v1.BackendServices": { + "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": { + "AddSignedUrlKey": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "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", + "retry_params_name": "no_retry_1_params" + }, + "DeleteSignedUrlKey": { + "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" + }, + "GetHealth": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetIamPolicy": { + "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" + }, + "ListUsable": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetEdgeSecurityPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetSecurityPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "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/owl-bot-staging/Compute/V1/src/V1/resources/backend_services_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/backend_services_descriptor_config.php new file mode 100644 index 000000000000..8db30677d7df --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/backend_services_descriptor_config.php @@ -0,0 +1,420 @@ + [ + 'google.cloud.compute.v1.BackendServices' => [ + 'AddSignedUrlKey' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'backend_service', + 'fieldAccessors' => [ + 'getBackendService', + ], + ], + ], + ], + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'backend_service', + 'fieldAccessors' => [ + 'getBackendService', + ], + ], + ], + ], + 'DeleteSignedUrlKey' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'backend_service', + 'fieldAccessors' => [ + 'getBackendService', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'backend_service', + 'fieldAccessors' => [ + 'getBackendService', + ], + ], + ], + ], + 'SetEdgeSecurityPolicy' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'backend_service', + 'fieldAccessors' => [ + 'getBackendService', + ], + ], + ], + ], + 'SetSecurityPolicy' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'backend_service', + 'fieldAccessors' => [ + 'getBackendService', + ], + ], + ], + ], + 'Update' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'backend_service', + 'fieldAccessors' => [ + 'getBackendService', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\BackendServiceAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\BackendService', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'backend_service', + 'fieldAccessors' => [ + 'getBackendService', + ], + ], + ], + ], + 'GetHealth' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\BackendServiceGroupHealth', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'backend_service', + 'fieldAccessors' => [ + 'getBackendService', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\BackendServiceList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'ListUsable' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\BackendServiceListUsable', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/backend_services_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/backend_services_rest_client_config.php new file mode 100644 index 000000000000..e24093ec36fe --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/backend_services_rest_client_config.php @@ -0,0 +1,348 @@ + [ + 'google.cloud.compute.v1.BackendServices' => [ + 'AddSignedUrlKey' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendServices/{backend_service}/addSignedUrlKey', + 'body' => 'signed_url_key_resource', + 'placeholders' => [ + 'backend_service' => [ + 'getters' => [ + 'getBackendService', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/backendServices', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendServices/{backend_service}', + 'placeholders' => [ + 'backend_service' => [ + 'getters' => [ + 'getBackendService', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'DeleteSignedUrlKey' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendServices/{backend_service}/deleteSignedUrlKey', + 'placeholders' => [ + 'backend_service' => [ + 'getters' => [ + 'getBackendService', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + 'queryParams' => [ + 'key_name', + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendServices/{backend_service}', + 'placeholders' => [ + 'backend_service' => [ + 'getters' => [ + 'getBackendService', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'GetHealth' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendServices/{backend_service}/getHealth', + 'body' => 'resource_group_reference_resource', + 'placeholders' => [ + 'backend_service' => [ + 'getters' => [ + 'getBackendService', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendServices/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendServices', + 'body' => 'backend_service_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendServices', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'ListUsable' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendServices/listUsable', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendServices/{backend_service}', + 'body' => 'backend_service_resource', + 'placeholders' => [ + 'backend_service' => [ + 'getters' => [ + 'getBackendService', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'SetEdgeSecurityPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendServices/{backend_service}/setEdgeSecurityPolicy', + 'body' => 'security_policy_reference_resource', + 'placeholders' => [ + 'backend_service' => [ + 'getters' => [ + 'getBackendService', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendServices/{resource}/setIamPolicy', + 'body' => 'global_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetSecurityPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendServices/{backend_service}/setSecurityPolicy', + 'body' => 'security_policy_reference_resource', + 'placeholders' => [ + 'backend_service' => [ + 'getters' => [ + 'getBackendService', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendServices/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'Update' => [ + 'method' => 'put', + 'uriTemplate' => '/compute/v1/projects/{project}/global/backendServices/{backend_service}', + 'body' => 'backend_service_resource', + 'placeholders' => [ + 'backend_service' => [ + 'getters' => [ + 'getBackendService', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/disk_types_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/disk_types_client_config.json new file mode 100644 index 000000000000..865bab50f599 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/disk_types_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.cloud.compute.v1.DiskTypes": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "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 + } + }, + "methods": { + "AggregatedList": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "Get": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "List": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/disk_types_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/disk_types_descriptor_config.php new file mode 100644 index 000000000000..ef82b923b64e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/disk_types_descriptor_config.php @@ -0,0 +1,98 @@ + [ + 'google.cloud.compute.v1.DiskTypes' => [ + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\DiskTypeAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\DiskType', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'disk_type', + 'fieldAccessors' => [ + 'getDiskType', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\DiskTypeList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/disk_types_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/disk_types_rest_client_config.php new file mode 100644 index 000000000000..e76843a408f5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/disk_types_rest_client_config.php @@ -0,0 +1,76 @@ + [ + 'google.cloud.compute.v1.DiskTypes' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/diskTypes', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/diskTypes/{disk_type}', + 'placeholders' => [ + 'disk_type' => [ + 'getters' => [ + 'getDiskType', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/diskTypes', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/disks_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/disks_client_config.json new file mode 100644 index 000000000000..7a5d21785c1e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/disks_client_config.json @@ -0,0 +1,135 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Disks": { + "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": { + "AddResourcePolicies": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "AggregatedList": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "BulkInsert": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateSnapshot": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "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" + }, + "GetIamPolicy": { + "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" + }, + "RemoveResourcePolicies": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Resize": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetLabels": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "StartAsyncReplication": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "StopAsyncReplication": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "StopGroupAsyncReplication": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "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/owl-bot-staging/Compute/V1/src/V1/resources/disks_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/disks_descriptor_config.php new file mode 100644 index 000000000000..c2fc76cfa137 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/disks_descriptor_config.php @@ -0,0 +1,608 @@ + [ + 'google.cloud.compute.v1.Disks' => [ + 'AddResourcePolicies' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'disk', + 'fieldAccessors' => [ + 'getDisk', + ], + ], + ], + ], + 'BulkInsert' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'CreateSnapshot' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'disk', + 'fieldAccessors' => [ + 'getDisk', + ], + ], + ], + ], + 'Delete' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'disk', + 'fieldAccessors' => [ + 'getDisk', + ], + ], + ], + ], + 'Insert' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'RemoveResourcePolicies' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'disk', + 'fieldAccessors' => [ + 'getDisk', + ], + ], + ], + ], + 'Resize' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'disk', + 'fieldAccessors' => [ + 'getDisk', + ], + ], + ], + ], + 'SetLabels' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'StartAsyncReplication' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'disk', + 'fieldAccessors' => [ + 'getDisk', + ], + ], + ], + ], + 'StopAsyncReplication' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'disk', + 'fieldAccessors' => [ + 'getDisk', + ], + ], + ], + ], + 'StopGroupAsyncReplication' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'disk', + 'fieldAccessors' => [ + 'getDisk', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\DiskAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Disk', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'disk', + 'fieldAccessors' => [ + 'getDisk', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\DiskList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/disks_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/disks_rest_client_config.php new file mode 100644 index 000000000000..ca33478f59a6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/disks_rest_client_config.php @@ -0,0 +1,469 @@ + [ + 'google.cloud.compute.v1.Disks' => [ + 'AddResourcePolicies' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/addResourcePolicies', + 'body' => 'disks_add_resource_policies_request_resource', + 'placeholders' => [ + 'disk' => [ + 'getters' => [ + 'getDisk', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/disks', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'BulkInsert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/disks/bulkInsert', + 'body' => 'bulk_insert_disk_resource_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'CreateSnapshot' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/createSnapshot', + 'body' => 'snapshot_resource', + 'placeholders' => [ + 'disk' => [ + 'getters' => [ + 'getDisk', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/disks/{disk}', + 'placeholders' => [ + 'disk' => [ + 'getters' => [ + 'getDisk', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/disks/{disk}', + 'placeholders' => [ + 'disk' => [ + 'getters' => [ + 'getDisk', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/disks/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/disks', + 'body' => 'disk_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/disks', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'RemoveResourcePolicies' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/removeResourcePolicies', + 'body' => 'disks_remove_resource_policies_request_resource', + 'placeholders' => [ + 'disk' => [ + 'getters' => [ + 'getDisk', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Resize' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/resize', + 'body' => 'disks_resize_request_resource', + 'placeholders' => [ + 'disk' => [ + 'getters' => [ + 'getDisk', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/disks/{resource}/setIamPolicy', + 'body' => 'zone_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SetLabels' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/disks/{resource}/setLabels', + 'body' => 'zone_set_labels_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'StartAsyncReplication' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/startAsyncReplication', + 'body' => 'disks_start_async_replication_request_resource', + 'placeholders' => [ + 'disk' => [ + 'getters' => [ + 'getDisk', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'StopAsyncReplication' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/stopAsyncReplication', + 'placeholders' => [ + 'disk' => [ + 'getters' => [ + 'getDisk', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'StopGroupAsyncReplication' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/disks/stopGroupAsyncReplication', + 'body' => 'disks_stop_group_async_replication_resource_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/disks/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + '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' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/external_vpn_gateways_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/external_vpn_gateways_client_config.json new file mode 100644 index 000000000000..54ad15af6e9f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/external_vpn_gateways_client_config.json @@ -0,0 +1,75 @@ +{ + "interfaces": { + "google.cloud.compute.v1.ExternalVpnGateways": { + "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" + }, + "SetLabels": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/external_vpn_gateways_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/external_vpn_gateways_descriptor_config.php new file mode 100644 index 000000000000..3bd841dcee34 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/external_vpn_gateways_descriptor_config.php @@ -0,0 +1,171 @@ + [ + 'google.cloud.compute.v1.ExternalVpnGateways' => [ + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'external_vpn_gateway', + 'fieldAccessors' => [ + 'getExternalVpnGateway', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'SetLabels' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\ExternalVpnGateway', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'external_vpn_gateway', + 'fieldAccessors' => [ + 'getExternalVpnGateway', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\ExternalVpnGatewayList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/external_vpn_gateways_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/external_vpn_gateways_rest_client_config.php new file mode 100644 index 000000000000..e034b625db9f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/external_vpn_gateways_rest_client_config.php @@ -0,0 +1,189 @@ + [ + 'google.cloud.compute.v1.ExternalVpnGateways' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/externalVpnGateways/{external_vpn_gateway}', + 'placeholders' => [ + 'external_vpn_gateway' => [ + 'getters' => [ + 'getExternalVpnGateway', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/externalVpnGateways/{external_vpn_gateway}', + 'placeholders' => [ + 'external_vpn_gateway' => [ + 'getters' => [ + 'getExternalVpnGateway', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/externalVpnGateways', + 'body' => 'external_vpn_gateway_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/externalVpnGateways', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'SetLabels' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/externalVpnGateways/{resource}/setLabels', + 'body' => 'global_set_labels_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/externalVpnGateways/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/firewall_policies_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/firewall_policies_client_config.json new file mode 100644 index 000000000000..7dffff1afef5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/firewall_policies_client_config.json @@ -0,0 +1,135 @@ +{ + "interfaces": { + "google.cloud.compute.v1.FirewallPolicies": { + "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": { + "AddAssociation": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "AddRule": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CloneRules": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "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" + }, + "GetAssociation": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetRule": { + "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" + }, + "ListAssociations": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "Move": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "PatchRule": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RemoveAssociation": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RemoveRule": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/firewall_policies_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/firewall_policies_descriptor_config.php new file mode 100644 index 000000000000..92a75582f239 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/firewall_policies_descriptor_config.php @@ -0,0 +1,338 @@ + [ + 'google.cloud.compute.v1.FirewallPolicies' => [ + 'AddAssociation' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'AddRule' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'CloneRules' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + ], + 'Move' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'Patch' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'PatchRule' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'RemoveAssociation' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'RemoveRule' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\FirewallPolicy', + 'headerParams' => [ + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'GetAssociation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\FirewallPolicyAssociation', + 'headerParams' => [ + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'GetRule' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\FirewallPolicyRule', + 'headerParams' => [ + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\FirewallPolicyList', + ], + 'ListAssociations' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\FirewallPoliciesListAssociationsResponse', + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/firewall_policies_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/firewall_policies_rest_client_config.php new file mode 100644 index 000000000000..8afd8ae02e0a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/firewall_policies_rest_client_config.php @@ -0,0 +1,246 @@ + [ + 'google.cloud.compute.v1.FirewallPolicies' => [ + 'AddAssociation' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/locations/global/firewallPolicies/{firewall_policy}/addAssociation', + 'body' => 'firewall_policy_association_resource', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'AddRule' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/locations/global/firewallPolicies/{firewall_policy}/addRule', + 'body' => 'firewall_policy_rule_resource', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'CloneRules' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/locations/global/firewallPolicies/{firewall_policy}/cloneRules', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/locations/global/firewallPolicies/{firewall_policy}', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/locations/global/firewallPolicies/{firewall_policy}', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'GetAssociation' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/locations/global/firewallPolicies/{firewall_policy}/getAssociation', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/locations/global/firewallPolicies/{resource}/getIamPolicy', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetRule' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/locations/global/firewallPolicies/{firewall_policy}/getRule', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/locations/global/firewallPolicies', + 'body' => 'firewall_policy_resource', + 'queryParams' => [ + 'parent_id', + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/locations/global/firewallPolicies', + ], + 'ListAssociations' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/locations/global/firewallPolicies/listAssociations', + ], + 'Move' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/locations/global/firewallPolicies/{firewall_policy}/move', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + ], + 'queryParams' => [ + 'parent_id', + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/locations/global/firewallPolicies/{firewall_policy}', + 'body' => 'firewall_policy_resource', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'PatchRule' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/locations/global/firewallPolicies/{firewall_policy}/patchRule', + 'body' => 'firewall_policy_rule_resource', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'RemoveAssociation' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/locations/global/firewallPolicies/{firewall_policy}/removeAssociation', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'RemoveRule' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/locations/global/firewallPolicies/{firewall_policy}/removeRule', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/locations/global/firewallPolicies/{resource}/setIamPolicy', + 'body' => 'global_organization_set_policy_request_resource', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/locations/global/firewallPolicies/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOrganizationOperations' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/locations/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/locations/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/locations/global/operations', + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/firewalls_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/firewalls_client_config.json new file mode 100644 index 000000000000..d5ab78984678 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/firewalls_client_config.json @@ -0,0 +1,75 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Firewalls": { + "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" + }, + "Patch": { + "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/owl-bot-staging/Compute/V1/src/V1/resources/firewalls_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/firewalls_descriptor_config.php new file mode 100644 index 000000000000..14eacf72717c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/firewalls_descriptor_config.php @@ -0,0 +1,184 @@ + [ + 'google.cloud.compute.v1.Firewalls' => [ + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'firewall', + 'fieldAccessors' => [ + 'getFirewall', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'firewall', + 'fieldAccessors' => [ + 'getFirewall', + ], + ], + ], + ], + 'Update' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'firewall', + 'fieldAccessors' => [ + 'getFirewall', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Firewall', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'firewall', + 'fieldAccessors' => [ + 'getFirewall', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\FirewallList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/firewalls_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/firewalls_rest_client_config.php new file mode 100644 index 000000000000..bd6440758124 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/firewalls_rest_client_config.php @@ -0,0 +1,189 @@ + [ + 'google.cloud.compute.v1.Firewalls' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/firewalls/{firewall}', + 'placeholders' => [ + 'firewall' => [ + 'getters' => [ + 'getFirewall', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/firewalls/{firewall}', + 'placeholders' => [ + 'firewall' => [ + 'getters' => [ + 'getFirewall', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/firewalls', + 'body' => 'firewall_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/firewalls', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/global/firewalls/{firewall}', + 'body' => 'firewall_resource', + 'placeholders' => [ + 'firewall' => [ + 'getters' => [ + 'getFirewall', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Update' => [ + 'method' => 'put', + 'uriTemplate' => '/compute/v1/projects/{project}/global/firewalls/{firewall}', + 'body' => 'firewall_resource', + 'placeholders' => [ + 'firewall' => [ + 'getters' => [ + 'getFirewall', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/forwarding_rules_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/forwarding_rules_client_config.json new file mode 100644 index 000000000000..8d00271cefa6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/forwarding_rules_client_config.json @@ -0,0 +1,85 @@ +{ + "interfaces": { + "google.cloud.compute.v1.ForwardingRules": { + "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": { + "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", + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetLabels": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetTarget": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/forwarding_rules_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/forwarding_rules_descriptor_config.php new file mode 100644 index 000000000000..a23f06fb52d6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/forwarding_rules_descriptor_config.php @@ -0,0 +1,282 @@ + [ + 'google.cloud.compute.v1.ForwardingRules' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'forwarding_rule', + 'fieldAccessors' => [ + 'getForwardingRule', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'forwarding_rule', + 'fieldAccessors' => [ + 'getForwardingRule', + ], + ], + ], + ], + 'SetLabels' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'SetTarget' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'forwarding_rule', + 'fieldAccessors' => [ + 'getForwardingRule', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\ForwardingRuleAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\ForwardingRule', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'forwarding_rule', + 'fieldAccessors' => [ + 'getForwardingRule', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\ForwardingRuleList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/forwarding_rules_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/forwarding_rules_rest_client_config.php new file mode 100644 index 000000000000..767ade521b04 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/forwarding_rules_rest_client_config.php @@ -0,0 +1,261 @@ + [ + 'google.cloud.compute.v1.ForwardingRules' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/forwardingRules', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}', + 'placeholders' => [ + 'forwarding_rule' => [ + 'getters' => [ + 'getForwardingRule', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}', + 'placeholders' => [ + 'forwarding_rule' => [ + 'getters' => [ + 'getForwardingRule', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/forwardingRules', + 'body' => 'forwarding_rule_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/forwardingRules', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}', + 'body' => 'forwarding_rule_resource', + 'placeholders' => [ + 'forwarding_rule' => [ + 'getters' => [ + 'getForwardingRule', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'SetLabels' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/forwardingRules/{resource}/setLabels', + 'body' => 'region_set_labels_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetTarget' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}/setTarget', + 'body' => 'target_reference_resource', + 'placeholders' => [ + 'forwarding_rule' => [ + 'getters' => [ + 'getForwardingRule', + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/global_addresses_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/global_addresses_client_config.json new file mode 100644 index 000000000000..f30d87956492 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/global_addresses_client_config.json @@ -0,0 +1,75 @@ +{ + "interfaces": { + "google.cloud.compute.v1.GlobalAddresses": { + "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" + }, + "Move": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetLabels": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/global_addresses_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/global_addresses_descriptor_config.php new file mode 100644 index 000000000000..916970994782 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/global_addresses_descriptor_config.php @@ -0,0 +1,184 @@ + [ + 'google.cloud.compute.v1.GlobalAddresses' => [ + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'address', + 'fieldAccessors' => [ + 'getAddress', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Move' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'address', + 'fieldAccessors' => [ + 'getAddress', + ], + ], + ], + ], + 'SetLabels' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Address', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'address', + 'fieldAccessors' => [ + 'getAddress', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\AddressList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/global_addresses_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/global_addresses_rest_client_config.php new file mode 100644 index 000000000000..809fbfc58555 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/global_addresses_rest_client_config.php @@ -0,0 +1,189 @@ + [ + 'google.cloud.compute.v1.GlobalAddresses' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/addresses/{address}', + 'placeholders' => [ + 'address' => [ + 'getters' => [ + 'getAddress', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/addresses/{address}', + 'placeholders' => [ + 'address' => [ + 'getters' => [ + 'getAddress', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/addresses', + 'body' => 'address_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/addresses', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Move' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/addresses/{address}/move', + 'body' => 'global_addresses_move_request_resource', + 'placeholders' => [ + 'address' => [ + 'getters' => [ + 'getAddress', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'SetLabels' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/addresses/{resource}/setLabels', + 'body' => 'global_set_labels_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/global_forwarding_rules_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/global_forwarding_rules_client_config.json new file mode 100644 index 000000000000..02c40d4bfea9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/global_forwarding_rules_client_config.json @@ -0,0 +1,80 @@ +{ + "interfaces": { + "google.cloud.compute.v1.GlobalForwardingRules": { + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetLabels": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetTarget": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/global_forwarding_rules_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/global_forwarding_rules_descriptor_config.php new file mode 100644 index 000000000000..54ef535e9a3f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/global_forwarding_rules_descriptor_config.php @@ -0,0 +1,215 @@ + [ + 'google.cloud.compute.v1.GlobalForwardingRules' => [ + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'forwarding_rule', + 'fieldAccessors' => [ + 'getForwardingRule', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'forwarding_rule', + 'fieldAccessors' => [ + 'getForwardingRule', + ], + ], + ], + ], + 'SetLabels' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'SetTarget' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'forwarding_rule', + 'fieldAccessors' => [ + 'getForwardingRule', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\ForwardingRule', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'forwarding_rule', + 'fieldAccessors' => [ + 'getForwardingRule', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\ForwardingRuleList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/global_forwarding_rules_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/global_forwarding_rules_rest_client_config.php new file mode 100644 index 000000000000..7fbcd40ace19 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/global_forwarding_rules_rest_client_config.php @@ -0,0 +1,206 @@ + [ + 'google.cloud.compute.v1.GlobalForwardingRules' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/forwardingRules/{forwarding_rule}', + 'placeholders' => [ + 'forwarding_rule' => [ + 'getters' => [ + 'getForwardingRule', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/forwardingRules/{forwarding_rule}', + 'placeholders' => [ + 'forwarding_rule' => [ + 'getters' => [ + 'getForwardingRule', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/forwardingRules', + 'body' => 'forwarding_rule_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/forwardingRules', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/global/forwardingRules/{forwarding_rule}', + 'body' => 'forwarding_rule_resource', + 'placeholders' => [ + 'forwarding_rule' => [ + 'getters' => [ + 'getForwardingRule', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'SetLabels' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/forwardingRules/{resource}/setLabels', + 'body' => 'global_set_labels_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetTarget' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/forwardingRules/{forwarding_rule}/setTarget', + 'body' => 'target_reference_resource', + 'placeholders' => [ + 'forwarding_rule' => [ + 'getters' => [ + 'getForwardingRule', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/global_network_endpoint_groups_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/global_network_endpoint_groups_client_config.json new file mode 100644 index 000000000000..e62de623520a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/global_network_endpoint_groups_client_config.json @@ -0,0 +1,80 @@ +{ + "interfaces": { + "google.cloud.compute.v1.GlobalNetworkEndpointGroups": { + "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": { + "AttachNetworkEndpoints": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Delete": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DetachNetworkEndpoints": { + "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" + }, + "ListNetworkEndpoints": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/global_network_endpoint_groups_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/global_network_endpoint_groups_descriptor_config.php new file mode 100644 index 000000000000..372207bde932 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/global_network_endpoint_groups_descriptor_config.php @@ -0,0 +1,210 @@ + [ + 'google.cloud.compute.v1.GlobalNetworkEndpointGroups' => [ + 'AttachNetworkEndpoints' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'network_endpoint_group', + 'fieldAccessors' => [ + 'getNetworkEndpointGroup', + ], + ], + ], + ], + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'network_endpoint_group', + 'fieldAccessors' => [ + 'getNetworkEndpointGroup', + ], + ], + ], + ], + 'DetachNetworkEndpoints' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'network_endpoint_group', + 'fieldAccessors' => [ + 'getNetworkEndpointGroup', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NetworkEndpointGroup', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'network_endpoint_group', + 'fieldAccessors' => [ + 'getNetworkEndpointGroup', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NetworkEndpointGroupList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'ListNetworkEndpoints' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NetworkEndpointGroupsListNetworkEndpoints', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'network_endpoint_group', + 'fieldAccessors' => [ + 'getNetworkEndpointGroup', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/global_network_endpoint_groups_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/global_network_endpoint_groups_rest_client_config.php new file mode 100644 index 000000000000..9e7b804dd579 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/global_network_endpoint_groups_rest_client_config.php @@ -0,0 +1,205 @@ + [ + 'google.cloud.compute.v1.GlobalNetworkEndpointGroups' => [ + 'AttachNetworkEndpoints' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}/attachNetworkEndpoints', + 'body' => 'global_network_endpoint_groups_attach_endpoints_request_resource', + 'placeholders' => [ + 'network_endpoint_group' => [ + 'getters' => [ + 'getNetworkEndpointGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}', + 'placeholders' => [ + 'network_endpoint_group' => [ + 'getters' => [ + 'getNetworkEndpointGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'DetachNetworkEndpoints' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}/detachNetworkEndpoints', + 'body' => 'global_network_endpoint_groups_detach_endpoints_request_resource', + 'placeholders' => [ + 'network_endpoint_group' => [ + 'getters' => [ + 'getNetworkEndpointGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}', + 'placeholders' => [ + 'network_endpoint_group' => [ + 'getters' => [ + 'getNetworkEndpointGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/networkEndpointGroups', + 'body' => 'network_endpoint_group_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/networkEndpointGroups', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'ListNetworkEndpoints' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}/listNetworkEndpoints', + 'placeholders' => [ + 'network_endpoint_group' => [ + 'getters' => [ + 'getNetworkEndpointGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/global_operations_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/global_operations_client_config.json new file mode 100644 index 000000000000..8c605df32e1a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/global_operations_client_config.json @@ -0,0 +1,70 @@ +{ + "interfaces": { + "google.cloud.compute.v1.GlobalOperations": { + "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": { + "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", + "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" + }, + "List": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "Wait": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/global_operations_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/global_operations_descriptor_config.php new file mode 100644 index 000000000000..ad10343efb61 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/global_operations_descriptor_config.php @@ -0,0 +1,122 @@ + [ + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\OperationAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\DeleteGlobalOperationResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'operation', + 'fieldAccessors' => [ + 'getOperation', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'operation', + 'fieldAccessors' => [ + 'getOperation', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\OperationList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'operation', + 'fieldAccessors' => [ + 'getOperation', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/global_operations_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/global_operations_rest_client_config.php new file mode 100644 index 000000000000..3b58af713054 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/global_operations_rest_client_config.php @@ -0,0 +1,98 @@ + [ + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/global_organization_operations_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/global_organization_operations_client_config.json new file mode 100644 index 000000000000..198ed8975741 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/global_organization_operations_client_config.json @@ -0,0 +1,60 @@ +{ + "interfaces": { + "google.cloud.compute.v1.GlobalOrganizationOperations": { + "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" + }, + "List": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/global_organization_operations_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/global_organization_operations_descriptor_config.php new file mode 100644 index 000000000000..e6a151ab3223 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/global_organization_operations_descriptor_config.php @@ -0,0 +1,64 @@ + [ + 'google.cloud.compute.v1.GlobalOrganizationOperations' => [ + 'Delete' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationResponse', + 'headerParams' => [ + [ + 'keyName' => 'operation', + 'fieldAccessors' => [ + 'getOperation', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'headerParams' => [ + [ + 'keyName' => 'operation', + 'fieldAccessors' => [ + 'getOperation', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\OperationList', + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/global_organization_operations_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/global_organization_operations_rest_client_config.php new file mode 100644 index 000000000000..54f0a6a3c70a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/global_organization_operations_rest_client_config.php @@ -0,0 +1,54 @@ + [ + 'google.cloud.compute.v1.GlobalOrganizationOperations' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/locations/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/locations/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/locations/global/operations', + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/global_public_delegated_prefixes_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/global_public_delegated_prefixes_client_config.json new file mode 100644 index 000000000000..8246a0da8b86 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/global_public_delegated_prefixes_client_config.json @@ -0,0 +1,70 @@ +{ + "interfaces": { + "google.cloud.compute.v1.GlobalPublicDelegatedPrefixes": { + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/global_public_delegated_prefixes_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/global_public_delegated_prefixes_descriptor_config.php new file mode 100644 index 000000000000..cf495d4a42c9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/global_public_delegated_prefixes_descriptor_config.php @@ -0,0 +1,153 @@ + [ + 'google.cloud.compute.v1.GlobalPublicDelegatedPrefixes' => [ + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'public_delegated_prefix', + 'fieldAccessors' => [ + 'getPublicDelegatedPrefix', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'public_delegated_prefix', + 'fieldAccessors' => [ + 'getPublicDelegatedPrefix', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\PublicDelegatedPrefix', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'public_delegated_prefix', + 'fieldAccessors' => [ + 'getPublicDelegatedPrefix', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\PublicDelegatedPrefixList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/global_public_delegated_prefixes_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/global_public_delegated_prefixes_rest_client_config.php new file mode 100644 index 000000000000..4b76edc9f660 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/global_public_delegated_prefixes_rest_client_config.php @@ -0,0 +1,172 @@ + [ + 'google.cloud.compute.v1.GlobalPublicDelegatedPrefixes' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/publicDelegatedPrefixes/{public_delegated_prefix}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'public_delegated_prefix' => [ + 'getters' => [ + 'getPublicDelegatedPrefix', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/publicDelegatedPrefixes/{public_delegated_prefix}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'public_delegated_prefix' => [ + 'getters' => [ + 'getPublicDelegatedPrefix', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/publicDelegatedPrefixes', + 'body' => 'public_delegated_prefix_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/publicDelegatedPrefixes', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/global/publicDelegatedPrefixes/{public_delegated_prefix}', + 'body' => 'public_delegated_prefix_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'public_delegated_prefix' => [ + 'getters' => [ + 'getPublicDelegatedPrefix', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/health_checks_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/health_checks_client_config.json new file mode 100644 index 000000000000..9cb5c4c4bf3a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/health_checks_client_config.json @@ -0,0 +1,80 @@ +{ + "interfaces": { + "google.cloud.compute.v1.HealthChecks": { + "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": { + "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", + "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" + }, + "Patch": { + "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/owl-bot-staging/Compute/V1/src/V1/resources/health_checks_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/health_checks_descriptor_config.php new file mode 100644 index 000000000000..e46c9fe2f1d3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/health_checks_descriptor_config.php @@ -0,0 +1,204 @@ + [ + 'google.cloud.compute.v1.HealthChecks' => [ + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'health_check', + 'fieldAccessors' => [ + 'getHealthCheck', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'health_check', + 'fieldAccessors' => [ + 'getHealthCheck', + ], + ], + ], + ], + 'Update' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'health_check', + 'fieldAccessors' => [ + 'getHealthCheck', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\HealthChecksAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\HealthCheck', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'health_check', + 'fieldAccessors' => [ + 'getHealthCheck', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\HealthCheckList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/health_checks_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/health_checks_rest_client_config.php new file mode 100644 index 000000000000..b76f93f67fc7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/health_checks_rest_client_config.php @@ -0,0 +1,200 @@ + [ + 'google.cloud.compute.v1.HealthChecks' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/healthChecks', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/healthChecks/{health_check}', + 'placeholders' => [ + 'health_check' => [ + 'getters' => [ + 'getHealthCheck', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/healthChecks/{health_check}', + 'placeholders' => [ + 'health_check' => [ + 'getters' => [ + 'getHealthCheck', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/healthChecks', + 'body' => 'health_check_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/healthChecks', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/global/healthChecks/{health_check}', + 'body' => 'health_check_resource', + 'placeholders' => [ + 'health_check' => [ + 'getters' => [ + 'getHealthCheck', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Update' => [ + 'method' => 'put', + 'uriTemplate' => '/compute/v1/projects/{project}/global/healthChecks/{health_check}', + 'body' => 'health_check_resource', + 'placeholders' => [ + 'health_check' => [ + 'getters' => [ + 'getHealthCheck', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/image_family_views_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/image_family_views_client_config.json new file mode 100644 index 000000000000..2b92f1b89456 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/image_family_views_client_config.json @@ -0,0 +1,40 @@ +{ + "interfaces": { + "google.cloud.compute.v1.ImageFamilyViews": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "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 + } + }, + "methods": { + "Get": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/image_family_views_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/image_family_views_descriptor_config.php new file mode 100644 index 000000000000..9d8202441ef6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/image_family_views_descriptor_config.php @@ -0,0 +1,52 @@ + [ + 'google.cloud.compute.v1.ImageFamilyViews' => [ + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\ImageFamilyView', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'family', + 'fieldAccessors' => [ + 'getFamily', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/image_family_views_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/image_family_views_rest_client_config.php new file mode 100644 index 000000000000..b59bddf865b0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/image_family_views_rest_client_config.php @@ -0,0 +1,49 @@ + [ + 'google.cloud.compute.v1.ImageFamilyViews' => [ + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/imageFamilyViews/{family}', + 'placeholders' => [ + 'family' => [ + 'getters' => [ + 'getFamily', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/images_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/images_client_config.json new file mode 100644 index 000000000000..060ef59b8a2f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/images_client_config.json @@ -0,0 +1,100 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Images": { + "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" + }, + "Deprecate": { + "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" + }, + "GetFromFamily": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIamPolicy": { + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetLabels": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/images_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/images_descriptor_config.php new file mode 100644 index 000000000000..09907c4e560c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/images_descriptor_config.php @@ -0,0 +1,287 @@ + [ + 'google.cloud.compute.v1.Images' => [ + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'image', + 'fieldAccessors' => [ + 'getImage', + ], + ], + ], + ], + 'Deprecate' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'image', + 'fieldAccessors' => [ + 'getImage', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'image', + 'fieldAccessors' => [ + 'getImage', + ], + ], + ], + ], + 'SetLabels' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Image', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'image', + 'fieldAccessors' => [ + 'getImage', + ], + ], + ], + ], + 'GetFromFamily' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Image', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'family', + 'fieldAccessors' => [ + 'getFamily', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\ImageList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/images_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/images_rest_client_config.php new file mode 100644 index 000000000000..7579f25ad9ef --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/images_rest_client_config.php @@ -0,0 +1,272 @@ + [ + 'google.cloud.compute.v1.Images' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/images/{image}', + 'placeholders' => [ + 'image' => [ + 'getters' => [ + 'getImage', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Deprecate' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/images/{image}/deprecate', + 'body' => 'deprecation_status_resource', + 'placeholders' => [ + 'image' => [ + 'getters' => [ + 'getImage', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/images/{image}', + 'placeholders' => [ + 'image' => [ + 'getters' => [ + 'getImage', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'GetFromFamily' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/images/family/{family}', + 'placeholders' => [ + 'family' => [ + 'getters' => [ + 'getFamily', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/images/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/images', + 'body' => 'image_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/images', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/global/images/{image}', + 'body' => 'image_resource', + 'placeholders' => [ + 'image' => [ + 'getters' => [ + 'getImage', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/images/{resource}/setIamPolicy', + 'body' => 'global_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetLabels' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/images/{resource}/setLabels', + 'body' => 'global_set_labels_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/images/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/instance_group_manager_resize_requests_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/instance_group_manager_resize_requests_client_config.json new file mode 100644 index 000000000000..443021549925 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instance_group_manager_resize_requests_client_config.json @@ -0,0 +1,70 @@ +{ + "interfaces": { + "google.cloud.compute.v1.InstanceGroupManagerResizeRequests": { + "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": { + "Cancel": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "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/owl-bot-staging/Compute/V1/src/V1/resources/instance_group_manager_resize_requests_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/instance_group_manager_resize_requests_descriptor_config.php new file mode 100644 index 000000000000..9ce287748ff4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instance_group_manager_resize_requests_descriptor_config.php @@ -0,0 +1,216 @@ + [ + 'google.cloud.compute.v1.InstanceGroupManagerResizeRequests' => [ + 'Cancel' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + [ + 'keyName' => 'resize_request', + 'fieldAccessors' => [ + 'getResizeRequest', + ], + ], + ], + ], + 'Delete' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + [ + 'keyName' => 'resize_request', + 'fieldAccessors' => [ + 'getResizeRequest', + ], + ], + ], + ], + 'Insert' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequest', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + [ + 'keyName' => 'resize_request', + 'fieldAccessors' => [ + 'getResizeRequest', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequestsListResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/instance_group_manager_resize_requests_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/instance_group_manager_resize_requests_rest_client_config.php new file mode 100644 index 000000000000..816ae19884f1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instance_group_manager_resize_requests_rest_client_config.php @@ -0,0 +1,230 @@ + [ + 'google.cloud.compute.v1.InstanceGroupManagerResizeRequests' => [ + 'Cancel' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/resizeRequests/{resize_request}/cancel', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resize_request' => [ + 'getters' => [ + 'getResizeRequest', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/resizeRequests/{resize_request}', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resize_request' => [ + 'getters' => [ + 'getResizeRequest', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/resizeRequests/{resize_request}', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resize_request' => [ + 'getters' => [ + 'getResizeRequest', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/resizeRequests', + 'body' => 'instance_group_manager_resize_request_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/resizeRequests', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.ZoneOperations' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/instance_group_managers_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/instance_group_managers_client_config.json new file mode 100644 index 000000000000..a35032c3888b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instance_group_managers_client_config.json @@ -0,0 +1,145 @@ +{ + "interfaces": { + "google.cloud.compute.v1.InstanceGroupManagers": { + "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": { + "AbandonInstances": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "AggregatedList": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ApplyUpdatesToInstances": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateInstances": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Delete": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteInstances": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeletePerInstanceConfigs": { + "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" + }, + "ListErrors": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListManagedInstances": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListPerInstanceConfigs": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "PatchPerInstanceConfigs": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RecreateInstances": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Resize": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetInstanceTemplate": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetTargetPools": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdatePerInstanceConfigs": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/instance_group_managers_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/instance_group_managers_descriptor_config.php new file mode 100644 index 000000000000..686b12da840d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instance_group_managers_descriptor_config.php @@ -0,0 +1,720 @@ + [ + 'google.cloud.compute.v1.InstanceGroupManagers' => [ + 'AbandonInstances' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'ApplyUpdatesToInstances' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'CreateInstances' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'Delete' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'DeleteInstances' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'DeletePerInstanceConfigs' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'Insert' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'PatchPerInstanceConfigs' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'RecreateInstances' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'Resize' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'SetInstanceTemplate' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'SetTargetPools' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'UpdatePerInstanceConfigs' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceGroupManagerAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceGroupManager', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceGroupManagerList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'ListErrors' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceGroupManagersListErrorsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'ListManagedInstances' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getManagedInstances', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceGroupManagersListManagedInstancesResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'ListPerInstanceConfigs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceGroupManagersListPerInstanceConfigsResp', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/instance_group_managers_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/instance_group_managers_rest_client_config.php new file mode 100644 index 000000000000..297d62072570 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instance_group_managers_rest_client_config.php @@ -0,0 +1,524 @@ + [ + 'google.cloud.compute.v1.InstanceGroupManagers' => [ + 'AbandonInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/abandonInstances', + 'body' => 'instance_group_managers_abandon_instances_request_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/instanceGroupManagers', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'ApplyUpdatesToInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/applyUpdatesToInstances', + 'body' => 'instance_group_managers_apply_updates_request_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'CreateInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/createInstances', + 'body' => 'instance_group_managers_create_instances_request_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'DeleteInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/deleteInstances', + 'body' => 'instance_group_managers_delete_instances_request_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'DeletePerInstanceConfigs' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/deletePerInstanceConfigs', + 'body' => 'instance_group_managers_delete_per_instance_configs_req_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers', + 'body' => 'instance_group_manager_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'ListErrors' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/listErrors', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'ListManagedInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/listManagedInstances', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'ListPerInstanceConfigs' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/listPerInstanceConfigs', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}', + 'body' => 'instance_group_manager_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'PatchPerInstanceConfigs' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/patchPerInstanceConfigs', + 'body' => 'instance_group_managers_patch_per_instance_configs_req_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'RecreateInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/recreateInstances', + 'body' => 'instance_group_managers_recreate_instances_request_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Resize' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/resize', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + 'queryParams' => [ + 'size', + ], + ], + 'SetInstanceTemplate' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/setInstanceTemplate', + 'body' => 'instance_group_managers_set_instance_template_request_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SetTargetPools' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/setTargetPools', + 'body' => 'instance_group_managers_set_target_pools_request_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'UpdatePerInstanceConfigs' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/updatePerInstanceConfigs', + 'body' => 'instance_group_managers_update_per_instance_configs_req_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.ZoneOperations' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/instance_groups_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/instance_groups_client_config.json new file mode 100644 index 000000000000..b38fc0e942ea --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instance_groups_client_config.json @@ -0,0 +1,90 @@ +{ + "interfaces": { + "google.cloud.compute.v1.InstanceGroups": { + "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": { + "AddInstances": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "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", + "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" + }, + "ListInstances": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RemoveInstances": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetNamedPorts": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/instance_groups_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/instance_groups_descriptor_config.php new file mode 100644 index 000000000000..622893f89b23 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instance_groups_descriptor_config.php @@ -0,0 +1,314 @@ + [ + 'google.cloud.compute.v1.InstanceGroups' => [ + 'AddInstances' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group', + 'fieldAccessors' => [ + 'getInstanceGroup', + ], + ], + ], + ], + 'Delete' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group', + 'fieldAccessors' => [ + 'getInstanceGroup', + ], + ], + ], + ], + 'Insert' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'RemoveInstances' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group', + 'fieldAccessors' => [ + 'getInstanceGroup', + ], + ], + ], + ], + 'SetNamedPorts' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group', + 'fieldAccessors' => [ + 'getInstanceGroup', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceGroupAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceGroup', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group', + 'fieldAccessors' => [ + 'getInstanceGroup', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceGroupList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'ListInstances' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceGroupsListInstances', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance_group', + 'fieldAccessors' => [ + 'getInstanceGroup', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/instance_groups_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/instance_groups_rest_client_config.php new file mode 100644 index 000000000000..d32693408016 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instance_groups_rest_client_config.php @@ -0,0 +1,283 @@ + [ + 'google.cloud.compute.v1.InstanceGroups' => [ + 'AddInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}/addInstances', + 'body' => 'instance_groups_add_instances_request_resource', + 'placeholders' => [ + 'instance_group' => [ + 'getters' => [ + 'getInstanceGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/instanceGroups', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}', + 'placeholders' => [ + 'instance_group' => [ + 'getters' => [ + 'getInstanceGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}', + 'placeholders' => [ + 'instance_group' => [ + 'getters' => [ + 'getInstanceGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroups', + 'body' => 'instance_group_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroups', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'ListInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}/listInstances', + 'body' => 'instance_groups_list_instances_request_resource', + 'placeholders' => [ + 'instance_group' => [ + 'getters' => [ + 'getInstanceGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'RemoveInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}/removeInstances', + 'body' => 'instance_groups_remove_instances_request_resource', + 'placeholders' => [ + 'instance_group' => [ + 'getters' => [ + 'getInstanceGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SetNamedPorts' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}/setNamedPorts', + 'body' => 'instance_groups_set_named_ports_request_resource', + 'placeholders' => [ + 'instance_group' => [ + 'getters' => [ + 'getInstanceGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.ZoneOperations' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/instance_settings_service_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/instance_settings_service_client_config.json new file mode 100644 index 000000000000..20514ac4d0d5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instance_settings_service_client_config.json @@ -0,0 +1,55 @@ +{ + "interfaces": { + "google.cloud.compute.v1.InstanceSettingsService": { + "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": { + "Get": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/instance_settings_service_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/instance_settings_service_descriptor_config.php new file mode 100644 index 000000000000..cae400c3f45a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instance_settings_service_descriptor_config.php @@ -0,0 +1,78 @@ + [ + 'google.cloud.compute.v1.InstanceSettingsService' => [ + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceSettings', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/instance_settings_service_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/instance_settings_service_rest_client_config.php new file mode 100644 index 000000000000..c63d09b4efa9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instance_settings_service_rest_client_config.php @@ -0,0 +1,142 @@ + [ + 'google.cloud.compute.v1.InstanceSettingsService' => [ + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceSettings', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceSettings', + 'body' => 'instance_settings_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.ZoneOperations' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/instance_templates_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/instance_templates_client_config.json new file mode 100644 index 000000000000..7513d5d8dc99 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instance_templates_client_config.json @@ -0,0 +1,85 @@ +{ + "interfaces": { + "google.cloud.compute.v1.InstanceTemplates": { + "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": { + "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", + "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" + }, + "GetIamPolicy": { + "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" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/instance_templates_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/instance_templates_descriptor_config.php new file mode 100644 index 000000000000..0eb625709786 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instance_templates_descriptor_config.php @@ -0,0 +1,196 @@ + [ + 'google.cloud.compute.v1.InstanceTemplates' => [ + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'instance_template', + 'fieldAccessors' => [ + 'getInstanceTemplate', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceTemplateAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceTemplate', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'instance_template', + 'fieldAccessors' => [ + 'getInstanceTemplate', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceTemplateList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/instance_templates_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/instance_templates_rest_client_config.php new file mode 100644 index 000000000000..8805ae07618e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instance_templates_rest_client_config.php @@ -0,0 +1,216 @@ + [ + '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}', + 'placeholders' => [ + 'instance_template' => [ + 'getters' => [ + 'getInstanceTemplate', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/instanceTemplates/{instance_template}', + 'placeholders' => [ + 'instance_template' => [ + 'getters' => [ + 'getInstanceTemplate', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/instanceTemplates/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/instanceTemplates', + 'body' => 'instance_template_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/instanceTemplates', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/instanceTemplates/{resource}/setIamPolicy', + 'body' => 'global_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/instanceTemplates/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/instances_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/instances_client_config.json new file mode 100644 index 000000000000..c6a98fb77309 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instances_client_config.json @@ -0,0 +1,285 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Instances": { + "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": { + "AddAccessConfig": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "AddResourcePolicies": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "AggregatedList": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "AttachDisk": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "BulkInsert": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Delete": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteAccessConfig": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DetachDisk": { + "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" + }, + "GetEffectiveFirewalls": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetGuestAttributes": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetScreenshot": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetSerialPortOutput": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetShieldedInstanceIdentity": { + "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" + }, + "ListReferrers": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "PerformMaintenance": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RemoveResourcePolicies": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Reset": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Resume": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SendDiagnosticInterrupt": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetDeletionProtection": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetDiskAutoDelete": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetLabels": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetMachineResources": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetMachineType": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetMetadata": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetMinCpuPlatform": { + "timeout_millis": 600000, + "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", + "retry_params_name": "no_retry_1_params" + }, + "SetSecurityPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetServiceAccount": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetShieldedInstanceIntegrityPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetTags": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SimulateMaintenanceEvent": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Start": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "StartWithEncryptionKey": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Stop": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Suspend": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "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" + }, + "UpdateAccessConfig": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateDisplayDevice": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateNetworkInterface": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdateShieldedInstanceConfig": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/instances_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/instances_descriptor_config.php new file mode 100644 index 000000000000..5e27cabd0e41 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instances_descriptor_config.php @@ -0,0 +1,1664 @@ + [ + 'google.cloud.compute.v1.Instances' => [ + 'AddAccessConfig' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'AddResourcePolicies' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'AttachDisk' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'BulkInsert' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'Delete' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'DeleteAccessConfig' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'DetachDisk' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'Insert' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'PerformMaintenance' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'RemoveResourcePolicies' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'Reset' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'Resume' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'SetDeletionProtection' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'SetDiskAutoDelete' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'SetLabels' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'SetMachineResources' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'SetMachineType' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'SetMetadata' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'SetMinCpuPlatform' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'SetScheduling' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'SetSecurityPolicy' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'SetServiceAccount' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'SetShieldedInstanceIntegrityPolicy' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'SetTags' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'SimulateMaintenanceEvent' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'Start' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'StartWithEncryptionKey' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'Stop' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'Suspend' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'UpdateAccessConfig' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'UpdateDisplayDevice' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'UpdateNetworkInterface' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'UpdateShieldedInstanceConfig' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Instance', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'GetEffectiveFirewalls' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstancesGetEffectiveFirewallsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'GetGuestAttributes' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\GuestAttributes', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'GetScreenshot' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Screenshot', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'GetSerialPortOutput' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SerialPortOutput', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'GetShieldedInstanceIdentity' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\ShieldedInstanceIdentity', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'ListReferrers' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceListReferrers', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'SendDiagnosticInterrupt' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SendDiagnosticInterruptInstanceResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instance', + 'fieldAccessors' => [ + 'getInstance', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/instances_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/instances_rest_client_config.php new file mode 100644 index 000000000000..4f2c88b993cc --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instances_rest_client_config.php @@ -0,0 +1,1140 @@ + [ + 'google.cloud.compute.v1.Instances' => [ + 'AddAccessConfig' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/addAccessConfig', + 'body' => 'access_config_resource', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + 'queryParams' => [ + 'network_interface', + ], + ], + 'AddResourcePolicies' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/addResourcePolicies', + 'body' => 'instances_add_resource_policies_request_resource', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/instances', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'AttachDisk' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/attachDisk', + 'body' => 'attached_disk_resource', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'BulkInsert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/bulkInsert', + 'body' => 'bulk_insert_instance_resource_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'DeleteAccessConfig' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/deleteAccessConfig', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + 'queryParams' => [ + 'access_config', + 'network_interface', + ], + ], + 'DetachDisk' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/detachDisk', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + 'queryParams' => [ + 'device_name', + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'GetEffectiveFirewalls' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/getEffectiveFirewalls', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + 'queryParams' => [ + 'network_interface', + ], + ], + 'GetGuestAttributes' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/getGuestAttributes', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'GetScreenshot' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/screenshot', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'GetSerialPortOutput' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/serialPort', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'GetShieldedInstanceIdentity' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/getShieldedInstanceIdentity', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances', + 'body' => 'instance_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'ListReferrers' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/referrers', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'PerformMaintenance' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/performMaintenance', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'RemoveResourcePolicies' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/removeResourcePolicies', + 'body' => 'instances_remove_resource_policies_request_resource', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Reset' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/reset', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Resume' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/resume', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SendDiagnosticInterrupt' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/sendDiagnosticInterrupt', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SetDeletionProtection' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{resource}/setDeletionProtection', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SetDiskAutoDelete' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + 'queryParams' => [ + 'auto_delete', + 'device_name', + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{resource}/setIamPolicy', + 'body' => 'zone_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SetLabels' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setLabels', + 'body' => 'instances_set_labels_request_resource', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SetMachineResources' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMachineResources', + 'body' => 'instances_set_machine_resources_request_resource', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SetMachineType' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMachineType', + 'body' => 'instances_set_machine_type_request_resource', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SetMetadata' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMetadata', + 'body' => 'metadata_resource', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SetMinCpuPlatform' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform', + 'body' => 'instances_set_min_cpu_platform_request_resource', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + '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', + 'body' => 'scheduling_resource', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SetSecurityPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setSecurityPolicy', + 'body' => 'instances_set_security_policy_request_resource', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SetServiceAccount' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setServiceAccount', + 'body' => 'instances_set_service_account_request_resource', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SetShieldedInstanceIntegrityPolicy' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setShieldedInstanceIntegrityPolicy', + 'body' => 'shielded_instance_integrity_policy_resource', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SetTags' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setTags', + 'body' => 'tags_resource', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SimulateMaintenanceEvent' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Start' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/start', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'StartWithEncryptionKey' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey', + 'body' => 'instances_start_with_encryption_key_request_resource', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Stop' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/stop', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Suspend' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/suspend', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Update' => [ + 'method' => 'put', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}', + 'body' => 'instance_resource', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'UpdateAccessConfig' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateAccessConfig', + 'body' => 'access_config_resource', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + 'queryParams' => [ + 'network_interface', + ], + ], + 'UpdateDisplayDevice' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateDisplayDevice', + 'body' => 'display_device_resource', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'UpdateNetworkInterface' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateNetworkInterface', + 'body' => 'network_interface_resource', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + 'queryParams' => [ + 'network_interface', + ], + ], + 'UpdateShieldedInstanceConfig' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateShieldedInstanceConfig', + 'body' => 'shielded_instance_config_resource', + 'placeholders' => [ + 'instance' => [ + 'getters' => [ + 'getInstance', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.ZoneOperations' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/instant_snapshots_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/instant_snapshots_client_config.json new file mode 100644 index 000000000000..ff964adea758 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instant_snapshots_client_config.json @@ -0,0 +1,90 @@ +{ + "interfaces": { + "google.cloud.compute.v1.InstantSnapshots": { + "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": { + "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", + "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" + }, + "GetIamPolicy": { + "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" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetLabels": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/instant_snapshots_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/instant_snapshots_descriptor_config.php new file mode 100644 index 000000000000..5c5bfc230eef --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instant_snapshots_descriptor_config.php @@ -0,0 +1,278 @@ + [ + 'google.cloud.compute.v1.InstantSnapshots' => [ + 'Delete' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instant_snapshot', + 'fieldAccessors' => [ + 'getInstantSnapshot', + ], + ], + ], + ], + 'Insert' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'SetLabels' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstantSnapshotAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstantSnapshot', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'instant_snapshot', + 'fieldAccessors' => [ + 'getInstantSnapshot', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstantSnapshotList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/instant_snapshots_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/instant_snapshots_rest_client_config.php new file mode 100644 index 000000000000..1d9d1169074d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instant_snapshots_rest_client_config.php @@ -0,0 +1,282 @@ + [ + 'google.cloud.compute.v1.InstantSnapshots' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/instantSnapshots', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instantSnapshots/{instant_snapshot}', + 'placeholders' => [ + 'instant_snapshot' => [ + 'getters' => [ + 'getInstantSnapshot', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instantSnapshots/{instant_snapshot}', + 'placeholders' => [ + 'instant_snapshot' => [ + 'getters' => [ + 'getInstantSnapshot', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instantSnapshots/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instantSnapshots', + 'body' => 'instant_snapshot_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instantSnapshots', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instantSnapshots/{resource}/setIamPolicy', + 'body' => 'zone_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SetLabels' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instantSnapshots/{resource}/setLabels', + 'body' => 'zone_set_labels_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instantSnapshots/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.ZoneOperations' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_attachments_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_attachments_client_config.json new file mode 100644 index 000000000000..e35eec930cb0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_attachments_client_config.json @@ -0,0 +1,80 @@ +{ + "interfaces": { + "google.cloud.compute.v1.InterconnectAttachments": { + "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": { + "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", + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetLabels": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_attachments_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_attachments_descriptor_config.php new file mode 100644 index 000000000000..4f59112fa0ec --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_attachments_descriptor_config.php @@ -0,0 +1,244 @@ + [ + 'google.cloud.compute.v1.InterconnectAttachments' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'interconnect_attachment', + 'fieldAccessors' => [ + 'getInterconnectAttachment', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'interconnect_attachment', + 'fieldAccessors' => [ + 'getInterconnectAttachment', + ], + ], + ], + ], + 'SetLabels' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InterconnectAttachmentAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InterconnectAttachment', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'interconnect_attachment', + 'fieldAccessors' => [ + 'getInterconnectAttachment', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InterconnectAttachmentList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_attachments_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_attachments_rest_client_config.php new file mode 100644 index 000000000000..63d5445cd790 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_attachments_rest_client_config.php @@ -0,0 +1,239 @@ + [ + 'google.cloud.compute.v1.InterconnectAttachments' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/interconnectAttachments', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/interconnectAttachments/{interconnect_attachment}', + 'placeholders' => [ + 'interconnect_attachment' => [ + 'getters' => [ + 'getInterconnectAttachment', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/interconnectAttachments/{interconnect_attachment}', + 'placeholders' => [ + 'interconnect_attachment' => [ + 'getters' => [ + 'getInterconnectAttachment', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/interconnectAttachments', + 'body' => 'interconnect_attachment_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/interconnectAttachments', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/interconnectAttachments/{interconnect_attachment}', + 'body' => 'interconnect_attachment_resource', + 'placeholders' => [ + 'interconnect_attachment' => [ + 'getters' => [ + 'getInterconnectAttachment', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'SetLabels' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/interconnectAttachments/{resource}/setLabels', + 'body' => 'region_set_labels_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_locations_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_locations_client_config.json new file mode 100644 index 000000000000..cce2a41d4a7d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_locations_client_config.json @@ -0,0 +1,45 @@ +{ + "interfaces": { + "google.cloud.compute.v1.InterconnectLocations": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "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 + } + }, + "methods": { + "Get": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "List": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_locations_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_locations_descriptor_config.php new file mode 100644 index 000000000000..3c9745457e90 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_locations_descriptor_config.php @@ -0,0 +1,66 @@ + [ + 'google.cloud.compute.v1.InterconnectLocations' => [ + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InterconnectLocation', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'interconnect_location', + 'fieldAccessors' => [ + 'getInterconnectLocation', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InterconnectLocationList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_locations_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_locations_rest_client_config.php new file mode 100644 index 000000000000..f5021ab17c38 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_locations_rest_client_config.php @@ -0,0 +1,55 @@ + [ + 'google.cloud.compute.v1.InterconnectLocations' => [ + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/interconnectLocations/{interconnect_location}', + 'placeholders' => [ + 'interconnect_location' => [ + 'getters' => [ + 'getInterconnectLocation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/interconnectLocations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_remote_locations_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_remote_locations_client_config.json new file mode 100644 index 000000000000..6bb49f0ad905 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_remote_locations_client_config.json @@ -0,0 +1,45 @@ +{ + "interfaces": { + "google.cloud.compute.v1.InterconnectRemoteLocations": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "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 + } + }, + "methods": { + "Get": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "List": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_remote_locations_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_remote_locations_descriptor_config.php new file mode 100644 index 000000000000..b70c6b9fe13d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_remote_locations_descriptor_config.php @@ -0,0 +1,66 @@ + [ + 'google.cloud.compute.v1.InterconnectRemoteLocations' => [ + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InterconnectRemoteLocation', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'interconnect_remote_location', + 'fieldAccessors' => [ + 'getInterconnectRemoteLocation', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InterconnectRemoteLocationList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_remote_locations_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_remote_locations_rest_client_config.php new file mode 100644 index 000000000000..afd99a054751 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_remote_locations_rest_client_config.php @@ -0,0 +1,55 @@ + [ + 'google.cloud.compute.v1.InterconnectRemoteLocations' => [ + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/interconnectRemoteLocations/{interconnect_remote_location}', + 'placeholders' => [ + 'interconnect_remote_location' => [ + 'getters' => [ + 'getInterconnectRemoteLocation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/interconnectRemoteLocations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/interconnects_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/interconnects_client_config.json new file mode 100644 index 000000000000..b89dd9e2c45a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/interconnects_client_config.json @@ -0,0 +1,85 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Interconnects": { + "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" + }, + "GetDiagnostics": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetMacsecConfig": { + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetLabels": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/interconnects_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/interconnects_descriptor_config.php new file mode 100644 index 000000000000..6b82b8b622dc --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/interconnects_descriptor_config.php @@ -0,0 +1,220 @@ + [ + 'google.cloud.compute.v1.Interconnects' => [ + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'interconnect', + 'fieldAccessors' => [ + 'getInterconnect', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'interconnect', + 'fieldAccessors' => [ + 'getInterconnect', + ], + ], + ], + ], + 'SetLabels' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Interconnect', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'interconnect', + 'fieldAccessors' => [ + 'getInterconnect', + ], + ], + ], + ], + 'GetDiagnostics' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InterconnectsGetDiagnosticsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'interconnect', + 'fieldAccessors' => [ + 'getInterconnect', + ], + ], + ], + ], + 'GetMacsecConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InterconnectsGetMacsecConfigResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'interconnect', + 'fieldAccessors' => [ + 'getInterconnect', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InterconnectList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/interconnects_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/interconnects_rest_client_config.php new file mode 100644 index 000000000000..85b82c158342 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/interconnects_rest_client_config.php @@ -0,0 +1,221 @@ + [ + 'google.cloud.compute.v1.Interconnects' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/interconnects/{interconnect}', + 'placeholders' => [ + 'interconnect' => [ + 'getters' => [ + 'getInterconnect', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/interconnects/{interconnect}', + 'placeholders' => [ + 'interconnect' => [ + 'getters' => [ + 'getInterconnect', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'GetDiagnostics' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/interconnects/{interconnect}/getDiagnostics', + 'placeholders' => [ + 'interconnect' => [ + 'getters' => [ + 'getInterconnect', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'GetMacsecConfig' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/interconnects/{interconnect}/getMacsecConfig', + 'placeholders' => [ + 'interconnect' => [ + 'getters' => [ + 'getInterconnect', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/interconnects', + 'body' => 'interconnect_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/interconnects', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/global/interconnects/{interconnect}', + 'body' => 'interconnect_resource', + 'placeholders' => [ + 'interconnect' => [ + 'getters' => [ + 'getInterconnect', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'SetLabels' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/interconnects/{resource}/setLabels', + 'body' => 'global_set_labels_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/license_codes_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/license_codes_client_config.json new file mode 100644 index 000000000000..8c0c15cf8a46 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/license_codes_client_config.json @@ -0,0 +1,55 @@ +{ + "interfaces": { + "google.cloud.compute.v1.LicenseCodes": { + "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": { + "Get": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/license_codes_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/license_codes_descriptor_config.php new file mode 100644 index 000000000000..614709a4e28d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/license_codes_descriptor_config.php @@ -0,0 +1,64 @@ + [ + 'google.cloud.compute.v1.LicenseCodes' => [ + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\LicenseCode', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'license_code', + 'fieldAccessors' => [ + 'getLicenseCode', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/license_codes_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/license_codes_rest_client_config.php new file mode 100644 index 000000000000..c448a65a971a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/license_codes_rest_client_config.php @@ -0,0 +1,61 @@ + [ + 'google.cloud.compute.v1.LicenseCodes' => [ + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/licenseCodes/{license_code}', + 'placeholders' => [ + 'license_code' => [ + 'getters' => [ + 'getLicenseCode', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/licenseCodes/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/licenses_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/licenses_client_config.json new file mode 100644 index 000000000000..2f4549d08363 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/licenses_client_config.json @@ -0,0 +1,80 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Licenses": { + "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" + }, + "GetIamPolicy": { + "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" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/licenses_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/licenses_descriptor_config.php new file mode 100644 index 000000000000..d988b8f7417a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/licenses_descriptor_config.php @@ -0,0 +1,176 @@ + [ + 'google.cloud.compute.v1.Licenses' => [ + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'license', + 'fieldAccessors' => [ + 'getLicense', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\License', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'license', + 'fieldAccessors' => [ + 'getLicense', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\LicensesListResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/licenses_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/licenses_rest_client_config.php new file mode 100644 index 000000000000..44ec0c314963 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/licenses_rest_client_config.php @@ -0,0 +1,205 @@ + [ + 'google.cloud.compute.v1.Licenses' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/licenses/{license}', + 'placeholders' => [ + 'license' => [ + 'getters' => [ + 'getLicense', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/licenses/{license}', + 'placeholders' => [ + 'license' => [ + 'getters' => [ + 'getLicense', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/licenses/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/licenses', + 'body' => 'license_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/licenses', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/licenses/{resource}/setIamPolicy', + 'body' => 'global_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/licenses/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/machine_images_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/machine_images_client_config.json new file mode 100644 index 000000000000..2e0566520188 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/machine_images_client_config.json @@ -0,0 +1,80 @@ +{ + "interfaces": { + "google.cloud.compute.v1.MachineImages": { + "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" + }, + "GetIamPolicy": { + "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" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/machine_images_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/machine_images_descriptor_config.php new file mode 100644 index 000000000000..df87e80c4b78 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/machine_images_descriptor_config.php @@ -0,0 +1,176 @@ + [ + 'google.cloud.compute.v1.MachineImages' => [ + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'machine_image', + 'fieldAccessors' => [ + 'getMachineImage', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\MachineImage', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'machine_image', + 'fieldAccessors' => [ + 'getMachineImage', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\MachineImageList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/machine_images_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/machine_images_rest_client_config.php new file mode 100644 index 000000000000..afff9d18bf84 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/machine_images_rest_client_config.php @@ -0,0 +1,205 @@ + [ + 'google.cloud.compute.v1.MachineImages' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/machineImages/{machine_image}', + 'placeholders' => [ + 'machine_image' => [ + 'getters' => [ + 'getMachineImage', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/machineImages/{machine_image}', + 'placeholders' => [ + 'machine_image' => [ + 'getters' => [ + 'getMachineImage', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/machineImages/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/machineImages', + 'body' => 'machine_image_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/machineImages', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/machineImages/{resource}/setIamPolicy', + 'body' => 'global_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/machineImages/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/machine_types_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/machine_types_client_config.json new file mode 100644 index 000000000000..bc04ba83d85b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/machine_types_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.cloud.compute.v1.MachineTypes": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "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 + } + }, + "methods": { + "AggregatedList": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "Get": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "List": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/machine_types_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/machine_types_descriptor_config.php new file mode 100644 index 000000000000..151402618f49 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/machine_types_descriptor_config.php @@ -0,0 +1,98 @@ + [ + 'google.cloud.compute.v1.MachineTypes' => [ + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\MachineTypeAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\MachineType', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'machine_type', + 'fieldAccessors' => [ + 'getMachineType', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\MachineTypeList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/machine_types_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/machine_types_rest_client_config.php new file mode 100644 index 000000000000..6ae1dd710b8b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/machine_types_rest_client_config.php @@ -0,0 +1,76 @@ + [ + 'google.cloud.compute.v1.MachineTypes' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/machineTypes', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/machineTypes/{machine_type}', + 'placeholders' => [ + 'machine_type' => [ + 'getters' => [ + 'getMachineType', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/machineTypes', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/network_attachments_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/network_attachments_client_config.json new file mode 100644 index 000000000000..a30db02e131f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/network_attachments_client_config.json @@ -0,0 +1,90 @@ +{ + "interfaces": { + "google.cloud.compute.v1.NetworkAttachments": { + "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": { + "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", + "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" + }, + "GetIamPolicy": { + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/network_attachments_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/network_attachments_descriptor_config.php new file mode 100644 index 000000000000..2c2982395377 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/network_attachments_descriptor_config.php @@ -0,0 +1,278 @@ + [ + 'google.cloud.compute.v1.NetworkAttachments' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'network_attachment', + 'fieldAccessors' => [ + 'getNetworkAttachment', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'network_attachment', + 'fieldAccessors' => [ + 'getNetworkAttachment', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NetworkAttachmentAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NetworkAttachment', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'network_attachment', + 'fieldAccessors' => [ + 'getNetworkAttachment', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NetworkAttachmentList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/network_attachments_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/network_attachments_rest_client_config.php new file mode 100644 index 000000000000..a706569c34b6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/network_attachments_rest_client_config.php @@ -0,0 +1,282 @@ + [ + 'google.cloud.compute.v1.NetworkAttachments' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/networkAttachments', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/networkAttachments/{network_attachment}', + 'placeholders' => [ + 'network_attachment' => [ + 'getters' => [ + 'getNetworkAttachment', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/networkAttachments/{network_attachment}', + 'placeholders' => [ + 'network_attachment' => [ + 'getters' => [ + 'getNetworkAttachment', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/networkAttachments/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/networkAttachments', + 'body' => 'network_attachment_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/networkAttachments', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/networkAttachments/{network_attachment}', + 'body' => 'network_attachment_resource', + 'placeholders' => [ + 'network_attachment' => [ + 'getters' => [ + 'getNetworkAttachment', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/networkAttachments/{resource}/setIamPolicy', + 'body' => 'region_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/networkAttachments/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/network_edge_security_services_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/network_edge_security_services_client_config.json new file mode 100644 index 000000000000..e42008acd361 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/network_edge_security_services_client_config.json @@ -0,0 +1,70 @@ +{ + "interfaces": { + "google.cloud.compute.v1.NetworkEdgeSecurityServices": { + "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": { + "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", + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/network_edge_security_services_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/network_edge_security_services_descriptor_config.php new file mode 100644 index 000000000000..66671178a7d4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/network_edge_security_services_descriptor_config.php @@ -0,0 +1,180 @@ + [ + 'google.cloud.compute.v1.NetworkEdgeSecurityServices' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'network_edge_security_service', + 'fieldAccessors' => [ + 'getNetworkEdgeSecurityService', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'network_edge_security_service', + 'fieldAccessors' => [ + 'getNetworkEdgeSecurityService', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NetworkEdgeSecurityServiceAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NetworkEdgeSecurityService', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'network_edge_security_service', + 'fieldAccessors' => [ + 'getNetworkEdgeSecurityService', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/network_edge_security_services_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/network_edge_security_services_rest_client_config.php new file mode 100644 index 000000000000..61d9e5d605ab --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/network_edge_security_services_rest_client_config.php @@ -0,0 +1,201 @@ + [ + 'google.cloud.compute.v1.NetworkEdgeSecurityServices' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/networkEdgeSecurityServices', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/networkEdgeSecurityServices/{network_edge_security_service}', + 'placeholders' => [ + 'network_edge_security_service' => [ + 'getters' => [ + 'getNetworkEdgeSecurityService', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/networkEdgeSecurityServices/{network_edge_security_service}', + 'placeholders' => [ + 'network_edge_security_service' => [ + 'getters' => [ + 'getNetworkEdgeSecurityService', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/networkEdgeSecurityServices', + 'body' => 'network_edge_security_service_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/networkEdgeSecurityServices/{network_edge_security_service}', + 'body' => 'network_edge_security_service_resource', + 'placeholders' => [ + 'network_edge_security_service' => [ + 'getters' => [ + 'getNetworkEdgeSecurityService', + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/network_endpoint_groups_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/network_endpoint_groups_client_config.json new file mode 100644 index 000000000000..78433f324744 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/network_endpoint_groups_client_config.json @@ -0,0 +1,90 @@ +{ + "interfaces": { + "google.cloud.compute.v1.NetworkEndpointGroups": { + "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": { + "AggregatedList": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "AttachNetworkEndpoints": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Delete": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DetachNetworkEndpoints": { + "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" + }, + "ListNetworkEndpoints": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/network_endpoint_groups_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/network_endpoint_groups_descriptor_config.php new file mode 100644 index 000000000000..437a3994dd91 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/network_endpoint_groups_descriptor_config.php @@ -0,0 +1,300 @@ + [ + 'google.cloud.compute.v1.NetworkEndpointGroups' => [ + 'AttachNetworkEndpoints' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'network_endpoint_group', + 'fieldAccessors' => [ + 'getNetworkEndpointGroup', + ], + ], + ], + ], + 'Delete' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'network_endpoint_group', + 'fieldAccessors' => [ + 'getNetworkEndpointGroup', + ], + ], + ], + ], + 'DetachNetworkEndpoints' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'network_endpoint_group', + 'fieldAccessors' => [ + 'getNetworkEndpointGroup', + ], + ], + ], + ], + 'Insert' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NetworkEndpointGroupAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NetworkEndpointGroup', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'network_endpoint_group', + 'fieldAccessors' => [ + 'getNetworkEndpointGroup', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NetworkEndpointGroupList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'ListNetworkEndpoints' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NetworkEndpointGroupsListNetworkEndpoints', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'network_endpoint_group', + 'fieldAccessors' => [ + 'getNetworkEndpointGroup', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/network_endpoint_groups_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/network_endpoint_groups_rest_client_config.php new file mode 100644 index 000000000000..995e54193772 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/network_endpoint_groups_rest_client_config.php @@ -0,0 +1,283 @@ + [ + 'google.cloud.compute.v1.NetworkEndpointGroups' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/networkEndpointGroups', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'AttachNetworkEndpoints' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{network_endpoint_group}/attachNetworkEndpoints', + 'body' => 'network_endpoint_groups_attach_endpoints_request_resource', + 'placeholders' => [ + 'network_endpoint_group' => [ + 'getters' => [ + 'getNetworkEndpointGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{network_endpoint_group}', + 'placeholders' => [ + 'network_endpoint_group' => [ + 'getters' => [ + 'getNetworkEndpointGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'DetachNetworkEndpoints' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{network_endpoint_group}/detachNetworkEndpoints', + 'body' => 'network_endpoint_groups_detach_endpoints_request_resource', + 'placeholders' => [ + 'network_endpoint_group' => [ + 'getters' => [ + 'getNetworkEndpointGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{network_endpoint_group}', + 'placeholders' => [ + 'network_endpoint_group' => [ + 'getters' => [ + 'getNetworkEndpointGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups', + 'body' => 'network_endpoint_group_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'ListNetworkEndpoints' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{network_endpoint_group}/listNetworkEndpoints', + 'body' => 'network_endpoint_groups_list_endpoints_request_resource', + 'placeholders' => [ + 'network_endpoint_group' => [ + 'getters' => [ + 'getNetworkEndpointGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.ZoneOperations' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/network_firewall_policies_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/network_firewall_policies_client_config.json new file mode 100644 index 000000000000..525a2675675c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/network_firewall_policies_client_config.json @@ -0,0 +1,125 @@ +{ + "interfaces": { + "google.cloud.compute.v1.NetworkFirewallPolicies": { + "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": { + "AddAssociation": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "AddRule": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CloneRules": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "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" + }, + "GetAssociation": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetRule": { + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "PatchRule": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RemoveAssociation": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RemoveRule": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/network_firewall_policies_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/network_firewall_policies_descriptor_config.php new file mode 100644 index 000000000000..03212e133d1e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/network_firewall_policies_descriptor_config.php @@ -0,0 +1,429 @@ + [ + 'google.cloud.compute.v1.NetworkFirewallPolicies' => [ + 'AddAssociation' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'AddRule' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'CloneRules' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'PatchRule' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'RemoveAssociation' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'RemoveRule' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\FirewallPolicy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'GetAssociation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\FirewallPolicyAssociation', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'GetRule' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\FirewallPolicyRule', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\FirewallPolicyList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/network_firewall_policies_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/network_firewall_policies_rest_client_config.php new file mode 100644 index 000000000000..90ad923dba7b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/network_firewall_policies_rest_client_config.php @@ -0,0 +1,353 @@ + [ + 'google.cloud.compute.v1.NetworkFirewallPolicies' => [ + 'AddAssociation' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/firewallPolicies/{firewall_policy}/addAssociation', + 'body' => 'firewall_policy_association_resource', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'AddRule' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/firewallPolicies/{firewall_policy}/addRule', + 'body' => 'firewall_policy_rule_resource', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'CloneRules' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/firewallPolicies/{firewall_policy}/cloneRules', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/firewallPolicies/{firewall_policy}', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/firewallPolicies/{firewall_policy}', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'GetAssociation' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/firewallPolicies/{firewall_policy}/getAssociation', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/firewallPolicies/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetRule' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/firewallPolicies/{firewall_policy}/getRule', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/firewallPolicies', + 'body' => 'firewall_policy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/firewallPolicies', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/global/firewallPolicies/{firewall_policy}', + 'body' => 'firewall_policy_resource', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'PatchRule' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/firewallPolicies/{firewall_policy}/patchRule', + 'body' => 'firewall_policy_rule_resource', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'RemoveAssociation' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/firewallPolicies/{firewall_policy}/removeAssociation', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'RemoveRule' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/firewallPolicies/{firewall_policy}/removeRule', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/firewallPolicies/{resource}/setIamPolicy', + 'body' => 'global_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/firewallPolicies/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/networks_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/networks_client_config.json new file mode 100644 index 000000000000..e771538bea20 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/networks_client_config.json @@ -0,0 +1,100 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Networks": { + "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": { + "AddPeering": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "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" + }, + "GetEffectiveFirewalls": { + "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" + }, + "ListPeeringRoutes": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RemovePeering": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SwitchToCustomMode": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdatePeering": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/networks_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/networks_descriptor_config.php new file mode 100644 index 000000000000..6e6526774c45 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/networks_descriptor_config.php @@ -0,0 +1,321 @@ + [ + 'google.cloud.compute.v1.Networks' => [ + 'AddPeering' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'network', + 'fieldAccessors' => [ + 'getNetwork', + ], + ], + ], + ], + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'network', + 'fieldAccessors' => [ + 'getNetwork', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'network', + 'fieldAccessors' => [ + 'getNetwork', + ], + ], + ], + ], + 'RemovePeering' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'network', + 'fieldAccessors' => [ + 'getNetwork', + ], + ], + ], + ], + 'SwitchToCustomMode' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'network', + 'fieldAccessors' => [ + 'getNetwork', + ], + ], + ], + ], + 'UpdatePeering' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'network', + 'fieldAccessors' => [ + 'getNetwork', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Network', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'network', + 'fieldAccessors' => [ + 'getNetwork', + ], + ], + ], + ], + 'GetEffectiveFirewalls' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NetworksGetEffectiveFirewallsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'network', + 'fieldAccessors' => [ + 'getNetwork', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NetworkList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'ListPeeringRoutes' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\ExchangedPeeringRoutesList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'network', + 'fieldAccessors' => [ + 'getNetwork', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/networks_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/networks_rest_client_config.php new file mode 100644 index 000000000000..6cff31187bae --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/networks_rest_client_config.php @@ -0,0 +1,271 @@ + [ + 'google.cloud.compute.v1.Networks' => [ + 'AddPeering' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/networks/{network}/addPeering', + 'body' => 'networks_add_peering_request_resource', + 'placeholders' => [ + 'network' => [ + 'getters' => [ + 'getNetwork', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/networks/{network}', + 'placeholders' => [ + 'network' => [ + 'getters' => [ + 'getNetwork', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/networks/{network}', + 'placeholders' => [ + 'network' => [ + 'getters' => [ + 'getNetwork', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'GetEffectiveFirewalls' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/networks/{network}/getEffectiveFirewalls', + 'placeholders' => [ + 'network' => [ + 'getters' => [ + 'getNetwork', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/networks', + 'body' => 'network_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/networks', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'ListPeeringRoutes' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/networks/{network}/listPeeringRoutes', + 'placeholders' => [ + 'network' => [ + 'getters' => [ + 'getNetwork', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/global/networks/{network}', + 'body' => 'network_resource', + 'placeholders' => [ + 'network' => [ + 'getters' => [ + 'getNetwork', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'RemovePeering' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/networks/{network}/removePeering', + 'body' => 'networks_remove_peering_request_resource', + 'placeholders' => [ + 'network' => [ + 'getters' => [ + 'getNetwork', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'SwitchToCustomMode' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/networks/{network}/switchToCustomMode', + 'placeholders' => [ + 'network' => [ + 'getters' => [ + 'getNetwork', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'UpdatePeering' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/global/networks/{network}/updatePeering', + 'body' => 'networks_update_peering_request_resource', + 'placeholders' => [ + 'network' => [ + 'getters' => [ + 'getNetwork', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/node_groups_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/node_groups_client_config.json new file mode 100644 index 000000000000..e1153e1150bc --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/node_groups_client_config.json @@ -0,0 +1,120 @@ +{ + "interfaces": { + "google.cloud.compute.v1.NodeGroups": { + "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": { + "AddNodes": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "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", + "retry_params_name": "no_retry_1_params" + }, + "DeleteNodes": { + "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" + }, + "GetIamPolicy": { + "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" + }, + "ListNodes": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "PerformMaintenance": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetNodeTemplate": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SimulateMaintenanceEvent": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/node_groups_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/node_groups_descriptor_config.php new file mode 100644 index 000000000000..67f298062854 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/node_groups_descriptor_config.php @@ -0,0 +1,500 @@ + [ + 'google.cloud.compute.v1.NodeGroups' => [ + 'AddNodes' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'node_group', + 'fieldAccessors' => [ + 'getNodeGroup', + ], + ], + ], + ], + 'Delete' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'node_group', + 'fieldAccessors' => [ + 'getNodeGroup', + ], + ], + ], + ], + 'DeleteNodes' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'node_group', + 'fieldAccessors' => [ + 'getNodeGroup', + ], + ], + ], + ], + 'Insert' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'node_group', + 'fieldAccessors' => [ + 'getNodeGroup', + ], + ], + ], + ], + 'PerformMaintenance' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'node_group', + 'fieldAccessors' => [ + 'getNodeGroup', + ], + ], + ], + ], + 'SetNodeTemplate' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'node_group', + 'fieldAccessors' => [ + 'getNodeGroup', + ], + ], + ], + ], + 'SimulateMaintenanceEvent' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'node_group', + 'fieldAccessors' => [ + 'getNodeGroup', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NodeGroupAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NodeGroup', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'node_group', + 'fieldAccessors' => [ + 'getNodeGroup', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NodeGroupList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'ListNodes' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NodeGroupsListNodes', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'node_group', + 'fieldAccessors' => [ + 'getNodeGroup', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/node_groups_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/node_groups_rest_client_config.php new file mode 100644 index 000000000000..595b2e2b59dd --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/node_groups_rest_client_config.php @@ -0,0 +1,416 @@ + [ + 'google.cloud.compute.v1.NodeGroups' => [ + 'AddNodes' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/addNodes', + 'body' => 'node_groups_add_nodes_request_resource', + 'placeholders' => [ + 'node_group' => [ + 'getters' => [ + 'getNodeGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/nodeGroups', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}', + 'placeholders' => [ + 'node_group' => [ + 'getters' => [ + 'getNodeGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'DeleteNodes' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/deleteNodes', + 'body' => 'node_groups_delete_nodes_request_resource', + 'placeholders' => [ + 'node_group' => [ + 'getters' => [ + 'getNodeGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}', + 'placeholders' => [ + 'node_group' => [ + 'getters' => [ + 'getNodeGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/nodeGroups', + 'body' => 'node_group_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + 'queryParams' => [ + 'initial_node_count', + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/nodeGroups', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'ListNodes' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/listNodes', + 'placeholders' => [ + 'node_group' => [ + 'getters' => [ + 'getNodeGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}', + 'body' => 'node_group_resource', + 'placeholders' => [ + 'node_group' => [ + 'getters' => [ + 'getNodeGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'PerformMaintenance' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/performMaintenance', + 'body' => 'node_groups_perform_maintenance_request_resource', + 'placeholders' => [ + 'node_group' => [ + 'getters' => [ + 'getNodeGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy', + 'body' => 'zone_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SetNodeTemplate' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/setNodeTemplate', + 'body' => 'node_groups_set_node_template_request_resource', + 'placeholders' => [ + 'node_group' => [ + 'getters' => [ + 'getNodeGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SimulateMaintenanceEvent' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/simulateMaintenanceEvent', + 'body' => 'node_groups_simulate_maintenance_event_request_resource', + 'placeholders' => [ + 'node_group' => [ + 'getters' => [ + 'getNodeGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.ZoneOperations' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/node_templates_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/node_templates_client_config.json new file mode 100644 index 000000000000..3b7ffcbcb40c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/node_templates_client_config.json @@ -0,0 +1,85 @@ +{ + "interfaces": { + "google.cloud.compute.v1.NodeTemplates": { + "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": { + "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", + "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" + }, + "GetIamPolicy": { + "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" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/node_templates_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/node_templates_descriptor_config.php new file mode 100644 index 000000000000..aada90a1d2bd --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/node_templates_descriptor_config.php @@ -0,0 +1,240 @@ + [ + 'google.cloud.compute.v1.NodeTemplates' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'node_template', + 'fieldAccessors' => [ + 'getNodeTemplate', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NodeTemplateAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NodeTemplate', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'node_template', + 'fieldAccessors' => [ + 'getNodeTemplate', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NodeTemplateList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/node_templates_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/node_templates_rest_client_config.php new file mode 100644 index 000000000000..96a09c236bd3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/node_templates_rest_client_config.php @@ -0,0 +1,260 @@ + [ + 'google.cloud.compute.v1.NodeTemplates' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/nodeTemplates', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/nodeTemplates/{node_template}', + 'placeholders' => [ + 'node_template' => [ + 'getters' => [ + 'getNodeTemplate', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/nodeTemplates/{node_template}', + 'placeholders' => [ + 'node_template' => [ + 'getters' => [ + 'getNodeTemplate', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/nodeTemplates', + 'body' => 'node_template_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/nodeTemplates', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy', + 'body' => 'region_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/node_types_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/node_types_client_config.json new file mode 100644 index 000000000000..2dcc6c5b80ea --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/node_types_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.cloud.compute.v1.NodeTypes": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "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 + } + }, + "methods": { + "AggregatedList": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "Get": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "List": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/node_types_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/node_types_descriptor_config.php new file mode 100644 index 000000000000..fb63671578ca --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/node_types_descriptor_config.php @@ -0,0 +1,98 @@ + [ + 'google.cloud.compute.v1.NodeTypes' => [ + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NodeTypeAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NodeType', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'node_type', + 'fieldAccessors' => [ + 'getNodeType', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NodeTypeList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/node_types_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/node_types_rest_client_config.php new file mode 100644 index 000000000000..9f921a3107b9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/node_types_rest_client_config.php @@ -0,0 +1,76 @@ + [ + 'google.cloud.compute.v1.NodeTypes' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/nodeTypes', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/nodeTypes/{node_type}', + 'placeholders' => [ + 'node_type' => [ + 'getters' => [ + 'getNodeType', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/nodeTypes', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/packet_mirrorings_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/packet_mirrorings_client_config.json new file mode 100644 index 000000000000..a910e5cbbd63 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/packet_mirrorings_client_config.json @@ -0,0 +1,80 @@ +{ + "interfaces": { + "google.cloud.compute.v1.PacketMirrorings": { + "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": { + "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", + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/packet_mirrorings_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/packet_mirrorings_descriptor_config.php new file mode 100644 index 000000000000..8e5276480ae2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/packet_mirrorings_descriptor_config.php @@ -0,0 +1,230 @@ + [ + 'google.cloud.compute.v1.PacketMirrorings' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'packet_mirroring', + 'fieldAccessors' => [ + 'getPacketMirroring', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'packet_mirroring', + 'fieldAccessors' => [ + 'getPacketMirroring', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\PacketMirroringAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\PacketMirroring', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'packet_mirroring', + 'fieldAccessors' => [ + 'getPacketMirroring', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\PacketMirroringList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/packet_mirrorings_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/packet_mirrorings_rest_client_config.php new file mode 100644 index 000000000000..c7ca42ac392a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/packet_mirrorings_rest_client_config.php @@ -0,0 +1,239 @@ + [ + 'google.cloud.compute.v1.PacketMirrorings' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/packetMirrorings', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/packetMirrorings/{packet_mirroring}', + 'placeholders' => [ + 'packet_mirroring' => [ + 'getters' => [ + 'getPacketMirroring', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/packetMirrorings/{packet_mirroring}', + 'placeholders' => [ + 'packet_mirroring' => [ + 'getters' => [ + 'getPacketMirroring', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/packetMirrorings', + 'body' => 'packet_mirroring_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/packetMirrorings', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/packetMirrorings/{packet_mirroring}', + 'body' => 'packet_mirroring_resource', + 'placeholders' => [ + 'packet_mirroring' => [ + 'getters' => [ + 'getPacketMirroring', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/packetMirrorings/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/projects_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/projects_client_config.json new file mode 100644 index 000000000000..7db219789269 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/projects_client_config.json @@ -0,0 +1,115 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Projects": { + "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": { + "DisableXpnHost": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DisableXpnResource": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "EnableXpnHost": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "EnableXpnResource": { + "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" + }, + "GetXpnHost": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetXpnResources": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListXpnHosts": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "MoveDisk": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "MoveInstance": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetCloudArmorTier": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetCommonInstanceMetadata": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetDefaultNetworkTier": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetUsageExportBucket": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/projects_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/projects_descriptor_config.php new file mode 100644 index 000000000000..e2efb3491193 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/projects_descriptor_config.php @@ -0,0 +1,342 @@ + [ + 'google.cloud.compute.v1.Projects' => [ + 'DisableXpnHost' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'DisableXpnResource' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'EnableXpnHost' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'EnableXpnResource' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'MoveDisk' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'MoveInstance' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'SetCloudArmorTier' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'SetCommonInstanceMetadata' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'SetDefaultNetworkTier' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'SetUsageExportBucket' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Project', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'GetXpnHost' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Project', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'GetXpnResources' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getResources', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\ProjectsGetXpnResources', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'ListXpnHosts' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\XpnHostList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/projects_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/projects_rest_client_config.php new file mode 100644 index 000000000000..db4625b7e3bd --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/projects_rest_client_config.php @@ -0,0 +1,263 @@ + [ + 'google.cloud.compute.v1.Projects' => [ + 'DisableXpnHost' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/disableXpnHost', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'DisableXpnResource' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/disableXpnResource', + 'body' => 'projects_disable_xpn_resource_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'EnableXpnHost' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/enableXpnHost', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'EnableXpnResource' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/enableXpnResource', + 'body' => 'projects_enable_xpn_resource_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'GetXpnHost' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/getXpnHost', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'GetXpnResources' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/getXpnResources', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'ListXpnHosts' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/listXpnHosts', + 'body' => 'projects_list_xpn_hosts_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'MoveDisk' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/moveDisk', + 'body' => 'disk_move_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'MoveInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/moveInstance', + 'body' => 'instance_move_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'SetCloudArmorTier' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/setCloudArmorTier', + 'body' => 'projects_set_cloud_armor_tier_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'SetCommonInstanceMetadata' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/setCommonInstanceMetadata', + 'body' => 'metadata_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'SetDefaultNetworkTier' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/setDefaultNetworkTier', + 'body' => 'projects_set_default_network_tier_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'SetUsageExportBucket' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/setUsageExportBucket', + 'body' => 'usage_export_location_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/public_advertised_prefixes_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/public_advertised_prefixes_client_config.json new file mode 100644 index 000000000000..249aae0c4228 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/public_advertised_prefixes_client_config.json @@ -0,0 +1,80 @@ +{ + "interfaces": { + "google.cloud.compute.v1.PublicAdvertisedPrefixes": { + "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": { + "Announce": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Withdraw": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/public_advertised_prefixes_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/public_advertised_prefixes_descriptor_config.php new file mode 100644 index 000000000000..4d238b93cd73 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/public_advertised_prefixes_descriptor_config.php @@ -0,0 +1,215 @@ + [ + 'google.cloud.compute.v1.PublicAdvertisedPrefixes' => [ + 'Announce' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'public_advertised_prefix', + 'fieldAccessors' => [ + 'getPublicAdvertisedPrefix', + ], + ], + ], + ], + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'public_advertised_prefix', + 'fieldAccessors' => [ + 'getPublicAdvertisedPrefix', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'public_advertised_prefix', + 'fieldAccessors' => [ + 'getPublicAdvertisedPrefix', + ], + ], + ], + ], + 'Withdraw' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'public_advertised_prefix', + 'fieldAccessors' => [ + 'getPublicAdvertisedPrefix', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\PublicAdvertisedPrefix', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'public_advertised_prefix', + 'fieldAccessors' => [ + 'getPublicAdvertisedPrefix', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\PublicAdvertisedPrefixList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/public_advertised_prefixes_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/public_advertised_prefixes_rest_client_config.php new file mode 100644 index 000000000000..33cbe8ac9675 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/public_advertised_prefixes_rest_client_config.php @@ -0,0 +1,204 @@ + [ + 'google.cloud.compute.v1.PublicAdvertisedPrefixes' => [ + 'Announce' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/publicAdvertisedPrefixes/{public_advertised_prefix}/announce', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'public_advertised_prefix' => [ + 'getters' => [ + 'getPublicAdvertisedPrefix', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/publicAdvertisedPrefixes/{public_advertised_prefix}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'public_advertised_prefix' => [ + 'getters' => [ + 'getPublicAdvertisedPrefix', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/publicAdvertisedPrefixes/{public_advertised_prefix}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'public_advertised_prefix' => [ + 'getters' => [ + 'getPublicAdvertisedPrefix', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/publicAdvertisedPrefixes', + 'body' => 'public_advertised_prefix_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/publicAdvertisedPrefixes', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/global/publicAdvertisedPrefixes/{public_advertised_prefix}', + 'body' => 'public_advertised_prefix_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'public_advertised_prefix' => [ + 'getters' => [ + 'getPublicAdvertisedPrefix', + ], + ], + ], + ], + 'Withdraw' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/publicAdvertisedPrefixes/{public_advertised_prefix}/withdraw', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'public_advertised_prefix' => [ + 'getters' => [ + 'getPublicAdvertisedPrefix', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/public_delegated_prefixes_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/public_delegated_prefixes_client_config.json new file mode 100644 index 000000000000..d9820b7e251b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/public_delegated_prefixes_client_config.json @@ -0,0 +1,85 @@ +{ + "interfaces": { + "google.cloud.compute.v1.PublicDelegatedPrefixes": { + "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": { + "AggregatedList": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "Announce": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Withdraw": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/public_delegated_prefixes_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/public_delegated_prefixes_descriptor_config.php new file mode 100644 index 000000000000..9aa9e516d86b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/public_delegated_prefixes_descriptor_config.php @@ -0,0 +1,282 @@ + [ + 'google.cloud.compute.v1.PublicDelegatedPrefixes' => [ + 'Announce' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'public_delegated_prefix', + 'fieldAccessors' => [ + 'getPublicDelegatedPrefix', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'public_delegated_prefix', + 'fieldAccessors' => [ + 'getPublicDelegatedPrefix', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'public_delegated_prefix', + 'fieldAccessors' => [ + 'getPublicDelegatedPrefix', + ], + ], + ], + ], + 'Withdraw' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'public_delegated_prefix', + 'fieldAccessors' => [ + 'getPublicDelegatedPrefix', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\PublicDelegatedPrefixAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\PublicDelegatedPrefix', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'public_delegated_prefix', + 'fieldAccessors' => [ + 'getPublicDelegatedPrefix', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\PublicDelegatedPrefixList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/public_delegated_prefixes_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/public_delegated_prefixes_rest_client_config.php new file mode 100644 index 000000000000..12ced9d5ac24 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/public_delegated_prefixes_rest_client_config.php @@ -0,0 +1,259 @@ + [ + 'google.cloud.compute.v1.PublicDelegatedPrefixes' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/publicDelegatedPrefixes', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Announce' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/publicDelegatedPrefixes/{public_delegated_prefix}/announce', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'public_delegated_prefix' => [ + 'getters' => [ + 'getPublicDelegatedPrefix', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/publicDelegatedPrefixes/{public_delegated_prefix}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'public_delegated_prefix' => [ + 'getters' => [ + 'getPublicDelegatedPrefix', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/publicDelegatedPrefixes/{public_delegated_prefix}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'public_delegated_prefix' => [ + 'getters' => [ + 'getPublicDelegatedPrefix', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/publicDelegatedPrefixes', + 'body' => 'public_delegated_prefix_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/publicDelegatedPrefixes', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/publicDelegatedPrefixes/{public_delegated_prefix}', + 'body' => 'public_delegated_prefix_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'public_delegated_prefix' => [ + 'getters' => [ + 'getPublicDelegatedPrefix', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Withdraw' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/publicDelegatedPrefixes/{public_delegated_prefix}/withdraw', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'public_delegated_prefix' => [ + 'getters' => [ + 'getPublicDelegatedPrefix', + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_autoscalers_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_autoscalers_client_config.json new file mode 100644 index 000000000000..120342a41c47 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_autoscalers_client_config.json @@ -0,0 +1,75 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionAutoscalers": { + "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" + }, + "Patch": { + "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/owl-bot-staging/Compute/V1/src/V1/resources/region_autoscalers_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_autoscalers_descriptor_config.php new file mode 100644 index 000000000000..9e56a76ba767 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_autoscalers_descriptor_config.php @@ -0,0 +1,212 @@ + [ + 'google.cloud.compute.v1.RegionAutoscalers' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'autoscaler', + 'fieldAccessors' => [ + 'getAutoscaler', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Autoscaler', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'autoscaler', + 'fieldAccessors' => [ + 'getAutoscaler', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\RegionAutoscalerList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_autoscalers_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_autoscalers_rest_client_config.php new file mode 100644 index 000000000000..aa8825529066 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_autoscalers_rest_client_config.php @@ -0,0 +1,218 @@ + [ + 'google.cloud.compute.v1.RegionAutoscalers' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/autoscalers/{autoscaler}', + 'placeholders' => [ + 'autoscaler' => [ + 'getters' => [ + 'getAutoscaler', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/autoscalers/{autoscaler}', + 'placeholders' => [ + 'autoscaler' => [ + 'getters' => [ + 'getAutoscaler', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/autoscalers', + 'body' => 'autoscaler_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/autoscalers', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/autoscalers', + 'body' => 'autoscaler_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Update' => [ + 'method' => 'put', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/autoscalers', + 'body' => 'autoscaler_resource', + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_backend_services_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_backend_services_client_config.json new file mode 100644 index 000000000000..1296f023ba47 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_backend_services_client_config.json @@ -0,0 +1,105 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionBackendServices": { + "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" + }, + "GetHealth": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetIamPolicy": { + "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" + }, + "ListUsable": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetSecurityPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "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/owl-bot-staging/Compute/V1/src/V1/resources/region_backend_services_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_backend_services_descriptor_config.php new file mode 100644 index 000000000000..8cf59faa6aa7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_backend_services_descriptor_config.php @@ -0,0 +1,384 @@ + [ + 'google.cloud.compute.v1.RegionBackendServices' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'backend_service', + 'fieldAccessors' => [ + 'getBackendService', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'backend_service', + 'fieldAccessors' => [ + 'getBackendService', + ], + ], + ], + ], + 'SetSecurityPolicy' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'backend_service', + 'fieldAccessors' => [ + 'getBackendService', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'backend_service', + 'fieldAccessors' => [ + 'getBackendService', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\BackendService', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'backend_service', + 'fieldAccessors' => [ + 'getBackendService', + ], + ], + ], + ], + 'GetHealth' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\BackendServiceGroupHealth', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'backend_service', + 'fieldAccessors' => [ + 'getBackendService', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\BackendServiceList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'ListUsable' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\BackendServiceListUsable', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_backend_services_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_backend_services_rest_client_config.php new file mode 100644 index 000000000000..20111fdff857 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_backend_services_rest_client_config.php @@ -0,0 +1,353 @@ + [ + 'google.cloud.compute.v1.RegionBackendServices' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/backendServices/{backend_service}', + 'placeholders' => [ + 'backend_service' => [ + 'getters' => [ + 'getBackendService', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/backendServices/{backend_service}', + 'placeholders' => [ + 'backend_service' => [ + 'getters' => [ + 'getBackendService', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'GetHealth' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/backendServices/{backend_service}/getHealth', + 'body' => 'resource_group_reference_resource', + 'placeholders' => [ + 'backend_service' => [ + 'getters' => [ + 'getBackendService', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/backendServices/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/backendServices', + 'body' => 'backend_service_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/backendServices', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'ListUsable' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/backendServices/listUsable', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/backendServices/{backend_service}', + 'body' => 'backend_service_resource', + 'placeholders' => [ + 'backend_service' => [ + 'getters' => [ + 'getBackendService', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/backendServices/{resource}/setIamPolicy', + 'body' => 'region_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetSecurityPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/backendServices/{backend_service}/setSecurityPolicy', + 'body' => 'security_policy_reference_resource', + 'placeholders' => [ + 'backend_service' => [ + 'getters' => [ + 'getBackendService', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/backendServices/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'Update' => [ + 'method' => 'put', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/backendServices/{backend_service}', + 'body' => 'backend_service_resource', + 'placeholders' => [ + 'backend_service' => [ + 'getters' => [ + 'getBackendService', + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_commitments_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_commitments_client_config.json new file mode 100644 index 000000000000..9fa460da01d3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_commitments_client_config.json @@ -0,0 +1,70 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionCommitments": { + "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": { + "AggregatedList": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_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" + }, + "Update": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_commitments_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_commitments_descriptor_config.php new file mode 100644 index 000000000000..d301f8eaa33c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_commitments_descriptor_config.php @@ -0,0 +1,168 @@ + [ + 'google.cloud.compute.v1.RegionCommitments' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'commitment', + 'fieldAccessors' => [ + 'getCommitment', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\CommitmentAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Commitment', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'commitment', + 'fieldAccessors' => [ + 'getCommitment', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\CommitmentList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_commitments_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_commitments_rest_client_config.php new file mode 100644 index 000000000000..5e07d5490ec2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_commitments_rest_client_config.php @@ -0,0 +1,196 @@ + [ + 'google.cloud.compute.v1.RegionCommitments' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/commitments', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/commitments/{commitment}', + 'placeholders' => [ + 'commitment' => [ + 'getters' => [ + 'getCommitment', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/commitments', + 'body' => 'commitment_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/commitments', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Update' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/commitments/{commitment}', + 'body' => 'commitment_resource', + 'placeholders' => [ + 'commitment' => [ + 'getters' => [ + 'getCommitment', + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_disk_types_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_disk_types_client_config.json new file mode 100644 index 000000000000..dd8a210b1505 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_disk_types_client_config.json @@ -0,0 +1,45 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionDiskTypes": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "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 + } + }, + "methods": { + "Get": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "List": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_disk_types_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_disk_types_descriptor_config.php new file mode 100644 index 000000000000..7e4585b9b87d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_disk_types_descriptor_config.php @@ -0,0 +1,78 @@ + [ + 'google.cloud.compute.v1.RegionDiskTypes' => [ + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\DiskType', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'disk_type', + 'fieldAccessors' => [ + 'getDiskType', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\RegionDiskTypeList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_disk_types_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_disk_types_rest_client_config.php new file mode 100644 index 000000000000..37f3ae33a8bd --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_disk_types_rest_client_config.php @@ -0,0 +1,65 @@ + [ + 'google.cloud.compute.v1.RegionDiskTypes' => [ + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/diskTypes/{disk_type}', + 'placeholders' => [ + 'disk_type' => [ + 'getters' => [ + 'getDiskType', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/diskTypes', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_disks_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_disks_client_config.json new file mode 100644 index 000000000000..3bba57f98258 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_disks_client_config.json @@ -0,0 +1,130 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionDisks": { + "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": { + "AddResourcePolicies": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "BulkInsert": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateSnapshot": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "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" + }, + "GetIamPolicy": { + "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" + }, + "RemoveResourcePolicies": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Resize": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetLabels": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "StartAsyncReplication": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "StopAsyncReplication": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "StopGroupAsyncReplication": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "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/owl-bot-staging/Compute/V1/src/V1/resources/region_disks_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_disks_descriptor_config.php new file mode 100644 index 000000000000..0e2e95ba6b3a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_disks_descriptor_config.php @@ -0,0 +1,588 @@ + [ + 'google.cloud.compute.v1.RegionDisks' => [ + 'AddResourcePolicies' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'disk', + 'fieldAccessors' => [ + 'getDisk', + ], + ], + ], + ], + 'BulkInsert' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'CreateSnapshot' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'disk', + 'fieldAccessors' => [ + 'getDisk', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'disk', + 'fieldAccessors' => [ + 'getDisk', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'RemoveResourcePolicies' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'disk', + 'fieldAccessors' => [ + 'getDisk', + ], + ], + ], + ], + 'Resize' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'disk', + 'fieldAccessors' => [ + 'getDisk', + ], + ], + ], + ], + 'SetLabels' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'StartAsyncReplication' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'disk', + 'fieldAccessors' => [ + 'getDisk', + ], + ], + ], + ], + 'StopAsyncReplication' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'disk', + 'fieldAccessors' => [ + 'getDisk', + ], + ], + ], + ], + 'StopGroupAsyncReplication' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'disk', + 'fieldAccessors' => [ + 'getDisk', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Disk', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'disk', + 'fieldAccessors' => [ + 'getDisk', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\DiskList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_disks_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_disks_rest_client_config.php new file mode 100644 index 000000000000..e4b64d4bc054 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_disks_rest_client_config.php @@ -0,0 +1,458 @@ + [ + 'google.cloud.compute.v1.RegionDisks' => [ + 'AddResourcePolicies' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/disks/{disk}/addResourcePolicies', + 'body' => 'region_disks_add_resource_policies_request_resource', + 'placeholders' => [ + 'disk' => [ + 'getters' => [ + 'getDisk', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'BulkInsert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/disks/bulkInsert', + 'body' => 'bulk_insert_disk_resource_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'CreateSnapshot' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/disks/{disk}/createSnapshot', + 'body' => 'snapshot_resource', + 'placeholders' => [ + 'disk' => [ + 'getters' => [ + 'getDisk', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/disks/{disk}', + 'placeholders' => [ + 'disk' => [ + 'getters' => [ + 'getDisk', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/disks/{disk}', + 'placeholders' => [ + 'disk' => [ + 'getters' => [ + 'getDisk', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/disks/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/disks', + 'body' => 'disk_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/disks', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'RemoveResourcePolicies' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/disks/{disk}/removeResourcePolicies', + 'body' => 'region_disks_remove_resource_policies_request_resource', + 'placeholders' => [ + 'disk' => [ + 'getters' => [ + 'getDisk', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Resize' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/disks/{disk}/resize', + 'body' => 'region_disks_resize_request_resource', + 'placeholders' => [ + 'disk' => [ + 'getters' => [ + 'getDisk', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/disks/{resource}/setIamPolicy', + 'body' => 'region_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetLabels' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/disks/{resource}/setLabels', + 'body' => 'region_set_labels_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'StartAsyncReplication' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/disks/{disk}/startAsyncReplication', + 'body' => 'region_disks_start_async_replication_request_resource', + 'placeholders' => [ + 'disk' => [ + 'getters' => [ + 'getDisk', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'StopAsyncReplication' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/disks/{disk}/stopAsyncReplication', + 'placeholders' => [ + 'disk' => [ + 'getters' => [ + 'getDisk', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'StopGroupAsyncReplication' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/disks/stopGroupAsyncReplication', + 'body' => 'disks_stop_group_async_replication_resource_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/disks/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + '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' => [ + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_health_check_services_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_health_check_services_client_config.json new file mode 100644 index 000000000000..48130e4b06b2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_health_check_services_client_config.json @@ -0,0 +1,70 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionHealthCheckServices": { + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_health_check_services_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_health_check_services_descriptor_config.php new file mode 100644 index 000000000000..06e06df7d0b7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_health_check_services_descriptor_config.php @@ -0,0 +1,186 @@ + [ + 'google.cloud.compute.v1.RegionHealthCheckServices' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'health_check_service', + 'fieldAccessors' => [ + 'getHealthCheckService', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'health_check_service', + 'fieldAccessors' => [ + 'getHealthCheckService', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\HealthCheckService', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'health_check_service', + 'fieldAccessors' => [ + 'getHealthCheckService', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\HealthCheckServicesList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_health_check_services_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_health_check_services_rest_client_config.php new file mode 100644 index 000000000000..ad2da6b16e7f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_health_check_services_rest_client_config.php @@ -0,0 +1,206 @@ + [ + 'google.cloud.compute.v1.RegionHealthCheckServices' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/healthCheckServices/{health_check_service}', + 'placeholders' => [ + 'health_check_service' => [ + 'getters' => [ + 'getHealthCheckService', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/healthCheckServices/{health_check_service}', + 'placeholders' => [ + 'health_check_service' => [ + 'getters' => [ + 'getHealthCheckService', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/healthCheckServices', + 'body' => 'health_check_service_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/healthCheckServices', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/healthCheckServices/{health_check_service}', + 'body' => 'health_check_service_resource', + 'placeholders' => [ + 'health_check_service' => [ + 'getters' => [ + 'getHealthCheckService', + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_health_checks_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_health_checks_client_config.json new file mode 100644 index 000000000000..004065f8917a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_health_checks_client_config.json @@ -0,0 +1,75 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionHealthChecks": { + "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" + }, + "Patch": { + "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/owl-bot-staging/Compute/V1/src/V1/resources/region_health_checks_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_health_checks_descriptor_config.php new file mode 100644 index 000000000000..8c4c1fdd3d13 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_health_checks_descriptor_config.php @@ -0,0 +1,224 @@ + [ + 'google.cloud.compute.v1.RegionHealthChecks' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'health_check', + 'fieldAccessors' => [ + 'getHealthCheck', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'health_check', + 'fieldAccessors' => [ + 'getHealthCheck', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'health_check', + 'fieldAccessors' => [ + 'getHealthCheck', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\HealthCheck', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'health_check', + 'fieldAccessors' => [ + 'getHealthCheck', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\HealthCheckList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_health_checks_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_health_checks_rest_client_config.php new file mode 100644 index 000000000000..137f3b7f2cd6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_health_checks_rest_client_config.php @@ -0,0 +1,228 @@ + [ + 'google.cloud.compute.v1.RegionHealthChecks' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/healthChecks/{health_check}', + 'placeholders' => [ + 'health_check' => [ + 'getters' => [ + 'getHealthCheck', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/healthChecks/{health_check}', + 'placeholders' => [ + 'health_check' => [ + 'getters' => [ + 'getHealthCheck', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/healthChecks', + 'body' => 'health_check_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/healthChecks', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/healthChecks/{health_check}', + 'body' => 'health_check_resource', + 'placeholders' => [ + 'health_check' => [ + 'getters' => [ + 'getHealthCheck', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Update' => [ + 'method' => 'put', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/healthChecks/{health_check}', + 'body' => 'health_check_resource', + 'placeholders' => [ + 'health_check' => [ + 'getters' => [ + 'getHealthCheck', + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_group_managers_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_group_managers_client_config.json new file mode 100644 index 000000000000..835ab6c866c4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_group_managers_client_config.json @@ -0,0 +1,140 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionInstanceGroupManagers": { + "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": { + "AbandonInstances": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ApplyUpdatesToInstances": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CreateInstances": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Delete": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteInstances": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeletePerInstanceConfigs": { + "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" + }, + "ListErrors": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListManagedInstances": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListPerInstanceConfigs": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "PatchPerInstanceConfigs": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RecreateInstances": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Resize": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetInstanceTemplate": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetTargetPools": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "UpdatePerInstanceConfigs": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_group_managers_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_group_managers_descriptor_config.php new file mode 100644 index 000000000000..ffbe58f22d12 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_group_managers_descriptor_config.php @@ -0,0 +1,700 @@ + [ + 'google.cloud.compute.v1.RegionInstanceGroupManagers' => [ + 'AbandonInstances' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'ApplyUpdatesToInstances' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'CreateInstances' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'DeleteInstances' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'DeletePerInstanceConfigs' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'PatchPerInstanceConfigs' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'RecreateInstances' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'Resize' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'SetInstanceTemplate' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'SetTargetPools' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'UpdatePerInstanceConfigs' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceGroupManager', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\RegionInstanceGroupManagerList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'ListErrors' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\RegionInstanceGroupManagersListErrorsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'ListManagedInstances' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getManagedInstances', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\RegionInstanceGroupManagersListInstancesResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + 'ListPerInstanceConfigs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\RegionInstanceGroupManagersListInstanceConfigsResp', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instance_group_manager', + 'fieldAccessors' => [ + 'getInstanceGroupManager', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_group_managers_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_group_managers_rest_client_config.php new file mode 100644 index 000000000000..a20fa10e6e76 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_group_managers_rest_client_config.php @@ -0,0 +1,513 @@ + [ + 'google.cloud.compute.v1.RegionInstanceGroupManagers' => [ + 'AbandonInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/abandonInstances', + 'body' => 'region_instance_group_managers_abandon_instances_request_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'ApplyUpdatesToInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/applyUpdatesToInstances', + 'body' => 'region_instance_group_managers_apply_updates_request_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'CreateInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/createInstances', + 'body' => 'region_instance_group_managers_create_instances_request_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'DeleteInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/deleteInstances', + 'body' => 'region_instance_group_managers_delete_instances_request_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'DeletePerInstanceConfigs' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/deletePerInstanceConfigs', + 'body' => 'region_instance_group_manager_delete_instance_config_req_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers', + 'body' => 'instance_group_manager_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'ListErrors' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/listErrors', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'ListManagedInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/listManagedInstances', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'ListPerInstanceConfigs' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/listPerInstanceConfigs', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}', + 'body' => 'instance_group_manager_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'PatchPerInstanceConfigs' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/patchPerInstanceConfigs', + 'body' => 'region_instance_group_manager_patch_instance_config_req_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'RecreateInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/recreateInstances', + 'body' => 'region_instance_group_managers_recreate_request_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Resize' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/resize', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + 'queryParams' => [ + 'size', + ], + ], + 'SetInstanceTemplate' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/setInstanceTemplate', + 'body' => 'region_instance_group_managers_set_template_request_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'SetTargetPools' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/setTargetPools', + 'body' => 'region_instance_group_managers_set_target_pools_request_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'UpdatePerInstanceConfigs' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/updatePerInstanceConfigs', + 'body' => 'region_instance_group_manager_update_instance_config_req_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_groups_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_groups_client_config.json new file mode 100644 index 000000000000..4e9dc158d6f9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_groups_client_config.json @@ -0,0 +1,65 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionInstanceGroups": { + "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": { + "Get": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "List": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListInstances": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetNamedPorts": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_groups_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_groups_descriptor_config.php new file mode 100644 index 000000000000..5af30f171591 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_groups_descriptor_config.php @@ -0,0 +1,148 @@ + [ + 'google.cloud.compute.v1.RegionInstanceGroups' => [ + 'SetNamedPorts' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instance_group', + 'fieldAccessors' => [ + 'getInstanceGroup', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceGroup', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instance_group', + 'fieldAccessors' => [ + 'getInstanceGroup', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\RegionInstanceGroupList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'ListInstances' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\RegionInstanceGroupsListInstances', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instance_group', + 'fieldAccessors' => [ + 'getInstanceGroup', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_groups_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_groups_rest_client_config.php new file mode 100644 index 000000000000..9a911532edd0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_groups_rest_client_config.php @@ -0,0 +1,190 @@ + [ + 'google.cloud.compute.v1.RegionInstanceGroups' => [ + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroups/{instance_group}', + 'placeholders' => [ + 'instance_group' => [ + 'getters' => [ + 'getInstanceGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroups', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'ListInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroups/{instance_group}/listInstances', + 'body' => 'region_instance_groups_list_instances_request_resource', + 'placeholders' => [ + 'instance_group' => [ + 'getters' => [ + 'getInstanceGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'SetNamedPorts' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroups/{instance_group}/setNamedPorts', + 'body' => 'region_instance_groups_set_named_ports_request_resource', + 'placeholders' => [ + 'instance_group' => [ + 'getters' => [ + 'getInstanceGroup', + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_templates_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_templates_client_config.json new file mode 100644 index 000000000000..fb8e7b79d31f --- /dev/null +++ b/owl-bot-staging/Compute/V1/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/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_templates_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_templates_descriptor_config.php new file mode 100644 index 000000000000..41b569be292c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_templates_descriptor_config.php @@ -0,0 +1,148 @@ + [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instance_template', + 'fieldAccessors' => [ + 'getInstanceTemplate', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceTemplate', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instance_template', + 'fieldAccessors' => [ + 'getInstanceTemplate', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstanceTemplateList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_templates_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_templates_rest_client_config.php new file mode 100644 index 000000000000..33dcab1f0b23 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_templates_rest_client_config.php @@ -0,0 +1,184 @@ + [ + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_instances_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_instances_client_config.json new file mode 100644 index 000000000000..e3b5310ac37d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_instances_client_config.json @@ -0,0 +1,37 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionInstances": { + "retry_codes": { + "no_retry_codes": [], + "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 + }, + "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": { + "BulkInsert": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_instances_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_instances_descriptor_config.php new file mode 100644 index 000000000000..55eb355aa382 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_instances_descriptor_config.php @@ -0,0 +1,60 @@ + [ + 'google.cloud.compute.v1.RegionInstances' => [ + 'BulkInsert' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_instances_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_instances_rest_client_config.php new file mode 100644 index 000000000000..68cab5a92197 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_instances_rest_client_config.php @@ -0,0 +1,126 @@ + [ + 'google.cloud.compute.v1.RegionInstances' => [ + 'BulkInsert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instances/bulkInsert', + 'body' => 'bulk_insert_instance_resource_resource', + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_instant_snapshots_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_instant_snapshots_client_config.json new file mode 100644 index 000000000000..625a714f501e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_instant_snapshots_client_config.json @@ -0,0 +1,85 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionInstantSnapshots": { + "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" + }, + "GetIamPolicy": { + "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" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetLabels": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_instant_snapshots_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_instant_snapshots_descriptor_config.php new file mode 100644 index 000000000000..f5acc7ccfd38 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_instant_snapshots_descriptor_config.php @@ -0,0 +1,258 @@ + [ + 'google.cloud.compute.v1.RegionInstantSnapshots' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instant_snapshot', + 'fieldAccessors' => [ + 'getInstantSnapshot', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'SetLabels' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstantSnapshot', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'instant_snapshot', + 'fieldAccessors' => [ + 'getInstantSnapshot', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\InstantSnapshotList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_instant_snapshots_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_instant_snapshots_rest_client_config.php new file mode 100644 index 000000000000..baf56358885e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_instant_snapshots_rest_client_config.php @@ -0,0 +1,271 @@ + [ + 'google.cloud.compute.v1.RegionInstantSnapshots' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instantSnapshots/{instant_snapshot}', + 'placeholders' => [ + 'instant_snapshot' => [ + 'getters' => [ + 'getInstantSnapshot', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instantSnapshots/{instant_snapshot}', + 'placeholders' => [ + 'instant_snapshot' => [ + 'getters' => [ + 'getInstantSnapshot', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instantSnapshots/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instantSnapshots', + 'body' => 'instant_snapshot_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instantSnapshots', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instantSnapshots/{resource}/setIamPolicy', + 'body' => 'region_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetLabels' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instantSnapshots/{resource}/setLabels', + 'body' => 'region_set_labels_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instantSnapshots/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_network_endpoint_groups_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_network_endpoint_groups_client_config.json new file mode 100644 index 000000000000..0e8d4bfca93b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_network_endpoint_groups_client_config.json @@ -0,0 +1,80 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionNetworkEndpointGroups": { + "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": { + "AttachNetworkEndpoints": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Delete": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DetachNetworkEndpoints": { + "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" + }, + "ListNetworkEndpoints": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_network_endpoint_groups_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_network_endpoint_groups_descriptor_config.php new file mode 100644 index 000000000000..48a384a5e3ee --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_network_endpoint_groups_descriptor_config.php @@ -0,0 +1,256 @@ + [ + 'google.cloud.compute.v1.RegionNetworkEndpointGroups' => [ + 'AttachNetworkEndpoints' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'network_endpoint_group', + 'fieldAccessors' => [ + 'getNetworkEndpointGroup', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'network_endpoint_group', + 'fieldAccessors' => [ + 'getNetworkEndpointGroup', + ], + ], + ], + ], + 'DetachNetworkEndpoints' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'network_endpoint_group', + 'fieldAccessors' => [ + 'getNetworkEndpointGroup', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NetworkEndpointGroup', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'network_endpoint_group', + 'fieldAccessors' => [ + 'getNetworkEndpointGroup', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NetworkEndpointGroupList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'ListNetworkEndpoints' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NetworkEndpointGroupsListNetworkEndpoints', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'network_endpoint_group', + 'fieldAccessors' => [ + 'getNetworkEndpointGroup', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_network_endpoint_groups_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_network_endpoint_groups_rest_client_config.php new file mode 100644 index 000000000000..623475c02856 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_network_endpoint_groups_rest_client_config.php @@ -0,0 +1,249 @@ + [ + 'google.cloud.compute.v1.RegionNetworkEndpointGroups' => [ + 'AttachNetworkEndpoints' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/networkEndpointGroups/{network_endpoint_group}/attachNetworkEndpoints', + 'body' => 'region_network_endpoint_groups_attach_endpoints_request_resource', + 'placeholders' => [ + 'network_endpoint_group' => [ + 'getters' => [ + 'getNetworkEndpointGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/networkEndpointGroups/{network_endpoint_group}', + 'placeholders' => [ + 'network_endpoint_group' => [ + 'getters' => [ + 'getNetworkEndpointGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'DetachNetworkEndpoints' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/networkEndpointGroups/{network_endpoint_group}/detachNetworkEndpoints', + 'body' => 'region_network_endpoint_groups_detach_endpoints_request_resource', + 'placeholders' => [ + 'network_endpoint_group' => [ + 'getters' => [ + 'getNetworkEndpointGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/networkEndpointGroups/{network_endpoint_group}', + 'placeholders' => [ + 'network_endpoint_group' => [ + 'getters' => [ + 'getNetworkEndpointGroup', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/networkEndpointGroups', + 'body' => 'network_endpoint_group_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/networkEndpointGroups', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'ListNetworkEndpoints' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/networkEndpointGroups/{network_endpoint_group}/listNetworkEndpoints', + 'placeholders' => [ + 'network_endpoint_group' => [ + 'getters' => [ + 'getNetworkEndpointGroup', + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_network_firewall_policies_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_network_firewall_policies_client_config.json new file mode 100644 index 000000000000..3a20d16c3a91 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_network_firewall_policies_client_config.json @@ -0,0 +1,130 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionNetworkFirewallPolicies": { + "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": { + "AddAssociation": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "AddRule": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CloneRules": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "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" + }, + "GetAssociation": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetEffectiveFirewalls": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetRule": { + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "PatchRule": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RemoveAssociation": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RemoveRule": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_network_firewall_policies_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_network_firewall_policies_descriptor_config.php new file mode 100644 index 000000000000..b81470041d5f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_network_firewall_policies_descriptor_config.php @@ -0,0 +1,552 @@ + [ + 'google.cloud.compute.v1.RegionNetworkFirewallPolicies' => [ + 'AddAssociation' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'AddRule' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'CloneRules' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'PatchRule' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'RemoveAssociation' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'RemoveRule' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\FirewallPolicy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'GetAssociation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\FirewallPolicyAssociation', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'GetEffectiveFirewalls' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'GetRule' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\FirewallPolicyRule', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'firewall_policy', + 'fieldAccessors' => [ + 'getFirewallPolicy', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\FirewallPolicyList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_network_firewall_policies_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_network_firewall_policies_rest_client_config.php new file mode 100644 index 000000000000..b7af731f1388 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_network_firewall_policies_rest_client_config.php @@ -0,0 +1,461 @@ + [ + 'google.cloud.compute.v1.RegionNetworkFirewallPolicies' => [ + 'AddAssociation' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/firewallPolicies/{firewall_policy}/addAssociation', + 'body' => 'firewall_policy_association_resource', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'AddRule' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/firewallPolicies/{firewall_policy}/addRule', + 'body' => 'firewall_policy_rule_resource', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'CloneRules' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/firewallPolicies/{firewall_policy}/cloneRules', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/firewallPolicies/{firewall_policy}', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/firewallPolicies/{firewall_policy}', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'GetAssociation' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/firewallPolicies/{firewall_policy}/getAssociation', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'GetEffectiveFirewalls' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/firewallPolicies/getEffectiveFirewalls', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + 'queryParams' => [ + 'network', + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/firewallPolicies/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'GetRule' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/firewallPolicies/{firewall_policy}/getRule', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/firewallPolicies', + 'body' => 'firewall_policy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/firewallPolicies', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/firewallPolicies/{firewall_policy}', + 'body' => 'firewall_policy_resource', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'PatchRule' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/firewallPolicies/{firewall_policy}/patchRule', + 'body' => 'firewall_policy_rule_resource', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'RemoveAssociation' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/firewallPolicies/{firewall_policy}/removeAssociation', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'RemoveRule' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/firewallPolicies/{firewall_policy}/removeRule', + 'placeholders' => [ + 'firewall_policy' => [ + 'getters' => [ + 'getFirewallPolicy', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/firewallPolicies/{resource}/setIamPolicy', + 'body' => 'region_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/firewallPolicies/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_notification_endpoints_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_notification_endpoints_client_config.json new file mode 100644 index 000000000000..5a2c587a02da --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_notification_endpoints_client_config.json @@ -0,0 +1,65 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionNotificationEndpoints": { + "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/owl-bot-staging/Compute/V1/src/V1/resources/region_notification_endpoints_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_notification_endpoints_descriptor_config.php new file mode 100644 index 000000000000..a89277a203c8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_notification_endpoints_descriptor_config.php @@ -0,0 +1,148 @@ + [ + 'google.cloud.compute.v1.RegionNotificationEndpoints' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'notification_endpoint', + 'fieldAccessors' => [ + 'getNotificationEndpoint', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NotificationEndpoint', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'notification_endpoint', + 'fieldAccessors' => [ + 'getNotificationEndpoint', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NotificationEndpointList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_notification_endpoints_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_notification_endpoints_rest_client_config.php new file mode 100644 index 000000000000..3c9bd94ba3b0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_notification_endpoints_rest_client_config.php @@ -0,0 +1,184 @@ + [ + 'google.cloud.compute.v1.RegionNotificationEndpoints' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/notificationEndpoints/{notification_endpoint}', + 'placeholders' => [ + 'notification_endpoint' => [ + 'getters' => [ + 'getNotificationEndpoint', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/notificationEndpoints/{notification_endpoint}', + 'placeholders' => [ + 'notification_endpoint' => [ + 'getters' => [ + 'getNotificationEndpoint', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/notificationEndpoints', + 'body' => 'notification_endpoint_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/notificationEndpoints', + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_operations_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_operations_client_config.json new file mode 100644 index 000000000000..b580d648de00 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_operations_client_config.json @@ -0,0 +1,65 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionOperations": { + "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" + }, + "List": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "Wait": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_operations_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_operations_descriptor_config.php new file mode 100644 index 000000000000..c6edc1d2bc15 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_operations_descriptor_config.php @@ -0,0 +1,126 @@ + [ + 'google.cloud.compute.v1.RegionOperations' => [ + 'Delete' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\DeleteRegionOperationResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'operation', + 'fieldAccessors' => [ + 'getOperation', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'operation', + 'fieldAccessors' => [ + 'getOperation', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\OperationList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Wait' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'operation', + 'fieldAccessors' => [ + 'getOperation', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_operations_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_operations_rest_client_config.php new file mode 100644 index 000000000000..9cc1aa619923 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_operations_rest_client_config.php @@ -0,0 +1,107 @@ + [ + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_security_policies_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_security_policies_client_config.json new file mode 100644 index 000000000000..29353c33df61 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_security_policies_client_config.json @@ -0,0 +1,90 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionSecurityPolicies": { + "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": { + "AddRule": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "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" + }, + "GetRule": { + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "PatchRule": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RemoveRule": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_security_policies_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_security_policies_descriptor_config.php new file mode 100644 index 000000000000..86b26739f51b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_security_policies_descriptor_config.php @@ -0,0 +1,324 @@ + [ + 'google.cloud.compute.v1.RegionSecurityPolicies' => [ + 'AddRule' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'security_policy', + 'fieldAccessors' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'security_policy', + 'fieldAccessors' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'security_policy', + 'fieldAccessors' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'PatchRule' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'security_policy', + 'fieldAccessors' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'RemoveRule' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'security_policy', + 'fieldAccessors' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SecurityPolicy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'security_policy', + 'fieldAccessors' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'GetRule' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SecurityPolicyRule', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'security_policy', + 'fieldAccessors' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SecurityPolicyList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_security_policies_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_security_policies_rest_client_config.php new file mode 100644 index 000000000000..6682f16c85f7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_security_policies_rest_client_config.php @@ -0,0 +1,292 @@ + [ + 'google.cloud.compute.v1.RegionSecurityPolicies' => [ + 'AddRule' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/securityPolicies/{security_policy}/addRule', + 'body' => 'security_policy_rule_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'security_policy' => [ + 'getters' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/securityPolicies/{security_policy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'security_policy' => [ + 'getters' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/securityPolicies/{security_policy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'security_policy' => [ + 'getters' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'GetRule' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/securityPolicies/{security_policy}/getRule', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'security_policy' => [ + 'getters' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/securityPolicies', + 'body' => 'security_policy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/securityPolicies', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/securityPolicies/{security_policy}', + 'body' => 'security_policy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'security_policy' => [ + 'getters' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'PatchRule' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/securityPolicies/{security_policy}/patchRule', + 'body' => 'security_policy_rule_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'security_policy' => [ + 'getters' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'RemoveRule' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/securityPolicies/{security_policy}/removeRule', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'security_policy' => [ + 'getters' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_certificates_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_certificates_client_config.json new file mode 100644 index 000000000000..73a455002734 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_certificates_client_config.json @@ -0,0 +1,65 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionSslCertificates": { + "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/owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_certificates_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_certificates_descriptor_config.php new file mode 100644 index 000000000000..05d610ccb8d5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_certificates_descriptor_config.php @@ -0,0 +1,148 @@ + [ + 'google.cloud.compute.v1.RegionSslCertificates' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'ssl_certificate', + 'fieldAccessors' => [ + 'getSslCertificate', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SslCertificate', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'ssl_certificate', + 'fieldAccessors' => [ + 'getSslCertificate', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SslCertificateList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_certificates_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_certificates_rest_client_config.php new file mode 100644 index 000000000000..3323a159629b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_certificates_rest_client_config.php @@ -0,0 +1,184 @@ + [ + 'google.cloud.compute.v1.RegionSslCertificates' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/sslCertificates/{ssl_certificate}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'ssl_certificate' => [ + 'getters' => [ + 'getSslCertificate', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/sslCertificates/{ssl_certificate}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'ssl_certificate' => [ + 'getters' => [ + 'getSslCertificate', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/sslCertificates', + 'body' => 'ssl_certificate_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/sslCertificates', + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_policies_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_policies_client_config.json new file mode 100644 index 000000000000..eaaaa89e0f03 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_policies_client_config.json @@ -0,0 +1,75 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionSslPolicies": { + "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" + }, + "ListAvailableFeatures": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_policies_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_policies_descriptor_config.php new file mode 100644 index 000000000000..d724a43f0c70 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_policies_descriptor_config.php @@ -0,0 +1,204 @@ + [ + 'google.cloud.compute.v1.RegionSslPolicies' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'ssl_policy', + 'fieldAccessors' => [ + 'getSslPolicy', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'ssl_policy', + 'fieldAccessors' => [ + 'getSslPolicy', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SslPolicy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'ssl_policy', + 'fieldAccessors' => [ + 'getSslPolicy', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SslPoliciesList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'ListAvailableFeatures' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SslPoliciesListAvailableFeaturesResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_policies_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_policies_rest_client_config.php new file mode 100644 index 000000000000..e497a97f8758 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_policies_rest_client_config.php @@ -0,0 +1,222 @@ + [ + 'google.cloud.compute.v1.RegionSslPolicies' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/sslPolicies/{ssl_policy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'ssl_policy' => [ + 'getters' => [ + 'getSslPolicy', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/sslPolicies/{ssl_policy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'ssl_policy' => [ + 'getters' => [ + 'getSslPolicy', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/sslPolicies', + 'body' => 'ssl_policy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/sslPolicies', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'ListAvailableFeatures' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/sslPolicies/listAvailableFeatures', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/sslPolicies/{ssl_policy}', + 'body' => 'ssl_policy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'ssl_policy' => [ + 'getters' => [ + 'getSslPolicy', + ], + ], + ], + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_target_http_proxies_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_target_http_proxies_client_config.json new file mode 100644 index 000000000000..bf0b35ebdff4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_target_http_proxies_client_config.json @@ -0,0 +1,70 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionTargetHttpProxies": { + "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" + }, + "SetUrlMap": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_target_http_proxies_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_target_http_proxies_descriptor_config.php new file mode 100644 index 000000000000..45894ab5584a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_target_http_proxies_descriptor_config.php @@ -0,0 +1,186 @@ + [ + 'google.cloud.compute.v1.RegionTargetHttpProxies' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'target_http_proxy', + 'fieldAccessors' => [ + 'getTargetHttpProxy', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'SetUrlMap' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'target_http_proxy', + 'fieldAccessors' => [ + 'getTargetHttpProxy', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetHttpProxy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'target_http_proxy', + 'fieldAccessors' => [ + 'getTargetHttpProxy', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetHttpProxyList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_target_http_proxies_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_target_http_proxies_rest_client_config.php new file mode 100644 index 000000000000..037780c4027d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_target_http_proxies_rest_client_config.php @@ -0,0 +1,206 @@ + [ + 'google.cloud.compute.v1.RegionTargetHttpProxies' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetHttpProxies/{target_http_proxy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'target_http_proxy' => [ + 'getters' => [ + 'getTargetHttpProxy', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetHttpProxies/{target_http_proxy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'target_http_proxy' => [ + 'getters' => [ + 'getTargetHttpProxy', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetHttpProxies', + 'body' => 'target_http_proxy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetHttpProxies', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'SetUrlMap' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetHttpProxies/{target_http_proxy}/setUrlMap', + 'body' => 'url_map_reference_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'target_http_proxy' => [ + 'getters' => [ + 'getTargetHttpProxy', + ], + ], + ], + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_target_https_proxies_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_target_https_proxies_client_config.json new file mode 100644 index 000000000000..84cd105f486b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_target_https_proxies_client_config.json @@ -0,0 +1,80 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionTargetHttpsProxies": { + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetSslCertificates": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetUrlMap": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_target_https_proxies_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_target_https_proxies_descriptor_config.php new file mode 100644 index 000000000000..7c892dab8056 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_target_https_proxies_descriptor_config.php @@ -0,0 +1,262 @@ + [ + 'google.cloud.compute.v1.RegionTargetHttpsProxies' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'target_https_proxy', + 'fieldAccessors' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'target_https_proxy', + 'fieldAccessors' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'SetSslCertificates' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'target_https_proxy', + 'fieldAccessors' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'SetUrlMap' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'target_https_proxy', + 'fieldAccessors' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetHttpsProxy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'target_https_proxy', + 'fieldAccessors' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetHttpsProxyList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_target_https_proxies_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_target_https_proxies_rest_client_config.php new file mode 100644 index 000000000000..b3285aeab109 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_target_https_proxies_rest_client_config.php @@ -0,0 +1,250 @@ + [ + 'google.cloud.compute.v1.RegionTargetHttpsProxies' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies/{target_https_proxy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'target_https_proxy' => [ + 'getters' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies/{target_https_proxy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'target_https_proxy' => [ + 'getters' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies', + 'body' => 'target_https_proxy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies/{target_https_proxy}', + 'body' => 'target_https_proxy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'target_https_proxy' => [ + 'getters' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'SetSslCertificates' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies/{target_https_proxy}/setSslCertificates', + 'body' => 'region_target_https_proxies_set_ssl_certificates_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'target_https_proxy' => [ + 'getters' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'SetUrlMap' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies/{target_https_proxy}/setUrlMap', + 'body' => 'url_map_reference_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'target_https_proxy' => [ + 'getters' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_target_tcp_proxies_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_target_tcp_proxies_client_config.json new file mode 100644 index 000000000000..166dcece5d9a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_target_tcp_proxies_client_config.json @@ -0,0 +1,65 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionTargetTcpProxies": { + "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/owl-bot-staging/Compute/V1/src/V1/resources/region_target_tcp_proxies_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_target_tcp_proxies_descriptor_config.php new file mode 100644 index 000000000000..b8dc8befd70a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_target_tcp_proxies_descriptor_config.php @@ -0,0 +1,148 @@ + [ + 'google.cloud.compute.v1.RegionTargetTcpProxies' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'target_tcp_proxy', + 'fieldAccessors' => [ + 'getTargetTcpProxy', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetTcpProxy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'target_tcp_proxy', + 'fieldAccessors' => [ + 'getTargetTcpProxy', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetTcpProxyList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_target_tcp_proxies_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_target_tcp_proxies_rest_client_config.php new file mode 100644 index 000000000000..a40a28e2ee43 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_target_tcp_proxies_rest_client_config.php @@ -0,0 +1,184 @@ + [ + 'google.cloud.compute.v1.RegionTargetTcpProxies' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetTcpProxies/{target_tcp_proxy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'target_tcp_proxy' => [ + 'getters' => [ + 'getTargetTcpProxy', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetTcpProxies/{target_tcp_proxy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'target_tcp_proxy' => [ + 'getters' => [ + 'getTargetTcpProxy', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetTcpProxies', + 'body' => 'target_tcp_proxy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetTcpProxies', + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_url_maps_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_url_maps_client_config.json new file mode 100644 index 000000000000..e14abeb5b877 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_url_maps_client_config.json @@ -0,0 +1,80 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionUrlMaps": { + "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" + }, + "Patch": { + "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" + }, + "Validate": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_url_maps_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_url_maps_descriptor_config.php new file mode 100644 index 000000000000..8859e43452ef --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_url_maps_descriptor_config.php @@ -0,0 +1,248 @@ + [ + 'google.cloud.compute.v1.RegionUrlMaps' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'url_map', + 'fieldAccessors' => [ + 'getUrlMap', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'url_map', + 'fieldAccessors' => [ + 'getUrlMap', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'url_map', + 'fieldAccessors' => [ + 'getUrlMap', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\UrlMap', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'url_map', + 'fieldAccessors' => [ + 'getUrlMap', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\UrlMapList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Validate' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\UrlMapsValidateResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'url_map', + 'fieldAccessors' => [ + 'getUrlMap', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_url_maps_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_url_maps_rest_client_config.php new file mode 100644 index 000000000000..3b6a797485c2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_url_maps_rest_client_config.php @@ -0,0 +1,250 @@ + [ + 'google.cloud.compute.v1.RegionUrlMaps' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/urlMaps/{url_map}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'url_map' => [ + 'getters' => [ + 'getUrlMap', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/urlMaps/{url_map}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'url_map' => [ + 'getters' => [ + 'getUrlMap', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/urlMaps', + 'body' => 'url_map_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/urlMaps', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/urlMaps/{url_map}', + 'body' => 'url_map_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'url_map' => [ + 'getters' => [ + 'getUrlMap', + ], + ], + ], + ], + 'Update' => [ + 'method' => 'put', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/urlMaps/{url_map}', + 'body' => 'url_map_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'url_map' => [ + 'getters' => [ + 'getUrlMap', + ], + ], + ], + ], + 'Validate' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/urlMaps/{url_map}/validate', + 'body' => 'region_url_maps_validate_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'url_map' => [ + 'getters' => [ + 'getUrlMap', + ], + ], + ], + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/region_zones_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/region_zones_client_config.json new file mode 100644 index 000000000000..7c969f850d76 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_zones_client_config.json @@ -0,0 +1,40 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionZones": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "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 + } + }, + "methods": { + "List": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_zones_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_zones_descriptor_config.php new file mode 100644 index 000000000000..d62c29bf8e01 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_zones_descriptor_config.php @@ -0,0 +1,54 @@ + [ + 'google.cloud.compute.v1.RegionZones' => [ + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\ZoneList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/region_zones_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/region_zones_rest_client_config.php new file mode 100644 index 000000000000..87a6aa539964 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_zones_rest_client_config.php @@ -0,0 +1,44 @@ + [ + 'google.cloud.compute.v1.RegionZones' => [ + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/zones', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/regions_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/regions_client_config.json new file mode 100644 index 000000000000..672d35f91589 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/regions_client_config.json @@ -0,0 +1,45 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Regions": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "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 + } + }, + "methods": { + "Get": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "List": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/regions_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/regions_descriptor_config.php new file mode 100644 index 000000000000..4ee10209bab2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/regions_descriptor_config.php @@ -0,0 +1,66 @@ + [ + 'google.cloud.compute.v1.Regions' => [ + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Region', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\RegionList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/regions_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/regions_rest_client_config.php new file mode 100644 index 000000000000..3b31296ef691 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/regions_rest_client_config.php @@ -0,0 +1,55 @@ + [ + 'google.cloud.compute.v1.Regions' => [ + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/reservations_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/reservations_client_config.json new file mode 100644 index 000000000000..59e302ebb5ee --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/reservations_client_config.json @@ -0,0 +1,95 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Reservations": { + "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": { + "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", + "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" + }, + "GetIamPolicy": { + "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" + }, + "Resize": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "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/owl-bot-staging/Compute/V1/src/V1/resources/reservations_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/reservations_descriptor_config.php new file mode 100644 index 000000000000..d9e947351539 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/reservations_descriptor_config.php @@ -0,0 +1,316 @@ + [ + 'google.cloud.compute.v1.Reservations' => [ + 'Delete' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'reservation', + 'fieldAccessors' => [ + 'getReservation', + ], + ], + ], + ], + 'Insert' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'Resize' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'reservation', + 'fieldAccessors' => [ + 'getReservation', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'reservation', + 'fieldAccessors' => [ + 'getReservation', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\ReservationAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Reservation', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'reservation', + 'fieldAccessors' => [ + 'getReservation', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\ReservationList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/reservations_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/reservations_rest_client_config.php new file mode 100644 index 000000000000..7f7f10f09d63 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/reservations_rest_client_config.php @@ -0,0 +1,304 @@ + [ + 'google.cloud.compute.v1.Reservations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/reservations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/reservations/{reservation}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'reservation' => [ + 'getters' => [ + 'getReservation', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/reservations/{reservation}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'reservation' => [ + 'getters' => [ + 'getReservation', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/reservations/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/reservations', + 'body' => 'reservation_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/reservations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Resize' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/reservations/{reservation}/resize', + 'body' => 'reservations_resize_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'reservation' => [ + 'getters' => [ + 'getReservation', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/reservations/{resource}/setIamPolicy', + 'body' => 'zone_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/reservations/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Update' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/reservations/{reservation}', + 'body' => 'reservation_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'reservation' => [ + 'getters' => [ + 'getReservation', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.ZoneOperations' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/resource_policies_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/resource_policies_client_config.json new file mode 100644 index 000000000000..74872fc4a643 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/resource_policies_client_config.json @@ -0,0 +1,90 @@ +{ + "interfaces": { + "google.cloud.compute.v1.ResourcePolicies": { + "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": { + "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", + "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" + }, + "GetIamPolicy": { + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/resource_policies_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/resource_policies_descriptor_config.php new file mode 100644 index 000000000000..2ca924d67c27 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/resource_policies_descriptor_config.php @@ -0,0 +1,278 @@ + [ + 'google.cloud.compute.v1.ResourcePolicies' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource_policy', + 'fieldAccessors' => [ + 'getResourcePolicy', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource_policy', + 'fieldAccessors' => [ + 'getResourcePolicy', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\ResourcePolicyAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\ResourcePolicy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource_policy', + 'fieldAccessors' => [ + 'getResourcePolicy', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\ResourcePolicyList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/resource_policies_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/resource_policies_rest_client_config.php new file mode 100644 index 000000000000..0b25a4b7a850 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/resource_policies_rest_client_config.php @@ -0,0 +1,282 @@ + [ + 'google.cloud.compute.v1.ResourcePolicies' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/resourcePolicies', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{resource_policy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource_policy' => [ + 'getters' => [ + 'getResourcePolicy', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{resource_policy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource_policy' => [ + 'getters' => [ + 'getResourcePolicy', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/resourcePolicies', + 'body' => 'resource_policy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/resourcePolicies', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{resource_policy}', + 'body' => 'resource_policy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource_policy' => [ + 'getters' => [ + 'getResourcePolicy', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{resource}/setIamPolicy', + 'body' => 'region_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/routers_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/routers_client_config.json new file mode 100644 index 000000000000..ce81e090e18e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/routers_client_config.json @@ -0,0 +1,100 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Routers": { + "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": { + "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", + "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" + }, + "GetNatIpInfo": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetNatMappingInfo": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetRouterStatus": { + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Preview": { + "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/owl-bot-staging/Compute/V1/src/V1/resources/routers_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/routers_descriptor_config.php new file mode 100644 index 000000000000..25bc2008eb2b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/routers_descriptor_config.php @@ -0,0 +1,348 @@ + [ + 'google.cloud.compute.v1.Routers' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'router', + 'fieldAccessors' => [ + 'getRouter', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'router', + 'fieldAccessors' => [ + 'getRouter', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'router', + 'fieldAccessors' => [ + 'getRouter', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\RouterAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Router', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'router', + 'fieldAccessors' => [ + 'getRouter', + ], + ], + ], + ], + 'GetNatIpInfo' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NatIpInfoResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'router', + 'fieldAccessors' => [ + 'getRouter', + ], + ], + ], + ], + 'GetNatMappingInfo' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getResult', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\VmEndpointNatMappingsList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'router', + 'fieldAccessors' => [ + 'getRouter', + ], + ], + ], + ], + 'GetRouterStatus' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\RouterStatusResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'router', + 'fieldAccessors' => [ + 'getRouter', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\RouterList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Preview' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\RoutersPreviewResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'router', + 'fieldAccessors' => [ + 'getRouter', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/routers_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/routers_rest_client_config.php new file mode 100644 index 000000000000..56d4e5cb6f02 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/routers_rest_client_config.php @@ -0,0 +1,324 @@ + [ + 'google.cloud.compute.v1.Routers' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/routers', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/routers/{router}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'router' => [ + 'getters' => [ + 'getRouter', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/routers/{router}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'router' => [ + 'getters' => [ + 'getRouter', + ], + ], + ], + ], + 'GetNatIpInfo' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/routers/{router}/getNatIpInfo', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'router' => [ + 'getters' => [ + 'getRouter', + ], + ], + ], + ], + 'GetNatMappingInfo' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/routers/{router}/getNatMappingInfo', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'router' => [ + 'getters' => [ + 'getRouter', + ], + ], + ], + ], + 'GetRouterStatus' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/routers/{router}/getRouterStatus', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'router' => [ + 'getters' => [ + 'getRouter', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/routers', + 'body' => 'router_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/routers', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/routers/{router}', + 'body' => 'router_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'router' => [ + 'getters' => [ + 'getRouter', + ], + ], + ], + ], + 'Preview' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/routers/{router}/preview', + 'body' => 'router_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'router' => [ + 'getters' => [ + 'getRouter', + ], + ], + ], + ], + 'Update' => [ + 'method' => 'put', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/routers/{router}', + 'body' => 'router_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'router' => [ + 'getters' => [ + 'getRouter', + ], + ], + ], + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/routes_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/routes_client_config.json new file mode 100644 index 000000000000..d655c0adefce --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/routes_client_config.json @@ -0,0 +1,65 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Routes": { + "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/owl-bot-staging/Compute/V1/src/V1/resources/routes_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/routes_descriptor_config.php new file mode 100644 index 000000000000..3178689ce144 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/routes_descriptor_config.php @@ -0,0 +1,122 @@ + [ + 'google.cloud.compute.v1.Routes' => [ + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'route', + 'fieldAccessors' => [ + 'getRoute', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Route', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'route', + 'fieldAccessors' => [ + 'getRoute', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\RouteList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/routes_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/routes_rest_client_config.php new file mode 100644 index 000000000000..3994ba001ddf --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/routes_rest_client_config.php @@ -0,0 +1,155 @@ + [ + 'google.cloud.compute.v1.Routes' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/routes/{route}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'route' => [ + 'getters' => [ + 'getRoute', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/routes/{route}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'route' => [ + 'getters' => [ + 'getRoute', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/routes', + 'body' => 'route_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/routes', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/security_policies_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/security_policies_client_config.json new file mode 100644 index 000000000000..ce00fa84acba --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/security_policies_client_config.json @@ -0,0 +1,105 @@ +{ + "interfaces": { + "google.cloud.compute.v1.SecurityPolicies": { + "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": { + "AddRule": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "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", + "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" + }, + "GetRule": { + "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" + }, + "ListPreconfiguredExpressionSets": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "PatchRule": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RemoveRule": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetLabels": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/security_policies_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/security_policies_descriptor_config.php new file mode 100644 index 000000000000..46e5ff1db4a0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/security_policies_descriptor_config.php @@ -0,0 +1,327 @@ + [ + 'google.cloud.compute.v1.SecurityPolicies' => [ + 'AddRule' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'security_policy', + 'fieldAccessors' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'security_policy', + 'fieldAccessors' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'security_policy', + 'fieldAccessors' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'PatchRule' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'security_policy', + 'fieldAccessors' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'RemoveRule' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'security_policy', + 'fieldAccessors' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'SetLabels' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SecurityPoliciesAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SecurityPolicy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'security_policy', + 'fieldAccessors' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'GetRule' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SecurityPolicyRule', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'security_policy', + 'fieldAccessors' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SecurityPolicyList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'ListPreconfiguredExpressionSets' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SecurityPoliciesListPreconfiguredExpressionSetsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/security_policies_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/security_policies_rest_client_config.php new file mode 100644 index 000000000000..023b45e63528 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/security_policies_rest_client_config.php @@ -0,0 +1,277 @@ + [ + 'google.cloud.compute.v1.SecurityPolicies' => [ + 'AddRule' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/securityPolicies/{security_policy}/addRule', + 'body' => 'security_policy_rule_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'security_policy' => [ + 'getters' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/securityPolicies', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/securityPolicies/{security_policy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'security_policy' => [ + 'getters' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/securityPolicies/{security_policy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'security_policy' => [ + 'getters' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'GetRule' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/securityPolicies/{security_policy}/getRule', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'security_policy' => [ + 'getters' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/securityPolicies', + 'body' => 'security_policy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/securityPolicies', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'ListPreconfiguredExpressionSets' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/securityPolicies/listPreconfiguredExpressionSets', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/global/securityPolicies/{security_policy}', + 'body' => 'security_policy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'security_policy' => [ + 'getters' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'PatchRule' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/securityPolicies/{security_policy}/patchRule', + 'body' => 'security_policy_rule_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'security_policy' => [ + 'getters' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'RemoveRule' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/securityPolicies/{security_policy}/removeRule', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'security_policy' => [ + 'getters' => [ + 'getSecurityPolicy', + ], + ], + ], + ], + 'SetLabels' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/securityPolicies/{resource}/setLabels', + 'body' => 'global_set_labels_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/service_attachments_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/service_attachments_client_config.json new file mode 100644 index 000000000000..6308b5246159 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/service_attachments_client_config.json @@ -0,0 +1,90 @@ +{ + "interfaces": { + "google.cloud.compute.v1.ServiceAttachments": { + "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": { + "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", + "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" + }, + "GetIamPolicy": { + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/service_attachments_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/service_attachments_descriptor_config.php new file mode 100644 index 000000000000..f5c3cb903abb --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/service_attachments_descriptor_config.php @@ -0,0 +1,278 @@ + [ + 'google.cloud.compute.v1.ServiceAttachments' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'service_attachment', + 'fieldAccessors' => [ + 'getServiceAttachment', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'service_attachment', + 'fieldAccessors' => [ + 'getServiceAttachment', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\ServiceAttachmentAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\ServiceAttachment', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'service_attachment', + 'fieldAccessors' => [ + 'getServiceAttachment', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\ServiceAttachmentList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/service_attachments_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/service_attachments_rest_client_config.php new file mode 100644 index 000000000000..e7457efef55d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/service_attachments_rest_client_config.php @@ -0,0 +1,282 @@ + [ + 'google.cloud.compute.v1.ServiceAttachments' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/serviceAttachments', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/serviceAttachments/{service_attachment}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'service_attachment' => [ + 'getters' => [ + 'getServiceAttachment', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/serviceAttachments/{service_attachment}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'service_attachment' => [ + 'getters' => [ + 'getServiceAttachment', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/serviceAttachments/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/serviceAttachments', + 'body' => 'service_attachment_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/serviceAttachments', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/serviceAttachments/{service_attachment}', + 'body' => 'service_attachment_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'service_attachment' => [ + 'getters' => [ + 'getServiceAttachment', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/serviceAttachments/{resource}/setIamPolicy', + 'body' => 'region_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/serviceAttachments/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/snapshot_settings_service_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/snapshot_settings_service_client_config.json new file mode 100644 index 000000000000..cfab069b8fd9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/snapshot_settings_service_client_config.json @@ -0,0 +1,55 @@ +{ + "interfaces": { + "google.cloud.compute.v1.SnapshotSettingsService": { + "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": { + "Get": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/snapshot_settings_service_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/snapshot_settings_service_descriptor_config.php new file mode 100644 index 000000000000..324adf409a87 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/snapshot_settings_service_descriptor_config.php @@ -0,0 +1,65 @@ + [ + 'google.cloud.compute.v1.SnapshotSettingsService' => [ + 'Patch' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SnapshotSettings', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/snapshot_settings_service_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/snapshot_settings_service_rest_client_config.php new file mode 100644 index 000000000000..3a0bca96cdc8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/snapshot_settings_service_rest_client_config.php @@ -0,0 +1,123 @@ + [ + 'google.cloud.compute.v1.SnapshotSettingsService' => [ + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/snapshotSettings', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/global/snapshotSettings', + 'body' => 'snapshot_settings_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/snapshots_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/snapshots_client_config.json new file mode 100644 index 000000000000..ee4034960365 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/snapshots_client_config.json @@ -0,0 +1,85 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Snapshots": { + "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" + }, + "GetIamPolicy": { + "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" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetLabels": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/snapshots_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/snapshots_descriptor_config.php new file mode 100644 index 000000000000..c101c42e1240 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/snapshots_descriptor_config.php @@ -0,0 +1,207 @@ + [ + 'google.cloud.compute.v1.Snapshots' => [ + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'snapshot', + 'fieldAccessors' => [ + 'getSnapshot', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'SetLabels' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Snapshot', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'snapshot', + 'fieldAccessors' => [ + 'getSnapshot', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SnapshotList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/snapshots_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/snapshots_rest_client_config.php new file mode 100644 index 000000000000..0126c6825734 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/snapshots_rest_client_config.php @@ -0,0 +1,222 @@ + [ + 'google.cloud.compute.v1.Snapshots' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/snapshots/{snapshot}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'snapshot' => [ + 'getters' => [ + 'getSnapshot', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/snapshots/{snapshot}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'snapshot' => [ + 'getters' => [ + 'getSnapshot', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/snapshots/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/snapshots', + 'body' => 'snapshot_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/snapshots', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/snapshots/{resource}/setIamPolicy', + 'body' => 'global_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetLabels' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/snapshots/{resource}/setLabels', + 'body' => 'global_set_labels_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/snapshots/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/ssl_certificates_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/ssl_certificates_client_config.json new file mode 100644 index 000000000000..f19ca6a330fc --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/ssl_certificates_client_config.json @@ -0,0 +1,70 @@ +{ + "interfaces": { + "google.cloud.compute.v1.SslCertificates": { + "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": { + "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", + "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/owl-bot-staging/Compute/V1/src/V1/resources/ssl_certificates_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/ssl_certificates_descriptor_config.php new file mode 100644 index 000000000000..0d7a08d10736 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/ssl_certificates_descriptor_config.php @@ -0,0 +1,142 @@ + [ + 'google.cloud.compute.v1.SslCertificates' => [ + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'ssl_certificate', + 'fieldAccessors' => [ + 'getSslCertificate', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SslCertificateAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SslCertificate', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'ssl_certificate', + 'fieldAccessors' => [ + 'getSslCertificate', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SslCertificateList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/ssl_certificates_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/ssl_certificates_rest_client_config.php new file mode 100644 index 000000000000..10a8ae36561c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/ssl_certificates_rest_client_config.php @@ -0,0 +1,166 @@ + [ + 'google.cloud.compute.v1.SslCertificates' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/sslCertificates', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/sslCertificates/{ssl_certificate}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'ssl_certificate' => [ + 'getters' => [ + 'getSslCertificate', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/sslCertificates/{ssl_certificate}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'ssl_certificate' => [ + 'getters' => [ + 'getSslCertificate', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/sslCertificates', + 'body' => 'ssl_certificate_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/sslCertificates', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/ssl_policies_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/ssl_policies_client_config.json new file mode 100644 index 000000000000..e51585ca6143 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/ssl_policies_client_config.json @@ -0,0 +1,80 @@ +{ + "interfaces": { + "google.cloud.compute.v1.SslPolicies": { + "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": { + "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", + "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" + }, + "ListAvailableFeatures": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/ssl_policies_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/ssl_policies_descriptor_config.php new file mode 100644 index 000000000000..69792fd30a86 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/ssl_policies_descriptor_config.php @@ -0,0 +1,185 @@ + [ + 'google.cloud.compute.v1.SslPolicies' => [ + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'ssl_policy', + 'fieldAccessors' => [ + 'getSslPolicy', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'ssl_policy', + 'fieldAccessors' => [ + 'getSslPolicy', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SslPoliciesAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SslPolicy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'ssl_policy', + 'fieldAccessors' => [ + 'getSslPolicy', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SslPoliciesList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'ListAvailableFeatures' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SslPoliciesListAvailableFeaturesResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/ssl_policies_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/ssl_policies_rest_client_config.php new file mode 100644 index 000000000000..fa7057a3f242 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/ssl_policies_rest_client_config.php @@ -0,0 +1,194 @@ + [ + 'google.cloud.compute.v1.SslPolicies' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/sslPolicies', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/sslPolicies/{ssl_policy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'ssl_policy' => [ + 'getters' => [ + 'getSslPolicy', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/sslPolicies/{ssl_policy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'ssl_policy' => [ + 'getters' => [ + 'getSslPolicy', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/sslPolicies', + 'body' => 'ssl_policy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/sslPolicies', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'ListAvailableFeatures' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/sslPolicies/listAvailableFeatures', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/global/sslPolicies/{ssl_policy}', + 'body' => 'ssl_policy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'ssl_policy' => [ + 'getters' => [ + 'getSslPolicy', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/storage_pool_types_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/storage_pool_types_client_config.json new file mode 100644 index 000000000000..fc4db2d72d1c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/storage_pool_types_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.cloud.compute.v1.StoragePoolTypes": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "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 + } + }, + "methods": { + "AggregatedList": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "Get": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "List": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/storage_pool_types_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/storage_pool_types_descriptor_config.php new file mode 100644 index 000000000000..f258748b3b67 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/storage_pool_types_descriptor_config.php @@ -0,0 +1,98 @@ + [ + 'google.cloud.compute.v1.StoragePoolTypes' => [ + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\StoragePoolTypeAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\StoragePoolType', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'storage_pool_type', + 'fieldAccessors' => [ + 'getStoragePoolType', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\StoragePoolTypeList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/storage_pool_types_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/storage_pool_types_rest_client_config.php new file mode 100644 index 000000000000..fc809ac7d12e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/storage_pool_types_rest_client_config.php @@ -0,0 +1,76 @@ + [ + 'google.cloud.compute.v1.StoragePoolTypes' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/storagePoolTypes', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/storagePoolTypes/{storage_pool_type}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'storage_pool_type' => [ + 'getters' => [ + 'getStoragePoolType', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/storagePoolTypes', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/storage_pools_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/storage_pools_client_config.json new file mode 100644 index 000000000000..5c164d0bc468 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/storage_pools_client_config.json @@ -0,0 +1,95 @@ +{ + "interfaces": { + "google.cloud.compute.v1.StoragePools": { + "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": { + "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", + "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" + }, + "GetIamPolicy": { + "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" + }, + "ListDisks": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "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/owl-bot-staging/Compute/V1/src/V1/resources/storage_pools_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/storage_pools_descriptor_config.php new file mode 100644 index 000000000000..b7262f08f7d9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/storage_pools_descriptor_config.php @@ -0,0 +1,294 @@ + [ + 'google.cloud.compute.v1.StoragePools' => [ + 'Delete' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'storage_pool', + 'fieldAccessors' => [ + 'getStoragePool', + ], + ], + ], + ], + 'Insert' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'storage_pool', + 'fieldAccessors' => [ + 'getStoragePool', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\StoragePoolAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\StoragePool', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'storage_pool', + 'fieldAccessors' => [ + 'getStoragePool', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'List' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\StoragePoolList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'ListDisks' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\StoragePoolListDisks', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'storage_pool', + 'fieldAccessors' => [ + 'getStoragePool', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/storage_pools_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/storage_pools_rest_client_config.php new file mode 100644 index 000000000000..401317cd5af4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/storage_pools_rest_client_config.php @@ -0,0 +1,303 @@ + [ + 'google.cloud.compute.v1.StoragePools' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/storagePools', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/storagePools/{storage_pool}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'storage_pool' => [ + 'getters' => [ + 'getStoragePool', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/storagePools/{storage_pool}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'storage_pool' => [ + 'getters' => [ + 'getStoragePool', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/storagePools/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/storagePools', + 'body' => 'storage_pool_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/storagePools', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'ListDisks' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/storagePools/{storage_pool}/listDisks', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'storage_pool' => [ + 'getters' => [ + 'getStoragePool', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/storagePools/{resource}/setIamPolicy', + 'body' => 'zone_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/storagePools/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Update' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/storagePools/{storage_pool}', + 'body' => 'storage_pool_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'storage_pool' => [ + 'getters' => [ + 'getStoragePool', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.ZoneOperations' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/subnetworks_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/subnetworks_client_config.json new file mode 100644 index 000000000000..f9903f9d0800 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/subnetworks_client_config.json @@ -0,0 +1,105 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Subnetworks": { + "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": { + "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", + "retry_params_name": "no_retry_1_params" + }, + "ExpandIpCidrRange": { + "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" + }, + "GetIamPolicy": { + "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" + }, + "ListUsable": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetIamPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetPrivateIpGoogleAccess": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/subnetworks_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/subnetworks_descriptor_config.php new file mode 100644 index 000000000000..f78e4e18f1db --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/subnetworks_descriptor_config.php @@ -0,0 +1,374 @@ + [ + 'google.cloud.compute.v1.Subnetworks' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'subnetwork', + 'fieldAccessors' => [ + 'getSubnetwork', + ], + ], + ], + ], + 'ExpandIpCidrRange' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'subnetwork', + 'fieldAccessors' => [ + 'getSubnetwork', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'Patch' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'subnetwork', + 'fieldAccessors' => [ + 'getSubnetwork', + ], + ], + ], + ], + 'SetPrivateIpGoogleAccess' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'subnetwork', + 'fieldAccessors' => [ + 'getSubnetwork', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SubnetworkAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Subnetwork', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'subnetwork', + 'fieldAccessors' => [ + 'getSubnetwork', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\SubnetworkList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'ListUsable' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\UsableSubnetworksAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Policy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/subnetworks_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/subnetworks_rest_client_config.php new file mode 100644 index 000000000000..68af3d0c3bbb --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/subnetworks_rest_client_config.php @@ -0,0 +1,337 @@ + [ + 'google.cloud.compute.v1.Subnetworks' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/subnetworks', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'subnetwork' => [ + 'getters' => [ + 'getSubnetwork', + ], + ], + ], + ], + 'ExpandIpCidrRange' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange', + 'body' => 'subnetworks_expand_ip_cidr_range_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'subnetwork' => [ + 'getters' => [ + 'getSubnetwork', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'subnetwork' => [ + 'getters' => [ + 'getSubnetwork', + ], + ], + ], + ], + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/subnetworks/{resource}/getIamPolicy', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/subnetworks', + 'body' => 'subnetwork_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/subnetworks', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'ListUsable' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/subnetworks/listUsable', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}', + 'body' => 'subnetwork_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'subnetwork' => [ + 'getters' => [ + 'getSubnetwork', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/subnetworks/{resource}/setIamPolicy', + 'body' => 'region_set_policy_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetPrivateIpGoogleAccess' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess', + 'body' => 'subnetworks_set_private_ip_google_access_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'subnetwork' => [ + 'getters' => [ + 'getSubnetwork', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/subnetworks/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/target_grpc_proxies_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/target_grpc_proxies_client_config.json new file mode 100644 index 000000000000..2eee79c8af4d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_grpc_proxies_client_config.json @@ -0,0 +1,70 @@ +{ + "interfaces": { + "google.cloud.compute.v1.TargetGrpcProxies": { + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/target_grpc_proxies_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/target_grpc_proxies_descriptor_config.php new file mode 100644 index 000000000000..254183f84e52 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_grpc_proxies_descriptor_config.php @@ -0,0 +1,153 @@ + [ + 'google.cloud.compute.v1.TargetGrpcProxies' => [ + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_grpc_proxy', + 'fieldAccessors' => [ + 'getTargetGrpcProxy', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_grpc_proxy', + 'fieldAccessors' => [ + 'getTargetGrpcProxy', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetGrpcProxy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_grpc_proxy', + 'fieldAccessors' => [ + 'getTargetGrpcProxy', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetGrpcProxyList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/target_grpc_proxies_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/target_grpc_proxies_rest_client_config.php new file mode 100644 index 000000000000..159ace9b824a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_grpc_proxies_rest_client_config.php @@ -0,0 +1,172 @@ + [ + 'google.cloud.compute.v1.TargetGrpcProxies' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetGrpcProxies/{target_grpc_proxy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_grpc_proxy' => [ + 'getters' => [ + 'getTargetGrpcProxy', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetGrpcProxies/{target_grpc_proxy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_grpc_proxy' => [ + 'getters' => [ + 'getTargetGrpcProxy', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetGrpcProxies', + 'body' => 'target_grpc_proxy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetGrpcProxies', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetGrpcProxies/{target_grpc_proxy}', + 'body' => 'target_grpc_proxy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_grpc_proxy' => [ + 'getters' => [ + 'getTargetGrpcProxy', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/target_http_proxies_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/target_http_proxies_client_config.json new file mode 100644 index 000000000000..df9432aa29af --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_http_proxies_client_config.json @@ -0,0 +1,80 @@ +{ + "interfaces": { + "google.cloud.compute.v1.TargetHttpProxies": { + "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": { + "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", + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetUrlMap": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/target_http_proxies_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/target_http_proxies_descriptor_config.php new file mode 100644 index 000000000000..cf0edd6501da --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_http_proxies_descriptor_config.php @@ -0,0 +1,204 @@ + [ + 'google.cloud.compute.v1.TargetHttpProxies' => [ + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_http_proxy', + 'fieldAccessors' => [ + 'getTargetHttpProxy', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_http_proxy', + 'fieldAccessors' => [ + 'getTargetHttpProxy', + ], + ], + ], + ], + 'SetUrlMap' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_http_proxy', + 'fieldAccessors' => [ + 'getTargetHttpProxy', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetHttpProxyAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetHttpProxy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_http_proxy', + 'fieldAccessors' => [ + 'getTargetHttpProxy', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetHttpProxyList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/target_http_proxies_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/target_http_proxies_rest_client_config.php new file mode 100644 index 000000000000..c23a40f88a1d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_http_proxies_rest_client_config.php @@ -0,0 +1,200 @@ + [ + 'google.cloud.compute.v1.TargetHttpProxies' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/targetHttpProxies', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetHttpProxies/{target_http_proxy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_http_proxy' => [ + 'getters' => [ + 'getTargetHttpProxy', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetHttpProxies/{target_http_proxy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_http_proxy' => [ + 'getters' => [ + 'getTargetHttpProxy', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetHttpProxies', + 'body' => 'target_http_proxy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetHttpProxies', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetHttpProxies/{target_http_proxy}', + 'body' => 'target_http_proxy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_http_proxy' => [ + 'getters' => [ + 'getTargetHttpProxy', + ], + ], + ], + ], + 'SetUrlMap' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/targetHttpProxies/{target_http_proxy}/setUrlMap', + 'body' => 'url_map_reference_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_http_proxy' => [ + 'getters' => [ + 'getTargetHttpProxy', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/target_https_proxies_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/target_https_proxies_client_config.json new file mode 100644 index 000000000000..3945ddfdf683 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_https_proxies_client_config.json @@ -0,0 +1,100 @@ +{ + "interfaces": { + "google.cloud.compute.v1.TargetHttpsProxies": { + "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": { + "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", + "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" + }, + "Patch": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetCertificateMap": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetQuicOverride": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetSslCertificates": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetSslPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetUrlMap": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/target_https_proxies_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/target_https_proxies_descriptor_config.php new file mode 100644 index 000000000000..8e90fe47911b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_https_proxies_descriptor_config.php @@ -0,0 +1,328 @@ + [ + 'google.cloud.compute.v1.TargetHttpsProxies' => [ + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_https_proxy', + 'fieldAccessors' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_https_proxy', + 'fieldAccessors' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'SetCertificateMap' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_https_proxy', + 'fieldAccessors' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'SetQuicOverride' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_https_proxy', + 'fieldAccessors' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'SetSslCertificates' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_https_proxy', + 'fieldAccessors' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'SetSslPolicy' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_https_proxy', + 'fieldAccessors' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'SetUrlMap' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_https_proxy', + 'fieldAccessors' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetHttpsProxyAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetHttpsProxy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_https_proxy', + 'fieldAccessors' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetHttpsProxyList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/target_https_proxies_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/target_https_proxies_rest_client_config.php new file mode 100644 index 000000000000..d1030d866857 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_https_proxies_rest_client_config.php @@ -0,0 +1,268 @@ + [ + 'google.cloud.compute.v1.TargetHttpsProxies' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/targetHttpsProxies', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_https_proxy' => [ + 'getters' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_https_proxy' => [ + 'getters' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetHttpsProxies', + 'body' => 'target_https_proxy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetHttpsProxies', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}', + 'body' => 'target_https_proxy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_https_proxy' => [ + 'getters' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'SetCertificateMap' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}/setCertificateMap', + 'body' => 'target_https_proxies_set_certificate_map_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_https_proxy' => [ + 'getters' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'SetQuicOverride' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}/setQuicOverride', + 'body' => 'target_https_proxies_set_quic_override_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_https_proxy' => [ + 'getters' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'SetSslCertificates' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/targetHttpsProxies/{target_https_proxy}/setSslCertificates', + 'body' => 'target_https_proxies_set_ssl_certificates_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_https_proxy' => [ + 'getters' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'SetSslPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}/setSslPolicy', + 'body' => 'ssl_policy_reference_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_https_proxy' => [ + 'getters' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + 'SetUrlMap' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/targetHttpsProxies/{target_https_proxy}/setUrlMap', + 'body' => 'url_map_reference_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_https_proxy' => [ + 'getters' => [ + 'getTargetHttpsProxy', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/target_instances_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/target_instances_client_config.json new file mode 100644 index 000000000000..9030f781b197 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_instances_client_config.json @@ -0,0 +1,75 @@ +{ + "interfaces": { + "google.cloud.compute.v1.TargetInstances": { + "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": { + "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", + "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" + }, + "SetSecurityPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/target_instances_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/target_instances_descriptor_config.php new file mode 100644 index 000000000000..fb28638269c3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_instances_descriptor_config.php @@ -0,0 +1,206 @@ + [ + 'google.cloud.compute.v1.TargetInstances' => [ + 'Delete' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'target_instance', + 'fieldAccessors' => [ + 'getTargetInstance', + ], + ], + ], + ], + 'Insert' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'SetSecurityPolicy' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'target_instance', + 'fieldAccessors' => [ + 'getTargetInstance', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetInstanceAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetInstance', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'target_instance', + 'fieldAccessors' => [ + 'getTargetInstance', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetInstanceList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/target_instances_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/target_instances_rest_client_config.php new file mode 100644 index 000000000000..d0d3118a3a2d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_instances_rest_client_config.php @@ -0,0 +1,217 @@ + [ + 'google.cloud.compute.v1.TargetInstances' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/targetInstances', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/targetInstances/{target_instance}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_instance' => [ + 'getters' => [ + 'getTargetInstance', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/targetInstances/{target_instance}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_instance' => [ + 'getters' => [ + 'getTargetInstance', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/targetInstances', + 'body' => 'target_instance_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/targetInstances', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SetSecurityPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/targetInstances/{target_instance}/setSecurityPolicy', + 'body' => 'security_policy_reference_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_instance' => [ + 'getters' => [ + 'getTargetInstance', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.ZoneOperations' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/target_pools_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/target_pools_client_config.json new file mode 100644 index 000000000000..2dd3c2b2038c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_pools_client_config.json @@ -0,0 +1,105 @@ +{ + "interfaces": { + "google.cloud.compute.v1.TargetPools": { + "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": { + "AddHealthCheck": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "AddInstance": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "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", + "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" + }, + "GetHealth": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_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" + }, + "RemoveHealthCheck": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RemoveInstance": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetBackup": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetSecurityPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/target_pools_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/target_pools_descriptor_config.php new file mode 100644 index 000000000000..223636d00cc1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_pools_descriptor_config.php @@ -0,0 +1,420 @@ + [ + 'google.cloud.compute.v1.TargetPools' => [ + 'AddHealthCheck' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'target_pool', + 'fieldAccessors' => [ + 'getTargetPool', + ], + ], + ], + ], + 'AddInstance' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'target_pool', + 'fieldAccessors' => [ + 'getTargetPool', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'target_pool', + 'fieldAccessors' => [ + 'getTargetPool', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'RemoveHealthCheck' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'target_pool', + 'fieldAccessors' => [ + 'getTargetPool', + ], + ], + ], + ], + 'RemoveInstance' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'target_pool', + 'fieldAccessors' => [ + 'getTargetPool', + ], + ], + ], + ], + 'SetBackup' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'target_pool', + 'fieldAccessors' => [ + 'getTargetPool', + ], + ], + ], + ], + 'SetSecurityPolicy' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'target_pool', + 'fieldAccessors' => [ + 'getTargetPool', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetPoolAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetPool', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'target_pool', + 'fieldAccessors' => [ + 'getTargetPool', + ], + ], + ], + ], + 'GetHealth' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetPoolInstanceHealth', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'target_pool', + 'fieldAccessors' => [ + 'getTargetPool', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetPoolList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/target_pools_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/target_pools_rest_client_config.php new file mode 100644 index 000000000000..cce64208e969 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_pools_rest_client_config.php @@ -0,0 +1,349 @@ + [ + 'google.cloud.compute.v1.TargetPools' => [ + 'AddHealthCheck' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/addHealthCheck', + 'body' => 'target_pools_add_health_check_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'target_pool' => [ + 'getters' => [ + 'getTargetPool', + ], + ], + ], + ], + 'AddInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/addInstance', + 'body' => 'target_pools_add_instance_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'target_pool' => [ + 'getters' => [ + 'getTargetPool', + ], + ], + ], + ], + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/targetPools', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'target_pool' => [ + 'getters' => [ + 'getTargetPool', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'target_pool' => [ + 'getters' => [ + 'getTargetPool', + ], + ], + ], + ], + 'GetHealth' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/getHealth', + 'body' => 'instance_reference_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'target_pool' => [ + 'getters' => [ + 'getTargetPool', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetPools', + 'body' => 'target_pool_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetPools', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'RemoveHealthCheck' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/removeHealthCheck', + 'body' => 'target_pools_remove_health_check_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'target_pool' => [ + 'getters' => [ + 'getTargetPool', + ], + ], + ], + ], + 'RemoveInstance' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/removeInstance', + 'body' => 'target_pools_remove_instance_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'target_pool' => [ + 'getters' => [ + 'getTargetPool', + ], + ], + ], + ], + 'SetBackup' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/setBackup', + 'body' => 'target_reference_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'target_pool' => [ + 'getters' => [ + 'getTargetPool', + ], + ], + ], + ], + 'SetSecurityPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/setSecurityPolicy', + 'body' => 'security_policy_reference_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'target_pool' => [ + 'getters' => [ + 'getTargetPool', + ], + ], + ], + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/target_ssl_proxies_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/target_ssl_proxies_client_config.json new file mode 100644 index 000000000000..d194c7b50e2f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_ssl_proxies_client_config.json @@ -0,0 +1,90 @@ +{ + "interfaces": { + "google.cloud.compute.v1.TargetSslProxies": { + "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" + }, + "SetBackendService": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetCertificateMap": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetProxyHeader": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetSslCertificates": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetSslPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/target_ssl_proxies_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/target_ssl_proxies_descriptor_config.php new file mode 100644 index 000000000000..c4e8dbaa6f77 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_ssl_proxies_descriptor_config.php @@ -0,0 +1,277 @@ + [ + 'google.cloud.compute.v1.TargetSslProxies' => [ + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_ssl_proxy', + 'fieldAccessors' => [ + 'getTargetSslProxy', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'SetBackendService' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_ssl_proxy', + 'fieldAccessors' => [ + 'getTargetSslProxy', + ], + ], + ], + ], + 'SetCertificateMap' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_ssl_proxy', + 'fieldAccessors' => [ + 'getTargetSslProxy', + ], + ], + ], + ], + 'SetProxyHeader' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_ssl_proxy', + 'fieldAccessors' => [ + 'getTargetSslProxy', + ], + ], + ], + ], + 'SetSslCertificates' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_ssl_proxy', + 'fieldAccessors' => [ + 'getTargetSslProxy', + ], + ], + ], + ], + 'SetSslPolicy' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_ssl_proxy', + 'fieldAccessors' => [ + 'getTargetSslProxy', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetSslProxy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_ssl_proxy', + 'fieldAccessors' => [ + 'getTargetSslProxy', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetSslProxyList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/target_ssl_proxies_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/target_ssl_proxies_rest_client_config.php new file mode 100644 index 000000000000..6edf163ce9bc --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_ssl_proxies_rest_client_config.php @@ -0,0 +1,240 @@ + [ + 'google.cloud.compute.v1.TargetSslProxies' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_ssl_proxy' => [ + 'getters' => [ + 'getTargetSslProxy', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_ssl_proxy' => [ + 'getters' => [ + 'getTargetSslProxy', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetSslProxies', + 'body' => 'target_ssl_proxy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetSslProxies', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'SetBackendService' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setBackendService', + 'body' => 'target_ssl_proxies_set_backend_service_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_ssl_proxy' => [ + 'getters' => [ + 'getTargetSslProxy', + ], + ], + ], + ], + 'SetCertificateMap' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setCertificateMap', + 'body' => 'target_ssl_proxies_set_certificate_map_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_ssl_proxy' => [ + 'getters' => [ + 'getTargetSslProxy', + ], + ], + ], + ], + 'SetProxyHeader' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setProxyHeader', + 'body' => 'target_ssl_proxies_set_proxy_header_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_ssl_proxy' => [ + 'getters' => [ + 'getTargetSslProxy', + ], + ], + ], + ], + 'SetSslCertificates' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setSslCertificates', + 'body' => 'target_ssl_proxies_set_ssl_certificates_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_ssl_proxy' => [ + 'getters' => [ + 'getTargetSslProxy', + ], + ], + ], + ], + 'SetSslPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setSslPolicy', + 'body' => 'ssl_policy_reference_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_ssl_proxy' => [ + 'getters' => [ + 'getTargetSslProxy', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/target_tcp_proxies_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/target_tcp_proxies_client_config.json new file mode 100644 index 000000000000..e24197d78ef6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_tcp_proxies_client_config.json @@ -0,0 +1,80 @@ +{ + "interfaces": { + "google.cloud.compute.v1.TargetTcpProxies": { + "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": { + "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", + "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" + }, + "SetBackendService": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SetProxyHeader": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/target_tcp_proxies_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/target_tcp_proxies_descriptor_config.php new file mode 100644 index 000000000000..9464ee53f3d4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_tcp_proxies_descriptor_config.php @@ -0,0 +1,204 @@ + [ + 'google.cloud.compute.v1.TargetTcpProxies' => [ + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_tcp_proxy', + 'fieldAccessors' => [ + 'getTargetTcpProxy', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'SetBackendService' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_tcp_proxy', + 'fieldAccessors' => [ + 'getTargetTcpProxy', + ], + ], + ], + ], + 'SetProxyHeader' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_tcp_proxy', + 'fieldAccessors' => [ + 'getTargetTcpProxy', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetTcpProxyAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetTcpProxy', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'target_tcp_proxy', + 'fieldAccessors' => [ + 'getTargetTcpProxy', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetTcpProxyList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/target_tcp_proxies_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/target_tcp_proxies_rest_client_config.php new file mode 100644 index 000000000000..e92438bed04c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_tcp_proxies_rest_client_config.php @@ -0,0 +1,200 @@ + [ + 'google.cloud.compute.v1.TargetTcpProxies' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/targetTcpProxies', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetTcpProxies/{target_tcp_proxy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_tcp_proxy' => [ + 'getters' => [ + 'getTargetTcpProxy', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetTcpProxies/{target_tcp_proxy}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_tcp_proxy' => [ + 'getters' => [ + 'getTargetTcpProxy', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetTcpProxies', + 'body' => 'target_tcp_proxy_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetTcpProxies', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'SetBackendService' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetTcpProxies/{target_tcp_proxy}/setBackendService', + 'body' => 'target_tcp_proxies_set_backend_service_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_tcp_proxy' => [ + 'getters' => [ + 'getTargetTcpProxy', + ], + ], + ], + ], + 'SetProxyHeader' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/targetTcpProxies/{target_tcp_proxy}/setProxyHeader', + 'body' => 'target_tcp_proxies_set_proxy_header_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'target_tcp_proxy' => [ + 'getters' => [ + 'getTargetTcpProxy', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/target_vpn_gateways_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/target_vpn_gateways_client_config.json new file mode 100644 index 000000000000..4f22c2b0771f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_vpn_gateways_client_config.json @@ -0,0 +1,75 @@ +{ + "interfaces": { + "google.cloud.compute.v1.TargetVpnGateways": { + "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": { + "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", + "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" + }, + "SetLabels": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/target_vpn_gateways_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/target_vpn_gateways_descriptor_config.php new file mode 100644 index 000000000000..7285dc4c336d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_vpn_gateways_descriptor_config.php @@ -0,0 +1,206 @@ + [ + 'google.cloud.compute.v1.TargetVpnGateways' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'target_vpn_gateway', + 'fieldAccessors' => [ + 'getTargetVpnGateway', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'SetLabels' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetVpnGatewayAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetVpnGateway', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'target_vpn_gateway', + 'fieldAccessors' => [ + 'getTargetVpnGateway', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TargetVpnGatewayList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/target_vpn_gateways_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/target_vpn_gateways_rest_client_config.php new file mode 100644 index 000000000000..b5a05ad6bf46 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_vpn_gateways_rest_client_config.php @@ -0,0 +1,217 @@ + [ + 'google.cloud.compute.v1.TargetVpnGateways' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/targetVpnGateways', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetVpnGateways/{target_vpn_gateway}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'target_vpn_gateway' => [ + 'getters' => [ + 'getTargetVpnGateway', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetVpnGateways/{target_vpn_gateway}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'target_vpn_gateway' => [ + 'getters' => [ + 'getTargetVpnGateway', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetVpnGateways', + 'body' => 'target_vpn_gateway_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetVpnGateways', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'SetLabels' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/targetVpnGateways/{resource}/setLabels', + 'body' => 'region_set_labels_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/url_maps_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/url_maps_client_config.json new file mode 100644 index 000000000000..2c888197979b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/url_maps_client_config.json @@ -0,0 +1,90 @@ +{ + "interfaces": { + "google.cloud.compute.v1.UrlMaps": { + "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": { + "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", + "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" + }, + "InvalidateCache": { + "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" + }, + "Patch": { + "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" + }, + "Validate": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/url_maps_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/url_maps_descriptor_config.php new file mode 100644 index 000000000000..307ae7b17e48 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/url_maps_descriptor_config.php @@ -0,0 +1,253 @@ + [ + 'google.cloud.compute.v1.UrlMaps' => [ + 'Delete' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'url_map', + 'fieldAccessors' => [ + 'getUrlMap', + ], + ], + ], + ], + 'Insert' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'InvalidateCache' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'url_map', + 'fieldAccessors' => [ + 'getUrlMap', + ], + ], + ], + ], + 'Patch' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'url_map', + 'fieldAccessors' => [ + 'getUrlMap', + ], + ], + ], + ], + 'Update' => [ + 'longRunning' => [ + 'additionalArgumentMethods' => [ + 'getProject', + ], + 'getOperationMethod' => 'get', + 'cancelOperationMethod' => null, + 'deleteOperationMethod' => 'delete', + 'operationErrorCodeMethod' => 'getHttpErrorStatusCode', + 'operationErrorMessageMethod' => 'getHttpErrorMessage', + 'operationNameMethod' => 'getName', + 'operationStatusMethod' => 'getStatus', + 'operationStatusDoneValue' => \Google\Cloud\Compute\V1\Operation\Status::DONE, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'url_map', + 'fieldAccessors' => [ + 'getUrlMap', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\UrlMapsAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\UrlMap', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'url_map', + 'fieldAccessors' => [ + 'getUrlMap', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\UrlMapList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Validate' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\UrlMapsValidateResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'url_map', + 'fieldAccessors' => [ + 'getUrlMap', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/url_maps_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/url_maps_rest_client_config.php new file mode 100644 index 000000000000..b070a36b8dd8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/url_maps_rest_client_config.php @@ -0,0 +1,234 @@ + [ + 'google.cloud.compute.v1.UrlMaps' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/urlMaps', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/urlMaps/{url_map}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'url_map' => [ + 'getters' => [ + 'getUrlMap', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/urlMaps/{url_map}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'url_map' => [ + 'getters' => [ + 'getUrlMap', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/urlMaps', + 'body' => 'url_map_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'InvalidateCache' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/urlMaps/{url_map}/invalidateCache', + 'body' => 'cache_invalidation_rule_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'url_map' => [ + 'getters' => [ + 'getUrlMap', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/urlMaps', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Patch' => [ + 'method' => 'patch', + 'uriTemplate' => '/compute/v1/projects/{project}/global/urlMaps/{url_map}', + 'body' => 'url_map_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'url_map' => [ + 'getters' => [ + 'getUrlMap', + ], + ], + ], + ], + 'Update' => [ + 'method' => 'put', + 'uriTemplate' => '/compute/v1/projects/{project}/global/urlMaps/{url_map}', + 'body' => 'url_map_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'url_map' => [ + 'getters' => [ + 'getUrlMap', + ], + ], + ], + ], + 'Validate' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/urlMaps/{url_map}/validate', + 'body' => 'url_maps_validate_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'url_map' => [ + 'getters' => [ + 'getUrlMap', + ], + ], + ], + ], + ], + 'google.cloud.compute.v1.GlobalOperations' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/global/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/vpn_gateways_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/vpn_gateways_client_config.json new file mode 100644 index 000000000000..dac0e3657f5c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/vpn_gateways_client_config.json @@ -0,0 +1,85 @@ +{ + "interfaces": { + "google.cloud.compute.v1.VpnGateways": { + "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": { + "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", + "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" + }, + "GetStatus": { + "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" + }, + "SetLabels": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "TestIamPermissions": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/vpn_gateways_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/vpn_gateways_descriptor_config.php new file mode 100644 index 000000000000..18b6b1fd11a6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/vpn_gateways_descriptor_config.php @@ -0,0 +1,254 @@ + [ + 'google.cloud.compute.v1.VpnGateways' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'vpn_gateway', + 'fieldAccessors' => [ + 'getVpnGateway', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'SetLabels' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\VpnGatewayAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\VpnGateway', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'vpn_gateway', + 'fieldAccessors' => [ + 'getVpnGateway', + ], + ], + ], + ], + 'GetStatus' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\VpnGatewaysGetStatusResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'vpn_gateway', + 'fieldAccessors' => [ + 'getVpnGateway', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\VpnGatewayList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\TestPermissionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/vpn_gateways_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/vpn_gateways_rest_client_config.php new file mode 100644 index 000000000000..ea4a5fc86a2b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/vpn_gateways_rest_client_config.php @@ -0,0 +1,260 @@ + [ + 'google.cloud.compute.v1.VpnGateways' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/vpnGateways', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/vpnGateways/{vpn_gateway}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'vpn_gateway' => [ + 'getters' => [ + 'getVpnGateway', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/vpnGateways/{vpn_gateway}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'vpn_gateway' => [ + 'getters' => [ + 'getVpnGateway', + ], + ], + ], + ], + 'GetStatus' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/vpnGateways/{vpn_gateway}/getStatus', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'vpn_gateway' => [ + 'getters' => [ + 'getVpnGateway', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/vpnGateways', + 'body' => 'vpn_gateway_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/vpnGateways', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'SetLabels' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/vpnGateways/{resource}/setLabels', + 'body' => 'region_set_labels_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/vpnGateways/{resource}/testIamPermissions', + 'body' => 'test_permissions_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/vpn_tunnels_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/vpn_tunnels_client_config.json new file mode 100644 index 000000000000..fab2014bc9d2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/vpn_tunnels_client_config.json @@ -0,0 +1,75 @@ +{ + "interfaces": { + "google.cloud.compute.v1.VpnTunnels": { + "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": { + "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", + "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" + }, + "SetLabels": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/vpn_tunnels_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/vpn_tunnels_descriptor_config.php new file mode 100644 index 000000000000..738677fc5452 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/vpn_tunnels_descriptor_config.php @@ -0,0 +1,206 @@ + [ + 'google.cloud.compute.v1.VpnTunnels' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'vpn_tunnel', + 'fieldAccessors' => [ + 'getVpnTunnel', + ], + ], + ], + ], + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + 'SetLabels' => [ + '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, + ], + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'resource', + 'fieldAccessors' => [ + 'getResource', + ], + ], + ], + ], + 'AggregatedList' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\VpnTunnelAggregatedList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\VpnTunnel', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + [ + 'keyName' => 'vpn_tunnel', + 'fieldAccessors' => [ + 'getVpnTunnel', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\VpnTunnelList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'region', + 'fieldAccessors' => [ + 'getRegion', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/vpn_tunnels_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/vpn_tunnels_rest_client_config.php new file mode 100644 index 000000000000..67aade00b791 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/vpn_tunnels_rest_client_config.php @@ -0,0 +1,217 @@ + [ + 'google.cloud.compute.v1.VpnTunnels' => [ + 'AggregatedList' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/aggregated/vpnTunnels', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/vpnTunnels/{vpn_tunnel}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'vpn_tunnel' => [ + 'getters' => [ + 'getVpnTunnel', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/vpnTunnels/{vpn_tunnel}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'vpn_tunnel' => [ + 'getters' => [ + 'getVpnTunnel', + ], + ], + ], + ], + 'Insert' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/vpnTunnels', + 'body' => 'vpn_tunnel_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/vpnTunnels', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'SetLabels' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/vpnTunnels/{resource}/setLabels', + 'body' => 'region_set_labels_request_resource', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + '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/owl-bot-staging/Compute/V1/src/V1/resources/zone_operations_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/zone_operations_client_config.json new file mode 100644 index 000000000000..27263738b596 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/zone_operations_client_config.json @@ -0,0 +1,65 @@ +{ + "interfaces": { + "google.cloud.compute.v1.ZoneOperations": { + "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" + }, + "List": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "Wait": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/zone_operations_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/zone_operations_descriptor_config.php new file mode 100644 index 000000000000..2a679de05bc5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/zone_operations_descriptor_config.php @@ -0,0 +1,126 @@ + [ + 'google.cloud.compute.v1.ZoneOperations' => [ + 'Delete' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\DeleteZoneOperationResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'operation', + 'fieldAccessors' => [ + 'getOperation', + ], + ], + ], + ], + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'operation', + 'fieldAccessors' => [ + 'getOperation', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\OperationList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'Wait' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Operation', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + [ + 'keyName' => 'operation', + 'fieldAccessors' => [ + 'getOperation', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/zone_operations_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/zone_operations_rest_client_config.php new file mode 100644 index 000000000000..96db89ae2421 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/zone_operations_rest_client_config.php @@ -0,0 +1,107 @@ + [ + 'google.cloud.compute.v1.ZoneOperations' => [ + 'Delete' => [ + 'method' => 'delete', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'Wait' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}/wait', + 'placeholders' => [ + 'operation' => [ + 'getters' => [ + 'getOperation', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/zones_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/zones_client_config.json new file mode 100644 index 000000000000..cb4498799155 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/zones_client_config.json @@ -0,0 +1,45 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Zones": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "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 + } + }, + "methods": { + "Get": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "List": { + "timeout_millis": 600000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/zones_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/zones_descriptor_config.php new file mode 100644 index 000000000000..4f91a0e331b1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/zones_descriptor_config.php @@ -0,0 +1,66 @@ + [ + 'google.cloud.compute.v1.Zones' => [ + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\Zone', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'zone', + 'fieldAccessors' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getMaxResults', + 'requestPageSizeSetMethod' => 'setMaxResults', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getItems', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\ZoneList', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/zones_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/zones_rest_client_config.php new file mode 100644 index 000000000000..af7de216d677 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/zones_rest_client_config.php @@ -0,0 +1,55 @@ + [ + 'google.cloud.compute.v1.Zones' => [ + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/zones', + 'placeholders' => [ + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/AcceleratorTypesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/AcceleratorTypesClientTest.php new file mode 100644 index 000000000000..9583b54e6e0b --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/AcceleratorTypesClientTest.php @@ -0,0 +1,299 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AcceleratorTypesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AcceleratorTypesClient($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 AcceleratorTypesScopedList(), + ]; + $expectedResponse = new AcceleratorTypeAggregatedList(); + $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.AcceleratorTypes/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 getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $maximumCardsPerInstance = 1883669166; + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new AcceleratorType(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setMaximumCardsPerInstance($maximumCardsPerInstance); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $acceleratorType = 'acceleratorType1748643982'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->get($acceleratorType, $project, $zone); + $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.AcceleratorTypes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getAcceleratorType(); + $this->assertProtobufEquals($acceleratorType, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $acceleratorType = 'acceleratorType1748643982'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->get($acceleratorType, $project, $zone); + // 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 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 AcceleratorType(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new AcceleratorTypeList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->list($project, $zone); + $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.AcceleratorTypes/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + try { + $gapicClient->list($project, $zone); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/AddressesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/AddressesClientTest.php new file mode 100644 index 000000000000..7efa9ba7a367 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/AddressesClientTest.php @@ -0,0 +1,809 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AddressesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AddressesClient($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 AddressesScopedList(), + ]; + $expectedResponse = new AddressAggregatedList(); + $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.Addresses/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() + { + $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 + $address = 'address-1147692044'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($address, $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.Addresses/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAddress(); + $this->assertProtobufEquals($address, $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 + $address = 'address-1147692044'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($address, $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 + $address2 = 'address2874543783'; + $addressType = 'addressType264307877'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $id = 3355; + $ipVersion = 'ipVersion-1315653184'; + $ipv6EndpointType = 'ipv6EndpointType-2049982644'; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $network = 'network1843485230'; + $networkTier = 'networkTier-19473069'; + $prefixLength = 1157046989; + $purpose = 'purpose-220463842'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $subnetwork = 'subnetwork-1302785042'; + $expectedResponse = new Address(); + $expectedResponse->setAddress($address2); + $expectedResponse->setAddressType($addressType); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setIpVersion($ipVersion); + $expectedResponse->setIpv6EndpointType($ipv6EndpointType); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setNetworkTier($networkTier); + $expectedResponse->setPrefixLength($prefixLength); + $expectedResponse->setPurpose($purpose); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $expectedResponse->setSubnetwork($subnetwork); + $transport->addResponse($expectedResponse); + // Mock request + $address = 'address-1147692044'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($address, $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.Addresses/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getAddress(); + $this->assertProtobufEquals($address, $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 + $address = 'address-1147692044'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($address, $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 + $addressResource = new Address(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($addressResource, $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.Addresses/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAddressResource(); + $this->assertProtobufEquals($addressResource, $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 + $addressResource = new Address(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($addressResource, $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 Address(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new AddressList(); + $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.Addresses/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()); + } + + /** @test */ + public function moveTest() + { + $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/moveTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/moveTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $address = 'address-1147692044'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionAddressesMoveRequestResource = new RegionAddressesMoveRequest(); + $response = $gapicClient->move($address, $project, $region, $regionAddressesMoveRequestResource); + $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.Addresses/Move', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAddress(); + $this->assertProtobufEquals($address, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionAddressesMoveRequestResource(); + $this->assertProtobufEquals($regionAddressesMoveRequestResource, $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 moveExceptionTest() + { + $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/moveExceptionTest'); + $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 + $address = 'address-1147692044'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionAddressesMoveRequestResource = new RegionAddressesMoveRequest(); + $response = $gapicClient->move($address, $project, $region, $regionAddressesMoveRequestResource); + $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 setLabelsTest() + { + $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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + $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.Addresses/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionSetLabelsRequestResource(); + $this->assertProtobufEquals($regionSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $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 setLabelsExceptionTest() + { + $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/setLabelsExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/AutoscalersClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/AutoscalersClientTest.php new file mode 100644 index 000000000000..5e096d4cf475 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/AutoscalersClientTest.php @@ -0,0 +1,785 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AutoscalersClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AutoscalersClient($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 AutoscalersScopedList(), + ]; + $expectedResponse = new AutoscalerAggregatedList(); + $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.Autoscalers/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() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $autoscaler = 'autoscaler517258967'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($autoscaler, $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.Autoscalers/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAutoscaler(); + $this->assertProtobufEquals($autoscaler, $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 deleteExceptionTest() + { + $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/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 + $autoscaler = 'autoscaler517258967'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($autoscaler, $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 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'; + $recommendedSize = 1889567899; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $target = 'target-880905839'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new Autoscaler(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRecommendedSize($recommendedSize); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $expectedResponse->setTarget($target); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $autoscaler = 'autoscaler517258967'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->get($autoscaler, $project, $zone); + $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.Autoscalers/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getAutoscaler(); + $this->assertProtobufEquals($autoscaler, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $autoscaler = 'autoscaler517258967'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->get($autoscaler, $project, $zone); + // 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 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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->insert($autoscalerResource, $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.Autoscalers/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAutoscalerResource(); + $this->assertProtobufEquals($autoscalerResource, $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 insertExceptionTest() + { + $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/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 + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->insert($autoscalerResource, $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 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 Autoscaler(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new AutoscalerList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->list($project, $zone); + $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.Autoscalers/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + try { + $gapicClient->list($project, $zone); + // 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 patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->patch($autoscalerResource, $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.Autoscalers/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAutoscalerResource(); + $this->assertProtobufEquals($autoscalerResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->patch($autoscalerResource, $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 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 + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->update($autoscalerResource, $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.Autoscalers/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAutoscalerResource(); + $this->assertProtobufEquals($autoscalerResource, $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 + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->update($autoscalerResource, $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/owl-bot-staging/Compute/V1/tests/Unit/V1/BackendBucketsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/BackendBucketsClientTest.php new file mode 100644 index 000000000000..d63e43b9757c --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/BackendBucketsClientTest.php @@ -0,0 +1,1252 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return BackendBucketsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new BackendBucketsClient($options); + } + + /** @test */ + public function addSignedUrlKeyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addSignedUrlKeyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addSignedUrlKeyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendBucket = 'backendBucket91714037'; + $project = 'project-309310695'; + $signedUrlKeyResource = new SignedUrlKey(); + $response = $gapicClient->addSignedUrlKey($backendBucket, $project, $signedUrlKeyResource); + $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.BackendBuckets/AddSignedUrlKey', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendBucket(); + $this->assertProtobufEquals($backendBucket, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSignedUrlKeyResource(); + $this->assertProtobufEquals($signedUrlKeyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function addSignedUrlKeyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addSignedUrlKeyExceptionTest'); + $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 + $backendBucket = 'backendBucket91714037'; + $project = 'project-309310695'; + $signedUrlKeyResource = new SignedUrlKey(); + $response = $gapicClient->addSignedUrlKey($backendBucket, $project, $signedUrlKeyResource); + $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 deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $backendBucket = 'backendBucket91714037'; + $project = 'project-309310695'; + $response = $gapicClient->delete($backendBucket, $project); + $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.BackendBuckets/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendBucket(); + $this->assertProtobufEquals($backendBucket, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $backendBucket = 'backendBucket91714037'; + $project = 'project-309310695'; + $response = $gapicClient->delete($backendBucket, $project); + $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 deleteSignedUrlKeyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deleteSignedUrlKeyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteSignedUrlKeyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendBucket = 'backendBucket91714037'; + $keyName = 'keyName500938859'; + $project = 'project-309310695'; + $response = $gapicClient->deleteSignedUrlKey($backendBucket, $keyName, $project); + $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.BackendBuckets/DeleteSignedUrlKey', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendBucket(); + $this->assertProtobufEquals($backendBucket, $actualValue); + $actualValue = $actualApiRequestObject->getKeyName(); + $this->assertProtobufEquals($keyName, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteSignedUrlKeyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deleteSignedUrlKeyExceptionTest'); + $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 + $backendBucket = 'backendBucket91714037'; + $keyName = 'keyName500938859'; + $project = 'project-309310695'; + $response = $gapicClient->deleteSignedUrlKey($backendBucket, $keyName, $project); + $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 + $bucketName = 'bucketName283610048'; + $compressionMode = 'compressionMode-2051962660'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $edgeSecurityPolicy = 'edgeSecurityPolicy-1032704881'; + $enableCdn = false; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new BackendBucket(); + $expectedResponse->setBucketName($bucketName); + $expectedResponse->setCompressionMode($compressionMode); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEdgeSecurityPolicy($edgeSecurityPolicy); + $expectedResponse->setEnableCdn($enableCdn); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $backendBucket = 'backendBucket91714037'; + $project = 'project-309310695'; + $response = $gapicClient->get($backendBucket, $project); + $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.BackendBuckets/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getBackendBucket(); + $this->assertProtobufEquals($backendBucket, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $backendBucket = 'backendBucket91714037'; + $project = 'project-309310695'; + try { + $gapicClient->get($backendBucket, $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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($project, $resource); + $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.BackendBuckets/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($project, $resource); + // 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 GlobalOperationsClient([ + '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 + $backendBucketResource = new BackendBucket(); + $project = 'project-309310695'; + $response = $gapicClient->insert($backendBucketResource, $project); + $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.BackendBuckets/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendBucketResource(); + $this->assertProtobufEquals($backendBucketResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $backendBucketResource = new BackendBucket(); + $project = 'project-309310695'; + $response = $gapicClient->insert($backendBucketResource, $project); + $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 BackendBucket(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new BackendBucketList(); + $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->list($project); + $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.BackendBuckets/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendBucket = 'backendBucket91714037'; + $backendBucketResource = new BackendBucket(); + $project = 'project-309310695'; + $response = $gapicClient->patch($backendBucket, $backendBucketResource, $project); + $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.BackendBuckets/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendBucket(); + $this->assertProtobufEquals($backendBucket, $actualValue); + $actualValue = $actualApiRequestObject->getBackendBucketResource(); + $this->assertProtobufEquals($backendBucketResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $backendBucket = 'backendBucket91714037'; + $backendBucketResource = new BackendBucket(); + $project = 'project-309310695'; + $response = $gapicClient->patch($backendBucket, $backendBucketResource, $project); + $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 setEdgeSecurityPolicyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setEdgeSecurityPolicyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setEdgeSecurityPolicyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendBucket = 'backendBucket91714037'; + $project = 'project-309310695'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $response = $gapicClient->setEdgeSecurityPolicy($backendBucket, $project, $securityPolicyReferenceResource); + $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.BackendBuckets/SetEdgeSecurityPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendBucket(); + $this->assertProtobufEquals($backendBucket, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyReferenceResource(); + $this->assertProtobufEquals($securityPolicyReferenceResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setEdgeSecurityPolicyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setEdgeSecurityPolicyExceptionTest'); + $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 + $backendBucket = 'backendBucket91714037'; + $project = 'project-309310695'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $response = $gapicClient->setEdgeSecurityPolicy($backendBucket, $project, $securityPolicyReferenceResource); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + $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.BackendBuckets/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getGlobalSetPolicyRequestResource(); + $this->assertProtobufEquals($globalSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + try { + $gapicClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $response = $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + $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.BackendBuckets/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + try { + $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + // 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 updateTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $backendBucket = 'backendBucket91714037'; + $backendBucketResource = new BackendBucket(); + $project = 'project-309310695'; + $response = $gapicClient->update($backendBucket, $backendBucketResource, $project); + $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.BackendBuckets/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendBucket(); + $this->assertProtobufEquals($backendBucket, $actualValue); + $actualValue = $actualApiRequestObject->getBackendBucketResource(); + $this->assertProtobufEquals($backendBucketResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $backendBucket = 'backendBucket91714037'; + $backendBucketResource = new BackendBucket(); + $project = 'project-309310695'; + $response = $gapicClient->update($backendBucket, $backendBucketResource, $project); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/BackendServicesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/BackendServicesClientTest.php new file mode 100644 index 000000000000..5ba2ceaa84dc --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/BackendServicesClientTest.php @@ -0,0 +1,1616 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return BackendServicesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new BackendServicesClient($options); + } + + /** @test */ + public function addSignedUrlKeyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addSignedUrlKeyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addSignedUrlKeyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $signedUrlKeyResource = new SignedUrlKey(); + $response = $gapicClient->addSignedUrlKey($backendService, $project, $signedUrlKeyResource); + $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.BackendServices/AddSignedUrlKey', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSignedUrlKeyResource(); + $this->assertProtobufEquals($signedUrlKeyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function addSignedUrlKeyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addSignedUrlKeyExceptionTest'); + $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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $signedUrlKeyResource = new SignedUrlKey(); + $response = $gapicClient->addSignedUrlKey($backendService, $project, $signedUrlKeyResource); + $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 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 BackendServicesScopedList(), + ]; + $expectedResponse = new BackendServiceAggregatedList(); + $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.BackendServices/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() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $response = $gapicClient->delete($backendService, $project); + $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.BackendServices/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $response = $gapicClient->delete($backendService, $project); + $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 deleteSignedUrlKeyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deleteSignedUrlKeyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteSignedUrlKeyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendService = 'backendService306946058'; + $keyName = 'keyName500938859'; + $project = 'project-309310695'; + $response = $gapicClient->deleteSignedUrlKey($backendService, $keyName, $project); + $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.BackendServices/DeleteSignedUrlKey', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualApiRequestObject->getKeyName(); + $this->assertProtobufEquals($keyName, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteSignedUrlKeyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deleteSignedUrlKeyExceptionTest'); + $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 + $backendService = 'backendService306946058'; + $keyName = 'keyName500938859'; + $project = 'project-309310695'; + $response = $gapicClient->deleteSignedUrlKey($backendService, $keyName, $project); + $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 + $affinityCookieTtlSec = 1777486694; + $compressionMode = 'compressionMode-2051962660'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $edgeSecurityPolicy = 'edgeSecurityPolicy-1032704881'; + $enableCDN = false; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $loadBalancingScheme = 'loadBalancingScheme1974502980'; + $localityLbPolicy = 'localityLbPolicy-2016052161'; + $name = 'name3373707'; + $network = 'network1843485230'; + $port = 3446913; + $portName = 'portName1115276169'; + $protocol = 'protocol-989163880'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $selfLink = 'selfLink-1691268851'; + $serviceLbPolicy = 'serviceLbPolicy1168590609'; + $sessionAffinity = 'sessionAffinity1000759473'; + $timeoutSec = 2067488653; + $expectedResponse = new BackendService(); + $expectedResponse->setAffinityCookieTtlSec($affinityCookieTtlSec); + $expectedResponse->setCompressionMode($compressionMode); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEdgeSecurityPolicy($edgeSecurityPolicy); + $expectedResponse->setEnableCDN($enableCDN); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLoadBalancingScheme($loadBalancingScheme); + $expectedResponse->setLocalityLbPolicy($localityLbPolicy); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setPort($port); + $expectedResponse->setPortName($portName); + $expectedResponse->setProtocol($protocol); + $expectedResponse->setRegion($region); + $expectedResponse->setSecurityPolicy($securityPolicy); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setServiceLbPolicy($serviceLbPolicy); + $expectedResponse->setSessionAffinity($sessionAffinity); + $expectedResponse->setTimeoutSec($timeoutSec); + $transport->addResponse($expectedResponse); + // Mock request + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $response = $gapicClient->get($backendService, $project); + $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.BackendServices/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + try { + $gapicClient->get($backendService, $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 getHealthTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $kind = 'kind3292052'; + $expectedResponse = new BackendServiceGroupHealth(); + $expectedResponse->setKind($kind); + $transport->addResponse($expectedResponse); + // Mock request + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $resourceGroupReferenceResource = new ResourceGroupReference(); + $response = $gapicClient->getHealth($backendService, $project, $resourceGroupReferenceResource); + $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.BackendServices/GetHealth', $actualFuncCall); + $actualValue = $actualRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResourceGroupReferenceResource(); + $this->assertProtobufEquals($resourceGroupReferenceResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getHealthExceptionTest() + { + $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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $resourceGroupReferenceResource = new ResourceGroupReference(); + try { + $gapicClient->getHealth($backendService, $project, $resourceGroupReferenceResource); + // 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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($project, $resource); + $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.BackendServices/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($project, $resource); + // 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 GlobalOperationsClient([ + '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 + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $response = $gapicClient->insert($backendServiceResource, $project); + $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.BackendServices/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendServiceResource(); + $this->assertProtobufEquals($backendServiceResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $response = $gapicClient->insert($backendServiceResource, $project); + $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 BackendService(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new BackendServiceList(); + $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->list($project); + $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.BackendServices/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 listUsableTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new BackendService(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new BackendServiceListUsable(); + $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->listUsable($project); + $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.BackendServices/ListUsable', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listUsableExceptionTest() + { + $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->listUsable($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 patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendService = 'backendService306946058'; + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $response = $gapicClient->patch($backendService, $backendServiceResource, $project); + $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.BackendServices/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualApiRequestObject->getBackendServiceResource(); + $this->assertProtobufEquals($backendServiceResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $backendService = 'backendService306946058'; + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $response = $gapicClient->patch($backendService, $backendServiceResource, $project); + $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 setEdgeSecurityPolicyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setEdgeSecurityPolicyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setEdgeSecurityPolicyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $response = $gapicClient->setEdgeSecurityPolicy($backendService, $project, $securityPolicyReferenceResource); + $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.BackendServices/SetEdgeSecurityPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyReferenceResource(); + $this->assertProtobufEquals($securityPolicyReferenceResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setEdgeSecurityPolicyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setEdgeSecurityPolicyExceptionTest'); + $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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $response = $gapicClient->setEdgeSecurityPolicy($backendService, $project, $securityPolicyReferenceResource); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + $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.BackendServices/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getGlobalSetPolicyRequestResource(); + $this->assertProtobufEquals($globalSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + try { + $gapicClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + // 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 setSecurityPolicyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setSecurityPolicyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setSecurityPolicyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $response = $gapicClient->setSecurityPolicy($backendService, $project, $securityPolicyReferenceResource); + $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.BackendServices/SetSecurityPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyReferenceResource(); + $this->assertProtobufEquals($securityPolicyReferenceResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setSecurityPolicyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setSecurityPolicyExceptionTest'); + $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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $response = $gapicClient->setSecurityPolicy($backendService, $project, $securityPolicyReferenceResource); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $response = $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + $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.BackendServices/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + try { + $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + // 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 updateTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $backendService = 'backendService306946058'; + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $response = $gapicClient->update($backendService, $backendServiceResource, $project); + $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.BackendServices/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualApiRequestObject->getBackendServiceResource(); + $this->assertProtobufEquals($backendServiceResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $backendService = 'backendService306946058'; + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $response = $gapicClient->update($backendService, $backendServiceResource, $project); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/AcceleratorTypesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/AcceleratorTypesClientTest.php new file mode 100644 index 000000000000..dd59ee8f4f99 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/AcceleratorTypesClientTest.php @@ -0,0 +1,364 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AcceleratorTypesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AcceleratorTypesClient($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 AcceleratorTypesScopedList(), + ]; + $expectedResponse = new AcceleratorTypeAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListAcceleratorTypesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.AcceleratorTypes/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'; + $request = (new AggregatedListAcceleratorTypesRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $maximumCardsPerInstance = 1883669166; + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new AcceleratorType(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setMaximumCardsPerInstance($maximumCardsPerInstance); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $acceleratorType = 'acceleratorType1748643982'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetAcceleratorTypeRequest()) + ->setAcceleratorType($acceleratorType) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.AcceleratorTypes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getAcceleratorType(); + $this->assertProtobufEquals($acceleratorType, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $acceleratorType = 'acceleratorType1748643982'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetAcceleratorTypeRequest()) + ->setAcceleratorType($acceleratorType) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 AcceleratorType(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new AcceleratorTypeList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListAcceleratorTypesRequest()) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->list($request); + $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.AcceleratorTypes/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + $request = (new ListAcceleratorTypesRequest()) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function aggregatedListAsyncTest() + { + $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 AcceleratorTypesScopedList(), + ]; + $expectedResponse = new AcceleratorTypeAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListAcceleratorTypesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.AcceleratorTypes/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/AddressesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/AddressesClientTest.php new file mode 100644 index 000000000000..691f2e75fee7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/AddressesClientTest.php @@ -0,0 +1,914 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AddressesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AddressesClient($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 AddressesScopedList(), + ]; + $expectedResponse = new AddressAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListAddressesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.Addresses/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'; + $request = (new AggregatedListAddressesRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $address = 'address-1147692044'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteAddressRequest()) + ->setAddress($address) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.Addresses/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAddress(); + $this->assertProtobufEquals($address, $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 + $address = 'address-1147692044'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteAddressRequest()) + ->setAddress($address) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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 + $address2 = 'address2874543783'; + $addressType = 'addressType264307877'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $id = 3355; + $ipVersion = 'ipVersion-1315653184'; + $ipv6EndpointType = 'ipv6EndpointType-2049982644'; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $network = 'network1843485230'; + $networkTier = 'networkTier-19473069'; + $prefixLength = 1157046989; + $purpose = 'purpose-220463842'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $subnetwork = 'subnetwork-1302785042'; + $expectedResponse = new Address(); + $expectedResponse->setAddress($address2); + $expectedResponse->setAddressType($addressType); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setIpVersion($ipVersion); + $expectedResponse->setIpv6EndpointType($ipv6EndpointType); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setNetworkTier($networkTier); + $expectedResponse->setPrefixLength($prefixLength); + $expectedResponse->setPurpose($purpose); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $expectedResponse->setSubnetwork($subnetwork); + $transport->addResponse($expectedResponse); + // Mock request + $address = 'address-1147692044'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetAddressRequest()) + ->setAddress($address) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Addresses/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getAddress(); + $this->assertProtobufEquals($address, $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 + $address = 'address-1147692044'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetAddressRequest()) + ->setAddress($address) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $addressResource = new Address(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertAddressRequest()) + ->setAddressResource($addressResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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.Addresses/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAddressResource(); + $this->assertProtobufEquals($addressResource, $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 + $addressResource = new Address(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertAddressRequest()) + ->setAddressResource($addressResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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 Address(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new AddressList(); + $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'; + $request = (new ListAddressesRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.Addresses/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'; + $request = (new ListAddressesRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function moveTest() + { + $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/moveTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/moveTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $address = 'address-1147692044'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionAddressesMoveRequestResource = new RegionAddressesMoveRequest(); + $request = (new MoveAddressRequest()) + ->setAddress($address) + ->setProject($project) + ->setRegion($region) + ->setRegionAddressesMoveRequestResource($regionAddressesMoveRequestResource); + $response = $gapicClient->move($request); + $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.Addresses/Move', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAddress(); + $this->assertProtobufEquals($address, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionAddressesMoveRequestResource(); + $this->assertProtobufEquals($regionAddressesMoveRequestResource, $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 moveExceptionTest() + { + $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/moveExceptionTest'); + $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 + $address = 'address-1147692044'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionAddressesMoveRequestResource = new RegionAddressesMoveRequest(); + $request = (new MoveAddressRequest()) + ->setAddress($address) + ->setProject($project) + ->setRegion($region) + ->setRegionAddressesMoveRequestResource($regionAddressesMoveRequestResource); + $response = $gapicClient->move($request); + $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 setLabelsTest() + { + $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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $request = (new SetLabelsAddressRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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.Addresses/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionSetLabelsRequestResource(); + $this->assertProtobufEquals($regionSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $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 setLabelsExceptionTest() + { + $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/setLabelsExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $request = (new SetLabelsAddressRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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 aggregatedListAsyncTest() + { + $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 AddressesScopedList(), + ]; + $expectedResponse = new AddressAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListAddressesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.Addresses/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/AutoscalersClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/AutoscalersClientTest.php new file mode 100644 index 000000000000..ccbc26848bb7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/AutoscalersClientTest.php @@ -0,0 +1,886 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return AutoscalersClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new AutoscalersClient($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 AutoscalersScopedList(), + ]; + $expectedResponse = new AutoscalerAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListAutoscalersRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.Autoscalers/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'; + $request = (new AggregatedListAutoscalersRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTest() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $autoscaler = 'autoscaler517258967'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteAutoscalerRequest()) + ->setAutoscaler($autoscaler) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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.Autoscalers/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAutoscaler(); + $this->assertProtobufEquals($autoscaler, $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 deleteExceptionTest() + { + $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/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 + $autoscaler = 'autoscaler517258967'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteAutoscalerRequest()) + ->setAutoscaler($autoscaler) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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'; + $recommendedSize = 1889567899; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $target = 'target-880905839'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new Autoscaler(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRecommendedSize($recommendedSize); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $expectedResponse->setTarget($target); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $autoscaler = 'autoscaler517258967'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetAutoscalerRequest()) + ->setAutoscaler($autoscaler) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Autoscalers/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getAutoscaler(); + $this->assertProtobufEquals($autoscaler, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $autoscaler = 'autoscaler517258967'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetAutoscalerRequest()) + ->setAutoscaler($autoscaler) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new InsertAutoscalerRequest()) + ->setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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.Autoscalers/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAutoscalerResource(); + $this->assertProtobufEquals($autoscalerResource, $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 insertExceptionTest() + { + $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/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 + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new InsertAutoscalerRequest()) + ->setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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 Autoscaler(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new AutoscalerList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListAutoscalersRequest()) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->list($request); + $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.Autoscalers/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + $request = (new ListAutoscalersRequest()) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new PatchAutoscalerRequest()) + ->setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->patch($request); + $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.Autoscalers/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAutoscalerResource(); + $this->assertProtobufEquals($autoscalerResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new PatchAutoscalerRequest()) + ->setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->patch($request); + $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 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 + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new UpdateAutoscalerRequest()) + ->setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->update($request); + $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.Autoscalers/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAutoscalerResource(); + $this->assertProtobufEquals($autoscalerResource, $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 + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new UpdateAutoscalerRequest()) + ->setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->update($request); + $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 aggregatedListAsyncTest() + { + $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 AutoscalersScopedList(), + ]; + $expectedResponse = new AutoscalerAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListAutoscalersRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.Autoscalers/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/BackendBucketsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/BackendBucketsClientTest.php new file mode 100644 index 000000000000..568bbd2df553 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/BackendBucketsClientTest.php @@ -0,0 +1,1415 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return BackendBucketsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new BackendBucketsClient($options); + } + + /** @test */ + public function addSignedUrlKeyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addSignedUrlKeyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addSignedUrlKeyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendBucket = 'backendBucket91714037'; + $project = 'project-309310695'; + $signedUrlKeyResource = new SignedUrlKey(); + $request = (new AddSignedUrlKeyBackendBucketRequest()) + ->setBackendBucket($backendBucket) + ->setProject($project) + ->setSignedUrlKeyResource($signedUrlKeyResource); + $response = $gapicClient->addSignedUrlKey($request); + $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.BackendBuckets/AddSignedUrlKey', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendBucket(); + $this->assertProtobufEquals($backendBucket, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSignedUrlKeyResource(); + $this->assertProtobufEquals($signedUrlKeyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function addSignedUrlKeyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addSignedUrlKeyExceptionTest'); + $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 + $backendBucket = 'backendBucket91714037'; + $project = 'project-309310695'; + $signedUrlKeyResource = new SignedUrlKey(); + $request = (new AddSignedUrlKeyBackendBucketRequest()) + ->setBackendBucket($backendBucket) + ->setProject($project) + ->setSignedUrlKeyResource($signedUrlKeyResource); + $response = $gapicClient->addSignedUrlKey($request); + $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 deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $backendBucket = 'backendBucket91714037'; + $project = 'project-309310695'; + $request = (new DeleteBackendBucketRequest()) + ->setBackendBucket($backendBucket) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.BackendBuckets/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendBucket(); + $this->assertProtobufEquals($backendBucket, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $backendBucket = 'backendBucket91714037'; + $project = 'project-309310695'; + $request = (new DeleteBackendBucketRequest()) + ->setBackendBucket($backendBucket) + ->setProject($project); + $response = $gapicClient->delete($request); + $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 deleteSignedUrlKeyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deleteSignedUrlKeyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteSignedUrlKeyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendBucket = 'backendBucket91714037'; + $keyName = 'keyName500938859'; + $project = 'project-309310695'; + $request = (new DeleteSignedUrlKeyBackendBucketRequest()) + ->setBackendBucket($backendBucket) + ->setKeyName($keyName) + ->setProject($project); + $response = $gapicClient->deleteSignedUrlKey($request); + $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.BackendBuckets/DeleteSignedUrlKey', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendBucket(); + $this->assertProtobufEquals($backendBucket, $actualValue); + $actualValue = $actualApiRequestObject->getKeyName(); + $this->assertProtobufEquals($keyName, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteSignedUrlKeyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deleteSignedUrlKeyExceptionTest'); + $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 + $backendBucket = 'backendBucket91714037'; + $keyName = 'keyName500938859'; + $project = 'project-309310695'; + $request = (new DeleteSignedUrlKeyBackendBucketRequest()) + ->setBackendBucket($backendBucket) + ->setKeyName($keyName) + ->setProject($project); + $response = $gapicClient->deleteSignedUrlKey($request); + $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 + $bucketName = 'bucketName283610048'; + $compressionMode = 'compressionMode-2051962660'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $edgeSecurityPolicy = 'edgeSecurityPolicy-1032704881'; + $enableCdn = false; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new BackendBucket(); + $expectedResponse->setBucketName($bucketName); + $expectedResponse->setCompressionMode($compressionMode); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEdgeSecurityPolicy($edgeSecurityPolicy); + $expectedResponse->setEnableCdn($enableCdn); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $backendBucket = 'backendBucket91714037'; + $project = 'project-309310695'; + $request = (new GetBackendBucketRequest()) + ->setBackendBucket($backendBucket) + ->setProject($project); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.BackendBuckets/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getBackendBucket(); + $this->assertProtobufEquals($backendBucket, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $backendBucket = 'backendBucket91714037'; + $project = 'project-309310695'; + $request = (new GetBackendBucketRequest()) + ->setBackendBucket($backendBucket) + ->setProject($project); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyBackendBucketRequest()) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.BackendBuckets/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyBackendBucketRequest()) + ->setProject($project) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $backendBucketResource = new BackendBucket(); + $project = 'project-309310695'; + $request = (new InsertBackendBucketRequest()) + ->setBackendBucketResource($backendBucketResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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.BackendBuckets/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendBucketResource(); + $this->assertProtobufEquals($backendBucketResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $backendBucketResource = new BackendBucket(); + $project = 'project-309310695'; + $request = (new InsertBackendBucketRequest()) + ->setBackendBucketResource($backendBucketResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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 BackendBucket(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new BackendBucketList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListBackendBucketsRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.BackendBuckets/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListBackendBucketsRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendBucket = 'backendBucket91714037'; + $backendBucketResource = new BackendBucket(); + $project = 'project-309310695'; + $request = (new PatchBackendBucketRequest()) + ->setBackendBucket($backendBucket) + ->setBackendBucketResource($backendBucketResource) + ->setProject($project); + $response = $gapicClient->patch($request); + $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.BackendBuckets/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendBucket(); + $this->assertProtobufEquals($backendBucket, $actualValue); + $actualValue = $actualApiRequestObject->getBackendBucketResource(); + $this->assertProtobufEquals($backendBucketResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $backendBucket = 'backendBucket91714037'; + $backendBucketResource = new BackendBucket(); + $project = 'project-309310695'; + $request = (new PatchBackendBucketRequest()) + ->setBackendBucket($backendBucket) + ->setBackendBucketResource($backendBucketResource) + ->setProject($project); + $response = $gapicClient->patch($request); + $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 setEdgeSecurityPolicyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setEdgeSecurityPolicyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setEdgeSecurityPolicyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendBucket = 'backendBucket91714037'; + $project = 'project-309310695'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $request = (new SetEdgeSecurityPolicyBackendBucketRequest()) + ->setBackendBucket($backendBucket) + ->setProject($project) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + $response = $gapicClient->setEdgeSecurityPolicy($request); + $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.BackendBuckets/SetEdgeSecurityPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendBucket(); + $this->assertProtobufEquals($backendBucket, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyReferenceResource(); + $this->assertProtobufEquals($securityPolicyReferenceResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setEdgeSecurityPolicyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setEdgeSecurityPolicyExceptionTest'); + $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 + $backendBucket = 'backendBucket91714037'; + $project = 'project-309310695'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $request = (new SetEdgeSecurityPolicyBackendBucketRequest()) + ->setBackendBucket($backendBucket) + ->setProject($project) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + $response = $gapicClient->setEdgeSecurityPolicy($request); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetIamPolicyBackendBucketRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.BackendBuckets/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getGlobalSetPolicyRequestResource(); + $this->assertProtobufEquals($globalSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetIamPolicyBackendBucketRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsBackendBucketRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.BackendBuckets/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsBackendBucketRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $backendBucket = 'backendBucket91714037'; + $backendBucketResource = new BackendBucket(); + $project = 'project-309310695'; + $request = (new UpdateBackendBucketRequest()) + ->setBackendBucket($backendBucket) + ->setBackendBucketResource($backendBucketResource) + ->setProject($project); + $response = $gapicClient->update($request); + $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.BackendBuckets/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendBucket(); + $this->assertProtobufEquals($backendBucket, $actualValue); + $actualValue = $actualApiRequestObject->getBackendBucketResource(); + $this->assertProtobufEquals($backendBucketResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $backendBucket = 'backendBucket91714037'; + $backendBucketResource = new BackendBucket(); + $project = 'project-309310695'; + $request = (new UpdateBackendBucketRequest()) + ->setBackendBucket($backendBucket) + ->setBackendBucketResource($backendBucketResource) + ->setProject($project); + $response = $gapicClient->update($request); + $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 addSignedUrlKeyAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addSignedUrlKeyAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addSignedUrlKeyAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendBucket = 'backendBucket91714037'; + $project = 'project-309310695'; + $signedUrlKeyResource = new SignedUrlKey(); + $request = (new AddSignedUrlKeyBackendBucketRequest()) + ->setBackendBucket($backendBucket) + ->setProject($project) + ->setSignedUrlKeyResource($signedUrlKeyResource); + $response = $gapicClient->addSignedUrlKey($request); + $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.BackendBuckets/AddSignedUrlKey', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendBucket(); + $this->assertProtobufEquals($backendBucket, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSignedUrlKeyResource(); + $this->assertProtobufEquals($signedUrlKeyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/BackendServicesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/BackendServicesClientTest.php new file mode 100644 index 000000000000..c51a3c7c75da --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/BackendServicesClientTest.php @@ -0,0 +1,1807 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return BackendServicesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new BackendServicesClient($options); + } + + /** @test */ + public function addSignedUrlKeyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addSignedUrlKeyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addSignedUrlKeyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $signedUrlKeyResource = new SignedUrlKey(); + $request = (new AddSignedUrlKeyBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setSignedUrlKeyResource($signedUrlKeyResource); + $response = $gapicClient->addSignedUrlKey($request); + $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.BackendServices/AddSignedUrlKey', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSignedUrlKeyResource(); + $this->assertProtobufEquals($signedUrlKeyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function addSignedUrlKeyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addSignedUrlKeyExceptionTest'); + $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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $signedUrlKeyResource = new SignedUrlKey(); + $request = (new AddSignedUrlKeyBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setSignedUrlKeyResource($signedUrlKeyResource); + $response = $gapicClient->addSignedUrlKey($request); + $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 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 BackendServicesScopedList(), + ]; + $expectedResponse = new BackendServiceAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListBackendServicesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.BackendServices/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'; + $request = (new AggregatedListBackendServicesRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $request = (new DeleteBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.BackendServices/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $request = (new DeleteBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project); + $response = $gapicClient->delete($request); + $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 deleteSignedUrlKeyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deleteSignedUrlKeyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteSignedUrlKeyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendService = 'backendService306946058'; + $keyName = 'keyName500938859'; + $project = 'project-309310695'; + $request = (new DeleteSignedUrlKeyBackendServiceRequest()) + ->setBackendService($backendService) + ->setKeyName($keyName) + ->setProject($project); + $response = $gapicClient->deleteSignedUrlKey($request); + $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.BackendServices/DeleteSignedUrlKey', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualApiRequestObject->getKeyName(); + $this->assertProtobufEquals($keyName, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteSignedUrlKeyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deleteSignedUrlKeyExceptionTest'); + $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 + $backendService = 'backendService306946058'; + $keyName = 'keyName500938859'; + $project = 'project-309310695'; + $request = (new DeleteSignedUrlKeyBackendServiceRequest()) + ->setBackendService($backendService) + ->setKeyName($keyName) + ->setProject($project); + $response = $gapicClient->deleteSignedUrlKey($request); + $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 + $affinityCookieTtlSec = 1777486694; + $compressionMode = 'compressionMode-2051962660'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $edgeSecurityPolicy = 'edgeSecurityPolicy-1032704881'; + $enableCDN = false; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $loadBalancingScheme = 'loadBalancingScheme1974502980'; + $localityLbPolicy = 'localityLbPolicy-2016052161'; + $name = 'name3373707'; + $network = 'network1843485230'; + $port = 3446913; + $portName = 'portName1115276169'; + $protocol = 'protocol-989163880'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $selfLink = 'selfLink-1691268851'; + $serviceLbPolicy = 'serviceLbPolicy1168590609'; + $sessionAffinity = 'sessionAffinity1000759473'; + $timeoutSec = 2067488653; + $expectedResponse = new BackendService(); + $expectedResponse->setAffinityCookieTtlSec($affinityCookieTtlSec); + $expectedResponse->setCompressionMode($compressionMode); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEdgeSecurityPolicy($edgeSecurityPolicy); + $expectedResponse->setEnableCDN($enableCDN); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLoadBalancingScheme($loadBalancingScheme); + $expectedResponse->setLocalityLbPolicy($localityLbPolicy); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setPort($port); + $expectedResponse->setPortName($portName); + $expectedResponse->setProtocol($protocol); + $expectedResponse->setRegion($region); + $expectedResponse->setSecurityPolicy($securityPolicy); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setServiceLbPolicy($serviceLbPolicy); + $expectedResponse->setSessionAffinity($sessionAffinity); + $expectedResponse->setTimeoutSec($timeoutSec); + $transport->addResponse($expectedResponse); + // Mock request + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $request = (new GetBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.BackendServices/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $request = (new GetBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getHealthTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $kind = 'kind3292052'; + $expectedResponse = new BackendServiceGroupHealth(); + $expectedResponse->setKind($kind); + $transport->addResponse($expectedResponse); + // Mock request + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $resourceGroupReferenceResource = new ResourceGroupReference(); + $request = (new GetHealthBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setResourceGroupReferenceResource($resourceGroupReferenceResource); + $response = $gapicClient->getHealth($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.BackendServices/GetHealth', $actualFuncCall); + $actualValue = $actualRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResourceGroupReferenceResource(); + $this->assertProtobufEquals($resourceGroupReferenceResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getHealthExceptionTest() + { + $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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $resourceGroupReferenceResource = new ResourceGroupReference(); + $request = (new GetHealthBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setResourceGroupReferenceResource($resourceGroupReferenceResource); + try { + $gapicClient->getHealth($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyBackendServiceRequest()) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.BackendServices/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyBackendServiceRequest()) + ->setProject($project) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $request = (new InsertBackendServiceRequest()) + ->setBackendServiceResource($backendServiceResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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.BackendServices/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendServiceResource(); + $this->assertProtobufEquals($backendServiceResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $request = (new InsertBackendServiceRequest()) + ->setBackendServiceResource($backendServiceResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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 BackendService(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new BackendServiceList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListBackendServicesRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.BackendServices/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListBackendServicesRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listUsableTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new BackendService(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new BackendServiceListUsable(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListUsableBackendServicesRequest()) + ->setProject($project); + $response = $gapicClient->listUsable($request); + $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.BackendServices/ListUsable', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listUsableExceptionTest() + { + $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'; + $request = (new ListUsableBackendServicesRequest()) + ->setProject($project); + try { + $gapicClient->listUsable($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendService = 'backendService306946058'; + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $request = (new PatchBackendServiceRequest()) + ->setBackendService($backendService) + ->setBackendServiceResource($backendServiceResource) + ->setProject($project); + $response = $gapicClient->patch($request); + $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.BackendServices/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualApiRequestObject->getBackendServiceResource(); + $this->assertProtobufEquals($backendServiceResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $backendService = 'backendService306946058'; + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $request = (new PatchBackendServiceRequest()) + ->setBackendService($backendService) + ->setBackendServiceResource($backendServiceResource) + ->setProject($project); + $response = $gapicClient->patch($request); + $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 setEdgeSecurityPolicyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setEdgeSecurityPolicyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setEdgeSecurityPolicyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $request = (new SetEdgeSecurityPolicyBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + $response = $gapicClient->setEdgeSecurityPolicy($request); + $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.BackendServices/SetEdgeSecurityPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyReferenceResource(); + $this->assertProtobufEquals($securityPolicyReferenceResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setEdgeSecurityPolicyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setEdgeSecurityPolicyExceptionTest'); + $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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $request = (new SetEdgeSecurityPolicyBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + $response = $gapicClient->setEdgeSecurityPolicy($request); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetIamPolicyBackendServiceRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.BackendServices/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getGlobalSetPolicyRequestResource(); + $this->assertProtobufEquals($globalSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetIamPolicyBackendServiceRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setSecurityPolicyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setSecurityPolicyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setSecurityPolicyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $request = (new SetSecurityPolicyBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + $response = $gapicClient->setSecurityPolicy($request); + $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.BackendServices/SetSecurityPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyReferenceResource(); + $this->assertProtobufEquals($securityPolicyReferenceResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setSecurityPolicyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setSecurityPolicyExceptionTest'); + $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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $request = (new SetSecurityPolicyBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + $response = $gapicClient->setSecurityPolicy($request); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsBackendServiceRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.BackendServices/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsBackendServiceRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function updateTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $backendService = 'backendService306946058'; + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $request = (new UpdateBackendServiceRequest()) + ->setBackendService($backendService) + ->setBackendServiceResource($backendServiceResource) + ->setProject($project); + $response = $gapicClient->update($request); + $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.BackendServices/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualApiRequestObject->getBackendServiceResource(); + $this->assertProtobufEquals($backendServiceResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $backendService = 'backendService306946058'; + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $request = (new UpdateBackendServiceRequest()) + ->setBackendService($backendService) + ->setBackendServiceResource($backendServiceResource) + ->setProject($project); + $response = $gapicClient->update($request); + $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 addSignedUrlKeyAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addSignedUrlKeyAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addSignedUrlKeyAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $signedUrlKeyResource = new SignedUrlKey(); + $request = (new AddSignedUrlKeyBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setSignedUrlKeyResource($signedUrlKeyResource); + $response = $gapicClient->addSignedUrlKey($request); + $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.BackendServices/AddSignedUrlKey', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSignedUrlKeyResource(); + $this->assertProtobufEquals($signedUrlKeyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/DiskTypesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/DiskTypesClientTest.php new file mode 100644 index 000000000000..01cd5e8428c9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/DiskTypesClientTest.php @@ -0,0 +1,368 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return DiskTypesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DiskTypesClient($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 DiskTypesScopedList(), + ]; + $expectedResponse = new DiskTypeAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListDiskTypesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.DiskTypes/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'; + $request = (new AggregatedListDiskTypesRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $creationTimestamp = 'creationTimestamp567396278'; + $defaultDiskSizeGb = 807490165; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $validDiskSize = 'validDiskSize-1653521184'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new DiskType(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDefaultDiskSizeGb($defaultDiskSizeGb); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setValidDiskSize($validDiskSize); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $diskType = 'diskType93009052'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetDiskTypeRequest()) + ->setDiskType($diskType) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.DiskTypes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getDiskType(); + $this->assertProtobufEquals($diskType, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $diskType = 'diskType93009052'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetDiskTypeRequest()) + ->setDiskType($diskType) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 DiskType(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new DiskTypeList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListDiskTypesRequest()) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->list($request); + $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.DiskTypes/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + $request = (new ListDiskTypesRequest()) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function aggregatedListAsyncTest() + { + $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 DiskTypesScopedList(), + ]; + $expectedResponse = new DiskTypeAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListDiskTypesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.DiskTypes/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/DisksClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/DisksClientTest.php new file mode 100644 index 000000000000..82e09abfc359 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/DisksClientTest.php @@ -0,0 +1,2289 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return DisksClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DisksClient($options); + } + + /** @test */ + public function addResourcePoliciesTest() + { + $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/addResourcePoliciesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addResourcePoliciesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $disksAddResourcePoliciesRequestResource = new DisksAddResourcePoliciesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new AddResourcePoliciesDiskRequest()) + ->setDisk($disk) + ->setDisksAddResourcePoliciesRequestResource($disksAddResourcePoliciesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->addResourcePolicies($request); + $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/AddResourcePolicies', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getDisksAddResourcePoliciesRequestResource(); + $this->assertProtobufEquals($disksAddResourcePoliciesRequestResource, $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 addResourcePoliciesExceptionTest() + { + $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/addResourcePoliciesExceptionTest'); + $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'; + $disksAddResourcePoliciesRequestResource = new DisksAddResourcePoliciesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new AddResourcePoliciesDiskRequest()) + ->setDisk($disk) + ->setDisksAddResourcePoliciesRequestResource($disksAddResourcePoliciesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->addResourcePolicies($request); + $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 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 DisksScopedList(), + ]; + $expectedResponse = new DiskAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListDisksRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.Disks/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'; + $request = (new AggregatedListDisksRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function bulkInsertTest() + { + $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/bulkInsertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/bulkInsertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $bulkInsertDiskResourceResource = new BulkInsertDiskResource(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new BulkInsertDiskRequest()) + ->setBulkInsertDiskResourceResource($bulkInsertDiskResourceResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->bulkInsert($request); + $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/BulkInsert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBulkInsertDiskResourceResource(); + $this->assertProtobufEquals($bulkInsertDiskResourceResource, $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 bulkInsertExceptionTest() + { + $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/bulkInsertExceptionTest'); + $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 + $bulkInsertDiskResourceResource = new BulkInsertDiskResource(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new BulkInsertDiskRequest()) + ->setBulkInsertDiskResourceResource($bulkInsertDiskResourceResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->bulkInsert($request); + $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 createSnapshotTest() + { + $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/createSnapshotTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/createSnapshotTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $snapshotResource = new Snapshot(); + $zone = 'zone3744684'; + $request = (new CreateSnapshotDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setSnapshotResource($snapshotResource) + ->setZone($zone); + $response = $gapicClient->createSnapshot($request); + $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/CreateSnapshot', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSnapshotResource(); + $this->assertProtobufEquals($snapshotResource, $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 createSnapshotExceptionTest() + { + $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/createSnapshotExceptionTest'); + $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'; + $project = 'project-309310695'; + $snapshotResource = new Snapshot(); + $zone = 'zone3744684'; + $request = (new CreateSnapshotDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setSnapshotResource($snapshotResource) + ->setZone($zone); + $response = $gapicClient->createSnapshot($request); + $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 deleteTest() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $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 deleteExceptionTest() + { + $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/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 + $disk = 'disk3083677'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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 + $architecture = 'architecture839674195'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $enableConfidentialCompute = true; + $id = 3355; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $lastAttachTimestamp = 'lastAttachTimestamp-2105323995'; + $lastDetachTimestamp = 'lastDetachTimestamp-480399885'; + $locationHint = 'locationHint-1796964143'; + $name = 'name3373707'; + $options = 'options-1249474914'; + $physicalBlockSizeBytes = 1190604793; + $provisionedIops = 1260510932; + $provisionedThroughput = 1600266005; + $region = 'region-934795532'; + $satisfiesPzi = false; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $sizeGb = 2105542105; + $sourceConsistencyGroupPolicy = 'sourceConsistencyGroupPolicy19616093'; + $sourceConsistencyGroupPolicyId = 'sourceConsistencyGroupPolicyId267568957'; + $sourceDisk = 'sourceDisk-85117119'; + $sourceDiskId = 'sourceDiskId-1693292839'; + $sourceImage = 'sourceImage1661056055'; + $sourceImageId = 'sourceImageId-2092155357'; + $sourceInstantSnapshot = 'sourceInstantSnapshot-317668858'; + $sourceInstantSnapshotId = 'sourceInstantSnapshotId-1859900940'; + $sourceSnapshot = 'sourceSnapshot-947679896'; + $sourceSnapshotId = 'sourceSnapshotId-1511650478'; + $sourceStorageObject = 'sourceStorageObject-303818201'; + $status = 'status-892481550'; + $storagePool = 'storagePool897344352'; + $type = 'type3575610'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new Disk(); + $expectedResponse->setArchitecture($architecture); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEnableConfidentialCompute($enableConfidentialCompute); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setLastAttachTimestamp($lastAttachTimestamp); + $expectedResponse->setLastDetachTimestamp($lastDetachTimestamp); + $expectedResponse->setLocationHint($locationHint); + $expectedResponse->setName($name); + $expectedResponse->setOptions($options); + $expectedResponse->setPhysicalBlockSizeBytes($physicalBlockSizeBytes); + $expectedResponse->setProvisionedIops($provisionedIops); + $expectedResponse->setProvisionedThroughput($provisionedThroughput); + $expectedResponse->setRegion($region); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSizeGb($sizeGb); + $expectedResponse->setSourceConsistencyGroupPolicy($sourceConsistencyGroupPolicy); + $expectedResponse->setSourceConsistencyGroupPolicyId($sourceConsistencyGroupPolicyId); + $expectedResponse->setSourceDisk($sourceDisk); + $expectedResponse->setSourceDiskId($sourceDiskId); + $expectedResponse->setSourceImage($sourceImage); + $expectedResponse->setSourceImageId($sourceImageId); + $expectedResponse->setSourceInstantSnapshot($sourceInstantSnapshot); + $expectedResponse->setSourceInstantSnapshotId($sourceInstantSnapshotId); + $expectedResponse->setSourceSnapshot($sourceSnapshot); + $expectedResponse->setSourceSnapshotId($sourceSnapshotId); + $expectedResponse->setSourceStorageObject($sourceStorageObject); + $expectedResponse->setStatus($status); + $expectedResponse->setStoragePool($storagePool); + $expectedResponse->setType($type); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Disks/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $disk = 'disk3083677'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $request = (new GetIamPolicyDiskRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Disks/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $request = (new GetIamPolicyDiskRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $diskResource = new Disk(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new InsertDiskRequest()) + ->setDiskResource($diskResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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/Insert', $actualApiFuncCall); + $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 insertExceptionTest() + { + $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/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 + $diskResource = new Disk(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new InsertDiskRequest()) + ->setDiskResource($diskResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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 Disk(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new DiskList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListDisksRequest()) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->list($request); + $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.Disks/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + $request = (new ListDisksRequest()) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function removeResourcePoliciesTest() + { + $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/removeResourcePoliciesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeResourcePoliciesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $disksRemoveResourcePoliciesRequestResource = new DisksRemoveResourcePoliciesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new RemoveResourcePoliciesDiskRequest()) + ->setDisk($disk) + ->setDisksRemoveResourcePoliciesRequestResource($disksRemoveResourcePoliciesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->removeResourcePolicies($request); + $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/RemoveResourcePolicies', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getDisksRemoveResourcePoliciesRequestResource(); + $this->assertProtobufEquals($disksRemoveResourcePoliciesRequestResource, $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 removeResourcePoliciesExceptionTest() + { + $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/removeResourcePoliciesExceptionTest'); + $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'; + $disksRemoveResourcePoliciesRequestResource = new DisksRemoveResourcePoliciesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new RemoveResourcePoliciesDiskRequest()) + ->setDisk($disk) + ->setDisksRemoveResourcePoliciesRequestResource($disksRemoveResourcePoliciesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->removeResourcePolicies($request); + $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 resizeTest() + { + $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/resizeTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/resizeTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $disksResizeRequestResource = new DisksResizeRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ResizeDiskRequest()) + ->setDisk($disk) + ->setDisksResizeRequestResource($disksResizeRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->resize($request); + $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/Resize', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getDisksResizeRequestResource(); + $this->assertProtobufEquals($disksResizeRequestResource, $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 resizeExceptionTest() + { + $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/resizeExceptionTest'); + $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'; + $disksResizeRequestResource = new DisksResizeRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ResizeDiskRequest()) + ->setDisk($disk) + ->setDisksResizeRequestResource($disksResizeRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->resize($request); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $request = (new SetIamPolicyDiskRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Disks/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $actualValue = $actualRequestObject->getZoneSetPolicyRequestResource(); + $this->assertProtobufEquals($zoneSetPolicyRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $request = (new SetIamPolicyDiskRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setLabelsTest() + { + $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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetLabelsRequestResource = new ZoneSetLabelsRequest(); + $request = (new SetLabelsDiskRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetLabelsRequestResource($zoneSetLabelsRequestResource); + $response = $gapicClient->setLabels($request); + $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/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualApiRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $actualValue = $actualApiRequestObject->getZoneSetLabelsRequestResource(); + $this->assertProtobufEquals($zoneSetLabelsRequestResource, $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 setLabelsExceptionTest() + { + $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/setLabelsExceptionTest'); + $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 + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetLabelsRequestResource = new ZoneSetLabelsRequest(); + $request = (new SetLabelsDiskRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetLabelsRequestResource($zoneSetLabelsRequestResource); + $response = $gapicClient->setLabels($request); + $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 startAsyncReplicationTest() + { + $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/startAsyncReplicationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/startAsyncReplicationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $disksStartAsyncReplicationRequestResource = new DisksStartAsyncReplicationRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new StartAsyncReplicationDiskRequest()) + ->setDisk($disk) + ->setDisksStartAsyncReplicationRequestResource($disksStartAsyncReplicationRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->startAsyncReplication($request); + $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/StartAsyncReplication', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getDisksStartAsyncReplicationRequestResource(); + $this->assertProtobufEquals($disksStartAsyncReplicationRequestResource, $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 startAsyncReplicationExceptionTest() + { + $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/startAsyncReplicationExceptionTest'); + $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'; + $disksStartAsyncReplicationRequestResource = new DisksStartAsyncReplicationRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new StartAsyncReplicationDiskRequest()) + ->setDisk($disk) + ->setDisksStartAsyncReplicationRequestResource($disksStartAsyncReplicationRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->startAsyncReplication($request); + $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 stopAsyncReplicationTest() + { + $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/stopAsyncReplicationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/stopAsyncReplicationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new StopAsyncReplicationDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->stopAsyncReplication($request); + $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/StopAsyncReplication', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $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 stopAsyncReplicationExceptionTest() + { + $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/stopAsyncReplicationExceptionTest'); + $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'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new StopAsyncReplicationDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->stopAsyncReplication($request); + $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 stopGroupAsyncReplicationTest() + { + $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/stopGroupAsyncReplicationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/stopGroupAsyncReplicationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disksStopGroupAsyncReplicationResourceResource = new DisksStopGroupAsyncReplicationResource(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new StopGroupAsyncReplicationDiskRequest()) + ->setDisksStopGroupAsyncReplicationResourceResource($disksStopGroupAsyncReplicationResourceResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->stopGroupAsyncReplication($request); + $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/StopGroupAsyncReplication', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisksStopGroupAsyncReplicationResourceResource(); + $this->assertProtobufEquals($disksStopGroupAsyncReplicationResourceResource, $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 stopGroupAsyncReplicationExceptionTest() + { + $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/stopGroupAsyncReplicationExceptionTest'); + $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 + $disksStopGroupAsyncReplicationResourceResource = new DisksStopGroupAsyncReplicationResource(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new StopGroupAsyncReplicationDiskRequest()) + ->setDisksStopGroupAsyncReplicationResourceResource($disksStopGroupAsyncReplicationResourceResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->stopGroupAsyncReplication($request); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + $request = (new TestIamPermissionsDiskRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Disks/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + $request = (new TestIamPermissionsDiskRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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'; + $request = (new UpdateDiskRequest()) + ->setDisk($disk) + ->setDiskResource($diskResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->update($request); + $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'; + $request = (new UpdateDiskRequest()) + ->setDisk($disk) + ->setDiskResource($diskResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->update($request); + $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 addResourcePoliciesAsyncTest() + { + $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/addResourcePoliciesAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addResourcePoliciesAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $disksAddResourcePoliciesRequestResource = new DisksAddResourcePoliciesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new AddResourcePoliciesDiskRequest()) + ->setDisk($disk) + ->setDisksAddResourcePoliciesRequestResource($disksAddResourcePoliciesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->addResourcePolicies($request); + $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/AddResourcePolicies', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getDisksAddResourcePoliciesRequestResource(); + $this->assertProtobufEquals($disksAddResourcePoliciesRequestResource, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ExternalVpnGatewaysClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ExternalVpnGatewaysClientTest.php new file mode 100644 index 000000000000..6825baea0ce1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ExternalVpnGatewaysClientTest.php @@ -0,0 +1,742 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ExternalVpnGatewaysClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ExternalVpnGatewaysClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $externalVpnGateway = 'externalVpnGateway-2037585019'; + $project = 'project-309310695'; + $request = (new DeleteExternalVpnGatewayRequest()) + ->setExternalVpnGateway($externalVpnGateway) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.ExternalVpnGateways/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getExternalVpnGateway(); + $this->assertProtobufEquals($externalVpnGateway, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $externalVpnGateway = 'externalVpnGateway-2037585019'; + $project = 'project-309310695'; + $request = (new DeleteExternalVpnGatewayRequest()) + ->setExternalVpnGateway($externalVpnGateway) + ->setProject($project); + $response = $gapicClient->delete($request); + $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'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $redundancyType = 'redundancyType1345185564'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new ExternalVpnGateway(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setRedundancyType($redundancyType); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $externalVpnGateway = 'externalVpnGateway-2037585019'; + $project = 'project-309310695'; + $request = (new GetExternalVpnGatewayRequest()) + ->setExternalVpnGateway($externalVpnGateway) + ->setProject($project); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.ExternalVpnGateways/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getExternalVpnGateway(); + $this->assertProtobufEquals($externalVpnGateway, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $externalVpnGateway = 'externalVpnGateway-2037585019'; + $project = 'project-309310695'; + $request = (new GetExternalVpnGatewayRequest()) + ->setExternalVpnGateway($externalVpnGateway) + ->setProject($project); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $externalVpnGatewayResource = new ExternalVpnGateway(); + $project = 'project-309310695'; + $request = (new InsertExternalVpnGatewayRequest()) + ->setExternalVpnGatewayResource($externalVpnGatewayResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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.ExternalVpnGateways/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getExternalVpnGatewayResource(); + $this->assertProtobufEquals($externalVpnGatewayResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $externalVpnGatewayResource = new ExternalVpnGateway(); + $project = 'project-309310695'; + $request = (new InsertExternalVpnGatewayRequest()) + ->setExternalVpnGatewayResource($externalVpnGatewayResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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 + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new ExternalVpnGateway(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new ExternalVpnGatewayList(); + $expectedResponse->setEtag($etag); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListExternalVpnGatewaysRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.ExternalVpnGateways/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListExternalVpnGatewaysRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setLabelsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetLabelsExternalVpnGatewayRequest()) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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.ExternalVpnGateways/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getGlobalSetLabelsRequestResource(); + $this->assertProtobufEquals($globalSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setLabelsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsExceptionTest'); + $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 + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetLabelsExternalVpnGatewayRequest()) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsExternalVpnGatewayRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.ExternalVpnGateways/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsExternalVpnGatewayRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $externalVpnGateway = 'externalVpnGateway-2037585019'; + $project = 'project-309310695'; + $request = (new DeleteExternalVpnGatewayRequest()) + ->setExternalVpnGateway($externalVpnGateway) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.ExternalVpnGateways/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getExternalVpnGateway(); + $this->assertProtobufEquals($externalVpnGateway, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/FirewallPoliciesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/FirewallPoliciesClientTest.php new file mode 100644 index 000000000000..5da498242f39 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/FirewallPoliciesClientTest.php @@ -0,0 +1,1897 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return FirewallPoliciesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new FirewallPoliciesClient($options); + } + + /** @test */ + public function addAssociationTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/addAssociationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addAssociationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyAssociationResource = new FirewallPolicyAssociation(); + $request = (new AddAssociationFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyAssociationResource($firewallPolicyAssociationResource); + $response = $gapicClient->addAssociation($request); + $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.FirewallPolicies/AddAssociation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyAssociationResource(); + $this->assertProtobufEquals($firewallPolicyAssociationResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOrganizationOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $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.GlobalOrganizationOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function addAssociationExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/addAssociationExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyAssociationResource = new FirewallPolicyAssociation(); + $request = (new AddAssociationFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyAssociationResource($firewallPolicyAssociationResource); + $response = $gapicClient->addAssociation($request); + $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 addRuleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/addRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $request = (new AddRuleFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource); + $response = $gapicClient->addRule($request); + $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.FirewallPolicies/AddRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyRuleResource(); + $this->assertProtobufEquals($firewallPolicyRuleResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOrganizationOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $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.GlobalOrganizationOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function addRuleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/addRuleExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $request = (new AddRuleFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource); + $response = $gapicClient->addRule($request); + $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 cloneRulesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/cloneRulesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/cloneRulesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $request = (new CloneRulesFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + $response = $gapicClient->cloneRules($request); + $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.FirewallPolicies/CloneRules', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOrganizationOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $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.GlobalOrganizationOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function cloneRulesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/cloneRulesExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $request = (new CloneRulesFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + $response = $gapicClient->cloneRules($request); + $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 deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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 + $firewallPolicy = 'firewallPolicy1035044177'; + $request = (new DeleteFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + $response = $gapicClient->delete($request); + $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.FirewallPolicies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOrganizationOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $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.GlobalOrganizationOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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 + $firewallPolicy = 'firewallPolicy1035044177'; + $request = (new DeleteFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + $response = $gapicClient->delete($request); + $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'; + $displayName = 'displayName1615086568'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $parent = 'parent-995424086'; + $region = 'region-934795532'; + $ruleTupleCount = 388342037; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $shortName = 'shortName1565793390'; + $expectedResponse = new FirewallPolicy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setRegion($region); + $expectedResponse->setRuleTupleCount($ruleTupleCount); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $expectedResponse->setShortName($shortName); + $transport->addResponse($expectedResponse); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $request = (new GetFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.FirewallPolicies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $request = (new GetFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAssociationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $attachmentTarget = 'attachmentTarget1786386477'; + $displayName = 'displayName1615086568'; + $firewallPolicyId = 'firewallPolicyId1430953673'; + $name2 = 'name2-1052831874'; + $shortName = 'shortName1565793390'; + $expectedResponse = new FirewallPolicyAssociation(); + $expectedResponse->setAttachmentTarget($attachmentTarget); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setFirewallPolicyId($firewallPolicyId); + $expectedResponse->setName($name2); + $expectedResponse->setShortName($shortName); + $transport->addResponse($expectedResponse); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $request = (new GetAssociationFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + $response = $gapicClient->getAssociation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.FirewallPolicies/GetAssociation', $actualFuncCall); + $actualValue = $actualRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAssociationExceptionTest() + { + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $request = (new GetAssociationFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + try { + $gapicClient->getAssociation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $request = (new GetIamPolicyFirewallPolicyRequest()) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.FirewallPolicies/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $request = (new GetIamPolicyFirewallPolicyRequest()) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRuleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $action = 'action-1422950858'; + $description = 'description-1724546052'; + $direction = 'direction-962590849'; + $disabled = true; + $enableLogging = false; + $kind = 'kind3292052'; + $priority2 = 978365527; + $ruleName = 'ruleName-2092197394'; + $ruleTupleCount = 388342037; + $securityProfileGroup = 'securityProfileGroup-329459286'; + $tlsInspect = true; + $expectedResponse = new FirewallPolicyRule(); + $expectedResponse->setAction($action); + $expectedResponse->setDescription($description); + $expectedResponse->setDirection($direction); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setEnableLogging($enableLogging); + $expectedResponse->setKind($kind); + $expectedResponse->setPriority($priority2); + $expectedResponse->setRuleName($ruleName); + $expectedResponse->setRuleTupleCount($ruleTupleCount); + $expectedResponse->setSecurityProfileGroup($securityProfileGroup); + $expectedResponse->setTlsInspect($tlsInspect); + $transport->addResponse($expectedResponse); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $request = (new GetRuleFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + $response = $gapicClient->getRule($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.FirewallPolicies/GetRule', $actualFuncCall); + $actualValue = $actualRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRuleExceptionTest() + { + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $request = (new GetRuleFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + try { + $gapicClient->getRule($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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 + $firewallPolicyResource = new FirewallPolicy(); + $parentId = 'parentId2070327504'; + $request = (new InsertFirewallPolicyRequest()) + ->setFirewallPolicyResource($firewallPolicyResource) + ->setParentId($parentId); + $response = $gapicClient->insert($request); + $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.FirewallPolicies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicyResource(); + $this->assertProtobufEquals($firewallPolicyResource, $actualValue); + $actualValue = $actualApiRequestObject->getParentId(); + $this->assertProtobufEquals($parentId, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOrganizationOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $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.GlobalOrganizationOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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 + $firewallPolicyResource = new FirewallPolicy(); + $parentId = 'parentId2070327504'; + $request = (new InsertFirewallPolicyRequest()) + ->setFirewallPolicyResource($firewallPolicyResource) + ->setParentId($parentId); + $response = $gapicClient->insert($request); + $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 = ''; + $itemsElement = new FirewallPolicy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new FirewallPolicyList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + $request = new ListFirewallPoliciesRequest(); + $response = $gapicClient->list($request); + $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.FirewallPolicies/List', $actualFuncCall); + $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); + $request = new ListFirewallPoliciesRequest(); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAssociationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $kind = 'kind3292052'; + $expectedResponse = new FirewallPoliciesListAssociationsResponse(); + $expectedResponse->setKind($kind); + $transport->addResponse($expectedResponse); + $request = new ListAssociationsFirewallPolicyRequest(); + $response = $gapicClient->listAssociations($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.FirewallPolicies/ListAssociations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAssociationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListAssociationsFirewallPolicyRequest(); + try { + $gapicClient->listAssociations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function moveTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/moveTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/moveTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $parentId = 'parentId2070327504'; + $request = (new MoveFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setParentId($parentId); + $response = $gapicClient->move($request); + $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.FirewallPolicies/Move', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getParentId(); + $this->assertProtobufEquals($parentId, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOrganizationOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $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.GlobalOrganizationOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function moveExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/moveExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $parentId = 'parentId2070327504'; + $request = (new MoveFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setParentId($parentId); + $response = $gapicClient->move($request); + $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 patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyResource = new FirewallPolicy(); + $request = (new PatchFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyResource($firewallPolicyResource); + $response = $gapicClient->patch($request); + $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.FirewallPolicies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyResource(); + $this->assertProtobufEquals($firewallPolicyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOrganizationOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $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.GlobalOrganizationOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/patchExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyResource = new FirewallPolicy(); + $request = (new PatchFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyResource($firewallPolicyResource); + $response = $gapicClient->patch($request); + $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 patchRuleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/patchRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $request = (new PatchRuleFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource); + $response = $gapicClient->patchRule($request); + $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.FirewallPolicies/PatchRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyRuleResource(); + $this->assertProtobufEquals($firewallPolicyRuleResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOrganizationOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $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.GlobalOrganizationOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchRuleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/patchRuleExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $request = (new PatchRuleFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource); + $response = $gapicClient->patchRule($request); + $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 removeAssociationTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/removeAssociationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeAssociationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $request = (new RemoveAssociationFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + $response = $gapicClient->removeAssociation($request); + $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.FirewallPolicies/RemoveAssociation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOrganizationOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $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.GlobalOrganizationOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function removeAssociationExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/removeAssociationExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $request = (new RemoveAssociationFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + $response = $gapicClient->removeAssociation($request); + $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 removeRuleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/removeRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $request = (new RemoveRuleFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + $response = $gapicClient->removeRule($request); + $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.FirewallPolicies/RemoveRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOrganizationOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $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.GlobalOrganizationOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function removeRuleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/removeRuleExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $request = (new RemoveRuleFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy); + $response = $gapicClient->removeRule($request); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $globalOrganizationSetPolicyRequestResource = new GlobalOrganizationSetPolicyRequest(); + $resource = 'resource-341064690'; + $request = (new SetIamPolicyFirewallPolicyRequest()) + ->setGlobalOrganizationSetPolicyRequestResource($globalOrganizationSetPolicyRequestResource) + ->setResource($resource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.FirewallPolicies/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getGlobalOrganizationSetPolicyRequestResource(); + $this->assertProtobufEquals($globalOrganizationSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $globalOrganizationSetPolicyRequestResource = new GlobalOrganizationSetPolicyRequest(); + $resource = 'resource-341064690'; + $request = (new SetIamPolicyFirewallPolicyRequest()) + ->setGlobalOrganizationSetPolicyRequestResource($globalOrganizationSetPolicyRequestResource) + ->setResource($resource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsFirewallPolicyRequest()) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.FirewallPolicies/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsFirewallPolicyRequest()) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function addAssociationAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/addAssociationAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addAssociationAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyAssociationResource = new FirewallPolicyAssociation(); + $request = (new AddAssociationFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyAssociationResource($firewallPolicyAssociationResource); + $response = $gapicClient->addAssociation($request); + $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.FirewallPolicies/AddAssociation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyAssociationResource(); + $this->assertProtobufEquals($firewallPolicyAssociationResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOrganizationOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $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.GlobalOrganizationOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/FirewallsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/FirewallsClientTest.php new file mode 100644 index 000000000000..c57909b47c95 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/FirewallsClientTest.php @@ -0,0 +1,793 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return FirewallsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new FirewallsClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $firewall = 'firewall-562725632'; + $project = 'project-309310695'; + $request = (new DeleteFirewallRequest()) + ->setFirewall($firewall) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.Firewalls/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewall(); + $this->assertProtobufEquals($firewall, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $firewall = 'firewall-562725632'; + $project = 'project-309310695'; + $request = (new DeleteFirewallRequest()) + ->setFirewall($firewall) + ->setProject($project); + $response = $gapicClient->delete($request); + $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'; + $direction = 'direction-962590849'; + $disabled = true; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $network = 'network1843485230'; + $priority = 1165461084; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new Firewall(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDirection($direction); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setPriority($priority); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $firewall = 'firewall-562725632'; + $project = 'project-309310695'; + $request = (new GetFirewallRequest()) + ->setFirewall($firewall) + ->setProject($project); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Firewalls/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getFirewall(); + $this->assertProtobufEquals($firewall, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $firewall = 'firewall-562725632'; + $project = 'project-309310695'; + $request = (new GetFirewallRequest()) + ->setFirewall($firewall) + ->setProject($project); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $firewallResource = new Firewall(); + $project = 'project-309310695'; + $request = (new InsertFirewallRequest()) + ->setFirewallResource($firewallResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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.Firewalls/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallResource(); + $this->assertProtobufEquals($firewallResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $firewallResource = new Firewall(); + $project = 'project-309310695'; + $request = (new InsertFirewallRequest()) + ->setFirewallResource($firewallResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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 Firewall(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new FirewallList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListFirewallsRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.Firewalls/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListFirewallsRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewall = 'firewall-562725632'; + $firewallResource = new Firewall(); + $project = 'project-309310695'; + $request = (new PatchFirewallRequest()) + ->setFirewall($firewall) + ->setFirewallResource($firewallResource) + ->setProject($project); + $response = $gapicClient->patch($request); + $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.Firewalls/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewall(); + $this->assertProtobufEquals($firewall, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallResource(); + $this->assertProtobufEquals($firewallResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $firewall = 'firewall-562725632'; + $firewallResource = new Firewall(); + $project = 'project-309310695'; + $request = (new PatchFirewallRequest()) + ->setFirewall($firewall) + ->setFirewallResource($firewallResource) + ->setProject($project); + $response = $gapicClient->patch($request); + $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 updateTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $firewall = 'firewall-562725632'; + $firewallResource = new Firewall(); + $project = 'project-309310695'; + $request = (new UpdateFirewallRequest()) + ->setFirewall($firewall) + ->setFirewallResource($firewallResource) + ->setProject($project); + $response = $gapicClient->update($request); + $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.Firewalls/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewall(); + $this->assertProtobufEquals($firewall, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallResource(); + $this->assertProtobufEquals($firewallResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $firewall = 'firewall-562725632'; + $firewallResource = new Firewall(); + $project = 'project-309310695'; + $request = (new UpdateFirewallRequest()) + ->setFirewall($firewall) + ->setFirewallResource($firewallResource) + ->setProject($project); + $response = $gapicClient->update($request); + $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 deleteAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewall = 'firewall-562725632'; + $project = 'project-309310695'; + $request = (new DeleteFirewallRequest()) + ->setFirewall($firewall) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.Firewalls/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewall(); + $this->assertProtobufEquals($firewall, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ForwardingRulesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ForwardingRulesClientTest.php new file mode 100644 index 000000000000..af73033c5db7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ForwardingRulesClientTest.php @@ -0,0 +1,1072 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ForwardingRulesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ForwardingRulesClient($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 ForwardingRulesScopedList(), + ]; + $expectedResponse = new ForwardingRuleAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListForwardingRulesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.ForwardingRules/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'; + $request = (new AggregatedListForwardingRulesRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.ForwardingRules/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getForwardingRule(); + $this->assertProtobufEquals($forwardingRule, $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 + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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 + $iPAddress = 'iPAddress1116718767'; + $iPProtocol = 'iPProtocol488094525'; + $allPorts = true; + $allowGlobalAccess = true; + $allowPscGlobalAccess = false; + $backendService = 'backendService306946058'; + $baseForwardingRule = 'baseForwardingRule524873104'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $ipCollection = 'ipCollection176818358'; + $ipVersion = 'ipVersion-1315653184'; + $isMirroringCollector = true; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $loadBalancingScheme = 'loadBalancingScheme1974502980'; + $name = 'name3373707'; + $network = 'network1843485230'; + $networkTier = 'networkTier-19473069'; + $noAutomateDnsZone = false; + $portRange = 'portRange217518079'; + $pscConnectionId = 292082397; + $pscConnectionStatus = 'pscConnectionStatus-889592652'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $serviceLabel = 'serviceLabel-1730474774'; + $serviceName = 'serviceName359880149'; + $subnetwork = 'subnetwork-1302785042'; + $target = 'target-880905839'; + $expectedResponse = new ForwardingRule(); + $expectedResponse->setIPAddress($iPAddress); + $expectedResponse->setIPProtocol($iPProtocol); + $expectedResponse->setAllPorts($allPorts); + $expectedResponse->setAllowGlobalAccess($allowGlobalAccess); + $expectedResponse->setAllowPscGlobalAccess($allowPscGlobalAccess); + $expectedResponse->setBackendService($backendService); + $expectedResponse->setBaseForwardingRule($baseForwardingRule); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setIpCollection($ipCollection); + $expectedResponse->setIpVersion($ipVersion); + $expectedResponse->setIsMirroringCollector($isMirroringCollector); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setLoadBalancingScheme($loadBalancingScheme); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setNetworkTier($networkTier); + $expectedResponse->setNoAutomateDnsZone($noAutomateDnsZone); + $expectedResponse->setPortRange($portRange); + $expectedResponse->setPscConnectionId($pscConnectionId); + $expectedResponse->setPscConnectionStatus($pscConnectionStatus); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setServiceLabel($serviceLabel); + $expectedResponse->setServiceName($serviceName); + $expectedResponse->setSubnetwork($subnetwork); + $expectedResponse->setTarget($target); + $transport->addResponse($expectedResponse); + // Mock request + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.ForwardingRules/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getForwardingRule(); + $this->assertProtobufEquals($forwardingRule, $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 + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $forwardingRuleResource = new ForwardingRule(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertForwardingRuleRequest()) + ->setForwardingRuleResource($forwardingRuleResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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.ForwardingRules/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getForwardingRuleResource(); + $this->assertProtobufEquals($forwardingRuleResource, $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 + $forwardingRuleResource = new ForwardingRule(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertForwardingRuleRequest()) + ->setForwardingRuleResource($forwardingRuleResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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 ForwardingRule(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new ForwardingRuleList(); + $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'; + $request = (new ListForwardingRulesRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.ForwardingRules/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'; + $request = (new ListForwardingRulesRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $forwardingRule = 'forwardingRule-1340648706'; + $forwardingRuleResource = new ForwardingRule(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setForwardingRuleResource($forwardingRuleResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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.ForwardingRules/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getForwardingRule(); + $this->assertProtobufEquals($forwardingRule, $actualValue); + $actualValue = $actualApiRequestObject->getForwardingRuleResource(); + $this->assertProtobufEquals($forwardingRuleResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $forwardingRule = 'forwardingRule-1340648706'; + $forwardingRuleResource = new ForwardingRule(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setForwardingRuleResource($forwardingRuleResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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 setLabelsTest() + { + $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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $request = (new SetLabelsForwardingRuleRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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.ForwardingRules/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionSetLabelsRequestResource(); + $this->assertProtobufEquals($regionSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $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 setLabelsExceptionTest() + { + $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/setLabelsExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $request = (new SetLabelsForwardingRuleRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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 setTargetTest() + { + $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/setTargetTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setTargetTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetReferenceResource = new TargetReference(); + $request = (new SetTargetForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setProject($project) + ->setRegion($region) + ->setTargetReferenceResource($targetReferenceResource); + $response = $gapicClient->setTarget($request); + $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.ForwardingRules/SetTarget', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getForwardingRule(); + $this->assertProtobufEquals($forwardingRule, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetReferenceResource(); + $this->assertProtobufEquals($targetReferenceResource, $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 setTargetExceptionTest() + { + $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/setTargetExceptionTest'); + $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 + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetReferenceResource = new TargetReference(); + $request = (new SetTargetForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setProject($project) + ->setRegion($region) + ->setTargetReferenceResource($targetReferenceResource); + $response = $gapicClient->setTarget($request); + $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 aggregatedListAsyncTest() + { + $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 ForwardingRulesScopedList(), + ]; + $expectedResponse = new ForwardingRuleAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListForwardingRulesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.ForwardingRules/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalAddressesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalAddressesClientTest.php new file mode 100644 index 000000000000..9d5d03b48343 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalAddressesClientTest.php @@ -0,0 +1,811 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return GlobalAddressesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new GlobalAddressesClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $address = 'address-1147692044'; + $project = 'project-309310695'; + $request = (new DeleteGlobalAddressRequest()) + ->setAddress($address) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.GlobalAddresses/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAddress(); + $this->assertProtobufEquals($address, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $address = 'address-1147692044'; + $project = 'project-309310695'; + $request = (new DeleteGlobalAddressRequest()) + ->setAddress($address) + ->setProject($project); + $response = $gapicClient->delete($request); + $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 + $address2 = 'address2874543783'; + $addressType = 'addressType264307877'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $id = 3355; + $ipVersion = 'ipVersion-1315653184'; + $ipv6EndpointType = 'ipv6EndpointType-2049982644'; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $network = 'network1843485230'; + $networkTier = 'networkTier-19473069'; + $prefixLength = 1157046989; + $purpose = 'purpose-220463842'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $subnetwork = 'subnetwork-1302785042'; + $expectedResponse = new Address(); + $expectedResponse->setAddress($address2); + $expectedResponse->setAddressType($addressType); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setIpVersion($ipVersion); + $expectedResponse->setIpv6EndpointType($ipv6EndpointType); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setNetworkTier($networkTier); + $expectedResponse->setPrefixLength($prefixLength); + $expectedResponse->setPurpose($purpose); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $expectedResponse->setSubnetwork($subnetwork); + $transport->addResponse($expectedResponse); + // Mock request + $address = 'address-1147692044'; + $project = 'project-309310695'; + $request = (new GetGlobalAddressRequest()) + ->setAddress($address) + ->setProject($project); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.GlobalAddresses/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getAddress(); + $this->assertProtobufEquals($address, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $address = 'address-1147692044'; + $project = 'project-309310695'; + $request = (new GetGlobalAddressRequest()) + ->setAddress($address) + ->setProject($project); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $addressResource = new Address(); + $project = 'project-309310695'; + $request = (new InsertGlobalAddressRequest()) + ->setAddressResource($addressResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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.GlobalAddresses/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAddressResource(); + $this->assertProtobufEquals($addressResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $addressResource = new Address(); + $project = 'project-309310695'; + $request = (new InsertGlobalAddressRequest()) + ->setAddressResource($addressResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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 Address(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new AddressList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListGlobalAddressesRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.GlobalAddresses/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListGlobalAddressesRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function moveTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/moveTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/moveTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $address = 'address-1147692044'; + $globalAddressesMoveRequestResource = new GlobalAddressesMoveRequest(); + $project = 'project-309310695'; + $request = (new MoveGlobalAddressRequest()) + ->setAddress($address) + ->setGlobalAddressesMoveRequestResource($globalAddressesMoveRequestResource) + ->setProject($project); + $response = $gapicClient->move($request); + $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.GlobalAddresses/Move', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAddress(); + $this->assertProtobufEquals($address, $actualValue); + $actualValue = $actualApiRequestObject->getGlobalAddressesMoveRequestResource(); + $this->assertProtobufEquals($globalAddressesMoveRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function moveExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/moveExceptionTest'); + $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 + $address = 'address-1147692044'; + $globalAddressesMoveRequestResource = new GlobalAddressesMoveRequest(); + $project = 'project-309310695'; + $request = (new MoveGlobalAddressRequest()) + ->setAddress($address) + ->setGlobalAddressesMoveRequestResource($globalAddressesMoveRequestResource) + ->setProject($project); + $response = $gapicClient->move($request); + $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 setLabelsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetLabelsGlobalAddressRequest()) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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.GlobalAddresses/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getGlobalSetLabelsRequestResource(); + $this->assertProtobufEquals($globalSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setLabelsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsExceptionTest'); + $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 + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetLabelsGlobalAddressRequest()) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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 deleteAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $address = 'address-1147692044'; + $project = 'project-309310695'; + $request = (new DeleteGlobalAddressRequest()) + ->setAddress($address) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.GlobalAddresses/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAddress(); + $this->assertProtobufEquals($address, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalForwardingRulesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalForwardingRulesClientTest.php new file mode 100644 index 000000000000..ee1564b8e4f3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalForwardingRulesClientTest.php @@ -0,0 +1,962 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return GlobalForwardingRulesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new GlobalForwardingRulesClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $request = (new DeleteGlobalForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.GlobalForwardingRules/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getForwardingRule(); + $this->assertProtobufEquals($forwardingRule, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $request = (new DeleteGlobalForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setProject($project); + $response = $gapicClient->delete($request); + $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 + $iPAddress = 'iPAddress1116718767'; + $iPProtocol = 'iPProtocol488094525'; + $allPorts = true; + $allowGlobalAccess = true; + $allowPscGlobalAccess = false; + $backendService = 'backendService306946058'; + $baseForwardingRule = 'baseForwardingRule524873104'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $ipCollection = 'ipCollection176818358'; + $ipVersion = 'ipVersion-1315653184'; + $isMirroringCollector = true; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $loadBalancingScheme = 'loadBalancingScheme1974502980'; + $name = 'name3373707'; + $network = 'network1843485230'; + $networkTier = 'networkTier-19473069'; + $noAutomateDnsZone = false; + $portRange = 'portRange217518079'; + $pscConnectionId = 292082397; + $pscConnectionStatus = 'pscConnectionStatus-889592652'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $serviceLabel = 'serviceLabel-1730474774'; + $serviceName = 'serviceName359880149'; + $subnetwork = 'subnetwork-1302785042'; + $target = 'target-880905839'; + $expectedResponse = new ForwardingRule(); + $expectedResponse->setIPAddress($iPAddress); + $expectedResponse->setIPProtocol($iPProtocol); + $expectedResponse->setAllPorts($allPorts); + $expectedResponse->setAllowGlobalAccess($allowGlobalAccess); + $expectedResponse->setAllowPscGlobalAccess($allowPscGlobalAccess); + $expectedResponse->setBackendService($backendService); + $expectedResponse->setBaseForwardingRule($baseForwardingRule); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setIpCollection($ipCollection); + $expectedResponse->setIpVersion($ipVersion); + $expectedResponse->setIsMirroringCollector($isMirroringCollector); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setLoadBalancingScheme($loadBalancingScheme); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setNetworkTier($networkTier); + $expectedResponse->setNoAutomateDnsZone($noAutomateDnsZone); + $expectedResponse->setPortRange($portRange); + $expectedResponse->setPscConnectionId($pscConnectionId); + $expectedResponse->setPscConnectionStatus($pscConnectionStatus); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setServiceLabel($serviceLabel); + $expectedResponse->setServiceName($serviceName); + $expectedResponse->setSubnetwork($subnetwork); + $expectedResponse->setTarget($target); + $transport->addResponse($expectedResponse); + // Mock request + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $request = (new GetGlobalForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setProject($project); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.GlobalForwardingRules/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getForwardingRule(); + $this->assertProtobufEquals($forwardingRule, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $request = (new GetGlobalForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setProject($project); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $forwardingRuleResource = new ForwardingRule(); + $project = 'project-309310695'; + $request = (new InsertGlobalForwardingRuleRequest()) + ->setForwardingRuleResource($forwardingRuleResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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.GlobalForwardingRules/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getForwardingRuleResource(); + $this->assertProtobufEquals($forwardingRuleResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $forwardingRuleResource = new ForwardingRule(); + $project = 'project-309310695'; + $request = (new InsertGlobalForwardingRuleRequest()) + ->setForwardingRuleResource($forwardingRuleResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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 ForwardingRule(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new ForwardingRuleList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListGlobalForwardingRulesRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.GlobalForwardingRules/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListGlobalForwardingRulesRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $forwardingRule = 'forwardingRule-1340648706'; + $forwardingRuleResource = new ForwardingRule(); + $project = 'project-309310695'; + $request = (new PatchGlobalForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setForwardingRuleResource($forwardingRuleResource) + ->setProject($project); + $response = $gapicClient->patch($request); + $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.GlobalForwardingRules/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getForwardingRule(); + $this->assertProtobufEquals($forwardingRule, $actualValue); + $actualValue = $actualApiRequestObject->getForwardingRuleResource(); + $this->assertProtobufEquals($forwardingRuleResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $forwardingRule = 'forwardingRule-1340648706'; + $forwardingRuleResource = new ForwardingRule(); + $project = 'project-309310695'; + $request = (new PatchGlobalForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setForwardingRuleResource($forwardingRuleResource) + ->setProject($project); + $response = $gapicClient->patch($request); + $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 setLabelsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetLabelsGlobalForwardingRuleRequest()) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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.GlobalForwardingRules/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getGlobalSetLabelsRequestResource(); + $this->assertProtobufEquals($globalSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setLabelsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsExceptionTest'); + $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 + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetLabelsGlobalForwardingRuleRequest()) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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 setTargetTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setTargetTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setTargetTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $targetReferenceResource = new TargetReference(); + $request = (new SetTargetGlobalForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setProject($project) + ->setTargetReferenceResource($targetReferenceResource); + $response = $gapicClient->setTarget($request); + $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.GlobalForwardingRules/SetTarget', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getForwardingRule(); + $this->assertProtobufEquals($forwardingRule, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetReferenceResource(); + $this->assertProtobufEquals($targetReferenceResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setTargetExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setTargetExceptionTest'); + $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 + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $targetReferenceResource = new TargetReference(); + $request = (new SetTargetGlobalForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setProject($project) + ->setTargetReferenceResource($targetReferenceResource); + $response = $gapicClient->setTarget($request); + $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 deleteAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $request = (new DeleteGlobalForwardingRuleRequest()) + ->setForwardingRule($forwardingRule) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.GlobalForwardingRules/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getForwardingRule(); + $this->assertProtobufEquals($forwardingRule, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalNetworkEndpointGroupsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalNetworkEndpointGroupsClientTest.php new file mode 100644 index 000000000000..3e8a0c254995 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalNetworkEndpointGroupsClientTest.php @@ -0,0 +1,892 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return GlobalNetworkEndpointGroupsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new GlobalNetworkEndpointGroupsClient($options); + } + + /** @test */ + public function attachNetworkEndpointsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/attachNetworkEndpointsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/attachNetworkEndpointsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $globalNetworkEndpointGroupsAttachEndpointsRequestResource = new GlobalNetworkEndpointGroupsAttachEndpointsRequest(); + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $request = (new AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest()) + ->setGlobalNetworkEndpointGroupsAttachEndpointsRequestResource($globalNetworkEndpointGroupsAttachEndpointsRequestResource) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project); + $response = $gapicClient->attachNetworkEndpoints($request); + $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.GlobalNetworkEndpointGroups/AttachNetworkEndpoints', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getGlobalNetworkEndpointGroupsAttachEndpointsRequestResource(); + $this->assertProtobufEquals($globalNetworkEndpointGroupsAttachEndpointsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function attachNetworkEndpointsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/attachNetworkEndpointsExceptionTest'); + $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 + $globalNetworkEndpointGroupsAttachEndpointsRequestResource = new GlobalNetworkEndpointGroupsAttachEndpointsRequest(); + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $request = (new AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest()) + ->setGlobalNetworkEndpointGroupsAttachEndpointsRequestResource($globalNetworkEndpointGroupsAttachEndpointsRequestResource) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project); + $response = $gapicClient->attachNetworkEndpoints($request); + $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 deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $request = (new DeleteGlobalNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.GlobalNetworkEndpointGroups/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $request = (new DeleteGlobalNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project); + $response = $gapicClient->delete($request); + $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 detachNetworkEndpointsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/detachNetworkEndpointsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/detachNetworkEndpointsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $globalNetworkEndpointGroupsDetachEndpointsRequestResource = new GlobalNetworkEndpointGroupsDetachEndpointsRequest(); + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $request = (new DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest()) + ->setGlobalNetworkEndpointGroupsDetachEndpointsRequestResource($globalNetworkEndpointGroupsDetachEndpointsRequestResource) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project); + $response = $gapicClient->detachNetworkEndpoints($request); + $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.GlobalNetworkEndpointGroups/DetachNetworkEndpoints', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getGlobalNetworkEndpointGroupsDetachEndpointsRequestResource(); + $this->assertProtobufEquals($globalNetworkEndpointGroupsDetachEndpointsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function detachNetworkEndpointsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/detachNetworkEndpointsExceptionTest'); + $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 + $globalNetworkEndpointGroupsDetachEndpointsRequestResource = new GlobalNetworkEndpointGroupsDetachEndpointsRequest(); + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $request = (new DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest()) + ->setGlobalNetworkEndpointGroupsDetachEndpointsRequestResource($globalNetworkEndpointGroupsDetachEndpointsRequestResource) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project); + $response = $gapicClient->detachNetworkEndpoints($request); + $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'; + $defaultPort = 650363969; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $network = 'network1843485230'; + $networkEndpointType = 'networkEndpointType118301523'; + $pscTargetService = 'pscTargetService1879744870'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $size = 3530753; + $subnetwork = 'subnetwork-1302785042'; + $zone = 'zone3744684'; + $expectedResponse = new NetworkEndpointGroup(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDefaultPort($defaultPort); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setNetworkEndpointType($networkEndpointType); + $expectedResponse->setPscTargetService($pscTargetService); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSize($size); + $expectedResponse->setSubnetwork($subnetwork); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $request = (new GetGlobalNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.GlobalNetworkEndpointGroups/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $request = (new GetGlobalNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $networkEndpointGroupResource = new NetworkEndpointGroup(); + $project = 'project-309310695'; + $request = (new InsertGlobalNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroupResource($networkEndpointGroupResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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.GlobalNetworkEndpointGroups/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroupResource(); + $this->assertProtobufEquals($networkEndpointGroupResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $networkEndpointGroupResource = new NetworkEndpointGroup(); + $project = 'project-309310695'; + $request = (new InsertGlobalNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroupResource($networkEndpointGroupResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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 NetworkEndpointGroup(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NetworkEndpointGroupList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListGlobalNetworkEndpointGroupsRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.GlobalNetworkEndpointGroups/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListGlobalNetworkEndpointGroupsRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNetworkEndpointsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $itemsElement = new NetworkEndpointWithHealthStatus(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NetworkEndpointGroupsListNetworkEndpoints(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $request = (new ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project); + $response = $gapicClient->listNetworkEndpoints($request); + $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.GlobalNetworkEndpointGroups/ListNetworkEndpoints', $actualFuncCall); + $actualValue = $actualRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNetworkEndpointsExceptionTest() + { + $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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $request = (new ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project); + try { + $gapicClient->listNetworkEndpoints($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function attachNetworkEndpointsAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/attachNetworkEndpointsAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/attachNetworkEndpointsAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $globalNetworkEndpointGroupsAttachEndpointsRequestResource = new GlobalNetworkEndpointGroupsAttachEndpointsRequest(); + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $request = (new AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest()) + ->setGlobalNetworkEndpointGroupsAttachEndpointsRequestResource($globalNetworkEndpointGroupsAttachEndpointsRequestResource) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project); + $response = $gapicClient->attachNetworkEndpoints($request); + $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.GlobalNetworkEndpointGroups/AttachNetworkEndpoints', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getGlobalNetworkEndpointGroupsAttachEndpointsRequestResource(); + $this->assertProtobufEquals($globalNetworkEndpointGroupsAttachEndpointsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalOperationsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalOperationsClientTest.php new file mode 100644 index 000000000000..1a0fb1d08dd7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalOperationsClientTest.php @@ -0,0 +1,559 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return GlobalOperationsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new GlobalOperationsClient($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 OperationsScopedList(), + ]; + $expectedResponse = new OperationAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListGlobalOperationsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.GlobalOperations/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'; + $request = (new AggregatedListGlobalOperationsRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new DeleteGlobalOperationResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $request = (new DeleteGlobalOperationRequest()) + ->setOperation($operation) + ->setProject($project); + $response = $gapicClient->delete($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.GlobalOperations/Delete', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $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 + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $request = (new DeleteGlobalOperationRequest()) + ->setOperation($operation) + ->setProject($project); + try { + $gapicClient->delete($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $clientOperationId = 'clientOperationId-239630617'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $endTime = 'endTime1725551537'; + $httpErrorMessage = 'httpErrorMessage1276263769'; + $httpErrorStatusCode = 1386087020; + $id = 3355; + $insertTime = 'insertTime-103148397'; + $kind = 'kind3292052'; + $name = 'name3373707'; + $operationGroupId = 'operationGroupId40171187'; + $operationType = 'operationType-1432962286'; + $progress = 1001078227; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $startTime = 'startTime-1573145462'; + $statusMessage = 'statusMessage-239442758'; + $targetId = 815576439; + $targetLink = 'targetLink-2084812312'; + $user = 'user3599307'; + $zone = 'zone3744684'; + $expectedResponse = new Operation(); + $expectedResponse->setClientOperationId($clientOperationId); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEndTime($endTime); + $expectedResponse->setHttpErrorMessage($httpErrorMessage); + $expectedResponse->setHttpErrorStatusCode($httpErrorStatusCode); + $expectedResponse->setId($id); + $expectedResponse->setInsertTime($insertTime); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setOperationGroupId($operationGroupId); + $expectedResponse->setOperationType($operationType); + $expectedResponse->setProgress($progress); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStartTime($startTime); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setTargetId($targetId); + $expectedResponse->setTargetLink($targetLink); + $expectedResponse->setUser($user); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $request = (new GetGlobalOperationRequest()) + ->setOperation($operation) + ->setProject($project); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.GlobalOperations/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $request = (new GetGlobalOperationRequest()) + ->setOperation($operation) + ->setProject($project); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 Operation(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new OperationList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListGlobalOperationsRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.GlobalOperations/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListGlobalOperationsRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function waitTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $clientOperationId = 'clientOperationId-239630617'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $endTime = 'endTime1725551537'; + $httpErrorMessage = 'httpErrorMessage1276263769'; + $httpErrorStatusCode = 1386087020; + $id = 3355; + $insertTime = 'insertTime-103148397'; + $kind = 'kind3292052'; + $name = 'name3373707'; + $operationGroupId = 'operationGroupId40171187'; + $operationType = 'operationType-1432962286'; + $progress = 1001078227; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $startTime = 'startTime-1573145462'; + $statusMessage = 'statusMessage-239442758'; + $targetId = 815576439; + $targetLink = 'targetLink-2084812312'; + $user = 'user3599307'; + $zone = 'zone3744684'; + $expectedResponse = new Operation(); + $expectedResponse->setClientOperationId($clientOperationId); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEndTime($endTime); + $expectedResponse->setHttpErrorMessage($httpErrorMessage); + $expectedResponse->setHttpErrorStatusCode($httpErrorStatusCode); + $expectedResponse->setId($id); + $expectedResponse->setInsertTime($insertTime); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setOperationGroupId($operationGroupId); + $expectedResponse->setOperationType($operationType); + $expectedResponse->setProgress($progress); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStartTime($startTime); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setTargetId($targetId); + $expectedResponse->setTargetLink($targetLink); + $expectedResponse->setUser($user); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $request = (new WaitGlobalOperationRequest()) + ->setOperation($operation) + ->setProject($project); + $response = $gapicClient->wait($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.GlobalOperations/Wait', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function waitExceptionTest() + { + $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 + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $request = (new WaitGlobalOperationRequest()) + ->setOperation($operation) + ->setProject($project); + try { + $gapicClient->wait($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function aggregatedListAsyncTest() + { + $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 OperationsScopedList(), + ]; + $expectedResponse = new OperationAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListGlobalOperationsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.GlobalOperations/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalOrganizationOperationsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalOrganizationOperationsClientTest.php new file mode 100644 index 000000000000..1dad69a62337 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalOrganizationOperationsClientTest.php @@ -0,0 +1,329 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return GlobalOrganizationOperationsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new GlobalOrganizationOperationsClient($options); + } + + /** @test */ + public function deleteTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new DeleteGlobalOrganizationOperationResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $request = (new DeleteGlobalOrganizationOperationRequest()) + ->setOperation($operation); + $response = $gapicClient->delete($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.GlobalOrganizationOperations/Delete', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $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 + $operation = 'operation1662702951'; + $request = (new DeleteGlobalOrganizationOperationRequest()) + ->setOperation($operation); + try { + $gapicClient->delete($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $clientOperationId = 'clientOperationId-239630617'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $endTime = 'endTime1725551537'; + $httpErrorMessage = 'httpErrorMessage1276263769'; + $httpErrorStatusCode = 1386087020; + $id = 3355; + $insertTime = 'insertTime-103148397'; + $kind = 'kind3292052'; + $name = 'name3373707'; + $operationGroupId = 'operationGroupId40171187'; + $operationType = 'operationType-1432962286'; + $progress = 1001078227; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $startTime = 'startTime-1573145462'; + $statusMessage = 'statusMessage-239442758'; + $targetId = 815576439; + $targetLink = 'targetLink-2084812312'; + $user = 'user3599307'; + $zone = 'zone3744684'; + $expectedResponse = new Operation(); + $expectedResponse->setClientOperationId($clientOperationId); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEndTime($endTime); + $expectedResponse->setHttpErrorMessage($httpErrorMessage); + $expectedResponse->setHttpErrorStatusCode($httpErrorStatusCode); + $expectedResponse->setId($id); + $expectedResponse->setInsertTime($insertTime); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setOperationGroupId($operationGroupId); + $expectedResponse->setOperationType($operationType); + $expectedResponse->setProgress($progress); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStartTime($startTime); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setTargetId($targetId); + $expectedResponse->setTargetLink($targetLink); + $expectedResponse->setUser($user); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $request = (new GetGlobalOrganizationOperationRequest()) + ->setOperation($operation); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.GlobalOrganizationOperations/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $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 + $operation = 'operation1662702951'; + $request = (new GetGlobalOrganizationOperationRequest()) + ->setOperation($operation); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 Operation(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new OperationList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + $request = new ListGlobalOrganizationOperationsRequest(); + $response = $gapicClient->list($request); + $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.GlobalOrganizationOperations/List', $actualFuncCall); + $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); + $request = new ListGlobalOrganizationOperationsRequest(); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new DeleteGlobalOrganizationOperationResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $request = (new DeleteGlobalOrganizationOperationRequest()) + ->setOperation($operation); + $response = $gapicClient->deleteAsync($request)->wait(); + $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.GlobalOrganizationOperations/Delete', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalPublicDelegatedPrefixesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalPublicDelegatedPrefixesClientTest.php new file mode 100644 index 000000000000..d7e8fdd1f5a3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/GlobalPublicDelegatedPrefixesClientTest.php @@ -0,0 +1,676 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return GlobalPublicDelegatedPrefixesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new GlobalPublicDelegatedPrefixesClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $request = (new DeleteGlobalPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix); + $response = $gapicClient->delete($request); + $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.GlobalPublicDelegatedPrefixes/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicDelegatedPrefix(); + $this->assertProtobufEquals($publicDelegatedPrefix, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $request = (new DeleteGlobalPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix); + $response = $gapicClient->delete($request); + $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 + $allocatablePrefixLength = 1649040182; + $byoipApiVersion = 'byoipApiVersion162683283'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $ipCidrRange = 'ipCidrRange-2049366326'; + $isLiveMigration = true; + $kind = 'kind3292052'; + $mode = 'mode3357091'; + $name = 'name3373707'; + $parentPrefix = 'parentPrefix552104903'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $expectedResponse = new PublicDelegatedPrefix(); + $expectedResponse->setAllocatablePrefixLength($allocatablePrefixLength); + $expectedResponse->setByoipApiVersion($byoipApiVersion); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setIpCidrRange($ipCidrRange); + $expectedResponse->setIsLiveMigration($isLiveMigration); + $expectedResponse->setKind($kind); + $expectedResponse->setMode($mode); + $expectedResponse->setName($name); + $expectedResponse->setParentPrefix($parentPrefix); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $request = (new GetGlobalPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.GlobalPublicDelegatedPrefixes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getPublicDelegatedPrefix(); + $this->assertProtobufEquals($publicDelegatedPrefix, $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 + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $request = (new GetGlobalPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + $request = (new InsertGlobalPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource); + $response = $gapicClient->insert($request); + $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.GlobalPublicDelegatedPrefixes/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicDelegatedPrefixResource(); + $this->assertProtobufEquals($publicDelegatedPrefixResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + $request = (new InsertGlobalPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource); + $response = $gapicClient->insert($request); + $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 PublicDelegatedPrefix(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new PublicDelegatedPrefixList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListGlobalPublicDelegatedPrefixesRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.GlobalPublicDelegatedPrefixes/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListGlobalPublicDelegatedPrefixesRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + $request = (new PatchGlobalPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource); + $response = $gapicClient->patch($request); + $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.GlobalPublicDelegatedPrefixes/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicDelegatedPrefix(); + $this->assertProtobufEquals($publicDelegatedPrefix, $actualValue); + $actualValue = $actualApiRequestObject->getPublicDelegatedPrefixResource(); + $this->assertProtobufEquals($publicDelegatedPrefixResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + $request = (new PatchGlobalPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource); + $response = $gapicClient->patch($request); + $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 deleteAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $request = (new DeleteGlobalPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix); + $response = $gapicClient->delete($request); + $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.GlobalPublicDelegatedPrefixes/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicDelegatedPrefix(); + $this->assertProtobufEquals($publicDelegatedPrefix, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/HealthChecksClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/HealthChecksClientTest.php new file mode 100644 index 000000000000..aa9bbdad83ac --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/HealthChecksClientTest.php @@ -0,0 +1,860 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return HealthChecksClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new HealthChecksClient($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 HealthChecksScopedList(), + ]; + $expectedResponse = new HealthChecksAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListHealthChecksRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.HealthChecks/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'; + $request = (new AggregatedListHealthChecksRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $healthCheck = 'healthCheck845747557'; + $project = 'project-309310695'; + $request = (new DeleteHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.HealthChecks/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheck(); + $this->assertProtobufEquals($healthCheck, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $healthCheck = 'healthCheck845747557'; + $project = 'project-309310695'; + $request = (new DeleteHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setProject($project); + $response = $gapicClient->delete($request); + $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 + $checkIntervalSec = 345561006; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $healthyThreshold = 133658551; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $timeoutSec = 2067488653; + $type = 'type3575610'; + $unhealthyThreshold = 1838571216; + $expectedResponse = new HealthCheck(); + $expectedResponse->setCheckIntervalSec($checkIntervalSec); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setHealthyThreshold($healthyThreshold); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setTimeoutSec($timeoutSec); + $expectedResponse->setType($type); + $expectedResponse->setUnhealthyThreshold($unhealthyThreshold); + $transport->addResponse($expectedResponse); + // Mock request + $healthCheck = 'healthCheck845747557'; + $project = 'project-309310695'; + $request = (new GetHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setProject($project); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.HealthChecks/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getHealthCheck(); + $this->assertProtobufEquals($healthCheck, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $healthCheck = 'healthCheck845747557'; + $project = 'project-309310695'; + $request = (new GetHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setProject($project); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $request = (new InsertHealthCheckRequest()) + ->setHealthCheckResource($healthCheckResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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.HealthChecks/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheckResource(); + $this->assertProtobufEquals($healthCheckResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $request = (new InsertHealthCheckRequest()) + ->setHealthCheckResource($healthCheckResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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 HealthCheck(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new HealthCheckList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListHealthChecksRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.HealthChecks/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListHealthChecksRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $healthCheck = 'healthCheck845747557'; + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $request = (new PatchHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setHealthCheckResource($healthCheckResource) + ->setProject($project); + $response = $gapicClient->patch($request); + $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.HealthChecks/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheck(); + $this->assertProtobufEquals($healthCheck, $actualValue); + $actualValue = $actualApiRequestObject->getHealthCheckResource(); + $this->assertProtobufEquals($healthCheckResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $healthCheck = 'healthCheck845747557'; + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $request = (new PatchHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setHealthCheckResource($healthCheckResource) + ->setProject($project); + $response = $gapicClient->patch($request); + $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 updateTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $healthCheck = 'healthCheck845747557'; + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $request = (new UpdateHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setHealthCheckResource($healthCheckResource) + ->setProject($project); + $response = $gapicClient->update($request); + $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.HealthChecks/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheck(); + $this->assertProtobufEquals($healthCheck, $actualValue); + $actualValue = $actualApiRequestObject->getHealthCheckResource(); + $this->assertProtobufEquals($healthCheckResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $healthCheck = 'healthCheck845747557'; + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $request = (new UpdateHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setHealthCheckResource($healthCheckResource) + ->setProject($project); + $response = $gapicClient->update($request); + $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 aggregatedListAsyncTest() + { + $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 HealthChecksScopedList(), + ]; + $expectedResponse = new HealthChecksAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListHealthChecksRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.HealthChecks/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ImageFamilyViewsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ImageFamilyViewsClientTest.php new file mode 100644 index 000000000000..d1f897fd877d --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ImageFamilyViewsClientTest.php @@ -0,0 +1,171 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ImageFamilyViewsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ImageFamilyViewsClient($options); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ImageFamilyView(); + $transport->addResponse($expectedResponse); + // Mock request + $family = 'family-1281860764'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetImageFamilyViewRequest()) + ->setFamily($family) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.ImageFamilyViews/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getFamily(); + $this->assertProtobufEquals($family, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $family = 'family-1281860764'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetImageFamilyViewRequest()) + ->setFamily($family) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ImageFamilyView(); + $transport->addResponse($expectedResponse); + // Mock request + $family = 'family-1281860764'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetImageFamilyViewRequest()) + ->setFamily($family) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->getAsync($request)->wait(); + $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.ImageFamilyViews/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getFamily(); + $this->assertProtobufEquals($family, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ImagesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ImagesClientTest.php new file mode 100644 index 000000000000..412cf2c521b1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ImagesClientTest.php @@ -0,0 +1,1294 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ImagesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ImagesClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $image = 'image100313435'; + $project = 'project-309310695'; + $request = (new DeleteImageRequest()) + ->setImage($image) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.Images/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getImage(); + $this->assertProtobufEquals($image, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $image = 'image100313435'; + $project = 'project-309310695'; + $request = (new DeleteImageRequest()) + ->setImage($image) + ->setProject($project); + $response = $gapicClient->delete($request); + $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 deprecateTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deprecateTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deprecateTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $deprecationStatusResource = new DeprecationStatus(); + $image = 'image100313435'; + $project = 'project-309310695'; + $request = (new DeprecateImageRequest()) + ->setDeprecationStatusResource($deprecationStatusResource) + ->setImage($image) + ->setProject($project); + $response = $gapicClient->deprecate($request); + $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.Images/Deprecate', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDeprecationStatusResource(); + $this->assertProtobufEquals($deprecationStatusResource, $actualValue); + $actualValue = $actualApiRequestObject->getImage(); + $this->assertProtobufEquals($image, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deprecateExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deprecateExceptionTest'); + $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 + $deprecationStatusResource = new DeprecationStatus(); + $image = 'image100313435'; + $project = 'project-309310695'; + $request = (new DeprecateImageRequest()) + ->setDeprecationStatusResource($deprecationStatusResource) + ->setImage($image) + ->setProject($project); + $response = $gapicClient->deprecate($request); + $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 + $architecture = 'architecture839674195'; + $archiveSizeBytes = 1766390198; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $diskSizeGb = 757478089; + $enableConfidentialCompute = true; + $family = 'family-1281860764'; + $id = 3355; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $satisfiesPzi = false; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $sourceDisk = 'sourceDisk-85117119'; + $sourceDiskId = 'sourceDiskId-1693292839'; + $sourceImage = 'sourceImage1661056055'; + $sourceImageId = 'sourceImageId-2092155357'; + $sourceSnapshot = 'sourceSnapshot-947679896'; + $sourceSnapshotId = 'sourceSnapshotId-1511650478'; + $sourceType = 'sourceType-84625186'; + $status = 'status-892481550'; + $expectedResponse = new Image(); + $expectedResponse->setArchitecture($architecture); + $expectedResponse->setArchiveSizeBytes($archiveSizeBytes); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDiskSizeGb($diskSizeGb); + $expectedResponse->setEnableConfidentialCompute($enableConfidentialCompute); + $expectedResponse->setFamily($family); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSourceDisk($sourceDisk); + $expectedResponse->setSourceDiskId($sourceDiskId); + $expectedResponse->setSourceImage($sourceImage); + $expectedResponse->setSourceImageId($sourceImageId); + $expectedResponse->setSourceSnapshot($sourceSnapshot); + $expectedResponse->setSourceSnapshotId($sourceSnapshotId); + $expectedResponse->setSourceType($sourceType); + $expectedResponse->setStatus($status); + $transport->addResponse($expectedResponse); + // Mock request + $image = 'image100313435'; + $project = 'project-309310695'; + $request = (new GetImageRequest()) + ->setImage($image) + ->setProject($project); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Images/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getImage(); + $this->assertProtobufEquals($image, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $image = 'image100313435'; + $project = 'project-309310695'; + $request = (new GetImageRequest()) + ->setImage($image) + ->setProject($project); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getFromFamilyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $architecture = 'architecture839674195'; + $archiveSizeBytes = 1766390198; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $diskSizeGb = 757478089; + $enableConfidentialCompute = true; + $family2 = 'family2787422743'; + $id = 3355; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $satisfiesPzi = false; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $sourceDisk = 'sourceDisk-85117119'; + $sourceDiskId = 'sourceDiskId-1693292839'; + $sourceImage = 'sourceImage1661056055'; + $sourceImageId = 'sourceImageId-2092155357'; + $sourceSnapshot = 'sourceSnapshot-947679896'; + $sourceSnapshotId = 'sourceSnapshotId-1511650478'; + $sourceType = 'sourceType-84625186'; + $status = 'status-892481550'; + $expectedResponse = new Image(); + $expectedResponse->setArchitecture($architecture); + $expectedResponse->setArchiveSizeBytes($archiveSizeBytes); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDiskSizeGb($diskSizeGb); + $expectedResponse->setEnableConfidentialCompute($enableConfidentialCompute); + $expectedResponse->setFamily($family2); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSourceDisk($sourceDisk); + $expectedResponse->setSourceDiskId($sourceDiskId); + $expectedResponse->setSourceImage($sourceImage); + $expectedResponse->setSourceImageId($sourceImageId); + $expectedResponse->setSourceSnapshot($sourceSnapshot); + $expectedResponse->setSourceSnapshotId($sourceSnapshotId); + $expectedResponse->setSourceType($sourceType); + $expectedResponse->setStatus($status); + $transport->addResponse($expectedResponse); + // Mock request + $family = 'family-1281860764'; + $project = 'project-309310695'; + $request = (new GetFromFamilyImageRequest()) + ->setFamily($family) + ->setProject($project); + $response = $gapicClient->getFromFamily($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Images/GetFromFamily', $actualFuncCall); + $actualValue = $actualRequestObject->getFamily(); + $this->assertProtobufEquals($family, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getFromFamilyExceptionTest() + { + $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 + $family = 'family-1281860764'; + $project = 'project-309310695'; + $request = (new GetFromFamilyImageRequest()) + ->setFamily($family) + ->setProject($project); + try { + $gapicClient->getFromFamily($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyImageRequest()) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Images/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyImageRequest()) + ->setProject($project) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $imageResource = new Image(); + $project = 'project-309310695'; + $request = (new InsertImageRequest()) + ->setImageResource($imageResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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.Images/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getImageResource(); + $this->assertProtobufEquals($imageResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $imageResource = new Image(); + $project = 'project-309310695'; + $request = (new InsertImageRequest()) + ->setImageResource($imageResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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 Image(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new ImageList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListImagesRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.Images/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListImagesRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $image = 'image100313435'; + $imageResource = new Image(); + $project = 'project-309310695'; + $request = (new PatchImageRequest()) + ->setImage($image) + ->setImageResource($imageResource) + ->setProject($project); + $response = $gapicClient->patch($request); + $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.Images/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getImage(); + $this->assertProtobufEquals($image, $actualValue); + $actualValue = $actualApiRequestObject->getImageResource(); + $this->assertProtobufEquals($imageResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $image = 'image100313435'; + $imageResource = new Image(); + $project = 'project-309310695'; + $request = (new PatchImageRequest()) + ->setImage($image) + ->setImageResource($imageResource) + ->setProject($project); + $response = $gapicClient->patch($request); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetIamPolicyImageRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Images/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getGlobalSetPolicyRequestResource(); + $this->assertProtobufEquals($globalSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetIamPolicyImageRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setLabelsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetLabelsImageRequest()) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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.Images/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getGlobalSetLabelsRequestResource(); + $this->assertProtobufEquals($globalSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setLabelsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsExceptionTest'); + $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 + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetLabelsImageRequest()) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsImageRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Images/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsImageRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $image = 'image100313435'; + $project = 'project-309310695'; + $request = (new DeleteImageRequest()) + ->setImage($image) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.Images/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getImage(); + $this->assertProtobufEquals($image, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstanceGroupManagerResizeRequestsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstanceGroupManagerResizeRequestsClientTest.php new file mode 100644 index 000000000000..d7e8aee967e7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstanceGroupManagerResizeRequestsClientTest.php @@ -0,0 +1,732 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return InstanceGroupManagerResizeRequestsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new InstanceGroupManagerResizeRequestsClient($options); + } + + /** @test */ + public function cancelTest() + { + $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/cancelTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/cancelTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $resizeRequest = 'resizeRequest-319929852'; + $zone = 'zone3744684'; + $request = (new CancelInstanceGroupManagerResizeRequestRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setResizeRequest($resizeRequest) + ->setZone($zone); + $response = $gapicClient->cancel($request); + $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.InstanceGroupManagerResizeRequests/Cancel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResizeRequest(); + $this->assertProtobufEquals($resizeRequest, $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 cancelExceptionTest() + { + $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/cancelExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $resizeRequest = 'resizeRequest-319929852'; + $zone = 'zone3744684'; + $request = (new CancelInstanceGroupManagerResizeRequestRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setResizeRequest($resizeRequest) + ->setZone($zone); + $response = $gapicClient->cancel($request); + $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 deleteTest() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $resizeRequest = 'resizeRequest-319929852'; + $zone = 'zone3744684'; + $request = (new DeleteInstanceGroupManagerResizeRequestRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setResizeRequest($resizeRequest) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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.InstanceGroupManagerResizeRequests/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResizeRequest(); + $this->assertProtobufEquals($resizeRequest, $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 deleteExceptionTest() + { + $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/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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $resizeRequest = 'resizeRequest-319929852'; + $zone = 'zone3744684'; + $request = (new DeleteInstanceGroupManagerResizeRequestRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setResizeRequest($resizeRequest) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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'; + $resizeBy = 2144348098; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $state = 'state109757585'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new InstanceGroupManagerResizeRequest(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setResizeBy($resizeBy); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $expectedResponse->setState($state); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $resizeRequest = 'resizeRequest-319929852'; + $zone = 'zone3744684'; + $request = (new GetInstanceGroupManagerResizeRequestRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setResizeRequest($resizeRequest) + ->setZone($zone); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.InstanceGroupManagerResizeRequests/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResizeRequest(); + $this->assertProtobufEquals($resizeRequest, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $resizeRequest = 'resizeRequest-319929852'; + $zone = 'zone3744684'; + $request = (new GetInstanceGroupManagerResizeRequestRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setResizeRequest($resizeRequest) + ->setZone($zone); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagerResizeRequestResource = new InstanceGroupManagerResizeRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new InsertInstanceGroupManagerResizeRequestRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagerResizeRequestResource($instanceGroupManagerResizeRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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.InstanceGroupManagerResizeRequests/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagerResizeRequestResource(); + $this->assertProtobufEquals($instanceGroupManagerResizeRequestResource, $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 insertExceptionTest() + { + $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/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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagerResizeRequestResource = new InstanceGroupManagerResizeRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new InsertInstanceGroupManagerResizeRequestRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagerResizeRequestResource($instanceGroupManagerResizeRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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 InstanceGroupManagerResizeRequest(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InstanceGroupManagerResizeRequestsListResponse(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListInstanceGroupManagerResizeRequestsRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->list($request); + $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.InstanceGroupManagerResizeRequests/List', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListInstanceGroupManagerResizeRequestsRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function cancelAsyncTest() + { + $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/cancelAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/cancelAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $resizeRequest = 'resizeRequest-319929852'; + $zone = 'zone3744684'; + $request = (new CancelInstanceGroupManagerResizeRequestRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setResizeRequest($resizeRequest) + ->setZone($zone); + $response = $gapicClient->cancel($request); + $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.InstanceGroupManagerResizeRequests/Cancel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResizeRequest(); + $this->assertProtobufEquals($resizeRequest, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstanceGroupManagersClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstanceGroupManagersClientTest.php new file mode 100644 index 000000000000..2a4f603293bc --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstanceGroupManagersClientTest.php @@ -0,0 +1,2543 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return InstanceGroupManagersClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new InstanceGroupManagersClient($options); + } + + /** @test */ + public function abandonInstancesTest() + { + $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/abandonInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/abandonInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersAbandonInstancesRequestResource = new InstanceGroupManagersAbandonInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new AbandonInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersAbandonInstancesRequestResource($instanceGroupManagersAbandonInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->abandonInstances($request); + $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.InstanceGroupManagers/AbandonInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersAbandonInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersAbandonInstancesRequestResource, $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 abandonInstancesExceptionTest() + { + $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/abandonInstancesExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersAbandonInstancesRequestResource = new InstanceGroupManagersAbandonInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new AbandonInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersAbandonInstancesRequestResource($instanceGroupManagersAbandonInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->abandonInstances($request); + $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 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 InstanceGroupManagersScopedList(), + ]; + $expectedResponse = new InstanceGroupManagerAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListInstanceGroupManagersRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.InstanceGroupManagers/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'; + $request = (new AggregatedListInstanceGroupManagersRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function applyUpdatesToInstancesTest() + { + $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/applyUpdatesToInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/applyUpdatesToInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersApplyUpdatesRequestResource = new InstanceGroupManagersApplyUpdatesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ApplyUpdatesToInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersApplyUpdatesRequestResource($instanceGroupManagersApplyUpdatesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->applyUpdatesToInstances($request); + $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.InstanceGroupManagers/ApplyUpdatesToInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersApplyUpdatesRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersApplyUpdatesRequestResource, $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 applyUpdatesToInstancesExceptionTest() + { + $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/applyUpdatesToInstancesExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersApplyUpdatesRequestResource = new InstanceGroupManagersApplyUpdatesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ApplyUpdatesToInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersApplyUpdatesRequestResource($instanceGroupManagersApplyUpdatesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->applyUpdatesToInstances($request); + $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 createInstancesTest() + { + $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/createInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/createInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersCreateInstancesRequestResource = new InstanceGroupManagersCreateInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new CreateInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersCreateInstancesRequestResource($instanceGroupManagersCreateInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->createInstances($request); + $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.InstanceGroupManagers/CreateInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersCreateInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersCreateInstancesRequestResource, $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 createInstancesExceptionTest() + { + $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/createInstancesExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersCreateInstancesRequestResource = new InstanceGroupManagersCreateInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new CreateInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersCreateInstancesRequestResource($instanceGroupManagersCreateInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->createInstances($request); + $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 deleteTest() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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.InstanceGroupManagers/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $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 deleteExceptionTest() + { + $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/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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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 deleteInstancesTest() + { + $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/deleteInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersDeleteInstancesRequestResource = new InstanceGroupManagersDeleteInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersDeleteInstancesRequestResource($instanceGroupManagersDeleteInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->deleteInstances($request); + $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.InstanceGroupManagers/DeleteInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersDeleteInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersDeleteInstancesRequestResource, $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 deleteInstancesExceptionTest() + { + $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/deleteInstancesExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersDeleteInstancesRequestResource = new InstanceGroupManagersDeleteInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersDeleteInstancesRequestResource($instanceGroupManagersDeleteInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->deleteInstances($request); + $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 deletePerInstanceConfigsTest() + { + $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/deletePerInstanceConfigsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deletePerInstanceConfigsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersDeletePerInstanceConfigsReqResource = new InstanceGroupManagersDeletePerInstanceConfigsReq(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeletePerInstanceConfigsInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersDeletePerInstanceConfigsReqResource($instanceGroupManagersDeletePerInstanceConfigsReqResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->deletePerInstanceConfigs($request); + $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.InstanceGroupManagers/DeletePerInstanceConfigs', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersDeletePerInstanceConfigsReqResource(); + $this->assertProtobufEquals($instanceGroupManagersDeletePerInstanceConfigsReqResource, $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 deletePerInstanceConfigsExceptionTest() + { + $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/deletePerInstanceConfigsExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersDeletePerInstanceConfigsReqResource = new InstanceGroupManagersDeletePerInstanceConfigsReq(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeletePerInstanceConfigsInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersDeletePerInstanceConfigsReqResource($instanceGroupManagersDeletePerInstanceConfigsReqResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->deletePerInstanceConfigs($request); + $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 + $baseInstanceName = 'baseInstanceName389106439'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $instanceGroup = 'instanceGroup81095253'; + $instanceTemplate = 'instanceTemplate309248228'; + $kind = 'kind3292052'; + $listManagedInstancesResults = 'listManagedInstancesResults832918068'; + $name = 'name3373707'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $targetSize = 2084603409; + $zone2 = 'zone2-696322977'; + $expectedResponse = new InstanceGroupManager(); + $expectedResponse->setBaseInstanceName($baseInstanceName); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setInstanceGroup($instanceGroup); + $expectedResponse->setInstanceTemplate($instanceTemplate); + $expectedResponse->setKind($kind); + $expectedResponse->setListManagedInstancesResults($listManagedInstancesResults); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setTargetSize($targetSize); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.InstanceGroupManagers/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManagerResource = new InstanceGroupManager(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new InsertInstanceGroupManagerRequest()) + ->setInstanceGroupManagerResource($instanceGroupManagerResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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.InstanceGroupManagers/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManagerResource(); + $this->assertProtobufEquals($instanceGroupManagerResource, $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 insertExceptionTest() + { + $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/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 + $instanceGroupManagerResource = new InstanceGroupManager(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new InsertInstanceGroupManagerRequest()) + ->setInstanceGroupManagerResource($instanceGroupManagerResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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 InstanceGroupManager(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InstanceGroupManagerList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListInstanceGroupManagersRequest()) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->list($request); + $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.InstanceGroupManagers/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + $request = (new ListInstanceGroupManagersRequest()) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listErrorsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $itemsElement = new InstanceManagedByIgmError(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InstanceGroupManagersListErrorsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListErrorsInstanceGroupManagersRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->listErrors($request); + $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.InstanceGroupManagers/ListErrors', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listErrorsExceptionTest() + { + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListErrorsInstanceGroupManagersRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->listErrors($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listManagedInstancesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $managedInstancesElement = new ManagedInstance(); + $managedInstances = [ + $managedInstancesElement, + ]; + $expectedResponse = new InstanceGroupManagersListManagedInstancesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setManagedInstances($managedInstances); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListManagedInstancesInstanceGroupManagersRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->listManagedInstances($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getManagedInstances()[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.InstanceGroupManagers/ListManagedInstances', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listManagedInstancesExceptionTest() + { + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListManagedInstancesInstanceGroupManagersRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->listManagedInstances($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listPerInstanceConfigsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $itemsElement = new PerInstanceConfig(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InstanceGroupManagersListPerInstanceConfigsResp(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListPerInstanceConfigsInstanceGroupManagersRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->listPerInstanceConfigs($request); + $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.InstanceGroupManagers/ListPerInstanceConfigs', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listPerInstanceConfigsExceptionTest() + { + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListPerInstanceConfigsInstanceGroupManagersRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->listPerInstanceConfigs($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagerResource = new InstanceGroupManager(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new PatchInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagerResource($instanceGroupManagerResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->patch($request); + $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.InstanceGroupManagers/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagerResource(); + $this->assertProtobufEquals($instanceGroupManagerResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagerResource = new InstanceGroupManager(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new PatchInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagerResource($instanceGroupManagerResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->patch($request); + $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 patchPerInstanceConfigsTest() + { + $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/patchPerInstanceConfigsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchPerInstanceConfigsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersPatchPerInstanceConfigsReqResource = new InstanceGroupManagersPatchPerInstanceConfigsReq(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new PatchPerInstanceConfigsInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersPatchPerInstanceConfigsReqResource($instanceGroupManagersPatchPerInstanceConfigsReqResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->patchPerInstanceConfigs($request); + $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.InstanceGroupManagers/PatchPerInstanceConfigs', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersPatchPerInstanceConfigsReqResource(); + $this->assertProtobufEquals($instanceGroupManagersPatchPerInstanceConfigsReqResource, $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 patchPerInstanceConfigsExceptionTest() + { + $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/patchPerInstanceConfigsExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersPatchPerInstanceConfigsReqResource = new InstanceGroupManagersPatchPerInstanceConfigsReq(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new PatchPerInstanceConfigsInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersPatchPerInstanceConfigsReqResource($instanceGroupManagersPatchPerInstanceConfigsReqResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->patchPerInstanceConfigs($request); + $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 recreateInstancesTest() + { + $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/recreateInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/recreateInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersRecreateInstancesRequestResource = new InstanceGroupManagersRecreateInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new RecreateInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersRecreateInstancesRequestResource($instanceGroupManagersRecreateInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->recreateInstances($request); + $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.InstanceGroupManagers/RecreateInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersRecreateInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersRecreateInstancesRequestResource, $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 recreateInstancesExceptionTest() + { + $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/recreateInstancesExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersRecreateInstancesRequestResource = new InstanceGroupManagersRecreateInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new RecreateInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersRecreateInstancesRequestResource($instanceGroupManagersRecreateInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->recreateInstances($request); + $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 resizeTest() + { + $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/resizeTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/resizeTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $size = 3530753; + $zone = 'zone3744684'; + $request = (new ResizeInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setSize($size) + ->setZone($zone); + $response = $gapicClient->resize($request); + $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.InstanceGroupManagers/Resize', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSize(); + $this->assertProtobufEquals($size, $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 resizeExceptionTest() + { + $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/resizeExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $size = 3530753; + $zone = 'zone3744684'; + $request = (new ResizeInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setSize($size) + ->setZone($zone); + $response = $gapicClient->resize($request); + $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 setInstanceTemplateTest() + { + $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/setInstanceTemplateTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setInstanceTemplateTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersSetInstanceTemplateRequestResource = new InstanceGroupManagersSetInstanceTemplateRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetInstanceTemplateInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersSetInstanceTemplateRequestResource($instanceGroupManagersSetInstanceTemplateRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setInstanceTemplate($request); + $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.InstanceGroupManagers/SetInstanceTemplate', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersSetInstanceTemplateRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersSetInstanceTemplateRequestResource, $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 setInstanceTemplateExceptionTest() + { + $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/setInstanceTemplateExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersSetInstanceTemplateRequestResource = new InstanceGroupManagersSetInstanceTemplateRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetInstanceTemplateInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersSetInstanceTemplateRequestResource($instanceGroupManagersSetInstanceTemplateRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setInstanceTemplate($request); + $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 setTargetPoolsTest() + { + $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/setTargetPoolsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setTargetPoolsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersSetTargetPoolsRequestResource = new InstanceGroupManagersSetTargetPoolsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetTargetPoolsInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersSetTargetPoolsRequestResource($instanceGroupManagersSetTargetPoolsRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setTargetPools($request); + $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.InstanceGroupManagers/SetTargetPools', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersSetTargetPoolsRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersSetTargetPoolsRequestResource, $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 setTargetPoolsExceptionTest() + { + $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/setTargetPoolsExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersSetTargetPoolsRequestResource = new InstanceGroupManagersSetTargetPoolsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetTargetPoolsInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersSetTargetPoolsRequestResource($instanceGroupManagersSetTargetPoolsRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setTargetPools($request); + $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 updatePerInstanceConfigsTest() + { + $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/updatePerInstanceConfigsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/updatePerInstanceConfigsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersUpdatePerInstanceConfigsReqResource = new InstanceGroupManagersUpdatePerInstanceConfigsReq(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new UpdatePerInstanceConfigsInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersUpdatePerInstanceConfigsReqResource($instanceGroupManagersUpdatePerInstanceConfigsReqResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->updatePerInstanceConfigs($request); + $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.InstanceGroupManagers/UpdatePerInstanceConfigs', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersUpdatePerInstanceConfigsReqResource(); + $this->assertProtobufEquals($instanceGroupManagersUpdatePerInstanceConfigsReqResource, $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 updatePerInstanceConfigsExceptionTest() + { + $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/updatePerInstanceConfigsExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersUpdatePerInstanceConfigsReqResource = new InstanceGroupManagersUpdatePerInstanceConfigsReq(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new UpdatePerInstanceConfigsInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersUpdatePerInstanceConfigsReqResource($instanceGroupManagersUpdatePerInstanceConfigsReqResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->updatePerInstanceConfigs($request); + $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 abandonInstancesAsyncTest() + { + $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/abandonInstancesAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/abandonInstancesAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersAbandonInstancesRequestResource = new InstanceGroupManagersAbandonInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new AbandonInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersAbandonInstancesRequestResource($instanceGroupManagersAbandonInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->abandonInstances($request); + $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.InstanceGroupManagers/AbandonInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersAbandonInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersAbandonInstancesRequestResource, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstanceGroupsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstanceGroupsClientTest.php new file mode 100644 index 000000000000..aa1b0ab7bb34 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstanceGroupsClientTest.php @@ -0,0 +1,1165 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return InstanceGroupsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new InstanceGroupsClient($options); + } + + /** @test */ + public function addInstancesTest() + { + $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/addInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroup = 'instanceGroup81095253'; + $instanceGroupsAddInstancesRequestResource = new InstanceGroupsAddInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new AddInstancesInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setInstanceGroupsAddInstancesRequestResource($instanceGroupsAddInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->addInstances($request); + $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.InstanceGroups/AddInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroup(); + $this->assertProtobufEquals($instanceGroup, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupsAddInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupsAddInstancesRequestResource, $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 addInstancesExceptionTest() + { + $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/addInstancesExceptionTest'); + $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 + $instanceGroup = 'instanceGroup81095253'; + $instanceGroupsAddInstancesRequestResource = new InstanceGroupsAddInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new AddInstancesInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setInstanceGroupsAddInstancesRequestResource($instanceGroupsAddInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->addInstances($request); + $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 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 InstanceGroupsScopedList(), + ]; + $expectedResponse = new InstanceGroupAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListInstanceGroupsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.InstanceGroups/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'; + $request = (new AggregatedListInstanceGroupsRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTest() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroup = 'instanceGroup81095253'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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.InstanceGroups/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroup(); + $this->assertProtobufEquals($instanceGroup, $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 deleteExceptionTest() + { + $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/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 + $instanceGroup = 'instanceGroup81095253'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $network = 'network1843485230'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $size = 3530753; + $subnetwork = 'subnetwork-1302785042'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new InstanceGroup(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSize($size); + $expectedResponse->setSubnetwork($subnetwork); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroup = 'instanceGroup81095253'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.InstanceGroups/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroup(); + $this->assertProtobufEquals($instanceGroup, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $instanceGroup = 'instanceGroup81095253'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupResource = new InstanceGroup(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new InsertInstanceGroupRequest()) + ->setInstanceGroupResource($instanceGroupResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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.InstanceGroups/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupResource(); + $this->assertProtobufEquals($instanceGroupResource, $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 insertExceptionTest() + { + $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/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 + $instanceGroupResource = new InstanceGroup(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new InsertInstanceGroupRequest()) + ->setInstanceGroupResource($instanceGroupResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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 InstanceGroup(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InstanceGroupList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListInstanceGroupsRequest()) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->list($request); + $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.InstanceGroups/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + $request = (new ListInstanceGroupsRequest()) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listInstancesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new InstanceWithNamedPorts(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InstanceGroupsListInstances(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroup = 'instanceGroup81095253'; + $instanceGroupsListInstancesRequestResource = new InstanceGroupsListInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListInstancesInstanceGroupsRequest()) + ->setInstanceGroup($instanceGroup) + ->setInstanceGroupsListInstancesRequestResource($instanceGroupsListInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->listInstances($request); + $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.InstanceGroups/ListInstances', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroup(); + $this->assertProtobufEquals($instanceGroup, $actualValue); + $actualValue = $actualRequestObject->getInstanceGroupsListInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupsListInstancesRequestResource, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listInstancesExceptionTest() + { + $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 + $instanceGroup = 'instanceGroup81095253'; + $instanceGroupsListInstancesRequestResource = new InstanceGroupsListInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListInstancesInstanceGroupsRequest()) + ->setInstanceGroup($instanceGroup) + ->setInstanceGroupsListInstancesRequestResource($instanceGroupsListInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->listInstances($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function removeInstancesTest() + { + $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/removeInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroup = 'instanceGroup81095253'; + $instanceGroupsRemoveInstancesRequestResource = new InstanceGroupsRemoveInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new RemoveInstancesInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setInstanceGroupsRemoveInstancesRequestResource($instanceGroupsRemoveInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->removeInstances($request); + $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.InstanceGroups/RemoveInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroup(); + $this->assertProtobufEquals($instanceGroup, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupsRemoveInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupsRemoveInstancesRequestResource, $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 removeInstancesExceptionTest() + { + $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/removeInstancesExceptionTest'); + $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 + $instanceGroup = 'instanceGroup81095253'; + $instanceGroupsRemoveInstancesRequestResource = new InstanceGroupsRemoveInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new RemoveInstancesInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setInstanceGroupsRemoveInstancesRequestResource($instanceGroupsRemoveInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->removeInstances($request); + $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 setNamedPortsTest() + { + $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/setNamedPortsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setNamedPortsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroup = 'instanceGroup81095253'; + $instanceGroupsSetNamedPortsRequestResource = new InstanceGroupsSetNamedPortsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetNamedPortsInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setInstanceGroupsSetNamedPortsRequestResource($instanceGroupsSetNamedPortsRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setNamedPorts($request); + $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.InstanceGroups/SetNamedPorts', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroup(); + $this->assertProtobufEquals($instanceGroup, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupsSetNamedPortsRequestResource(); + $this->assertProtobufEquals($instanceGroupsSetNamedPortsRequestResource, $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 setNamedPortsExceptionTest() + { + $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/setNamedPortsExceptionTest'); + $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 + $instanceGroup = 'instanceGroup81095253'; + $instanceGroupsSetNamedPortsRequestResource = new InstanceGroupsSetNamedPortsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetNamedPortsInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setInstanceGroupsSetNamedPortsRequestResource($instanceGroupsSetNamedPortsRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setNamedPorts($request); + $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 addInstancesAsyncTest() + { + $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/addInstancesAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addInstancesAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroup = 'instanceGroup81095253'; + $instanceGroupsAddInstancesRequestResource = new InstanceGroupsAddInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new AddInstancesInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setInstanceGroupsAddInstancesRequestResource($instanceGroupsAddInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->addInstances($request); + $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.InstanceGroups/AddInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroup(); + $this->assertProtobufEquals($instanceGroup, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupsAddInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupsAddInstancesRequestResource, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstanceSettingsServiceClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstanceSettingsServiceClientTest.php new file mode 100644 index 000000000000..5ecd5e5c3125 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstanceSettingsServiceClientTest.php @@ -0,0 +1,305 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return InstanceSettingsServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new InstanceSettingsServiceClient($options); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $fingerprint = 'fingerprint-1375934236'; + $kind = 'kind3292052'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new InstanceSettings(); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setKind($kind); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetInstanceSettingRequest()) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.InstanceSettingsService/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetInstanceSettingRequest()) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceSettingsResource = new InstanceSettings(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new PatchInstanceSettingRequest()) + ->setInstanceSettingsResource($instanceSettingsResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->patch($request); + $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.InstanceSettingsService/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceSettingsResource(); + $this->assertProtobufEquals($instanceSettingsResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $instanceSettingsResource = new InstanceSettings(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new PatchInstanceSettingRequest()) + ->setInstanceSettingsResource($instanceSettingsResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->patch($request); + $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 getAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $fingerprint = 'fingerprint-1375934236'; + $kind = 'kind3292052'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new InstanceSettings(); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setKind($kind); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetInstanceSettingRequest()) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->getAsync($request)->wait(); + $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.InstanceSettingsService/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstanceTemplatesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstanceTemplatesClientTest.php new file mode 100644 index 000000000000..d5d221a22105 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstanceTemplatesClientTest.php @@ -0,0 +1,833 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return InstanceTemplatesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + 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'; + $request = (new AggregatedListInstanceTemplatesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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'; + $request = (new AggregatedListInstanceTemplatesRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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'; + $request = (new DeleteInstanceTemplateRequest()) + ->setInstanceTemplate($instanceTemplate) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.InstanceTemplates/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceTemplate(); + $this->assertProtobufEquals($instanceTemplate, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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'; + $request = (new DeleteInstanceTemplateRequest()) + ->setInstanceTemplate($instanceTemplate) + ->setProject($project); + $response = $gapicClient->delete($request); + $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'; + $region = 'region-934795532'; + $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($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSourceInstance($sourceInstance); + $transport->addResponse($expectedResponse); + // Mock request + $instanceTemplate = 'instanceTemplate309248228'; + $project = 'project-309310695'; + $request = (new GetInstanceTemplateRequest()) + ->setInstanceTemplate($instanceTemplate) + ->setProject($project); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.InstanceTemplates/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceTemplate(); + $this->assertProtobufEquals($instanceTemplate, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new GetInstanceTemplateRequest()) + ->setInstanceTemplate($instanceTemplate) + ->setProject($project); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyInstanceTemplateRequest()) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.InstanceTemplates/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyInstanceTemplateRequest()) + ->setProject($project) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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'; + $request = (new InsertInstanceTemplateRequest()) + ->setInstanceTemplateResource($instanceTemplateResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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.InstanceTemplates/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceTemplateResource(); + $this->assertProtobufEquals($instanceTemplateResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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'; + $request = (new InsertInstanceTemplateRequest()) + ->setInstanceTemplateResource($instanceTemplateResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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'; + $request = (new ListInstanceTemplatesRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.InstanceTemplates/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListInstanceTemplatesRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetIamPolicyInstanceTemplateRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.InstanceTemplates/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getGlobalSetPolicyRequestResource(); + $this->assertProtobufEquals($globalSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetIamPolicyInstanceTemplateRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsInstanceTemplateRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.InstanceTemplates/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsInstanceTemplateRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function aggregatedListAsyncTest() + { + $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'; + $request = (new AggregatedListInstanceTemplatesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstancesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstancesClientTest.php new file mode 100644 index 000000000000..7f40bd501650 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstancesClientTest.php @@ -0,0 +1,5944 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return InstancesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new InstancesClient($options); + } + + /** @test */ + public function addAccessConfigTest() + { + $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/addAccessConfigTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addAccessConfigTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $accessConfigResource = new AccessConfig(); + $instance = 'instance555127957'; + $networkInterface = 'networkInterface902258792'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new AddAccessConfigInstanceRequest()) + ->setAccessConfigResource($accessConfigResource) + ->setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->addAccessConfig($request); + $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/AddAccessConfig', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAccessConfigResource(); + $this->assertProtobufEquals($accessConfigResource, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkInterface(); + $this->assertProtobufEquals($networkInterface, $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 addAccessConfigExceptionTest() + { + $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/addAccessConfigExceptionTest'); + $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 + $accessConfigResource = new AccessConfig(); + $instance = 'instance555127957'; + $networkInterface = 'networkInterface902258792'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new AddAccessConfigInstanceRequest()) + ->setAccessConfigResource($accessConfigResource) + ->setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->addAccessConfig($request); + $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 addResourcePoliciesTest() + { + $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/addResourcePoliciesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addResourcePoliciesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $instancesAddResourcePoliciesRequestResource = new InstancesAddResourcePoliciesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new AddResourcePoliciesInstanceRequest()) + ->setInstance($instance) + ->setInstancesAddResourcePoliciesRequestResource($instancesAddResourcePoliciesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->addResourcePolicies($request); + $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/AddResourcePolicies', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getInstancesAddResourcePoliciesRequestResource(); + $this->assertProtobufEquals($instancesAddResourcePoliciesRequestResource, $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 addResourcePoliciesExceptionTest() + { + $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/addResourcePoliciesExceptionTest'); + $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'; + $instancesAddResourcePoliciesRequestResource = new InstancesAddResourcePoliciesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new AddResourcePoliciesInstanceRequest()) + ->setInstance($instance) + ->setInstancesAddResourcePoliciesRequestResource($instancesAddResourcePoliciesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->addResourcePolicies($request); + $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 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 InstancesScopedList(), + ]; + $expectedResponse = new InstanceAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListInstancesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.Instances/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'; + $request = (new AggregatedListInstancesRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function attachDiskTest() + { + $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/attachDiskTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/attachDiskTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $attachedDiskResource = new AttachedDisk(); + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new AttachDiskInstanceRequest()) + ->setAttachedDiskResource($attachedDiskResource) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->attachDisk($request); + $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/AttachDisk', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAttachedDiskResource(); + $this->assertProtobufEquals($attachedDiskResource, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 attachDiskExceptionTest() + { + $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/attachDiskExceptionTest'); + $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 + $attachedDiskResource = new AttachedDisk(); + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new AttachDiskInstanceRequest()) + ->setAttachedDiskResource($attachedDiskResource) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->attachDisk($request); + $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 bulkInsertTest() + { + $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/bulkInsertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/bulkInsertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $bulkInsertInstanceResourceResource = new BulkInsertInstanceResource(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new BulkInsertInstanceRequest()) + ->setBulkInsertInstanceResourceResource($bulkInsertInstanceResourceResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->bulkInsert($request); + $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/BulkInsert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBulkInsertInstanceResourceResource(); + $this->assertProtobufEquals($bulkInsertInstanceResourceResource, $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 bulkInsertExceptionTest() + { + $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/bulkInsertExceptionTest'); + $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 + $bulkInsertInstanceResourceResource = new BulkInsertInstanceResource(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new BulkInsertInstanceRequest()) + ->setBulkInsertInstanceResourceResource($bulkInsertInstanceResourceResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->bulkInsert($request); + $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 deleteTest() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 deleteExceptionTest() + { + $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/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 + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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 deleteAccessConfigTest() + { + $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/deleteAccessConfigTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAccessConfigTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $accessConfig = 'accessConfig-464014723'; + $instance = 'instance555127957'; + $networkInterface = 'networkInterface902258792'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteAccessConfigInstanceRequest()) + ->setAccessConfig($accessConfig) + ->setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->deleteAccessConfig($request); + $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/DeleteAccessConfig', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAccessConfig(); + $this->assertProtobufEquals($accessConfig, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkInterface(); + $this->assertProtobufEquals($networkInterface, $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 deleteAccessConfigExceptionTest() + { + $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/deleteAccessConfigExceptionTest'); + $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 + $accessConfig = 'accessConfig-464014723'; + $instance = 'instance555127957'; + $networkInterface = 'networkInterface902258792'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteAccessConfigInstanceRequest()) + ->setAccessConfig($accessConfig) + ->setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->deleteAccessConfig($request); + $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 detachDiskTest() + { + $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/detachDiskTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/detachDiskTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $deviceName = 'deviceName-1543071020'; + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DetachDiskInstanceRequest()) + ->setDeviceName($deviceName) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->detachDisk($request); + $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/DetachDisk', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDeviceName(); + $this->assertProtobufEquals($deviceName, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 detachDiskExceptionTest() + { + $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/detachDiskExceptionTest'); + $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 + $deviceName = 'deviceName-1543071020'; + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DetachDiskInstanceRequest()) + ->setDeviceName($deviceName) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->detachDisk($request); + $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 + $canIpForward = true; + $cpuPlatform = 'cpuPlatform947156266'; + $creationTimestamp = 'creationTimestamp567396278'; + $deletionProtection = true; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $hostname = 'hostname-299803597'; + $id = 3355; + $keyRevocationActionType = 'keyRevocationActionType-1374671262'; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $lastStartTimestamp = 'lastStartTimestamp-629911088'; + $lastStopTimestamp = 'lastStopTimestamp-1197789726'; + $lastSuspendedTimestamp = 'lastSuspendedTimestamp893146249'; + $machineType = 'machineType1838323762'; + $minCpuPlatform = 'minCpuPlatform-1367699977'; + $name = 'name3373707'; + $privateIpv6GoogleAccess = 'privateIpv6GoogleAccess1122018830'; + $satisfiesPzi = false; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $sourceMachineImage = 'sourceMachineImage-1051972033'; + $startRestricted = true; + $status = 'status-892481550'; + $statusMessage = 'statusMessage-239442758'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new Instance(); + $expectedResponse->setCanIpForward($canIpForward); + $expectedResponse->setCpuPlatform($cpuPlatform); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDeletionProtection($deletionProtection); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setHostname($hostname); + $expectedResponse->setId($id); + $expectedResponse->setKeyRevocationActionType($keyRevocationActionType); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setLastStartTimestamp($lastStartTimestamp); + $expectedResponse->setLastStopTimestamp($lastStopTimestamp); + $expectedResponse->setLastSuspendedTimestamp($lastSuspendedTimestamp); + $expectedResponse->setMachineType($machineType); + $expectedResponse->setMinCpuPlatform($minCpuPlatform); + $expectedResponse->setName($name); + $expectedResponse->setPrivateIpv6GoogleAccess($privateIpv6GoogleAccess); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSourceMachineImage($sourceMachineImage); + $expectedResponse->setStartRestricted($startRestricted); + $expectedResponse->setStatus($status); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Instances/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEffectiveFirewallsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new InstancesGetEffectiveFirewallsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $instance = 'instance555127957'; + $networkInterface = 'networkInterface902258792'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetEffectiveFirewallsInstanceRequest()) + ->setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->getEffectiveFirewalls($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Instances/GetEffectiveFirewalls', $actualFuncCall); + $actualValue = $actualRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualRequestObject->getNetworkInterface(); + $this->assertProtobufEquals($networkInterface, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEffectiveFirewallsExceptionTest() + { + $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 + $instance = 'instance555127957'; + $networkInterface = 'networkInterface902258792'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetEffectiveFirewallsInstanceRequest()) + ->setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->getEffectiveFirewalls($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGuestAttributesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $kind = 'kind3292052'; + $queryPath2 = 'queryPath21491922415'; + $selfLink = 'selfLink-1691268851'; + $variableKey2 = 'variableKey2-1496058161'; + $variableValue = 'variableValue-1486030354'; + $expectedResponse = new GuestAttributes(); + $expectedResponse->setKind($kind); + $expectedResponse->setQueryPath($queryPath2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setVariableKey($variableKey2); + $expectedResponse->setVariableValue($variableValue); + $transport->addResponse($expectedResponse); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetGuestAttributesInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->getGuestAttributes($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Instances/GetGuestAttributes', $actualFuncCall); + $actualValue = $actualRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGuestAttributesExceptionTest() + { + $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 + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetGuestAttributesInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->getGuestAttributes($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $request = (new GetIamPolicyInstanceRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Instances/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $request = (new GetIamPolicyInstanceRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getScreenshotTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $contents = 'contents-567321830'; + $kind = 'kind3292052'; + $expectedResponse = new Screenshot(); + $expectedResponse->setContents($contents); + $expectedResponse->setKind($kind); + $transport->addResponse($expectedResponse); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetScreenshotInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->getScreenshot($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Instances/GetScreenshot', $actualFuncCall); + $actualValue = $actualRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getScreenshotExceptionTest() + { + $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 + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetScreenshotInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->getScreenshot($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSerialPortOutputTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $contents = 'contents-567321830'; + $kind = 'kind3292052'; + $next = 3377907; + $selfLink = 'selfLink-1691268851'; + $start2 = 1897185387; + $expectedResponse = new SerialPortOutput(); + $expectedResponse->setContents($contents); + $expectedResponse->setKind($kind); + $expectedResponse->setNext($next); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStart($start2); + $transport->addResponse($expectedResponse); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetSerialPortOutputInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->getSerialPortOutput($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Instances/GetSerialPortOutput', $actualFuncCall); + $actualValue = $actualRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSerialPortOutputExceptionTest() + { + $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 + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetSerialPortOutputInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->getSerialPortOutput($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getShieldedInstanceIdentityTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $kind = 'kind3292052'; + $expectedResponse = new ShieldedInstanceIdentity(); + $expectedResponse->setKind($kind); + $transport->addResponse($expectedResponse); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetShieldedInstanceIdentityInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->getShieldedInstanceIdentity($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Instances/GetShieldedInstanceIdentity', $actualFuncCall); + $actualValue = $actualRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getShieldedInstanceIdentityExceptionTest() + { + $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 + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetShieldedInstanceIdentityInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->getShieldedInstanceIdentity($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceResource = new Instance(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new InsertInstanceRequest()) + ->setInstanceResource($instanceResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceResource(); + $this->assertProtobufEquals($instanceResource, $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 insertExceptionTest() + { + $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/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 + $instanceResource = new Instance(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new InsertInstanceRequest()) + ->setInstanceResource($instanceResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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 Instance(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InstanceList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListInstancesRequest()) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->list($request); + $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.Instances/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + $request = (new ListInstancesRequest()) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listReferrersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new Reference(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InstanceListReferrers(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListReferrersInstancesRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->listReferrers($request); + $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.Instances/ListReferrers', $actualFuncCall); + $actualValue = $actualRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listReferrersExceptionTest() + { + $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 + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListReferrersInstancesRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->listReferrers($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function performMaintenanceTest() + { + $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/performMaintenanceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/performMaintenanceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new PerformMaintenanceInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->performMaintenance($request); + $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/PerformMaintenance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 performMaintenanceExceptionTest() + { + $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/performMaintenanceExceptionTest'); + $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'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new PerformMaintenanceInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->performMaintenance($request); + $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 removeResourcePoliciesTest() + { + $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/removeResourcePoliciesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeResourcePoliciesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $instancesRemoveResourcePoliciesRequestResource = new InstancesRemoveResourcePoliciesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new RemoveResourcePoliciesInstanceRequest()) + ->setInstance($instance) + ->setInstancesRemoveResourcePoliciesRequestResource($instancesRemoveResourcePoliciesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->removeResourcePolicies($request); + $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/RemoveResourcePolicies', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getInstancesRemoveResourcePoliciesRequestResource(); + $this->assertProtobufEquals($instancesRemoveResourcePoliciesRequestResource, $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 removeResourcePoliciesExceptionTest() + { + $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/removeResourcePoliciesExceptionTest'); + $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'; + $instancesRemoveResourcePoliciesRequestResource = new InstancesRemoveResourcePoliciesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new RemoveResourcePoliciesInstanceRequest()) + ->setInstance($instance) + ->setInstancesRemoveResourcePoliciesRequestResource($instancesRemoveResourcePoliciesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->removeResourcePolicies($request); + $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 resetTest() + { + $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/resetTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/resetTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ResetInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->reset($request); + $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/Reset', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 resetExceptionTest() + { + $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/resetExceptionTest'); + $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'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ResetInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->reset($request); + $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 resumeTest() + { + $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/resumeTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/resumeTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ResumeInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->resume($request); + $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/Resume', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 resumeExceptionTest() + { + $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/resumeExceptionTest'); + $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'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ResumeInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->resume($request); + $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 sendDiagnosticInterruptTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new SendDiagnosticInterruptInstanceResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SendDiagnosticInterruptInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->sendDiagnosticInterrupt($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Instances/SendDiagnosticInterrupt', $actualFuncCall); + $actualValue = $actualRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function sendDiagnosticInterruptExceptionTest() + { + $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 + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SendDiagnosticInterruptInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->sendDiagnosticInterrupt($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setDeletionProtectionTest() + { + $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/setDeletionProtectionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setDeletionProtectionTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $request = (new SetDeletionProtectionInstanceRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone); + $response = $gapicClient->setDeletionProtection($request); + $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/SetDeletionProtection', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $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 setDeletionProtectionExceptionTest() + { + $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/setDeletionProtectionExceptionTest'); + $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 + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $request = (new SetDeletionProtectionInstanceRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone); + $response = $gapicClient->setDeletionProtection($request); + $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 setDiskAutoDeleteTest() + { + $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/setDiskAutoDeleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setDiskAutoDeleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $autoDelete = false; + $deviceName = 'deviceName-1543071020'; + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetDiskAutoDeleteInstanceRequest()) + ->setAutoDelete($autoDelete) + ->setDeviceName($deviceName) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setDiskAutoDelete($request); + $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/SetDiskAutoDelete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAutoDelete(); + $this->assertProtobufEquals($autoDelete, $actualValue); + $actualValue = $actualApiRequestObject->getDeviceName(); + $this->assertProtobufEquals($deviceName, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 setDiskAutoDeleteExceptionTest() + { + $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/setDiskAutoDeleteExceptionTest'); + $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 + $autoDelete = false; + $deviceName = 'deviceName-1543071020'; + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetDiskAutoDeleteInstanceRequest()) + ->setAutoDelete($autoDelete) + ->setDeviceName($deviceName) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setDiskAutoDelete($request); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $request = (new SetIamPolicyInstanceRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Instances/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $actualValue = $actualRequestObject->getZoneSetPolicyRequestResource(); + $this->assertProtobufEquals($zoneSetPolicyRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $request = (new SetIamPolicyInstanceRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setLabelsTest() + { + $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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $instancesSetLabelsRequestResource = new InstancesSetLabelsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetLabelsInstanceRequest()) + ->setInstance($instance) + ->setInstancesSetLabelsRequestResource($instancesSetLabelsRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setLabels($request); + $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/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getInstancesSetLabelsRequestResource(); + $this->assertProtobufEquals($instancesSetLabelsRequestResource, $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 setLabelsExceptionTest() + { + $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/setLabelsExceptionTest'); + $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'; + $instancesSetLabelsRequestResource = new InstancesSetLabelsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetLabelsInstanceRequest()) + ->setInstance($instance) + ->setInstancesSetLabelsRequestResource($instancesSetLabelsRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setLabels($request); + $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 setMachineResourcesTest() + { + $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/setMachineResourcesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setMachineResourcesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $instancesSetMachineResourcesRequestResource = new InstancesSetMachineResourcesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetMachineResourcesInstanceRequest()) + ->setInstance($instance) + ->setInstancesSetMachineResourcesRequestResource($instancesSetMachineResourcesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setMachineResources($request); + $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/SetMachineResources', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getInstancesSetMachineResourcesRequestResource(); + $this->assertProtobufEquals($instancesSetMachineResourcesRequestResource, $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 setMachineResourcesExceptionTest() + { + $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/setMachineResourcesExceptionTest'); + $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'; + $instancesSetMachineResourcesRequestResource = new InstancesSetMachineResourcesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetMachineResourcesInstanceRequest()) + ->setInstance($instance) + ->setInstancesSetMachineResourcesRequestResource($instancesSetMachineResourcesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setMachineResources($request); + $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 setMachineTypeTest() + { + $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/setMachineTypeTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setMachineTypeTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $instancesSetMachineTypeRequestResource = new InstancesSetMachineTypeRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetMachineTypeInstanceRequest()) + ->setInstance($instance) + ->setInstancesSetMachineTypeRequestResource($instancesSetMachineTypeRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setMachineType($request); + $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/SetMachineType', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getInstancesSetMachineTypeRequestResource(); + $this->assertProtobufEquals($instancesSetMachineTypeRequestResource, $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 setMachineTypeExceptionTest() + { + $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/setMachineTypeExceptionTest'); + $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'; + $instancesSetMachineTypeRequestResource = new InstancesSetMachineTypeRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetMachineTypeInstanceRequest()) + ->setInstance($instance) + ->setInstancesSetMachineTypeRequestResource($instancesSetMachineTypeRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setMachineType($request); + $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 setMetadataTest() + { + $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/setMetadataTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setMetadataTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $metadataResource = new Metadata(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetMetadataInstanceRequest()) + ->setInstance($instance) + ->setMetadataResource($metadataResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setMetadata($request); + $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/SetMetadata', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getMetadataResource(); + $this->assertProtobufEquals($metadataResource, $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 setMetadataExceptionTest() + { + $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/setMetadataExceptionTest'); + $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'; + $metadataResource = new Metadata(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetMetadataInstanceRequest()) + ->setInstance($instance) + ->setMetadataResource($metadataResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setMetadata($request); + $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 setMinCpuPlatformTest() + { + $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/setMinCpuPlatformTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setMinCpuPlatformTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $instancesSetMinCpuPlatformRequestResource = new InstancesSetMinCpuPlatformRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetMinCpuPlatformInstanceRequest()) + ->setInstance($instance) + ->setInstancesSetMinCpuPlatformRequestResource($instancesSetMinCpuPlatformRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setMinCpuPlatform($request); + $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/SetMinCpuPlatform', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getInstancesSetMinCpuPlatformRequestResource(); + $this->assertProtobufEquals($instancesSetMinCpuPlatformRequestResource, $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 setMinCpuPlatformExceptionTest() + { + $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/setMinCpuPlatformExceptionTest'); + $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'; + $instancesSetMinCpuPlatformRequestResource = new InstancesSetMinCpuPlatformRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetMinCpuPlatformInstanceRequest()) + ->setInstance($instance) + ->setInstancesSetMinCpuPlatformRequestResource($instancesSetMinCpuPlatformRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setMinCpuPlatform($request); + $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 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'; + $request = (new SetNameInstanceRequest()) + ->setInstance($instance) + ->setInstancesSetNameRequestResource($instancesSetNameRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setName($request); + $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'; + $request = (new SetNameInstanceRequest()) + ->setInstance($instance) + ->setInstancesSetNameRequestResource($instancesSetNameRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setName($request); + $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() + { + $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/setSchedulingTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setSchedulingTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $schedulingResource = new Scheduling(); + $zone = 'zone3744684'; + $request = (new SetSchedulingInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setSchedulingResource($schedulingResource) + ->setZone($zone); + $response = $gapicClient->setScheduling($request); + $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/SetScheduling', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSchedulingResource(); + $this->assertProtobufEquals($schedulingResource, $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 setSchedulingExceptionTest() + { + $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/setSchedulingExceptionTest'); + $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'; + $project = 'project-309310695'; + $schedulingResource = new Scheduling(); + $zone = 'zone3744684'; + $request = (new SetSchedulingInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setSchedulingResource($schedulingResource) + ->setZone($zone); + $response = $gapicClient->setScheduling($request); + $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 setSecurityPolicyTest() + { + $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/setSecurityPolicyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setSecurityPolicyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $instancesSetSecurityPolicyRequestResource = new InstancesSetSecurityPolicyRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetSecurityPolicyInstanceRequest()) + ->setInstance($instance) + ->setInstancesSetSecurityPolicyRequestResource($instancesSetSecurityPolicyRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setSecurityPolicy($request); + $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/SetSecurityPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getInstancesSetSecurityPolicyRequestResource(); + $this->assertProtobufEquals($instancesSetSecurityPolicyRequestResource, $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 setSecurityPolicyExceptionTest() + { + $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/setSecurityPolicyExceptionTest'); + $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'; + $instancesSetSecurityPolicyRequestResource = new InstancesSetSecurityPolicyRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetSecurityPolicyInstanceRequest()) + ->setInstance($instance) + ->setInstancesSetSecurityPolicyRequestResource($instancesSetSecurityPolicyRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setSecurityPolicy($request); + $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 setServiceAccountTest() + { + $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/setServiceAccountTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setServiceAccountTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $instancesSetServiceAccountRequestResource = new InstancesSetServiceAccountRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetServiceAccountInstanceRequest()) + ->setInstance($instance) + ->setInstancesSetServiceAccountRequestResource($instancesSetServiceAccountRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setServiceAccount($request); + $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/SetServiceAccount', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getInstancesSetServiceAccountRequestResource(); + $this->assertProtobufEquals($instancesSetServiceAccountRequestResource, $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 setServiceAccountExceptionTest() + { + $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/setServiceAccountExceptionTest'); + $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'; + $instancesSetServiceAccountRequestResource = new InstancesSetServiceAccountRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetServiceAccountInstanceRequest()) + ->setInstance($instance) + ->setInstancesSetServiceAccountRequestResource($instancesSetServiceAccountRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setServiceAccount($request); + $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 setShieldedInstanceIntegrityPolicyTest() + { + $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/setShieldedInstanceIntegrityPolicyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setShieldedInstanceIntegrityPolicyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $shieldedInstanceIntegrityPolicyResource = new ShieldedInstanceIntegrityPolicy(); + $zone = 'zone3744684'; + $request = (new SetShieldedInstanceIntegrityPolicyInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setShieldedInstanceIntegrityPolicyResource($shieldedInstanceIntegrityPolicyResource) + ->setZone($zone); + $response = $gapicClient->setShieldedInstanceIntegrityPolicy($request); + $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/SetShieldedInstanceIntegrityPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getShieldedInstanceIntegrityPolicyResource(); + $this->assertProtobufEquals($shieldedInstanceIntegrityPolicyResource, $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 setShieldedInstanceIntegrityPolicyExceptionTest() + { + $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/setShieldedInstanceIntegrityPolicyExceptionTest'); + $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'; + $project = 'project-309310695'; + $shieldedInstanceIntegrityPolicyResource = new ShieldedInstanceIntegrityPolicy(); + $zone = 'zone3744684'; + $request = (new SetShieldedInstanceIntegrityPolicyInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setShieldedInstanceIntegrityPolicyResource($shieldedInstanceIntegrityPolicyResource) + ->setZone($zone); + $response = $gapicClient->setShieldedInstanceIntegrityPolicy($request); + $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 setTagsTest() + { + $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/setTagsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setTagsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $tagsResource = new Tags(); + $zone = 'zone3744684'; + $request = (new SetTagsInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setTagsResource($tagsResource) + ->setZone($zone); + $response = $gapicClient->setTags($request); + $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/SetTags', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTagsResource(); + $this->assertProtobufEquals($tagsResource, $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 setTagsExceptionTest() + { + $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/setTagsExceptionTest'); + $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'; + $project = 'project-309310695'; + $tagsResource = new Tags(); + $zone = 'zone3744684'; + $request = (new SetTagsInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setTagsResource($tagsResource) + ->setZone($zone); + $response = $gapicClient->setTags($request); + $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 simulateMaintenanceEventTest() + { + $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/simulateMaintenanceEventTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/simulateMaintenanceEventTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SimulateMaintenanceEventInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->simulateMaintenanceEvent($request); + $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/SimulateMaintenanceEvent', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 simulateMaintenanceEventExceptionTest() + { + $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/simulateMaintenanceEventExceptionTest'); + $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'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SimulateMaintenanceEventInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->simulateMaintenanceEvent($request); + $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 startTest() + { + $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/startTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/startTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new StartInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->start($request); + $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/Start', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 startExceptionTest() + { + $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/startExceptionTest'); + $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'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new StartInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->start($request); + $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 startWithEncryptionKeyTest() + { + $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/startWithEncryptionKeyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/startWithEncryptionKeyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $instancesStartWithEncryptionKeyRequestResource = new InstancesStartWithEncryptionKeyRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new StartWithEncryptionKeyInstanceRequest()) + ->setInstance($instance) + ->setInstancesStartWithEncryptionKeyRequestResource($instancesStartWithEncryptionKeyRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->startWithEncryptionKey($request); + $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/StartWithEncryptionKey', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getInstancesStartWithEncryptionKeyRequestResource(); + $this->assertProtobufEquals($instancesStartWithEncryptionKeyRequestResource, $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 startWithEncryptionKeyExceptionTest() + { + $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/startWithEncryptionKeyExceptionTest'); + $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'; + $instancesStartWithEncryptionKeyRequestResource = new InstancesStartWithEncryptionKeyRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new StartWithEncryptionKeyInstanceRequest()) + ->setInstance($instance) + ->setInstancesStartWithEncryptionKeyRequestResource($instancesStartWithEncryptionKeyRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->startWithEncryptionKey($request); + $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 stopTest() + { + $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/stopTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/stopTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new StopInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->stop($request); + $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/Stop', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 stopExceptionTest() + { + $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/stopExceptionTest'); + $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'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new StopInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->stop($request); + $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 suspendTest() + { + $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/suspendTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/suspendTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SuspendInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->suspend($request); + $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/Suspend', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 suspendExceptionTest() + { + $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/suspendExceptionTest'); + $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'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SuspendInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->suspend($request); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + $request = (new TestIamPermissionsInstanceRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Instances/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + $request = (new TestIamPermissionsInstanceRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $instance = 'instance555127957'; + $instanceResource = new Instance(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new UpdateInstanceRequest()) + ->setInstance($instance) + ->setInstanceResource($instanceResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->update($request); + $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/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceResource(); + $this->assertProtobufEquals($instanceResource, $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 + $instance = 'instance555127957'; + $instanceResource = new Instance(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new UpdateInstanceRequest()) + ->setInstance($instance) + ->setInstanceResource($instanceResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->update($request); + $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 updateAccessConfigTest() + { + $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/updateAccessConfigTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/updateAccessConfigTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $accessConfigResource = new AccessConfig(); + $instance = 'instance555127957'; + $networkInterface = 'networkInterface902258792'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new UpdateAccessConfigInstanceRequest()) + ->setAccessConfigResource($accessConfigResource) + ->setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->updateAccessConfig($request); + $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/UpdateAccessConfig', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAccessConfigResource(); + $this->assertProtobufEquals($accessConfigResource, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkInterface(); + $this->assertProtobufEquals($networkInterface, $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 updateAccessConfigExceptionTest() + { + $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/updateAccessConfigExceptionTest'); + $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 + $accessConfigResource = new AccessConfig(); + $instance = 'instance555127957'; + $networkInterface = 'networkInterface902258792'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new UpdateAccessConfigInstanceRequest()) + ->setAccessConfigResource($accessConfigResource) + ->setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->updateAccessConfig($request); + $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 updateDisplayDeviceTest() + { + $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/updateDisplayDeviceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/updateDisplayDeviceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $displayDeviceResource = new DisplayDevice(); + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new UpdateDisplayDeviceInstanceRequest()) + ->setDisplayDeviceResource($displayDeviceResource) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->updateDisplayDevice($request); + $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/UpdateDisplayDevice', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisplayDeviceResource(); + $this->assertProtobufEquals($displayDeviceResource, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 updateDisplayDeviceExceptionTest() + { + $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/updateDisplayDeviceExceptionTest'); + $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 + $displayDeviceResource = new DisplayDevice(); + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new UpdateDisplayDeviceInstanceRequest()) + ->setDisplayDeviceResource($displayDeviceResource) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->updateDisplayDevice($request); + $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 updateNetworkInterfaceTest() + { + $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/updateNetworkInterfaceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/updateNetworkInterfaceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $networkInterface = 'networkInterface902258792'; + $networkInterfaceResource = new NetworkInterface(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new UpdateNetworkInterfaceInstanceRequest()) + ->setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setNetworkInterfaceResource($networkInterfaceResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->updateNetworkInterface($request); + $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/UpdateNetworkInterface', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkInterface(); + $this->assertProtobufEquals($networkInterface, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkInterfaceResource(); + $this->assertProtobufEquals($networkInterfaceResource, $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 updateNetworkInterfaceExceptionTest() + { + $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/updateNetworkInterfaceExceptionTest'); + $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'; + $networkInterface = 'networkInterface902258792'; + $networkInterfaceResource = new NetworkInterface(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new UpdateNetworkInterfaceInstanceRequest()) + ->setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setNetworkInterfaceResource($networkInterfaceResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->updateNetworkInterface($request); + $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 updateShieldedInstanceConfigTest() + { + $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/updateShieldedInstanceConfigTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/updateShieldedInstanceConfigTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $shieldedInstanceConfigResource = new ShieldedInstanceConfig(); + $zone = 'zone3744684'; + $request = (new UpdateShieldedInstanceConfigInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setShieldedInstanceConfigResource($shieldedInstanceConfigResource) + ->setZone($zone); + $response = $gapicClient->updateShieldedInstanceConfig($request); + $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/UpdateShieldedInstanceConfig', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getShieldedInstanceConfigResource(); + $this->assertProtobufEquals($shieldedInstanceConfigResource, $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 updateShieldedInstanceConfigExceptionTest() + { + $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/updateShieldedInstanceConfigExceptionTest'); + $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'; + $project = 'project-309310695'; + $shieldedInstanceConfigResource = new ShieldedInstanceConfig(); + $zone = 'zone3744684'; + $request = (new UpdateShieldedInstanceConfigInstanceRequest()) + ->setInstance($instance) + ->setProject($project) + ->setShieldedInstanceConfigResource($shieldedInstanceConfigResource) + ->setZone($zone); + $response = $gapicClient->updateShieldedInstanceConfig($request); + $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 addAccessConfigAsyncTest() + { + $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/addAccessConfigAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addAccessConfigAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $accessConfigResource = new AccessConfig(); + $instance = 'instance555127957'; + $networkInterface = 'networkInterface902258792'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new AddAccessConfigInstanceRequest()) + ->setAccessConfigResource($accessConfigResource) + ->setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->addAccessConfig($request); + $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/AddAccessConfig', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAccessConfigResource(); + $this->assertProtobufEquals($accessConfigResource, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkInterface(); + $this->assertProtobufEquals($networkInterface, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstantSnapshotsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstantSnapshotsClientTest.php new file mode 100644 index 000000000000..3f169fc59d1a --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstantSnapshotsClientTest.php @@ -0,0 +1,1030 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return InstantSnapshotsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new InstantSnapshotsClient($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 InstantSnapshotsScopedList(), + ]; + $expectedResponse = new InstantSnapshotAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListInstantSnapshotsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.InstantSnapshots/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'; + $request = (new AggregatedListInstantSnapshotsRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTest() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instantSnapshot = 'instantSnapshot1465380450'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteInstantSnapshotRequest()) + ->setInstantSnapshot($instantSnapshot) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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.InstantSnapshots/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstantSnapshot(); + $this->assertProtobufEquals($instantSnapshot, $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 deleteExceptionTest() + { + $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/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 + $instantSnapshot = 'instantSnapshot1465380450'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteInstantSnapshotRequest()) + ->setInstantSnapshot($instantSnapshot) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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 + $architecture = 'architecture839674195'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $diskSizeGb = 757478089; + $id = 3355; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $region = 'region-934795532'; + $satisfiesPzi = false; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $sourceDisk = 'sourceDisk-85117119'; + $sourceDiskId = 'sourceDiskId-1693292839'; + $status = 'status-892481550'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new InstantSnapshot(); + $expectedResponse->setArchitecture($architecture); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDiskSizeGb($diskSizeGb); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $expectedResponse->setSourceDisk($sourceDisk); + $expectedResponse->setSourceDiskId($sourceDiskId); + $expectedResponse->setStatus($status); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $instantSnapshot = 'instantSnapshot1465380450'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetInstantSnapshotRequest()) + ->setInstantSnapshot($instantSnapshot) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.InstantSnapshots/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInstantSnapshot(); + $this->assertProtobufEquals($instantSnapshot, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $instantSnapshot = 'instantSnapshot1465380450'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetInstantSnapshotRequest()) + ->setInstantSnapshot($instantSnapshot) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $request = (new GetIamPolicyInstantSnapshotRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.InstantSnapshots/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $request = (new GetIamPolicyInstantSnapshotRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instantSnapshotResource = new InstantSnapshot(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new InsertInstantSnapshotRequest()) + ->setInstantSnapshotResource($instantSnapshotResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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.InstantSnapshots/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstantSnapshotResource(); + $this->assertProtobufEquals($instantSnapshotResource, $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 insertExceptionTest() + { + $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/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 + $instantSnapshotResource = new InstantSnapshot(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new InsertInstantSnapshotRequest()) + ->setInstantSnapshotResource($instantSnapshotResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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 InstantSnapshot(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InstantSnapshotList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListInstantSnapshotsRequest()) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->list($request); + $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.InstantSnapshots/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + $request = (new ListInstantSnapshotsRequest()) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $request = (new SetIamPolicyInstantSnapshotRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.InstantSnapshots/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $actualValue = $actualRequestObject->getZoneSetPolicyRequestResource(); + $this->assertProtobufEquals($zoneSetPolicyRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $request = (new SetIamPolicyInstantSnapshotRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setLabelsTest() + { + $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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetLabelsRequestResource = new ZoneSetLabelsRequest(); + $request = (new SetLabelsInstantSnapshotRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetLabelsRequestResource($zoneSetLabelsRequestResource); + $response = $gapicClient->setLabels($request); + $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.InstantSnapshots/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualApiRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $actualValue = $actualApiRequestObject->getZoneSetLabelsRequestResource(); + $this->assertProtobufEquals($zoneSetLabelsRequestResource, $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 setLabelsExceptionTest() + { + $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/setLabelsExceptionTest'); + $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 + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetLabelsRequestResource = new ZoneSetLabelsRequest(); + $request = (new SetLabelsInstantSnapshotRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetLabelsRequestResource($zoneSetLabelsRequestResource); + $response = $gapicClient->setLabels($request); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + $request = (new TestIamPermissionsInstantSnapshotRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.InstantSnapshots/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + $request = (new TestIamPermissionsInstantSnapshotRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function aggregatedListAsyncTest() + { + $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 InstantSnapshotsScopedList(), + ]; + $expectedResponse = new InstantSnapshotAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListInstantSnapshotsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.InstantSnapshots/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InterconnectAttachmentsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InterconnectAttachmentsClientTest.php new file mode 100644 index 000000000000..e8ff9b2e3b29 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InterconnectAttachmentsClientTest.php @@ -0,0 +1,943 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return InterconnectAttachmentsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new InterconnectAttachmentsClient($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 InterconnectAttachmentsScopedList(), + ]; + $expectedResponse = new InterconnectAttachmentAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListInterconnectAttachmentsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.InterconnectAttachments/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'; + $request = (new AggregatedListInterconnectAttachmentsRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $interconnectAttachment = 'interconnectAttachment308135284'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteInterconnectAttachmentRequest()) + ->setInterconnectAttachment($interconnectAttachment) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.InterconnectAttachments/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInterconnectAttachment(); + $this->assertProtobufEquals($interconnectAttachment, $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 + $interconnectAttachment = 'interconnectAttachment308135284'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteInterconnectAttachmentRequest()) + ->setInterconnectAttachment($interconnectAttachment) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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 + $adminEnabled = false; + $bandwidth = 'bandwidth-1965768527'; + $cloudRouterIpAddress = 'cloudRouterIpAddress1361134600'; + $cloudRouterIpv6Address = 'cloudRouterIpv6Address-621819448'; + $cloudRouterIpv6InterfaceId = 'cloudRouterIpv6InterfaceId1058153613'; + $creationTimestamp = 'creationTimestamp567396278'; + $customerRouterIpAddress = 'customerRouterIpAddress-741266063'; + $customerRouterIpv6Address = 'customerRouterIpv6Address1900739825'; + $customerRouterIpv6InterfaceId = 'customerRouterIpv6InterfaceId-1229618428'; + $dataplaneVersion = 1645532811; + $description = 'description-1724546052'; + $edgeAvailabilityDomain = 'edgeAvailabilityDomain-1539323226'; + $encryption = 'encryption-1512632445'; + $googleReferenceId = 'googleReferenceId534944469'; + $id = 3355; + $interconnect = 'interconnect-849140594'; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $mtu = 108462; + $name = 'name3373707'; + $operationalStatus = 'operationalStatus1274812671'; + $pairingKey = 'pairingKey976566376'; + $partnerAsn = 975037061; + $region2 = 'region2-690338393'; + $remoteService = 'remoteService-1218658372'; + $router = 'router-925132983'; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $stackType = 'stackType2036521617'; + $state = 'state109757585'; + $subnetLength = 1867652600; + $type = 'type3575610'; + $vlanTag8021q = 1730540572; + $expectedResponse = new InterconnectAttachment(); + $expectedResponse->setAdminEnabled($adminEnabled); + $expectedResponse->setBandwidth($bandwidth); + $expectedResponse->setCloudRouterIpAddress($cloudRouterIpAddress); + $expectedResponse->setCloudRouterIpv6Address($cloudRouterIpv6Address); + $expectedResponse->setCloudRouterIpv6InterfaceId($cloudRouterIpv6InterfaceId); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setCustomerRouterIpAddress($customerRouterIpAddress); + $expectedResponse->setCustomerRouterIpv6Address($customerRouterIpv6Address); + $expectedResponse->setCustomerRouterIpv6InterfaceId($customerRouterIpv6InterfaceId); + $expectedResponse->setDataplaneVersion($dataplaneVersion); + $expectedResponse->setDescription($description); + $expectedResponse->setEdgeAvailabilityDomain($edgeAvailabilityDomain); + $expectedResponse->setEncryption($encryption); + $expectedResponse->setGoogleReferenceId($googleReferenceId); + $expectedResponse->setId($id); + $expectedResponse->setInterconnect($interconnect); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setMtu($mtu); + $expectedResponse->setName($name); + $expectedResponse->setOperationalStatus($operationalStatus); + $expectedResponse->setPairingKey($pairingKey); + $expectedResponse->setPartnerAsn($partnerAsn); + $expectedResponse->setRegion($region2); + $expectedResponse->setRemoteService($remoteService); + $expectedResponse->setRouter($router); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStackType($stackType); + $expectedResponse->setState($state); + $expectedResponse->setSubnetLength($subnetLength); + $expectedResponse->setType($type); + $expectedResponse->setVlanTag8021q($vlanTag8021q); + $transport->addResponse($expectedResponse); + // Mock request + $interconnectAttachment = 'interconnectAttachment308135284'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetInterconnectAttachmentRequest()) + ->setInterconnectAttachment($interconnectAttachment) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.InterconnectAttachments/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInterconnectAttachment(); + $this->assertProtobufEquals($interconnectAttachment, $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 + $interconnectAttachment = 'interconnectAttachment308135284'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetInterconnectAttachmentRequest()) + ->setInterconnectAttachment($interconnectAttachment) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $interconnectAttachmentResource = new InterconnectAttachment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertInterconnectAttachmentRequest()) + ->setInterconnectAttachmentResource($interconnectAttachmentResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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.InterconnectAttachments/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInterconnectAttachmentResource(); + $this->assertProtobufEquals($interconnectAttachmentResource, $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 + $interconnectAttachmentResource = new InterconnectAttachment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertInterconnectAttachmentRequest()) + ->setInterconnectAttachmentResource($interconnectAttachmentResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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 InterconnectAttachment(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InterconnectAttachmentList(); + $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'; + $request = (new ListInterconnectAttachmentsRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.InterconnectAttachments/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'; + $request = (new ListInterconnectAttachmentsRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $interconnectAttachment = 'interconnectAttachment308135284'; + $interconnectAttachmentResource = new InterconnectAttachment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchInterconnectAttachmentRequest()) + ->setInterconnectAttachment($interconnectAttachment) + ->setInterconnectAttachmentResource($interconnectAttachmentResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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.InterconnectAttachments/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInterconnectAttachment(); + $this->assertProtobufEquals($interconnectAttachment, $actualValue); + $actualValue = $actualApiRequestObject->getInterconnectAttachmentResource(); + $this->assertProtobufEquals($interconnectAttachmentResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $interconnectAttachment = 'interconnectAttachment308135284'; + $interconnectAttachmentResource = new InterconnectAttachment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchInterconnectAttachmentRequest()) + ->setInterconnectAttachment($interconnectAttachment) + ->setInterconnectAttachmentResource($interconnectAttachmentResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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 setLabelsTest() + { + $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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $request = (new SetLabelsInterconnectAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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.InterconnectAttachments/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionSetLabelsRequestResource(); + $this->assertProtobufEquals($regionSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $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 setLabelsExceptionTest() + { + $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/setLabelsExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $request = (new SetLabelsInterconnectAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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 aggregatedListAsyncTest() + { + $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 InterconnectAttachmentsScopedList(), + ]; + $expectedResponse = new InterconnectAttachmentAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListInterconnectAttachmentsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.InterconnectAttachments/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InterconnectLocationsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InterconnectLocationsClientTest.php new file mode 100644 index 000000000000..eb78d59febde --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InterconnectLocationsClientTest.php @@ -0,0 +1,301 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return InterconnectLocationsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new InterconnectLocationsClient($options); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $address = 'address-1147692044'; + $availabilityZone = 'availabilityZone-378410992'; + $city = 'city3053931'; + $continent = 'continent-403427916'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $facilityProvider = 'facilityProvider2143916045'; + $facilityProviderFacilityId = 'facilityProviderFacilityId-1523343611'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $peeringdbFacilityId = 'peeringdbFacilityId-303818'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $supportsPzs = true; + $expectedResponse = new InterconnectLocation(); + $expectedResponse->setAddress($address); + $expectedResponse->setAvailabilityZone($availabilityZone); + $expectedResponse->setCity($city); + $expectedResponse->setContinent($continent); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFacilityProvider($facilityProvider); + $expectedResponse->setFacilityProviderFacilityId($facilityProviderFacilityId); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setPeeringdbFacilityId($peeringdbFacilityId); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $expectedResponse->setSupportsPzs($supportsPzs); + $transport->addResponse($expectedResponse); + // Mock request + $interconnectLocation = 'interconnectLocation-581505978'; + $project = 'project-309310695'; + $request = (new GetInterconnectLocationRequest()) + ->setInterconnectLocation($interconnectLocation) + ->setProject($project); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.InterconnectLocations/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInterconnectLocation(); + $this->assertProtobufEquals($interconnectLocation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $interconnectLocation = 'interconnectLocation-581505978'; + $project = 'project-309310695'; + $request = (new GetInterconnectLocationRequest()) + ->setInterconnectLocation($interconnectLocation) + ->setProject($project); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 InterconnectLocation(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InterconnectLocationList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListInterconnectLocationsRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.InterconnectLocations/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListInterconnectLocationsRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $address = 'address-1147692044'; + $availabilityZone = 'availabilityZone-378410992'; + $city = 'city3053931'; + $continent = 'continent-403427916'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $facilityProvider = 'facilityProvider2143916045'; + $facilityProviderFacilityId = 'facilityProviderFacilityId-1523343611'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $peeringdbFacilityId = 'peeringdbFacilityId-303818'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $supportsPzs = true; + $expectedResponse = new InterconnectLocation(); + $expectedResponse->setAddress($address); + $expectedResponse->setAvailabilityZone($availabilityZone); + $expectedResponse->setCity($city); + $expectedResponse->setContinent($continent); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFacilityProvider($facilityProvider); + $expectedResponse->setFacilityProviderFacilityId($facilityProviderFacilityId); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setPeeringdbFacilityId($peeringdbFacilityId); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $expectedResponse->setSupportsPzs($supportsPzs); + $transport->addResponse($expectedResponse); + // Mock request + $interconnectLocation = 'interconnectLocation-581505978'; + $project = 'project-309310695'; + $request = (new GetInterconnectLocationRequest()) + ->setInterconnectLocation($interconnectLocation) + ->setProject($project); + $response = $gapicClient->getAsync($request)->wait(); + $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.InterconnectLocations/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInterconnectLocation(); + $this->assertProtobufEquals($interconnectLocation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InterconnectRemoteLocationsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InterconnectRemoteLocationsClientTest.php new file mode 100644 index 000000000000..bec6789e9c66 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InterconnectRemoteLocationsClientTest.php @@ -0,0 +1,309 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return InterconnectRemoteLocationsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new InterconnectRemoteLocationsClient($options); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $address = 'address-1147692044'; + $city = 'city3053931'; + $continent = 'continent-403427916'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $facilityProvider = 'facilityProvider2143916045'; + $facilityProviderFacilityId = 'facilityProviderFacilityId-1523343611'; + $id = 3355; + $kind = 'kind3292052'; + $lacp = 'lacp3313826'; + $maxLagSize100Gbps = 828522571; + $maxLagSize10Gbps = 294007573; + $name = 'name3373707'; + $peeringdbFacilityId = 'peeringdbFacilityId-303818'; + $remoteService = 'remoteService-1218658372'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $expectedResponse = new InterconnectRemoteLocation(); + $expectedResponse->setAddress($address); + $expectedResponse->setCity($city); + $expectedResponse->setContinent($continent); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFacilityProvider($facilityProvider); + $expectedResponse->setFacilityProviderFacilityId($facilityProviderFacilityId); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLacp($lacp); + $expectedResponse->setMaxLagSize100Gbps($maxLagSize100Gbps); + $expectedResponse->setMaxLagSize10Gbps($maxLagSize10Gbps); + $expectedResponse->setName($name); + $expectedResponse->setPeeringdbFacilityId($peeringdbFacilityId); + $expectedResponse->setRemoteService($remoteService); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $transport->addResponse($expectedResponse); + // Mock request + $interconnectRemoteLocation = 'interconnectRemoteLocation1363895773'; + $project = 'project-309310695'; + $request = (new GetInterconnectRemoteLocationRequest()) + ->setInterconnectRemoteLocation($interconnectRemoteLocation) + ->setProject($project); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.InterconnectRemoteLocations/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInterconnectRemoteLocation(); + $this->assertProtobufEquals($interconnectRemoteLocation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $interconnectRemoteLocation = 'interconnectRemoteLocation1363895773'; + $project = 'project-309310695'; + $request = (new GetInterconnectRemoteLocationRequest()) + ->setInterconnectRemoteLocation($interconnectRemoteLocation) + ->setProject($project); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 InterconnectRemoteLocation(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InterconnectRemoteLocationList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListInterconnectRemoteLocationsRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.InterconnectRemoteLocations/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListInterconnectRemoteLocationsRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $address = 'address-1147692044'; + $city = 'city3053931'; + $continent = 'continent-403427916'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $facilityProvider = 'facilityProvider2143916045'; + $facilityProviderFacilityId = 'facilityProviderFacilityId-1523343611'; + $id = 3355; + $kind = 'kind3292052'; + $lacp = 'lacp3313826'; + $maxLagSize100Gbps = 828522571; + $maxLagSize10Gbps = 294007573; + $name = 'name3373707'; + $peeringdbFacilityId = 'peeringdbFacilityId-303818'; + $remoteService = 'remoteService-1218658372'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $expectedResponse = new InterconnectRemoteLocation(); + $expectedResponse->setAddress($address); + $expectedResponse->setCity($city); + $expectedResponse->setContinent($continent); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFacilityProvider($facilityProvider); + $expectedResponse->setFacilityProviderFacilityId($facilityProviderFacilityId); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLacp($lacp); + $expectedResponse->setMaxLagSize100Gbps($maxLagSize100Gbps); + $expectedResponse->setMaxLagSize10Gbps($maxLagSize10Gbps); + $expectedResponse->setName($name); + $expectedResponse->setPeeringdbFacilityId($peeringdbFacilityId); + $expectedResponse->setRemoteService($remoteService); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $transport->addResponse($expectedResponse); + // Mock request + $interconnectRemoteLocation = 'interconnectRemoteLocation1363895773'; + $project = 'project-309310695'; + $request = (new GetInterconnectRemoteLocationRequest()) + ->setInterconnectRemoteLocation($interconnectRemoteLocation) + ->setProject($project); + $response = $gapicClient->getAsync($request)->wait(); + $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.InterconnectRemoteLocations/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInterconnectRemoteLocation(); + $this->assertProtobufEquals($interconnectRemoteLocation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InterconnectsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InterconnectsClientTest.php new file mode 100644 index 000000000000..a6e63e48efb9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InterconnectsClientTest.php @@ -0,0 +1,962 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return InterconnectsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new InterconnectsClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $interconnect = 'interconnect-849140594'; + $project = 'project-309310695'; + $request = (new DeleteInterconnectRequest()) + ->setInterconnect($interconnect) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.Interconnects/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInterconnect(); + $this->assertProtobufEquals($interconnect, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $interconnect = 'interconnect-849140594'; + $project = 'project-309310695'; + $request = (new DeleteInterconnectRequest()) + ->setInterconnect($interconnect) + ->setProject($project); + $response = $gapicClient->delete($request); + $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 + $adminEnabled = false; + $creationTimestamp = 'creationTimestamp567396278'; + $customerName = 'customerName-2143818164'; + $description = 'description-1724546052'; + $googleIpAddress = 'googleIpAddress1516847778'; + $googleReferenceId = 'googleReferenceId534944469'; + $id = 3355; + $interconnectType = 'interconnectType2125777995'; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $linkType = 'linkType-1624275873'; + $location = 'location1901043637'; + $macsecEnabled = true; + $name = 'name3373707'; + $nocContactEmail = 'nocContactEmail1087814656'; + $operationalStatus = 'operationalStatus1274812671'; + $peerIpAddress = 'peerIpAddress-1939747879'; + $provisionedLinkCount = 1199724171; + $remoteLocation = 'remoteLocation1398130574'; + $requestedLinkCount = 1118793211; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $state = 'state109757585'; + $expectedResponse = new Interconnect(); + $expectedResponse->setAdminEnabled($adminEnabled); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setCustomerName($customerName); + $expectedResponse->setDescription($description); + $expectedResponse->setGoogleIpAddress($googleIpAddress); + $expectedResponse->setGoogleReferenceId($googleReferenceId); + $expectedResponse->setId($id); + $expectedResponse->setInterconnectType($interconnectType); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setLinkType($linkType); + $expectedResponse->setLocation($location); + $expectedResponse->setMacsecEnabled($macsecEnabled); + $expectedResponse->setName($name); + $expectedResponse->setNocContactEmail($nocContactEmail); + $expectedResponse->setOperationalStatus($operationalStatus); + $expectedResponse->setPeerIpAddress($peerIpAddress); + $expectedResponse->setProvisionedLinkCount($provisionedLinkCount); + $expectedResponse->setRemoteLocation($remoteLocation); + $expectedResponse->setRequestedLinkCount($requestedLinkCount); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setState($state); + $transport->addResponse($expectedResponse); + // Mock request + $interconnect = 'interconnect-849140594'; + $project = 'project-309310695'; + $request = (new GetInterconnectRequest()) + ->setInterconnect($interconnect) + ->setProject($project); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Interconnects/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInterconnect(); + $this->assertProtobufEquals($interconnect, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $interconnect = 'interconnect-849140594'; + $project = 'project-309310695'; + $request = (new GetInterconnectRequest()) + ->setInterconnect($interconnect) + ->setProject($project); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDiagnosticsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new InterconnectsGetDiagnosticsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $interconnect = 'interconnect-849140594'; + $project = 'project-309310695'; + $request = (new GetDiagnosticsInterconnectRequest()) + ->setInterconnect($interconnect) + ->setProject($project); + $response = $gapicClient->getDiagnostics($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Interconnects/GetDiagnostics', $actualFuncCall); + $actualValue = $actualRequestObject->getInterconnect(); + $this->assertProtobufEquals($interconnect, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDiagnosticsExceptionTest() + { + $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 + $interconnect = 'interconnect-849140594'; + $project = 'project-309310695'; + $request = (new GetDiagnosticsInterconnectRequest()) + ->setInterconnect($interconnect) + ->setProject($project); + try { + $gapicClient->getDiagnostics($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getMacsecConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $expectedResponse = new InterconnectsGetMacsecConfigResponse(); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $interconnect = 'interconnect-849140594'; + $project = 'project-309310695'; + $request = (new GetMacsecConfigInterconnectRequest()) + ->setInterconnect($interconnect) + ->setProject($project); + $response = $gapicClient->getMacsecConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Interconnects/GetMacsecConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getInterconnect(); + $this->assertProtobufEquals($interconnect, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getMacsecConfigExceptionTest() + { + $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 + $interconnect = 'interconnect-849140594'; + $project = 'project-309310695'; + $request = (new GetMacsecConfigInterconnectRequest()) + ->setInterconnect($interconnect) + ->setProject($project); + try { + $gapicClient->getMacsecConfig($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $interconnectResource = new Interconnect(); + $project = 'project-309310695'; + $request = (new InsertInterconnectRequest()) + ->setInterconnectResource($interconnectResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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.Interconnects/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInterconnectResource(); + $this->assertProtobufEquals($interconnectResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $interconnectResource = new Interconnect(); + $project = 'project-309310695'; + $request = (new InsertInterconnectRequest()) + ->setInterconnectResource($interconnectResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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 Interconnect(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InterconnectList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListInterconnectsRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.Interconnects/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListInterconnectsRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $interconnect = 'interconnect-849140594'; + $interconnectResource = new Interconnect(); + $project = 'project-309310695'; + $request = (new PatchInterconnectRequest()) + ->setInterconnect($interconnect) + ->setInterconnectResource($interconnectResource) + ->setProject($project); + $response = $gapicClient->patch($request); + $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.Interconnects/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInterconnect(); + $this->assertProtobufEquals($interconnect, $actualValue); + $actualValue = $actualApiRequestObject->getInterconnectResource(); + $this->assertProtobufEquals($interconnectResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $interconnect = 'interconnect-849140594'; + $interconnectResource = new Interconnect(); + $project = 'project-309310695'; + $request = (new PatchInterconnectRequest()) + ->setInterconnect($interconnect) + ->setInterconnectResource($interconnectResource) + ->setProject($project); + $response = $gapicClient->patch($request); + $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 setLabelsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetLabelsInterconnectRequest()) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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.Interconnects/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getGlobalSetLabelsRequestResource(); + $this->assertProtobufEquals($globalSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setLabelsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsExceptionTest'); + $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 + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetLabelsInterconnectRequest()) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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 deleteAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $interconnect = 'interconnect-849140594'; + $project = 'project-309310695'; + $request = (new DeleteInterconnectRequest()) + ->setInterconnect($interconnect) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.Interconnects/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInterconnect(); + $this->assertProtobufEquals($interconnect, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/LicenseCodesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/LicenseCodesClientTest.php new file mode 100644 index 000000000000..b2c48d89df7b --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/LicenseCodesClientTest.php @@ -0,0 +1,270 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return LicenseCodesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new LicenseCodesClient($options); + } + + /** @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'; + $selfLink = 'selfLink-1691268851'; + $state = 'state109757585'; + $transferable = false; + $expectedResponse = new LicenseCode(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setState($state); + $expectedResponse->setTransferable($transferable); + $transport->addResponse($expectedResponse); + // Mock request + $licenseCode = 'licenseCode1612079915'; + $project = 'project-309310695'; + $request = (new GetLicenseCodeRequest()) + ->setLicenseCode($licenseCode) + ->setProject($project); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.LicenseCodes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getLicenseCode(); + $this->assertProtobufEquals($licenseCode, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $licenseCode = 'licenseCode1612079915'; + $project = 'project-309310695'; + $request = (new GetLicenseCodeRequest()) + ->setLicenseCode($licenseCode) + ->setProject($project); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsLicenseCodeRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.LicenseCodes/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsLicenseCodeRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAsyncTest() + { + $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'; + $selfLink = 'selfLink-1691268851'; + $state = 'state109757585'; + $transferable = false; + $expectedResponse = new LicenseCode(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setState($state); + $expectedResponse->setTransferable($transferable); + $transport->addResponse($expectedResponse); + // Mock request + $licenseCode = 'licenseCode1612079915'; + $project = 'project-309310695'; + $request = (new GetLicenseCodeRequest()) + ->setLicenseCode($licenseCode) + ->setProject($project); + $response = $gapicClient->getAsync($request)->wait(); + $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.LicenseCodes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getLicenseCode(); + $this->assertProtobufEquals($licenseCode, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/LicensesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/LicensesClientTest.php new file mode 100644 index 000000000000..cb5fbf559ba3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/LicensesClientTest.php @@ -0,0 +1,770 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return LicensesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new LicensesClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $license = 'license166757441'; + $project = 'project-309310695'; + $request = (new DeleteLicenseRequest()) + ->setLicense($license) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.Licenses/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getLicense(); + $this->assertProtobufEquals($license, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $license = 'license166757441'; + $project = 'project-309310695'; + $request = (new DeleteLicenseRequest()) + ->setLicense($license) + ->setProject($project); + $response = $gapicClient->delete($request); + $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 + $chargesUseFee = true; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $licenseCode = 1612079915; + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $transferable = false; + $expectedResponse = new License(); + $expectedResponse->setChargesUseFee($chargesUseFee); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLicenseCode($licenseCode); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setTransferable($transferable); + $transport->addResponse($expectedResponse); + // Mock request + $license = 'license166757441'; + $project = 'project-309310695'; + $request = (new GetLicenseRequest()) + ->setLicense($license) + ->setProject($project); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Licenses/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getLicense(); + $this->assertProtobufEquals($license, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $license = 'license166757441'; + $project = 'project-309310695'; + $request = (new GetLicenseRequest()) + ->setLicense($license) + ->setProject($project); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyLicenseRequest()) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Licenses/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyLicenseRequest()) + ->setProject($project) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $licenseResource = new License(); + $project = 'project-309310695'; + $request = (new InsertLicenseRequest()) + ->setLicenseResource($licenseResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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.Licenses/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getLicenseResource(); + $this->assertProtobufEquals($licenseResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $licenseResource = new License(); + $project = 'project-309310695'; + $request = (new InsertLicenseRequest()) + ->setLicenseResource($licenseResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new License(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new LicensesListResponse(); + $expectedResponse->setId($id); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListLicensesRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.Licenses/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListLicensesRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetIamPolicyLicenseRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Licenses/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getGlobalSetPolicyRequestResource(); + $this->assertProtobufEquals($globalSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetIamPolicyLicenseRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsLicenseRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Licenses/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsLicenseRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $license = 'license166757441'; + $project = 'project-309310695'; + $request = (new DeleteLicenseRequest()) + ->setLicense($license) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.Licenses/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getLicense(); + $this->assertProtobufEquals($license, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/MachineImagesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/MachineImagesClientTest.php new file mode 100644 index 000000000000..26a41d67da7d --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/MachineImagesClientTest.php @@ -0,0 +1,778 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return MachineImagesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new MachineImagesClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $machineImage = 'machineImage1142931299'; + $project = 'project-309310695'; + $request = (new DeleteMachineImageRequest()) + ->setMachineImage($machineImage) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.MachineImages/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getMachineImage(); + $this->assertProtobufEquals($machineImage, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $machineImage = 'machineImage1142931299'; + $project = 'project-309310695'; + $request = (new DeleteMachineImageRequest()) + ->setMachineImage($machineImage) + ->setProject($project); + $response = $gapicClient->delete($request); + $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'; + $guestFlush = false; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $satisfiesPzi = false; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $sourceInstance = 'sourceInstance-677426119'; + $status = 'status-892481550'; + $totalStorageBytes = 1528757268; + $expectedResponse = new MachineImage(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setGuestFlush($guestFlush); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSourceInstance($sourceInstance); + $expectedResponse->setStatus($status); + $expectedResponse->setTotalStorageBytes($totalStorageBytes); + $transport->addResponse($expectedResponse); + // Mock request + $machineImage = 'machineImage1142931299'; + $project = 'project-309310695'; + $request = (new GetMachineImageRequest()) + ->setMachineImage($machineImage) + ->setProject($project); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.MachineImages/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getMachineImage(); + $this->assertProtobufEquals($machineImage, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $machineImage = 'machineImage1142931299'; + $project = 'project-309310695'; + $request = (new GetMachineImageRequest()) + ->setMachineImage($machineImage) + ->setProject($project); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyMachineImageRequest()) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.MachineImages/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyMachineImageRequest()) + ->setProject($project) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $machineImageResource = new MachineImage(); + $project = 'project-309310695'; + $request = (new InsertMachineImageRequest()) + ->setMachineImageResource($machineImageResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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.MachineImages/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getMachineImageResource(); + $this->assertProtobufEquals($machineImageResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $machineImageResource = new MachineImage(); + $project = 'project-309310695'; + $request = (new InsertMachineImageRequest()) + ->setMachineImageResource($machineImageResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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 MachineImage(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new MachineImageList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListMachineImagesRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.MachineImages/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListMachineImagesRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetIamPolicyMachineImageRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.MachineImages/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getGlobalSetPolicyRequestResource(); + $this->assertProtobufEquals($globalSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetIamPolicyMachineImageRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsMachineImageRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.MachineImages/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsMachineImageRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $machineImage = 'machineImage1142931299'; + $project = 'project-309310695'; + $request = (new DeleteMachineImageRequest()) + ->setMachineImage($machineImage) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.MachineImages/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getMachineImage(); + $this->assertProtobufEquals($machineImage, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/MachineTypesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/MachineTypesClientTest.php new file mode 100644 index 000000000000..6e70e6c6cde2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/MachineTypesClientTest.php @@ -0,0 +1,374 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return MachineTypesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new MachineTypesClient($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 MachineTypesScopedList(), + ]; + $expectedResponse = new MachineTypeAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListMachineTypesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.MachineTypes/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'; + $request = (new AggregatedListMachineTypesRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $guestCpus = 1754126894; + $id = 3355; + $imageSpaceGb = 461539048; + $isSharedCpu = false; + $kind = 'kind3292052'; + $maximumPersistentDisks = 1033091853; + $maximumPersistentDisksSizeGb = 1993209177; + $memoryMb = 1726613907; + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new MachineType(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setGuestCpus($guestCpus); + $expectedResponse->setId($id); + $expectedResponse->setImageSpaceGb($imageSpaceGb); + $expectedResponse->setIsSharedCpu($isSharedCpu); + $expectedResponse->setKind($kind); + $expectedResponse->setMaximumPersistentDisks($maximumPersistentDisks); + $expectedResponse->setMaximumPersistentDisksSizeGb($maximumPersistentDisksSizeGb); + $expectedResponse->setMemoryMb($memoryMb); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $machineType = 'machineType1838323762'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetMachineTypeRequest()) + ->setMachineType($machineType) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.MachineTypes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getMachineType(); + $this->assertProtobufEquals($machineType, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $machineType = 'machineType1838323762'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetMachineTypeRequest()) + ->setMachineType($machineType) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 MachineType(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new MachineTypeList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListMachineTypesRequest()) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->list($request); + $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.MachineTypes/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + $request = (new ListMachineTypesRequest()) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function aggregatedListAsyncTest() + { + $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 MachineTypesScopedList(), + ]; + $expectedResponse = new MachineTypeAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListMachineTypesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.MachineTypes/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworkAttachmentsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworkAttachmentsClientTest.php new file mode 100644 index 000000000000..dddfef86b148 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworkAttachmentsClientTest.php @@ -0,0 +1,1017 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return NetworkAttachmentsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NetworkAttachmentsClient($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 NetworkAttachmentsScopedList(), + ]; + $expectedResponse = new NetworkAttachmentAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListNetworkAttachmentsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.NetworkAttachments/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'; + $request = (new AggregatedListNetworkAttachmentsRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $networkAttachment = 'networkAttachment1835256788'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteNetworkAttachmentRequest()) + ->setNetworkAttachment($networkAttachment) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.NetworkAttachments/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkAttachment(); + $this->assertProtobufEquals($networkAttachment, $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 + $networkAttachment = 'networkAttachment1835256788'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteNetworkAttachmentRequest()) + ->setNetworkAttachment($networkAttachment) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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 + $connectionPreference = 'connectionPreference822688988'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $network = 'network1843485230'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $expectedResponse = new NetworkAttachment(); + $expectedResponse->setConnectionPreference($connectionPreference); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $transport->addResponse($expectedResponse); + // Mock request + $networkAttachment = 'networkAttachment1835256788'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetNetworkAttachmentRequest()) + ->setNetworkAttachment($networkAttachment) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.NetworkAttachments/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNetworkAttachment(); + $this->assertProtobufEquals($networkAttachment, $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 + $networkAttachment = 'networkAttachment1835256788'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetNetworkAttachmentRequest()) + ->setNetworkAttachment($networkAttachment) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyNetworkAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.NetworkAttachments/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyNetworkAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $networkAttachmentResource = new NetworkAttachment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertNetworkAttachmentRequest()) + ->setNetworkAttachmentResource($networkAttachmentResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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.NetworkAttachments/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkAttachmentResource(); + $this->assertProtobufEquals($networkAttachmentResource, $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 + $networkAttachmentResource = new NetworkAttachment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertNetworkAttachmentRequest()) + ->setNetworkAttachmentResource($networkAttachmentResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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 NetworkAttachment(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NetworkAttachmentList(); + $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'; + $request = (new ListNetworkAttachmentsRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.NetworkAttachments/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'; + $request = (new ListNetworkAttachmentsRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $networkAttachment = 'networkAttachment1835256788'; + $networkAttachmentResource = new NetworkAttachment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchNetworkAttachmentRequest()) + ->setNetworkAttachment($networkAttachment) + ->setNetworkAttachmentResource($networkAttachmentResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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.NetworkAttachments/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkAttachment(); + $this->assertProtobufEquals($networkAttachment, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkAttachmentResource(); + $this->assertProtobufEquals($networkAttachmentResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $networkAttachment = 'networkAttachment1835256788'; + $networkAttachmentResource = new NetworkAttachment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchNetworkAttachmentRequest()) + ->setNetworkAttachment($networkAttachment) + ->setNetworkAttachmentResource($networkAttachmentResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $request = (new SetIamPolicyNetworkAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.NetworkAttachments/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRegionSetPolicyRequestResource(); + $this->assertProtobufEquals($regionSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $request = (new SetIamPolicyNetworkAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsNetworkAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.NetworkAttachments/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsNetworkAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function aggregatedListAsyncTest() + { + $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 NetworkAttachmentsScopedList(), + ]; + $expectedResponse = new NetworkAttachmentAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListNetworkAttachmentsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.NetworkAttachments/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworkEdgeSecurityServicesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworkEdgeSecurityServicesClientTest.php new file mode 100644 index 000000000000..c4aa7e4ef013 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworkEdgeSecurityServicesClientTest.php @@ -0,0 +1,680 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return NetworkEdgeSecurityServicesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NetworkEdgeSecurityServicesClient($options); + } + + /** @test */ + public function aggregatedListTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $items = [ + 'itemsKey' => new NetworkEdgeSecurityServicesScopedList(), + ]; + $expectedResponse = new NetworkEdgeSecurityServiceAggregatedList(); + $expectedResponse->setEtag($etag); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListNetworkEdgeSecurityServicesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.NetworkEdgeSecurityServices/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'; + $request = (new AggregatedListNetworkEdgeSecurityServicesRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $networkEdgeSecurityService = 'networkEdgeSecurityService693882791'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteNetworkEdgeSecurityServiceRequest()) + ->setNetworkEdgeSecurityService($networkEdgeSecurityService) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.NetworkEdgeSecurityServices/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEdgeSecurityService(); + $this->assertProtobufEquals($networkEdgeSecurityService, $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 + $networkEdgeSecurityService = 'networkEdgeSecurityService693882791'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteNetworkEdgeSecurityServiceRequest()) + ->setNetworkEdgeSecurityService($networkEdgeSecurityService) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $region2 = 'region2-690338393'; + $securityPolicy = 'securityPolicy1781695249'; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $expectedResponse = new NetworkEdgeSecurityService(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSecurityPolicy($securityPolicy); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $transport->addResponse($expectedResponse); + // Mock request + $networkEdgeSecurityService = 'networkEdgeSecurityService693882791'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetNetworkEdgeSecurityServiceRequest()) + ->setNetworkEdgeSecurityService($networkEdgeSecurityService) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.NetworkEdgeSecurityServices/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNetworkEdgeSecurityService(); + $this->assertProtobufEquals($networkEdgeSecurityService, $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 + $networkEdgeSecurityService = 'networkEdgeSecurityService693882791'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetNetworkEdgeSecurityServiceRequest()) + ->setNetworkEdgeSecurityService($networkEdgeSecurityService) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $networkEdgeSecurityServiceResource = new NetworkEdgeSecurityService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertNetworkEdgeSecurityServiceRequest()) + ->setNetworkEdgeSecurityServiceResource($networkEdgeSecurityServiceResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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.NetworkEdgeSecurityServices/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEdgeSecurityServiceResource(); + $this->assertProtobufEquals($networkEdgeSecurityServiceResource, $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 + $networkEdgeSecurityServiceResource = new NetworkEdgeSecurityService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertNetworkEdgeSecurityServiceRequest()) + ->setNetworkEdgeSecurityServiceResource($networkEdgeSecurityServiceResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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 patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $networkEdgeSecurityService = 'networkEdgeSecurityService693882791'; + $networkEdgeSecurityServiceResource = new NetworkEdgeSecurityService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchNetworkEdgeSecurityServiceRequest()) + ->setNetworkEdgeSecurityService($networkEdgeSecurityService) + ->setNetworkEdgeSecurityServiceResource($networkEdgeSecurityServiceResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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.NetworkEdgeSecurityServices/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEdgeSecurityService(); + $this->assertProtobufEquals($networkEdgeSecurityService, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkEdgeSecurityServiceResource(); + $this->assertProtobufEquals($networkEdgeSecurityServiceResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $networkEdgeSecurityService = 'networkEdgeSecurityService693882791'; + $networkEdgeSecurityServiceResource = new NetworkEdgeSecurityService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchNetworkEdgeSecurityServiceRequest()) + ->setNetworkEdgeSecurityService($networkEdgeSecurityService) + ->setNetworkEdgeSecurityServiceResource($networkEdgeSecurityServiceResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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 aggregatedListAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $items = [ + 'itemsKey' => new NetworkEdgeSecurityServicesScopedList(), + ]; + $expectedResponse = new NetworkEdgeSecurityServiceAggregatedList(); + $expectedResponse->setEtag($etag); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListNetworkEdgeSecurityServicesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.NetworkEdgeSecurityServices/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworkEndpointGroupsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworkEndpointGroupsClientTest.php new file mode 100644 index 000000000000..fe0de5d2cb26 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworkEndpointGroupsClientTest.php @@ -0,0 +1,1087 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return NetworkEndpointGroupsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NetworkEndpointGroupsClient($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 NetworkEndpointGroupsScopedList(), + ]; + $expectedResponse = new NetworkEndpointGroupAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListNetworkEndpointGroupsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.NetworkEndpointGroups/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'; + $request = (new AggregatedListNetworkEndpointGroupsRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function attachNetworkEndpointsTest() + { + $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/attachNetworkEndpointsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/attachNetworkEndpointsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $networkEndpointGroupsAttachEndpointsRequestResource = new NetworkEndpointGroupsAttachEndpointsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new AttachNetworkEndpointsNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setNetworkEndpointGroupsAttachEndpointsRequestResource($networkEndpointGroupsAttachEndpointsRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->attachNetworkEndpoints($request); + $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.NetworkEndpointGroups/AttachNetworkEndpoints', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroupsAttachEndpointsRequestResource(); + $this->assertProtobufEquals($networkEndpointGroupsAttachEndpointsRequestResource, $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 attachNetworkEndpointsExceptionTest() + { + $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/attachNetworkEndpointsExceptionTest'); + $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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $networkEndpointGroupsAttachEndpointsRequestResource = new NetworkEndpointGroupsAttachEndpointsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new AttachNetworkEndpointsNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setNetworkEndpointGroupsAttachEndpointsRequestResource($networkEndpointGroupsAttachEndpointsRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->attachNetworkEndpoints($request); + $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 deleteTest() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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.NetworkEndpointGroups/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $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 deleteExceptionTest() + { + $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/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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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 detachNetworkEndpointsTest() + { + $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/detachNetworkEndpointsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/detachNetworkEndpointsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $networkEndpointGroupsDetachEndpointsRequestResource = new NetworkEndpointGroupsDetachEndpointsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DetachNetworkEndpointsNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setNetworkEndpointGroupsDetachEndpointsRequestResource($networkEndpointGroupsDetachEndpointsRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->detachNetworkEndpoints($request); + $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.NetworkEndpointGroups/DetachNetworkEndpoints', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroupsDetachEndpointsRequestResource(); + $this->assertProtobufEquals($networkEndpointGroupsDetachEndpointsRequestResource, $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 detachNetworkEndpointsExceptionTest() + { + $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/detachNetworkEndpointsExceptionTest'); + $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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $networkEndpointGroupsDetachEndpointsRequestResource = new NetworkEndpointGroupsDetachEndpointsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DetachNetworkEndpointsNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setNetworkEndpointGroupsDetachEndpointsRequestResource($networkEndpointGroupsDetachEndpointsRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->detachNetworkEndpoints($request); + $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'; + $defaultPort = 650363969; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $network = 'network1843485230'; + $networkEndpointType = 'networkEndpointType118301523'; + $pscTargetService = 'pscTargetService1879744870'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $size = 3530753; + $subnetwork = 'subnetwork-1302785042'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new NetworkEndpointGroup(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDefaultPort($defaultPort); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setNetworkEndpointType($networkEndpointType); + $expectedResponse->setPscTargetService($pscTargetService); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSize($size); + $expectedResponse->setSubnetwork($subnetwork); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.NetworkEndpointGroups/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $networkEndpointGroupResource = new NetworkEndpointGroup(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new InsertNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroupResource($networkEndpointGroupResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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.NetworkEndpointGroups/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroupResource(); + $this->assertProtobufEquals($networkEndpointGroupResource, $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 insertExceptionTest() + { + $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/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 + $networkEndpointGroupResource = new NetworkEndpointGroup(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new InsertNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroupResource($networkEndpointGroupResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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 NetworkEndpointGroup(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NetworkEndpointGroupList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListNetworkEndpointGroupsRequest()) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->list($request); + $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.NetworkEndpointGroups/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + $request = (new ListNetworkEndpointGroupsRequest()) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNetworkEndpointsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $itemsElement = new NetworkEndpointWithHealthStatus(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NetworkEndpointGroupsListNetworkEndpoints(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $networkEndpointGroupsListEndpointsRequestResource = new NetworkEndpointGroupsListEndpointsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListNetworkEndpointsNetworkEndpointGroupsRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setNetworkEndpointGroupsListEndpointsRequestResource($networkEndpointGroupsListEndpointsRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->listNetworkEndpoints($request); + $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.NetworkEndpointGroups/ListNetworkEndpoints', $actualFuncCall); + $actualValue = $actualRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualRequestObject->getNetworkEndpointGroupsListEndpointsRequestResource(); + $this->assertProtobufEquals($networkEndpointGroupsListEndpointsRequestResource, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNetworkEndpointsExceptionTest() + { + $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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $networkEndpointGroupsListEndpointsRequestResource = new NetworkEndpointGroupsListEndpointsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListNetworkEndpointsNetworkEndpointGroupsRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setNetworkEndpointGroupsListEndpointsRequestResource($networkEndpointGroupsListEndpointsRequestResource) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->listNetworkEndpoints($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + $request = (new TestIamPermissionsNetworkEndpointGroupRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.NetworkEndpointGroups/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + $request = (new TestIamPermissionsNetworkEndpointGroupRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function aggregatedListAsyncTest() + { + $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 NetworkEndpointGroupsScopedList(), + ]; + $expectedResponse = new NetworkEndpointGroupAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListNetworkEndpointGroupsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.NetworkEndpointGroups/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworkFirewallPoliciesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworkFirewallPoliciesClientTest.php new file mode 100644 index 000000000000..a71723839558 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworkFirewallPoliciesClientTest.php @@ -0,0 +1,1825 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return NetworkFirewallPoliciesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NetworkFirewallPoliciesClient($options); + } + + /** @test */ + public function addAssociationTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addAssociationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addAssociationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyAssociationResource = new FirewallPolicyAssociation(); + $project = 'project-309310695'; + $request = (new AddAssociationNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyAssociationResource($firewallPolicyAssociationResource) + ->setProject($project); + $response = $gapicClient->addAssociation($request); + $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.NetworkFirewallPolicies/AddAssociation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyAssociationResource(); + $this->assertProtobufEquals($firewallPolicyAssociationResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function addAssociationExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addAssociationExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyAssociationResource = new FirewallPolicyAssociation(); + $project = 'project-309310695'; + $request = (new AddAssociationNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyAssociationResource($firewallPolicyAssociationResource) + ->setProject($project); + $response = $gapicClient->addAssociation($request); + $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 addRuleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $project = 'project-309310695'; + $request = (new AddRuleNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource) + ->setProject($project); + $response = $gapicClient->addRule($request); + $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.NetworkFirewallPolicies/AddRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyRuleResource(); + $this->assertProtobufEquals($firewallPolicyRuleResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function addRuleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addRuleExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $project = 'project-309310695'; + $request = (new AddRuleNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource) + ->setProject($project); + $response = $gapicClient->addRule($request); + $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 cloneRulesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/cloneRulesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/cloneRulesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $request = (new CloneRulesNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project); + $response = $gapicClient->cloneRules($request); + $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.NetworkFirewallPolicies/CloneRules', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function cloneRulesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/cloneRulesExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $request = (new CloneRulesNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project); + $response = $gapicClient->cloneRules($request); + $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 deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $request = (new DeleteNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.NetworkFirewallPolicies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $request = (new DeleteNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project); + $response = $gapicClient->delete($request); + $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'; + $displayName = 'displayName1615086568'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $parent = 'parent-995424086'; + $region = 'region-934795532'; + $ruleTupleCount = 388342037; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $shortName = 'shortName1565793390'; + $expectedResponse = new FirewallPolicy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setRegion($region); + $expectedResponse->setRuleTupleCount($ruleTupleCount); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $expectedResponse->setShortName($shortName); + $transport->addResponse($expectedResponse); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $request = (new GetNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.NetworkFirewallPolicies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $request = (new GetNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAssociationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $attachmentTarget = 'attachmentTarget1786386477'; + $displayName = 'displayName1615086568'; + $firewallPolicyId = 'firewallPolicyId1430953673'; + $name2 = 'name2-1052831874'; + $shortName = 'shortName1565793390'; + $expectedResponse = new FirewallPolicyAssociation(); + $expectedResponse->setAttachmentTarget($attachmentTarget); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setFirewallPolicyId($firewallPolicyId); + $expectedResponse->setName($name2); + $expectedResponse->setShortName($shortName); + $transport->addResponse($expectedResponse); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $request = (new GetAssociationNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project); + $response = $gapicClient->getAssociation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.NetworkFirewallPolicies/GetAssociation', $actualFuncCall); + $actualValue = $actualRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAssociationExceptionTest() + { + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $request = (new GetAssociationNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project); + try { + $gapicClient->getAssociation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyNetworkFirewallPolicyRequest()) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.NetworkFirewallPolicies/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyNetworkFirewallPolicyRequest()) + ->setProject($project) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRuleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $action = 'action-1422950858'; + $description = 'description-1724546052'; + $direction = 'direction-962590849'; + $disabled = true; + $enableLogging = false; + $kind = 'kind3292052'; + $priority2 = 978365527; + $ruleName = 'ruleName-2092197394'; + $ruleTupleCount = 388342037; + $securityProfileGroup = 'securityProfileGroup-329459286'; + $tlsInspect = true; + $expectedResponse = new FirewallPolicyRule(); + $expectedResponse->setAction($action); + $expectedResponse->setDescription($description); + $expectedResponse->setDirection($direction); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setEnableLogging($enableLogging); + $expectedResponse->setKind($kind); + $expectedResponse->setPriority($priority2); + $expectedResponse->setRuleName($ruleName); + $expectedResponse->setRuleTupleCount($ruleTupleCount); + $expectedResponse->setSecurityProfileGroup($securityProfileGroup); + $expectedResponse->setTlsInspect($tlsInspect); + $transport->addResponse($expectedResponse); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $request = (new GetRuleNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project); + $response = $gapicClient->getRule($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.NetworkFirewallPolicies/GetRule', $actualFuncCall); + $actualValue = $actualRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRuleExceptionTest() + { + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $request = (new GetRuleNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project); + try { + $gapicClient->getRule($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $firewallPolicyResource = new FirewallPolicy(); + $project = 'project-309310695'; + $request = (new InsertNetworkFirewallPolicyRequest()) + ->setFirewallPolicyResource($firewallPolicyResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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.NetworkFirewallPolicies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicyResource(); + $this->assertProtobufEquals($firewallPolicyResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $firewallPolicyResource = new FirewallPolicy(); + $project = 'project-309310695'; + $request = (new InsertNetworkFirewallPolicyRequest()) + ->setFirewallPolicyResource($firewallPolicyResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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 = ''; + $itemsElement = new FirewallPolicy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new FirewallPolicyList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListNetworkFirewallPoliciesRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.NetworkFirewallPolicies/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListNetworkFirewallPoliciesRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyResource = new FirewallPolicy(); + $project = 'project-309310695'; + $request = (new PatchNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyResource($firewallPolicyResource) + ->setProject($project); + $response = $gapicClient->patch($request); + $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.NetworkFirewallPolicies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyResource(); + $this->assertProtobufEquals($firewallPolicyResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyResource = new FirewallPolicy(); + $project = 'project-309310695'; + $request = (new PatchNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyResource($firewallPolicyResource) + ->setProject($project); + $response = $gapicClient->patch($request); + $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 patchRuleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $project = 'project-309310695'; + $request = (new PatchRuleNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource) + ->setProject($project); + $response = $gapicClient->patchRule($request); + $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.NetworkFirewallPolicies/PatchRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyRuleResource(); + $this->assertProtobufEquals($firewallPolicyRuleResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchRuleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchRuleExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $project = 'project-309310695'; + $request = (new PatchRuleNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource) + ->setProject($project); + $response = $gapicClient->patchRule($request); + $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 removeAssociationTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/removeAssociationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeAssociationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $request = (new RemoveAssociationNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project); + $response = $gapicClient->removeAssociation($request); + $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.NetworkFirewallPolicies/RemoveAssociation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function removeAssociationExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/removeAssociationExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $request = (new RemoveAssociationNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project); + $response = $gapicClient->removeAssociation($request); + $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 removeRuleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/removeRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $request = (new RemoveRuleNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project); + $response = $gapicClient->removeRule($request); + $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.NetworkFirewallPolicies/RemoveRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function removeRuleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/removeRuleExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $request = (new RemoveRuleNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project); + $response = $gapicClient->removeRule($request); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetIamPolicyNetworkFirewallPolicyRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.NetworkFirewallPolicies/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getGlobalSetPolicyRequestResource(); + $this->assertProtobufEquals($globalSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetIamPolicyNetworkFirewallPolicyRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsNetworkFirewallPolicyRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.NetworkFirewallPolicies/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsNetworkFirewallPolicyRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function addAssociationAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addAssociationAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addAssociationAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyAssociationResource = new FirewallPolicyAssociation(); + $project = 'project-309310695'; + $request = (new AddAssociationNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyAssociationResource($firewallPolicyAssociationResource) + ->setProject($project); + $response = $gapicClient->addAssociation($request); + $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.NetworkFirewallPolicies/AddAssociation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyAssociationResource(); + $this->assertProtobufEquals($firewallPolicyAssociationResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworksClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworksClientTest.php new file mode 100644 index 000000000000..e9a6a5c9ec02 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworksClientTest.php @@ -0,0 +1,1342 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return NetworksClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NetworksClient($options); + } + + /** @test */ + public function addPeeringTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addPeeringTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addPeeringTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $network = 'network1843485230'; + $networksAddPeeringRequestResource = new NetworksAddPeeringRequest(); + $project = 'project-309310695'; + $request = (new AddPeeringNetworkRequest()) + ->setNetwork($network) + ->setNetworksAddPeeringRequestResource($networksAddPeeringRequestResource) + ->setProject($project); + $response = $gapicClient->addPeering($request); + $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.Networks/AddPeering', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $actualValue = $actualApiRequestObject->getNetworksAddPeeringRequestResource(); + $this->assertProtobufEquals($networksAddPeeringRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function addPeeringExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addPeeringExceptionTest'); + $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 + $network = 'network1843485230'; + $networksAddPeeringRequestResource = new NetworksAddPeeringRequest(); + $project = 'project-309310695'; + $request = (new AddPeeringNetworkRequest()) + ->setNetwork($network) + ->setNetworksAddPeeringRequestResource($networksAddPeeringRequestResource) + ->setProject($project); + $response = $gapicClient->addPeering($request); + $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 deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $network = 'network1843485230'; + $project = 'project-309310695'; + $request = (new DeleteNetworkRequest()) + ->setNetwork($network) + ->setProject($project); + $response = $gapicClient->delete($request); + $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.Networks/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $network = 'network1843485230'; + $project = 'project-309310695'; + $request = (new DeleteNetworkRequest()) + ->setNetwork($network) + ->setProject($project); + $response = $gapicClient->delete($request); + $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 + $iPv4Range = 'iPv4Range1132976182'; + $autoCreateSubnetworks = true; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $enableUlaInternalIpv6 = true; + $firewallPolicy = 'firewallPolicy1035044177'; + $gatewayIPv4 = 'gatewayIPv4-1431933859'; + $id = 3355; + $internalIpv6Range = 'internalIpv6Range277456807'; + $kind = 'kind3292052'; + $mtu = 108462; + $name = 'name3373707'; + $networkFirewallPolicyEnforcementOrder = 'networkFirewallPolicyEnforcementOrder1617117520'; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $expectedResponse = new Network(); + $expectedResponse->setIPv4Range($iPv4Range); + $expectedResponse->setAutoCreateSubnetworks($autoCreateSubnetworks); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEnableUlaInternalIpv6($enableUlaInternalIpv6); + $expectedResponse->setFirewallPolicy($firewallPolicy); + $expectedResponse->setGatewayIPv4($gatewayIPv4); + $expectedResponse->setId($id); + $expectedResponse->setInternalIpv6Range($internalIpv6Range); + $expectedResponse->setKind($kind); + $expectedResponse->setMtu($mtu); + $expectedResponse->setName($name); + $expectedResponse->setNetworkFirewallPolicyEnforcementOrder($networkFirewallPolicyEnforcementOrder); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $transport->addResponse($expectedResponse); + // Mock request + $network = 'network1843485230'; + $project = 'project-309310695'; + $request = (new GetNetworkRequest()) + ->setNetwork($network) + ->setProject($project); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Networks/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $network = 'network1843485230'; + $project = 'project-309310695'; + $request = (new GetNetworkRequest()) + ->setNetwork($network) + ->setProject($project); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEffectiveFirewallsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new NetworksGetEffectiveFirewallsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $network = 'network1843485230'; + $project = 'project-309310695'; + $request = (new GetEffectiveFirewallsNetworkRequest()) + ->setNetwork($network) + ->setProject($project); + $response = $gapicClient->getEffectiveFirewalls($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Networks/GetEffectiveFirewalls', $actualFuncCall); + $actualValue = $actualRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEffectiveFirewallsExceptionTest() + { + $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 + $network = 'network1843485230'; + $project = 'project-309310695'; + $request = (new GetEffectiveFirewallsNetworkRequest()) + ->setNetwork($network) + ->setProject($project); + try { + $gapicClient->getEffectiveFirewalls($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $networkResource = new Network(); + $project = 'project-309310695'; + $request = (new InsertNetworkRequest()) + ->setNetworkResource($networkResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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.Networks/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkResource(); + $this->assertProtobufEquals($networkResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $networkResource = new Network(); + $project = 'project-309310695'; + $request = (new InsertNetworkRequest()) + ->setNetworkResource($networkResource) + ->setProject($project); + $response = $gapicClient->insert($request); + $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 Network(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NetworkList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListNetworksRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.Networks/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListNetworksRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listPeeringRoutesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new ExchangedPeeringRoute(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new ExchangedPeeringRoutesList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $network = 'network1843485230'; + $project = 'project-309310695'; + $request = (new ListPeeringRoutesNetworksRequest()) + ->setNetwork($network) + ->setProject($project); + $response = $gapicClient->listPeeringRoutes($request); + $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.Networks/ListPeeringRoutes', $actualFuncCall); + $actualValue = $actualRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listPeeringRoutesExceptionTest() + { + $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 + $network = 'network1843485230'; + $project = 'project-309310695'; + $request = (new ListPeeringRoutesNetworksRequest()) + ->setNetwork($network) + ->setProject($project); + try { + $gapicClient->listPeeringRoutes($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $network = 'network1843485230'; + $networkResource = new Network(); + $project = 'project-309310695'; + $request = (new PatchNetworkRequest()) + ->setNetwork($network) + ->setNetworkResource($networkResource) + ->setProject($project); + $response = $gapicClient->patch($request); + $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.Networks/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkResource(); + $this->assertProtobufEquals($networkResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $network = 'network1843485230'; + $networkResource = new Network(); + $project = 'project-309310695'; + $request = (new PatchNetworkRequest()) + ->setNetwork($network) + ->setNetworkResource($networkResource) + ->setProject($project); + $response = $gapicClient->patch($request); + $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 removePeeringTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/removePeeringTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removePeeringTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $network = 'network1843485230'; + $networksRemovePeeringRequestResource = new NetworksRemovePeeringRequest(); + $project = 'project-309310695'; + $request = (new RemovePeeringNetworkRequest()) + ->setNetwork($network) + ->setNetworksRemovePeeringRequestResource($networksRemovePeeringRequestResource) + ->setProject($project); + $response = $gapicClient->removePeering($request); + $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.Networks/RemovePeering', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $actualValue = $actualApiRequestObject->getNetworksRemovePeeringRequestResource(); + $this->assertProtobufEquals($networksRemovePeeringRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function removePeeringExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/removePeeringExceptionTest'); + $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 + $network = 'network1843485230'; + $networksRemovePeeringRequestResource = new NetworksRemovePeeringRequest(); + $project = 'project-309310695'; + $request = (new RemovePeeringNetworkRequest()) + ->setNetwork($network) + ->setNetworksRemovePeeringRequestResource($networksRemovePeeringRequestResource) + ->setProject($project); + $response = $gapicClient->removePeering($request); + $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 switchToCustomModeTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/switchToCustomModeTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/switchToCustomModeTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $network = 'network1843485230'; + $project = 'project-309310695'; + $request = (new SwitchToCustomModeNetworkRequest()) + ->setNetwork($network) + ->setProject($project); + $response = $gapicClient->switchToCustomMode($request); + $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.Networks/SwitchToCustomMode', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function switchToCustomModeExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/switchToCustomModeExceptionTest'); + $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 + $network = 'network1843485230'; + $project = 'project-309310695'; + $request = (new SwitchToCustomModeNetworkRequest()) + ->setNetwork($network) + ->setProject($project); + $response = $gapicClient->switchToCustomMode($request); + $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 updatePeeringTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/updatePeeringTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/updatePeeringTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $network = 'network1843485230'; + $networksUpdatePeeringRequestResource = new NetworksUpdatePeeringRequest(); + $project = 'project-309310695'; + $request = (new UpdatePeeringNetworkRequest()) + ->setNetwork($network) + ->setNetworksUpdatePeeringRequestResource($networksUpdatePeeringRequestResource) + ->setProject($project); + $response = $gapicClient->updatePeering($request); + $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.Networks/UpdatePeering', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $actualValue = $actualApiRequestObject->getNetworksUpdatePeeringRequestResource(); + $this->assertProtobufEquals($networksUpdatePeeringRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updatePeeringExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/updatePeeringExceptionTest'); + $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 + $network = 'network1843485230'; + $networksUpdatePeeringRequestResource = new NetworksUpdatePeeringRequest(); + $project = 'project-309310695'; + $request = (new UpdatePeeringNetworkRequest()) + ->setNetwork($network) + ->setNetworksUpdatePeeringRequestResource($networksUpdatePeeringRequestResource) + ->setProject($project); + $response = $gapicClient->updatePeering($request); + $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 addPeeringAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addPeeringAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addPeeringAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $network = 'network1843485230'; + $networksAddPeeringRequestResource = new NetworksAddPeeringRequest(); + $project = 'project-309310695'; + $request = (new AddPeeringNetworkRequest()) + ->setNetwork($network) + ->setNetworksAddPeeringRequestResource($networksAddPeeringRequestResource) + ->setProject($project); + $response = $gapicClient->addPeering($request); + $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.Networks/AddPeering', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $actualValue = $actualApiRequestObject->getNetworksAddPeeringRequestResource(); + $this->assertProtobufEquals($networksAddPeeringRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NodeGroupsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NodeGroupsClientTest.php new file mode 100644 index 000000000000..87e9634450b6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NodeGroupsClientTest.php @@ -0,0 +1,1825 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return NodeGroupsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NodeGroupsClient($options); + } + + /** @test */ + public function addNodesTest() + { + $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/addNodesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addNodesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupsAddNodesRequestResource = new NodeGroupsAddNodesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new AddNodesNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setNodeGroupsAddNodesRequestResource($nodeGroupsAddNodesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->addNodes($request); + $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.NodeGroups/AddNodes', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNodeGroup(); + $this->assertProtobufEquals($nodeGroup, $actualValue); + $actualValue = $actualApiRequestObject->getNodeGroupsAddNodesRequestResource(); + $this->assertProtobufEquals($nodeGroupsAddNodesRequestResource, $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 addNodesExceptionTest() + { + $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/addNodesExceptionTest'); + $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 + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupsAddNodesRequestResource = new NodeGroupsAddNodesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new AddNodesNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setNodeGroupsAddNodesRequestResource($nodeGroupsAddNodesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->addNodes($request); + $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 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 NodeGroupsScopedList(), + ]; + $expectedResponse = new NodeGroupAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListNodeGroupsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.NodeGroups/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'; + $request = (new AggregatedListNodeGroupsRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTest() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $nodeGroup = 'nodeGroup1543699970'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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.NodeGroups/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNodeGroup(); + $this->assertProtobufEquals($nodeGroup, $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 deleteExceptionTest() + { + $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/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 + $nodeGroup = 'nodeGroup1543699970'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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 deleteNodesTest() + { + $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/deleteNodesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteNodesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupsDeleteNodesRequestResource = new NodeGroupsDeleteNodesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteNodesNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setNodeGroupsDeleteNodesRequestResource($nodeGroupsDeleteNodesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->deleteNodes($request); + $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.NodeGroups/DeleteNodes', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNodeGroup(); + $this->assertProtobufEquals($nodeGroup, $actualValue); + $actualValue = $actualApiRequestObject->getNodeGroupsDeleteNodesRequestResource(); + $this->assertProtobufEquals($nodeGroupsDeleteNodesRequestResource, $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 deleteNodesExceptionTest() + { + $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/deleteNodesExceptionTest'); + $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 + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupsDeleteNodesRequestResource = new NodeGroupsDeleteNodesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteNodesNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setNodeGroupsDeleteNodesRequestResource($nodeGroupsDeleteNodesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->deleteNodes($request); + $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'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $locationHint = 'locationHint-1796964143'; + $maintenanceInterval = 'maintenanceInterval1477109873'; + $maintenancePolicy = 'maintenancePolicy1065198558'; + $name = 'name3373707'; + $nodeTemplate = 'nodeTemplate323154455'; + $selfLink = 'selfLink-1691268851'; + $size = 3530753; + $status = 'status-892481550'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new NodeGroup(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLocationHint($locationHint); + $expectedResponse->setMaintenanceInterval($maintenanceInterval); + $expectedResponse->setMaintenancePolicy($maintenancePolicy); + $expectedResponse->setName($name); + $expectedResponse->setNodeTemplate($nodeTemplate); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSize($size); + $expectedResponse->setStatus($status); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $nodeGroup = 'nodeGroup1543699970'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.NodeGroups/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNodeGroup(); + $this->assertProtobufEquals($nodeGroup, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $nodeGroup = 'nodeGroup1543699970'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $request = (new GetIamPolicyNodeGroupRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.NodeGroups/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $request = (new GetIamPolicyNodeGroupRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $initialNodeCount = 1682564205; + $nodeGroupResource = new NodeGroup(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new InsertNodeGroupRequest()) + ->setInitialNodeCount($initialNodeCount) + ->setNodeGroupResource($nodeGroupResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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.NodeGroups/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInitialNodeCount(); + $this->assertProtobufEquals($initialNodeCount, $actualValue); + $actualValue = $actualApiRequestObject->getNodeGroupResource(); + $this->assertProtobufEquals($nodeGroupResource, $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 insertExceptionTest() + { + $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/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 + $initialNodeCount = 1682564205; + $nodeGroupResource = new NodeGroup(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new InsertNodeGroupRequest()) + ->setInitialNodeCount($initialNodeCount) + ->setNodeGroupResource($nodeGroupResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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 NodeGroup(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NodeGroupList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListNodeGroupsRequest()) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->list($request); + $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.NodeGroups/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + $request = (new ListNodeGroupsRequest()) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNodesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new NodeGroupNode(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NodeGroupsListNodes(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $nodeGroup = 'nodeGroup1543699970'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListNodesNodeGroupsRequest()) + ->setNodeGroup($nodeGroup) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->listNodes($request); + $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.NodeGroups/ListNodes', $actualFuncCall); + $actualValue = $actualRequestObject->getNodeGroup(); + $this->assertProtobufEquals($nodeGroup, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNodesExceptionTest() + { + $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 + $nodeGroup = 'nodeGroup1543699970'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListNodesNodeGroupsRequest()) + ->setNodeGroup($nodeGroup) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->listNodes($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupResource = new NodeGroup(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new PatchNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setNodeGroupResource($nodeGroupResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->patch($request); + $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.NodeGroups/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNodeGroup(); + $this->assertProtobufEquals($nodeGroup, $actualValue); + $actualValue = $actualApiRequestObject->getNodeGroupResource(); + $this->assertProtobufEquals($nodeGroupResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupResource = new NodeGroup(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new PatchNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setNodeGroupResource($nodeGroupResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->patch($request); + $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 performMaintenanceTest() + { + $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/performMaintenanceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/performMaintenanceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupsPerformMaintenanceRequestResource = new NodeGroupsPerformMaintenanceRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new PerformMaintenanceNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setNodeGroupsPerformMaintenanceRequestResource($nodeGroupsPerformMaintenanceRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->performMaintenance($request); + $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.NodeGroups/PerformMaintenance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNodeGroup(); + $this->assertProtobufEquals($nodeGroup, $actualValue); + $actualValue = $actualApiRequestObject->getNodeGroupsPerformMaintenanceRequestResource(); + $this->assertProtobufEquals($nodeGroupsPerformMaintenanceRequestResource, $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 performMaintenanceExceptionTest() + { + $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/performMaintenanceExceptionTest'); + $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 + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupsPerformMaintenanceRequestResource = new NodeGroupsPerformMaintenanceRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new PerformMaintenanceNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setNodeGroupsPerformMaintenanceRequestResource($nodeGroupsPerformMaintenanceRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->performMaintenance($request); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $request = (new SetIamPolicyNodeGroupRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.NodeGroups/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $actualValue = $actualRequestObject->getZoneSetPolicyRequestResource(); + $this->assertProtobufEquals($zoneSetPolicyRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $request = (new SetIamPolicyNodeGroupRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setNodeTemplateTest() + { + $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/setNodeTemplateTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setNodeTemplateTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupsSetNodeTemplateRequestResource = new NodeGroupsSetNodeTemplateRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetNodeTemplateNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setNodeGroupsSetNodeTemplateRequestResource($nodeGroupsSetNodeTemplateRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setNodeTemplate($request); + $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.NodeGroups/SetNodeTemplate', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNodeGroup(); + $this->assertProtobufEquals($nodeGroup, $actualValue); + $actualValue = $actualApiRequestObject->getNodeGroupsSetNodeTemplateRequestResource(); + $this->assertProtobufEquals($nodeGroupsSetNodeTemplateRequestResource, $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 setNodeTemplateExceptionTest() + { + $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/setNodeTemplateExceptionTest'); + $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 + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupsSetNodeTemplateRequestResource = new NodeGroupsSetNodeTemplateRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SetNodeTemplateNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setNodeGroupsSetNodeTemplateRequestResource($nodeGroupsSetNodeTemplateRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->setNodeTemplate($request); + $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 simulateMaintenanceEventTest() + { + $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/simulateMaintenanceEventTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/simulateMaintenanceEventTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupsSimulateMaintenanceEventRequestResource = new NodeGroupsSimulateMaintenanceEventRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SimulateMaintenanceEventNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setNodeGroupsSimulateMaintenanceEventRequestResource($nodeGroupsSimulateMaintenanceEventRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->simulateMaintenanceEvent($request); + $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.NodeGroups/SimulateMaintenanceEvent', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNodeGroup(); + $this->assertProtobufEquals($nodeGroup, $actualValue); + $actualValue = $actualApiRequestObject->getNodeGroupsSimulateMaintenanceEventRequestResource(); + $this->assertProtobufEquals($nodeGroupsSimulateMaintenanceEventRequestResource, $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 simulateMaintenanceEventExceptionTest() + { + $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/simulateMaintenanceEventExceptionTest'); + $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 + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupsSimulateMaintenanceEventRequestResource = new NodeGroupsSimulateMaintenanceEventRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SimulateMaintenanceEventNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setNodeGroupsSimulateMaintenanceEventRequestResource($nodeGroupsSimulateMaintenanceEventRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->simulateMaintenanceEvent($request); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + $request = (new TestIamPermissionsNodeGroupRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.NodeGroups/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + $request = (new TestIamPermissionsNodeGroupRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function addNodesAsyncTest() + { + $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/addNodesAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addNodesAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupsAddNodesRequestResource = new NodeGroupsAddNodesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new AddNodesNodeGroupRequest()) + ->setNodeGroup($nodeGroup) + ->setNodeGroupsAddNodesRequestResource($nodeGroupsAddNodesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->addNodes($request); + $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.NodeGroups/AddNodes', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNodeGroup(); + $this->assertProtobufEquals($nodeGroup, $actualValue); + $actualValue = $actualApiRequestObject->getNodeGroupsAddNodesRequestResource(); + $this->assertProtobufEquals($nodeGroupsAddNodesRequestResource, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NodeTemplatesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NodeTemplatesClientTest.php new file mode 100644 index 000000000000..d27564b3397c --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NodeTemplatesClientTest.php @@ -0,0 +1,883 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return NodeTemplatesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NodeTemplatesClient($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 NodeTemplatesScopedList(), + ]; + $expectedResponse = new NodeTemplateAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListNodeTemplatesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.NodeTemplates/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'; + $request = (new AggregatedListNodeTemplatesRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $nodeTemplate = 'nodeTemplate323154455'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteNodeTemplateRequest()) + ->setNodeTemplate($nodeTemplate) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.NodeTemplates/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNodeTemplate(); + $this->assertProtobufEquals($nodeTemplate, $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 + $nodeTemplate = 'nodeTemplate323154455'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteNodeTemplateRequest()) + ->setNodeTemplate($nodeTemplate) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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 + $cpuOvercommitType = 'cpuOvercommitType247727959'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $nodeType = 'nodeType465832791'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $statusMessage = 'statusMessage-239442758'; + $expectedResponse = new NodeTemplate(); + $expectedResponse->setCpuOvercommitType($cpuOvercommitType); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNodeType($nodeType); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $expectedResponse->setStatusMessage($statusMessage); + $transport->addResponse($expectedResponse); + // Mock request + $nodeTemplate = 'nodeTemplate323154455'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetNodeTemplateRequest()) + ->setNodeTemplate($nodeTemplate) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.NodeTemplates/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNodeTemplate(); + $this->assertProtobufEquals($nodeTemplate, $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 + $nodeTemplate = 'nodeTemplate323154455'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetNodeTemplateRequest()) + ->setNodeTemplate($nodeTemplate) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyNodeTemplateRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.NodeTemplates/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyNodeTemplateRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $nodeTemplateResource = new NodeTemplate(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertNodeTemplateRequest()) + ->setNodeTemplateResource($nodeTemplateResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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.NodeTemplates/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNodeTemplateResource(); + $this->assertProtobufEquals($nodeTemplateResource, $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 + $nodeTemplateResource = new NodeTemplate(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertNodeTemplateRequest()) + ->setNodeTemplateResource($nodeTemplateResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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 NodeTemplate(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NodeTemplateList(); + $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'; + $request = (new ListNodeTemplatesRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.NodeTemplates/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'; + $request = (new ListNodeTemplatesRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $request = (new SetIamPolicyNodeTemplateRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.NodeTemplates/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRegionSetPolicyRequestResource(); + $this->assertProtobufEquals($regionSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $request = (new SetIamPolicyNodeTemplateRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsNodeTemplateRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.NodeTemplates/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsNodeTemplateRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function aggregatedListAsyncTest() + { + $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 NodeTemplatesScopedList(), + ]; + $expectedResponse = new NodeTemplateAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListNodeTemplatesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.NodeTemplates/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NodeTypesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NodeTypesClientTest.php new file mode 100644 index 000000000000..94ab2e1c74bf --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NodeTypesClientTest.php @@ -0,0 +1,370 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return NodeTypesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NodeTypesClient($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 NodeTypesScopedList(), + ]; + $expectedResponse = new NodeTypeAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListNodeTypesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.NodeTypes/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'; + $request = (new AggregatedListNodeTypesRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $cpuPlatform = 'cpuPlatform947156266'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $guestCpus = 1754126894; + $id = 3355; + $kind = 'kind3292052'; + $localSsdGb = 1281375158; + $memoryMb = 1726613907; + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new NodeType(); + $expectedResponse->setCpuPlatform($cpuPlatform); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setGuestCpus($guestCpus); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLocalSsdGb($localSsdGb); + $expectedResponse->setMemoryMb($memoryMb); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $nodeType = 'nodeType465832791'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetNodeTypeRequest()) + ->setNodeType($nodeType) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.NodeTypes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNodeType(); + $this->assertProtobufEquals($nodeType, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $nodeType = 'nodeType465832791'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetNodeTypeRequest()) + ->setNodeType($nodeType) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 NodeType(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NodeTypeList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListNodeTypesRequest()) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->list($request); + $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.NodeTypes/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + $request = (new ListNodeTypesRequest()) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function aggregatedListAsyncTest() + { + $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 NodeTypesScopedList(), + ]; + $expectedResponse = new NodeTypeAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListNodeTypesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.NodeTypes/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/PacketMirroringsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/PacketMirroringsClientTest.php new file mode 100644 index 000000000000..86998406f782 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/PacketMirroringsClientTest.php @@ -0,0 +1,843 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return PacketMirroringsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new PacketMirroringsClient($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 PacketMirroringsScopedList(), + ]; + $expectedResponse = new PacketMirroringAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListPacketMirroringsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.PacketMirrorings/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'; + $request = (new AggregatedListPacketMirroringsRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $packetMirroring = 'packetMirroring22305996'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeletePacketMirroringRequest()) + ->setPacketMirroring($packetMirroring) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.PacketMirrorings/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getPacketMirroring(); + $this->assertProtobufEquals($packetMirroring, $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 + $packetMirroring = 'packetMirroring22305996'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeletePacketMirroringRequest()) + ->setPacketMirroring($packetMirroring) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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'; + $enable = 'enable-1298848381'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $priority = 1165461084; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new PacketMirroring(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEnable($enable); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setPriority($priority); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $packetMirroring = 'packetMirroring22305996'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetPacketMirroringRequest()) + ->setPacketMirroring($packetMirroring) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.PacketMirrorings/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getPacketMirroring(); + $this->assertProtobufEquals($packetMirroring, $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 + $packetMirroring = 'packetMirroring22305996'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetPacketMirroringRequest()) + ->setPacketMirroring($packetMirroring) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $packetMirroringResource = new PacketMirroring(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertPacketMirroringRequest()) + ->setPacketMirroringResource($packetMirroringResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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.PacketMirrorings/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getPacketMirroringResource(); + $this->assertProtobufEquals($packetMirroringResource, $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 + $packetMirroringResource = new PacketMirroring(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertPacketMirroringRequest()) + ->setPacketMirroringResource($packetMirroringResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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 PacketMirroring(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new PacketMirroringList(); + $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'; + $request = (new ListPacketMirroringsRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.PacketMirrorings/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'; + $request = (new ListPacketMirroringsRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $packetMirroring = 'packetMirroring22305996'; + $packetMirroringResource = new PacketMirroring(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchPacketMirroringRequest()) + ->setPacketMirroring($packetMirroring) + ->setPacketMirroringResource($packetMirroringResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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.PacketMirrorings/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getPacketMirroring(); + $this->assertProtobufEquals($packetMirroring, $actualValue); + $actualValue = $actualApiRequestObject->getPacketMirroringResource(); + $this->assertProtobufEquals($packetMirroringResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $packetMirroring = 'packetMirroring22305996'; + $packetMirroringResource = new PacketMirroring(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchPacketMirroringRequest()) + ->setPacketMirroring($packetMirroring) + ->setPacketMirroringResource($packetMirroringResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsPacketMirroringRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.PacketMirrorings/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsPacketMirroringRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function aggregatedListAsyncTest() + { + $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 PacketMirroringsScopedList(), + ]; + $expectedResponse = new PacketMirroringAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListPacketMirroringsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.PacketMirrorings/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ProjectsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ProjectsClientTest.php new file mode 100644 index 000000000000..b0c0821aff93 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ProjectsClientTest.php @@ -0,0 +1,1664 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ProjectsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ProjectsClient($options); + } + + /** @test */ + public function disableXpnHostTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/disableXpnHostTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/disableXpnHostTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $request = (new DisableXpnHostProjectRequest()) + ->setProject($project); + $response = $gapicClient->disableXpnHost($request); + $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.Projects/DisableXpnHost', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function disableXpnHostExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/disableXpnHostExceptionTest'); + $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 + $project = 'project-309310695'; + $request = (new DisableXpnHostProjectRequest()) + ->setProject($project); + $response = $gapicClient->disableXpnHost($request); + $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 disableXpnResourceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/disableXpnResourceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/disableXpnResourceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $projectsDisableXpnResourceRequestResource = new ProjectsDisableXpnResourceRequest(); + $request = (new DisableXpnResourceProjectRequest()) + ->setProject($project) + ->setProjectsDisableXpnResourceRequestResource($projectsDisableXpnResourceRequestResource); + $response = $gapicClient->disableXpnResource($request); + $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.Projects/DisableXpnResource', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getProjectsDisableXpnResourceRequestResource(); + $this->assertProtobufEquals($projectsDisableXpnResourceRequestResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function disableXpnResourceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/disableXpnResourceExceptionTest'); + $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 + $project = 'project-309310695'; + $projectsDisableXpnResourceRequestResource = new ProjectsDisableXpnResourceRequest(); + $request = (new DisableXpnResourceProjectRequest()) + ->setProject($project) + ->setProjectsDisableXpnResourceRequestResource($projectsDisableXpnResourceRequestResource); + $response = $gapicClient->disableXpnResource($request); + $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 enableXpnHostTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/enableXpnHostTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/enableXpnHostTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $request = (new EnableXpnHostProjectRequest()) + ->setProject($project); + $response = $gapicClient->enableXpnHost($request); + $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.Projects/EnableXpnHost', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function enableXpnHostExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/enableXpnHostExceptionTest'); + $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 + $project = 'project-309310695'; + $request = (new EnableXpnHostProjectRequest()) + ->setProject($project); + $response = $gapicClient->enableXpnHost($request); + $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 enableXpnResourceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/enableXpnResourceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/enableXpnResourceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $projectsEnableXpnResourceRequestResource = new ProjectsEnableXpnResourceRequest(); + $request = (new EnableXpnResourceProjectRequest()) + ->setProject($project) + ->setProjectsEnableXpnResourceRequestResource($projectsEnableXpnResourceRequestResource); + $response = $gapicClient->enableXpnResource($request); + $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.Projects/EnableXpnResource', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getProjectsEnableXpnResourceRequestResource(); + $this->assertProtobufEquals($projectsEnableXpnResourceRequestResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function enableXpnResourceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/enableXpnResourceExceptionTest'); + $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 + $project = 'project-309310695'; + $projectsEnableXpnResourceRequestResource = new ProjectsEnableXpnResourceRequest(); + $request = (new EnableXpnResourceProjectRequest()) + ->setProject($project) + ->setProjectsEnableXpnResourceRequestResource($projectsEnableXpnResourceRequestResource); + $response = $gapicClient->enableXpnResource($request); + $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 + $cloudArmorTier = 'cloudArmorTier-532443860'; + $creationTimestamp = 'creationTimestamp567396278'; + $defaultNetworkTier = 'defaultNetworkTier1545495185'; + $defaultServiceAccount = 'defaultServiceAccount-1848771419'; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $vmDnsSetting = 'vmDnsSetting1132598194'; + $xpnProjectStatus = 'xpnProjectStatus-308451647'; + $expectedResponse = new Project(); + $expectedResponse->setCloudArmorTier($cloudArmorTier); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDefaultNetworkTier($defaultNetworkTier); + $expectedResponse->setDefaultServiceAccount($defaultServiceAccount); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setVmDnsSetting($vmDnsSetting); + $expectedResponse->setXpnProjectStatus($xpnProjectStatus); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new GetProjectRequest()) + ->setProject($project); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Projects/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $project = 'project-309310695'; + $request = (new GetProjectRequest()) + ->setProject($project); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getXpnHostTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $cloudArmorTier = 'cloudArmorTier-532443860'; + $creationTimestamp = 'creationTimestamp567396278'; + $defaultNetworkTier = 'defaultNetworkTier1545495185'; + $defaultServiceAccount = 'defaultServiceAccount-1848771419'; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $vmDnsSetting = 'vmDnsSetting1132598194'; + $xpnProjectStatus = 'xpnProjectStatus-308451647'; + $expectedResponse = new Project(); + $expectedResponse->setCloudArmorTier($cloudArmorTier); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDefaultNetworkTier($defaultNetworkTier); + $expectedResponse->setDefaultServiceAccount($defaultServiceAccount); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setVmDnsSetting($vmDnsSetting); + $expectedResponse->setXpnProjectStatus($xpnProjectStatus); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new GetXpnHostProjectRequest()) + ->setProject($project); + $response = $gapicClient->getXpnHost($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Projects/GetXpnHost', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getXpnHostExceptionTest() + { + $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'; + $request = (new GetXpnHostProjectRequest()) + ->setProject($project); + try { + $gapicClient->getXpnHost($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getXpnResourcesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $kind = 'kind3292052'; + $nextPageToken = ''; + $resourcesElement = new XpnResourceId(); + $resources = [ + $resourcesElement, + ]; + $expectedResponse = new ProjectsGetXpnResources(); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setResources($resources); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new GetXpnResourcesProjectsRequest()) + ->setProject($project); + $response = $gapicClient->getXpnResources($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getResources()[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.Projects/GetXpnResources', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getXpnResourcesExceptionTest() + { + $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'; + $request = (new GetXpnResourcesProjectsRequest()) + ->setProject($project); + try { + $gapicClient->getXpnResources($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listXpnHostsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new Project(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new XpnHostList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $projectsListXpnHostsRequestResource = new ProjectsListXpnHostsRequest(); + $request = (new ListXpnHostsProjectsRequest()) + ->setProject($project) + ->setProjectsListXpnHostsRequestResource($projectsListXpnHostsRequestResource); + $response = $gapicClient->listXpnHosts($request); + $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.Projects/ListXpnHosts', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getProjectsListXpnHostsRequestResource(); + $this->assertProtobufEquals($projectsListXpnHostsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listXpnHostsExceptionTest() + { + $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'; + $projectsListXpnHostsRequestResource = new ProjectsListXpnHostsRequest(); + $request = (new ListXpnHostsProjectsRequest()) + ->setProject($project) + ->setProjectsListXpnHostsRequestResource($projectsListXpnHostsRequestResource); + try { + $gapicClient->listXpnHosts($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function moveDiskTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/moveDiskTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/moveDiskTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $diskMoveRequestResource = new DiskMoveRequest(); + $project = 'project-309310695'; + $request = (new MoveDiskProjectRequest()) + ->setDiskMoveRequestResource($diskMoveRequestResource) + ->setProject($project); + $response = $gapicClient->moveDisk($request); + $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.Projects/MoveDisk', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDiskMoveRequestResource(); + $this->assertProtobufEquals($diskMoveRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function moveDiskExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/moveDiskExceptionTest'); + $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 + $diskMoveRequestResource = new DiskMoveRequest(); + $project = 'project-309310695'; + $request = (new MoveDiskProjectRequest()) + ->setDiskMoveRequestResource($diskMoveRequestResource) + ->setProject($project); + $response = $gapicClient->moveDisk($request); + $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 moveInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/moveInstanceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/moveInstanceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceMoveRequestResource = new InstanceMoveRequest(); + $project = 'project-309310695'; + $request = (new MoveInstanceProjectRequest()) + ->setInstanceMoveRequestResource($instanceMoveRequestResource) + ->setProject($project); + $response = $gapicClient->moveInstance($request); + $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.Projects/MoveInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceMoveRequestResource(); + $this->assertProtobufEquals($instanceMoveRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function moveInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/moveInstanceExceptionTest'); + $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 + $instanceMoveRequestResource = new InstanceMoveRequest(); + $project = 'project-309310695'; + $request = (new MoveInstanceProjectRequest()) + ->setInstanceMoveRequestResource($instanceMoveRequestResource) + ->setProject($project); + $response = $gapicClient->moveInstance($request); + $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 setCloudArmorTierTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setCloudArmorTierTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setCloudArmorTierTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $projectsSetCloudArmorTierRequestResource = new ProjectsSetCloudArmorTierRequest(); + $request = (new SetCloudArmorTierProjectRequest()) + ->setProject($project) + ->setProjectsSetCloudArmorTierRequestResource($projectsSetCloudArmorTierRequestResource); + $response = $gapicClient->setCloudArmorTier($request); + $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.Projects/SetCloudArmorTier', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getProjectsSetCloudArmorTierRequestResource(); + $this->assertProtobufEquals($projectsSetCloudArmorTierRequestResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setCloudArmorTierExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setCloudArmorTierExceptionTest'); + $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 + $project = 'project-309310695'; + $projectsSetCloudArmorTierRequestResource = new ProjectsSetCloudArmorTierRequest(); + $request = (new SetCloudArmorTierProjectRequest()) + ->setProject($project) + ->setProjectsSetCloudArmorTierRequestResource($projectsSetCloudArmorTierRequestResource); + $response = $gapicClient->setCloudArmorTier($request); + $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 setCommonInstanceMetadataTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setCommonInstanceMetadataTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setCommonInstanceMetadataTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $metadataResource = new Metadata(); + $project = 'project-309310695'; + $request = (new SetCommonInstanceMetadataProjectRequest()) + ->setMetadataResource($metadataResource) + ->setProject($project); + $response = $gapicClient->setCommonInstanceMetadata($request); + $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.Projects/SetCommonInstanceMetadata', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getMetadataResource(); + $this->assertProtobufEquals($metadataResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setCommonInstanceMetadataExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setCommonInstanceMetadataExceptionTest'); + $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 + $metadataResource = new Metadata(); + $project = 'project-309310695'; + $request = (new SetCommonInstanceMetadataProjectRequest()) + ->setMetadataResource($metadataResource) + ->setProject($project); + $response = $gapicClient->setCommonInstanceMetadata($request); + $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 setDefaultNetworkTierTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setDefaultNetworkTierTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setDefaultNetworkTierTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $projectsSetDefaultNetworkTierRequestResource = new ProjectsSetDefaultNetworkTierRequest(); + $request = (new SetDefaultNetworkTierProjectRequest()) + ->setProject($project) + ->setProjectsSetDefaultNetworkTierRequestResource($projectsSetDefaultNetworkTierRequestResource); + $response = $gapicClient->setDefaultNetworkTier($request); + $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.Projects/SetDefaultNetworkTier', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getProjectsSetDefaultNetworkTierRequestResource(); + $this->assertProtobufEquals($projectsSetDefaultNetworkTierRequestResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setDefaultNetworkTierExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setDefaultNetworkTierExceptionTest'); + $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 + $project = 'project-309310695'; + $projectsSetDefaultNetworkTierRequestResource = new ProjectsSetDefaultNetworkTierRequest(); + $request = (new SetDefaultNetworkTierProjectRequest()) + ->setProject($project) + ->setProjectsSetDefaultNetworkTierRequestResource($projectsSetDefaultNetworkTierRequestResource); + $response = $gapicClient->setDefaultNetworkTier($request); + $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 setUsageExportBucketTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setUsageExportBucketTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setUsageExportBucketTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $usageExportLocationResource = new UsageExportLocation(); + $request = (new SetUsageExportBucketProjectRequest()) + ->setProject($project) + ->setUsageExportLocationResource($usageExportLocationResource); + $response = $gapicClient->setUsageExportBucket($request); + $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.Projects/SetUsageExportBucket', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getUsageExportLocationResource(); + $this->assertProtobufEquals($usageExportLocationResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setUsageExportBucketExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setUsageExportBucketExceptionTest'); + $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 + $project = 'project-309310695'; + $usageExportLocationResource = new UsageExportLocation(); + $request = (new SetUsageExportBucketProjectRequest()) + ->setProject($project) + ->setUsageExportLocationResource($usageExportLocationResource); + $response = $gapicClient->setUsageExportBucket($request); + $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 disableXpnHostAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/disableXpnHostAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/disableXpnHostAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $request = (new DisableXpnHostProjectRequest()) + ->setProject($project); + $response = $gapicClient->disableXpnHost($request); + $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.Projects/DisableXpnHost', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/PublicAdvertisedPrefixesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/PublicAdvertisedPrefixesClientTest.php new file mode 100644 index 000000000000..9851642fbaa0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/PublicAdvertisedPrefixesClientTest.php @@ -0,0 +1,914 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return PublicAdvertisedPrefixesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new PublicAdvertisedPrefixesClient($options); + } + + /** @test */ + public function announceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/announceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/announceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $publicAdvertisedPrefix = 'publicAdvertisedPrefix-1508738146'; + $request = (new AnnouncePublicAdvertisedPrefixeRequest()) + ->setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + $response = $gapicClient->announce($request); + $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.PublicAdvertisedPrefixes/Announce', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicAdvertisedPrefix(); + $this->assertProtobufEquals($publicAdvertisedPrefix, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function announceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/announceExceptionTest'); + $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 + $project = 'project-309310695'; + $publicAdvertisedPrefix = 'publicAdvertisedPrefix-1508738146'; + $request = (new AnnouncePublicAdvertisedPrefixeRequest()) + ->setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + $response = $gapicClient->announce($request); + $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 deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $publicAdvertisedPrefix = 'publicAdvertisedPrefix-1508738146'; + $request = (new DeletePublicAdvertisedPrefixeRequest()) + ->setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + $response = $gapicClient->delete($request); + $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.PublicAdvertisedPrefixes/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicAdvertisedPrefix(); + $this->assertProtobufEquals($publicAdvertisedPrefix, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $publicAdvertisedPrefix = 'publicAdvertisedPrefix-1508738146'; + $request = (new DeletePublicAdvertisedPrefixeRequest()) + ->setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + $response = $gapicClient->delete($request); + $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 + $byoipApiVersion = 'byoipApiVersion162683283'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $dnsVerificationIp = 'dnsVerificationIp-1906472267'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $ipCidrRange = 'ipCidrRange-2049366326'; + $kind = 'kind3292052'; + $name = 'name3373707'; + $pdpScope = 'pdpScope1061135697'; + $selfLink = 'selfLink-1691268851'; + $sharedSecret = 'sharedSecret-154938422'; + $status = 'status-892481550'; + $expectedResponse = new PublicAdvertisedPrefix(); + $expectedResponse->setByoipApiVersion($byoipApiVersion); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDnsVerificationIp($dnsVerificationIp); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setIpCidrRange($ipCidrRange); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setPdpScope($pdpScope); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSharedSecret($sharedSecret); + $expectedResponse->setStatus($status); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $publicAdvertisedPrefix = 'publicAdvertisedPrefix-1508738146'; + $request = (new GetPublicAdvertisedPrefixeRequest()) + ->setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.PublicAdvertisedPrefixes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getPublicAdvertisedPrefix(); + $this->assertProtobufEquals($publicAdvertisedPrefix, $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 + $project = 'project-309310695'; + $publicAdvertisedPrefix = 'publicAdvertisedPrefix-1508738146'; + $request = (new GetPublicAdvertisedPrefixeRequest()) + ->setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $publicAdvertisedPrefixResource = new PublicAdvertisedPrefix(); + $request = (new InsertPublicAdvertisedPrefixeRequest()) + ->setProject($project) + ->setPublicAdvertisedPrefixResource($publicAdvertisedPrefixResource); + $response = $gapicClient->insert($request); + $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.PublicAdvertisedPrefixes/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicAdvertisedPrefixResource(); + $this->assertProtobufEquals($publicAdvertisedPrefixResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $publicAdvertisedPrefixResource = new PublicAdvertisedPrefix(); + $request = (new InsertPublicAdvertisedPrefixeRequest()) + ->setProject($project) + ->setPublicAdvertisedPrefixResource($publicAdvertisedPrefixResource); + $response = $gapicClient->insert($request); + $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 PublicAdvertisedPrefix(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new PublicAdvertisedPrefixList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListPublicAdvertisedPrefixesRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.PublicAdvertisedPrefixes/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListPublicAdvertisedPrefixesRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $publicAdvertisedPrefix = 'publicAdvertisedPrefix-1508738146'; + $publicAdvertisedPrefixResource = new PublicAdvertisedPrefix(); + $request = (new PatchPublicAdvertisedPrefixeRequest()) + ->setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix) + ->setPublicAdvertisedPrefixResource($publicAdvertisedPrefixResource); + $response = $gapicClient->patch($request); + $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.PublicAdvertisedPrefixes/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicAdvertisedPrefix(); + $this->assertProtobufEquals($publicAdvertisedPrefix, $actualValue); + $actualValue = $actualApiRequestObject->getPublicAdvertisedPrefixResource(); + $this->assertProtobufEquals($publicAdvertisedPrefixResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $publicAdvertisedPrefix = 'publicAdvertisedPrefix-1508738146'; + $publicAdvertisedPrefixResource = new PublicAdvertisedPrefix(); + $request = (new PatchPublicAdvertisedPrefixeRequest()) + ->setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix) + ->setPublicAdvertisedPrefixResource($publicAdvertisedPrefixResource); + $response = $gapicClient->patch($request); + $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 withdrawTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/withdrawTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/withdrawTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $publicAdvertisedPrefix = 'publicAdvertisedPrefix-1508738146'; + $request = (new WithdrawPublicAdvertisedPrefixeRequest()) + ->setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + $response = $gapicClient->withdraw($request); + $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.PublicAdvertisedPrefixes/Withdraw', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicAdvertisedPrefix(); + $this->assertProtobufEquals($publicAdvertisedPrefix, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function withdrawExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/withdrawExceptionTest'); + $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 + $project = 'project-309310695'; + $publicAdvertisedPrefix = 'publicAdvertisedPrefix-1508738146'; + $request = (new WithdrawPublicAdvertisedPrefixeRequest()) + ->setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + $response = $gapicClient->withdraw($request); + $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 announceAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/announceAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/announceAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $publicAdvertisedPrefix = 'publicAdvertisedPrefix-1508738146'; + $request = (new AnnouncePublicAdvertisedPrefixeRequest()) + ->setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + $response = $gapicClient->announce($request); + $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.PublicAdvertisedPrefixes/Announce', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicAdvertisedPrefix(); + $this->assertProtobufEquals($publicAdvertisedPrefix, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/PublicDelegatedPrefixesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/PublicDelegatedPrefixesClientTest.php new file mode 100644 index 000000000000..a9ac8a6fe325 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/PublicDelegatedPrefixesClientTest.php @@ -0,0 +1,1028 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return PublicDelegatedPrefixesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new PublicDelegatedPrefixesClient($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 PublicDelegatedPrefixesScopedList(), + ]; + $expectedResponse = new PublicDelegatedPrefixAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListPublicDelegatedPrefixesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.PublicDelegatedPrefixes/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'; + $request = (new AggregatedListPublicDelegatedPrefixesRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function announceTest() + { + $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/announceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/announceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $region = 'region-934795532'; + $request = (new AnnouncePublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setRegion($region); + $response = $gapicClient->announce($request); + $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.PublicDelegatedPrefixes/Announce', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicDelegatedPrefix(); + $this->assertProtobufEquals($publicDelegatedPrefix, $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 announceExceptionTest() + { + $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/announceExceptionTest'); + $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 + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $region = 'region-934795532'; + $request = (new AnnouncePublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setRegion($region); + $response = $gapicClient->announce($request); + $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 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 + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $region = 'region-934795532'; + $request = (new DeletePublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.PublicDelegatedPrefixes/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicDelegatedPrefix(); + $this->assertProtobufEquals($publicDelegatedPrefix, $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 + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $region = 'region-934795532'; + $request = (new DeletePublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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 + $allocatablePrefixLength = 1649040182; + $byoipApiVersion = 'byoipApiVersion162683283'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $ipCidrRange = 'ipCidrRange-2049366326'; + $isLiveMigration = true; + $kind = 'kind3292052'; + $mode = 'mode3357091'; + $name = 'name3373707'; + $parentPrefix = 'parentPrefix552104903'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $expectedResponse = new PublicDelegatedPrefix(); + $expectedResponse->setAllocatablePrefixLength($allocatablePrefixLength); + $expectedResponse->setByoipApiVersion($byoipApiVersion); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setIpCidrRange($ipCidrRange); + $expectedResponse->setIsLiveMigration($isLiveMigration); + $expectedResponse->setKind($kind); + $expectedResponse->setMode($mode); + $expectedResponse->setName($name); + $expectedResponse->setParentPrefix($parentPrefix); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $region = 'region-934795532'; + $request = (new GetPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.PublicDelegatedPrefixes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getPublicDelegatedPrefix(); + $this->assertProtobufEquals($publicDelegatedPrefix, $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 + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $region = 'region-934795532'; + $request = (new GetPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + $region = 'region-934795532'; + $request = (new InsertPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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.PublicDelegatedPrefixes/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicDelegatedPrefixResource(); + $this->assertProtobufEquals($publicDelegatedPrefixResource, $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 + $project = 'project-309310695'; + $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + $region = 'region-934795532'; + $request = (new InsertPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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 PublicDelegatedPrefix(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new PublicDelegatedPrefixList(); + $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'; + $request = (new ListPublicDelegatedPrefixesRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.PublicDelegatedPrefixes/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'; + $request = (new ListPublicDelegatedPrefixesRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + $region = 'region-934795532'; + $request = (new PatchPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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.PublicDelegatedPrefixes/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicDelegatedPrefix(); + $this->assertProtobufEquals($publicDelegatedPrefix, $actualValue); + $actualValue = $actualApiRequestObject->getPublicDelegatedPrefixResource(); + $this->assertProtobufEquals($publicDelegatedPrefixResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + $region = 'region-934795532'; + $request = (new PatchPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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 withdrawTest() + { + $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/withdrawTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/withdrawTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $region = 'region-934795532'; + $request = (new WithdrawPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setRegion($region); + $response = $gapicClient->withdraw($request); + $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.PublicDelegatedPrefixes/Withdraw', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicDelegatedPrefix(); + $this->assertProtobufEquals($publicDelegatedPrefix, $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 withdrawExceptionTest() + { + $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/withdrawExceptionTest'); + $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 + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $region = 'region-934795532'; + $request = (new WithdrawPublicDelegatedPrefixeRequest()) + ->setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setRegion($region); + $response = $gapicClient->withdraw($request); + $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 aggregatedListAsyncTest() + { + $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 PublicDelegatedPrefixesScopedList(), + ]; + $expectedResponse = new PublicDelegatedPrefixAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListPublicDelegatedPrefixesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.PublicDelegatedPrefixes/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionAutoscalersClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionAutoscalersClientTest.php new file mode 100644 index 000000000000..93197ad2c441 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionAutoscalersClientTest.php @@ -0,0 +1,828 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionAutoscalersClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionAutoscalersClient($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 + $autoscaler = 'autoscaler517258967'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionAutoscalerRequest()) + ->setAutoscaler($autoscaler) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.RegionAutoscalers/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAutoscaler(); + $this->assertProtobufEquals($autoscaler, $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 + $autoscaler = 'autoscaler517258967'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionAutoscalerRequest()) + ->setAutoscaler($autoscaler) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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'; + $recommendedSize = 1889567899; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $target = 'target-880905839'; + $zone = 'zone3744684'; + $expectedResponse = new Autoscaler(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRecommendedSize($recommendedSize); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $expectedResponse->setTarget($target); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $autoscaler = 'autoscaler517258967'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionAutoscalerRequest()) + ->setAutoscaler($autoscaler) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionAutoscalers/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getAutoscaler(); + $this->assertProtobufEquals($autoscaler, $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 + $autoscaler = 'autoscaler517258967'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionAutoscalerRequest()) + ->setAutoscaler($autoscaler) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertRegionAutoscalerRequest()) + ->setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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.RegionAutoscalers/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAutoscalerResource(); + $this->assertProtobufEquals($autoscalerResource, $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 + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertRegionAutoscalerRequest()) + ->setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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 Autoscaler(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new RegionAutoscalerList(); + $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'; + $request = (new ListRegionAutoscalersRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.RegionAutoscalers/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'; + $request = (new ListRegionAutoscalersRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchRegionAutoscalerRequest()) + ->setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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.RegionAutoscalers/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAutoscalerResource(); + $this->assertProtobufEquals($autoscalerResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchRegionAutoscalerRequest()) + ->setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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 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 + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new UpdateRegionAutoscalerRequest()) + ->setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->update($request); + $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.RegionAutoscalers/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAutoscalerResource(); + $this->assertProtobufEquals($autoscalerResource, $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 + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new UpdateRegionAutoscalerRequest()) + ->setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->update($request); + $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 deleteAsyncTest() + { + $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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $autoscaler = 'autoscaler517258967'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionAutoscalerRequest()) + ->setAutoscaler($autoscaler) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.RegionAutoscalers/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAutoscaler(); + $this->assertProtobufEquals($autoscaler, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionBackendServicesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionBackendServicesClientTest.php new file mode 100644 index 000000000000..51db0b1dd458 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionBackendServicesClientTest.php @@ -0,0 +1,1421 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionBackendServicesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionBackendServicesClient($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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.RegionBackendServices/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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 + $affinityCookieTtlSec = 1777486694; + $compressionMode = 'compressionMode-2051962660'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $edgeSecurityPolicy = 'edgeSecurityPolicy-1032704881'; + $enableCDN = false; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $loadBalancingScheme = 'loadBalancingScheme1974502980'; + $localityLbPolicy = 'localityLbPolicy-2016052161'; + $name = 'name3373707'; + $network = 'network1843485230'; + $port = 3446913; + $portName = 'portName1115276169'; + $protocol = 'protocol-989163880'; + $region2 = 'region2-690338393'; + $securityPolicy = 'securityPolicy1781695249'; + $selfLink = 'selfLink-1691268851'; + $serviceLbPolicy = 'serviceLbPolicy1168590609'; + $sessionAffinity = 'sessionAffinity1000759473'; + $timeoutSec = 2067488653; + $expectedResponse = new BackendService(); + $expectedResponse->setAffinityCookieTtlSec($affinityCookieTtlSec); + $expectedResponse->setCompressionMode($compressionMode); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEdgeSecurityPolicy($edgeSecurityPolicy); + $expectedResponse->setEnableCDN($enableCDN); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLoadBalancingScheme($loadBalancingScheme); + $expectedResponse->setLocalityLbPolicy($localityLbPolicy); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setPort($port); + $expectedResponse->setPortName($portName); + $expectedResponse->setProtocol($protocol); + $expectedResponse->setRegion($region2); + $expectedResponse->setSecurityPolicy($securityPolicy); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setServiceLbPolicy($serviceLbPolicy); + $expectedResponse->setSessionAffinity($sessionAffinity); + $expectedResponse->setTimeoutSec($timeoutSec); + $transport->addResponse($expectedResponse); + // Mock request + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionBackendServices/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getHealthTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $kind = 'kind3292052'; + $expectedResponse = new BackendServiceGroupHealth(); + $expectedResponse->setKind($kind); + $transport->addResponse($expectedResponse); + // Mock request + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $resourceGroupReferenceResource = new ResourceGroupReference(); + $request = (new GetHealthRegionBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setRegion($region) + ->setResourceGroupReferenceResource($resourceGroupReferenceResource); + $response = $gapicClient->getHealth($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionBackendServices/GetHealth', $actualFuncCall); + $actualValue = $actualRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResourceGroupReferenceResource(); + $this->assertProtobufEquals($resourceGroupReferenceResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getHealthExceptionTest() + { + $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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $resourceGroupReferenceResource = new ResourceGroupReference(); + $request = (new GetHealthRegionBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setRegion($region) + ->setResourceGroupReferenceResource($resourceGroupReferenceResource); + try { + $gapicClient->getHealth($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRegionBackendServiceRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionBackendServices/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRegionBackendServiceRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertRegionBackendServiceRequest()) + ->setBackendServiceResource($backendServiceResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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.RegionBackendServices/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendServiceResource(); + $this->assertProtobufEquals($backendServiceResource, $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 + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertRegionBackendServiceRequest()) + ->setBackendServiceResource($backendServiceResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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 BackendService(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new BackendServiceList(); + $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'; + $request = (new ListRegionBackendServicesRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.RegionBackendServices/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'; + $request = (new ListRegionBackendServicesRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listUsableTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new BackendService(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new BackendServiceListUsable(); + $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'; + $request = (new ListUsableRegionBackendServicesRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->listUsable($request); + $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.RegionBackendServices/ListUsable', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listUsableExceptionTest() + { + $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'; + $request = (new ListUsableRegionBackendServicesRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->listUsable($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendService = 'backendService306946058'; + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchRegionBackendServiceRequest()) + ->setBackendService($backendService) + ->setBackendServiceResource($backendServiceResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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.RegionBackendServices/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualApiRequestObject->getBackendServiceResource(); + $this->assertProtobufEquals($backendServiceResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $backendService = 'backendService306946058'; + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchRegionBackendServiceRequest()) + ->setBackendService($backendService) + ->setBackendServiceResource($backendServiceResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $request = (new SetIamPolicyRegionBackendServiceRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionBackendServices/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRegionSetPolicyRequestResource(); + $this->assertProtobufEquals($regionSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $request = (new SetIamPolicyRegionBackendServiceRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setSecurityPolicyTest() + { + $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/setSecurityPolicyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setSecurityPolicyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $request = (new SetSecurityPolicyRegionBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + $response = $gapicClient->setSecurityPolicy($request); + $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.RegionBackendServices/SetSecurityPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyReferenceResource(); + $this->assertProtobufEquals($securityPolicyReferenceResource, $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 setSecurityPolicyExceptionTest() + { + $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/setSecurityPolicyExceptionTest'); + $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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $request = (new SetSecurityPolicyRegionBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + $response = $gapicClient->setSecurityPolicy($request); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsRegionBackendServiceRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionBackendServices/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsRegionBackendServiceRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $backendService = 'backendService306946058'; + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new UpdateRegionBackendServiceRequest()) + ->setBackendService($backendService) + ->setBackendServiceResource($backendServiceResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->update($request); + $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.RegionBackendServices/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualApiRequestObject->getBackendServiceResource(); + $this->assertProtobufEquals($backendServiceResource, $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 + $backendService = 'backendService306946058'; + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new UpdateRegionBackendServiceRequest()) + ->setBackendService($backendService) + ->setBackendServiceResource($backendServiceResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->update($request); + $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 deleteAsyncTest() + { + $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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionBackendServiceRequest()) + ->setBackendService($backendService) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.RegionBackendServices/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionCommitmentsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionCommitmentsClientTest.php new file mode 100644 index 000000000000..27b530ecb808 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionCommitmentsClientTest.php @@ -0,0 +1,646 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionCommitmentsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionCommitmentsClient($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 CommitmentsScopedList(), + ]; + $expectedResponse = new CommitmentAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListRegionCommitmentsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.RegionCommitments/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'; + $request = (new AggregatedListRegionCommitmentsRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $autoRenew = false; + $category = 'category50511102'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $endTimestamp = 'endTimestamp1004967602'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $plan = 'plan3443497'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $splitSourceCommitment = 'splitSourceCommitment402611156'; + $startTimestamp = 'startTimestamp-1526966919'; + $status = 'status-892481550'; + $statusMessage = 'statusMessage-239442758'; + $type = 'type3575610'; + $expectedResponse = new Commitment(); + $expectedResponse->setAutoRenew($autoRenew); + $expectedResponse->setCategory($category); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEndTimestamp($endTimestamp); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setPlan($plan); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSplitSourceCommitment($splitSourceCommitment); + $expectedResponse->setStartTimestamp($startTimestamp); + $expectedResponse->setStatus($status); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setType($type); + $transport->addResponse($expectedResponse); + // Mock request + $commitment = 'commitment1019005717'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionCommitmentRequest()) + ->setCommitment($commitment) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionCommitments/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getCommitment(); + $this->assertProtobufEquals($commitment, $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 + $commitment = 'commitment1019005717'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionCommitmentRequest()) + ->setCommitment($commitment) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $commitmentResource = new Commitment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertRegionCommitmentRequest()) + ->setCommitmentResource($commitmentResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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.RegionCommitments/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getCommitmentResource(); + $this->assertProtobufEquals($commitmentResource, $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 + $commitmentResource = new Commitment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertRegionCommitmentRequest()) + ->setCommitmentResource($commitmentResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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 Commitment(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new CommitmentList(); + $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'; + $request = (new ListRegionCommitmentsRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.RegionCommitments/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'; + $request = (new ListRegionCommitmentsRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $commitment = 'commitment1019005717'; + $commitmentResource = new Commitment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new UpdateRegionCommitmentRequest()) + ->setCommitment($commitment) + ->setCommitmentResource($commitmentResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->update($request); + $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.RegionCommitments/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getCommitment(); + $this->assertProtobufEquals($commitment, $actualValue); + $actualValue = $actualApiRequestObject->getCommitmentResource(); + $this->assertProtobufEquals($commitmentResource, $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 + $commitment = 'commitment1019005717'; + $commitmentResource = new Commitment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new UpdateRegionCommitmentRequest()) + ->setCommitment($commitment) + ->setCommitmentResource($commitmentResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->update($request); + $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 aggregatedListAsyncTest() + { + $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 CommitmentsScopedList(), + ]; + $expectedResponse = new CommitmentAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListRegionCommitmentsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.RegionCommitments/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionDiskTypesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionDiskTypesClientTest.php new file mode 100644 index 000000000000..615f10e89d16 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionDiskTypesClientTest.php @@ -0,0 +1,297 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionDiskTypesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionDiskTypesClient($options); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $creationTimestamp = 'creationTimestamp567396278'; + $defaultDiskSizeGb = 807490165; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $validDiskSize = 'validDiskSize-1653521184'; + $zone = 'zone3744684'; + $expectedResponse = new DiskType(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDefaultDiskSizeGb($defaultDiskSizeGb); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setValidDiskSize($validDiskSize); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $diskType = 'diskType93009052'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionDiskTypeRequest()) + ->setDiskType($diskType) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionDiskTypes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getDiskType(); + $this->assertProtobufEquals($diskType, $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 + $diskType = 'diskType93009052'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionDiskTypeRequest()) + ->setDiskType($diskType) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 DiskType(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new RegionDiskTypeList(); + $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'; + $request = (new ListRegionDiskTypesRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.RegionDiskTypes/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'; + $request = (new ListRegionDiskTypesRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $creationTimestamp = 'creationTimestamp567396278'; + $defaultDiskSizeGb = 807490165; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $validDiskSize = 'validDiskSize-1653521184'; + $zone = 'zone3744684'; + $expectedResponse = new DiskType(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDefaultDiskSizeGb($defaultDiskSizeGb); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setValidDiskSize($validDiskSize); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $diskType = 'diskType93009052'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionDiskTypeRequest()) + ->setDiskType($diskType) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->getAsync($request)->wait(); + $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.RegionDiskTypes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getDiskType(); + $this->assertProtobufEquals($diskType, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionDisksClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionDisksClientTest.php new file mode 100644 index 000000000000..0dbdb9736fa0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionDisksClientTest.php @@ -0,0 +1,2207 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionDisksClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionDisksClient($options); + } + + /** @test */ + public function addResourcePoliciesTest() + { + $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/addResourcePoliciesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addResourcePoliciesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionDisksAddResourcePoliciesRequestResource = new RegionDisksAddResourcePoliciesRequest(); + $request = (new AddResourcePoliciesRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region) + ->setRegionDisksAddResourcePoliciesRequestResource($regionDisksAddResourcePoliciesRequestResource); + $response = $gapicClient->addResourcePolicies($request); + $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/AddResourcePolicies', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionDisksAddResourcePoliciesRequestResource(); + $this->assertProtobufEquals($regionDisksAddResourcePoliciesRequestResource, $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 addResourcePoliciesExceptionTest() + { + $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/addResourcePoliciesExceptionTest'); + $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'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionDisksAddResourcePoliciesRequestResource = new RegionDisksAddResourcePoliciesRequest(); + $request = (new AddResourcePoliciesRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region) + ->setRegionDisksAddResourcePoliciesRequestResource($regionDisksAddResourcePoliciesRequestResource); + $response = $gapicClient->addResourcePolicies($request); + $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 bulkInsertTest() + { + $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/bulkInsertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/bulkInsertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $bulkInsertDiskResourceResource = new BulkInsertDiskResource(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new BulkInsertRegionDiskRequest()) + ->setBulkInsertDiskResourceResource($bulkInsertDiskResourceResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->bulkInsert($request); + $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/BulkInsert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBulkInsertDiskResourceResource(); + $this->assertProtobufEquals($bulkInsertDiskResourceResource, $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 bulkInsertExceptionTest() + { + $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/bulkInsertExceptionTest'); + $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 + $bulkInsertDiskResourceResource = new BulkInsertDiskResource(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new BulkInsertRegionDiskRequest()) + ->setBulkInsertDiskResourceResource($bulkInsertDiskResourceResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->bulkInsert($request); + $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 createSnapshotTest() + { + $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/createSnapshotTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/createSnapshotTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $snapshotResource = new Snapshot(); + $request = (new CreateSnapshotRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region) + ->setSnapshotResource($snapshotResource); + $response = $gapicClient->createSnapshot($request); + $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/CreateSnapshot', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSnapshotResource(); + $this->assertProtobufEquals($snapshotResource, $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 createSnapshotExceptionTest() + { + $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/createSnapshotExceptionTest'); + $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'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $snapshotResource = new Snapshot(); + $request = (new CreateSnapshotRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region) + ->setSnapshotResource($snapshotResource); + $response = $gapicClient->createSnapshot($request); + $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 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 + $disk = 'disk3083677'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $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 + $disk = 'disk3083677'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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 + $architecture = 'architecture839674195'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $enableConfidentialCompute = true; + $id = 3355; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $lastAttachTimestamp = 'lastAttachTimestamp-2105323995'; + $lastDetachTimestamp = 'lastDetachTimestamp-480399885'; + $locationHint = 'locationHint-1796964143'; + $name = 'name3373707'; + $options = 'options-1249474914'; + $physicalBlockSizeBytes = 1190604793; + $provisionedIops = 1260510932; + $provisionedThroughput = 1600266005; + $region2 = 'region2-690338393'; + $satisfiesPzi = false; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $sizeGb = 2105542105; + $sourceConsistencyGroupPolicy = 'sourceConsistencyGroupPolicy19616093'; + $sourceConsistencyGroupPolicyId = 'sourceConsistencyGroupPolicyId267568957'; + $sourceDisk = 'sourceDisk-85117119'; + $sourceDiskId = 'sourceDiskId-1693292839'; + $sourceImage = 'sourceImage1661056055'; + $sourceImageId = 'sourceImageId-2092155357'; + $sourceInstantSnapshot = 'sourceInstantSnapshot-317668858'; + $sourceInstantSnapshotId = 'sourceInstantSnapshotId-1859900940'; + $sourceSnapshot = 'sourceSnapshot-947679896'; + $sourceSnapshotId = 'sourceSnapshotId-1511650478'; + $sourceStorageObject = 'sourceStorageObject-303818201'; + $status = 'status-892481550'; + $storagePool = 'storagePool897344352'; + $type = 'type3575610'; + $zone = 'zone3744684'; + $expectedResponse = new Disk(); + $expectedResponse->setArchitecture($architecture); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEnableConfidentialCompute($enableConfidentialCompute); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setLastAttachTimestamp($lastAttachTimestamp); + $expectedResponse->setLastDetachTimestamp($lastDetachTimestamp); + $expectedResponse->setLocationHint($locationHint); + $expectedResponse->setName($name); + $expectedResponse->setOptions($options); + $expectedResponse->setPhysicalBlockSizeBytes($physicalBlockSizeBytes); + $expectedResponse->setProvisionedIops($provisionedIops); + $expectedResponse->setProvisionedThroughput($provisionedThroughput); + $expectedResponse->setRegion($region2); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSizeGb($sizeGb); + $expectedResponse->setSourceConsistencyGroupPolicy($sourceConsistencyGroupPolicy); + $expectedResponse->setSourceConsistencyGroupPolicyId($sourceConsistencyGroupPolicyId); + $expectedResponse->setSourceDisk($sourceDisk); + $expectedResponse->setSourceDiskId($sourceDiskId); + $expectedResponse->setSourceImage($sourceImage); + $expectedResponse->setSourceImageId($sourceImageId); + $expectedResponse->setSourceInstantSnapshot($sourceInstantSnapshot); + $expectedResponse->setSourceInstantSnapshotId($sourceInstantSnapshotId); + $expectedResponse->setSourceSnapshot($sourceSnapshot); + $expectedResponse->setSourceSnapshotId($sourceSnapshotId); + $expectedResponse->setSourceStorageObject($sourceStorageObject); + $expectedResponse->setStatus($status); + $expectedResponse->setStoragePool($storagePool); + $expectedResponse->setType($type); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionDisks/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $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 + $disk = 'disk3083677'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRegionDiskRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionDisks/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRegionDiskRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $diskResource = new Disk(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertRegionDiskRequest()) + ->setDiskResource($diskResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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/Insert', $actualApiFuncCall); + $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 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 + $diskResource = new Disk(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertRegionDiskRequest()) + ->setDiskResource($diskResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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 Disk(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new DiskList(); + $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'; + $request = (new ListRegionDisksRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.RegionDisks/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'; + $request = (new ListRegionDisksRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function removeResourcePoliciesTest() + { + $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/removeResourcePoliciesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeResourcePoliciesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionDisksRemoveResourcePoliciesRequestResource = new RegionDisksRemoveResourcePoliciesRequest(); + $request = (new RemoveResourcePoliciesRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region) + ->setRegionDisksRemoveResourcePoliciesRequestResource($regionDisksRemoveResourcePoliciesRequestResource); + $response = $gapicClient->removeResourcePolicies($request); + $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/RemoveResourcePolicies', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionDisksRemoveResourcePoliciesRequestResource(); + $this->assertProtobufEquals($regionDisksRemoveResourcePoliciesRequestResource, $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 removeResourcePoliciesExceptionTest() + { + $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/removeResourcePoliciesExceptionTest'); + $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'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionDisksRemoveResourcePoliciesRequestResource = new RegionDisksRemoveResourcePoliciesRequest(); + $request = (new RemoveResourcePoliciesRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region) + ->setRegionDisksRemoveResourcePoliciesRequestResource($regionDisksRemoveResourcePoliciesRequestResource); + $response = $gapicClient->removeResourcePolicies($request); + $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 resizeTest() + { + $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/resizeTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/resizeTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionDisksResizeRequestResource = new RegionDisksResizeRequest(); + $request = (new ResizeRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region) + ->setRegionDisksResizeRequestResource($regionDisksResizeRequestResource); + $response = $gapicClient->resize($request); + $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/Resize', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionDisksResizeRequestResource(); + $this->assertProtobufEquals($regionDisksResizeRequestResource, $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 resizeExceptionTest() + { + $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/resizeExceptionTest'); + $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'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionDisksResizeRequestResource = new RegionDisksResizeRequest(); + $request = (new ResizeRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region) + ->setRegionDisksResizeRequestResource($regionDisksResizeRequestResource); + $response = $gapicClient->resize($request); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $request = (new SetIamPolicyRegionDiskRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionDisks/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRegionSetPolicyRequestResource(); + $this->assertProtobufEquals($regionSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $request = (new SetIamPolicyRegionDiskRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setLabelsTest() + { + $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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $request = (new SetLabelsRegionDiskRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionSetLabelsRequestResource(); + $this->assertProtobufEquals($regionSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $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 setLabelsExceptionTest() + { + $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/setLabelsExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $request = (new SetLabelsRegionDiskRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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 startAsyncReplicationTest() + { + $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/startAsyncReplicationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/startAsyncReplicationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionDisksStartAsyncReplicationRequestResource = new RegionDisksStartAsyncReplicationRequest(); + $request = (new StartAsyncReplicationRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region) + ->setRegionDisksStartAsyncReplicationRequestResource($regionDisksStartAsyncReplicationRequestResource); + $response = $gapicClient->startAsyncReplication($request); + $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/StartAsyncReplication', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionDisksStartAsyncReplicationRequestResource(); + $this->assertProtobufEquals($regionDisksStartAsyncReplicationRequestResource, $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 startAsyncReplicationExceptionTest() + { + $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/startAsyncReplicationExceptionTest'); + $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'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionDisksStartAsyncReplicationRequestResource = new RegionDisksStartAsyncReplicationRequest(); + $request = (new StartAsyncReplicationRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region) + ->setRegionDisksStartAsyncReplicationRequestResource($regionDisksStartAsyncReplicationRequestResource); + $response = $gapicClient->startAsyncReplication($request); + $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 stopAsyncReplicationTest() + { + $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/stopAsyncReplicationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/stopAsyncReplicationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new StopAsyncReplicationRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->stopAsyncReplication($request); + $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/StopAsyncReplication', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $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 stopAsyncReplicationExceptionTest() + { + $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/stopAsyncReplicationExceptionTest'); + $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'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new StopAsyncReplicationRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->stopAsyncReplication($request); + $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 stopGroupAsyncReplicationTest() + { + $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/stopGroupAsyncReplicationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/stopGroupAsyncReplicationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disksStopGroupAsyncReplicationResourceResource = new DisksStopGroupAsyncReplicationResource(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new StopGroupAsyncReplicationRegionDiskRequest()) + ->setDisksStopGroupAsyncReplicationResourceResource($disksStopGroupAsyncReplicationResourceResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->stopGroupAsyncReplication($request); + $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/StopGroupAsyncReplication', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisksStopGroupAsyncReplicationResourceResource(); + $this->assertProtobufEquals($disksStopGroupAsyncReplicationResourceResource, $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 stopGroupAsyncReplicationExceptionTest() + { + $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/stopGroupAsyncReplicationExceptionTest'); + $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 + $disksStopGroupAsyncReplicationResourceResource = new DisksStopGroupAsyncReplicationResource(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new StopGroupAsyncReplicationRegionDiskRequest()) + ->setDisksStopGroupAsyncReplicationResourceResource($disksStopGroupAsyncReplicationResourceResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->stopGroupAsyncReplication($request); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsRegionDiskRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionDisks/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsRegionDiskRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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'; + $request = (new UpdateRegionDiskRequest()) + ->setDisk($disk) + ->setDiskResource($diskResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->update($request); + $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'; + $request = (new UpdateRegionDiskRequest()) + ->setDisk($disk) + ->setDiskResource($diskResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->update($request); + $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 addResourcePoliciesAsyncTest() + { + $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/addResourcePoliciesAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addResourcePoliciesAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionDisksAddResourcePoliciesRequestResource = new RegionDisksAddResourcePoliciesRequest(); + $request = (new AddResourcePoliciesRegionDiskRequest()) + ->setDisk($disk) + ->setProject($project) + ->setRegion($region) + ->setRegionDisksAddResourcePoliciesRequestResource($regionDisksAddResourcePoliciesRequestResource); + $response = $gapicClient->addResourcePolicies($request); + $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/AddResourcePolicies', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionDisksAddResourcePoliciesRequestResource(); + $this->assertProtobufEquals($regionDisksAddResourcePoliciesRequestResource, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionHealthCheckServicesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionHealthCheckServicesClientTest.php new file mode 100644 index 000000000000..3d1173fa2b1e --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionHealthCheckServicesClientTest.php @@ -0,0 +1,702 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionHealthCheckServicesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionHealthCheckServicesClient($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 + $healthCheckService = 'healthCheckService-665367077'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionHealthCheckServiceRequest()) + ->setHealthCheckService($healthCheckService) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.RegionHealthCheckServices/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheckService(); + $this->assertProtobufEquals($healthCheckService, $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 + $healthCheckService = 'healthCheckService-665367077'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionHealthCheckServiceRequest()) + ->setHealthCheckService($healthCheckService) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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'; + $fingerprint = 'fingerprint-1375934236'; + $healthStatusAggregationPolicy = 'healthStatusAggregationPolicy-820578695'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new HealthCheckService(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setHealthStatusAggregationPolicy($healthStatusAggregationPolicy); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $healthCheckService = 'healthCheckService-665367077'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionHealthCheckServiceRequest()) + ->setHealthCheckService($healthCheckService) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionHealthCheckServices/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getHealthCheckService(); + $this->assertProtobufEquals($healthCheckService, $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 + $healthCheckService = 'healthCheckService-665367077'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionHealthCheckServiceRequest()) + ->setHealthCheckService($healthCheckService) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $healthCheckServiceResource = new HealthCheckService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertRegionHealthCheckServiceRequest()) + ->setHealthCheckServiceResource($healthCheckServiceResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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.RegionHealthCheckServices/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheckServiceResource(); + $this->assertProtobufEquals($healthCheckServiceResource, $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 + $healthCheckServiceResource = new HealthCheckService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertRegionHealthCheckServiceRequest()) + ->setHealthCheckServiceResource($healthCheckServiceResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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 HealthCheckService(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new HealthCheckServicesList(); + $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'; + $request = (new ListRegionHealthCheckServicesRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.RegionHealthCheckServices/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'; + $request = (new ListRegionHealthCheckServicesRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $healthCheckService = 'healthCheckService-665367077'; + $healthCheckServiceResource = new HealthCheckService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchRegionHealthCheckServiceRequest()) + ->setHealthCheckService($healthCheckService) + ->setHealthCheckServiceResource($healthCheckServiceResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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.RegionHealthCheckServices/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheckService(); + $this->assertProtobufEquals($healthCheckService, $actualValue); + $actualValue = $actualApiRequestObject->getHealthCheckServiceResource(); + $this->assertProtobufEquals($healthCheckServiceResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $healthCheckService = 'healthCheckService-665367077'; + $healthCheckServiceResource = new HealthCheckService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchRegionHealthCheckServiceRequest()) + ->setHealthCheckService($healthCheckService) + ->setHealthCheckServiceResource($healthCheckServiceResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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 deleteAsyncTest() + { + $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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $healthCheckService = 'healthCheckService-665367077'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionHealthCheckServiceRequest()) + ->setHealthCheckService($healthCheckService) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.RegionHealthCheckServices/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheckService(); + $this->assertProtobufEquals($healthCheckService, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionHealthChecksClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionHealthChecksClientTest.php new file mode 100644 index 000000000000..27688679c4f7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionHealthChecksClientTest.php @@ -0,0 +1,842 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionHealthChecksClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionHealthChecksClient($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 + $healthCheck = 'healthCheck845747557'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.RegionHealthChecks/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheck(); + $this->assertProtobufEquals($healthCheck, $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 + $healthCheck = 'healthCheck845747557'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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 + $checkIntervalSec = 345561006; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $healthyThreshold = 133658551; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $timeoutSec = 2067488653; + $type = 'type3575610'; + $unhealthyThreshold = 1838571216; + $expectedResponse = new HealthCheck(); + $expectedResponse->setCheckIntervalSec($checkIntervalSec); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setHealthyThreshold($healthyThreshold); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setTimeoutSec($timeoutSec); + $expectedResponse->setType($type); + $expectedResponse->setUnhealthyThreshold($unhealthyThreshold); + $transport->addResponse($expectedResponse); + // Mock request + $healthCheck = 'healthCheck845747557'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionHealthChecks/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getHealthCheck(); + $this->assertProtobufEquals($healthCheck, $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 + $healthCheck = 'healthCheck845747557'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertRegionHealthCheckRequest()) + ->setHealthCheckResource($healthCheckResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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.RegionHealthChecks/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheckResource(); + $this->assertProtobufEquals($healthCheckResource, $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 + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertRegionHealthCheckRequest()) + ->setHealthCheckResource($healthCheckResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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 HealthCheck(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new HealthCheckList(); + $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'; + $request = (new ListRegionHealthChecksRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.RegionHealthChecks/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'; + $request = (new ListRegionHealthChecksRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $healthCheck = 'healthCheck845747557'; + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchRegionHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setHealthCheckResource($healthCheckResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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.RegionHealthChecks/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheck(); + $this->assertProtobufEquals($healthCheck, $actualValue); + $actualValue = $actualApiRequestObject->getHealthCheckResource(); + $this->assertProtobufEquals($healthCheckResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $healthCheck = 'healthCheck845747557'; + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchRegionHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setHealthCheckResource($healthCheckResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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 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 + $healthCheck = 'healthCheck845747557'; + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new UpdateRegionHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setHealthCheckResource($healthCheckResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->update($request); + $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.RegionHealthChecks/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheck(); + $this->assertProtobufEquals($healthCheck, $actualValue); + $actualValue = $actualApiRequestObject->getHealthCheckResource(); + $this->assertProtobufEquals($healthCheckResource, $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 + $healthCheck = 'healthCheck845747557'; + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new UpdateRegionHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setHealthCheckResource($healthCheckResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->update($request); + $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 deleteAsyncTest() + { + $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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $healthCheck = 'healthCheck845747557'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionHealthCheckRequest()) + ->setHealthCheck($healthCheck) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.RegionHealthChecks/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheck(); + $this->assertProtobufEquals($healthCheck, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionInstanceGroupManagersClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionInstanceGroupManagersClientTest.php new file mode 100644 index 000000000000..63ae29f6a440 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionInstanceGroupManagersClientTest.php @@ -0,0 +1,2461 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionInstanceGroupManagersClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionInstanceGroupManagersClient($options); + } + + /** @test */ + public function abandonInstancesTest() + { + $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/abandonInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/abandonInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersAbandonInstancesRequestResource = new RegionInstanceGroupManagersAbandonInstancesRequest(); + $request = (new AbandonInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersAbandonInstancesRequestResource($regionInstanceGroupManagersAbandonInstancesRequestResource); + $response = $gapicClient->abandonInstances($request); + $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.RegionInstanceGroupManagers/AbandonInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersAbandonInstancesRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersAbandonInstancesRequestResource, $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 abandonInstancesExceptionTest() + { + $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/abandonInstancesExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersAbandonInstancesRequestResource = new RegionInstanceGroupManagersAbandonInstancesRequest(); + $request = (new AbandonInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersAbandonInstancesRequestResource($regionInstanceGroupManagersAbandonInstancesRequestResource); + $response = $gapicClient->abandonInstances($request); + $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 applyUpdatesToInstancesTest() + { + $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/applyUpdatesToInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/applyUpdatesToInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersApplyUpdatesRequestResource = new RegionInstanceGroupManagersApplyUpdatesRequest(); + $request = (new ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersApplyUpdatesRequestResource($regionInstanceGroupManagersApplyUpdatesRequestResource); + $response = $gapicClient->applyUpdatesToInstances($request); + $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.RegionInstanceGroupManagers/ApplyUpdatesToInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersApplyUpdatesRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersApplyUpdatesRequestResource, $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 applyUpdatesToInstancesExceptionTest() + { + $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/applyUpdatesToInstancesExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersApplyUpdatesRequestResource = new RegionInstanceGroupManagersApplyUpdatesRequest(); + $request = (new ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersApplyUpdatesRequestResource($regionInstanceGroupManagersApplyUpdatesRequestResource); + $response = $gapicClient->applyUpdatesToInstances($request); + $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 createInstancesTest() + { + $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/createInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/createInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersCreateInstancesRequestResource = new RegionInstanceGroupManagersCreateInstancesRequest(); + $request = (new CreateInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersCreateInstancesRequestResource($regionInstanceGroupManagersCreateInstancesRequestResource); + $response = $gapicClient->createInstances($request); + $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.RegionInstanceGroupManagers/CreateInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersCreateInstancesRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersCreateInstancesRequestResource, $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 createInstancesExceptionTest() + { + $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/createInstancesExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersCreateInstancesRequestResource = new RegionInstanceGroupManagersCreateInstancesRequest(); + $request = (new CreateInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersCreateInstancesRequestResource($regionInstanceGroupManagersCreateInstancesRequestResource); + $response = $gapicClient->createInstances($request); + $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 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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.RegionInstanceGroupManagers/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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 deleteInstancesTest() + { + $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/deleteInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersDeleteInstancesRequestResource = new RegionInstanceGroupManagersDeleteInstancesRequest(); + $request = (new DeleteInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersDeleteInstancesRequestResource($regionInstanceGroupManagersDeleteInstancesRequestResource); + $response = $gapicClient->deleteInstances($request); + $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.RegionInstanceGroupManagers/DeleteInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersDeleteInstancesRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersDeleteInstancesRequestResource, $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 deleteInstancesExceptionTest() + { + $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/deleteInstancesExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersDeleteInstancesRequestResource = new RegionInstanceGroupManagersDeleteInstancesRequest(); + $request = (new DeleteInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersDeleteInstancesRequestResource($regionInstanceGroupManagersDeleteInstancesRequestResource); + $response = $gapicClient->deleteInstances($request); + $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 deletePerInstanceConfigsTest() + { + $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/deletePerInstanceConfigsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deletePerInstanceConfigsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagerDeleteInstanceConfigReqResource = new RegionInstanceGroupManagerDeleteInstanceConfigReq(); + $request = (new DeletePerInstanceConfigsRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagerDeleteInstanceConfigReqResource($regionInstanceGroupManagerDeleteInstanceConfigReqResource); + $response = $gapicClient->deletePerInstanceConfigs($request); + $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.RegionInstanceGroupManagers/DeletePerInstanceConfigs', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagerDeleteInstanceConfigReqResource(); + $this->assertProtobufEquals($regionInstanceGroupManagerDeleteInstanceConfigReqResource, $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 deletePerInstanceConfigsExceptionTest() + { + $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/deletePerInstanceConfigsExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagerDeleteInstanceConfigReqResource = new RegionInstanceGroupManagerDeleteInstanceConfigReq(); + $request = (new DeletePerInstanceConfigsRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagerDeleteInstanceConfigReqResource($regionInstanceGroupManagerDeleteInstanceConfigReqResource); + $response = $gapicClient->deletePerInstanceConfigs($request); + $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 + $baseInstanceName = 'baseInstanceName389106439'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $instanceGroup = 'instanceGroup81095253'; + $instanceTemplate = 'instanceTemplate309248228'; + $kind = 'kind3292052'; + $listManagedInstancesResults = 'listManagedInstancesResults832918068'; + $name = 'name3373707'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $targetSize = 2084603409; + $zone = 'zone3744684'; + $expectedResponse = new InstanceGroupManager(); + $expectedResponse->setBaseInstanceName($baseInstanceName); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setInstanceGroup($instanceGroup); + $expectedResponse->setInstanceTemplate($instanceTemplate); + $expectedResponse->setKind($kind); + $expectedResponse->setListManagedInstancesResults($listManagedInstancesResults); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setTargetSize($targetSize); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionInstanceGroupManagers/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $instanceGroupManagerResource = new InstanceGroupManager(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManagerResource($instanceGroupManagerResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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.RegionInstanceGroupManagers/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManagerResource(); + $this->assertProtobufEquals($instanceGroupManagerResource, $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 + $instanceGroupManagerResource = new InstanceGroupManager(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManagerResource($instanceGroupManagerResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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 InstanceGroupManager(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new RegionInstanceGroupManagerList(); + $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'; + $request = (new ListRegionInstanceGroupManagersRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.RegionInstanceGroupManagers/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'; + $request = (new ListRegionInstanceGroupManagersRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listErrorsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $itemsElement = new InstanceManagedByIgmError(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new RegionInstanceGroupManagersListErrorsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new ListErrorsRegionInstanceGroupManagersRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->listErrors($request); + $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.RegionInstanceGroupManagers/ListErrors', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listErrorsExceptionTest() + { + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new ListErrorsRegionInstanceGroupManagersRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->listErrors($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listManagedInstancesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $managedInstancesElement = new ManagedInstance(); + $managedInstances = [ + $managedInstancesElement, + ]; + $expectedResponse = new RegionInstanceGroupManagersListInstancesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setManagedInstances($managedInstances); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new ListManagedInstancesRegionInstanceGroupManagersRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->listManagedInstances($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getManagedInstances()[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.RegionInstanceGroupManagers/ListManagedInstances', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listManagedInstancesExceptionTest() + { + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new ListManagedInstancesRegionInstanceGroupManagersRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->listManagedInstances($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listPerInstanceConfigsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $itemsElement = new PerInstanceConfig(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new RegionInstanceGroupManagersListInstanceConfigsResp(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new ListPerInstanceConfigsRegionInstanceGroupManagersRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->listPerInstanceConfigs($request); + $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.RegionInstanceGroupManagers/ListPerInstanceConfigs', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listPerInstanceConfigsExceptionTest() + { + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new ListPerInstanceConfigsRegionInstanceGroupManagersRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->listPerInstanceConfigs($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagerResource = new InstanceGroupManager(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagerResource($instanceGroupManagerResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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.RegionInstanceGroupManagers/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagerResource(); + $this->assertProtobufEquals($instanceGroupManagerResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagerResource = new InstanceGroupManager(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagerResource($instanceGroupManagerResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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 patchPerInstanceConfigsTest() + { + $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/patchPerInstanceConfigsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchPerInstanceConfigsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagerPatchInstanceConfigReqResource = new RegionInstanceGroupManagerPatchInstanceConfigReq(); + $request = (new PatchPerInstanceConfigsRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagerPatchInstanceConfigReqResource($regionInstanceGroupManagerPatchInstanceConfigReqResource); + $response = $gapicClient->patchPerInstanceConfigs($request); + $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.RegionInstanceGroupManagers/PatchPerInstanceConfigs', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagerPatchInstanceConfigReqResource(); + $this->assertProtobufEquals($regionInstanceGroupManagerPatchInstanceConfigReqResource, $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 patchPerInstanceConfigsExceptionTest() + { + $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/patchPerInstanceConfigsExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagerPatchInstanceConfigReqResource = new RegionInstanceGroupManagerPatchInstanceConfigReq(); + $request = (new PatchPerInstanceConfigsRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagerPatchInstanceConfigReqResource($regionInstanceGroupManagerPatchInstanceConfigReqResource); + $response = $gapicClient->patchPerInstanceConfigs($request); + $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 recreateInstancesTest() + { + $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/recreateInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/recreateInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersRecreateRequestResource = new RegionInstanceGroupManagersRecreateRequest(); + $request = (new RecreateInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersRecreateRequestResource($regionInstanceGroupManagersRecreateRequestResource); + $response = $gapicClient->recreateInstances($request); + $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.RegionInstanceGroupManagers/RecreateInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersRecreateRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersRecreateRequestResource, $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 recreateInstancesExceptionTest() + { + $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/recreateInstancesExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersRecreateRequestResource = new RegionInstanceGroupManagersRecreateRequest(); + $request = (new RecreateInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersRecreateRequestResource($regionInstanceGroupManagersRecreateRequestResource); + $response = $gapicClient->recreateInstances($request); + $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 resizeTest() + { + $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/resizeTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/resizeTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $size = 3530753; + $request = (new ResizeRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setSize($size); + $response = $gapicClient->resize($request); + $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.RegionInstanceGroupManagers/Resize', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSize(); + $this->assertProtobufEquals($size, $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 resizeExceptionTest() + { + $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/resizeExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $size = 3530753; + $request = (new ResizeRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setSize($size); + $response = $gapicClient->resize($request); + $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 setInstanceTemplateTest() + { + $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/setInstanceTemplateTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setInstanceTemplateTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersSetTemplateRequestResource = new RegionInstanceGroupManagersSetTemplateRequest(); + $request = (new SetInstanceTemplateRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersSetTemplateRequestResource($regionInstanceGroupManagersSetTemplateRequestResource); + $response = $gapicClient->setInstanceTemplate($request); + $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.RegionInstanceGroupManagers/SetInstanceTemplate', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersSetTemplateRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersSetTemplateRequestResource, $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 setInstanceTemplateExceptionTest() + { + $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/setInstanceTemplateExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersSetTemplateRequestResource = new RegionInstanceGroupManagersSetTemplateRequest(); + $request = (new SetInstanceTemplateRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersSetTemplateRequestResource($regionInstanceGroupManagersSetTemplateRequestResource); + $response = $gapicClient->setInstanceTemplate($request); + $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 setTargetPoolsTest() + { + $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/setTargetPoolsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setTargetPoolsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersSetTargetPoolsRequestResource = new RegionInstanceGroupManagersSetTargetPoolsRequest(); + $request = (new SetTargetPoolsRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersSetTargetPoolsRequestResource($regionInstanceGroupManagersSetTargetPoolsRequestResource); + $response = $gapicClient->setTargetPools($request); + $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.RegionInstanceGroupManagers/SetTargetPools', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersSetTargetPoolsRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersSetTargetPoolsRequestResource, $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 setTargetPoolsExceptionTest() + { + $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/setTargetPoolsExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersSetTargetPoolsRequestResource = new RegionInstanceGroupManagersSetTargetPoolsRequest(); + $request = (new SetTargetPoolsRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersSetTargetPoolsRequestResource($regionInstanceGroupManagersSetTargetPoolsRequestResource); + $response = $gapicClient->setTargetPools($request); + $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 updatePerInstanceConfigsTest() + { + $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/updatePerInstanceConfigsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/updatePerInstanceConfigsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagerUpdateInstanceConfigReqResource = new RegionInstanceGroupManagerUpdateInstanceConfigReq(); + $request = (new UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagerUpdateInstanceConfigReqResource($regionInstanceGroupManagerUpdateInstanceConfigReqResource); + $response = $gapicClient->updatePerInstanceConfigs($request); + $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.RegionInstanceGroupManagers/UpdatePerInstanceConfigs', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagerUpdateInstanceConfigReqResource(); + $this->assertProtobufEquals($regionInstanceGroupManagerUpdateInstanceConfigReqResource, $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 updatePerInstanceConfigsExceptionTest() + { + $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/updatePerInstanceConfigsExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagerUpdateInstanceConfigReqResource = new RegionInstanceGroupManagerUpdateInstanceConfigReq(); + $request = (new UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagerUpdateInstanceConfigReqResource($regionInstanceGroupManagerUpdateInstanceConfigReqResource); + $response = $gapicClient->updatePerInstanceConfigs($request); + $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 abandonInstancesAsyncTest() + { + $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/abandonInstancesAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/abandonInstancesAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersAbandonInstancesRequestResource = new RegionInstanceGroupManagersAbandonInstancesRequest(); + $request = (new AbandonInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersAbandonInstancesRequestResource($regionInstanceGroupManagersAbandonInstancesRequestResource); + $response = $gapicClient->abandonInstances($request); + $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.RegionInstanceGroupManagers/AbandonInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersAbandonInstancesRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersAbandonInstancesRequestResource, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionInstanceGroupsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionInstanceGroupsClientTest.php new file mode 100644 index 000000000000..fdcd6f910dd9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionInstanceGroupsClientTest.php @@ -0,0 +1,544 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionInstanceGroupsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionInstanceGroupsClient($options); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $network = 'network1843485230'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $size = 3530753; + $subnetwork = 'subnetwork-1302785042'; + $zone = 'zone3744684'; + $expectedResponse = new InstanceGroup(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSize($size); + $expectedResponse->setSubnetwork($subnetwork); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroup = 'instanceGroup81095253'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionInstanceGroups/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroup(); + $this->assertProtobufEquals($instanceGroup, $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 + $instanceGroup = 'instanceGroup81095253'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 InstanceGroup(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new RegionInstanceGroupList(); + $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'; + $request = (new ListRegionInstanceGroupsRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.RegionInstanceGroups/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'; + $request = (new ListRegionInstanceGroupsRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listInstancesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new InstanceWithNamedPorts(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new RegionInstanceGroupsListInstances(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroup = 'instanceGroup81095253'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupsListInstancesRequestResource = new RegionInstanceGroupsListInstancesRequest(); + $request = (new ListInstancesRegionInstanceGroupsRequest()) + ->setInstanceGroup($instanceGroup) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupsListInstancesRequestResource($regionInstanceGroupsListInstancesRequestResource); + $response = $gapicClient->listInstances($request); + $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.RegionInstanceGroups/ListInstances', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroup(); + $this->assertProtobufEquals($instanceGroup, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRegionInstanceGroupsListInstancesRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupsListInstancesRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listInstancesExceptionTest() + { + $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 + $instanceGroup = 'instanceGroup81095253'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupsListInstancesRequestResource = new RegionInstanceGroupsListInstancesRequest(); + $request = (new ListInstancesRegionInstanceGroupsRequest()) + ->setInstanceGroup($instanceGroup) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupsListInstancesRequestResource($regionInstanceGroupsListInstancesRequestResource); + try { + $gapicClient->listInstances($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setNamedPortsTest() + { + $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/setNamedPortsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setNamedPortsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroup = 'instanceGroup81095253'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupsSetNamedPortsRequestResource = new RegionInstanceGroupsSetNamedPortsRequest(); + $request = (new SetNamedPortsRegionInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupsSetNamedPortsRequestResource($regionInstanceGroupsSetNamedPortsRequestResource); + $response = $gapicClient->setNamedPorts($request); + $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.RegionInstanceGroups/SetNamedPorts', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroup(); + $this->assertProtobufEquals($instanceGroup, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupsSetNamedPortsRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupsSetNamedPortsRequestResource, $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 setNamedPortsExceptionTest() + { + $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/setNamedPortsExceptionTest'); + $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 + $instanceGroup = 'instanceGroup81095253'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupsSetNamedPortsRequestResource = new RegionInstanceGroupsSetNamedPortsRequest(); + $request = (new SetNamedPortsRegionInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupsSetNamedPortsRequestResource($regionInstanceGroupsSetNamedPortsRequestResource); + $response = $gapicClient->setNamedPorts($request); + $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 getAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $network = 'network1843485230'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $size = 3530753; + $subnetwork = 'subnetwork-1302785042'; + $zone = 'zone3744684'; + $expectedResponse = new InstanceGroup(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSize($size); + $expectedResponse->setSubnetwork($subnetwork); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroup = 'instanceGroup81095253'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionInstanceGroupRequest()) + ->setInstanceGroup($instanceGroup) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->getAsync($request)->wait(); + $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.RegionInstanceGroups/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroup(); + $this->assertProtobufEquals($instanceGroup, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionInstanceTemplatesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionInstanceTemplatesClientTest.php new file mode 100644 index 000000000000..fd1fa9c961a5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionInstanceTemplatesClientTest.php @@ -0,0 +1,566 @@ +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'; + $request = (new DeleteRegionInstanceTemplateRequest()) + ->setInstanceTemplate($instanceTemplate) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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'; + $request = (new DeleteRegionInstanceTemplateRequest()) + ->setInstanceTemplate($instanceTemplate) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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'; + $request = (new GetRegionInstanceTemplateRequest()) + ->setInstanceTemplate($instanceTemplate) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.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'; + $request = (new GetRegionInstanceTemplateRequest()) + ->setInstanceTemplate($instanceTemplate) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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'; + $request = (new InsertRegionInstanceTemplateRequest()) + ->setInstanceTemplateResource($instanceTemplateResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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'; + $request = (new InsertRegionInstanceTemplateRequest()) + ->setInstanceTemplateResource($instanceTemplateResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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'; + $request = (new ListRegionInstanceTemplatesRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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'; + $request = (new ListRegionInstanceTemplatesRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAsyncTest() + { + $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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceTemplate = 'instanceTemplate309248228'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionInstanceTemplateRequest()) + ->setInstanceTemplate($instanceTemplate) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionInstancesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionInstancesClientTest.php new file mode 100644 index 000000000000..e5a65e039f00 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionInstancesClientTest.php @@ -0,0 +1,261 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionInstancesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionInstancesClient($options); + } + + /** @test */ + public function bulkInsertTest() + { + $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/bulkInsertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/bulkInsertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $bulkInsertInstanceResourceResource = new BulkInsertInstanceResource(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new BulkInsertRegionInstanceRequest()) + ->setBulkInsertInstanceResourceResource($bulkInsertInstanceResourceResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->bulkInsert($request); + $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.RegionInstances/BulkInsert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBulkInsertInstanceResourceResource(); + $this->assertProtobufEquals($bulkInsertInstanceResourceResource, $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 bulkInsertExceptionTest() + { + $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/bulkInsertExceptionTest'); + $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 + $bulkInsertInstanceResourceResource = new BulkInsertInstanceResource(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new BulkInsertRegionInstanceRequest()) + ->setBulkInsertInstanceResourceResource($bulkInsertInstanceResourceResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->bulkInsert($request); + $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 bulkInsertAsyncTest() + { + $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/bulkInsertAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/bulkInsertAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $bulkInsertInstanceResourceResource = new BulkInsertInstanceResource(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new BulkInsertRegionInstanceRequest()) + ->setBulkInsertInstanceResourceResource($bulkInsertInstanceResourceResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->bulkInsert($request); + $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.RegionInstances/BulkInsert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBulkInsertInstanceResourceResource(); + $this->assertProtobufEquals($bulkInsertInstanceResourceResource, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionInstantSnapshotsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionInstantSnapshotsClientTest.php new file mode 100644 index 000000000000..6ac21d5d6f03 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionInstantSnapshotsClientTest.php @@ -0,0 +1,972 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionInstantSnapshotsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionInstantSnapshotsClient($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 + $instantSnapshot = 'instantSnapshot1465380450'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionInstantSnapshotRequest()) + ->setInstantSnapshot($instantSnapshot) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.RegionInstantSnapshots/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstantSnapshot(); + $this->assertProtobufEquals($instantSnapshot, $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 + $instantSnapshot = 'instantSnapshot1465380450'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionInstantSnapshotRequest()) + ->setInstantSnapshot($instantSnapshot) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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 + $architecture = 'architecture839674195'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $diskSizeGb = 757478089; + $id = 3355; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $region2 = 'region2-690338393'; + $satisfiesPzi = false; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $sourceDisk = 'sourceDisk-85117119'; + $sourceDiskId = 'sourceDiskId-1693292839'; + $status = 'status-892481550'; + $zone = 'zone3744684'; + $expectedResponse = new InstantSnapshot(); + $expectedResponse->setArchitecture($architecture); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDiskSizeGb($diskSizeGb); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $expectedResponse->setSourceDisk($sourceDisk); + $expectedResponse->setSourceDiskId($sourceDiskId); + $expectedResponse->setStatus($status); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $instantSnapshot = 'instantSnapshot1465380450'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionInstantSnapshotRequest()) + ->setInstantSnapshot($instantSnapshot) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionInstantSnapshots/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInstantSnapshot(); + $this->assertProtobufEquals($instantSnapshot, $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 + $instantSnapshot = 'instantSnapshot1465380450'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionInstantSnapshotRequest()) + ->setInstantSnapshot($instantSnapshot) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRegionInstantSnapshotRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionInstantSnapshots/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRegionInstantSnapshotRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $instantSnapshotResource = new InstantSnapshot(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertRegionInstantSnapshotRequest()) + ->setInstantSnapshotResource($instantSnapshotResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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.RegionInstantSnapshots/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstantSnapshotResource(); + $this->assertProtobufEquals($instantSnapshotResource, $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 + $instantSnapshotResource = new InstantSnapshot(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertRegionInstantSnapshotRequest()) + ->setInstantSnapshotResource($instantSnapshotResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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 InstantSnapshot(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InstantSnapshotList(); + $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'; + $request = (new ListRegionInstantSnapshotsRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.RegionInstantSnapshots/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'; + $request = (new ListRegionInstantSnapshotsRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $request = (new SetIamPolicyRegionInstantSnapshotRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionInstantSnapshots/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRegionSetPolicyRequestResource(); + $this->assertProtobufEquals($regionSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $request = (new SetIamPolicyRegionInstantSnapshotRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setLabelsTest() + { + $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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $request = (new SetLabelsRegionInstantSnapshotRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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.RegionInstantSnapshots/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionSetLabelsRequestResource(); + $this->assertProtobufEquals($regionSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $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 setLabelsExceptionTest() + { + $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/setLabelsExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $request = (new SetLabelsRegionInstantSnapshotRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsRegionInstantSnapshotRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionInstantSnapshots/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsRegionInstantSnapshotRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAsyncTest() + { + $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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instantSnapshot = 'instantSnapshot1465380450'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionInstantSnapshotRequest()) + ->setInstantSnapshot($instantSnapshot) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.RegionInstantSnapshots/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstantSnapshot(); + $this->assertProtobufEquals($instantSnapshot, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionNetworkEndpointGroupsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionNetworkEndpointGroupsClientTest.php new file mode 100644 index 000000000000..cdf4d1ec0ed4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionNetworkEndpointGroupsClientTest.php @@ -0,0 +1,943 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionNetworkEndpointGroupsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionNetworkEndpointGroupsClient($options); + } + + /** @test */ + public function attachNetworkEndpointsTest() + { + $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/attachNetworkEndpointsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/attachNetworkEndpointsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionNetworkEndpointGroupsAttachEndpointsRequestResource = new RegionNetworkEndpointGroupsAttachEndpointsRequest(); + $request = (new AttachNetworkEndpointsRegionNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setRegion($region) + ->setRegionNetworkEndpointGroupsAttachEndpointsRequestResource($regionNetworkEndpointGroupsAttachEndpointsRequestResource); + $response = $gapicClient->attachNetworkEndpoints($request); + $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.RegionNetworkEndpointGroups/AttachNetworkEndpoints', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionNetworkEndpointGroupsAttachEndpointsRequestResource(); + $this->assertProtobufEquals($regionNetworkEndpointGroupsAttachEndpointsRequestResource, $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 attachNetworkEndpointsExceptionTest() + { + $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/attachNetworkEndpointsExceptionTest'); + $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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionNetworkEndpointGroupsAttachEndpointsRequestResource = new RegionNetworkEndpointGroupsAttachEndpointsRequest(); + $request = (new AttachNetworkEndpointsRegionNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setRegion($region) + ->setRegionNetworkEndpointGroupsAttachEndpointsRequestResource($regionNetworkEndpointGroupsAttachEndpointsRequestResource); + $response = $gapicClient->attachNetworkEndpoints($request); + $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 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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.RegionNetworkEndpointGroups/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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 detachNetworkEndpointsTest() + { + $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/detachNetworkEndpointsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/detachNetworkEndpointsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionNetworkEndpointGroupsDetachEndpointsRequestResource = new RegionNetworkEndpointGroupsDetachEndpointsRequest(); + $request = (new DetachNetworkEndpointsRegionNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setRegion($region) + ->setRegionNetworkEndpointGroupsDetachEndpointsRequestResource($regionNetworkEndpointGroupsDetachEndpointsRequestResource); + $response = $gapicClient->detachNetworkEndpoints($request); + $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.RegionNetworkEndpointGroups/DetachNetworkEndpoints', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionNetworkEndpointGroupsDetachEndpointsRequestResource(); + $this->assertProtobufEquals($regionNetworkEndpointGroupsDetachEndpointsRequestResource, $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 detachNetworkEndpointsExceptionTest() + { + $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/detachNetworkEndpointsExceptionTest'); + $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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionNetworkEndpointGroupsDetachEndpointsRequestResource = new RegionNetworkEndpointGroupsDetachEndpointsRequest(); + $request = (new DetachNetworkEndpointsRegionNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setRegion($region) + ->setRegionNetworkEndpointGroupsDetachEndpointsRequestResource($regionNetworkEndpointGroupsDetachEndpointsRequestResource); + $response = $gapicClient->detachNetworkEndpoints($request); + $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'; + $defaultPort = 650363969; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $network = 'network1843485230'; + $networkEndpointType = 'networkEndpointType118301523'; + $pscTargetService = 'pscTargetService1879744870'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $size = 3530753; + $subnetwork = 'subnetwork-1302785042'; + $zone = 'zone3744684'; + $expectedResponse = new NetworkEndpointGroup(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDefaultPort($defaultPort); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setNetworkEndpointType($networkEndpointType); + $expectedResponse->setPscTargetService($pscTargetService); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSize($size); + $expectedResponse->setSubnetwork($subnetwork); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionNetworkEndpointGroups/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $networkEndpointGroupResource = new NetworkEndpointGroup(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertRegionNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroupResource($networkEndpointGroupResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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.RegionNetworkEndpointGroups/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroupResource(); + $this->assertProtobufEquals($networkEndpointGroupResource, $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 + $networkEndpointGroupResource = new NetworkEndpointGroup(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertRegionNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroupResource($networkEndpointGroupResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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 NetworkEndpointGroup(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NetworkEndpointGroupList(); + $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'; + $request = (new ListRegionNetworkEndpointGroupsRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.RegionNetworkEndpointGroups/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'; + $request = (new ListRegionNetworkEndpointGroupsRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNetworkEndpointsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $itemsElement = new NetworkEndpointWithHealthStatus(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NetworkEndpointGroupsListNetworkEndpoints(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new ListNetworkEndpointsRegionNetworkEndpointGroupsRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->listNetworkEndpoints($request); + $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.RegionNetworkEndpointGroups/ListNetworkEndpoints', $actualFuncCall); + $actualValue = $actualRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNetworkEndpointsExceptionTest() + { + $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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new ListNetworkEndpointsRegionNetworkEndpointGroupsRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->listNetworkEndpoints($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function attachNetworkEndpointsAsyncTest() + { + $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/attachNetworkEndpointsAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/attachNetworkEndpointsAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionNetworkEndpointGroupsAttachEndpointsRequestResource = new RegionNetworkEndpointGroupsAttachEndpointsRequest(); + $request = (new AttachNetworkEndpointsRegionNetworkEndpointGroupRequest()) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setRegion($region) + ->setRegionNetworkEndpointGroupsAttachEndpointsRequestResource($regionNetworkEndpointGroupsAttachEndpointsRequestResource); + $response = $gapicClient->attachNetworkEndpoints($request); + $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.RegionNetworkEndpointGroups/AttachNetworkEndpoints', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionNetworkEndpointGroupsAttachEndpointsRequestResource(); + $this->assertProtobufEquals($regionNetworkEndpointGroupsAttachEndpointsRequestResource, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionNetworkFirewallPoliciesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionNetworkFirewallPoliciesClientTest.php new file mode 100644 index 000000000000..8ed7b187513d --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionNetworkFirewallPoliciesClientTest.php @@ -0,0 +1,2011 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionNetworkFirewallPoliciesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionNetworkFirewallPoliciesClient($options); + } + + /** @test */ + public function addAssociationTest() + { + $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/addAssociationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addAssociationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyAssociationResource = new FirewallPolicyAssociation(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new AddAssociationRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyAssociationResource($firewallPolicyAssociationResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->addAssociation($request); + $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.RegionNetworkFirewallPolicies/AddAssociation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyAssociationResource(); + $this->assertProtobufEquals($firewallPolicyAssociationResource, $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 addAssociationExceptionTest() + { + $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/addAssociationExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyAssociationResource = new FirewallPolicyAssociation(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new AddAssociationRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyAssociationResource($firewallPolicyAssociationResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->addAssociation($request); + $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 addRuleTest() + { + $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/addRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new AddRuleRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->addRule($request); + $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.RegionNetworkFirewallPolicies/AddRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyRuleResource(); + $this->assertProtobufEquals($firewallPolicyRuleResource, $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 addRuleExceptionTest() + { + $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/addRuleExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new AddRuleRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->addRule($request); + $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 cloneRulesTest() + { + $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/cloneRulesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/cloneRulesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new CloneRulesRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->cloneRules($request); + $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.RegionNetworkFirewallPolicies/CloneRules', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $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 cloneRulesExceptionTest() + { + $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/cloneRulesExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new CloneRulesRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->cloneRules($request); + $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 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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.RegionNetworkFirewallPolicies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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'; + $displayName = 'displayName1615086568'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $parent = 'parent-995424086'; + $region2 = 'region2-690338393'; + $ruleTupleCount = 388342037; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $shortName = 'shortName1565793390'; + $expectedResponse = new FirewallPolicy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setRegion($region2); + $expectedResponse->setRuleTupleCount($ruleTupleCount); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $expectedResponse->setShortName($shortName); + $transport->addResponse($expectedResponse); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionNetworkFirewallPolicies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAssociationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $attachmentTarget = 'attachmentTarget1786386477'; + $displayName = 'displayName1615086568'; + $firewallPolicyId = 'firewallPolicyId1430953673'; + $name2 = 'name2-1052831874'; + $shortName = 'shortName1565793390'; + $expectedResponse = new FirewallPolicyAssociation(); + $expectedResponse->setAttachmentTarget($attachmentTarget); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setFirewallPolicyId($firewallPolicyId); + $expectedResponse->setName($name2); + $expectedResponse->setShortName($shortName); + $transport->addResponse($expectedResponse); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetAssociationRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->getAssociation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionNetworkFirewallPolicies/GetAssociation', $actualFuncCall); + $actualValue = $actualRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAssociationExceptionTest() + { + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetAssociationRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->getAssociation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEffectiveFirewallsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $network = 'network1843485230'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest()) + ->setNetwork($network) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->getEffectiveFirewalls($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionNetworkFirewallPolicies/GetEffectiveFirewalls', $actualFuncCall); + $actualValue = $actualRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEffectiveFirewallsExceptionTest() + { + $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 + $network = 'network1843485230'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest()) + ->setNetwork($network) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->getEffectiveFirewalls($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRegionNetworkFirewallPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionNetworkFirewallPolicies/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyRegionNetworkFirewallPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRuleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $action = 'action-1422950858'; + $description = 'description-1724546052'; + $direction = 'direction-962590849'; + $disabled = true; + $enableLogging = false; + $kind = 'kind3292052'; + $priority2 = 978365527; + $ruleName = 'ruleName-2092197394'; + $ruleTupleCount = 388342037; + $securityProfileGroup = 'securityProfileGroup-329459286'; + $tlsInspect = true; + $expectedResponse = new FirewallPolicyRule(); + $expectedResponse->setAction($action); + $expectedResponse->setDescription($description); + $expectedResponse->setDirection($direction); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setEnableLogging($enableLogging); + $expectedResponse->setKind($kind); + $expectedResponse->setPriority($priority2); + $expectedResponse->setRuleName($ruleName); + $expectedResponse->setRuleTupleCount($ruleTupleCount); + $expectedResponse->setSecurityProfileGroup($securityProfileGroup); + $expectedResponse->setTlsInspect($tlsInspect); + $transport->addResponse($expectedResponse); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRuleRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->getRule($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionNetworkFirewallPolicies/GetRule', $actualFuncCall); + $actualValue = $actualRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRuleExceptionTest() + { + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRuleRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->getRule($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $firewallPolicyResource = new FirewallPolicy(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicyResource($firewallPolicyResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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.RegionNetworkFirewallPolicies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicyResource(); + $this->assertProtobufEquals($firewallPolicyResource, $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 + $firewallPolicyResource = new FirewallPolicy(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicyResource($firewallPolicyResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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 = ''; + $itemsElement = new FirewallPolicy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new FirewallPolicyList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new ListRegionNetworkFirewallPoliciesRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.RegionNetworkFirewallPolicies/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'; + $request = (new ListRegionNetworkFirewallPoliciesRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyResource = new FirewallPolicy(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyResource($firewallPolicyResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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.RegionNetworkFirewallPolicies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyResource(); + $this->assertProtobufEquals($firewallPolicyResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyResource = new FirewallPolicy(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyResource($firewallPolicyResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patch($request); + $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 patchRuleTest() + { + $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/patchRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchRuleRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patchRule($request); + $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.RegionNetworkFirewallPolicies/PatchRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyRuleResource(); + $this->assertProtobufEquals($firewallPolicyRuleResource, $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 patchRuleExceptionTest() + { + $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/patchRuleExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new PatchRuleRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->patchRule($request); + $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 removeAssociationTest() + { + $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/removeAssociationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeAssociationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new RemoveAssociationRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->removeAssociation($request); + $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.RegionNetworkFirewallPolicies/RemoveAssociation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $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 removeAssociationExceptionTest() + { + $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/removeAssociationExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new RemoveAssociationRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->removeAssociation($request); + $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 removeRuleTest() + { + $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/removeRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new RemoveRuleRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->removeRule($request); + $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.RegionNetworkFirewallPolicies/RemoveRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $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 removeRuleExceptionTest() + { + $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/removeRuleExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new RemoveRuleRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->removeRule($request); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $request = (new SetIamPolicyRegionNetworkFirewallPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionNetworkFirewallPolicies/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRegionSetPolicyRequestResource(); + $this->assertProtobufEquals($regionSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $request = (new SetIamPolicyRegionNetworkFirewallPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsRegionNetworkFirewallPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionNetworkFirewallPolicies/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsRegionNetworkFirewallPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function addAssociationAsyncTest() + { + $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/addAssociationAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addAssociationAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyAssociationResource = new FirewallPolicyAssociation(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new AddAssociationRegionNetworkFirewallPolicyRequest()) + ->setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyAssociationResource($firewallPolicyAssociationResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->addAssociation($request); + $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.RegionNetworkFirewallPolicies/AddAssociation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyAssociationResource(); + $this->assertProtobufEquals($firewallPolicyAssociationResource, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionNotificationEndpointsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionNotificationEndpointsClientTest.php new file mode 100644 index 000000000000..9908d8d27354 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionNotificationEndpointsClientTest.php @@ -0,0 +1,564 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionNotificationEndpointsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionNotificationEndpointsClient($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 + $notificationEndpoint = 'notificationEndpoint-696934807'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionNotificationEndpointRequest()) + ->setNotificationEndpoint($notificationEndpoint) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.RegionNotificationEndpoints/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNotificationEndpoint(); + $this->assertProtobufEquals($notificationEndpoint, $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 + $notificationEndpoint = 'notificationEndpoint-696934807'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionNotificationEndpointRequest()) + ->setNotificationEndpoint($notificationEndpoint) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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'; + $expectedResponse = new NotificationEndpoint(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $notificationEndpoint = 'notificationEndpoint-696934807'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionNotificationEndpointRequest()) + ->setNotificationEndpoint($notificationEndpoint) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionNotificationEndpoints/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNotificationEndpoint(); + $this->assertProtobufEquals($notificationEndpoint, $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 + $notificationEndpoint = 'notificationEndpoint-696934807'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionNotificationEndpointRequest()) + ->setNotificationEndpoint($notificationEndpoint) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $notificationEndpointResource = new NotificationEndpoint(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertRegionNotificationEndpointRequest()) + ->setNotificationEndpointResource($notificationEndpointResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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.RegionNotificationEndpoints/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNotificationEndpointResource(); + $this->assertProtobufEquals($notificationEndpointResource, $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 + $notificationEndpointResource = new NotificationEndpoint(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new InsertRegionNotificationEndpointRequest()) + ->setNotificationEndpointResource($notificationEndpointResource) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->insert($request); + $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 NotificationEndpoint(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NotificationEndpointList(); + $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'; + $request = (new ListRegionNotificationEndpointsRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.RegionNotificationEndpoints/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'; + $request = (new ListRegionNotificationEndpointsRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAsyncTest() + { + $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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $notificationEndpoint = 'notificationEndpoint-696934807'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionNotificationEndpointRequest()) + ->setNotificationEndpoint($notificationEndpoint) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $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.RegionNotificationEndpoints/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNotificationEndpoint(); + $this->assertProtobufEquals($notificationEndpoint, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionOperationsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionOperationsClientTest.php new file mode 100644 index 000000000000..67fd242cfc80 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionOperationsClientTest.php @@ -0,0 +1,492 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionOperationsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionOperationsClient($options); + } + + /** @test */ + public function deleteTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new DeleteRegionOperationResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionOperationRequest()) + ->setOperation($operation) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->delete($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionOperations/Delete', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $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 + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionOperationRequest()) + ->setOperation($operation) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->delete($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $clientOperationId = 'clientOperationId-239630617'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $endTime = 'endTime1725551537'; + $httpErrorMessage = 'httpErrorMessage1276263769'; + $httpErrorStatusCode = 1386087020; + $id = 3355; + $insertTime = 'insertTime-103148397'; + $kind = 'kind3292052'; + $name = 'name3373707'; + $operationGroupId = 'operationGroupId40171187'; + $operationType = 'operationType-1432962286'; + $progress = 1001078227; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $startTime = 'startTime-1573145462'; + $statusMessage = 'statusMessage-239442758'; + $targetId = 815576439; + $targetLink = 'targetLink-2084812312'; + $user = 'user3599307'; + $zone = 'zone3744684'; + $expectedResponse = new Operation(); + $expectedResponse->setClientOperationId($clientOperationId); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEndTime($endTime); + $expectedResponse->setHttpErrorMessage($httpErrorMessage); + $expectedResponse->setHttpErrorStatusCode($httpErrorStatusCode); + $expectedResponse->setId($id); + $expectedResponse->setInsertTime($insertTime); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setOperationGroupId($operationGroupId); + $expectedResponse->setOperationType($operationType); + $expectedResponse->setProgress($progress); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStartTime($startTime); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setTargetId($targetId); + $expectedResponse->setTargetLink($targetLink); + $expectedResponse->setUser($user); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionOperationRequest()) + ->setOperation($operation) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionOperations/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $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 + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionOperationRequest()) + ->setOperation($operation) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 Operation(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new OperationList(); + $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'; + $request = (new ListRegionOperationsRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.RegionOperations/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'; + $request = (new ListRegionOperationsRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function waitTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $clientOperationId = 'clientOperationId-239630617'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $endTime = 'endTime1725551537'; + $httpErrorMessage = 'httpErrorMessage1276263769'; + $httpErrorStatusCode = 1386087020; + $id = 3355; + $insertTime = 'insertTime-103148397'; + $kind = 'kind3292052'; + $name = 'name3373707'; + $operationGroupId = 'operationGroupId40171187'; + $operationType = 'operationType-1432962286'; + $progress = 1001078227; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $startTime = 'startTime-1573145462'; + $statusMessage = 'statusMessage-239442758'; + $targetId = 815576439; + $targetLink = 'targetLink-2084812312'; + $user = 'user3599307'; + $zone = 'zone3744684'; + $expectedResponse = new Operation(); + $expectedResponse->setClientOperationId($clientOperationId); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEndTime($endTime); + $expectedResponse->setHttpErrorMessage($httpErrorMessage); + $expectedResponse->setHttpErrorStatusCode($httpErrorStatusCode); + $expectedResponse->setId($id); + $expectedResponse->setInsertTime($insertTime); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setOperationGroupId($operationGroupId); + $expectedResponse->setOperationType($operationType); + $expectedResponse->setProgress($progress); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStartTime($startTime); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setTargetId($targetId); + $expectedResponse->setTargetLink($targetLink); + $expectedResponse->setUser($user); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new WaitRegionOperationRequest()) + ->setOperation($operation) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->wait($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionOperations/Wait', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function waitExceptionTest() + { + $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 + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new WaitRegionOperationRequest()) + ->setOperation($operation) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->wait($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new DeleteRegionOperationResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new DeleteRegionOperationRequest()) + ->setOperation($operation) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->deleteAsync($request)->wait(); + $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.RegionOperations/Delete', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionSecurityPoliciesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionSecurityPoliciesClientTest.php new file mode 100644 index 000000000000..c79bbec71fa9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionSecurityPoliciesClientTest.php @@ -0,0 +1,1188 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionSecurityPoliciesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionSecurityPoliciesClient($options); + } + + /** @test */ + public function addRuleTest() + { + $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/addRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyRuleResource = new SecurityPolicyRule(); + $request = (new AddRuleRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyRuleResource($securityPolicyRuleResource); + $response = $gapicClient->addRule($request); + $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.RegionSecurityPolicies/AddRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyRuleResource(); + $this->assertProtobufEquals($securityPolicyRuleResource, $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 addRuleExceptionTest() + { + $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/addRuleExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyRuleResource = new SecurityPolicyRule(); + $request = (new AddRuleRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyRuleResource($securityPolicyRuleResource); + $response = $gapicClient->addRule($request); + $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 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $request = (new DeleteRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy); + $response = $gapicClient->delete($request); + $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.RegionSecurityPolicies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $request = (new DeleteRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy); + $response = $gapicClient->delete($request); + $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'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $type = 'type3575610'; + $expectedResponse = new SecurityPolicy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setType($type); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $request = (new GetRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionSecurityPolicies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $request = (new GetRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRuleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $action = 'action-1422950858'; + $description = 'description-1724546052'; + $kind = 'kind3292052'; + $preview = true; + $priority2 = 978365527; + $expectedResponse = new SecurityPolicyRule(); + $expectedResponse->setAction($action); + $expectedResponse->setDescription($description); + $expectedResponse->setKind($kind); + $expectedResponse->setPreview($preview); + $expectedResponse->setPriority($priority2); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $request = (new GetRuleRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy); + $response = $gapicClient->getRule($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionSecurityPolicies/GetRule', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRuleExceptionTest() + { + $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'; + $securityPolicy = 'securityPolicy1781695249'; + $request = (new GetRuleRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy); + try { + $gapicClient->getRule($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicyResource = new SecurityPolicy(); + $request = (new InsertRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicyResource($securityPolicyResource); + $response = $gapicClient->insert($request); + $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.RegionSecurityPolicies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyResource(); + $this->assertProtobufEquals($securityPolicyResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicyResource = new SecurityPolicy(); + $request = (new InsertRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicyResource($securityPolicyResource); + $response = $gapicClient->insert($request); + $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 = ''; + $itemsElement = new SecurityPolicy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new SecurityPolicyList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new ListRegionSecurityPoliciesRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.RegionSecurityPolicies/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'; + $request = (new ListRegionSecurityPoliciesRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyResource = new SecurityPolicy(); + $request = (new PatchRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyResource($securityPolicyResource); + $response = $gapicClient->patch($request); + $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.RegionSecurityPolicies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyResource(); + $this->assertProtobufEquals($securityPolicyResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyResource = new SecurityPolicy(); + $request = (new PatchRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyResource($securityPolicyResource); + $response = $gapicClient->patch($request); + $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 patchRuleTest() + { + $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/patchRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyRuleResource = new SecurityPolicyRule(); + $request = (new PatchRuleRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyRuleResource($securityPolicyRuleResource); + $response = $gapicClient->patchRule($request); + $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.RegionSecurityPolicies/PatchRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyRuleResource(); + $this->assertProtobufEquals($securityPolicyRuleResource, $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 patchRuleExceptionTest() + { + $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/patchRuleExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyRuleResource = new SecurityPolicyRule(); + $request = (new PatchRuleRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyRuleResource($securityPolicyRuleResource); + $response = $gapicClient->patchRule($request); + $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 removeRuleTest() + { + $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/removeRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $request = (new RemoveRuleRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy); + $response = $gapicClient->removeRule($request); + $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.RegionSecurityPolicies/RemoveRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $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 removeRuleExceptionTest() + { + $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/removeRuleExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $request = (new RemoveRuleRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy); + $response = $gapicClient->removeRule($request); + $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 addRuleAsyncTest() + { + $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/addRuleAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addRuleAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyRuleResource = new SecurityPolicyRule(); + $request = (new AddRuleRegionSecurityPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyRuleResource($securityPolicyRuleResource); + $response = $gapicClient->addRule($request); + $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.RegionSecurityPolicies/AddRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyRuleResource(); + $this->assertProtobufEquals($securityPolicyRuleResource, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionSslCertificatesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionSslCertificatesClientTest.php new file mode 100644 index 000000000000..77ca7195a77d --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionSslCertificatesClientTest.php @@ -0,0 +1,572 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionSslCertificatesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionSslCertificatesClient($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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslCertificate = 'sslCertificate-1027298332'; + $request = (new DeleteRegionSslCertificateRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslCertificate($sslCertificate); + $response = $gapicClient->delete($request); + $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.RegionSslCertificates/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSslCertificate(); + $this->assertProtobufEquals($sslCertificate, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslCertificate = 'sslCertificate-1027298332'; + $request = (new DeleteRegionSslCertificateRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslCertificate($sslCertificate); + $response = $gapicClient->delete($request); + $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 + $certificate = 'certificate1952399767'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $expireTime = 'expireTime-96179731'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $privateKey = 'privateKey1971943843'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $type = 'type3575610'; + $expectedResponse = new SslCertificate(); + $expectedResponse->setCertificate($certificate); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setExpireTime($expireTime); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setPrivateKey($privateKey); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setType($type); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslCertificate = 'sslCertificate-1027298332'; + $request = (new GetRegionSslCertificateRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslCertificate($sslCertificate); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionSslCertificates/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getSslCertificate(); + $this->assertProtobufEquals($sslCertificate, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslCertificate = 'sslCertificate-1027298332'; + $request = (new GetRegionSslCertificateRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslCertificate($sslCertificate); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslCertificateResource = new SslCertificate(); + $request = (new InsertRegionSslCertificateRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslCertificateResource($sslCertificateResource); + $response = $gapicClient->insert($request); + $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.RegionSslCertificates/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSslCertificateResource(); + $this->assertProtobufEquals($sslCertificateResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslCertificateResource = new SslCertificate(); + $request = (new InsertRegionSslCertificateRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslCertificateResource($sslCertificateResource); + $response = $gapicClient->insert($request); + $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 SslCertificate(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new SslCertificateList(); + $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'; + $request = (new ListRegionSslCertificatesRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.RegionSslCertificates/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'; + $request = (new ListRegionSslCertificatesRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAsyncTest() + { + $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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslCertificate = 'sslCertificate-1027298332'; + $request = (new DeleteRegionSslCertificateRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslCertificate($sslCertificate); + $response = $gapicClient->delete($request); + $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.RegionSslCertificates/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSslCertificate(); + $this->assertProtobufEquals($sslCertificate, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionSslPoliciesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionSslPoliciesClientTest.php new file mode 100644 index 000000000000..9d0f2beb3e89 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionSslPoliciesClientTest.php @@ -0,0 +1,774 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionSslPoliciesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionSslPoliciesClient($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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslPolicy = 'sslPolicy-1852293435'; + $request = (new DeleteRegionSslPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslPolicy($sslPolicy); + $response = $gapicClient->delete($request); + $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.RegionSslPolicies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSslPolicy(); + $this->assertProtobufEquals($sslPolicy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslPolicy = 'sslPolicy-1852293435'; + $request = (new DeleteRegionSslPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslPolicy($sslPolicy); + $response = $gapicClient->delete($request); + $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'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $minTlsVersion = 'minTlsVersion8155943'; + $name = 'name3373707'; + $profile = 'profile-309425751'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new SslPolicy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setMinTlsVersion($minTlsVersion); + $expectedResponse->setName($name); + $expectedResponse->setProfile($profile); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslPolicy = 'sslPolicy-1852293435'; + $request = (new GetRegionSslPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslPolicy($sslPolicy); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionSslPolicies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getSslPolicy(); + $this->assertProtobufEquals($sslPolicy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslPolicy = 'sslPolicy-1852293435'; + $request = (new GetRegionSslPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslPolicy($sslPolicy); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslPolicyResource = new SslPolicy(); + $request = (new InsertRegionSslPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslPolicyResource($sslPolicyResource); + $response = $gapicClient->insert($request); + $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.RegionSslPolicies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSslPolicyResource(); + $this->assertProtobufEquals($sslPolicyResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslPolicyResource = new SslPolicy(); + $request = (new InsertRegionSslPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslPolicyResource($sslPolicyResource); + $response = $gapicClient->insert($request); + $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 SslPolicy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new SslPoliciesList(); + $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'; + $request = (new ListRegionSslPoliciesRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.RegionSslPolicies/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'; + $request = (new ListRegionSslPoliciesRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAvailableFeaturesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new SslPoliciesListAvailableFeaturesResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new ListAvailableFeaturesRegionSslPoliciesRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->listAvailableFeatures($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionSslPolicies/ListAvailableFeatures', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAvailableFeaturesExceptionTest() + { + $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'; + $request = (new ListAvailableFeaturesRegionSslPoliciesRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->listAvailableFeatures($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslPolicy = 'sslPolicy-1852293435'; + $sslPolicyResource = new SslPolicy(); + $request = (new PatchRegionSslPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslPolicy($sslPolicy) + ->setSslPolicyResource($sslPolicyResource); + $response = $gapicClient->patch($request); + $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.RegionSslPolicies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSslPolicy(); + $this->assertProtobufEquals($sslPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getSslPolicyResource(); + $this->assertProtobufEquals($sslPolicyResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslPolicy = 'sslPolicy-1852293435'; + $sslPolicyResource = new SslPolicy(); + $request = (new PatchRegionSslPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslPolicy($sslPolicy) + ->setSslPolicyResource($sslPolicyResource); + $response = $gapicClient->patch($request); + $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 deleteAsyncTest() + { + $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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslPolicy = 'sslPolicy-1852293435'; + $request = (new DeleteRegionSslPolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setSslPolicy($sslPolicy); + $response = $gapicClient->delete($request); + $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.RegionSslPolicies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSslPolicy(); + $this->assertProtobufEquals($sslPolicy, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionTargetHttpProxiesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionTargetHttpProxiesClientTest.php new file mode 100644 index 000000000000..11b3c02732d8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionTargetHttpProxiesClientTest.php @@ -0,0 +1,707 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionTargetHttpProxiesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionTargetHttpProxiesClient($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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $request = (new DeleteRegionTargetHttpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpProxy($targetHttpProxy); + $response = $gapicClient->delete($request); + $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.RegionTargetHttpProxies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpProxy(); + $this->assertProtobufEquals($targetHttpProxy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $request = (new DeleteRegionTargetHttpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpProxy($targetHttpProxy); + $response = $gapicClient->delete($request); + $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'; + $fingerprint = 'fingerprint-1375934236'; + $httpKeepAliveTimeoutSec = 2057938782; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $proxyBind = true; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $urlMap = 'urlMap-169850228'; + $expectedResponse = new TargetHttpProxy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setHttpKeepAliveTimeoutSec($httpKeepAliveTimeoutSec); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setProxyBind($proxyBind); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setUrlMap($urlMap); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $request = (new GetRegionTargetHttpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpProxy($targetHttpProxy); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionTargetHttpProxies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getTargetHttpProxy(); + $this->assertProtobufEquals($targetHttpProxy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $request = (new GetRegionTargetHttpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpProxy($targetHttpProxy); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpProxyResource = new TargetHttpProxy(); + $request = (new InsertRegionTargetHttpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpProxyResource($targetHttpProxyResource); + $response = $gapicClient->insert($request); + $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.RegionTargetHttpProxies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpProxyResource(); + $this->assertProtobufEquals($targetHttpProxyResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpProxyResource = new TargetHttpProxy(); + $request = (new InsertRegionTargetHttpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpProxyResource($targetHttpProxyResource); + $response = $gapicClient->insert($request); + $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 TargetHttpProxy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new TargetHttpProxyList(); + $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'; + $request = (new ListRegionTargetHttpProxiesRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.RegionTargetHttpProxies/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'; + $request = (new ListRegionTargetHttpProxiesRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setUrlMapTest() + { + $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/setUrlMapTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setUrlMapTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $urlMapReferenceResource = new UrlMapReference(); + $request = (new SetUrlMapRegionTargetHttpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpProxy($targetHttpProxy) + ->setUrlMapReferenceResource($urlMapReferenceResource); + $response = $gapicClient->setUrlMap($request); + $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.RegionTargetHttpProxies/SetUrlMap', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpProxy(); + $this->assertProtobufEquals($targetHttpProxy, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMapReferenceResource(); + $this->assertProtobufEquals($urlMapReferenceResource, $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 setUrlMapExceptionTest() + { + $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/setUrlMapExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $urlMapReferenceResource = new UrlMapReference(); + $request = (new SetUrlMapRegionTargetHttpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpProxy($targetHttpProxy) + ->setUrlMapReferenceResource($urlMapReferenceResource); + $response = $gapicClient->setUrlMap($request); + $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 deleteAsyncTest() + { + $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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $request = (new DeleteRegionTargetHttpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpProxy($targetHttpProxy); + $response = $gapicClient->delete($request); + $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.RegionTargetHttpProxies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpProxy(); + $this->assertProtobufEquals($targetHttpProxy, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionTargetHttpsProxiesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionTargetHttpsProxiesClientTest.php new file mode 100644 index 000000000000..423b658a2e7c --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionTargetHttpsProxiesClientTest.php @@ -0,0 +1,986 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionTargetHttpsProxiesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionTargetHttpsProxiesClient($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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $request = (new DeleteRegionTargetHttpsProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpsProxy($targetHttpsProxy); + $response = $gapicClient->delete($request); + $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.RegionTargetHttpsProxies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $request = (new DeleteRegionTargetHttpsProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpsProxy($targetHttpsProxy); + $response = $gapicClient->delete($request); + $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 + $authorizationPolicy = 'authorizationPolicy-1576667208'; + $certificateMap = 'certificateMap-917278028'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $httpKeepAliveTimeoutSec = 2057938782; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $proxyBind = true; + $quicOverride = 'quicOverride2067189933'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $serverTlsPolicy = 'serverTlsPolicy1906438002'; + $sslPolicy = 'sslPolicy-1852293435'; + $urlMap = 'urlMap-169850228'; + $expectedResponse = new TargetHttpsProxy(); + $expectedResponse->setAuthorizationPolicy($authorizationPolicy); + $expectedResponse->setCertificateMap($certificateMap); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setHttpKeepAliveTimeoutSec($httpKeepAliveTimeoutSec); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setProxyBind($proxyBind); + $expectedResponse->setQuicOverride($quicOverride); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setServerTlsPolicy($serverTlsPolicy); + $expectedResponse->setSslPolicy($sslPolicy); + $expectedResponse->setUrlMap($urlMap); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $request = (new GetRegionTargetHttpsProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpsProxy($targetHttpsProxy); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionTargetHttpsProxies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $request = (new GetRegionTargetHttpsProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpsProxy($targetHttpsProxy); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpsProxyResource = new TargetHttpsProxy(); + $request = (new InsertRegionTargetHttpsProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpsProxyResource($targetHttpsProxyResource); + $response = $gapicClient->insert($request); + $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.RegionTargetHttpsProxies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxyResource(); + $this->assertProtobufEquals($targetHttpsProxyResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpsProxyResource = new TargetHttpsProxy(); + $request = (new InsertRegionTargetHttpsProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpsProxyResource($targetHttpsProxyResource); + $response = $gapicClient->insert($request); + $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 TargetHttpsProxy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new TargetHttpsProxyList(); + $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'; + $request = (new ListRegionTargetHttpsProxiesRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.RegionTargetHttpsProxies/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'; + $request = (new ListRegionTargetHttpsProxiesRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $targetHttpsProxyResource = new TargetHttpsProxy(); + $request = (new PatchRegionTargetHttpsProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setTargetHttpsProxyResource($targetHttpsProxyResource); + $response = $gapicClient->patch($request); + $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.RegionTargetHttpsProxies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxyResource(); + $this->assertProtobufEquals($targetHttpsProxyResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $targetHttpsProxyResource = new TargetHttpsProxy(); + $request = (new PatchRegionTargetHttpsProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setTargetHttpsProxyResource($targetHttpsProxyResource); + $response = $gapicClient->patch($request); + $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 setSslCertificatesTest() + { + $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/setSslCertificatesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setSslCertificatesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionTargetHttpsProxiesSetSslCertificatesRequestResource = new RegionTargetHttpsProxiesSetSslCertificatesRequest(); + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $request = (new SetSslCertificatesRegionTargetHttpsProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionTargetHttpsProxiesSetSslCertificatesRequestResource($regionTargetHttpsProxiesSetSslCertificatesRequestResource) + ->setTargetHttpsProxy($targetHttpsProxy); + $response = $gapicClient->setSslCertificates($request); + $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.RegionTargetHttpsProxies/SetSslCertificates', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionTargetHttpsProxiesSetSslCertificatesRequestResource(); + $this->assertProtobufEquals($regionTargetHttpsProxiesSetSslCertificatesRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $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 setSslCertificatesExceptionTest() + { + $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/setSslCertificatesExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionTargetHttpsProxiesSetSslCertificatesRequestResource = new RegionTargetHttpsProxiesSetSslCertificatesRequest(); + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $request = (new SetSslCertificatesRegionTargetHttpsProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionTargetHttpsProxiesSetSslCertificatesRequestResource($regionTargetHttpsProxiesSetSslCertificatesRequestResource) + ->setTargetHttpsProxy($targetHttpsProxy); + $response = $gapicClient->setSslCertificates($request); + $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 setUrlMapTest() + { + $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/setUrlMapTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setUrlMapTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $urlMapReferenceResource = new UrlMapReference(); + $request = (new SetUrlMapRegionTargetHttpsProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setUrlMapReferenceResource($urlMapReferenceResource); + $response = $gapicClient->setUrlMap($request); + $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.RegionTargetHttpsProxies/SetUrlMap', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMapReferenceResource(); + $this->assertProtobufEquals($urlMapReferenceResource, $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 setUrlMapExceptionTest() + { + $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/setUrlMapExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $urlMapReferenceResource = new UrlMapReference(); + $request = (new SetUrlMapRegionTargetHttpsProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setUrlMapReferenceResource($urlMapReferenceResource); + $response = $gapicClient->setUrlMap($request); + $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 deleteAsyncTest() + { + $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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $request = (new DeleteRegionTargetHttpsProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetHttpsProxy($targetHttpsProxy); + $response = $gapicClient->delete($request); + $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.RegionTargetHttpsProxies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionTargetTcpProxiesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionTargetTcpProxiesClientTest.php new file mode 100644 index 000000000000..90b4a1f65457 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionTargetTcpProxiesClientTest.php @@ -0,0 +1,570 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionTargetTcpProxiesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionTargetTcpProxiesClient($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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetTcpProxy = 'targetTcpProxy503065442'; + $request = (new DeleteRegionTargetTcpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetTcpProxy($targetTcpProxy); + $response = $gapicClient->delete($request); + $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.RegionTargetTcpProxies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetTcpProxy(); + $this->assertProtobufEquals($targetTcpProxy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetTcpProxy = 'targetTcpProxy503065442'; + $request = (new DeleteRegionTargetTcpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetTcpProxy($targetTcpProxy); + $response = $gapicClient->delete($request); + $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'; + $proxyBind = true; + $proxyHeader = 'proxyHeader-1987109506'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $service = 'service1984153269'; + $expectedResponse = new TargetTcpProxy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setProxyBind($proxyBind); + $expectedResponse->setProxyHeader($proxyHeader); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setService($service); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetTcpProxy = 'targetTcpProxy503065442'; + $request = (new GetRegionTargetTcpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetTcpProxy($targetTcpProxy); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionTargetTcpProxies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getTargetTcpProxy(); + $this->assertProtobufEquals($targetTcpProxy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetTcpProxy = 'targetTcpProxy503065442'; + $request = (new GetRegionTargetTcpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetTcpProxy($targetTcpProxy); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetTcpProxyResource = new TargetTcpProxy(); + $request = (new InsertRegionTargetTcpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetTcpProxyResource($targetTcpProxyResource); + $response = $gapicClient->insert($request); + $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.RegionTargetTcpProxies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetTcpProxyResource(); + $this->assertProtobufEquals($targetTcpProxyResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetTcpProxyResource = new TargetTcpProxy(); + $request = (new InsertRegionTargetTcpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetTcpProxyResource($targetTcpProxyResource); + $response = $gapicClient->insert($request); + $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 TargetTcpProxy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new TargetTcpProxyList(); + $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'; + $request = (new ListRegionTargetTcpProxiesRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.RegionTargetTcpProxies/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'; + $request = (new ListRegionTargetTcpProxiesRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAsyncTest() + { + $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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetTcpProxy = 'targetTcpProxy503065442'; + $request = (new DeleteRegionTargetTcpProxyRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetTcpProxy($targetTcpProxy); + $response = $gapicClient->delete($request); + $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.RegionTargetTcpProxies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetTcpProxy(); + $this->assertProtobufEquals($targetTcpProxy, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionUrlMapsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionUrlMapsClientTest.php new file mode 100644 index 000000000000..7053f0b3f944 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionUrlMapsClientTest.php @@ -0,0 +1,919 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionUrlMapsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionUrlMapsClient($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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $urlMap = 'urlMap-169850228'; + $request = (new DeleteRegionUrlMapRequest()) + ->setProject($project) + ->setRegion($region) + ->setUrlMap($urlMap); + $response = $gapicClient->delete($request); + $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.RegionUrlMaps/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $urlMap = 'urlMap-169850228'; + $request = (new DeleteRegionUrlMapRequest()) + ->setProject($project) + ->setRegion($region) + ->setUrlMap($urlMap); + $response = $gapicClient->delete($request); + $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'; + $defaultService = 'defaultService1980854967'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new UrlMap(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDefaultService($defaultService); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $urlMap = 'urlMap-169850228'; + $request = (new GetRegionUrlMapRequest()) + ->setProject($project) + ->setRegion($region) + ->setUrlMap($urlMap); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionUrlMaps/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $urlMap = 'urlMap-169850228'; + $request = (new GetRegionUrlMapRequest()) + ->setProject($project) + ->setRegion($region) + ->setUrlMap($urlMap); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $urlMapResource = new UrlMap(); + $request = (new InsertRegionUrlMapRequest()) + ->setProject($project) + ->setRegion($region) + ->setUrlMapResource($urlMapResource); + $response = $gapicClient->insert($request); + $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.RegionUrlMaps/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMapResource(); + $this->assertProtobufEquals($urlMapResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $urlMapResource = new UrlMap(); + $request = (new InsertRegionUrlMapRequest()) + ->setProject($project) + ->setRegion($region) + ->setUrlMapResource($urlMapResource); + $response = $gapicClient->insert($request); + $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 UrlMap(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new UrlMapList(); + $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'; + $request = (new ListRegionUrlMapsRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.RegionUrlMaps/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'; + $request = (new ListRegionUrlMapsRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $urlMap = 'urlMap-169850228'; + $urlMapResource = new UrlMap(); + $request = (new PatchRegionUrlMapRequest()) + ->setProject($project) + ->setRegion($region) + ->setUrlMap($urlMap) + ->setUrlMapResource($urlMapResource); + $response = $gapicClient->patch($request); + $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.RegionUrlMaps/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMapResource(); + $this->assertProtobufEquals($urlMapResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $urlMap = 'urlMap-169850228'; + $urlMapResource = new UrlMap(); + $request = (new PatchRegionUrlMapRequest()) + ->setProject($project) + ->setRegion($region) + ->setUrlMap($urlMap) + ->setUrlMapResource($urlMapResource); + $response = $gapicClient->patch($request); + $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 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $urlMap = 'urlMap-169850228'; + $urlMapResource = new UrlMap(); + $request = (new UpdateRegionUrlMapRequest()) + ->setProject($project) + ->setRegion($region) + ->setUrlMap($urlMap) + ->setUrlMapResource($urlMapResource); + $response = $gapicClient->update($request); + $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.RegionUrlMaps/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMapResource(); + $this->assertProtobufEquals($urlMapResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $urlMap = 'urlMap-169850228'; + $urlMapResource = new UrlMap(); + $request = (new UpdateRegionUrlMapRequest()) + ->setProject($project) + ->setRegion($region) + ->setUrlMap($urlMap) + ->setUrlMapResource($urlMapResource); + $response = $gapicClient->update($request); + $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 validateTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new UrlMapsValidateResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionUrlMapsValidateRequestResource = new RegionUrlMapsValidateRequest(); + $urlMap = 'urlMap-169850228'; + $request = (new ValidateRegionUrlMapRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionUrlMapsValidateRequestResource($regionUrlMapsValidateRequestResource) + ->setUrlMap($urlMap); + $response = $gapicClient->validate($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionUrlMaps/Validate', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRegionUrlMapsValidateRequestResource(); + $this->assertProtobufEquals($regionUrlMapsValidateRequestResource, $actualValue); + $actualValue = $actualRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function validateExceptionTest() + { + $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'; + $regionUrlMapsValidateRequestResource = new RegionUrlMapsValidateRequest(); + $urlMap = 'urlMap-169850228'; + $request = (new ValidateRegionUrlMapRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionUrlMapsValidateRequestResource($regionUrlMapsValidateRequestResource) + ->setUrlMap($urlMap); + try { + $gapicClient->validate($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAsyncTest() + { + $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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $urlMap = 'urlMap-169850228'; + $request = (new DeleteRegionUrlMapRequest()) + ->setProject($project) + ->setRegion($region) + ->setUrlMap($urlMap); + $response = $gapicClient->delete($request); + $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.RegionUrlMaps/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionZonesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionZonesClientTest.php new file mode 100644 index 000000000000..34a45156b7ec --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionZonesClientTest.php @@ -0,0 +1,194 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionZonesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionZonesClient($options); + } + + /** @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 Zone(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new ZoneList(); + $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'; + $request = (new ListRegionZonesRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.RegionZones/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'; + $request = (new ListRegionZonesRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new Zone(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new ZoneList(); + $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'; + $request = (new ListRegionZonesRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->listAsync($request)->wait(); + $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.RegionZones/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionsClientTest.php new file mode 100644 index 000000000000..7b6c9f43363b --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionsClientTest.php @@ -0,0 +1,273 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionsClient($options); + } + + /** @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'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $supportsPzs = true; + $expectedResponse = new Region(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $expectedResponse->setSupportsPzs($supportsPzs); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Regions/Get', $actualFuncCall); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 Region(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new RegionList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListRegionsRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.Regions/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListRegionsRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAsyncTest() + { + $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'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $supportsPzs = true; + $expectedResponse = new Region(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $expectedResponse->setSupportsPzs($supportsPzs); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $request = (new GetRegionRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->getAsync($request)->wait(); + $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.Regions/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ReservationsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ReservationsClientTest.php new file mode 100644 index 000000000000..2b5f07594f63 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ReservationsClientTest.php @@ -0,0 +1,1152 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ReservationsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ReservationsClient($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 ReservationsScopedList(), + ]; + $expectedResponse = new ReservationAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListReservationsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.Reservations/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'; + $request = (new AggregatedListReservationsRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTest() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $reservation = 'reservation-1563081780'; + $zone = 'zone3744684'; + $request = (new DeleteReservationRequest()) + ->setProject($project) + ->setReservation($reservation) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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.Reservations/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getReservation(); + $this->assertProtobufEquals($reservation, $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 deleteExceptionTest() + { + $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/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 + $project = 'project-309310695'; + $reservation = 'reservation-1563081780'; + $zone = 'zone3744684'; + $request = (new DeleteReservationRequest()) + ->setProject($project) + ->setReservation($reservation) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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 + $commitment = 'commitment1019005717'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $specificReservationRequired = false; + $status = 'status-892481550'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new Reservation(); + $expectedResponse->setCommitment($commitment); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSpecificReservationRequired($specificReservationRequired); + $expectedResponse->setStatus($status); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $reservation = 'reservation-1563081780'; + $zone = 'zone3744684'; + $request = (new GetReservationRequest()) + ->setProject($project) + ->setReservation($reservation) + ->setZone($zone); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Reservations/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getReservation(); + $this->assertProtobufEquals($reservation, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $project = 'project-309310695'; + $reservation = 'reservation-1563081780'; + $zone = 'zone3744684'; + $request = (new GetReservationRequest()) + ->setProject($project) + ->setReservation($reservation) + ->setZone($zone); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $request = (new GetIamPolicyReservationRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Reservations/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $request = (new GetIamPolicyReservationRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $reservationResource = new Reservation(); + $zone = 'zone3744684'; + $request = (new InsertReservationRequest()) + ->setProject($project) + ->setReservationResource($reservationResource) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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.Reservations/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getReservationResource(); + $this->assertProtobufEquals($reservationResource, $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 insertExceptionTest() + { + $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/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 + $project = 'project-309310695'; + $reservationResource = new Reservation(); + $zone = 'zone3744684'; + $request = (new InsertReservationRequest()) + ->setProject($project) + ->setReservationResource($reservationResource) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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 Reservation(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new ReservationList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListReservationsRequest()) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->list($request); + $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.Reservations/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + $request = (new ListReservationsRequest()) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function resizeTest() + { + $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/resizeTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/resizeTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $reservation = 'reservation-1563081780'; + $reservationsResizeRequestResource = new ReservationsResizeRequest(); + $zone = 'zone3744684'; + $request = (new ResizeReservationRequest()) + ->setProject($project) + ->setReservation($reservation) + ->setReservationsResizeRequestResource($reservationsResizeRequestResource) + ->setZone($zone); + $response = $gapicClient->resize($request); + $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.Reservations/Resize', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getReservation(); + $this->assertProtobufEquals($reservation, $actualValue); + $actualValue = $actualApiRequestObject->getReservationsResizeRequestResource(); + $this->assertProtobufEquals($reservationsResizeRequestResource, $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 resizeExceptionTest() + { + $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/resizeExceptionTest'); + $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 + $project = 'project-309310695'; + $reservation = 'reservation-1563081780'; + $reservationsResizeRequestResource = new ReservationsResizeRequest(); + $zone = 'zone3744684'; + $request = (new ResizeReservationRequest()) + ->setProject($project) + ->setReservation($reservation) + ->setReservationsResizeRequestResource($reservationsResizeRequestResource) + ->setZone($zone); + $response = $gapicClient->resize($request); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $request = (new SetIamPolicyReservationRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Reservations/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $actualValue = $actualRequestObject->getZoneSetPolicyRequestResource(); + $this->assertProtobufEquals($zoneSetPolicyRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $request = (new SetIamPolicyReservationRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + $request = (new TestIamPermissionsReservationRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Reservations/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + $request = (new TestIamPermissionsReservationRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $reservation = 'reservation-1563081780'; + $reservationResource = new Reservation(); + $zone = 'zone3744684'; + $request = (new UpdateReservationRequest()) + ->setProject($project) + ->setReservation($reservation) + ->setReservationResource($reservationResource) + ->setZone($zone); + $response = $gapicClient->update($request); + $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.Reservations/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getReservation(); + $this->assertProtobufEquals($reservation, $actualValue); + $actualValue = $actualApiRequestObject->getReservationResource(); + $this->assertProtobufEquals($reservationResource, $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 + $project = 'project-309310695'; + $reservation = 'reservation-1563081780'; + $reservationResource = new Reservation(); + $zone = 'zone3744684'; + $request = (new UpdateReservationRequest()) + ->setProject($project) + ->setReservation($reservation) + ->setReservationResource($reservationResource) + ->setZone($zone); + $response = $gapicClient->update($request); + $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 aggregatedListAsyncTest() + { + $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 ReservationsScopedList(), + ]; + $expectedResponse = new ReservationAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListReservationsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.Reservations/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ResourcePoliciesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ResourcePoliciesClientTest.php new file mode 100644 index 000000000000..292792af3f9e --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ResourcePoliciesClientTest.php @@ -0,0 +1,1017 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ResourcePoliciesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ResourcePoliciesClient($options); + } + + /** @test */ + public function aggregatedListTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $items = [ + 'itemsKey' => new ResourcePoliciesScopedList(), + ]; + $expectedResponse = new ResourcePolicyAggregatedList(); + $expectedResponse->setEtag($etag); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListResourcePoliciesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.ResourcePolicies/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'; + $request = (new AggregatedListResourcePoliciesRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $resourcePolicy = 'resourcePolicy696111747'; + $request = (new DeleteResourcePolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResourcePolicy($resourcePolicy); + $response = $gapicClient->delete($request); + $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.ResourcePolicies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getResourcePolicy(); + $this->assertProtobufEquals($resourcePolicy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $resourcePolicy = 'resourcePolicy696111747'; + $request = (new DeleteResourcePolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResourcePolicy($resourcePolicy); + $response = $gapicClient->delete($request); + $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'; + $status = 'status-892481550'; + $expectedResponse = new ResourcePolicy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resourcePolicy = 'resourcePolicy696111747'; + $request = (new GetResourcePolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResourcePolicy($resourcePolicy); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.ResourcePolicies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResourcePolicy(); + $this->assertProtobufEquals($resourcePolicy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $resourcePolicy = 'resourcePolicy696111747'; + $request = (new GetResourcePolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResourcePolicy($resourcePolicy); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyResourcePolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.ResourcePolicies/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyResourcePolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $resourcePolicyResource = new ResourcePolicy(); + $request = (new InsertResourcePolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResourcePolicyResource($resourcePolicyResource); + $response = $gapicClient->insert($request); + $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.ResourcePolicies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getResourcePolicyResource(); + $this->assertProtobufEquals($resourcePolicyResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $resourcePolicyResource = new ResourcePolicy(); + $request = (new InsertResourcePolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResourcePolicyResource($resourcePolicyResource); + $response = $gapicClient->insert($request); + $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 + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new ResourcePolicy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new ResourcePolicyList(); + $expectedResponse->setEtag($etag); + $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'; + $request = (new ListResourcePoliciesRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.ResourcePolicies/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'; + $request = (new ListResourcePoliciesRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resourcePolicy = 'resourcePolicy696111747'; + $resourcePolicyResource = new ResourcePolicy(); + $request = (new PatchResourcePolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResourcePolicy($resourcePolicy) + ->setResourcePolicyResource($resourcePolicyResource); + $response = $gapicClient->patch($request); + $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.ResourcePolicies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getResourcePolicy(); + $this->assertProtobufEquals($resourcePolicy, $actualValue); + $actualValue = $actualApiRequestObject->getResourcePolicyResource(); + $this->assertProtobufEquals($resourcePolicyResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $resourcePolicy = 'resourcePolicy696111747'; + $resourcePolicyResource = new ResourcePolicy(); + $request = (new PatchResourcePolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResourcePolicy($resourcePolicy) + ->setResourcePolicyResource($resourcePolicyResource); + $response = $gapicClient->patch($request); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $request = (new SetIamPolicyResourcePolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.ResourcePolicies/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRegionSetPolicyRequestResource(); + $this->assertProtobufEquals($regionSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $request = (new SetIamPolicyResourcePolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsResourcePolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.ResourcePolicies/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsResourcePolicyRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function aggregatedListAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $items = [ + 'itemsKey' => new ResourcePoliciesScopedList(), + ]; + $expectedResponse = new ResourcePolicyAggregatedList(); + $expectedResponse->setEtag($etag); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListResourcePoliciesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.ResourcePolicies/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RoutersClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RoutersClientTest.php new file mode 100644 index 000000000000..e89578f27bba --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RoutersClientTest.php @@ -0,0 +1,1223 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RoutersClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RoutersClient($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 RoutersScopedList(), + ]; + $expectedResponse = new RouterAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListRoutersRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.Routers/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'; + $request = (new AggregatedListRoutersRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $request = (new DeleteRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router); + $response = $gapicClient->delete($request); + $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.Routers/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRouter(); + $this->assertProtobufEquals($router, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $request = (new DeleteRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router); + $response = $gapicClient->delete($request); + $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'; + $encryptedInterconnectRouter = false; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $network = 'network1843485230'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new Router(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEncryptedInterconnectRouter($encryptedInterconnectRouter); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $request = (new GetRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Routers/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRouter(); + $this->assertProtobufEquals($router, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $request = (new GetRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNatIpInfoTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new NatIpInfoResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $request = (new GetNatIpInfoRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router); + $response = $gapicClient->getNatIpInfo($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Routers/GetNatIpInfo', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRouter(); + $this->assertProtobufEquals($router, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNatIpInfoExceptionTest() + { + $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'; + $router = 'router-925132983'; + $request = (new GetNatIpInfoRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router); + try { + $gapicClient->getNatIpInfo($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNatMappingInfoTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $resultElement = new VmEndpointNatMappings(); + $result = [ + $resultElement, + ]; + $expectedResponse = new VmEndpointNatMappingsList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setResult($result); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $request = (new GetNatMappingInfoRoutersRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router); + $response = $gapicClient->getNatMappingInfo($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getResult()[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.Routers/GetNatMappingInfo', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRouter(); + $this->assertProtobufEquals($router, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNatMappingInfoExceptionTest() + { + $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'; + $router = 'router-925132983'; + $request = (new GetNatMappingInfoRoutersRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router); + try { + $gapicClient->getNatMappingInfo($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRouterStatusTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $kind = 'kind3292052'; + $expectedResponse = new RouterStatusResponse(); + $expectedResponse->setKind($kind); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $request = (new GetRouterStatusRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router); + $response = $gapicClient->getRouterStatus($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Routers/GetRouterStatus', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRouter(); + $this->assertProtobufEquals($router, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRouterStatusExceptionTest() + { + $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'; + $router = 'router-925132983'; + $request = (new GetRouterStatusRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router); + try { + $gapicClient->getRouterStatus($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $routerResource = new Router(); + $request = (new InsertRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouterResource($routerResource); + $response = $gapicClient->insert($request); + $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.Routers/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRouterResource(); + $this->assertProtobufEquals($routerResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $routerResource = new Router(); + $request = (new InsertRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouterResource($routerResource); + $response = $gapicClient->insert($request); + $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 Router(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new RouterList(); + $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'; + $request = (new ListRoutersRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.Routers/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'; + $request = (new ListRoutersRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $routerResource = new Router(); + $request = (new PatchRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router) + ->setRouterResource($routerResource); + $response = $gapicClient->patch($request); + $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.Routers/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRouter(); + $this->assertProtobufEquals($router, $actualValue); + $actualValue = $actualApiRequestObject->getRouterResource(); + $this->assertProtobufEquals($routerResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $routerResource = new Router(); + $request = (new PatchRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router) + ->setRouterResource($routerResource); + $response = $gapicClient->patch($request); + $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 previewTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new RoutersPreviewResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $routerResource = new Router(); + $request = (new PreviewRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router) + ->setRouterResource($routerResource); + $response = $gapicClient->preview($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Routers/Preview', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRouter(); + $this->assertProtobufEquals($router, $actualValue); + $actualValue = $actualRequestObject->getRouterResource(); + $this->assertProtobufEquals($routerResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function previewExceptionTest() + { + $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'; + $router = 'router-925132983'; + $routerResource = new Router(); + $request = (new PreviewRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router) + ->setRouterResource($routerResource); + try { + $gapicClient->preview($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $routerResource = new Router(); + $request = (new UpdateRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router) + ->setRouterResource($routerResource); + $response = $gapicClient->update($request); + $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.Routers/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRouter(); + $this->assertProtobufEquals($router, $actualValue); + $actualValue = $actualApiRequestObject->getRouterResource(); + $this->assertProtobufEquals($routerResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $routerResource = new Router(); + $request = (new UpdateRouterRequest()) + ->setProject($project) + ->setRegion($region) + ->setRouter($router) + ->setRouterResource($routerResource); + $response = $gapicClient->update($request); + $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 aggregatedListAsyncTest() + { + $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 RoutersScopedList(), + ]; + $expectedResponse = new RouterAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListRoutersRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.Routers/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RoutesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RoutesClientTest.php new file mode 100644 index 000000000000..5b8145490cff --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RoutesClientTest.php @@ -0,0 +1,557 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RoutesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RoutesClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $route = 'route108704329'; + $request = (new DeleteRouteRequest()) + ->setProject($project) + ->setRoute($route); + $response = $gapicClient->delete($request); + $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.Routes/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRoute(); + $this->assertProtobufEquals($route, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $route = 'route108704329'; + $request = (new DeleteRouteRequest()) + ->setProject($project) + ->setRoute($route); + $response = $gapicClient->delete($request); + $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'; + $destRange = 'destRange918198624'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $network = 'network1843485230'; + $nextHopGateway = 'nextHopGateway-159695614'; + $nextHopHub = 'nextHopHub-1948804429'; + $nextHopIlb = 'nextHopIlb-1948803747'; + $nextHopInstance = 'nextHopInstance1467250071'; + $nextHopIp = 'nextHopIp1184061353'; + $nextHopNetwork = 'nextHopNetwork1872908524'; + $nextHopPeering = 'nextHopPeering-661059074'; + $nextHopVpnTunnel = 'nextHopVpnTunnel-1627639147'; + $priority = 1165461084; + $routeStatus = 'routeStatus955033256'; + $routeType = 'routeType912759664'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new Route(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDestRange($destRange); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setNextHopGateway($nextHopGateway); + $expectedResponse->setNextHopHub($nextHopHub); + $expectedResponse->setNextHopIlb($nextHopIlb); + $expectedResponse->setNextHopInstance($nextHopInstance); + $expectedResponse->setNextHopIp($nextHopIp); + $expectedResponse->setNextHopNetwork($nextHopNetwork); + $expectedResponse->setNextHopPeering($nextHopPeering); + $expectedResponse->setNextHopVpnTunnel($nextHopVpnTunnel); + $expectedResponse->setPriority($priority); + $expectedResponse->setRouteStatus($routeStatus); + $expectedResponse->setRouteType($routeType); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $route = 'route108704329'; + $request = (new GetRouteRequest()) + ->setProject($project) + ->setRoute($route); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Routes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRoute(); + $this->assertProtobufEquals($route, $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 + $project = 'project-309310695'; + $route = 'route108704329'; + $request = (new GetRouteRequest()) + ->setProject($project) + ->setRoute($route); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $routeResource = new Route(); + $request = (new InsertRouteRequest()) + ->setProject($project) + ->setRouteResource($routeResource); + $response = $gapicClient->insert($request); + $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.Routes/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRouteResource(); + $this->assertProtobufEquals($routeResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $routeResource = new Route(); + $request = (new InsertRouteRequest()) + ->setProject($project) + ->setRouteResource($routeResource); + $response = $gapicClient->insert($request); + $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 Route(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new RouteList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListRoutesRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.Routes/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListRoutesRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $route = 'route108704329'; + $request = (new DeleteRouteRequest()) + ->setProject($project) + ->setRoute($route); + $response = $gapicClient->delete($request); + $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.Routes/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRoute(); + $this->assertProtobufEquals($route, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SecurityPoliciesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SecurityPoliciesClientTest.php new file mode 100644 index 000000000000..c84b5c88dfa0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SecurityPoliciesClientTest.php @@ -0,0 +1,1399 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SecurityPoliciesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SecurityPoliciesClient($options); + } + + /** @test */ + public function addRuleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyRuleResource = new SecurityPolicyRule(); + $request = (new AddRuleSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyRuleResource($securityPolicyRuleResource); + $response = $gapicClient->addRule($request); + $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.SecurityPolicies/AddRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyRuleResource(); + $this->assertProtobufEquals($securityPolicyRuleResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function addRuleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addRuleExceptionTest'); + $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 + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyRuleResource = new SecurityPolicyRule(); + $request = (new AddRuleSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyRuleResource($securityPolicyRuleResource); + $response = $gapicClient->addRule($request); + $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 aggregatedListTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $items = [ + 'itemsKey' => new SecurityPoliciesScopedList(), + ]; + $expectedResponse = new SecurityPoliciesAggregatedList(); + $expectedResponse->setEtag($etag); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListSecurityPoliciesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.SecurityPolicies/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'; + $request = (new AggregatedListSecurityPoliciesRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $request = (new DeleteSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy); + $response = $gapicClient->delete($request); + $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.SecurityPolicies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $request = (new DeleteSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy); + $response = $gapicClient->delete($request); + $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'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $type = 'type3575610'; + $expectedResponse = new SecurityPolicy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setType($type); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $request = (new GetSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.SecurityPolicies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $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 + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $request = (new GetSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRuleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $action = 'action-1422950858'; + $description = 'description-1724546052'; + $kind = 'kind3292052'; + $preview = true; + $priority2 = 978365527; + $expectedResponse = new SecurityPolicyRule(); + $expectedResponse->setAction($action); + $expectedResponse->setDescription($description); + $expectedResponse->setKind($kind); + $expectedResponse->setPreview($preview); + $expectedResponse->setPriority($priority2); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $request = (new GetRuleSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy); + $response = $gapicClient->getRule($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.SecurityPolicies/GetRule', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRuleExceptionTest() + { + $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'; + $securityPolicy = 'securityPolicy1781695249'; + $request = (new GetRuleSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy); + try { + $gapicClient->getRule($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $securityPolicyResource = new SecurityPolicy(); + $request = (new InsertSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicyResource($securityPolicyResource); + $response = $gapicClient->insert($request); + $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.SecurityPolicies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyResource(); + $this->assertProtobufEquals($securityPolicyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $securityPolicyResource = new SecurityPolicy(); + $request = (new InsertSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicyResource($securityPolicyResource); + $response = $gapicClient->insert($request); + $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 = ''; + $itemsElement = new SecurityPolicy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new SecurityPolicyList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListSecurityPoliciesRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.SecurityPolicies/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListSecurityPoliciesRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listPreconfiguredExpressionSetsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new SecurityPoliciesListPreconfiguredExpressionSetsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListPreconfiguredExpressionSetsSecurityPoliciesRequest()) + ->setProject($project); + $response = $gapicClient->listPreconfiguredExpressionSets($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.SecurityPolicies/ListPreconfiguredExpressionSets', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listPreconfiguredExpressionSetsExceptionTest() + { + $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'; + $request = (new ListPreconfiguredExpressionSetsSecurityPoliciesRequest()) + ->setProject($project); + try { + $gapicClient->listPreconfiguredExpressionSets($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyResource = new SecurityPolicy(); + $request = (new PatchSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyResource($securityPolicyResource); + $response = $gapicClient->patch($request); + $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.SecurityPolicies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyResource(); + $this->assertProtobufEquals($securityPolicyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyResource = new SecurityPolicy(); + $request = (new PatchSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyResource($securityPolicyResource); + $response = $gapicClient->patch($request); + $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 patchRuleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyRuleResource = new SecurityPolicyRule(); + $request = (new PatchRuleSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyRuleResource($securityPolicyRuleResource); + $response = $gapicClient->patchRule($request); + $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.SecurityPolicies/PatchRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyRuleResource(); + $this->assertProtobufEquals($securityPolicyRuleResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchRuleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchRuleExceptionTest'); + $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 + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyRuleResource = new SecurityPolicyRule(); + $request = (new PatchRuleSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyRuleResource($securityPolicyRuleResource); + $response = $gapicClient->patchRule($request); + $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 removeRuleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/removeRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $request = (new RemoveRuleSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy); + $response = $gapicClient->removeRule($request); + $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.SecurityPolicies/RemoveRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function removeRuleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/removeRuleExceptionTest'); + $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 + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $request = (new RemoveRuleSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy); + $response = $gapicClient->removeRule($request); + $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 setLabelsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetLabelsSecurityPolicyRequest()) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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.SecurityPolicies/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getGlobalSetLabelsRequestResource(); + $this->assertProtobufEquals($globalSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setLabelsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsExceptionTest'); + $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 + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetLabelsSecurityPolicyRequest()) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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 addRuleAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addRuleAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addRuleAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyRuleResource = new SecurityPolicyRule(); + $request = (new AddRuleSecurityPolicyRequest()) + ->setProject($project) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyRuleResource($securityPolicyRuleResource); + $response = $gapicClient->addRule($request); + $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.SecurityPolicies/AddRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyRuleResource(); + $this->assertProtobufEquals($securityPolicyRuleResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ServiceAttachmentsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ServiceAttachmentsClientTest.php new file mode 100644 index 000000000000..1c9bc64cc54f --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ServiceAttachmentsClientTest.php @@ -0,0 +1,1021 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ServiceAttachmentsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ServiceAttachmentsClient($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 ServiceAttachmentsScopedList(), + ]; + $expectedResponse = new ServiceAttachmentAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListServiceAttachmentsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.ServiceAttachments/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'; + $request = (new AggregatedListServiceAttachmentsRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $serviceAttachment = 'serviceAttachment-1271655187'; + $request = (new DeleteServiceAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setServiceAttachment($serviceAttachment); + $response = $gapicClient->delete($request); + $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.ServiceAttachments/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getServiceAttachment(); + $this->assertProtobufEquals($serviceAttachment, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $serviceAttachment = 'serviceAttachment-1271655187'; + $request = (new DeleteServiceAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setServiceAttachment($serviceAttachment); + $response = $gapicClient->delete($request); + $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 + $connectionPreference = 'connectionPreference822688988'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $enableProxyProtocol = false; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $producerForwardingRule = 'producerForwardingRule-825813935'; + $reconcileConnections = true; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $targetService = 'targetService-1609318905'; + $expectedResponse = new ServiceAttachment(); + $expectedResponse->setConnectionPreference($connectionPreference); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEnableProxyProtocol($enableProxyProtocol); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setProducerForwardingRule($producerForwardingRule); + $expectedResponse->setReconcileConnections($reconcileConnections); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setTargetService($targetService); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $serviceAttachment = 'serviceAttachment-1271655187'; + $request = (new GetServiceAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setServiceAttachment($serviceAttachment); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.ServiceAttachments/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getServiceAttachment(); + $this->assertProtobufEquals($serviceAttachment, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $serviceAttachment = 'serviceAttachment-1271655187'; + $request = (new GetServiceAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setServiceAttachment($serviceAttachment); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyServiceAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.ServiceAttachments/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicyServiceAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $serviceAttachmentResource = new ServiceAttachment(); + $request = (new InsertServiceAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setServiceAttachmentResource($serviceAttachmentResource); + $response = $gapicClient->insert($request); + $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.ServiceAttachments/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getServiceAttachmentResource(); + $this->assertProtobufEquals($serviceAttachmentResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $serviceAttachmentResource = new ServiceAttachment(); + $request = (new InsertServiceAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setServiceAttachmentResource($serviceAttachmentResource); + $response = $gapicClient->insert($request); + $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 ServiceAttachment(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new ServiceAttachmentList(); + $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'; + $request = (new ListServiceAttachmentsRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.ServiceAttachments/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'; + $request = (new ListServiceAttachmentsRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $serviceAttachment = 'serviceAttachment-1271655187'; + $serviceAttachmentResource = new ServiceAttachment(); + $request = (new PatchServiceAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setServiceAttachment($serviceAttachment) + ->setServiceAttachmentResource($serviceAttachmentResource); + $response = $gapicClient->patch($request); + $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.ServiceAttachments/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getServiceAttachment(); + $this->assertProtobufEquals($serviceAttachment, $actualValue); + $actualValue = $actualApiRequestObject->getServiceAttachmentResource(); + $this->assertProtobufEquals($serviceAttachmentResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $serviceAttachment = 'serviceAttachment-1271655187'; + $serviceAttachmentResource = new ServiceAttachment(); + $request = (new PatchServiceAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setServiceAttachment($serviceAttachment) + ->setServiceAttachmentResource($serviceAttachmentResource); + $response = $gapicClient->patch($request); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $request = (new SetIamPolicyServiceAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.ServiceAttachments/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRegionSetPolicyRequestResource(); + $this->assertProtobufEquals($regionSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $request = (new SetIamPolicyServiceAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsServiceAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.ServiceAttachments/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsServiceAttachmentRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function aggregatedListAsyncTest() + { + $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 ServiceAttachmentsScopedList(), + ]; + $expectedResponse = new ServiceAttachmentAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListServiceAttachmentsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.ServiceAttachments/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SnapshotSettingsServiceClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SnapshotSettingsServiceClientTest.php new file mode 100644 index 000000000000..543fc3fd07c8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SnapshotSettingsServiceClientTest.php @@ -0,0 +1,276 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SnapshotSettingsServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SnapshotSettingsServiceClient($options); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new SnapshotSettings(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new GetSnapshotSettingRequest()) + ->setProject($project); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.SnapshotSettingsService/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $project = 'project-309310695'; + $request = (new GetSnapshotSettingRequest()) + ->setProject($project); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $snapshotSettingsResource = new SnapshotSettings(); + $request = (new PatchSnapshotSettingRequest()) + ->setProject($project) + ->setSnapshotSettingsResource($snapshotSettingsResource); + $response = $gapicClient->patch($request); + $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.SnapshotSettingsService/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSnapshotSettingsResource(); + $this->assertProtobufEquals($snapshotSettingsResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $snapshotSettingsResource = new SnapshotSettings(); + $request = (new PatchSnapshotSettingRequest()) + ->setProject($project) + ->setSnapshotSettingsResource($snapshotSettingsResource); + $response = $gapicClient->patch($request); + $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 getAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new SnapshotSettings(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new GetSnapshotSettingRequest()) + ->setProject($project); + $response = $gapicClient->getAsync($request)->wait(); + $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.SnapshotSettingsService/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SnapshotsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SnapshotsClientTest.php new file mode 100644 index 000000000000..523d4cc185c5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SnapshotsClientTest.php @@ -0,0 +1,938 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SnapshotsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SnapshotsClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $snapshot = 'snapshot284874180'; + $request = (new DeleteSnapshotRequest()) + ->setProject($project) + ->setSnapshot($snapshot); + $response = $gapicClient->delete($request); + $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.Snapshots/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSnapshot(); + $this->assertProtobufEquals($snapshot, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $snapshot = 'snapshot284874180'; + $request = (new DeleteSnapshotRequest()) + ->setProject($project) + ->setSnapshot($snapshot); + $response = $gapicClient->delete($request); + $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 + $architecture = 'architecture839674195'; + $autoCreated = true; + $chainName = 'chainName-2078839479'; + $creationSizeBytes = 1199141901; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $diskSizeGb = 757478089; + $downloadBytes = 971924980; + $enableConfidentialCompute = true; + $id = 3355; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $locationHint = 'locationHint-1796964143'; + $name = 'name3373707'; + $satisfiesPzi = false; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $snapshotType = 'snapshotType1198091477'; + $sourceDisk = 'sourceDisk-85117119'; + $sourceDiskForRecoveryCheckpoint = 'sourceDiskForRecoveryCheckpoint-713903874'; + $sourceDiskId = 'sourceDiskId-1693292839'; + $sourceInstantSnapshot = 'sourceInstantSnapshot-317668858'; + $sourceInstantSnapshotId = 'sourceInstantSnapshotId-1859900940'; + $sourceSnapshotSchedulePolicy = 'sourceSnapshotSchedulePolicy-837985533'; + $sourceSnapshotSchedulePolicyId = 'sourceSnapshotSchedulePolicyId-2076994601'; + $status = 'status-892481550'; + $storageBytes = 2035244455; + $storageBytesStatus = 'storageBytesStatus1027609994'; + $expectedResponse = new Snapshot(); + $expectedResponse->setArchitecture($architecture); + $expectedResponse->setAutoCreated($autoCreated); + $expectedResponse->setChainName($chainName); + $expectedResponse->setCreationSizeBytes($creationSizeBytes); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDiskSizeGb($diskSizeGb); + $expectedResponse->setDownloadBytes($downloadBytes); + $expectedResponse->setEnableConfidentialCompute($enableConfidentialCompute); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setLocationHint($locationHint); + $expectedResponse->setName($name); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSnapshotType($snapshotType); + $expectedResponse->setSourceDisk($sourceDisk); + $expectedResponse->setSourceDiskForRecoveryCheckpoint($sourceDiskForRecoveryCheckpoint); + $expectedResponse->setSourceDiskId($sourceDiskId); + $expectedResponse->setSourceInstantSnapshot($sourceInstantSnapshot); + $expectedResponse->setSourceInstantSnapshotId($sourceInstantSnapshotId); + $expectedResponse->setSourceSnapshotSchedulePolicy($sourceSnapshotSchedulePolicy); + $expectedResponse->setSourceSnapshotSchedulePolicyId($sourceSnapshotSchedulePolicyId); + $expectedResponse->setStatus($status); + $expectedResponse->setStorageBytes($storageBytes); + $expectedResponse->setStorageBytesStatus($storageBytesStatus); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $snapshot = 'snapshot284874180'; + $request = (new GetSnapshotRequest()) + ->setProject($project) + ->setSnapshot($snapshot); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Snapshots/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getSnapshot(); + $this->assertProtobufEquals($snapshot, $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 + $project = 'project-309310695'; + $snapshot = 'snapshot284874180'; + $request = (new GetSnapshotRequest()) + ->setProject($project) + ->setSnapshot($snapshot); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicySnapshotRequest()) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Snapshots/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicySnapshotRequest()) + ->setProject($project) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $snapshotResource = new Snapshot(); + $request = (new InsertSnapshotRequest()) + ->setProject($project) + ->setSnapshotResource($snapshotResource); + $response = $gapicClient->insert($request); + $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.Snapshots/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSnapshotResource(); + $this->assertProtobufEquals($snapshotResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $snapshotResource = new Snapshot(); + $request = (new InsertSnapshotRequest()) + ->setProject($project) + ->setSnapshotResource($snapshotResource); + $response = $gapicClient->insert($request); + $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 Snapshot(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new SnapshotList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListSnapshotsRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.Snapshots/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListSnapshotsRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetIamPolicySnapshotRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Snapshots/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getGlobalSetPolicyRequestResource(); + $this->assertProtobufEquals($globalSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetIamPolicySnapshotRequest()) + ->setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setLabelsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetLabelsSnapshotRequest()) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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.Snapshots/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getGlobalSetLabelsRequestResource(); + $this->assertProtobufEquals($globalSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setLabelsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsExceptionTest'); + $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 + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $request = (new SetLabelsSnapshotRequest()) + ->setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsSnapshotRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Snapshots/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsSnapshotRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $snapshot = 'snapshot284874180'; + $request = (new DeleteSnapshotRequest()) + ->setProject($project) + ->setSnapshot($snapshot); + $response = $gapicClient->delete($request); + $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.Snapshots/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSnapshot(); + $this->assertProtobufEquals($snapshot, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SslCertificatesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SslCertificatesClientTest.php new file mode 100644 index 000000000000..2b7222ab4c3b --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SslCertificatesClientTest.php @@ -0,0 +1,604 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SslCertificatesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SslCertificatesClient($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 SslCertificatesScopedList(), + ]; + $expectedResponse = new SslCertificateAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListSslCertificatesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.SslCertificates/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'; + $request = (new AggregatedListSslCertificatesRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $sslCertificate = 'sslCertificate-1027298332'; + $request = (new DeleteSslCertificateRequest()) + ->setProject($project) + ->setSslCertificate($sslCertificate); + $response = $gapicClient->delete($request); + $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.SslCertificates/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSslCertificate(); + $this->assertProtobufEquals($sslCertificate, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $sslCertificate = 'sslCertificate-1027298332'; + $request = (new DeleteSslCertificateRequest()) + ->setProject($project) + ->setSslCertificate($sslCertificate); + $response = $gapicClient->delete($request); + $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 + $certificate = 'certificate1952399767'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $expireTime = 'expireTime-96179731'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $privateKey = 'privateKey1971943843'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $type = 'type3575610'; + $expectedResponse = new SslCertificate(); + $expectedResponse->setCertificate($certificate); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setExpireTime($expireTime); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setPrivateKey($privateKey); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setType($type); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $sslCertificate = 'sslCertificate-1027298332'; + $request = (new GetSslCertificateRequest()) + ->setProject($project) + ->setSslCertificate($sslCertificate); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.SslCertificates/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getSslCertificate(); + $this->assertProtobufEquals($sslCertificate, $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 + $project = 'project-309310695'; + $sslCertificate = 'sslCertificate-1027298332'; + $request = (new GetSslCertificateRequest()) + ->setProject($project) + ->setSslCertificate($sslCertificate); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $sslCertificateResource = new SslCertificate(); + $request = (new InsertSslCertificateRequest()) + ->setProject($project) + ->setSslCertificateResource($sslCertificateResource); + $response = $gapicClient->insert($request); + $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.SslCertificates/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSslCertificateResource(); + $this->assertProtobufEquals($sslCertificateResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $sslCertificateResource = new SslCertificate(); + $request = (new InsertSslCertificateRequest()) + ->setProject($project) + ->setSslCertificateResource($sslCertificateResource); + $response = $gapicClient->insert($request); + $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 SslCertificate(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new SslCertificateList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListSslCertificatesRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.SslCertificates/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListSslCertificatesRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function aggregatedListAsyncTest() + { + $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 SslCertificatesScopedList(), + ]; + $expectedResponse = new SslCertificateAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListSslCertificatesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.SslCertificates/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SslPoliciesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SslPoliciesClientTest.php new file mode 100644 index 000000000000..15a95aa4b08e --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SslPoliciesClientTest.php @@ -0,0 +1,797 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SslPoliciesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SslPoliciesClient($options); + } + + /** @test */ + public function aggregatedListTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $items = [ + 'itemsKey' => new SslPoliciesScopedList(), + ]; + $expectedResponse = new SslPoliciesAggregatedList(); + $expectedResponse->setEtag($etag); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListSslPoliciesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.SslPolicies/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'; + $request = (new AggregatedListSslPoliciesRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $sslPolicy = 'sslPolicy-1852293435'; + $request = (new DeleteSslPolicyRequest()) + ->setProject($project) + ->setSslPolicy($sslPolicy); + $response = $gapicClient->delete($request); + $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.SslPolicies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSslPolicy(); + $this->assertProtobufEquals($sslPolicy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $sslPolicy = 'sslPolicy-1852293435'; + $request = (new DeleteSslPolicyRequest()) + ->setProject($project) + ->setSslPolicy($sslPolicy); + $response = $gapicClient->delete($request); + $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'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $minTlsVersion = 'minTlsVersion8155943'; + $name = 'name3373707'; + $profile = 'profile-309425751'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new SslPolicy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setMinTlsVersion($minTlsVersion); + $expectedResponse->setName($name); + $expectedResponse->setProfile($profile); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $sslPolicy = 'sslPolicy-1852293435'; + $request = (new GetSslPolicyRequest()) + ->setProject($project) + ->setSslPolicy($sslPolicy); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.SslPolicies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getSslPolicy(); + $this->assertProtobufEquals($sslPolicy, $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 + $project = 'project-309310695'; + $sslPolicy = 'sslPolicy-1852293435'; + $request = (new GetSslPolicyRequest()) + ->setProject($project) + ->setSslPolicy($sslPolicy); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $sslPolicyResource = new SslPolicy(); + $request = (new InsertSslPolicyRequest()) + ->setProject($project) + ->setSslPolicyResource($sslPolicyResource); + $response = $gapicClient->insert($request); + $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.SslPolicies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSslPolicyResource(); + $this->assertProtobufEquals($sslPolicyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $sslPolicyResource = new SslPolicy(); + $request = (new InsertSslPolicyRequest()) + ->setProject($project) + ->setSslPolicyResource($sslPolicyResource); + $response = $gapicClient->insert($request); + $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 SslPolicy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new SslPoliciesList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListSslPoliciesRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.SslPolicies/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListSslPoliciesRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAvailableFeaturesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new SslPoliciesListAvailableFeaturesResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListAvailableFeaturesSslPoliciesRequest()) + ->setProject($project); + $response = $gapicClient->listAvailableFeatures($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.SslPolicies/ListAvailableFeatures', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAvailableFeaturesExceptionTest() + { + $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'; + $request = (new ListAvailableFeaturesSslPoliciesRequest()) + ->setProject($project); + try { + $gapicClient->listAvailableFeatures($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $sslPolicy = 'sslPolicy-1852293435'; + $sslPolicyResource = new SslPolicy(); + $request = (new PatchSslPolicyRequest()) + ->setProject($project) + ->setSslPolicy($sslPolicy) + ->setSslPolicyResource($sslPolicyResource); + $response = $gapicClient->patch($request); + $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.SslPolicies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSslPolicy(); + $this->assertProtobufEquals($sslPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getSslPolicyResource(); + $this->assertProtobufEquals($sslPolicyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $sslPolicy = 'sslPolicy-1852293435'; + $sslPolicyResource = new SslPolicy(); + $request = (new PatchSslPolicyRequest()) + ->setProject($project) + ->setSslPolicy($sslPolicy) + ->setSslPolicyResource($sslPolicyResource); + $response = $gapicClient->patch($request); + $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 aggregatedListAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $items = [ + 'itemsKey' => new SslPoliciesScopedList(), + ]; + $expectedResponse = new SslPoliciesAggregatedList(); + $expectedResponse->setEtag($etag); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListSslPoliciesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.SslPolicies/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/StoragePoolTypesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/StoragePoolTypesClientTest.php new file mode 100644 index 000000000000..e7cbf948e063 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/StoragePoolTypesClientTest.php @@ -0,0 +1,378 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return StoragePoolTypesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new StoragePoolTypesClient($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 StoragePoolTypesScopedList(), + ]; + $expectedResponse = new StoragePoolTypeAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListStoragePoolTypesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.StoragePoolTypes/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'; + $request = (new AggregatedListStoragePoolTypesRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $maxPoolProvisionedCapacityGb = 1255880909; + $maxPoolProvisionedIops = 1095342084; + $maxPoolProvisionedThroughput = 1302669885; + $minPoolProvisionedCapacityGb = 345848161; + $minPoolProvisionedIops = 1194139030; + $minPoolProvisionedThroughput = 1242850773; + $minSizeGb = 1459020012; + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new StoragePoolType(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setMaxPoolProvisionedCapacityGb($maxPoolProvisionedCapacityGb); + $expectedResponse->setMaxPoolProvisionedIops($maxPoolProvisionedIops); + $expectedResponse->setMaxPoolProvisionedThroughput($maxPoolProvisionedThroughput); + $expectedResponse->setMinPoolProvisionedCapacityGb($minPoolProvisionedCapacityGb); + $expectedResponse->setMinPoolProvisionedIops($minPoolProvisionedIops); + $expectedResponse->setMinPoolProvisionedThroughput($minPoolProvisionedThroughput); + $expectedResponse->setMinSizeGb($minSizeGb); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $storagePoolType = 'storagePoolType1896612025'; + $zone = 'zone3744684'; + $request = (new GetStoragePoolTypeRequest()) + ->setProject($project) + ->setStoragePoolType($storagePoolType) + ->setZone($zone); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.StoragePoolTypes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getStoragePoolType(); + $this->assertProtobufEquals($storagePoolType, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $project = 'project-309310695'; + $storagePoolType = 'storagePoolType1896612025'; + $zone = 'zone3744684'; + $request = (new GetStoragePoolTypeRequest()) + ->setProject($project) + ->setStoragePoolType($storagePoolType) + ->setZone($zone); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 StoragePoolType(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new StoragePoolTypeList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListStoragePoolTypesRequest()) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->list($request); + $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.StoragePoolTypes/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + $request = (new ListStoragePoolTypesRequest()) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function aggregatedListAsyncTest() + { + $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 StoragePoolTypesScopedList(), + ]; + $expectedResponse = new StoragePoolTypeAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListStoragePoolTypesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.StoragePoolTypes/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/StoragePoolsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/StoragePoolsClientTest.php new file mode 100644 index 000000000000..dab8524a3603 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/StoragePoolsClientTest.php @@ -0,0 +1,1111 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return StoragePoolsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new StoragePoolsClient($options); + } + + /** @test */ + public function aggregatedListTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $items = [ + 'itemsKey' => new StoragePoolsScopedList(), + ]; + $expectedResponse = new StoragePoolAggregatedList(); + $expectedResponse->setEtag($etag); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListStoragePoolsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.StoragePools/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'; + $request = (new AggregatedListStoragePoolsRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTest() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $storagePool = 'storagePool897344352'; + $zone = 'zone3744684'; + $request = (new DeleteStoragePoolRequest()) + ->setProject($project) + ->setStoragePool($storagePool) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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.StoragePools/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getStoragePool(); + $this->assertProtobufEquals($storagePool, $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 deleteExceptionTest() + { + $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/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 + $project = 'project-309310695'; + $storagePool = 'storagePool897344352'; + $zone = 'zone3744684'; + $request = (new DeleteStoragePoolRequest()) + ->setProject($project) + ->setStoragePool($storagePool) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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 + $capacityProvisioningType = 'capacityProvisioningType1325352199'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $performanceProvisioningType = 'performanceProvisioningType1542295293'; + $poolProvisionedCapacityGb = 1132075054; + $poolProvisionedIops = 1185834135; + $poolProvisionedThroughput = 1779828376; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $state = 'state109757585'; + $storagePoolType = 'storagePoolType1896612025'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new StoragePool(); + $expectedResponse->setCapacityProvisioningType($capacityProvisioningType); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setPerformanceProvisioningType($performanceProvisioningType); + $expectedResponse->setPoolProvisionedCapacityGb($poolProvisionedCapacityGb); + $expectedResponse->setPoolProvisionedIops($poolProvisionedIops); + $expectedResponse->setPoolProvisionedThroughput($poolProvisionedThroughput); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $expectedResponse->setState($state); + $expectedResponse->setStoragePoolType($storagePoolType); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $storagePool = 'storagePool897344352'; + $zone = 'zone3744684'; + $request = (new GetStoragePoolRequest()) + ->setProject($project) + ->setStoragePool($storagePool) + ->setZone($zone); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.StoragePools/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getStoragePool(); + $this->assertProtobufEquals($storagePool, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $project = 'project-309310695'; + $storagePool = 'storagePool897344352'; + $zone = 'zone3744684'; + $request = (new GetStoragePoolRequest()) + ->setProject($project) + ->setStoragePool($storagePool) + ->setZone($zone); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $request = (new GetIamPolicyStoragePoolRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.StoragePools/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $request = (new GetIamPolicyStoragePoolRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $storagePoolResource = new StoragePool(); + $zone = 'zone3744684'; + $request = (new InsertStoragePoolRequest()) + ->setProject($project) + ->setStoragePoolResource($storagePoolResource) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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.StoragePools/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getStoragePoolResource(); + $this->assertProtobufEquals($storagePoolResource, $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 insertExceptionTest() + { + $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/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 + $project = 'project-309310695'; + $storagePoolResource = new StoragePool(); + $zone = 'zone3744684'; + $request = (new InsertStoragePoolRequest()) + ->setProject($project) + ->setStoragePoolResource($storagePoolResource) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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 + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = 'nextPageToken-1530815211'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new StoragePoolList(); + $expectedResponse->setEtag($etag); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListStoragePoolsRequest()) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->list($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.StoragePools/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + $request = (new ListStoragePoolsRequest()) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDisksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = 'nextPageToken-1530815211'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new StoragePoolListDisks(); + $expectedResponse->setEtag($etag); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $storagePool = 'storagePool897344352'; + $zone = 'zone3744684'; + $request = (new ListDisksStoragePoolsRequest()) + ->setProject($project) + ->setStoragePool($storagePool) + ->setZone($zone); + $response = $gapicClient->listDisks($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.StoragePools/ListDisks', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getStoragePool(); + $this->assertProtobufEquals($storagePool, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDisksExceptionTest() + { + $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'; + $storagePool = 'storagePool897344352'; + $zone = 'zone3744684'; + $request = (new ListDisksStoragePoolsRequest()) + ->setProject($project) + ->setStoragePool($storagePool) + ->setZone($zone); + try { + $gapicClient->listDisks($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $request = (new SetIamPolicyStoragePoolRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.StoragePools/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $actualValue = $actualRequestObject->getZoneSetPolicyRequestResource(); + $this->assertProtobufEquals($zoneSetPolicyRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $request = (new SetIamPolicyStoragePoolRequest()) + ->setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + $request = (new TestIamPermissionsStoragePoolRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.StoragePools/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + $request = (new TestIamPermissionsStoragePoolRequest()) + ->setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $storagePool = 'storagePool897344352'; + $storagePoolResource = new StoragePool(); + $zone = 'zone3744684'; + $request = (new UpdateStoragePoolRequest()) + ->setProject($project) + ->setStoragePool($storagePool) + ->setStoragePoolResource($storagePoolResource) + ->setZone($zone); + $response = $gapicClient->update($request); + $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.StoragePools/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getStoragePool(); + $this->assertProtobufEquals($storagePool, $actualValue); + $actualValue = $actualApiRequestObject->getStoragePoolResource(); + $this->assertProtobufEquals($storagePoolResource, $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 + $project = 'project-309310695'; + $storagePool = 'storagePool897344352'; + $storagePoolResource = new StoragePool(); + $zone = 'zone3744684'; + $request = (new UpdateStoragePoolRequest()) + ->setProject($project) + ->setStoragePool($storagePool) + ->setStoragePoolResource($storagePoolResource) + ->setZone($zone); + $response = $gapicClient->update($request); + $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 aggregatedListAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $items = [ + 'itemsKey' => new StoragePoolsScopedList(), + ]; + $expectedResponse = new StoragePoolAggregatedList(); + $expectedResponse->setEtag($etag); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListStoragePoolsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.StoragePools/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SubnetworksClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SubnetworksClientTest.php new file mode 100644 index 000000000000..284ebec98ccf --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/SubnetworksClientTest.php @@ -0,0 +1,1392 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SubnetworksClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SubnetworksClient($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 SubnetworksScopedList(), + ]; + $expectedResponse = new SubnetworkAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListSubnetworksRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.Subnetworks/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'; + $request = (new AggregatedListSubnetworksRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetwork = 'subnetwork-1302785042'; + $request = (new DeleteSubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork); + $response = $gapicClient->delete($request); + $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.Subnetworks/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSubnetwork(); + $this->assertProtobufEquals($subnetwork, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetwork = 'subnetwork-1302785042'; + $request = (new DeleteSubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork); + $response = $gapicClient->delete($request); + $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 expandIpCidrRangeTest() + { + $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/expandIpCidrRangeTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/expandIpCidrRangeTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetwork = 'subnetwork-1302785042'; + $subnetworksExpandIpCidrRangeRequestResource = new SubnetworksExpandIpCidrRangeRequest(); + $request = (new ExpandIpCidrRangeSubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork) + ->setSubnetworksExpandIpCidrRangeRequestResource($subnetworksExpandIpCidrRangeRequestResource); + $response = $gapicClient->expandIpCidrRange($request); + $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.Subnetworks/ExpandIpCidrRange', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSubnetwork(); + $this->assertProtobufEquals($subnetwork, $actualValue); + $actualValue = $actualApiRequestObject->getSubnetworksExpandIpCidrRangeRequestResource(); + $this->assertProtobufEquals($subnetworksExpandIpCidrRangeRequestResource, $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 expandIpCidrRangeExceptionTest() + { + $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/expandIpCidrRangeExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetwork = 'subnetwork-1302785042'; + $subnetworksExpandIpCidrRangeRequestResource = new SubnetworksExpandIpCidrRangeRequest(); + $request = (new ExpandIpCidrRangeSubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork) + ->setSubnetworksExpandIpCidrRangeRequestResource($subnetworksExpandIpCidrRangeRequestResource); + $response = $gapicClient->expandIpCidrRange($request); + $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'; + $enableFlowLogs = true; + $externalIpv6Prefix = 'externalIpv6Prefix1749911926'; + $fingerprint = 'fingerprint-1375934236'; + $gatewayAddress = 'gatewayAddress-77003527'; + $id = 3355; + $internalIpv6Prefix = 'internalIpv6Prefix-30600856'; + $ipCidrRange = 'ipCidrRange-2049366326'; + $ipv6AccessType = 'ipv6AccessType-569083171'; + $ipv6CidrRange = 'ipv6CidrRange-1874342390'; + $kind = 'kind3292052'; + $name = 'name3373707'; + $network = 'network1843485230'; + $privateIpGoogleAccess = true; + $privateIpv6GoogleAccess = 'privateIpv6GoogleAccess1122018830'; + $purpose = 'purpose-220463842'; + $region2 = 'region2-690338393'; + $reservedInternalRange = 'reservedInternalRange-787493070'; + $role = 'role3506294'; + $selfLink = 'selfLink-1691268851'; + $stackType = 'stackType2036521617'; + $state = 'state109757585'; + $expectedResponse = new Subnetwork(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEnableFlowLogs($enableFlowLogs); + $expectedResponse->setExternalIpv6Prefix($externalIpv6Prefix); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setGatewayAddress($gatewayAddress); + $expectedResponse->setId($id); + $expectedResponse->setInternalIpv6Prefix($internalIpv6Prefix); + $expectedResponse->setIpCidrRange($ipCidrRange); + $expectedResponse->setIpv6AccessType($ipv6AccessType); + $expectedResponse->setIpv6CidrRange($ipv6CidrRange); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setPrivateIpGoogleAccess($privateIpGoogleAccess); + $expectedResponse->setPrivateIpv6GoogleAccess($privateIpv6GoogleAccess); + $expectedResponse->setPurpose($purpose); + $expectedResponse->setRegion($region2); + $expectedResponse->setReservedInternalRange($reservedInternalRange); + $expectedResponse->setRole($role); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStackType($stackType); + $expectedResponse->setState($state); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetwork = 'subnetwork-1302785042'; + $request = (new GetSubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Subnetworks/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getSubnetwork(); + $this->assertProtobufEquals($subnetwork, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetwork = 'subnetwork-1302785042'; + $request = (new GetSubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicySubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + $response = $gapicClient->getIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Subnetworks/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $request = (new GetIamPolicySubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource); + try { + $gapicClient->getIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetworkResource = new Subnetwork(); + $request = (new InsertSubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setSubnetworkResource($subnetworkResource); + $response = $gapicClient->insert($request); + $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.Subnetworks/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSubnetworkResource(); + $this->assertProtobufEquals($subnetworkResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetworkResource = new Subnetwork(); + $request = (new InsertSubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setSubnetworkResource($subnetworkResource); + $response = $gapicClient->insert($request); + $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 Subnetwork(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new SubnetworkList(); + $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'; + $request = (new ListSubnetworksRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.Subnetworks/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'; + $request = (new ListSubnetworksRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listUsableTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new UsableSubnetwork(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new UsableSubnetworksAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListUsableSubnetworksRequest()) + ->setProject($project); + $response = $gapicClient->listUsable($request); + $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.Subnetworks/ListUsable', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listUsableExceptionTest() + { + $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'; + $request = (new ListUsableSubnetworksRequest()) + ->setProject($project); + try { + $gapicClient->listUsable($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetwork = 'subnetwork-1302785042'; + $subnetworkResource = new Subnetwork(); + $request = (new PatchSubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork) + ->setSubnetworkResource($subnetworkResource); + $response = $gapicClient->patch($request); + $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.Subnetworks/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSubnetwork(); + $this->assertProtobufEquals($subnetwork, $actualValue); + $actualValue = $actualApiRequestObject->getSubnetworkResource(); + $this->assertProtobufEquals($subnetworkResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetwork = 'subnetwork-1302785042'; + $subnetworkResource = new Subnetwork(); + $request = (new PatchSubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork) + ->setSubnetworkResource($subnetworkResource); + $response = $gapicClient->patch($request); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $request = (new SetIamPolicySubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + $response = $gapicClient->setIamPolicy($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Subnetworks/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRegionSetPolicyRequestResource(); + $this->assertProtobufEquals($regionSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $request = (new SetIamPolicySubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + try { + $gapicClient->setIamPolicy($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setPrivateIpGoogleAccessTest() + { + $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/setPrivateIpGoogleAccessTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setPrivateIpGoogleAccessTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetwork = 'subnetwork-1302785042'; + $subnetworksSetPrivateIpGoogleAccessRequestResource = new SubnetworksSetPrivateIpGoogleAccessRequest(); + $request = (new SetPrivateIpGoogleAccessSubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork) + ->setSubnetworksSetPrivateIpGoogleAccessRequestResource($subnetworksSetPrivateIpGoogleAccessRequestResource); + $response = $gapicClient->setPrivateIpGoogleAccess($request); + $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.Subnetworks/SetPrivateIpGoogleAccess', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSubnetwork(); + $this->assertProtobufEquals($subnetwork, $actualValue); + $actualValue = $actualApiRequestObject->getSubnetworksSetPrivateIpGoogleAccessRequestResource(); + $this->assertProtobufEquals($subnetworksSetPrivateIpGoogleAccessRequestResource, $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 setPrivateIpGoogleAccessExceptionTest() + { + $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/setPrivateIpGoogleAccessExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetwork = 'subnetwork-1302785042'; + $subnetworksSetPrivateIpGoogleAccessRequestResource = new SubnetworksSetPrivateIpGoogleAccessRequest(); + $request = (new SetPrivateIpGoogleAccessSubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork) + ->setSubnetworksSetPrivateIpGoogleAccessRequestResource($subnetworksSetPrivateIpGoogleAccessRequestResource); + $response = $gapicClient->setPrivateIpGoogleAccess($request); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsSubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Subnetworks/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsSubnetworkRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function aggregatedListAsyncTest() + { + $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 SubnetworksScopedList(), + ]; + $expectedResponse = new SubnetworkAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListSubnetworksRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.Subnetworks/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetGrpcProxiesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetGrpcProxiesClientTest.php new file mode 100644 index 000000000000..ebc7d71544cb --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetGrpcProxiesClientTest.php @@ -0,0 +1,666 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TargetGrpcProxiesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TargetGrpcProxiesClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetGrpcProxy = 'targetGrpcProxy-1605592453'; + $request = (new DeleteTargetGrpcProxyRequest()) + ->setProject($project) + ->setTargetGrpcProxy($targetGrpcProxy); + $response = $gapicClient->delete($request); + $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.TargetGrpcProxies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetGrpcProxy(); + $this->assertProtobufEquals($targetGrpcProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetGrpcProxy = 'targetGrpcProxy-1605592453'; + $request = (new DeleteTargetGrpcProxyRequest()) + ->setProject($project) + ->setTargetGrpcProxy($targetGrpcProxy); + $response = $gapicClient->delete($request); + $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'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $urlMap = 'urlMap-169850228'; + $validateForProxyless = true; + $expectedResponse = new TargetGrpcProxy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $expectedResponse->setUrlMap($urlMap); + $expectedResponse->setValidateForProxyless($validateForProxyless); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $targetGrpcProxy = 'targetGrpcProxy-1605592453'; + $request = (new GetTargetGrpcProxyRequest()) + ->setProject($project) + ->setTargetGrpcProxy($targetGrpcProxy); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.TargetGrpcProxies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getTargetGrpcProxy(); + $this->assertProtobufEquals($targetGrpcProxy, $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 + $project = 'project-309310695'; + $targetGrpcProxy = 'targetGrpcProxy-1605592453'; + $request = (new GetTargetGrpcProxyRequest()) + ->setProject($project) + ->setTargetGrpcProxy($targetGrpcProxy); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetGrpcProxyResource = new TargetGrpcProxy(); + $request = (new InsertTargetGrpcProxyRequest()) + ->setProject($project) + ->setTargetGrpcProxyResource($targetGrpcProxyResource); + $response = $gapicClient->insert($request); + $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.TargetGrpcProxies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetGrpcProxyResource(); + $this->assertProtobufEquals($targetGrpcProxyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetGrpcProxyResource = new TargetGrpcProxy(); + $request = (new InsertTargetGrpcProxyRequest()) + ->setProject($project) + ->setTargetGrpcProxyResource($targetGrpcProxyResource); + $response = $gapicClient->insert($request); + $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 TargetGrpcProxy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new TargetGrpcProxyList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListTargetGrpcProxiesRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.TargetGrpcProxies/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListTargetGrpcProxiesRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetGrpcProxy = 'targetGrpcProxy-1605592453'; + $targetGrpcProxyResource = new TargetGrpcProxy(); + $request = (new PatchTargetGrpcProxyRequest()) + ->setProject($project) + ->setTargetGrpcProxy($targetGrpcProxy) + ->setTargetGrpcProxyResource($targetGrpcProxyResource); + $response = $gapicClient->patch($request); + $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.TargetGrpcProxies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetGrpcProxy(); + $this->assertProtobufEquals($targetGrpcProxy, $actualValue); + $actualValue = $actualApiRequestObject->getTargetGrpcProxyResource(); + $this->assertProtobufEquals($targetGrpcProxyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $targetGrpcProxy = 'targetGrpcProxy-1605592453'; + $targetGrpcProxyResource = new TargetGrpcProxy(); + $request = (new PatchTargetGrpcProxyRequest()) + ->setProject($project) + ->setTargetGrpcProxy($targetGrpcProxy) + ->setTargetGrpcProxyResource($targetGrpcProxyResource); + $response = $gapicClient->patch($request); + $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 deleteAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetGrpcProxy = 'targetGrpcProxy-1605592453'; + $request = (new DeleteTargetGrpcProxyRequest()) + ->setProject($project) + ->setTargetGrpcProxy($targetGrpcProxy); + $response = $gapicClient->delete($request); + $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.TargetGrpcProxies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetGrpcProxy(); + $this->assertProtobufEquals($targetGrpcProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetHttpProxiesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetHttpProxiesClientTest.php new file mode 100644 index 000000000000..f3f5e70b15ea --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetHttpProxiesClientTest.php @@ -0,0 +1,859 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TargetHttpProxiesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TargetHttpProxiesClient($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 TargetHttpProxiesScopedList(), + ]; + $expectedResponse = new TargetHttpProxyAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListTargetHttpProxiesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.TargetHttpProxies/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'; + $request = (new AggregatedListTargetHttpProxiesRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $request = (new DeleteTargetHttpProxyRequest()) + ->setProject($project) + ->setTargetHttpProxy($targetHttpProxy); + $response = $gapicClient->delete($request); + $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.TargetHttpProxies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpProxy(); + $this->assertProtobufEquals($targetHttpProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $request = (new DeleteTargetHttpProxyRequest()) + ->setProject($project) + ->setTargetHttpProxy($targetHttpProxy); + $response = $gapicClient->delete($request); + $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'; + $fingerprint = 'fingerprint-1375934236'; + $httpKeepAliveTimeoutSec = 2057938782; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $proxyBind = true; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $urlMap = 'urlMap-169850228'; + $expectedResponse = new TargetHttpProxy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setHttpKeepAliveTimeoutSec($httpKeepAliveTimeoutSec); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setProxyBind($proxyBind); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setUrlMap($urlMap); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $request = (new GetTargetHttpProxyRequest()) + ->setProject($project) + ->setTargetHttpProxy($targetHttpProxy); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.TargetHttpProxies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getTargetHttpProxy(); + $this->assertProtobufEquals($targetHttpProxy, $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 + $project = 'project-309310695'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $request = (new GetTargetHttpProxyRequest()) + ->setProject($project) + ->setTargetHttpProxy($targetHttpProxy); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetHttpProxyResource = new TargetHttpProxy(); + $request = (new InsertTargetHttpProxyRequest()) + ->setProject($project) + ->setTargetHttpProxyResource($targetHttpProxyResource); + $response = $gapicClient->insert($request); + $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.TargetHttpProxies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpProxyResource(); + $this->assertProtobufEquals($targetHttpProxyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetHttpProxyResource = new TargetHttpProxy(); + $request = (new InsertTargetHttpProxyRequest()) + ->setProject($project) + ->setTargetHttpProxyResource($targetHttpProxyResource); + $response = $gapicClient->insert($request); + $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 TargetHttpProxy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new TargetHttpProxyList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListTargetHttpProxiesRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.TargetHttpProxies/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListTargetHttpProxiesRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $targetHttpProxyResource = new TargetHttpProxy(); + $request = (new PatchTargetHttpProxyRequest()) + ->setProject($project) + ->setTargetHttpProxy($targetHttpProxy) + ->setTargetHttpProxyResource($targetHttpProxyResource); + $response = $gapicClient->patch($request); + $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.TargetHttpProxies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpProxy(); + $this->assertProtobufEquals($targetHttpProxy, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpProxyResource(); + $this->assertProtobufEquals($targetHttpProxyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $targetHttpProxyResource = new TargetHttpProxy(); + $request = (new PatchTargetHttpProxyRequest()) + ->setProject($project) + ->setTargetHttpProxy($targetHttpProxy) + ->setTargetHttpProxyResource($targetHttpProxyResource); + $response = $gapicClient->patch($request); + $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 setUrlMapTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setUrlMapTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setUrlMapTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $urlMapReferenceResource = new UrlMapReference(); + $request = (new SetUrlMapTargetHttpProxyRequest()) + ->setProject($project) + ->setTargetHttpProxy($targetHttpProxy) + ->setUrlMapReferenceResource($urlMapReferenceResource); + $response = $gapicClient->setUrlMap($request); + $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.TargetHttpProxies/SetUrlMap', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpProxy(); + $this->assertProtobufEquals($targetHttpProxy, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMapReferenceResource(); + $this->assertProtobufEquals($urlMapReferenceResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setUrlMapExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setUrlMapExceptionTest'); + $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 + $project = 'project-309310695'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $urlMapReferenceResource = new UrlMapReference(); + $request = (new SetUrlMapTargetHttpProxyRequest()) + ->setProject($project) + ->setTargetHttpProxy($targetHttpProxy) + ->setUrlMapReferenceResource($urlMapReferenceResource); + $response = $gapicClient->setUrlMap($request); + $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 aggregatedListAsyncTest() + { + $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 TargetHttpProxiesScopedList(), + ]; + $expectedResponse = new TargetHttpProxyAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListTargetHttpProxiesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.TargetHttpProxies/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetHttpsProxiesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetHttpsProxiesClientTest.php new file mode 100644 index 000000000000..064933b3bb2b --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetHttpsProxiesClientTest.php @@ -0,0 +1,1381 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TargetHttpsProxiesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TargetHttpsProxiesClient($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 TargetHttpsProxiesScopedList(), + ]; + $expectedResponse = new TargetHttpsProxyAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListTargetHttpsProxiesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.TargetHttpsProxies/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'; + $request = (new AggregatedListTargetHttpsProxiesRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $request = (new DeleteTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy); + $response = $gapicClient->delete($request); + $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.TargetHttpsProxies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $request = (new DeleteTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy); + $response = $gapicClient->delete($request); + $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 + $authorizationPolicy = 'authorizationPolicy-1576667208'; + $certificateMap = 'certificateMap-917278028'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $httpKeepAliveTimeoutSec = 2057938782; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $proxyBind = true; + $quicOverride = 'quicOverride2067189933'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $serverTlsPolicy = 'serverTlsPolicy1906438002'; + $sslPolicy = 'sslPolicy-1852293435'; + $urlMap = 'urlMap-169850228'; + $expectedResponse = new TargetHttpsProxy(); + $expectedResponse->setAuthorizationPolicy($authorizationPolicy); + $expectedResponse->setCertificateMap($certificateMap); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setHttpKeepAliveTimeoutSec($httpKeepAliveTimeoutSec); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setProxyBind($proxyBind); + $expectedResponse->setQuicOverride($quicOverride); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setServerTlsPolicy($serverTlsPolicy); + $expectedResponse->setSslPolicy($sslPolicy); + $expectedResponse->setUrlMap($urlMap); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $request = (new GetTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.TargetHttpsProxies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $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 + $project = 'project-309310695'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $request = (new GetTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetHttpsProxyResource = new TargetHttpsProxy(); + $request = (new InsertTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxyResource($targetHttpsProxyResource); + $response = $gapicClient->insert($request); + $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.TargetHttpsProxies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxyResource(); + $this->assertProtobufEquals($targetHttpsProxyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetHttpsProxyResource = new TargetHttpsProxy(); + $request = (new InsertTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxyResource($targetHttpsProxyResource); + $response = $gapicClient->insert($request); + $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 TargetHttpsProxy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new TargetHttpsProxyList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListTargetHttpsProxiesRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.TargetHttpsProxies/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListTargetHttpsProxiesRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $targetHttpsProxyResource = new TargetHttpsProxy(); + $request = (new PatchTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setTargetHttpsProxyResource($targetHttpsProxyResource); + $response = $gapicClient->patch($request); + $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.TargetHttpsProxies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxyResource(); + $this->assertProtobufEquals($targetHttpsProxyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $targetHttpsProxyResource = new TargetHttpsProxy(); + $request = (new PatchTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setTargetHttpsProxyResource($targetHttpsProxyResource); + $response = $gapicClient->patch($request); + $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 setCertificateMapTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setCertificateMapTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setCertificateMapTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetHttpsProxiesSetCertificateMapRequestResource = new TargetHttpsProxiesSetCertificateMapRequest(); + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $request = (new SetCertificateMapTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxiesSetCertificateMapRequestResource($targetHttpsProxiesSetCertificateMapRequestResource) + ->setTargetHttpsProxy($targetHttpsProxy); + $response = $gapicClient->setCertificateMap($request); + $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.TargetHttpsProxies/SetCertificateMap', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxiesSetCertificateMapRequestResource(); + $this->assertProtobufEquals($targetHttpsProxiesSetCertificateMapRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setCertificateMapExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setCertificateMapExceptionTest'); + $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 + $project = 'project-309310695'; + $targetHttpsProxiesSetCertificateMapRequestResource = new TargetHttpsProxiesSetCertificateMapRequest(); + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $request = (new SetCertificateMapTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxiesSetCertificateMapRequestResource($targetHttpsProxiesSetCertificateMapRequestResource) + ->setTargetHttpsProxy($targetHttpsProxy); + $response = $gapicClient->setCertificateMap($request); + $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 setQuicOverrideTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setQuicOverrideTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setQuicOverrideTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetHttpsProxiesSetQuicOverrideRequestResource = new TargetHttpsProxiesSetQuicOverrideRequest(); + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $request = (new SetQuicOverrideTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxiesSetQuicOverrideRequestResource($targetHttpsProxiesSetQuicOverrideRequestResource) + ->setTargetHttpsProxy($targetHttpsProxy); + $response = $gapicClient->setQuicOverride($request); + $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.TargetHttpsProxies/SetQuicOverride', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxiesSetQuicOverrideRequestResource(); + $this->assertProtobufEquals($targetHttpsProxiesSetQuicOverrideRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setQuicOverrideExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setQuicOverrideExceptionTest'); + $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 + $project = 'project-309310695'; + $targetHttpsProxiesSetQuicOverrideRequestResource = new TargetHttpsProxiesSetQuicOverrideRequest(); + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $request = (new SetQuicOverrideTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxiesSetQuicOverrideRequestResource($targetHttpsProxiesSetQuicOverrideRequestResource) + ->setTargetHttpsProxy($targetHttpsProxy); + $response = $gapicClient->setQuicOverride($request); + $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 setSslCertificatesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setSslCertificatesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setSslCertificatesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetHttpsProxiesSetSslCertificatesRequestResource = new TargetHttpsProxiesSetSslCertificatesRequest(); + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $request = (new SetSslCertificatesTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxiesSetSslCertificatesRequestResource($targetHttpsProxiesSetSslCertificatesRequestResource) + ->setTargetHttpsProxy($targetHttpsProxy); + $response = $gapicClient->setSslCertificates($request); + $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.TargetHttpsProxies/SetSslCertificates', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxiesSetSslCertificatesRequestResource(); + $this->assertProtobufEquals($targetHttpsProxiesSetSslCertificatesRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setSslCertificatesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setSslCertificatesExceptionTest'); + $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 + $project = 'project-309310695'; + $targetHttpsProxiesSetSslCertificatesRequestResource = new TargetHttpsProxiesSetSslCertificatesRequest(); + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $request = (new SetSslCertificatesTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxiesSetSslCertificatesRequestResource($targetHttpsProxiesSetSslCertificatesRequestResource) + ->setTargetHttpsProxy($targetHttpsProxy); + $response = $gapicClient->setSslCertificates($request); + $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 setSslPolicyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setSslPolicyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setSslPolicyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $sslPolicyReferenceResource = new SslPolicyReference(); + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $request = (new SetSslPolicyTargetHttpsProxyRequest()) + ->setProject($project) + ->setSslPolicyReferenceResource($sslPolicyReferenceResource) + ->setTargetHttpsProxy($targetHttpsProxy); + $response = $gapicClient->setSslPolicy($request); + $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.TargetHttpsProxies/SetSslPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSslPolicyReferenceResource(); + $this->assertProtobufEquals($sslPolicyReferenceResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setSslPolicyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setSslPolicyExceptionTest'); + $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 + $project = 'project-309310695'; + $sslPolicyReferenceResource = new SslPolicyReference(); + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $request = (new SetSslPolicyTargetHttpsProxyRequest()) + ->setProject($project) + ->setSslPolicyReferenceResource($sslPolicyReferenceResource) + ->setTargetHttpsProxy($targetHttpsProxy); + $response = $gapicClient->setSslPolicy($request); + $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 setUrlMapTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setUrlMapTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setUrlMapTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $urlMapReferenceResource = new UrlMapReference(); + $request = (new SetUrlMapTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setUrlMapReferenceResource($urlMapReferenceResource); + $response = $gapicClient->setUrlMap($request); + $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.TargetHttpsProxies/SetUrlMap', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMapReferenceResource(); + $this->assertProtobufEquals($urlMapReferenceResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setUrlMapExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setUrlMapExceptionTest'); + $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 + $project = 'project-309310695'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $urlMapReferenceResource = new UrlMapReference(); + $request = (new SetUrlMapTargetHttpsProxyRequest()) + ->setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setUrlMapReferenceResource($urlMapReferenceResource); + $response = $gapicClient->setUrlMap($request); + $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 aggregatedListAsyncTest() + { + $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 TargetHttpsProxiesScopedList(), + ]; + $expectedResponse = new TargetHttpsProxyAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListTargetHttpsProxiesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.TargetHttpsProxies/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetInstancesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetInstancesClientTest.php new file mode 100644 index 000000000000..3e750e60db3b --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetInstancesClientTest.php @@ -0,0 +1,765 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TargetInstancesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TargetInstancesClient($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 TargetInstancesScopedList(), + ]; + $expectedResponse = new TargetInstanceAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListTargetInstancesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.TargetInstances/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'; + $request = (new AggregatedListTargetInstancesRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTest() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetInstance = 'targetInstance826640259'; + $zone = 'zone3744684'; + $request = (new DeleteTargetInstanceRequest()) + ->setProject($project) + ->setTargetInstance($targetInstance) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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.TargetInstances/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetInstance(); + $this->assertProtobufEquals($targetInstance, $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 deleteExceptionTest() + { + $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/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 + $project = 'project-309310695'; + $targetInstance = 'targetInstance826640259'; + $zone = 'zone3744684'; + $request = (new DeleteTargetInstanceRequest()) + ->setProject($project) + ->setTargetInstance($targetInstance) + ->setZone($zone); + $response = $gapicClient->delete($request); + $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; + $instance = 'instance555127957'; + $kind = 'kind3292052'; + $name = 'name3373707'; + $natPolicy = 'natPolicy-1637703152'; + $network = 'network1843485230'; + $securityPolicy = 'securityPolicy1781695249'; + $selfLink = 'selfLink-1691268851'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new TargetInstance(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setInstance($instance); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNatPolicy($natPolicy); + $expectedResponse->setNetwork($network); + $expectedResponse->setSecurityPolicy($securityPolicy); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $targetInstance = 'targetInstance826640259'; + $zone = 'zone3744684'; + $request = (new GetTargetInstanceRequest()) + ->setProject($project) + ->setTargetInstance($targetInstance) + ->setZone($zone); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.TargetInstances/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getTargetInstance(); + $this->assertProtobufEquals($targetInstance, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $project = 'project-309310695'; + $targetInstance = 'targetInstance826640259'; + $zone = 'zone3744684'; + $request = (new GetTargetInstanceRequest()) + ->setProject($project) + ->setTargetInstance($targetInstance) + ->setZone($zone); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetInstanceResource = new TargetInstance(); + $zone = 'zone3744684'; + $request = (new InsertTargetInstanceRequest()) + ->setProject($project) + ->setTargetInstanceResource($targetInstanceResource) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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.TargetInstances/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetInstanceResource(); + $this->assertProtobufEquals($targetInstanceResource, $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 insertExceptionTest() + { + $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/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 + $project = 'project-309310695'; + $targetInstanceResource = new TargetInstance(); + $zone = 'zone3744684'; + $request = (new InsertTargetInstanceRequest()) + ->setProject($project) + ->setTargetInstanceResource($targetInstanceResource) + ->setZone($zone); + $response = $gapicClient->insert($request); + $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 TargetInstance(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new TargetInstanceList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListTargetInstancesRequest()) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->list($request); + $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.TargetInstances/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + $request = (new ListTargetInstancesRequest()) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setSecurityPolicyTest() + { + $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/setSecurityPolicyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setSecurityPolicyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $targetInstance = 'targetInstance826640259'; + $zone = 'zone3744684'; + $request = (new SetSecurityPolicyTargetInstanceRequest()) + ->setProject($project) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource) + ->setTargetInstance($targetInstance) + ->setZone($zone); + $response = $gapicClient->setSecurityPolicy($request); + $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.TargetInstances/SetSecurityPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyReferenceResource(); + $this->assertProtobufEquals($securityPolicyReferenceResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetInstance(); + $this->assertProtobufEquals($targetInstance, $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 setSecurityPolicyExceptionTest() + { + $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/setSecurityPolicyExceptionTest'); + $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 + $project = 'project-309310695'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $targetInstance = 'targetInstance826640259'; + $zone = 'zone3744684'; + $request = (new SetSecurityPolicyTargetInstanceRequest()) + ->setProject($project) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource) + ->setTargetInstance($targetInstance) + ->setZone($zone); + $response = $gapicClient->setSecurityPolicy($request); + $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 aggregatedListAsyncTest() + { + $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 TargetInstancesScopedList(), + ]; + $expectedResponse = new TargetInstanceAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListTargetInstancesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.TargetInstances/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetPoolsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetPoolsClientTest.php new file mode 100644 index 000000000000..b3692e4e970b --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetPoolsClientTest.php @@ -0,0 +1,1553 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TargetPoolsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TargetPoolsClient($options); + } + + /** @test */ + public function addHealthCheckTest() + { + $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/addHealthCheckTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addHealthCheckTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $targetPoolsAddHealthCheckRequestResource = new TargetPoolsAddHealthCheckRequest(); + $request = (new AddHealthCheckTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetPoolsAddHealthCheckRequestResource($targetPoolsAddHealthCheckRequestResource); + $response = $gapicClient->addHealthCheck($request); + $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.TargetPools/AddHealthCheck', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPool(); + $this->assertProtobufEquals($targetPool, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPoolsAddHealthCheckRequestResource(); + $this->assertProtobufEquals($targetPoolsAddHealthCheckRequestResource, $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 addHealthCheckExceptionTest() + { + $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/addHealthCheckExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $targetPoolsAddHealthCheckRequestResource = new TargetPoolsAddHealthCheckRequest(); + $request = (new AddHealthCheckTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetPoolsAddHealthCheckRequestResource($targetPoolsAddHealthCheckRequestResource); + $response = $gapicClient->addHealthCheck($request); + $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 addInstanceTest() + { + $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/addInstanceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addInstanceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $targetPoolsAddInstanceRequestResource = new TargetPoolsAddInstanceRequest(); + $request = (new AddInstanceTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetPoolsAddInstanceRequestResource($targetPoolsAddInstanceRequestResource); + $response = $gapicClient->addInstance($request); + $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.TargetPools/AddInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPool(); + $this->assertProtobufEquals($targetPool, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPoolsAddInstanceRequestResource(); + $this->assertProtobufEquals($targetPoolsAddInstanceRequestResource, $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 addInstanceExceptionTest() + { + $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/addInstanceExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $targetPoolsAddInstanceRequestResource = new TargetPoolsAddInstanceRequest(); + $request = (new AddInstanceTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetPoolsAddInstanceRequestResource($targetPoolsAddInstanceRequestResource); + $response = $gapicClient->addInstance($request); + $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 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 TargetPoolsScopedList(), + ]; + $expectedResponse = new TargetPoolAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListTargetPoolsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.TargetPools/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'; + $request = (new AggregatedListTargetPoolsRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $request = (new DeleteTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool); + $response = $gapicClient->delete($request); + $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.TargetPools/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPool(); + $this->assertProtobufEquals($targetPool, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $request = (new DeleteTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool); + $response = $gapicClient->delete($request); + $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 + $backupPool = 'backupPool1119626361'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $failoverRatio = -2221401; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $region2 = 'region2-690338393'; + $securityPolicy = 'securityPolicy1781695249'; + $selfLink = 'selfLink-1691268851'; + $sessionAffinity = 'sessionAffinity1000759473'; + $expectedResponse = new TargetPool(); + $expectedResponse->setBackupPool($backupPool); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFailoverRatio($failoverRatio); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSecurityPolicy($securityPolicy); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSessionAffinity($sessionAffinity); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $request = (new GetTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.TargetPools/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getTargetPool(); + $this->assertProtobufEquals($targetPool, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $request = (new GetTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getHealthTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $kind = 'kind3292052'; + $expectedResponse = new TargetPoolInstanceHealth(); + $expectedResponse->setKind($kind); + $transport->addResponse($expectedResponse); + // Mock request + $instanceReferenceResource = new InstanceReference(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $request = (new GetHealthTargetPoolRequest()) + ->setInstanceReferenceResource($instanceReferenceResource) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool); + $response = $gapicClient->getHealth($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.TargetPools/GetHealth', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceReferenceResource(); + $this->assertProtobufEquals($instanceReferenceResource, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getTargetPool(); + $this->assertProtobufEquals($targetPool, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getHealthExceptionTest() + { + $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 + $instanceReferenceResource = new InstanceReference(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $request = (new GetHealthTargetPoolRequest()) + ->setInstanceReferenceResource($instanceReferenceResource) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool); + try { + $gapicClient->getHealth($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPoolResource = new TargetPool(); + $request = (new InsertTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPoolResource($targetPoolResource); + $response = $gapicClient->insert($request); + $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.TargetPools/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPoolResource(); + $this->assertProtobufEquals($targetPoolResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPoolResource = new TargetPool(); + $request = (new InsertTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPoolResource($targetPoolResource); + $response = $gapicClient->insert($request); + $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 TargetPool(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new TargetPoolList(); + $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'; + $request = (new ListTargetPoolsRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.TargetPools/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'; + $request = (new ListTargetPoolsRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function removeHealthCheckTest() + { + $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/removeHealthCheckTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeHealthCheckTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $targetPoolsRemoveHealthCheckRequestResource = new TargetPoolsRemoveHealthCheckRequest(); + $request = (new RemoveHealthCheckTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetPoolsRemoveHealthCheckRequestResource($targetPoolsRemoveHealthCheckRequestResource); + $response = $gapicClient->removeHealthCheck($request); + $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.TargetPools/RemoveHealthCheck', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPool(); + $this->assertProtobufEquals($targetPool, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPoolsRemoveHealthCheckRequestResource(); + $this->assertProtobufEquals($targetPoolsRemoveHealthCheckRequestResource, $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 removeHealthCheckExceptionTest() + { + $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/removeHealthCheckExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $targetPoolsRemoveHealthCheckRequestResource = new TargetPoolsRemoveHealthCheckRequest(); + $request = (new RemoveHealthCheckTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetPoolsRemoveHealthCheckRequestResource($targetPoolsRemoveHealthCheckRequestResource); + $response = $gapicClient->removeHealthCheck($request); + $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 removeInstanceTest() + { + $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/removeInstanceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeInstanceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $targetPoolsRemoveInstanceRequestResource = new TargetPoolsRemoveInstanceRequest(); + $request = (new RemoveInstanceTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetPoolsRemoveInstanceRequestResource($targetPoolsRemoveInstanceRequestResource); + $response = $gapicClient->removeInstance($request); + $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.TargetPools/RemoveInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPool(); + $this->assertProtobufEquals($targetPool, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPoolsRemoveInstanceRequestResource(); + $this->assertProtobufEquals($targetPoolsRemoveInstanceRequestResource, $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 removeInstanceExceptionTest() + { + $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/removeInstanceExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $targetPoolsRemoveInstanceRequestResource = new TargetPoolsRemoveInstanceRequest(); + $request = (new RemoveInstanceTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetPoolsRemoveInstanceRequestResource($targetPoolsRemoveInstanceRequestResource); + $response = $gapicClient->removeInstance($request); + $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 setBackupTest() + { + $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/setBackupTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setBackupTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $targetReferenceResource = new TargetReference(); + $request = (new SetBackupTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetReferenceResource($targetReferenceResource); + $response = $gapicClient->setBackup($request); + $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.TargetPools/SetBackup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPool(); + $this->assertProtobufEquals($targetPool, $actualValue); + $actualValue = $actualApiRequestObject->getTargetReferenceResource(); + $this->assertProtobufEquals($targetReferenceResource, $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 setBackupExceptionTest() + { + $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/setBackupExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $targetReferenceResource = new TargetReference(); + $request = (new SetBackupTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetReferenceResource($targetReferenceResource); + $response = $gapicClient->setBackup($request); + $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 setSecurityPolicyTest() + { + $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/setSecurityPolicyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setSecurityPolicyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $targetPool = 'targetPool-2084687350'; + $request = (new SetSecurityPolicyTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource) + ->setTargetPool($targetPool); + $response = $gapicClient->setSecurityPolicy($request); + $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.TargetPools/SetSecurityPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyReferenceResource(); + $this->assertProtobufEquals($securityPolicyReferenceResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPool(); + $this->assertProtobufEquals($targetPool, $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 setSecurityPolicyExceptionTest() + { + $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/setSecurityPolicyExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $targetPool = 'targetPool-2084687350'; + $request = (new SetSecurityPolicyTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource) + ->setTargetPool($targetPool); + $response = $gapicClient->setSecurityPolicy($request); + $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 addHealthCheckAsyncTest() + { + $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/addHealthCheckAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addHealthCheckAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $targetPoolsAddHealthCheckRequestResource = new TargetPoolsAddHealthCheckRequest(); + $request = (new AddHealthCheckTargetPoolRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetPoolsAddHealthCheckRequestResource($targetPoolsAddHealthCheckRequestResource); + $response = $gapicClient->addHealthCheck($request); + $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.TargetPools/AddHealthCheck', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPool(); + $this->assertProtobufEquals($targetPool, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPoolsAddHealthCheckRequestResource(); + $this->assertProtobufEquals($targetPoolsAddHealthCheckRequestResource, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetSslProxiesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetSslProxiesClientTest.php new file mode 100644 index 000000000000..cfa8371c436b --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetSslProxiesClientTest.php @@ -0,0 +1,1179 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TargetSslProxiesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TargetSslProxiesClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetSslProxy = 'targetSslProxy875666765'; + $request = (new DeleteTargetSslProxyRequest()) + ->setProject($project) + ->setTargetSslProxy($targetSslProxy); + $response = $gapicClient->delete($request); + $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.TargetSslProxies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxy(); + $this->assertProtobufEquals($targetSslProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetSslProxy = 'targetSslProxy875666765'; + $request = (new DeleteTargetSslProxyRequest()) + ->setProject($project) + ->setTargetSslProxy($targetSslProxy); + $response = $gapicClient->delete($request); + $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 + $certificateMap = 'certificateMap-917278028'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $proxyHeader = 'proxyHeader-1987109506'; + $selfLink = 'selfLink-1691268851'; + $service = 'service1984153269'; + $sslPolicy = 'sslPolicy-1852293435'; + $expectedResponse = new TargetSslProxy(); + $expectedResponse->setCertificateMap($certificateMap); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setProxyHeader($proxyHeader); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setService($service); + $expectedResponse->setSslPolicy($sslPolicy); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $targetSslProxy = 'targetSslProxy875666765'; + $request = (new GetTargetSslProxyRequest()) + ->setProject($project) + ->setTargetSslProxy($targetSslProxy); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.TargetSslProxies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getTargetSslProxy(); + $this->assertProtobufEquals($targetSslProxy, $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 + $project = 'project-309310695'; + $targetSslProxy = 'targetSslProxy875666765'; + $request = (new GetTargetSslProxyRequest()) + ->setProject($project) + ->setTargetSslProxy($targetSslProxy); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetSslProxyResource = new TargetSslProxy(); + $request = (new InsertTargetSslProxyRequest()) + ->setProject($project) + ->setTargetSslProxyResource($targetSslProxyResource); + $response = $gapicClient->insert($request); + $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.TargetSslProxies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxyResource(); + $this->assertProtobufEquals($targetSslProxyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetSslProxyResource = new TargetSslProxy(); + $request = (new InsertTargetSslProxyRequest()) + ->setProject($project) + ->setTargetSslProxyResource($targetSslProxyResource); + $response = $gapicClient->insert($request); + $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 TargetSslProxy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new TargetSslProxyList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListTargetSslProxiesRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.TargetSslProxies/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListTargetSslProxiesRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setBackendServiceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setBackendServiceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setBackendServiceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetSslProxiesSetBackendServiceRequestResource = new TargetSslProxiesSetBackendServiceRequest(); + $targetSslProxy = 'targetSslProxy875666765'; + $request = (new SetBackendServiceTargetSslProxyRequest()) + ->setProject($project) + ->setTargetSslProxiesSetBackendServiceRequestResource($targetSslProxiesSetBackendServiceRequestResource) + ->setTargetSslProxy($targetSslProxy); + $response = $gapicClient->setBackendService($request); + $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.TargetSslProxies/SetBackendService', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxiesSetBackendServiceRequestResource(); + $this->assertProtobufEquals($targetSslProxiesSetBackendServiceRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxy(); + $this->assertProtobufEquals($targetSslProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setBackendServiceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setBackendServiceExceptionTest'); + $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 + $project = 'project-309310695'; + $targetSslProxiesSetBackendServiceRequestResource = new TargetSslProxiesSetBackendServiceRequest(); + $targetSslProxy = 'targetSslProxy875666765'; + $request = (new SetBackendServiceTargetSslProxyRequest()) + ->setProject($project) + ->setTargetSslProxiesSetBackendServiceRequestResource($targetSslProxiesSetBackendServiceRequestResource) + ->setTargetSslProxy($targetSslProxy); + $response = $gapicClient->setBackendService($request); + $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 setCertificateMapTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setCertificateMapTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setCertificateMapTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetSslProxiesSetCertificateMapRequestResource = new TargetSslProxiesSetCertificateMapRequest(); + $targetSslProxy = 'targetSslProxy875666765'; + $request = (new SetCertificateMapTargetSslProxyRequest()) + ->setProject($project) + ->setTargetSslProxiesSetCertificateMapRequestResource($targetSslProxiesSetCertificateMapRequestResource) + ->setTargetSslProxy($targetSslProxy); + $response = $gapicClient->setCertificateMap($request); + $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.TargetSslProxies/SetCertificateMap', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxiesSetCertificateMapRequestResource(); + $this->assertProtobufEquals($targetSslProxiesSetCertificateMapRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxy(); + $this->assertProtobufEquals($targetSslProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setCertificateMapExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setCertificateMapExceptionTest'); + $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 + $project = 'project-309310695'; + $targetSslProxiesSetCertificateMapRequestResource = new TargetSslProxiesSetCertificateMapRequest(); + $targetSslProxy = 'targetSslProxy875666765'; + $request = (new SetCertificateMapTargetSslProxyRequest()) + ->setProject($project) + ->setTargetSslProxiesSetCertificateMapRequestResource($targetSslProxiesSetCertificateMapRequestResource) + ->setTargetSslProxy($targetSslProxy); + $response = $gapicClient->setCertificateMap($request); + $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 setProxyHeaderTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setProxyHeaderTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setProxyHeaderTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetSslProxiesSetProxyHeaderRequestResource = new TargetSslProxiesSetProxyHeaderRequest(); + $targetSslProxy = 'targetSslProxy875666765'; + $request = (new SetProxyHeaderTargetSslProxyRequest()) + ->setProject($project) + ->setTargetSslProxiesSetProxyHeaderRequestResource($targetSslProxiesSetProxyHeaderRequestResource) + ->setTargetSslProxy($targetSslProxy); + $response = $gapicClient->setProxyHeader($request); + $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.TargetSslProxies/SetProxyHeader', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxiesSetProxyHeaderRequestResource(); + $this->assertProtobufEquals($targetSslProxiesSetProxyHeaderRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxy(); + $this->assertProtobufEquals($targetSslProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setProxyHeaderExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setProxyHeaderExceptionTest'); + $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 + $project = 'project-309310695'; + $targetSslProxiesSetProxyHeaderRequestResource = new TargetSslProxiesSetProxyHeaderRequest(); + $targetSslProxy = 'targetSslProxy875666765'; + $request = (new SetProxyHeaderTargetSslProxyRequest()) + ->setProject($project) + ->setTargetSslProxiesSetProxyHeaderRequestResource($targetSslProxiesSetProxyHeaderRequestResource) + ->setTargetSslProxy($targetSslProxy); + $response = $gapicClient->setProxyHeader($request); + $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 setSslCertificatesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setSslCertificatesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setSslCertificatesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetSslProxiesSetSslCertificatesRequestResource = new TargetSslProxiesSetSslCertificatesRequest(); + $targetSslProxy = 'targetSslProxy875666765'; + $request = (new SetSslCertificatesTargetSslProxyRequest()) + ->setProject($project) + ->setTargetSslProxiesSetSslCertificatesRequestResource($targetSslProxiesSetSslCertificatesRequestResource) + ->setTargetSslProxy($targetSslProxy); + $response = $gapicClient->setSslCertificates($request); + $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.TargetSslProxies/SetSslCertificates', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxiesSetSslCertificatesRequestResource(); + $this->assertProtobufEquals($targetSslProxiesSetSslCertificatesRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxy(); + $this->assertProtobufEquals($targetSslProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setSslCertificatesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setSslCertificatesExceptionTest'); + $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 + $project = 'project-309310695'; + $targetSslProxiesSetSslCertificatesRequestResource = new TargetSslProxiesSetSslCertificatesRequest(); + $targetSslProxy = 'targetSslProxy875666765'; + $request = (new SetSslCertificatesTargetSslProxyRequest()) + ->setProject($project) + ->setTargetSslProxiesSetSslCertificatesRequestResource($targetSslProxiesSetSslCertificatesRequestResource) + ->setTargetSslProxy($targetSslProxy); + $response = $gapicClient->setSslCertificates($request); + $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 setSslPolicyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setSslPolicyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setSslPolicyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $sslPolicyReferenceResource = new SslPolicyReference(); + $targetSslProxy = 'targetSslProxy875666765'; + $request = (new SetSslPolicyTargetSslProxyRequest()) + ->setProject($project) + ->setSslPolicyReferenceResource($sslPolicyReferenceResource) + ->setTargetSslProxy($targetSslProxy); + $response = $gapicClient->setSslPolicy($request); + $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.TargetSslProxies/SetSslPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSslPolicyReferenceResource(); + $this->assertProtobufEquals($sslPolicyReferenceResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxy(); + $this->assertProtobufEquals($targetSslProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setSslPolicyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setSslPolicyExceptionTest'); + $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 + $project = 'project-309310695'; + $sslPolicyReferenceResource = new SslPolicyReference(); + $targetSslProxy = 'targetSslProxy875666765'; + $request = (new SetSslPolicyTargetSslProxyRequest()) + ->setProject($project) + ->setSslPolicyReferenceResource($sslPolicyReferenceResource) + ->setTargetSslProxy($targetSslProxy); + $response = $gapicClient->setSslPolicy($request); + $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 deleteAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deleteAsyncTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAsyncTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetSslProxy = 'targetSslProxy875666765'; + $request = (new DeleteTargetSslProxyRequest()) + ->setProject($project) + ->setTargetSslProxy($targetSslProxy); + $response = $gapicClient->delete($request); + $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.TargetSslProxies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxy(); + $this->assertProtobufEquals($targetSslProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetTcpProxiesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetTcpProxiesClientTest.php new file mode 100644 index 000000000000..2675ca2a1793 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetTcpProxiesClientTest.php @@ -0,0 +1,858 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TargetTcpProxiesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TargetTcpProxiesClient($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 TargetTcpProxiesScopedList(), + ]; + $expectedResponse = new TargetTcpProxyAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListTargetTcpProxiesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.TargetTcpProxies/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'; + $request = (new AggregatedListTargetTcpProxiesRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetTcpProxy = 'targetTcpProxy503065442'; + $request = (new DeleteTargetTcpProxyRequest()) + ->setProject($project) + ->setTargetTcpProxy($targetTcpProxy); + $response = $gapicClient->delete($request); + $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.TargetTcpProxies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetTcpProxy(); + $this->assertProtobufEquals($targetTcpProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetTcpProxy = 'targetTcpProxy503065442'; + $request = (new DeleteTargetTcpProxyRequest()) + ->setProject($project) + ->setTargetTcpProxy($targetTcpProxy); + $response = $gapicClient->delete($request); + $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'; + $proxyBind = true; + $proxyHeader = 'proxyHeader-1987109506'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $service = 'service1984153269'; + $expectedResponse = new TargetTcpProxy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setProxyBind($proxyBind); + $expectedResponse->setProxyHeader($proxyHeader); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setService($service); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $targetTcpProxy = 'targetTcpProxy503065442'; + $request = (new GetTargetTcpProxyRequest()) + ->setProject($project) + ->setTargetTcpProxy($targetTcpProxy); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.TargetTcpProxies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getTargetTcpProxy(); + $this->assertProtobufEquals($targetTcpProxy, $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 + $project = 'project-309310695'; + $targetTcpProxy = 'targetTcpProxy503065442'; + $request = (new GetTargetTcpProxyRequest()) + ->setProject($project) + ->setTargetTcpProxy($targetTcpProxy); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetTcpProxyResource = new TargetTcpProxy(); + $request = (new InsertTargetTcpProxyRequest()) + ->setProject($project) + ->setTargetTcpProxyResource($targetTcpProxyResource); + $response = $gapicClient->insert($request); + $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.TargetTcpProxies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetTcpProxyResource(); + $this->assertProtobufEquals($targetTcpProxyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetTcpProxyResource = new TargetTcpProxy(); + $request = (new InsertTargetTcpProxyRequest()) + ->setProject($project) + ->setTargetTcpProxyResource($targetTcpProxyResource); + $response = $gapicClient->insert($request); + $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 TargetTcpProxy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new TargetTcpProxyList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListTargetTcpProxiesRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.TargetTcpProxies/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListTargetTcpProxiesRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setBackendServiceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setBackendServiceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setBackendServiceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetTcpProxiesSetBackendServiceRequestResource = new TargetTcpProxiesSetBackendServiceRequest(); + $targetTcpProxy = 'targetTcpProxy503065442'; + $request = (new SetBackendServiceTargetTcpProxyRequest()) + ->setProject($project) + ->setTargetTcpProxiesSetBackendServiceRequestResource($targetTcpProxiesSetBackendServiceRequestResource) + ->setTargetTcpProxy($targetTcpProxy); + $response = $gapicClient->setBackendService($request); + $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.TargetTcpProxies/SetBackendService', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetTcpProxiesSetBackendServiceRequestResource(); + $this->assertProtobufEquals($targetTcpProxiesSetBackendServiceRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetTcpProxy(); + $this->assertProtobufEquals($targetTcpProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setBackendServiceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setBackendServiceExceptionTest'); + $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 + $project = 'project-309310695'; + $targetTcpProxiesSetBackendServiceRequestResource = new TargetTcpProxiesSetBackendServiceRequest(); + $targetTcpProxy = 'targetTcpProxy503065442'; + $request = (new SetBackendServiceTargetTcpProxyRequest()) + ->setProject($project) + ->setTargetTcpProxiesSetBackendServiceRequestResource($targetTcpProxiesSetBackendServiceRequestResource) + ->setTargetTcpProxy($targetTcpProxy); + $response = $gapicClient->setBackendService($request); + $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 setProxyHeaderTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setProxyHeaderTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setProxyHeaderTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetTcpProxiesSetProxyHeaderRequestResource = new TargetTcpProxiesSetProxyHeaderRequest(); + $targetTcpProxy = 'targetTcpProxy503065442'; + $request = (new SetProxyHeaderTargetTcpProxyRequest()) + ->setProject($project) + ->setTargetTcpProxiesSetProxyHeaderRequestResource($targetTcpProxiesSetProxyHeaderRequestResource) + ->setTargetTcpProxy($targetTcpProxy); + $response = $gapicClient->setProxyHeader($request); + $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.TargetTcpProxies/SetProxyHeader', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetTcpProxiesSetProxyHeaderRequestResource(); + $this->assertProtobufEquals($targetTcpProxiesSetProxyHeaderRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetTcpProxy(); + $this->assertProtobufEquals($targetTcpProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setProxyHeaderExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setProxyHeaderExceptionTest'); + $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 + $project = 'project-309310695'; + $targetTcpProxiesSetProxyHeaderRequestResource = new TargetTcpProxiesSetProxyHeaderRequest(); + $targetTcpProxy = 'targetTcpProxy503065442'; + $request = (new SetProxyHeaderTargetTcpProxyRequest()) + ->setProject($project) + ->setTargetTcpProxiesSetProxyHeaderRequestResource($targetTcpProxiesSetProxyHeaderRequestResource) + ->setTargetTcpProxy($targetTcpProxy); + $response = $gapicClient->setProxyHeader($request); + $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 aggregatedListAsyncTest() + { + $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 TargetTcpProxiesScopedList(), + ]; + $expectedResponse = new TargetTcpProxyAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListTargetTcpProxiesRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.TargetTcpProxies/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetVpnGatewaysClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetVpnGatewaysClientTest.php new file mode 100644 index 000000000000..9c16e7d10996 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetVpnGatewaysClientTest.php @@ -0,0 +1,763 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TargetVpnGatewaysClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TargetVpnGatewaysClient($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 TargetVpnGatewaysScopedList(), + ]; + $expectedResponse = new TargetVpnGatewayAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListTargetVpnGatewaysRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.TargetVpnGateways/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'; + $request = (new AggregatedListTargetVpnGatewaysRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetVpnGateway = 'targetVpnGateway-4358069'; + $request = (new DeleteTargetVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetVpnGateway($targetVpnGateway); + $response = $gapicClient->delete($request); + $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.TargetVpnGateways/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetVpnGateway(); + $this->assertProtobufEquals($targetVpnGateway, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetVpnGateway = 'targetVpnGateway-4358069'; + $request = (new DeleteTargetVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetVpnGateway($targetVpnGateway); + $response = $gapicClient->delete($request); + $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'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $network = 'network1843485230'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $expectedResponse = new TargetVpnGateway(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetVpnGateway = 'targetVpnGateway-4358069'; + $request = (new GetTargetVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetVpnGateway($targetVpnGateway); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.TargetVpnGateways/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getTargetVpnGateway(); + $this->assertProtobufEquals($targetVpnGateway, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetVpnGateway = 'targetVpnGateway-4358069'; + $request = (new GetTargetVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetVpnGateway($targetVpnGateway); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetVpnGatewayResource = new TargetVpnGateway(); + $request = (new InsertTargetVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetVpnGatewayResource($targetVpnGatewayResource); + $response = $gapicClient->insert($request); + $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.TargetVpnGateways/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetVpnGatewayResource(); + $this->assertProtobufEquals($targetVpnGatewayResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetVpnGatewayResource = new TargetVpnGateway(); + $request = (new InsertTargetVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setTargetVpnGatewayResource($targetVpnGatewayResource); + $response = $gapicClient->insert($request); + $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 TargetVpnGateway(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new TargetVpnGatewayList(); + $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'; + $request = (new ListTargetVpnGatewaysRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.TargetVpnGateways/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'; + $request = (new ListTargetVpnGatewaysRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setLabelsTest() + { + $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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $request = (new SetLabelsTargetVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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.TargetVpnGateways/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionSetLabelsRequestResource(); + $this->assertProtobufEquals($regionSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $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 setLabelsExceptionTest() + { + $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/setLabelsExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $request = (new SetLabelsTargetVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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 aggregatedListAsyncTest() + { + $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 TargetVpnGatewaysScopedList(), + ]; + $expectedResponse = new TargetVpnGatewayAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListTargetVpnGatewaysRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.TargetVpnGateways/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/UrlMapsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/UrlMapsClientTest.php new file mode 100644 index 000000000000..9a8f95a59715 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/UrlMapsClientTest.php @@ -0,0 +1,1059 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return UrlMapsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new UrlMapsClient($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 UrlMapsScopedList(), + ]; + $expectedResponse = new UrlMapsAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListUrlMapsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.UrlMaps/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'; + $request = (new AggregatedListUrlMapsRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $urlMap = 'urlMap-169850228'; + $request = (new DeleteUrlMapRequest()) + ->setProject($project) + ->setUrlMap($urlMap); + $response = $gapicClient->delete($request); + $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.UrlMaps/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $urlMap = 'urlMap-169850228'; + $request = (new DeleteUrlMapRequest()) + ->setProject($project) + ->setUrlMap($urlMap); + $response = $gapicClient->delete($request); + $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'; + $defaultService = 'defaultService1980854967'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new UrlMap(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDefaultService($defaultService); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $urlMap = 'urlMap-169850228'; + $request = (new GetUrlMapRequest()) + ->setProject($project) + ->setUrlMap($urlMap); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.UrlMaps/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $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 + $project = 'project-309310695'; + $urlMap = 'urlMap-169850228'; + $request = (new GetUrlMapRequest()) + ->setProject($project) + ->setUrlMap($urlMap); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $urlMapResource = new UrlMap(); + $request = (new InsertUrlMapRequest()) + ->setProject($project) + ->setUrlMapResource($urlMapResource); + $response = $gapicClient->insert($request); + $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.UrlMaps/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMapResource(); + $this->assertProtobufEquals($urlMapResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $urlMapResource = new UrlMap(); + $request = (new InsertUrlMapRequest()) + ->setProject($project) + ->setUrlMapResource($urlMapResource); + $response = $gapicClient->insert($request); + $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 invalidateCacheTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/invalidateCacheTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/invalidateCacheTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $cacheInvalidationRuleResource = new CacheInvalidationRule(); + $project = 'project-309310695'; + $urlMap = 'urlMap-169850228'; + $request = (new InvalidateCacheUrlMapRequest()) + ->setCacheInvalidationRuleResource($cacheInvalidationRuleResource) + ->setProject($project) + ->setUrlMap($urlMap); + $response = $gapicClient->invalidateCache($request); + $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.UrlMaps/InvalidateCache', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getCacheInvalidationRuleResource(); + $this->assertProtobufEquals($cacheInvalidationRuleResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function invalidateCacheExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/invalidateCacheExceptionTest'); + $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 + $cacheInvalidationRuleResource = new CacheInvalidationRule(); + $project = 'project-309310695'; + $urlMap = 'urlMap-169850228'; + $request = (new InvalidateCacheUrlMapRequest()) + ->setCacheInvalidationRuleResource($cacheInvalidationRuleResource) + ->setProject($project) + ->setUrlMap($urlMap); + $response = $gapicClient->invalidateCache($request); + $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 UrlMap(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new UrlMapList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListUrlMapsRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.UrlMaps/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListUrlMapsRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $urlMap = 'urlMap-169850228'; + $urlMapResource = new UrlMap(); + $request = (new PatchUrlMapRequest()) + ->setProject($project) + ->setUrlMap($urlMap) + ->setUrlMapResource($urlMapResource); + $response = $gapicClient->patch($request); + $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.UrlMaps/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMapResource(); + $this->assertProtobufEquals($urlMapResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $urlMap = 'urlMap-169850228'; + $urlMapResource = new UrlMap(); + $request = (new PatchUrlMapRequest()) + ->setProject($project) + ->setUrlMap($urlMap) + ->setUrlMapResource($urlMapResource); + $response = $gapicClient->patch($request); + $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 updateTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $urlMap = 'urlMap-169850228'; + $urlMapResource = new UrlMap(); + $request = (new UpdateUrlMapRequest()) + ->setProject($project) + ->setUrlMap($urlMap) + ->setUrlMapResource($urlMapResource); + $response = $gapicClient->update($request); + $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.UrlMaps/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMapResource(); + $this->assertProtobufEquals($urlMapResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $urlMap = 'urlMap-169850228'; + $urlMapResource = new UrlMap(); + $request = (new UpdateUrlMapRequest()) + ->setProject($project) + ->setUrlMap($urlMap) + ->setUrlMapResource($urlMapResource); + $response = $gapicClient->update($request); + $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 validateTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new UrlMapsValidateResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $urlMap = 'urlMap-169850228'; + $urlMapsValidateRequestResource = new UrlMapsValidateRequest(); + $request = (new ValidateUrlMapRequest()) + ->setProject($project) + ->setUrlMap($urlMap) + ->setUrlMapsValidateRequestResource($urlMapsValidateRequestResource); + $response = $gapicClient->validate($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.UrlMaps/Validate', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $actualValue); + $actualValue = $actualRequestObject->getUrlMapsValidateRequestResource(); + $this->assertProtobufEquals($urlMapsValidateRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function validateExceptionTest() + { + $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'; + $urlMap = 'urlMap-169850228'; + $urlMapsValidateRequestResource = new UrlMapsValidateRequest(); + $request = (new ValidateUrlMapRequest()) + ->setProject($project) + ->setUrlMap($urlMap) + ->setUrlMapsValidateRequestResource($urlMapsValidateRequestResource); + try { + $gapicClient->validate($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function aggregatedListAsyncTest() + { + $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 UrlMapsScopedList(), + ]; + $expectedResponse = new UrlMapsAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListUrlMapsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.UrlMaps/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/VpnGatewaysClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/VpnGatewaysClientTest.php new file mode 100644 index 000000000000..5c9a8e4c957f --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/VpnGatewaysClientTest.php @@ -0,0 +1,924 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return VpnGatewaysClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new VpnGatewaysClient($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 VpnGatewaysScopedList(), + ]; + $expectedResponse = new VpnGatewayAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListVpnGatewaysRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.VpnGateways/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'; + $request = (new AggregatedListVpnGatewaysRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnGateway = 'vpnGateway-1203928583'; + $request = (new DeleteVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setVpnGateway($vpnGateway); + $response = $gapicClient->delete($request); + $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.VpnGateways/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getVpnGateway(); + $this->assertProtobufEquals($vpnGateway, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnGateway = 'vpnGateway-1203928583'; + $request = (new DeleteVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setVpnGateway($vpnGateway); + $response = $gapicClient->delete($request); + $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'; + $gatewayIpVersion = 'gatewayIpVersion1138816667'; + $id = 3355; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $network = 'network1843485230'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $stackType = 'stackType2036521617'; + $expectedResponse = new VpnGateway(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setGatewayIpVersion($gatewayIpVersion); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStackType($stackType); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnGateway = 'vpnGateway-1203928583'; + $request = (new GetVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setVpnGateway($vpnGateway); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.VpnGateways/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getVpnGateway(); + $this->assertProtobufEquals($vpnGateway, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnGateway = 'vpnGateway-1203928583'; + $request = (new GetVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setVpnGateway($vpnGateway); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getStatusTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new VpnGatewaysGetStatusResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnGateway = 'vpnGateway-1203928583'; + $request = (new GetStatusVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setVpnGateway($vpnGateway); + $response = $gapicClient->getStatus($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.VpnGateways/GetStatus', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getVpnGateway(); + $this->assertProtobufEquals($vpnGateway, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getStatusExceptionTest() + { + $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'; + $vpnGateway = 'vpnGateway-1203928583'; + $request = (new GetStatusVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setVpnGateway($vpnGateway); + try { + $gapicClient->getStatus($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnGatewayResource = new VpnGateway(); + $request = (new InsertVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setVpnGatewayResource($vpnGatewayResource); + $response = $gapicClient->insert($request); + $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.VpnGateways/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getVpnGatewayResource(); + $this->assertProtobufEquals($vpnGatewayResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnGatewayResource = new VpnGateway(); + $request = (new InsertVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setVpnGatewayResource($vpnGatewayResource); + $response = $gapicClient->insert($request); + $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 VpnGateway(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new VpnGatewayList(); + $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'; + $request = (new ListVpnGatewaysRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.VpnGateways/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'; + $request = (new ListVpnGatewaysRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setLabelsTest() + { + $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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $request = (new SetLabelsVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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.VpnGateways/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionSetLabelsRequestResource(); + $this->assertProtobufEquals($regionSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $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 setLabelsExceptionTest() + { + $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/setLabelsExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $request = (new SetLabelsVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + $response = $gapicClient->testIamPermissions($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.VpnGateways/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $request = (new TestIamPermissionsVpnGatewayRequest()) + ->setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + try { + $gapicClient->testIamPermissions($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function aggregatedListAsyncTest() + { + $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 VpnGatewaysScopedList(), + ]; + $expectedResponse = new VpnGatewayAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListVpnGatewaysRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.VpnGateways/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/VpnTunnelsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/VpnTunnelsClientTest.php new file mode 100644 index 000000000000..2f7fb5b67394 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/VpnTunnelsClientTest.php @@ -0,0 +1,785 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return VpnTunnelsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new VpnTunnelsClient($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 VpnTunnelsScopedList(), + ]; + $expectedResponse = new VpnTunnelAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListVpnTunnelsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedList($request); + $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.VpnTunnels/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'; + $request = (new AggregatedListVpnTunnelsRequest()) + ->setProject($project); + try { + $gapicClient->aggregatedList($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnTunnel = 'vpnTunnel-2003662317'; + $request = (new DeleteVpnTunnelRequest()) + ->setProject($project) + ->setRegion($region) + ->setVpnTunnel($vpnTunnel); + $response = $gapicClient->delete($request); + $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.VpnTunnels/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getVpnTunnel(); + $this->assertProtobufEquals($vpnTunnel, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnTunnel = 'vpnTunnel-2003662317'; + $request = (new DeleteVpnTunnelRequest()) + ->setProject($project) + ->setRegion($region) + ->setVpnTunnel($vpnTunnel); + $response = $gapicClient->delete($request); + $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'; + $detailedStatus = 'detailedStatus-740240799'; + $id = 3355; + $ikeVersion = 1292118044; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $peerExternalGateway = 'peerExternalGateway384956173'; + $peerExternalGatewayInterface = 620973433; + $peerGcpGateway = 'peerGcpGateway281867452'; + $peerIp = 'peerIp-690492124'; + $region2 = 'region2-690338393'; + $router = 'router-925132983'; + $selfLink = 'selfLink-1691268851'; + $sharedSecret = 'sharedSecret-154938422'; + $sharedSecretHash = 'sharedSecretHash935752803'; + $status = 'status-892481550'; + $targetVpnGateway = 'targetVpnGateway-4358069'; + $vpnGateway = 'vpnGateway-1203928583'; + $vpnGatewayInterface = 632850035; + $expectedResponse = new VpnTunnel(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDetailedStatus($detailedStatus); + $expectedResponse->setId($id); + $expectedResponse->setIkeVersion($ikeVersion); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setPeerExternalGateway($peerExternalGateway); + $expectedResponse->setPeerExternalGatewayInterface($peerExternalGatewayInterface); + $expectedResponse->setPeerGcpGateway($peerGcpGateway); + $expectedResponse->setPeerIp($peerIp); + $expectedResponse->setRegion($region2); + $expectedResponse->setRouter($router); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSharedSecret($sharedSecret); + $expectedResponse->setSharedSecretHash($sharedSecretHash); + $expectedResponse->setStatus($status); + $expectedResponse->setTargetVpnGateway($targetVpnGateway); + $expectedResponse->setVpnGateway($vpnGateway); + $expectedResponse->setVpnGatewayInterface($vpnGatewayInterface); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnTunnel = 'vpnTunnel-2003662317'; + $request = (new GetVpnTunnelRequest()) + ->setProject($project) + ->setRegion($region) + ->setVpnTunnel($vpnTunnel); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.VpnTunnels/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getVpnTunnel(); + $this->assertProtobufEquals($vpnTunnel, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnTunnel = 'vpnTunnel-2003662317'; + $request = (new GetVpnTunnelRequest()) + ->setProject($project) + ->setRegion($region) + ->setVpnTunnel($vpnTunnel); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnTunnelResource = new VpnTunnel(); + $request = (new InsertVpnTunnelRequest()) + ->setProject($project) + ->setRegion($region) + ->setVpnTunnelResource($vpnTunnelResource); + $response = $gapicClient->insert($request); + $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.VpnTunnels/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getVpnTunnelResource(); + $this->assertProtobufEquals($vpnTunnelResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnTunnelResource = new VpnTunnel(); + $request = (new InsertVpnTunnelRequest()) + ->setProject($project) + ->setRegion($region) + ->setVpnTunnelResource($vpnTunnelResource); + $response = $gapicClient->insert($request); + $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 VpnTunnel(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new VpnTunnelList(); + $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'; + $request = (new ListVpnTunnelsRequest()) + ->setProject($project) + ->setRegion($region); + $response = $gapicClient->list($request); + $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.VpnTunnels/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'; + $request = (new ListVpnTunnelsRequest()) + ->setProject($project) + ->setRegion($region); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setLabelsTest() + { + $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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $request = (new SetLabelsVpnTunnelRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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.VpnTunnels/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionSetLabelsRequestResource(); + $this->assertProtobufEquals($regionSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $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 setLabelsExceptionTest() + { + $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/setLabelsExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $request = (new SetLabelsVpnTunnelRequest()) + ->setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + $response = $gapicClient->setLabels($request); + $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 aggregatedListAsyncTest() + { + $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 VpnTunnelsScopedList(), + ]; + $expectedResponse = new VpnTunnelAggregatedList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new AggregatedListVpnTunnelsRequest()) + ->setProject($project); + $response = $gapicClient->aggregatedListAsync($request)->wait(); + $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.VpnTunnels/AggregatedList', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ZoneOperationsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ZoneOperationsClientTest.php new file mode 100644 index 000000000000..9398b8ad9839 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ZoneOperationsClientTest.php @@ -0,0 +1,492 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ZoneOperationsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ZoneOperationsClient($options); + } + + /** @test */ + public function deleteTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new DeleteZoneOperationResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteZoneOperationRequest()) + ->setOperation($operation) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->delete($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.ZoneOperations/Delete', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $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 + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteZoneOperationRequest()) + ->setOperation($operation) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->delete($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $clientOperationId = 'clientOperationId-239630617'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $endTime = 'endTime1725551537'; + $httpErrorMessage = 'httpErrorMessage1276263769'; + $httpErrorStatusCode = 1386087020; + $id = 3355; + $insertTime = 'insertTime-103148397'; + $kind = 'kind3292052'; + $name = 'name3373707'; + $operationGroupId = 'operationGroupId40171187'; + $operationType = 'operationType-1432962286'; + $progress = 1001078227; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $startTime = 'startTime-1573145462'; + $statusMessage = 'statusMessage-239442758'; + $targetId = 815576439; + $targetLink = 'targetLink-2084812312'; + $user = 'user3599307'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new Operation(); + $expectedResponse->setClientOperationId($clientOperationId); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEndTime($endTime); + $expectedResponse->setHttpErrorMessage($httpErrorMessage); + $expectedResponse->setHttpErrorStatusCode($httpErrorStatusCode); + $expectedResponse->setId($id); + $expectedResponse->setInsertTime($insertTime); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setOperationGroupId($operationGroupId); + $expectedResponse->setOperationType($operationType); + $expectedResponse->setProgress($progress); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStartTime($startTime); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setTargetId($targetId); + $expectedResponse->setTargetLink($targetLink); + $expectedResponse->setUser($user); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetZoneOperationRequest()) + ->setOperation($operation) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.ZoneOperations/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetZoneOperationRequest()) + ->setOperation($operation) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 Operation(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new OperationList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ListZoneOperationsRequest()) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->list($request); + $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.ZoneOperations/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + $request = (new ListZoneOperationsRequest()) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function waitTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $clientOperationId = 'clientOperationId-239630617'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $endTime = 'endTime1725551537'; + $httpErrorMessage = 'httpErrorMessage1276263769'; + $httpErrorStatusCode = 1386087020; + $id = 3355; + $insertTime = 'insertTime-103148397'; + $kind = 'kind3292052'; + $name = 'name3373707'; + $operationGroupId = 'operationGroupId40171187'; + $operationType = 'operationType-1432962286'; + $progress = 1001078227; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $startTime = 'startTime-1573145462'; + $statusMessage = 'statusMessage-239442758'; + $targetId = 815576439; + $targetLink = 'targetLink-2084812312'; + $user = 'user3599307'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new Operation(); + $expectedResponse->setClientOperationId($clientOperationId); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEndTime($endTime); + $expectedResponse->setHttpErrorMessage($httpErrorMessage); + $expectedResponse->setHttpErrorStatusCode($httpErrorStatusCode); + $expectedResponse->setId($id); + $expectedResponse->setInsertTime($insertTime); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setOperationGroupId($operationGroupId); + $expectedResponse->setOperationType($operationType); + $expectedResponse->setProgress($progress); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStartTime($startTime); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setTargetId($targetId); + $expectedResponse->setTargetLink($targetLink); + $expectedResponse->setUser($user); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new WaitZoneOperationRequest()) + ->setOperation($operation) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->wait($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.ZoneOperations/Wait', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function waitExceptionTest() + { + $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 + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new WaitZoneOperationRequest()) + ->setOperation($operation) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->wait($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new DeleteZoneOperationResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new DeleteZoneOperationRequest()) + ->setOperation($operation) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->deleteAsync($request)->wait(); + $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.ZoneOperations/Delete', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ZonesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ZonesClientTest.php new file mode 100644 index 000000000000..02022d5d1dfa --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ZonesClientTest.php @@ -0,0 +1,277 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ZonesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ZonesClient($options); + } + + /** @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'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $supportsPzs = true; + $expectedResponse = new Zone(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $expectedResponse->setSupportsPzs($supportsPzs); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetZoneRequest()) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->get($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.Zones/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetZoneRequest()) + ->setProject($project) + ->setZone($zone); + try { + $gapicClient->get($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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 Zone(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new ZoneList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListZonesRequest()) + ->setProject($project); + $response = $gapicClient->list($request); + $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.Zones/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + $request = (new ListZonesRequest()) + ->setProject($project); + try { + $gapicClient->list($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAsyncTest() + { + $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'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $supportsPzs = true; + $expectedResponse = new Zone(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $expectedResponse->setSupportsPzs($supportsPzs); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new GetZoneRequest()) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->getAsync($request)->wait(); + $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.Zones/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/DiskTypesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/DiskTypesClientTest.php new file mode 100644 index 000000000000..fe32cd6ec64e --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/DiskTypesClientTest.php @@ -0,0 +1,303 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return DiskTypesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DiskTypesClient($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 DiskTypesScopedList(), + ]; + $expectedResponse = new DiskTypeAggregatedList(); + $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.DiskTypes/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 getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $creationTimestamp = 'creationTimestamp567396278'; + $defaultDiskSizeGb = 807490165; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $validDiskSize = 'validDiskSize-1653521184'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new DiskType(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDefaultDiskSizeGb($defaultDiskSizeGb); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setValidDiskSize($validDiskSize); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $diskType = 'diskType93009052'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->get($diskType, $project, $zone); + $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.DiskTypes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getDiskType(); + $this->assertProtobufEquals($diskType, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $diskType = 'diskType93009052'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->get($diskType, $project, $zone); + // 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 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 DiskType(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new DiskTypeList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->list($project, $zone); + $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.DiskTypes/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + try { + $gapicClient->list($project, $zone); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/DisksClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/DisksClientTest.php new file mode 100644 index 000000000000..cf9899dc6c67 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/DisksClientTest.php @@ -0,0 +1,2043 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return DisksClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DisksClient($options); + } + + /** @test */ + public function addResourcePoliciesTest() + { + $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/addResourcePoliciesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addResourcePoliciesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $disksAddResourcePoliciesRequestResource = new DisksAddResourcePoliciesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->addResourcePolicies($disk, $disksAddResourcePoliciesRequestResource, $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/AddResourcePolicies', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getDisksAddResourcePoliciesRequestResource(); + $this->assertProtobufEquals($disksAddResourcePoliciesRequestResource, $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 addResourcePoliciesExceptionTest() + { + $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/addResourcePoliciesExceptionTest'); + $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'; + $disksAddResourcePoliciesRequestResource = new DisksAddResourcePoliciesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->addResourcePolicies($disk, $disksAddResourcePoliciesRequestResource, $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 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 DisksScopedList(), + ]; + $expectedResponse = new DiskAggregatedList(); + $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.Disks/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 bulkInsertTest() + { + $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/bulkInsertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/bulkInsertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $bulkInsertDiskResourceResource = new BulkInsertDiskResource(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->bulkInsert($bulkInsertDiskResourceResource, $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/BulkInsert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBulkInsertDiskResourceResource(); + $this->assertProtobufEquals($bulkInsertDiskResourceResource, $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 bulkInsertExceptionTest() + { + $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/bulkInsertExceptionTest'); + $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 + $bulkInsertDiskResourceResource = new BulkInsertDiskResource(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->bulkInsert($bulkInsertDiskResourceResource, $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 createSnapshotTest() + { + $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/createSnapshotTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/createSnapshotTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $snapshotResource = new Snapshot(); + $zone = 'zone3744684'; + $response = $gapicClient->createSnapshot($disk, $project, $snapshotResource, $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/CreateSnapshot', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSnapshotResource(); + $this->assertProtobufEquals($snapshotResource, $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 createSnapshotExceptionTest() + { + $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/createSnapshotExceptionTest'); + $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'; + $project = 'project-309310695'; + $snapshotResource = new Snapshot(); + $zone = 'zone3744684'; + $response = $gapicClient->createSnapshot($disk, $project, $snapshotResource, $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 deleteTest() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($disk, $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/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $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 deleteExceptionTest() + { + $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/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 + $disk = 'disk3083677'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($disk, $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 getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $architecture = 'architecture839674195'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $enableConfidentialCompute = true; + $id = 3355; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $lastAttachTimestamp = 'lastAttachTimestamp-2105323995'; + $lastDetachTimestamp = 'lastDetachTimestamp-480399885'; + $locationHint = 'locationHint-1796964143'; + $name = 'name3373707'; + $options = 'options-1249474914'; + $physicalBlockSizeBytes = 1190604793; + $provisionedIops = 1260510932; + $provisionedThroughput = 1600266005; + $region = 'region-934795532'; + $satisfiesPzi = false; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $sizeGb = 2105542105; + $sourceConsistencyGroupPolicy = 'sourceConsistencyGroupPolicy19616093'; + $sourceConsistencyGroupPolicyId = 'sourceConsistencyGroupPolicyId267568957'; + $sourceDisk = 'sourceDisk-85117119'; + $sourceDiskId = 'sourceDiskId-1693292839'; + $sourceImage = 'sourceImage1661056055'; + $sourceImageId = 'sourceImageId-2092155357'; + $sourceInstantSnapshot = 'sourceInstantSnapshot-317668858'; + $sourceInstantSnapshotId = 'sourceInstantSnapshotId-1859900940'; + $sourceSnapshot = 'sourceSnapshot-947679896'; + $sourceSnapshotId = 'sourceSnapshotId-1511650478'; + $sourceStorageObject = 'sourceStorageObject-303818201'; + $status = 'status-892481550'; + $storagePool = 'storagePool897344352'; + $type = 'type3575610'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new Disk(); + $expectedResponse->setArchitecture($architecture); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEnableConfidentialCompute($enableConfidentialCompute); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setLastAttachTimestamp($lastAttachTimestamp); + $expectedResponse->setLastDetachTimestamp($lastDetachTimestamp); + $expectedResponse->setLocationHint($locationHint); + $expectedResponse->setName($name); + $expectedResponse->setOptions($options); + $expectedResponse->setPhysicalBlockSizeBytes($physicalBlockSizeBytes); + $expectedResponse->setProvisionedIops($provisionedIops); + $expectedResponse->setProvisionedThroughput($provisionedThroughput); + $expectedResponse->setRegion($region); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSizeGb($sizeGb); + $expectedResponse->setSourceConsistencyGroupPolicy($sourceConsistencyGroupPolicy); + $expectedResponse->setSourceConsistencyGroupPolicyId($sourceConsistencyGroupPolicyId); + $expectedResponse->setSourceDisk($sourceDisk); + $expectedResponse->setSourceDiskId($sourceDiskId); + $expectedResponse->setSourceImage($sourceImage); + $expectedResponse->setSourceImageId($sourceImageId); + $expectedResponse->setSourceInstantSnapshot($sourceInstantSnapshot); + $expectedResponse->setSourceInstantSnapshotId($sourceInstantSnapshotId); + $expectedResponse->setSourceSnapshot($sourceSnapshot); + $expectedResponse->setSourceSnapshotId($sourceSnapshotId); + $expectedResponse->setSourceStorageObject($sourceStorageObject); + $expectedResponse->setStatus($status); + $expectedResponse->setStoragePool($storagePool); + $expectedResponse->setType($type); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->get($disk, $project, $zone); + $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.Disks/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $disk = 'disk3083677'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->get($disk, $project, $zone); + // 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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $response = $gapicClient->getIamPolicy($project, $resource, $zone); + $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.Disks/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + try { + $gapicClient->getIamPolicy($project, $resource, $zone); + // 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 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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $diskResource = new Disk(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->insert($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/Insert', $actualApiFuncCall); + $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 insertExceptionTest() + { + $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/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 + $diskResource = new Disk(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->insert($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()); + } + + /** @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 Disk(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new DiskList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->list($project, $zone); + $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.Disks/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + try { + $gapicClient->list($project, $zone); + // 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 removeResourcePoliciesTest() + { + $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/removeResourcePoliciesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeResourcePoliciesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $disksRemoveResourcePoliciesRequestResource = new DisksRemoveResourcePoliciesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->removeResourcePolicies($disk, $disksRemoveResourcePoliciesRequestResource, $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/RemoveResourcePolicies', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getDisksRemoveResourcePoliciesRequestResource(); + $this->assertProtobufEquals($disksRemoveResourcePoliciesRequestResource, $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 removeResourcePoliciesExceptionTest() + { + $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/removeResourcePoliciesExceptionTest'); + $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'; + $disksRemoveResourcePoliciesRequestResource = new DisksRemoveResourcePoliciesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->removeResourcePolicies($disk, $disksRemoveResourcePoliciesRequestResource, $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 resizeTest() + { + $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/resizeTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/resizeTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $disksResizeRequestResource = new DisksResizeRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->resize($disk, $disksResizeRequestResource, $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/Resize', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getDisksResizeRequestResource(); + $this->assertProtobufEquals($disksResizeRequestResource, $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 resizeExceptionTest() + { + $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/resizeExceptionTest'); + $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'; + $disksResizeRequestResource = new DisksResizeRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->resize($disk, $disksResizeRequestResource, $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $response = $gapicClient->setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource); + $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.Disks/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $actualValue = $actualRequestObject->getZoneSetPolicyRequestResource(); + $this->assertProtobufEquals($zoneSetPolicyRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + try { + $gapicClient->setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource); + // 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 setLabelsTest() + { + $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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetLabelsRequestResource = new ZoneSetLabelsRequest(); + $response = $gapicClient->setLabels($project, $resource, $zone, $zoneSetLabelsRequestResource); + $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/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualApiRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $actualValue = $actualApiRequestObject->getZoneSetLabelsRequestResource(); + $this->assertProtobufEquals($zoneSetLabelsRequestResource, $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 setLabelsExceptionTest() + { + $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/setLabelsExceptionTest'); + $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 + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetLabelsRequestResource = new ZoneSetLabelsRequest(); + $response = $gapicClient->setLabels($project, $resource, $zone, $zoneSetLabelsRequestResource); + $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 startAsyncReplicationTest() + { + $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/startAsyncReplicationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/startAsyncReplicationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $disksStartAsyncReplicationRequestResource = new DisksStartAsyncReplicationRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->startAsyncReplication($disk, $disksStartAsyncReplicationRequestResource, $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/StartAsyncReplication', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getDisksStartAsyncReplicationRequestResource(); + $this->assertProtobufEquals($disksStartAsyncReplicationRequestResource, $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 startAsyncReplicationExceptionTest() + { + $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/startAsyncReplicationExceptionTest'); + $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'; + $disksStartAsyncReplicationRequestResource = new DisksStartAsyncReplicationRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->startAsyncReplication($disk, $disksStartAsyncReplicationRequestResource, $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 stopAsyncReplicationTest() + { + $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/stopAsyncReplicationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/stopAsyncReplicationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->stopAsyncReplication($disk, $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/StopAsyncReplication', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $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 stopAsyncReplicationExceptionTest() + { + $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/stopAsyncReplicationExceptionTest'); + $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'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->stopAsyncReplication($disk, $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 stopGroupAsyncReplicationTest() + { + $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/stopGroupAsyncReplicationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/stopGroupAsyncReplicationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disksStopGroupAsyncReplicationResourceResource = new DisksStopGroupAsyncReplicationResource(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->stopGroupAsyncReplication($disksStopGroupAsyncReplicationResourceResource, $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/StopGroupAsyncReplication', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisksStopGroupAsyncReplicationResourceResource(); + $this->assertProtobufEquals($disksStopGroupAsyncReplicationResourceResource, $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 stopGroupAsyncReplicationExceptionTest() + { + $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/stopGroupAsyncReplicationExceptionTest'); + $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 + $disksStopGroupAsyncReplicationResourceResource = new DisksStopGroupAsyncReplicationResource(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->stopGroupAsyncReplication($disksStopGroupAsyncReplicationResourceResource, $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + $response = $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone); + $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.Disks/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + try { + $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone); + // 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 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/owl-bot-staging/Compute/V1/tests/Unit/V1/ExternalVpnGatewaysClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/ExternalVpnGatewaysClientTest.php new file mode 100644 index 000000000000..b03a72f4a2f2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/ExternalVpnGatewaysClientTest.php @@ -0,0 +1,635 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ExternalVpnGatewaysClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ExternalVpnGatewaysClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $externalVpnGateway = 'externalVpnGateway-2037585019'; + $project = 'project-309310695'; + $response = $gapicClient->delete($externalVpnGateway, $project); + $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.ExternalVpnGateways/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getExternalVpnGateway(); + $this->assertProtobufEquals($externalVpnGateway, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $externalVpnGateway = 'externalVpnGateway-2037585019'; + $project = 'project-309310695'; + $response = $gapicClient->delete($externalVpnGateway, $project); + $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'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $redundancyType = 'redundancyType1345185564'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new ExternalVpnGateway(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setRedundancyType($redundancyType); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $externalVpnGateway = 'externalVpnGateway-2037585019'; + $project = 'project-309310695'; + $response = $gapicClient->get($externalVpnGateway, $project); + $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.ExternalVpnGateways/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getExternalVpnGateway(); + $this->assertProtobufEquals($externalVpnGateway, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $externalVpnGateway = 'externalVpnGateway-2037585019'; + $project = 'project-309310695'; + try { + $gapicClient->get($externalVpnGateway, $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 insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $externalVpnGatewayResource = new ExternalVpnGateway(); + $project = 'project-309310695'; + $response = $gapicClient->insert($externalVpnGatewayResource, $project); + $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.ExternalVpnGateways/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getExternalVpnGatewayResource(); + $this->assertProtobufEquals($externalVpnGatewayResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $externalVpnGatewayResource = new ExternalVpnGateway(); + $project = 'project-309310695'; + $response = $gapicClient->insert($externalVpnGatewayResource, $project); + $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 + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new ExternalVpnGateway(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new ExternalVpnGatewayList(); + $expectedResponse->setEtag($etag); + $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->list($project); + $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.ExternalVpnGateways/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 setLabelsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + $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.ExternalVpnGateways/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getGlobalSetLabelsRequestResource(); + $this->assertProtobufEquals($globalSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setLabelsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsExceptionTest'); + $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 + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $response = $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + $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.ExternalVpnGateways/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + try { + $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/FirewallPoliciesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/FirewallPoliciesClientTest.php new file mode 100644 index 000000000000..4a8425b6dd7c --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/FirewallPoliciesClientTest.php @@ -0,0 +1,1733 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return FirewallPoliciesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new FirewallPoliciesClient($options); + } + + /** @test */ + public function addAssociationTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/addAssociationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addAssociationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyAssociationResource = new FirewallPolicyAssociation(); + $response = $gapicClient->addAssociation($firewallPolicy, $firewallPolicyAssociationResource); + $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.FirewallPolicies/AddAssociation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyAssociationResource(); + $this->assertProtobufEquals($firewallPolicyAssociationResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOrganizationOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $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.GlobalOrganizationOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function addAssociationExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/addAssociationExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyAssociationResource = new FirewallPolicyAssociation(); + $response = $gapicClient->addAssociation($firewallPolicy, $firewallPolicyAssociationResource); + $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 addRuleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/addRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $response = $gapicClient->addRule($firewallPolicy, $firewallPolicyRuleResource); + $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.FirewallPolicies/AddRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyRuleResource(); + $this->assertProtobufEquals($firewallPolicyRuleResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOrganizationOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $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.GlobalOrganizationOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function addRuleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/addRuleExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $response = $gapicClient->addRule($firewallPolicy, $firewallPolicyRuleResource); + $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 cloneRulesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/cloneRulesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/cloneRulesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $response = $gapicClient->cloneRules($firewallPolicy); + $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.FirewallPolicies/CloneRules', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOrganizationOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $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.GlobalOrganizationOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function cloneRulesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/cloneRulesExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $response = $gapicClient->cloneRules($firewallPolicy); + $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 deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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 + $firewallPolicy = 'firewallPolicy1035044177'; + $response = $gapicClient->delete($firewallPolicy); + $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.FirewallPolicies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOrganizationOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $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.GlobalOrganizationOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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 + $firewallPolicy = 'firewallPolicy1035044177'; + $response = $gapicClient->delete($firewallPolicy); + $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'; + $displayName = 'displayName1615086568'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $parent = 'parent-995424086'; + $region = 'region-934795532'; + $ruleTupleCount = 388342037; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $shortName = 'shortName1565793390'; + $expectedResponse = new FirewallPolicy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setRegion($region); + $expectedResponse->setRuleTupleCount($ruleTupleCount); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $expectedResponse->setShortName($shortName); + $transport->addResponse($expectedResponse); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $response = $gapicClient->get($firewallPolicy); + $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.FirewallPolicies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $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 + $firewallPolicy = 'firewallPolicy1035044177'; + try { + $gapicClient->get($firewallPolicy); + // 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 getAssociationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $attachmentTarget = 'attachmentTarget1786386477'; + $displayName = 'displayName1615086568'; + $firewallPolicyId = 'firewallPolicyId1430953673'; + $name2 = 'name2-1052831874'; + $shortName = 'shortName1565793390'; + $expectedResponse = new FirewallPolicyAssociation(); + $expectedResponse->setAttachmentTarget($attachmentTarget); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setFirewallPolicyId($firewallPolicyId); + $expectedResponse->setName($name2); + $expectedResponse->setShortName($shortName); + $transport->addResponse($expectedResponse); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $response = $gapicClient->getAssociation($firewallPolicy); + $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.FirewallPolicies/GetAssociation', $actualFuncCall); + $actualValue = $actualRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAssociationExceptionTest() + { + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + try { + $gapicClient->getAssociation($firewallPolicy); + // 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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($resource); + $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.FirewallPolicies/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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 + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($resource); + // 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 getRuleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $action = 'action-1422950858'; + $description = 'description-1724546052'; + $direction = 'direction-962590849'; + $disabled = true; + $enableLogging = false; + $kind = 'kind3292052'; + $priority2 = 978365527; + $ruleName = 'ruleName-2092197394'; + $ruleTupleCount = 388342037; + $securityProfileGroup = 'securityProfileGroup-329459286'; + $tlsInspect = true; + $expectedResponse = new FirewallPolicyRule(); + $expectedResponse->setAction($action); + $expectedResponse->setDescription($description); + $expectedResponse->setDirection($direction); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setEnableLogging($enableLogging); + $expectedResponse->setKind($kind); + $expectedResponse->setPriority($priority2); + $expectedResponse->setRuleName($ruleName); + $expectedResponse->setRuleTupleCount($ruleTupleCount); + $expectedResponse->setSecurityProfileGroup($securityProfileGroup); + $expectedResponse->setTlsInspect($tlsInspect); + $transport->addResponse($expectedResponse); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $response = $gapicClient->getRule($firewallPolicy); + $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.FirewallPolicies/GetRule', $actualFuncCall); + $actualValue = $actualRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRuleExceptionTest() + { + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + try { + $gapicClient->getRule($firewallPolicy); + // 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 GlobalOrganizationOperationsClient([ + '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 + $firewallPolicyResource = new FirewallPolicy(); + $parentId = 'parentId2070327504'; + $response = $gapicClient->insert($firewallPolicyResource, $parentId); + $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.FirewallPolicies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicyResource(); + $this->assertProtobufEquals($firewallPolicyResource, $actualValue); + $actualValue = $actualApiRequestObject->getParentId(); + $this->assertProtobufEquals($parentId, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOrganizationOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $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.GlobalOrganizationOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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 + $firewallPolicyResource = new FirewallPolicy(); + $parentId = 'parentId2070327504'; + $response = $gapicClient->insert($firewallPolicyResource, $parentId); + $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 = ''; + $itemsElement = new FirewallPolicy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new FirewallPolicyList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + $response = $gapicClient->list(); + $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.FirewallPolicies/List', $actualFuncCall); + $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); + try { + $gapicClient->list(); + // 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 listAssociationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $kind = 'kind3292052'; + $expectedResponse = new FirewallPoliciesListAssociationsResponse(); + $expectedResponse->setKind($kind); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listAssociations(); + $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.FirewallPolicies/ListAssociations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAssociationsExceptionTest() + { + $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); + try { + $gapicClient->listAssociations(); + // 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 moveTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/moveTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/moveTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $parentId = 'parentId2070327504'; + $response = $gapicClient->move($firewallPolicy, $parentId); + $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.FirewallPolicies/Move', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getParentId(); + $this->assertProtobufEquals($parentId, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOrganizationOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $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.GlobalOrganizationOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function moveExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/moveExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $parentId = 'parentId2070327504'; + $response = $gapicClient->move($firewallPolicy, $parentId); + $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 patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyResource = new FirewallPolicy(); + $response = $gapicClient->patch($firewallPolicy, $firewallPolicyResource); + $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.FirewallPolicies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyResource(); + $this->assertProtobufEquals($firewallPolicyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOrganizationOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $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.GlobalOrganizationOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/patchExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyResource = new FirewallPolicy(); + $response = $gapicClient->patch($firewallPolicy, $firewallPolicyResource); + $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 patchRuleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/patchRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $response = $gapicClient->patchRule($firewallPolicy, $firewallPolicyRuleResource); + $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.FirewallPolicies/PatchRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyRuleResource(); + $this->assertProtobufEquals($firewallPolicyRuleResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOrganizationOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $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.GlobalOrganizationOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchRuleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/patchRuleExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $response = $gapicClient->patchRule($firewallPolicy, $firewallPolicyRuleResource); + $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 removeAssociationTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/removeAssociationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeAssociationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $response = $gapicClient->removeAssociation($firewallPolicy); + $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.FirewallPolicies/RemoveAssociation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOrganizationOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $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.GlobalOrganizationOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function removeAssociationExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/removeAssociationExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $response = $gapicClient->removeAssociation($firewallPolicy); + $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 removeRuleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/removeRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $response = $gapicClient->removeRule($firewallPolicy); + $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.FirewallPolicies/RemoveRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOrganizationOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $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.GlobalOrganizationOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function removeRuleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOrganizationOperationsClient([ + '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/removeRuleExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $response = $gapicClient->removeRule($firewallPolicy); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $globalOrganizationSetPolicyRequestResource = new GlobalOrganizationSetPolicyRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setIamPolicy($globalOrganizationSetPolicyRequestResource, $resource); + $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.FirewallPolicies/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getGlobalOrganizationSetPolicyRequestResource(); + $this->assertProtobufEquals($globalOrganizationSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $globalOrganizationSetPolicyRequestResource = new GlobalOrganizationSetPolicyRequest(); + $resource = 'resource-341064690'; + try { + $gapicClient->setIamPolicy($globalOrganizationSetPolicyRequestResource, $resource); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $response = $gapicClient->testIamPermissions($resource, $testPermissionsRequestResource); + $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.FirewallPolicies/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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 + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + try { + $gapicClient->testIamPermissions($resource, $testPermissionsRequestResource); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/FirewallsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/FirewallsClientTest.php new file mode 100644 index 000000000000..d3be59750f86 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/FirewallsClientTest.php @@ -0,0 +1,686 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return FirewallsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new FirewallsClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $firewall = 'firewall-562725632'; + $project = 'project-309310695'; + $response = $gapicClient->delete($firewall, $project); + $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.Firewalls/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewall(); + $this->assertProtobufEquals($firewall, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $firewall = 'firewall-562725632'; + $project = 'project-309310695'; + $response = $gapicClient->delete($firewall, $project); + $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'; + $direction = 'direction-962590849'; + $disabled = true; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $network = 'network1843485230'; + $priority = 1165461084; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new Firewall(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDirection($direction); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setPriority($priority); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $firewall = 'firewall-562725632'; + $project = 'project-309310695'; + $response = $gapicClient->get($firewall, $project); + $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.Firewalls/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getFirewall(); + $this->assertProtobufEquals($firewall, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $firewall = 'firewall-562725632'; + $project = 'project-309310695'; + try { + $gapicClient->get($firewall, $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 insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $firewallResource = new Firewall(); + $project = 'project-309310695'; + $response = $gapicClient->insert($firewallResource, $project); + $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.Firewalls/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallResource(); + $this->assertProtobufEquals($firewallResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $firewallResource = new Firewall(); + $project = 'project-309310695'; + $response = $gapicClient->insert($firewallResource, $project); + $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 Firewall(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new FirewallList(); + $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->list($project); + $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.Firewalls/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewall = 'firewall-562725632'; + $firewallResource = new Firewall(); + $project = 'project-309310695'; + $response = $gapicClient->patch($firewall, $firewallResource, $project); + $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.Firewalls/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewall(); + $this->assertProtobufEquals($firewall, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallResource(); + $this->assertProtobufEquals($firewallResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $firewall = 'firewall-562725632'; + $firewallResource = new Firewall(); + $project = 'project-309310695'; + $response = $gapicClient->patch($firewall, $firewallResource, $project); + $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 updateTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $firewall = 'firewall-562725632'; + $firewallResource = new Firewall(); + $project = 'project-309310695'; + $response = $gapicClient->update($firewall, $firewallResource, $project); + $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.Firewalls/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewall(); + $this->assertProtobufEquals($firewall, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallResource(); + $this->assertProtobufEquals($firewallResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $firewall = 'firewall-562725632'; + $firewallResource = new Firewall(); + $project = 'project-309310695'; + $response = $gapicClient->update($firewall, $firewallResource, $project); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/ForwardingRulesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/ForwardingRulesClientTest.php new file mode 100644 index 000000000000..dae648d10b49 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/ForwardingRulesClientTest.php @@ -0,0 +1,956 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ForwardingRulesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ForwardingRulesClient($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 ForwardingRulesScopedList(), + ]; + $expectedResponse = new ForwardingRuleAggregatedList(); + $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.ForwardingRules/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() + { + $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 + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($forwardingRule, $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.ForwardingRules/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getForwardingRule(); + $this->assertProtobufEquals($forwardingRule, $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 + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($forwardingRule, $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 + $iPAddress = 'iPAddress1116718767'; + $iPProtocol = 'iPProtocol488094525'; + $allPorts = true; + $allowGlobalAccess = true; + $allowPscGlobalAccess = false; + $backendService = 'backendService306946058'; + $baseForwardingRule = 'baseForwardingRule524873104'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $ipCollection = 'ipCollection176818358'; + $ipVersion = 'ipVersion-1315653184'; + $isMirroringCollector = true; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $loadBalancingScheme = 'loadBalancingScheme1974502980'; + $name = 'name3373707'; + $network = 'network1843485230'; + $networkTier = 'networkTier-19473069'; + $noAutomateDnsZone = false; + $portRange = 'portRange217518079'; + $pscConnectionId = 292082397; + $pscConnectionStatus = 'pscConnectionStatus-889592652'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $serviceLabel = 'serviceLabel-1730474774'; + $serviceName = 'serviceName359880149'; + $subnetwork = 'subnetwork-1302785042'; + $target = 'target-880905839'; + $expectedResponse = new ForwardingRule(); + $expectedResponse->setIPAddress($iPAddress); + $expectedResponse->setIPProtocol($iPProtocol); + $expectedResponse->setAllPorts($allPorts); + $expectedResponse->setAllowGlobalAccess($allowGlobalAccess); + $expectedResponse->setAllowPscGlobalAccess($allowPscGlobalAccess); + $expectedResponse->setBackendService($backendService); + $expectedResponse->setBaseForwardingRule($baseForwardingRule); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setIpCollection($ipCollection); + $expectedResponse->setIpVersion($ipVersion); + $expectedResponse->setIsMirroringCollector($isMirroringCollector); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setLoadBalancingScheme($loadBalancingScheme); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setNetworkTier($networkTier); + $expectedResponse->setNoAutomateDnsZone($noAutomateDnsZone); + $expectedResponse->setPortRange($portRange); + $expectedResponse->setPscConnectionId($pscConnectionId); + $expectedResponse->setPscConnectionStatus($pscConnectionStatus); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setServiceLabel($serviceLabel); + $expectedResponse->setServiceName($serviceName); + $expectedResponse->setSubnetwork($subnetwork); + $expectedResponse->setTarget($target); + $transport->addResponse($expectedResponse); + // Mock request + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($forwardingRule, $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.ForwardingRules/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getForwardingRule(); + $this->assertProtobufEquals($forwardingRule, $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 + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($forwardingRule, $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 + $forwardingRuleResource = new ForwardingRule(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($forwardingRuleResource, $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.ForwardingRules/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getForwardingRuleResource(); + $this->assertProtobufEquals($forwardingRuleResource, $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 + $forwardingRuleResource = new ForwardingRule(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($forwardingRuleResource, $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 ForwardingRule(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new ForwardingRuleList(); + $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.ForwardingRules/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()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $forwardingRule = 'forwardingRule-1340648706'; + $forwardingRuleResource = new ForwardingRule(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patch($forwardingRule, $forwardingRuleResource, $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.ForwardingRules/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getForwardingRule(); + $this->assertProtobufEquals($forwardingRule, $actualValue); + $actualValue = $actualApiRequestObject->getForwardingRuleResource(); + $this->assertProtobufEquals($forwardingRuleResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $forwardingRule = 'forwardingRule-1340648706'; + $forwardingRuleResource = new ForwardingRule(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patch($forwardingRule, $forwardingRuleResource, $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 setLabelsTest() + { + $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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + $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.ForwardingRules/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionSetLabelsRequestResource(); + $this->assertProtobufEquals($regionSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $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 setLabelsExceptionTest() + { + $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/setLabelsExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + $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 setTargetTest() + { + $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/setTargetTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setTargetTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetReferenceResource = new TargetReference(); + $response = $gapicClient->setTarget($forwardingRule, $project, $region, $targetReferenceResource); + $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.ForwardingRules/SetTarget', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getForwardingRule(); + $this->assertProtobufEquals($forwardingRule, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetReferenceResource(); + $this->assertProtobufEquals($targetReferenceResource, $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 setTargetExceptionTest() + { + $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/setTargetExceptionTest'); + $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 + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetReferenceResource = new TargetReference(); + $response = $gapicClient->setTarget($forwardingRule, $project, $region, $targetReferenceResource); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalAddressesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalAddressesClientTest.php new file mode 100644 index 000000000000..df8206e26abe --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalAddressesClientTest.php @@ -0,0 +1,704 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return GlobalAddressesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new GlobalAddressesClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $address = 'address-1147692044'; + $project = 'project-309310695'; + $response = $gapicClient->delete($address, $project); + $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.GlobalAddresses/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAddress(); + $this->assertProtobufEquals($address, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $address = 'address-1147692044'; + $project = 'project-309310695'; + $response = $gapicClient->delete($address, $project); + $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 + $address2 = 'address2874543783'; + $addressType = 'addressType264307877'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $id = 3355; + $ipVersion = 'ipVersion-1315653184'; + $ipv6EndpointType = 'ipv6EndpointType-2049982644'; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $network = 'network1843485230'; + $networkTier = 'networkTier-19473069'; + $prefixLength = 1157046989; + $purpose = 'purpose-220463842'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $subnetwork = 'subnetwork-1302785042'; + $expectedResponse = new Address(); + $expectedResponse->setAddress($address2); + $expectedResponse->setAddressType($addressType); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setIpVersion($ipVersion); + $expectedResponse->setIpv6EndpointType($ipv6EndpointType); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setNetworkTier($networkTier); + $expectedResponse->setPrefixLength($prefixLength); + $expectedResponse->setPurpose($purpose); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $expectedResponse->setSubnetwork($subnetwork); + $transport->addResponse($expectedResponse); + // Mock request + $address = 'address-1147692044'; + $project = 'project-309310695'; + $response = $gapicClient->get($address, $project); + $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.GlobalAddresses/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getAddress(); + $this->assertProtobufEquals($address, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $address = 'address-1147692044'; + $project = 'project-309310695'; + try { + $gapicClient->get($address, $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 insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $addressResource = new Address(); + $project = 'project-309310695'; + $response = $gapicClient->insert($addressResource, $project); + $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.GlobalAddresses/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAddressResource(); + $this->assertProtobufEquals($addressResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $addressResource = new Address(); + $project = 'project-309310695'; + $response = $gapicClient->insert($addressResource, $project); + $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 Address(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new AddressList(); + $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->list($project); + $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.GlobalAddresses/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 moveTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/moveTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/moveTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $address = 'address-1147692044'; + $globalAddressesMoveRequestResource = new GlobalAddressesMoveRequest(); + $project = 'project-309310695'; + $response = $gapicClient->move($address, $globalAddressesMoveRequestResource, $project); + $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.GlobalAddresses/Move', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAddress(); + $this->assertProtobufEquals($address, $actualValue); + $actualValue = $actualApiRequestObject->getGlobalAddressesMoveRequestResource(); + $this->assertProtobufEquals($globalAddressesMoveRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function moveExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/moveExceptionTest'); + $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 + $address = 'address-1147692044'; + $globalAddressesMoveRequestResource = new GlobalAddressesMoveRequest(); + $project = 'project-309310695'; + $response = $gapicClient->move($address, $globalAddressesMoveRequestResource, $project); + $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 setLabelsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + $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.GlobalAddresses/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getGlobalSetLabelsRequestResource(); + $this->assertProtobufEquals($globalSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setLabelsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsExceptionTest'); + $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 + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalForwardingRulesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalForwardingRulesClientTest.php new file mode 100644 index 000000000000..0f8702077e2e --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalForwardingRulesClientTest.php @@ -0,0 +1,846 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return GlobalForwardingRulesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new GlobalForwardingRulesClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $response = $gapicClient->delete($forwardingRule, $project); + $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.GlobalForwardingRules/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getForwardingRule(); + $this->assertProtobufEquals($forwardingRule, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $response = $gapicClient->delete($forwardingRule, $project); + $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 + $iPAddress = 'iPAddress1116718767'; + $iPProtocol = 'iPProtocol488094525'; + $allPorts = true; + $allowGlobalAccess = true; + $allowPscGlobalAccess = false; + $backendService = 'backendService306946058'; + $baseForwardingRule = 'baseForwardingRule524873104'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $ipCollection = 'ipCollection176818358'; + $ipVersion = 'ipVersion-1315653184'; + $isMirroringCollector = true; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $loadBalancingScheme = 'loadBalancingScheme1974502980'; + $name = 'name3373707'; + $network = 'network1843485230'; + $networkTier = 'networkTier-19473069'; + $noAutomateDnsZone = false; + $portRange = 'portRange217518079'; + $pscConnectionId = 292082397; + $pscConnectionStatus = 'pscConnectionStatus-889592652'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $serviceLabel = 'serviceLabel-1730474774'; + $serviceName = 'serviceName359880149'; + $subnetwork = 'subnetwork-1302785042'; + $target = 'target-880905839'; + $expectedResponse = new ForwardingRule(); + $expectedResponse->setIPAddress($iPAddress); + $expectedResponse->setIPProtocol($iPProtocol); + $expectedResponse->setAllPorts($allPorts); + $expectedResponse->setAllowGlobalAccess($allowGlobalAccess); + $expectedResponse->setAllowPscGlobalAccess($allowPscGlobalAccess); + $expectedResponse->setBackendService($backendService); + $expectedResponse->setBaseForwardingRule($baseForwardingRule); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setIpCollection($ipCollection); + $expectedResponse->setIpVersion($ipVersion); + $expectedResponse->setIsMirroringCollector($isMirroringCollector); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setLoadBalancingScheme($loadBalancingScheme); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setNetworkTier($networkTier); + $expectedResponse->setNoAutomateDnsZone($noAutomateDnsZone); + $expectedResponse->setPortRange($portRange); + $expectedResponse->setPscConnectionId($pscConnectionId); + $expectedResponse->setPscConnectionStatus($pscConnectionStatus); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setServiceLabel($serviceLabel); + $expectedResponse->setServiceName($serviceName); + $expectedResponse->setSubnetwork($subnetwork); + $expectedResponse->setTarget($target); + $transport->addResponse($expectedResponse); + // Mock request + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $response = $gapicClient->get($forwardingRule, $project); + $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.GlobalForwardingRules/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getForwardingRule(); + $this->assertProtobufEquals($forwardingRule, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + try { + $gapicClient->get($forwardingRule, $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 insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $forwardingRuleResource = new ForwardingRule(); + $project = 'project-309310695'; + $response = $gapicClient->insert($forwardingRuleResource, $project); + $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.GlobalForwardingRules/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getForwardingRuleResource(); + $this->assertProtobufEquals($forwardingRuleResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $forwardingRuleResource = new ForwardingRule(); + $project = 'project-309310695'; + $response = $gapicClient->insert($forwardingRuleResource, $project); + $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 ForwardingRule(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new ForwardingRuleList(); + $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->list($project); + $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.GlobalForwardingRules/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $forwardingRule = 'forwardingRule-1340648706'; + $forwardingRuleResource = new ForwardingRule(); + $project = 'project-309310695'; + $response = $gapicClient->patch($forwardingRule, $forwardingRuleResource, $project); + $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.GlobalForwardingRules/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getForwardingRule(); + $this->assertProtobufEquals($forwardingRule, $actualValue); + $actualValue = $actualApiRequestObject->getForwardingRuleResource(); + $this->assertProtobufEquals($forwardingRuleResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $forwardingRule = 'forwardingRule-1340648706'; + $forwardingRuleResource = new ForwardingRule(); + $project = 'project-309310695'; + $response = $gapicClient->patch($forwardingRule, $forwardingRuleResource, $project); + $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 setLabelsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + $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.GlobalForwardingRules/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getGlobalSetLabelsRequestResource(); + $this->assertProtobufEquals($globalSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setLabelsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsExceptionTest'); + $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 + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + $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 setTargetTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setTargetTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setTargetTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $targetReferenceResource = new TargetReference(); + $response = $gapicClient->setTarget($forwardingRule, $project, $targetReferenceResource); + $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.GlobalForwardingRules/SetTarget', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getForwardingRule(); + $this->assertProtobufEquals($forwardingRule, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetReferenceResource(); + $this->assertProtobufEquals($targetReferenceResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setTargetExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setTargetExceptionTest'); + $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 + $forwardingRule = 'forwardingRule-1340648706'; + $project = 'project-309310695'; + $targetReferenceResource = new TargetReference(); + $response = $gapicClient->setTarget($forwardingRule, $project, $targetReferenceResource); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalNetworkEndpointGroupsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalNetworkEndpointGroupsClientTest.php new file mode 100644 index 000000000000..c26eff909ead --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalNetworkEndpointGroupsClientTest.php @@ -0,0 +1,774 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return GlobalNetworkEndpointGroupsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new GlobalNetworkEndpointGroupsClient($options); + } + + /** @test */ + public function attachNetworkEndpointsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/attachNetworkEndpointsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/attachNetworkEndpointsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $globalNetworkEndpointGroupsAttachEndpointsRequestResource = new GlobalNetworkEndpointGroupsAttachEndpointsRequest(); + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $response = $gapicClient->attachNetworkEndpoints($globalNetworkEndpointGroupsAttachEndpointsRequestResource, $networkEndpointGroup, $project); + $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.GlobalNetworkEndpointGroups/AttachNetworkEndpoints', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getGlobalNetworkEndpointGroupsAttachEndpointsRequestResource(); + $this->assertProtobufEquals($globalNetworkEndpointGroupsAttachEndpointsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function attachNetworkEndpointsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/attachNetworkEndpointsExceptionTest'); + $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 + $globalNetworkEndpointGroupsAttachEndpointsRequestResource = new GlobalNetworkEndpointGroupsAttachEndpointsRequest(); + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $response = $gapicClient->attachNetworkEndpoints($globalNetworkEndpointGroupsAttachEndpointsRequestResource, $networkEndpointGroup, $project); + $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 deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $response = $gapicClient->delete($networkEndpointGroup, $project); + $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.GlobalNetworkEndpointGroups/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $response = $gapicClient->delete($networkEndpointGroup, $project); + $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 detachNetworkEndpointsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/detachNetworkEndpointsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/detachNetworkEndpointsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $globalNetworkEndpointGroupsDetachEndpointsRequestResource = new GlobalNetworkEndpointGroupsDetachEndpointsRequest(); + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $response = $gapicClient->detachNetworkEndpoints($globalNetworkEndpointGroupsDetachEndpointsRequestResource, $networkEndpointGroup, $project); + $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.GlobalNetworkEndpointGroups/DetachNetworkEndpoints', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getGlobalNetworkEndpointGroupsDetachEndpointsRequestResource(); + $this->assertProtobufEquals($globalNetworkEndpointGroupsDetachEndpointsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function detachNetworkEndpointsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/detachNetworkEndpointsExceptionTest'); + $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 + $globalNetworkEndpointGroupsDetachEndpointsRequestResource = new GlobalNetworkEndpointGroupsDetachEndpointsRequest(); + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $response = $gapicClient->detachNetworkEndpoints($globalNetworkEndpointGroupsDetachEndpointsRequestResource, $networkEndpointGroup, $project); + $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'; + $defaultPort = 650363969; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $network = 'network1843485230'; + $networkEndpointType = 'networkEndpointType118301523'; + $pscTargetService = 'pscTargetService1879744870'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $size = 3530753; + $subnetwork = 'subnetwork-1302785042'; + $zone = 'zone3744684'; + $expectedResponse = new NetworkEndpointGroup(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDefaultPort($defaultPort); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setNetworkEndpointType($networkEndpointType); + $expectedResponse->setPscTargetService($pscTargetService); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSize($size); + $expectedResponse->setSubnetwork($subnetwork); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $response = $gapicClient->get($networkEndpointGroup, $project); + $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.GlobalNetworkEndpointGroups/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + try { + $gapicClient->get($networkEndpointGroup, $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 insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $networkEndpointGroupResource = new NetworkEndpointGroup(); + $project = 'project-309310695'; + $response = $gapicClient->insert($networkEndpointGroupResource, $project); + $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.GlobalNetworkEndpointGroups/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroupResource(); + $this->assertProtobufEquals($networkEndpointGroupResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $networkEndpointGroupResource = new NetworkEndpointGroup(); + $project = 'project-309310695'; + $response = $gapicClient->insert($networkEndpointGroupResource, $project); + $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 NetworkEndpointGroup(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NetworkEndpointGroupList(); + $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->list($project); + $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.GlobalNetworkEndpointGroups/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 listNetworkEndpointsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $itemsElement = new NetworkEndpointWithHealthStatus(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NetworkEndpointGroupsListNetworkEndpoints(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $response = $gapicClient->listNetworkEndpoints($networkEndpointGroup, $project); + $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.GlobalNetworkEndpointGroups/ListNetworkEndpoints', $actualFuncCall); + $actualValue = $actualRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNetworkEndpointsExceptionTest() + { + $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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + try { + $gapicClient->listNetworkEndpoints($networkEndpointGroup, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalOperationsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalOperationsClientTest.php new file mode 100644 index 000000000000..9e86f44f8f9a --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalOperationsClientTest.php @@ -0,0 +1,484 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return GlobalOperationsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new GlobalOperationsClient($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 OperationsScopedList(), + ]; + $expectedResponse = new OperationAggregatedList(); + $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.GlobalOperations/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() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new DeleteGlobalOperationResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $response = $gapicClient->delete($operation, $project); + $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.GlobalOperations/Delete', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $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 + $operation = 'operation1662702951'; + $project = 'project-309310695'; + try { + $gapicClient->delete($operation, $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 getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $clientOperationId = 'clientOperationId-239630617'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $endTime = 'endTime1725551537'; + $httpErrorMessage = 'httpErrorMessage1276263769'; + $httpErrorStatusCode = 1386087020; + $id = 3355; + $insertTime = 'insertTime-103148397'; + $kind = 'kind3292052'; + $name = 'name3373707'; + $operationGroupId = 'operationGroupId40171187'; + $operationType = 'operationType-1432962286'; + $progress = 1001078227; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $startTime = 'startTime-1573145462'; + $statusMessage = 'statusMessage-239442758'; + $targetId = 815576439; + $targetLink = 'targetLink-2084812312'; + $user = 'user3599307'; + $zone = 'zone3744684'; + $expectedResponse = new Operation(); + $expectedResponse->setClientOperationId($clientOperationId); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEndTime($endTime); + $expectedResponse->setHttpErrorMessage($httpErrorMessage); + $expectedResponse->setHttpErrorStatusCode($httpErrorStatusCode); + $expectedResponse->setId($id); + $expectedResponse->setInsertTime($insertTime); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setOperationGroupId($operationGroupId); + $expectedResponse->setOperationType($operationType); + $expectedResponse->setProgress($progress); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStartTime($startTime); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setTargetId($targetId); + $expectedResponse->setTargetLink($targetLink); + $expectedResponse->setUser($user); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $response = $gapicClient->get($operation, $project); + $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.GlobalOperations/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $operation = 'operation1662702951'; + $project = 'project-309310695'; + try { + $gapicClient->get($operation, $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 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 Operation(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new OperationList(); + $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->list($project); + $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.GlobalOperations/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 waitTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $clientOperationId = 'clientOperationId-239630617'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $endTime = 'endTime1725551537'; + $httpErrorMessage = 'httpErrorMessage1276263769'; + $httpErrorStatusCode = 1386087020; + $id = 3355; + $insertTime = 'insertTime-103148397'; + $kind = 'kind3292052'; + $name = 'name3373707'; + $operationGroupId = 'operationGroupId40171187'; + $operationType = 'operationType-1432962286'; + $progress = 1001078227; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $startTime = 'startTime-1573145462'; + $statusMessage = 'statusMessage-239442758'; + $targetId = 815576439; + $targetLink = 'targetLink-2084812312'; + $user = 'user3599307'; + $zone = 'zone3744684'; + $expectedResponse = new Operation(); + $expectedResponse->setClientOperationId($clientOperationId); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEndTime($endTime); + $expectedResponse->setHttpErrorMessage($httpErrorMessage); + $expectedResponse->setHttpErrorStatusCode($httpErrorStatusCode); + $expectedResponse->setId($id); + $expectedResponse->setInsertTime($insertTime); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setOperationGroupId($operationGroupId); + $expectedResponse->setOperationType($operationType); + $expectedResponse->setProgress($progress); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStartTime($startTime); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setTargetId($targetId); + $expectedResponse->setTargetLink($targetLink); + $expectedResponse->setUser($user); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $response = $gapicClient->wait($operation, $project); + $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.GlobalOperations/Wait', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function waitExceptionTest() + { + $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 + $operation = 'operation1662702951'; + $project = 'project-309310695'; + try { + $gapicClient->wait($operation, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalOrganizationOperationsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalOrganizationOperationsClientTest.php new file mode 100644 index 000000000000..70f85fe160ac --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalOrganizationOperationsClientTest.php @@ -0,0 +1,289 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return GlobalOrganizationOperationsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new GlobalOrganizationOperationsClient($options); + } + + /** @test */ + public function deleteTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new DeleteGlobalOrganizationOperationResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $response = $gapicClient->delete($operation); + $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.GlobalOrganizationOperations/Delete', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $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 + $operation = 'operation1662702951'; + try { + $gapicClient->delete($operation); + // 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 getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $clientOperationId = 'clientOperationId-239630617'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $endTime = 'endTime1725551537'; + $httpErrorMessage = 'httpErrorMessage1276263769'; + $httpErrorStatusCode = 1386087020; + $id = 3355; + $insertTime = 'insertTime-103148397'; + $kind = 'kind3292052'; + $name = 'name3373707'; + $operationGroupId = 'operationGroupId40171187'; + $operationType = 'operationType-1432962286'; + $progress = 1001078227; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $startTime = 'startTime-1573145462'; + $statusMessage = 'statusMessage-239442758'; + $targetId = 815576439; + $targetLink = 'targetLink-2084812312'; + $user = 'user3599307'; + $zone = 'zone3744684'; + $expectedResponse = new Operation(); + $expectedResponse->setClientOperationId($clientOperationId); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEndTime($endTime); + $expectedResponse->setHttpErrorMessage($httpErrorMessage); + $expectedResponse->setHttpErrorStatusCode($httpErrorStatusCode); + $expectedResponse->setId($id); + $expectedResponse->setInsertTime($insertTime); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setOperationGroupId($operationGroupId); + $expectedResponse->setOperationType($operationType); + $expectedResponse->setProgress($progress); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStartTime($startTime); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setTargetId($targetId); + $expectedResponse->setTargetLink($targetLink); + $expectedResponse->setUser($user); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $response = $gapicClient->get($operation); + $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.GlobalOrganizationOperations/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $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 + $operation = 'operation1662702951'; + try { + $gapicClient->get($operation); + // 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 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 Operation(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new OperationList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + $response = $gapicClient->list(); + $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.GlobalOrganizationOperations/List', $actualFuncCall); + $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); + try { + $gapicClient->list(); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalPublicDelegatedPrefixesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalPublicDelegatedPrefixesClientTest.php new file mode 100644 index 000000000000..dbc1396ae205 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/GlobalPublicDelegatedPrefixesClientTest.php @@ -0,0 +1,578 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return GlobalPublicDelegatedPrefixesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new GlobalPublicDelegatedPrefixesClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $response = $gapicClient->delete($project, $publicDelegatedPrefix); + $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.GlobalPublicDelegatedPrefixes/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicDelegatedPrefix(); + $this->assertProtobufEquals($publicDelegatedPrefix, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $response = $gapicClient->delete($project, $publicDelegatedPrefix); + $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 + $allocatablePrefixLength = 1649040182; + $byoipApiVersion = 'byoipApiVersion162683283'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $ipCidrRange = 'ipCidrRange-2049366326'; + $isLiveMigration = true; + $kind = 'kind3292052'; + $mode = 'mode3357091'; + $name = 'name3373707'; + $parentPrefix = 'parentPrefix552104903'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $expectedResponse = new PublicDelegatedPrefix(); + $expectedResponse->setAllocatablePrefixLength($allocatablePrefixLength); + $expectedResponse->setByoipApiVersion($byoipApiVersion); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setIpCidrRange($ipCidrRange); + $expectedResponse->setIsLiveMigration($isLiveMigration); + $expectedResponse->setKind($kind); + $expectedResponse->setMode($mode); + $expectedResponse->setName($name); + $expectedResponse->setParentPrefix($parentPrefix); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $response = $gapicClient->get($project, $publicDelegatedPrefix); + $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.GlobalPublicDelegatedPrefixes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getPublicDelegatedPrefix(); + $this->assertProtobufEquals($publicDelegatedPrefix, $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 + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + try { + $gapicClient->get($project, $publicDelegatedPrefix); + // 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 GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + $response = $gapicClient->insert($project, $publicDelegatedPrefixResource); + $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.GlobalPublicDelegatedPrefixes/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicDelegatedPrefixResource(); + $this->assertProtobufEquals($publicDelegatedPrefixResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + $response = $gapicClient->insert($project, $publicDelegatedPrefixResource); + $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 PublicDelegatedPrefix(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new PublicDelegatedPrefixList(); + $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->list($project); + $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.GlobalPublicDelegatedPrefixes/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + $response = $gapicClient->patch($project, $publicDelegatedPrefix, $publicDelegatedPrefixResource); + $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.GlobalPublicDelegatedPrefixes/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicDelegatedPrefix(); + $this->assertProtobufEquals($publicDelegatedPrefix, $actualValue); + $actualValue = $actualApiRequestObject->getPublicDelegatedPrefixResource(); + $this->assertProtobufEquals($publicDelegatedPrefixResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + $response = $gapicClient->patch($project, $publicDelegatedPrefix, $publicDelegatedPrefixResource); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/HealthChecksClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/HealthChecksClientTest.php new file mode 100644 index 000000000000..b0b6d70315cb --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/HealthChecksClientTest.php @@ -0,0 +1,767 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return HealthChecksClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new HealthChecksClient($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 HealthChecksScopedList(), + ]; + $expectedResponse = new HealthChecksAggregatedList(); + $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.HealthChecks/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() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $healthCheck = 'healthCheck845747557'; + $project = 'project-309310695'; + $response = $gapicClient->delete($healthCheck, $project); + $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.HealthChecks/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheck(); + $this->assertProtobufEquals($healthCheck, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $healthCheck = 'healthCheck845747557'; + $project = 'project-309310695'; + $response = $gapicClient->delete($healthCheck, $project); + $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 + $checkIntervalSec = 345561006; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $healthyThreshold = 133658551; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $timeoutSec = 2067488653; + $type = 'type3575610'; + $unhealthyThreshold = 1838571216; + $expectedResponse = new HealthCheck(); + $expectedResponse->setCheckIntervalSec($checkIntervalSec); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setHealthyThreshold($healthyThreshold); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setTimeoutSec($timeoutSec); + $expectedResponse->setType($type); + $expectedResponse->setUnhealthyThreshold($unhealthyThreshold); + $transport->addResponse($expectedResponse); + // Mock request + $healthCheck = 'healthCheck845747557'; + $project = 'project-309310695'; + $response = $gapicClient->get($healthCheck, $project); + $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.HealthChecks/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getHealthCheck(); + $this->assertProtobufEquals($healthCheck, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $healthCheck = 'healthCheck845747557'; + $project = 'project-309310695'; + try { + $gapicClient->get($healthCheck, $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 insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $response = $gapicClient->insert($healthCheckResource, $project); + $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.HealthChecks/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheckResource(); + $this->assertProtobufEquals($healthCheckResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $response = $gapicClient->insert($healthCheckResource, $project); + $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 HealthCheck(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new HealthCheckList(); + $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->list($project); + $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.HealthChecks/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $healthCheck = 'healthCheck845747557'; + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $response = $gapicClient->patch($healthCheck, $healthCheckResource, $project); + $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.HealthChecks/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheck(); + $this->assertProtobufEquals($healthCheck, $actualValue); + $actualValue = $actualApiRequestObject->getHealthCheckResource(); + $this->assertProtobufEquals($healthCheckResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $healthCheck = 'healthCheck845747557'; + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $response = $gapicClient->patch($healthCheck, $healthCheckResource, $project); + $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 updateTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $healthCheck = 'healthCheck845747557'; + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $response = $gapicClient->update($healthCheck, $healthCheckResource, $project); + $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.HealthChecks/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheck(); + $this->assertProtobufEquals($healthCheck, $actualValue); + $actualValue = $actualApiRequestObject->getHealthCheckResource(); + $this->assertProtobufEquals($healthCheckResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $healthCheck = 'healthCheck845747557'; + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $response = $gapicClient->update($healthCheck, $healthCheckResource, $project); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/ImageFamilyViewsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/ImageFamilyViewsClientTest.php new file mode 100644 index 000000000000..f61914fe435e --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/ImageFamilyViewsClientTest.php @@ -0,0 +1,127 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ImageFamilyViewsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ImageFamilyViewsClient($options); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ImageFamilyView(); + $transport->addResponse($expectedResponse); + // Mock request + $family = 'family-1281860764'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->get($family, $project, $zone); + $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.ImageFamilyViews/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getFamily(); + $this->assertProtobufEquals($family, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $family = 'family-1281860764'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->get($family, $project, $zone); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/ImagesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/ImagesClientTest.php new file mode 100644 index 000000000000..6ebf8cf921dd --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/ImagesClientTest.php @@ -0,0 +1,1146 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ImagesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ImagesClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $image = 'image100313435'; + $project = 'project-309310695'; + $response = $gapicClient->delete($image, $project); + $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.Images/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getImage(); + $this->assertProtobufEquals($image, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $image = 'image100313435'; + $project = 'project-309310695'; + $response = $gapicClient->delete($image, $project); + $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 deprecateTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deprecateTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deprecateTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $deprecationStatusResource = new DeprecationStatus(); + $image = 'image100313435'; + $project = 'project-309310695'; + $response = $gapicClient->deprecate($deprecationStatusResource, $image, $project); + $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.Images/Deprecate', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDeprecationStatusResource(); + $this->assertProtobufEquals($deprecationStatusResource, $actualValue); + $actualValue = $actualApiRequestObject->getImage(); + $this->assertProtobufEquals($image, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deprecateExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/deprecateExceptionTest'); + $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 + $deprecationStatusResource = new DeprecationStatus(); + $image = 'image100313435'; + $project = 'project-309310695'; + $response = $gapicClient->deprecate($deprecationStatusResource, $image, $project); + $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 + $architecture = 'architecture839674195'; + $archiveSizeBytes = 1766390198; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $diskSizeGb = 757478089; + $enableConfidentialCompute = true; + $family = 'family-1281860764'; + $id = 3355; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $satisfiesPzi = false; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $sourceDisk = 'sourceDisk-85117119'; + $sourceDiskId = 'sourceDiskId-1693292839'; + $sourceImage = 'sourceImage1661056055'; + $sourceImageId = 'sourceImageId-2092155357'; + $sourceSnapshot = 'sourceSnapshot-947679896'; + $sourceSnapshotId = 'sourceSnapshotId-1511650478'; + $sourceType = 'sourceType-84625186'; + $status = 'status-892481550'; + $expectedResponse = new Image(); + $expectedResponse->setArchitecture($architecture); + $expectedResponse->setArchiveSizeBytes($archiveSizeBytes); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDiskSizeGb($diskSizeGb); + $expectedResponse->setEnableConfidentialCompute($enableConfidentialCompute); + $expectedResponse->setFamily($family); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSourceDisk($sourceDisk); + $expectedResponse->setSourceDiskId($sourceDiskId); + $expectedResponse->setSourceImage($sourceImage); + $expectedResponse->setSourceImageId($sourceImageId); + $expectedResponse->setSourceSnapshot($sourceSnapshot); + $expectedResponse->setSourceSnapshotId($sourceSnapshotId); + $expectedResponse->setSourceType($sourceType); + $expectedResponse->setStatus($status); + $transport->addResponse($expectedResponse); + // Mock request + $image = 'image100313435'; + $project = 'project-309310695'; + $response = $gapicClient->get($image, $project); + $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.Images/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getImage(); + $this->assertProtobufEquals($image, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $image = 'image100313435'; + $project = 'project-309310695'; + try { + $gapicClient->get($image, $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 getFromFamilyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $architecture = 'architecture839674195'; + $archiveSizeBytes = 1766390198; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $diskSizeGb = 757478089; + $enableConfidentialCompute = true; + $family2 = 'family2787422743'; + $id = 3355; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $satisfiesPzi = false; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $sourceDisk = 'sourceDisk-85117119'; + $sourceDiskId = 'sourceDiskId-1693292839'; + $sourceImage = 'sourceImage1661056055'; + $sourceImageId = 'sourceImageId-2092155357'; + $sourceSnapshot = 'sourceSnapshot-947679896'; + $sourceSnapshotId = 'sourceSnapshotId-1511650478'; + $sourceType = 'sourceType-84625186'; + $status = 'status-892481550'; + $expectedResponse = new Image(); + $expectedResponse->setArchitecture($architecture); + $expectedResponse->setArchiveSizeBytes($archiveSizeBytes); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDiskSizeGb($diskSizeGb); + $expectedResponse->setEnableConfidentialCompute($enableConfidentialCompute); + $expectedResponse->setFamily($family2); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSourceDisk($sourceDisk); + $expectedResponse->setSourceDiskId($sourceDiskId); + $expectedResponse->setSourceImage($sourceImage); + $expectedResponse->setSourceImageId($sourceImageId); + $expectedResponse->setSourceSnapshot($sourceSnapshot); + $expectedResponse->setSourceSnapshotId($sourceSnapshotId); + $expectedResponse->setSourceType($sourceType); + $expectedResponse->setStatus($status); + $transport->addResponse($expectedResponse); + // Mock request + $family = 'family-1281860764'; + $project = 'project-309310695'; + $response = $gapicClient->getFromFamily($family, $project); + $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.Images/GetFromFamily', $actualFuncCall); + $actualValue = $actualRequestObject->getFamily(); + $this->assertProtobufEquals($family, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getFromFamilyExceptionTest() + { + $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 + $family = 'family-1281860764'; + $project = 'project-309310695'; + try { + $gapicClient->getFromFamily($family, $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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($project, $resource); + $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.Images/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($project, $resource); + // 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 GlobalOperationsClient([ + '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 + $imageResource = new Image(); + $project = 'project-309310695'; + $response = $gapicClient->insert($imageResource, $project); + $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.Images/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getImageResource(); + $this->assertProtobufEquals($imageResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $imageResource = new Image(); + $project = 'project-309310695'; + $response = $gapicClient->insert($imageResource, $project); + $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 Image(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new ImageList(); + $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->list($project); + $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.Images/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $image = 'image100313435'; + $imageResource = new Image(); + $project = 'project-309310695'; + $response = $gapicClient->patch($image, $imageResource, $project); + $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.Images/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getImage(); + $this->assertProtobufEquals($image, $actualValue); + $actualValue = $actualApiRequestObject->getImageResource(); + $this->assertProtobufEquals($imageResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $image = 'image100313435'; + $imageResource = new Image(); + $project = 'project-309310695'; + $response = $gapicClient->patch($image, $imageResource, $project); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + $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.Images/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getGlobalSetPolicyRequestResource(); + $this->assertProtobufEquals($globalSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + try { + $gapicClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + // 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 setLabelsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + $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.Images/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getGlobalSetLabelsRequestResource(); + $this->assertProtobufEquals($globalSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setLabelsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsExceptionTest'); + $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 + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $response = $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + $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.Images/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + try { + $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/InstanceGroupManagerResizeRequestsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/InstanceGroupManagerResizeRequestsClientTest.php new file mode 100644 index 000000000000..11f09c45f2be --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/InstanceGroupManagerResizeRequestsClientTest.php @@ -0,0 +1,607 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return InstanceGroupManagerResizeRequestsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new InstanceGroupManagerResizeRequestsClient($options); + } + + /** @test */ + public function cancelTest() + { + $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/cancelTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/cancelTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $resizeRequest = 'resizeRequest-319929852'; + $zone = 'zone3744684'; + $response = $gapicClient->cancel($instanceGroupManager, $project, $resizeRequest, $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.InstanceGroupManagerResizeRequests/Cancel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResizeRequest(); + $this->assertProtobufEquals($resizeRequest, $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 cancelExceptionTest() + { + $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/cancelExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $resizeRequest = 'resizeRequest-319929852'; + $zone = 'zone3744684'; + $response = $gapicClient->cancel($instanceGroupManager, $project, $resizeRequest, $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 deleteTest() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $resizeRequest = 'resizeRequest-319929852'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($instanceGroupManager, $project, $resizeRequest, $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.InstanceGroupManagerResizeRequests/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResizeRequest(); + $this->assertProtobufEquals($resizeRequest, $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 deleteExceptionTest() + { + $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/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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $resizeRequest = 'resizeRequest-319929852'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($instanceGroupManager, $project, $resizeRequest, $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 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'; + $resizeBy = 2144348098; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $state = 'state109757585'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new InstanceGroupManagerResizeRequest(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setResizeBy($resizeBy); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $expectedResponse->setState($state); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $resizeRequest = 'resizeRequest-319929852'; + $zone = 'zone3744684'; + $response = $gapicClient->get($instanceGroupManager, $project, $resizeRequest, $zone); + $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.InstanceGroupManagerResizeRequests/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResizeRequest(); + $this->assertProtobufEquals($resizeRequest, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $resizeRequest = 'resizeRequest-319929852'; + $zone = 'zone3744684'; + try { + $gapicClient->get($instanceGroupManager, $project, $resizeRequest, $zone); + // 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 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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagerResizeRequestResource = new InstanceGroupManagerResizeRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->insert($instanceGroupManager, $instanceGroupManagerResizeRequestResource, $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.InstanceGroupManagerResizeRequests/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagerResizeRequestResource(); + $this->assertProtobufEquals($instanceGroupManagerResizeRequestResource, $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 insertExceptionTest() + { + $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/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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagerResizeRequestResource = new InstanceGroupManagerResizeRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->insert($instanceGroupManager, $instanceGroupManagerResizeRequestResource, $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 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 InstanceGroupManagerResizeRequest(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InstanceGroupManagerResizeRequestsListResponse(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->list($instanceGroupManager, $project, $zone); + $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.InstanceGroupManagerResizeRequests/List', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->list($instanceGroupManager, $project, $zone); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/InstanceGroupManagersClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/InstanceGroupManagersClientTest.php new file mode 100644 index 000000000000..29e696207114 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/InstanceGroupManagersClientTest.php @@ -0,0 +1,2273 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return InstanceGroupManagersClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new InstanceGroupManagersClient($options); + } + + /** @test */ + public function abandonInstancesTest() + { + $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/abandonInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/abandonInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersAbandonInstancesRequestResource = new InstanceGroupManagersAbandonInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->abandonInstances($instanceGroupManager, $instanceGroupManagersAbandonInstancesRequestResource, $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.InstanceGroupManagers/AbandonInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersAbandonInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersAbandonInstancesRequestResource, $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 abandonInstancesExceptionTest() + { + $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/abandonInstancesExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersAbandonInstancesRequestResource = new InstanceGroupManagersAbandonInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->abandonInstances($instanceGroupManager, $instanceGroupManagersAbandonInstancesRequestResource, $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 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 InstanceGroupManagersScopedList(), + ]; + $expectedResponse = new InstanceGroupManagerAggregatedList(); + $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.InstanceGroupManagers/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 applyUpdatesToInstancesTest() + { + $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/applyUpdatesToInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/applyUpdatesToInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersApplyUpdatesRequestResource = new InstanceGroupManagersApplyUpdatesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->applyUpdatesToInstances($instanceGroupManager, $instanceGroupManagersApplyUpdatesRequestResource, $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.InstanceGroupManagers/ApplyUpdatesToInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersApplyUpdatesRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersApplyUpdatesRequestResource, $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 applyUpdatesToInstancesExceptionTest() + { + $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/applyUpdatesToInstancesExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersApplyUpdatesRequestResource = new InstanceGroupManagersApplyUpdatesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->applyUpdatesToInstances($instanceGroupManager, $instanceGroupManagersApplyUpdatesRequestResource, $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 createInstancesTest() + { + $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/createInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/createInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersCreateInstancesRequestResource = new InstanceGroupManagersCreateInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->createInstances($instanceGroupManager, $instanceGroupManagersCreateInstancesRequestResource, $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.InstanceGroupManagers/CreateInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersCreateInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersCreateInstancesRequestResource, $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 createInstancesExceptionTest() + { + $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/createInstancesExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersCreateInstancesRequestResource = new InstanceGroupManagersCreateInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->createInstances($instanceGroupManager, $instanceGroupManagersCreateInstancesRequestResource, $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 deleteTest() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($instanceGroupManager, $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.InstanceGroupManagers/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $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 deleteExceptionTest() + { + $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/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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($instanceGroupManager, $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 deleteInstancesTest() + { + $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/deleteInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersDeleteInstancesRequestResource = new InstanceGroupManagersDeleteInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->deleteInstances($instanceGroupManager, $instanceGroupManagersDeleteInstancesRequestResource, $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.InstanceGroupManagers/DeleteInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersDeleteInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersDeleteInstancesRequestResource, $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 deleteInstancesExceptionTest() + { + $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/deleteInstancesExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersDeleteInstancesRequestResource = new InstanceGroupManagersDeleteInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->deleteInstances($instanceGroupManager, $instanceGroupManagersDeleteInstancesRequestResource, $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 deletePerInstanceConfigsTest() + { + $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/deletePerInstanceConfigsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deletePerInstanceConfigsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersDeletePerInstanceConfigsReqResource = new InstanceGroupManagersDeletePerInstanceConfigsReq(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->deletePerInstanceConfigs($instanceGroupManager, $instanceGroupManagersDeletePerInstanceConfigsReqResource, $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.InstanceGroupManagers/DeletePerInstanceConfigs', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersDeletePerInstanceConfigsReqResource(); + $this->assertProtobufEquals($instanceGroupManagersDeletePerInstanceConfigsReqResource, $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 deletePerInstanceConfigsExceptionTest() + { + $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/deletePerInstanceConfigsExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersDeletePerInstanceConfigsReqResource = new InstanceGroupManagersDeletePerInstanceConfigsReq(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->deletePerInstanceConfigs($instanceGroupManager, $instanceGroupManagersDeletePerInstanceConfigsReqResource, $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 getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $baseInstanceName = 'baseInstanceName389106439'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $instanceGroup = 'instanceGroup81095253'; + $instanceTemplate = 'instanceTemplate309248228'; + $kind = 'kind3292052'; + $listManagedInstancesResults = 'listManagedInstancesResults832918068'; + $name = 'name3373707'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $targetSize = 2084603409; + $zone2 = 'zone2-696322977'; + $expectedResponse = new InstanceGroupManager(); + $expectedResponse->setBaseInstanceName($baseInstanceName); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setInstanceGroup($instanceGroup); + $expectedResponse->setInstanceTemplate($instanceTemplate); + $expectedResponse->setKind($kind); + $expectedResponse->setListManagedInstancesResults($listManagedInstancesResults); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setTargetSize($targetSize); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->get($instanceGroupManager, $project, $zone); + $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.InstanceGroupManagers/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->get($instanceGroupManager, $project, $zone); + // 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 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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManagerResource = new InstanceGroupManager(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->insert($instanceGroupManagerResource, $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.InstanceGroupManagers/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManagerResource(); + $this->assertProtobufEquals($instanceGroupManagerResource, $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 insertExceptionTest() + { + $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/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 + $instanceGroupManagerResource = new InstanceGroupManager(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->insert($instanceGroupManagerResource, $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 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 InstanceGroupManager(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InstanceGroupManagerList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->list($project, $zone); + $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.InstanceGroupManagers/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + try { + $gapicClient->list($project, $zone); + // 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 listErrorsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $itemsElement = new InstanceManagedByIgmError(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InstanceGroupManagersListErrorsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->listErrors($instanceGroupManager, $project, $zone); + $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.InstanceGroupManagers/ListErrors', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listErrorsExceptionTest() + { + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->listErrors($instanceGroupManager, $project, $zone); + // 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 listManagedInstancesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $managedInstancesElement = new ManagedInstance(); + $managedInstances = [ + $managedInstancesElement, + ]; + $expectedResponse = new InstanceGroupManagersListManagedInstancesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setManagedInstances($managedInstances); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->listManagedInstances($instanceGroupManager, $project, $zone); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getManagedInstances()[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.InstanceGroupManagers/ListManagedInstances', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listManagedInstancesExceptionTest() + { + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->listManagedInstances($instanceGroupManager, $project, $zone); + // 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 listPerInstanceConfigsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $itemsElement = new PerInstanceConfig(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InstanceGroupManagersListPerInstanceConfigsResp(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->listPerInstanceConfigs($instanceGroupManager, $project, $zone); + $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.InstanceGroupManagers/ListPerInstanceConfigs', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listPerInstanceConfigsExceptionTest() + { + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->listPerInstanceConfigs($instanceGroupManager, $project, $zone); + // 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 patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagerResource = new InstanceGroupManager(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->patch($instanceGroupManager, $instanceGroupManagerResource, $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.InstanceGroupManagers/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagerResource(); + $this->assertProtobufEquals($instanceGroupManagerResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagerResource = new InstanceGroupManager(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->patch($instanceGroupManager, $instanceGroupManagerResource, $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 patchPerInstanceConfigsTest() + { + $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/patchPerInstanceConfigsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchPerInstanceConfigsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersPatchPerInstanceConfigsReqResource = new InstanceGroupManagersPatchPerInstanceConfigsReq(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->patchPerInstanceConfigs($instanceGroupManager, $instanceGroupManagersPatchPerInstanceConfigsReqResource, $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.InstanceGroupManagers/PatchPerInstanceConfigs', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersPatchPerInstanceConfigsReqResource(); + $this->assertProtobufEquals($instanceGroupManagersPatchPerInstanceConfigsReqResource, $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 patchPerInstanceConfigsExceptionTest() + { + $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/patchPerInstanceConfigsExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersPatchPerInstanceConfigsReqResource = new InstanceGroupManagersPatchPerInstanceConfigsReq(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->patchPerInstanceConfigs($instanceGroupManager, $instanceGroupManagersPatchPerInstanceConfigsReqResource, $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 recreateInstancesTest() + { + $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/recreateInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/recreateInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersRecreateInstancesRequestResource = new InstanceGroupManagersRecreateInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->recreateInstances($instanceGroupManager, $instanceGroupManagersRecreateInstancesRequestResource, $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.InstanceGroupManagers/RecreateInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersRecreateInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersRecreateInstancesRequestResource, $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 recreateInstancesExceptionTest() + { + $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/recreateInstancesExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersRecreateInstancesRequestResource = new InstanceGroupManagersRecreateInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->recreateInstances($instanceGroupManager, $instanceGroupManagersRecreateInstancesRequestResource, $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 resizeTest() + { + $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/resizeTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/resizeTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $size = 3530753; + $zone = 'zone3744684'; + $response = $gapicClient->resize($instanceGroupManager, $project, $size, $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.InstanceGroupManagers/Resize', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSize(); + $this->assertProtobufEquals($size, $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 resizeExceptionTest() + { + $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/resizeExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $size = 3530753; + $zone = 'zone3744684'; + $response = $gapicClient->resize($instanceGroupManager, $project, $size, $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 setInstanceTemplateTest() + { + $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/setInstanceTemplateTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setInstanceTemplateTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersSetInstanceTemplateRequestResource = new InstanceGroupManagersSetInstanceTemplateRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setInstanceTemplate($instanceGroupManager, $instanceGroupManagersSetInstanceTemplateRequestResource, $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.InstanceGroupManagers/SetInstanceTemplate', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersSetInstanceTemplateRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersSetInstanceTemplateRequestResource, $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 setInstanceTemplateExceptionTest() + { + $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/setInstanceTemplateExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersSetInstanceTemplateRequestResource = new InstanceGroupManagersSetInstanceTemplateRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setInstanceTemplate($instanceGroupManager, $instanceGroupManagersSetInstanceTemplateRequestResource, $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 setTargetPoolsTest() + { + $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/setTargetPoolsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setTargetPoolsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersSetTargetPoolsRequestResource = new InstanceGroupManagersSetTargetPoolsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setTargetPools($instanceGroupManager, $instanceGroupManagersSetTargetPoolsRequestResource, $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.InstanceGroupManagers/SetTargetPools', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersSetTargetPoolsRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersSetTargetPoolsRequestResource, $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 setTargetPoolsExceptionTest() + { + $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/setTargetPoolsExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersSetTargetPoolsRequestResource = new InstanceGroupManagersSetTargetPoolsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setTargetPools($instanceGroupManager, $instanceGroupManagersSetTargetPoolsRequestResource, $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 updatePerInstanceConfigsTest() + { + $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/updatePerInstanceConfigsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/updatePerInstanceConfigsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersUpdatePerInstanceConfigsReqResource = new InstanceGroupManagersUpdatePerInstanceConfigsReq(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->updatePerInstanceConfigs($instanceGroupManager, $instanceGroupManagersUpdatePerInstanceConfigsReqResource, $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.InstanceGroupManagers/UpdatePerInstanceConfigs', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersUpdatePerInstanceConfigsReqResource(); + $this->assertProtobufEquals($instanceGroupManagersUpdatePerInstanceConfigsReqResource, $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 updatePerInstanceConfigsExceptionTest() + { + $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/updatePerInstanceConfigsExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersUpdatePerInstanceConfigsReqResource = new InstanceGroupManagersUpdatePerInstanceConfigsReq(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->updatePerInstanceConfigs($instanceGroupManager, $instanceGroupManagersUpdatePerInstanceConfigsReqResource, $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/owl-bot-staging/Compute/V1/tests/Unit/V1/InstanceGroupsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/InstanceGroupsClientTest.php new file mode 100644 index 000000000000..6fe563f3d8d7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/InstanceGroupsClientTest.php @@ -0,0 +1,1010 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return InstanceGroupsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new InstanceGroupsClient($options); + } + + /** @test */ + public function addInstancesTest() + { + $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/addInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroup = 'instanceGroup81095253'; + $instanceGroupsAddInstancesRequestResource = new InstanceGroupsAddInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->addInstances($instanceGroup, $instanceGroupsAddInstancesRequestResource, $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.InstanceGroups/AddInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroup(); + $this->assertProtobufEquals($instanceGroup, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupsAddInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupsAddInstancesRequestResource, $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 addInstancesExceptionTest() + { + $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/addInstancesExceptionTest'); + $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 + $instanceGroup = 'instanceGroup81095253'; + $instanceGroupsAddInstancesRequestResource = new InstanceGroupsAddInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->addInstances($instanceGroup, $instanceGroupsAddInstancesRequestResource, $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 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 InstanceGroupsScopedList(), + ]; + $expectedResponse = new InstanceGroupAggregatedList(); + $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.InstanceGroups/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() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroup = 'instanceGroup81095253'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($instanceGroup, $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.InstanceGroups/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroup(); + $this->assertProtobufEquals($instanceGroup, $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 deleteExceptionTest() + { + $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/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 + $instanceGroup = 'instanceGroup81095253'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($instanceGroup, $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 getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $network = 'network1843485230'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $size = 3530753; + $subnetwork = 'subnetwork-1302785042'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new InstanceGroup(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSize($size); + $expectedResponse->setSubnetwork($subnetwork); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroup = 'instanceGroup81095253'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->get($instanceGroup, $project, $zone); + $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.InstanceGroups/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroup(); + $this->assertProtobufEquals($instanceGroup, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $instanceGroup = 'instanceGroup81095253'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->get($instanceGroup, $project, $zone); + // 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 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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupResource = new InstanceGroup(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->insert($instanceGroupResource, $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.InstanceGroups/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupResource(); + $this->assertProtobufEquals($instanceGroupResource, $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 insertExceptionTest() + { + $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/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 + $instanceGroupResource = new InstanceGroup(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->insert($instanceGroupResource, $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 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 InstanceGroup(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InstanceGroupList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->list($project, $zone); + $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.InstanceGroups/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + try { + $gapicClient->list($project, $zone); + // 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 listInstancesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new InstanceWithNamedPorts(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InstanceGroupsListInstances(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroup = 'instanceGroup81095253'; + $instanceGroupsListInstancesRequestResource = new InstanceGroupsListInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->listInstances($instanceGroup, $instanceGroupsListInstancesRequestResource, $project, $zone); + $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.InstanceGroups/ListInstances', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroup(); + $this->assertProtobufEquals($instanceGroup, $actualValue); + $actualValue = $actualRequestObject->getInstanceGroupsListInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupsListInstancesRequestResource, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listInstancesExceptionTest() + { + $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 + $instanceGroup = 'instanceGroup81095253'; + $instanceGroupsListInstancesRequestResource = new InstanceGroupsListInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->listInstances($instanceGroup, $instanceGroupsListInstancesRequestResource, $project, $zone); + // 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 removeInstancesTest() + { + $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/removeInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroup = 'instanceGroup81095253'; + $instanceGroupsRemoveInstancesRequestResource = new InstanceGroupsRemoveInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->removeInstances($instanceGroup, $instanceGroupsRemoveInstancesRequestResource, $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.InstanceGroups/RemoveInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroup(); + $this->assertProtobufEquals($instanceGroup, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupsRemoveInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupsRemoveInstancesRequestResource, $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 removeInstancesExceptionTest() + { + $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/removeInstancesExceptionTest'); + $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 + $instanceGroup = 'instanceGroup81095253'; + $instanceGroupsRemoveInstancesRequestResource = new InstanceGroupsRemoveInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->removeInstances($instanceGroup, $instanceGroupsRemoveInstancesRequestResource, $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 setNamedPortsTest() + { + $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/setNamedPortsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setNamedPortsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroup = 'instanceGroup81095253'; + $instanceGroupsSetNamedPortsRequestResource = new InstanceGroupsSetNamedPortsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setNamedPorts($instanceGroup, $instanceGroupsSetNamedPortsRequestResource, $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.InstanceGroups/SetNamedPorts', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroup(); + $this->assertProtobufEquals($instanceGroup, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupsSetNamedPortsRequestResource(); + $this->assertProtobufEquals($instanceGroupsSetNamedPortsRequestResource, $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 setNamedPortsExceptionTest() + { + $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/setNamedPortsExceptionTest'); + $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 + $instanceGroup = 'instanceGroup81095253'; + $instanceGroupsSetNamedPortsRequestResource = new InstanceGroupsSetNamedPortsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setNamedPorts($instanceGroup, $instanceGroupsSetNamedPortsRequestResource, $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/owl-bot-staging/Compute/V1/tests/Unit/V1/InstanceSettingsServiceClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/InstanceSettingsServiceClientTest.php new file mode 100644 index 000000000000..d2c5797f9008 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/InstanceSettingsServiceClientTest.php @@ -0,0 +1,252 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return InstanceSettingsServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new InstanceSettingsServiceClient($options); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $fingerprint = 'fingerprint-1375934236'; + $kind = 'kind3292052'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new InstanceSettings(); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setKind($kind); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->get($project, $zone); + $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.InstanceSettingsService/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->get($project, $zone); + // 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 patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceSettingsResource = new InstanceSettings(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->patch($instanceSettingsResource, $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.InstanceSettingsService/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceSettingsResource(); + $this->assertProtobufEquals($instanceSettingsResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $instanceSettingsResource = new InstanceSettings(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->patch($instanceSettingsResource, $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/owl-bot-staging/Compute/V1/tests/Unit/V1/InstanceTemplatesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/InstanceTemplatesClientTest.php new file mode 100644 index 000000000000..0760d71ac322 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/InstanceTemplatesClientTest.php @@ -0,0 +1,733 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return InstanceTemplatesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + 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() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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'; + $response = $gapicClient->delete($instanceTemplate, $project); + $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.InstanceTemplates/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceTemplate(); + $this->assertProtobufEquals($instanceTemplate, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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'; + $response = $gapicClient->delete($instanceTemplate, $project); + $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'; + $region = 'region-934795532'; + $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($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSourceInstance($sourceInstance); + $transport->addResponse($expectedResponse); + // Mock request + $instanceTemplate = 'instanceTemplate309248228'; + $project = 'project-309310695'; + $response = $gapicClient->get($instanceTemplate, $project); + $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.InstanceTemplates/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceTemplate(); + $this->assertProtobufEquals($instanceTemplate, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->get($instanceTemplate, $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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($project, $resource); + $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.InstanceTemplates/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($project, $resource); + // 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 GlobalOperationsClient([ + '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'; + $response = $gapicClient->insert($instanceTemplateResource, $project); + $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.InstanceTemplates/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceTemplateResource(); + $this->assertProtobufEquals($instanceTemplateResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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'; + $response = $gapicClient->insert($instanceTemplateResource, $project); + $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'; + $response = $gapicClient->list($project); + $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.InstanceTemplates/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + $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.InstanceTemplates/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getGlobalSetPolicyRequestResource(); + $this->assertProtobufEquals($globalSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + try { + $gapicClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $response = $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + $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.InstanceTemplates/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + try { + $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/InstancesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/InstancesClientTest.php new file mode 100644 index 000000000000..d82a7820cc37 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/InstancesClientTest.php @@ -0,0 +1,5378 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return InstancesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new InstancesClient($options); + } + + /** @test */ + public function addAccessConfigTest() + { + $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/addAccessConfigTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addAccessConfigTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $accessConfigResource = new AccessConfig(); + $instance = 'instance555127957'; + $networkInterface = 'networkInterface902258792'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->addAccessConfig($accessConfigResource, $instance, $networkInterface, $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/AddAccessConfig', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAccessConfigResource(); + $this->assertProtobufEquals($accessConfigResource, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkInterface(); + $this->assertProtobufEquals($networkInterface, $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 addAccessConfigExceptionTest() + { + $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/addAccessConfigExceptionTest'); + $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 + $accessConfigResource = new AccessConfig(); + $instance = 'instance555127957'; + $networkInterface = 'networkInterface902258792'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->addAccessConfig($accessConfigResource, $instance, $networkInterface, $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 addResourcePoliciesTest() + { + $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/addResourcePoliciesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addResourcePoliciesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $instancesAddResourcePoliciesRequestResource = new InstancesAddResourcePoliciesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->addResourcePolicies($instance, $instancesAddResourcePoliciesRequestResource, $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/AddResourcePolicies', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getInstancesAddResourcePoliciesRequestResource(); + $this->assertProtobufEquals($instancesAddResourcePoliciesRequestResource, $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 addResourcePoliciesExceptionTest() + { + $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/addResourcePoliciesExceptionTest'); + $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'; + $instancesAddResourcePoliciesRequestResource = new InstancesAddResourcePoliciesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->addResourcePolicies($instance, $instancesAddResourcePoliciesRequestResource, $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 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 InstancesScopedList(), + ]; + $expectedResponse = new InstanceAggregatedList(); + $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.Instances/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 attachDiskTest() + { + $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/attachDiskTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/attachDiskTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $attachedDiskResource = new AttachedDisk(); + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->attachDisk($attachedDiskResource, $instance, $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/AttachDisk', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAttachedDiskResource(); + $this->assertProtobufEquals($attachedDiskResource, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 attachDiskExceptionTest() + { + $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/attachDiskExceptionTest'); + $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 + $attachedDiskResource = new AttachedDisk(); + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->attachDisk($attachedDiskResource, $instance, $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 bulkInsertTest() + { + $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/bulkInsertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/bulkInsertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $bulkInsertInstanceResourceResource = new BulkInsertInstanceResource(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->bulkInsert($bulkInsertInstanceResourceResource, $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/BulkInsert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBulkInsertInstanceResourceResource(); + $this->assertProtobufEquals($bulkInsertInstanceResourceResource, $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 bulkInsertExceptionTest() + { + $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/bulkInsertExceptionTest'); + $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 + $bulkInsertInstanceResourceResource = new BulkInsertInstanceResource(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->bulkInsert($bulkInsertInstanceResourceResource, $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 deleteTest() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($instance, $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/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 deleteExceptionTest() + { + $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/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 + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($instance, $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 deleteAccessConfigTest() + { + $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/deleteAccessConfigTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteAccessConfigTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $accessConfig = 'accessConfig-464014723'; + $instance = 'instance555127957'; + $networkInterface = 'networkInterface902258792'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->deleteAccessConfig($accessConfig, $instance, $networkInterface, $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/DeleteAccessConfig', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAccessConfig(); + $this->assertProtobufEquals($accessConfig, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkInterface(); + $this->assertProtobufEquals($networkInterface, $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 deleteAccessConfigExceptionTest() + { + $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/deleteAccessConfigExceptionTest'); + $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 + $accessConfig = 'accessConfig-464014723'; + $instance = 'instance555127957'; + $networkInterface = 'networkInterface902258792'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->deleteAccessConfig($accessConfig, $instance, $networkInterface, $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 detachDiskTest() + { + $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/detachDiskTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/detachDiskTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $deviceName = 'deviceName-1543071020'; + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->detachDisk($deviceName, $instance, $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/DetachDisk', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDeviceName(); + $this->assertProtobufEquals($deviceName, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 detachDiskExceptionTest() + { + $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/detachDiskExceptionTest'); + $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 + $deviceName = 'deviceName-1543071020'; + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->detachDisk($deviceName, $instance, $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 getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $canIpForward = true; + $cpuPlatform = 'cpuPlatform947156266'; + $creationTimestamp = 'creationTimestamp567396278'; + $deletionProtection = true; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $hostname = 'hostname-299803597'; + $id = 3355; + $keyRevocationActionType = 'keyRevocationActionType-1374671262'; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $lastStartTimestamp = 'lastStartTimestamp-629911088'; + $lastStopTimestamp = 'lastStopTimestamp-1197789726'; + $lastSuspendedTimestamp = 'lastSuspendedTimestamp893146249'; + $machineType = 'machineType1838323762'; + $minCpuPlatform = 'minCpuPlatform-1367699977'; + $name = 'name3373707'; + $privateIpv6GoogleAccess = 'privateIpv6GoogleAccess1122018830'; + $satisfiesPzi = false; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $sourceMachineImage = 'sourceMachineImage-1051972033'; + $startRestricted = true; + $status = 'status-892481550'; + $statusMessage = 'statusMessage-239442758'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new Instance(); + $expectedResponse->setCanIpForward($canIpForward); + $expectedResponse->setCpuPlatform($cpuPlatform); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDeletionProtection($deletionProtection); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setHostname($hostname); + $expectedResponse->setId($id); + $expectedResponse->setKeyRevocationActionType($keyRevocationActionType); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setLastStartTimestamp($lastStartTimestamp); + $expectedResponse->setLastStopTimestamp($lastStopTimestamp); + $expectedResponse->setLastSuspendedTimestamp($lastSuspendedTimestamp); + $expectedResponse->setMachineType($machineType); + $expectedResponse->setMinCpuPlatform($minCpuPlatform); + $expectedResponse->setName($name); + $expectedResponse->setPrivateIpv6GoogleAccess($privateIpv6GoogleAccess); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSourceMachineImage($sourceMachineImage); + $expectedResponse->setStartRestricted($startRestricted); + $expectedResponse->setStatus($status); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->get($instance, $project, $zone); + $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.Instances/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->get($instance, $project, $zone); + // 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 getEffectiveFirewallsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new InstancesGetEffectiveFirewallsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $instance = 'instance555127957'; + $networkInterface = 'networkInterface902258792'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->getEffectiveFirewalls($instance, $networkInterface, $project, $zone); + $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.Instances/GetEffectiveFirewalls', $actualFuncCall); + $actualValue = $actualRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualRequestObject->getNetworkInterface(); + $this->assertProtobufEquals($networkInterface, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEffectiveFirewallsExceptionTest() + { + $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 + $instance = 'instance555127957'; + $networkInterface = 'networkInterface902258792'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->getEffectiveFirewalls($instance, $networkInterface, $project, $zone); + // 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 getGuestAttributesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $kind = 'kind3292052'; + $queryPath2 = 'queryPath21491922415'; + $selfLink = 'selfLink-1691268851'; + $variableKey2 = 'variableKey2-1496058161'; + $variableValue = 'variableValue-1486030354'; + $expectedResponse = new GuestAttributes(); + $expectedResponse->setKind($kind); + $expectedResponse->setQueryPath($queryPath2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setVariableKey($variableKey2); + $expectedResponse->setVariableValue($variableValue); + $transport->addResponse($expectedResponse); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->getGuestAttributes($instance, $project, $zone); + $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.Instances/GetGuestAttributes', $actualFuncCall); + $actualValue = $actualRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGuestAttributesExceptionTest() + { + $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 + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->getGuestAttributes($instance, $project, $zone); + // 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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $response = $gapicClient->getIamPolicy($project, $resource, $zone); + $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.Instances/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + try { + $gapicClient->getIamPolicy($project, $resource, $zone); + // 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 getScreenshotTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $contents = 'contents-567321830'; + $kind = 'kind3292052'; + $expectedResponse = new Screenshot(); + $expectedResponse->setContents($contents); + $expectedResponse->setKind($kind); + $transport->addResponse($expectedResponse); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->getScreenshot($instance, $project, $zone); + $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.Instances/GetScreenshot', $actualFuncCall); + $actualValue = $actualRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getScreenshotExceptionTest() + { + $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 + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->getScreenshot($instance, $project, $zone); + // 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 getSerialPortOutputTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $contents = 'contents-567321830'; + $kind = 'kind3292052'; + $next = 3377907; + $selfLink = 'selfLink-1691268851'; + $start2 = 1897185387; + $expectedResponse = new SerialPortOutput(); + $expectedResponse->setContents($contents); + $expectedResponse->setKind($kind); + $expectedResponse->setNext($next); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStart($start2); + $transport->addResponse($expectedResponse); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->getSerialPortOutput($instance, $project, $zone); + $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.Instances/GetSerialPortOutput', $actualFuncCall); + $actualValue = $actualRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getSerialPortOutputExceptionTest() + { + $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 + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->getSerialPortOutput($instance, $project, $zone); + // 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 getShieldedInstanceIdentityTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $kind = 'kind3292052'; + $expectedResponse = new ShieldedInstanceIdentity(); + $expectedResponse->setKind($kind); + $transport->addResponse($expectedResponse); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->getShieldedInstanceIdentity($instance, $project, $zone); + $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.Instances/GetShieldedInstanceIdentity', $actualFuncCall); + $actualValue = $actualRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getShieldedInstanceIdentityExceptionTest() + { + $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 + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->getShieldedInstanceIdentity($instance, $project, $zone); + // 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 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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceResource = new Instance(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->insert($instanceResource, $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/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceResource(); + $this->assertProtobufEquals($instanceResource, $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 insertExceptionTest() + { + $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/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 + $instanceResource = new Instance(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->insert($instanceResource, $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 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 Instance(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InstanceList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->list($project, $zone); + $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.Instances/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + try { + $gapicClient->list($project, $zone); + // 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 listReferrersTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new Reference(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InstanceListReferrers(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->listReferrers($instance, $project, $zone); + $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.Instances/ListReferrers', $actualFuncCall); + $actualValue = $actualRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listReferrersExceptionTest() + { + $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 + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->listReferrers($instance, $project, $zone); + // 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 performMaintenanceTest() + { + $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/performMaintenanceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/performMaintenanceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->performMaintenance($instance, $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/PerformMaintenance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 performMaintenanceExceptionTest() + { + $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/performMaintenanceExceptionTest'); + $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'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->performMaintenance($instance, $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 removeResourcePoliciesTest() + { + $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/removeResourcePoliciesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeResourcePoliciesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $instancesRemoveResourcePoliciesRequestResource = new InstancesRemoveResourcePoliciesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->removeResourcePolicies($instance, $instancesRemoveResourcePoliciesRequestResource, $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/RemoveResourcePolicies', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getInstancesRemoveResourcePoliciesRequestResource(); + $this->assertProtobufEquals($instancesRemoveResourcePoliciesRequestResource, $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 removeResourcePoliciesExceptionTest() + { + $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/removeResourcePoliciesExceptionTest'); + $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'; + $instancesRemoveResourcePoliciesRequestResource = new InstancesRemoveResourcePoliciesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->removeResourcePolicies($instance, $instancesRemoveResourcePoliciesRequestResource, $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 resetTest() + { + $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/resetTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/resetTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->reset($instance, $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/Reset', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 resetExceptionTest() + { + $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/resetExceptionTest'); + $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'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->reset($instance, $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 resumeTest() + { + $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/resumeTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/resumeTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->resume($instance, $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/Resume', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 resumeExceptionTest() + { + $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/resumeExceptionTest'); + $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'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->resume($instance, $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 sendDiagnosticInterruptTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new SendDiagnosticInterruptInstanceResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->sendDiagnosticInterrupt($instance, $project, $zone); + $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.Instances/SendDiagnosticInterrupt', $actualFuncCall); + $actualValue = $actualRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function sendDiagnosticInterruptExceptionTest() + { + $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 + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->sendDiagnosticInterrupt($instance, $project, $zone); + // 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 setDeletionProtectionTest() + { + $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/setDeletionProtectionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setDeletionProtectionTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $response = $gapicClient->setDeletionProtection($project, $resource, $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/SetDeletionProtection', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $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 setDeletionProtectionExceptionTest() + { + $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/setDeletionProtectionExceptionTest'); + $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 + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $response = $gapicClient->setDeletionProtection($project, $resource, $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 setDiskAutoDeleteTest() + { + $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/setDiskAutoDeleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setDiskAutoDeleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $autoDelete = false; + $deviceName = 'deviceName-1543071020'; + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setDiskAutoDelete($autoDelete, $deviceName, $instance, $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/SetDiskAutoDelete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAutoDelete(); + $this->assertProtobufEquals($autoDelete, $actualValue); + $actualValue = $actualApiRequestObject->getDeviceName(); + $this->assertProtobufEquals($deviceName, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 setDiskAutoDeleteExceptionTest() + { + $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/setDiskAutoDeleteExceptionTest'); + $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 + $autoDelete = false; + $deviceName = 'deviceName-1543071020'; + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setDiskAutoDelete($autoDelete, $deviceName, $instance, $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $response = $gapicClient->setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource); + $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.Instances/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $actualValue = $actualRequestObject->getZoneSetPolicyRequestResource(); + $this->assertProtobufEquals($zoneSetPolicyRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + try { + $gapicClient->setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource); + // 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 setLabelsTest() + { + $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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $instancesSetLabelsRequestResource = new InstancesSetLabelsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setLabels($instance, $instancesSetLabelsRequestResource, $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/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getInstancesSetLabelsRequestResource(); + $this->assertProtobufEquals($instancesSetLabelsRequestResource, $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 setLabelsExceptionTest() + { + $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/setLabelsExceptionTest'); + $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'; + $instancesSetLabelsRequestResource = new InstancesSetLabelsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setLabels($instance, $instancesSetLabelsRequestResource, $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 setMachineResourcesTest() + { + $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/setMachineResourcesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setMachineResourcesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $instancesSetMachineResourcesRequestResource = new InstancesSetMachineResourcesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setMachineResources($instance, $instancesSetMachineResourcesRequestResource, $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/SetMachineResources', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getInstancesSetMachineResourcesRequestResource(); + $this->assertProtobufEquals($instancesSetMachineResourcesRequestResource, $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 setMachineResourcesExceptionTest() + { + $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/setMachineResourcesExceptionTest'); + $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'; + $instancesSetMachineResourcesRequestResource = new InstancesSetMachineResourcesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setMachineResources($instance, $instancesSetMachineResourcesRequestResource, $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 setMachineTypeTest() + { + $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/setMachineTypeTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setMachineTypeTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $instancesSetMachineTypeRequestResource = new InstancesSetMachineTypeRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setMachineType($instance, $instancesSetMachineTypeRequestResource, $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/SetMachineType', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getInstancesSetMachineTypeRequestResource(); + $this->assertProtobufEquals($instancesSetMachineTypeRequestResource, $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 setMachineTypeExceptionTest() + { + $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/setMachineTypeExceptionTest'); + $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'; + $instancesSetMachineTypeRequestResource = new InstancesSetMachineTypeRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setMachineType($instance, $instancesSetMachineTypeRequestResource, $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 setMetadataTest() + { + $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/setMetadataTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setMetadataTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $metadataResource = new Metadata(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setMetadata($instance, $metadataResource, $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/SetMetadata', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getMetadataResource(); + $this->assertProtobufEquals($metadataResource, $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 setMetadataExceptionTest() + { + $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/setMetadataExceptionTest'); + $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'; + $metadataResource = new Metadata(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setMetadata($instance, $metadataResource, $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 setMinCpuPlatformTest() + { + $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/setMinCpuPlatformTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setMinCpuPlatformTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $instancesSetMinCpuPlatformRequestResource = new InstancesSetMinCpuPlatformRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setMinCpuPlatform($instance, $instancesSetMinCpuPlatformRequestResource, $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/SetMinCpuPlatform', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getInstancesSetMinCpuPlatformRequestResource(); + $this->assertProtobufEquals($instancesSetMinCpuPlatformRequestResource, $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 setMinCpuPlatformExceptionTest() + { + $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/setMinCpuPlatformExceptionTest'); + $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'; + $instancesSetMinCpuPlatformRequestResource = new InstancesSetMinCpuPlatformRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setMinCpuPlatform($instance, $instancesSetMinCpuPlatformRequestResource, $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 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() + { + $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/setSchedulingTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setSchedulingTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $schedulingResource = new Scheduling(); + $zone = 'zone3744684'; + $response = $gapicClient->setScheduling($instance, $project, $schedulingResource, $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/SetScheduling', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSchedulingResource(); + $this->assertProtobufEquals($schedulingResource, $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 setSchedulingExceptionTest() + { + $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/setSchedulingExceptionTest'); + $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'; + $project = 'project-309310695'; + $schedulingResource = new Scheduling(); + $zone = 'zone3744684'; + $response = $gapicClient->setScheduling($instance, $project, $schedulingResource, $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 setSecurityPolicyTest() + { + $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/setSecurityPolicyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setSecurityPolicyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $instancesSetSecurityPolicyRequestResource = new InstancesSetSecurityPolicyRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setSecurityPolicy($instance, $instancesSetSecurityPolicyRequestResource, $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/SetSecurityPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getInstancesSetSecurityPolicyRequestResource(); + $this->assertProtobufEquals($instancesSetSecurityPolicyRequestResource, $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 setSecurityPolicyExceptionTest() + { + $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/setSecurityPolicyExceptionTest'); + $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'; + $instancesSetSecurityPolicyRequestResource = new InstancesSetSecurityPolicyRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setSecurityPolicy($instance, $instancesSetSecurityPolicyRequestResource, $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 setServiceAccountTest() + { + $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/setServiceAccountTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setServiceAccountTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $instancesSetServiceAccountRequestResource = new InstancesSetServiceAccountRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setServiceAccount($instance, $instancesSetServiceAccountRequestResource, $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/SetServiceAccount', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getInstancesSetServiceAccountRequestResource(); + $this->assertProtobufEquals($instancesSetServiceAccountRequestResource, $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 setServiceAccountExceptionTest() + { + $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/setServiceAccountExceptionTest'); + $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'; + $instancesSetServiceAccountRequestResource = new InstancesSetServiceAccountRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setServiceAccount($instance, $instancesSetServiceAccountRequestResource, $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 setShieldedInstanceIntegrityPolicyTest() + { + $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/setShieldedInstanceIntegrityPolicyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setShieldedInstanceIntegrityPolicyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $shieldedInstanceIntegrityPolicyResource = new ShieldedInstanceIntegrityPolicy(); + $zone = 'zone3744684'; + $response = $gapicClient->setShieldedInstanceIntegrityPolicy($instance, $project, $shieldedInstanceIntegrityPolicyResource, $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/SetShieldedInstanceIntegrityPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getShieldedInstanceIntegrityPolicyResource(); + $this->assertProtobufEquals($shieldedInstanceIntegrityPolicyResource, $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 setShieldedInstanceIntegrityPolicyExceptionTest() + { + $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/setShieldedInstanceIntegrityPolicyExceptionTest'); + $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'; + $project = 'project-309310695'; + $shieldedInstanceIntegrityPolicyResource = new ShieldedInstanceIntegrityPolicy(); + $zone = 'zone3744684'; + $response = $gapicClient->setShieldedInstanceIntegrityPolicy($instance, $project, $shieldedInstanceIntegrityPolicyResource, $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 setTagsTest() + { + $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/setTagsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setTagsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $tagsResource = new Tags(); + $zone = 'zone3744684'; + $response = $gapicClient->setTags($instance, $project, $tagsResource, $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/SetTags', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTagsResource(); + $this->assertProtobufEquals($tagsResource, $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 setTagsExceptionTest() + { + $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/setTagsExceptionTest'); + $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'; + $project = 'project-309310695'; + $tagsResource = new Tags(); + $zone = 'zone3744684'; + $response = $gapicClient->setTags($instance, $project, $tagsResource, $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 simulateMaintenanceEventTest() + { + $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/simulateMaintenanceEventTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/simulateMaintenanceEventTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->simulateMaintenanceEvent($instance, $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/SimulateMaintenanceEvent', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 simulateMaintenanceEventExceptionTest() + { + $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/simulateMaintenanceEventExceptionTest'); + $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'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->simulateMaintenanceEvent($instance, $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 startTest() + { + $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/startTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/startTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->start($instance, $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/Start', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 startExceptionTest() + { + $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/startExceptionTest'); + $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'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->start($instance, $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 startWithEncryptionKeyTest() + { + $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/startWithEncryptionKeyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/startWithEncryptionKeyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $instancesStartWithEncryptionKeyRequestResource = new InstancesStartWithEncryptionKeyRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->startWithEncryptionKey($instance, $instancesStartWithEncryptionKeyRequestResource, $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/StartWithEncryptionKey', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getInstancesStartWithEncryptionKeyRequestResource(); + $this->assertProtobufEquals($instancesStartWithEncryptionKeyRequestResource, $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 startWithEncryptionKeyExceptionTest() + { + $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/startWithEncryptionKeyExceptionTest'); + $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'; + $instancesStartWithEncryptionKeyRequestResource = new InstancesStartWithEncryptionKeyRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->startWithEncryptionKey($instance, $instancesStartWithEncryptionKeyRequestResource, $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 stopTest() + { + $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/stopTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/stopTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->stop($instance, $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/Stop', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 stopExceptionTest() + { + $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/stopExceptionTest'); + $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'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->stop($instance, $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 suspendTest() + { + $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/suspendTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/suspendTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->suspend($instance, $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/Suspend', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 suspendExceptionTest() + { + $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/suspendExceptionTest'); + $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'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->suspend($instance, $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + $response = $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone); + $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.Instances/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + try { + $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone); + // 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 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 + $instance = 'instance555127957'; + $instanceResource = new Instance(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->update($instance, $instanceResource, $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/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceResource(); + $this->assertProtobufEquals($instanceResource, $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 + $instance = 'instance555127957'; + $instanceResource = new Instance(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->update($instance, $instanceResource, $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 updateAccessConfigTest() + { + $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/updateAccessConfigTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/updateAccessConfigTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $accessConfigResource = new AccessConfig(); + $instance = 'instance555127957'; + $networkInterface = 'networkInterface902258792'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->updateAccessConfig($accessConfigResource, $instance, $networkInterface, $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/UpdateAccessConfig', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAccessConfigResource(); + $this->assertProtobufEquals($accessConfigResource, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkInterface(); + $this->assertProtobufEquals($networkInterface, $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 updateAccessConfigExceptionTest() + { + $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/updateAccessConfigExceptionTest'); + $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 + $accessConfigResource = new AccessConfig(); + $instance = 'instance555127957'; + $networkInterface = 'networkInterface902258792'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->updateAccessConfig($accessConfigResource, $instance, $networkInterface, $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 updateDisplayDeviceTest() + { + $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/updateDisplayDeviceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/updateDisplayDeviceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $displayDeviceResource = new DisplayDevice(); + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->updateDisplayDevice($displayDeviceResource, $instance, $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/UpdateDisplayDevice', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisplayDeviceResource(); + $this->assertProtobufEquals($displayDeviceResource, $actualValue); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $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 updateDisplayDeviceExceptionTest() + { + $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/updateDisplayDeviceExceptionTest'); + $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 + $displayDeviceResource = new DisplayDevice(); + $instance = 'instance555127957'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->updateDisplayDevice($displayDeviceResource, $instance, $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 updateNetworkInterfaceTest() + { + $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/updateNetworkInterfaceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/updateNetworkInterfaceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $networkInterface = 'networkInterface902258792'; + $networkInterfaceResource = new NetworkInterface(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->updateNetworkInterface($instance, $networkInterface, $networkInterfaceResource, $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/UpdateNetworkInterface', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkInterface(); + $this->assertProtobufEquals($networkInterface, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkInterfaceResource(); + $this->assertProtobufEquals($networkInterfaceResource, $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 updateNetworkInterfaceExceptionTest() + { + $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/updateNetworkInterfaceExceptionTest'); + $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'; + $networkInterface = 'networkInterface902258792'; + $networkInterfaceResource = new NetworkInterface(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->updateNetworkInterface($instance, $networkInterface, $networkInterfaceResource, $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 updateShieldedInstanceConfigTest() + { + $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/updateShieldedInstanceConfigTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/updateShieldedInstanceConfigTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instance = 'instance555127957'; + $project = 'project-309310695'; + $shieldedInstanceConfigResource = new ShieldedInstanceConfig(); + $zone = 'zone3744684'; + $response = $gapicClient->updateShieldedInstanceConfig($instance, $project, $shieldedInstanceConfigResource, $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/UpdateShieldedInstanceConfig', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstance(); + $this->assertProtobufEquals($instance, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getShieldedInstanceConfigResource(); + $this->assertProtobufEquals($shieldedInstanceConfigResource, $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 updateShieldedInstanceConfigExceptionTest() + { + $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/updateShieldedInstanceConfigExceptionTest'); + $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'; + $project = 'project-309310695'; + $shieldedInstanceConfigResource = new ShieldedInstanceConfig(); + $zone = 'zone3744684'; + $response = $gapicClient->updateShieldedInstanceConfig($instance, $project, $shieldedInstanceConfigResource, $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/owl-bot-staging/Compute/V1/tests/Unit/V1/InstantSnapshotsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/InstantSnapshotsClientTest.php new file mode 100644 index 000000000000..de747b661812 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/InstantSnapshotsClientTest.php @@ -0,0 +1,905 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return InstantSnapshotsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new InstantSnapshotsClient($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 InstantSnapshotsScopedList(), + ]; + $expectedResponse = new InstantSnapshotAggregatedList(); + $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.InstantSnapshots/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() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instantSnapshot = 'instantSnapshot1465380450'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($instantSnapshot, $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.InstantSnapshots/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstantSnapshot(); + $this->assertProtobufEquals($instantSnapshot, $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 deleteExceptionTest() + { + $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/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 + $instantSnapshot = 'instantSnapshot1465380450'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($instantSnapshot, $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 getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $architecture = 'architecture839674195'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $diskSizeGb = 757478089; + $id = 3355; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $region = 'region-934795532'; + $satisfiesPzi = false; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $sourceDisk = 'sourceDisk-85117119'; + $sourceDiskId = 'sourceDiskId-1693292839'; + $status = 'status-892481550'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new InstantSnapshot(); + $expectedResponse->setArchitecture($architecture); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDiskSizeGb($diskSizeGb); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $expectedResponse->setSourceDisk($sourceDisk); + $expectedResponse->setSourceDiskId($sourceDiskId); + $expectedResponse->setStatus($status); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $instantSnapshot = 'instantSnapshot1465380450'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->get($instantSnapshot, $project, $zone); + $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.InstantSnapshots/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInstantSnapshot(); + $this->assertProtobufEquals($instantSnapshot, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $instantSnapshot = 'instantSnapshot1465380450'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->get($instantSnapshot, $project, $zone); + // 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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $response = $gapicClient->getIamPolicy($project, $resource, $zone); + $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.InstantSnapshots/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + try { + $gapicClient->getIamPolicy($project, $resource, $zone); + // 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 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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instantSnapshotResource = new InstantSnapshot(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->insert($instantSnapshotResource, $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.InstantSnapshots/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstantSnapshotResource(); + $this->assertProtobufEquals($instantSnapshotResource, $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 insertExceptionTest() + { + $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/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 + $instantSnapshotResource = new InstantSnapshot(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->insert($instantSnapshotResource, $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 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 InstantSnapshot(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InstantSnapshotList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->list($project, $zone); + $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.InstantSnapshots/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + try { + $gapicClient->list($project, $zone); + // 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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $response = $gapicClient->setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource); + $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.InstantSnapshots/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $actualValue = $actualRequestObject->getZoneSetPolicyRequestResource(); + $this->assertProtobufEquals($zoneSetPolicyRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + try { + $gapicClient->setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource); + // 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 setLabelsTest() + { + $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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetLabelsRequestResource = new ZoneSetLabelsRequest(); + $response = $gapicClient->setLabels($project, $resource, $zone, $zoneSetLabelsRequestResource); + $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.InstantSnapshots/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualApiRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $actualValue = $actualApiRequestObject->getZoneSetLabelsRequestResource(); + $this->assertProtobufEquals($zoneSetLabelsRequestResource, $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 setLabelsExceptionTest() + { + $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/setLabelsExceptionTest'); + $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 + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetLabelsRequestResource = new ZoneSetLabelsRequest(); + $response = $gapicClient->setLabels($project, $resource, $zone, $zoneSetLabelsRequestResource); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + $response = $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone); + $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.InstantSnapshots/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + try { + $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/InterconnectAttachmentsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/InterconnectAttachmentsClientTest.php new file mode 100644 index 000000000000..a245f35d000c --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/InterconnectAttachmentsClientTest.php @@ -0,0 +1,838 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return InterconnectAttachmentsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new InterconnectAttachmentsClient($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 InterconnectAttachmentsScopedList(), + ]; + $expectedResponse = new InterconnectAttachmentAggregatedList(); + $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.InterconnectAttachments/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() + { + $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 + $interconnectAttachment = 'interconnectAttachment308135284'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($interconnectAttachment, $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.InterconnectAttachments/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInterconnectAttachment(); + $this->assertProtobufEquals($interconnectAttachment, $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 + $interconnectAttachment = 'interconnectAttachment308135284'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($interconnectAttachment, $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 + $adminEnabled = false; + $bandwidth = 'bandwidth-1965768527'; + $cloudRouterIpAddress = 'cloudRouterIpAddress1361134600'; + $cloudRouterIpv6Address = 'cloudRouterIpv6Address-621819448'; + $cloudRouterIpv6InterfaceId = 'cloudRouterIpv6InterfaceId1058153613'; + $creationTimestamp = 'creationTimestamp567396278'; + $customerRouterIpAddress = 'customerRouterIpAddress-741266063'; + $customerRouterIpv6Address = 'customerRouterIpv6Address1900739825'; + $customerRouterIpv6InterfaceId = 'customerRouterIpv6InterfaceId-1229618428'; + $dataplaneVersion = 1645532811; + $description = 'description-1724546052'; + $edgeAvailabilityDomain = 'edgeAvailabilityDomain-1539323226'; + $encryption = 'encryption-1512632445'; + $googleReferenceId = 'googleReferenceId534944469'; + $id = 3355; + $interconnect = 'interconnect-849140594'; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $mtu = 108462; + $name = 'name3373707'; + $operationalStatus = 'operationalStatus1274812671'; + $pairingKey = 'pairingKey976566376'; + $partnerAsn = 975037061; + $region2 = 'region2-690338393'; + $remoteService = 'remoteService-1218658372'; + $router = 'router-925132983'; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $stackType = 'stackType2036521617'; + $state = 'state109757585'; + $subnetLength = 1867652600; + $type = 'type3575610'; + $vlanTag8021q = 1730540572; + $expectedResponse = new InterconnectAttachment(); + $expectedResponse->setAdminEnabled($adminEnabled); + $expectedResponse->setBandwidth($bandwidth); + $expectedResponse->setCloudRouterIpAddress($cloudRouterIpAddress); + $expectedResponse->setCloudRouterIpv6Address($cloudRouterIpv6Address); + $expectedResponse->setCloudRouterIpv6InterfaceId($cloudRouterIpv6InterfaceId); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setCustomerRouterIpAddress($customerRouterIpAddress); + $expectedResponse->setCustomerRouterIpv6Address($customerRouterIpv6Address); + $expectedResponse->setCustomerRouterIpv6InterfaceId($customerRouterIpv6InterfaceId); + $expectedResponse->setDataplaneVersion($dataplaneVersion); + $expectedResponse->setDescription($description); + $expectedResponse->setEdgeAvailabilityDomain($edgeAvailabilityDomain); + $expectedResponse->setEncryption($encryption); + $expectedResponse->setGoogleReferenceId($googleReferenceId); + $expectedResponse->setId($id); + $expectedResponse->setInterconnect($interconnect); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setMtu($mtu); + $expectedResponse->setName($name); + $expectedResponse->setOperationalStatus($operationalStatus); + $expectedResponse->setPairingKey($pairingKey); + $expectedResponse->setPartnerAsn($partnerAsn); + $expectedResponse->setRegion($region2); + $expectedResponse->setRemoteService($remoteService); + $expectedResponse->setRouter($router); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStackType($stackType); + $expectedResponse->setState($state); + $expectedResponse->setSubnetLength($subnetLength); + $expectedResponse->setType($type); + $expectedResponse->setVlanTag8021q($vlanTag8021q); + $transport->addResponse($expectedResponse); + // Mock request + $interconnectAttachment = 'interconnectAttachment308135284'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($interconnectAttachment, $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.InterconnectAttachments/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInterconnectAttachment(); + $this->assertProtobufEquals($interconnectAttachment, $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 + $interconnectAttachment = 'interconnectAttachment308135284'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($interconnectAttachment, $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 + $interconnectAttachmentResource = new InterconnectAttachment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($interconnectAttachmentResource, $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.InterconnectAttachments/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInterconnectAttachmentResource(); + $this->assertProtobufEquals($interconnectAttachmentResource, $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 + $interconnectAttachmentResource = new InterconnectAttachment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($interconnectAttachmentResource, $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 InterconnectAttachment(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InterconnectAttachmentList(); + $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.InterconnectAttachments/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()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $interconnectAttachment = 'interconnectAttachment308135284'; + $interconnectAttachmentResource = new InterconnectAttachment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patch($interconnectAttachment, $interconnectAttachmentResource, $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.InterconnectAttachments/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInterconnectAttachment(); + $this->assertProtobufEquals($interconnectAttachment, $actualValue); + $actualValue = $actualApiRequestObject->getInterconnectAttachmentResource(); + $this->assertProtobufEquals($interconnectAttachmentResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $interconnectAttachment = 'interconnectAttachment308135284'; + $interconnectAttachmentResource = new InterconnectAttachment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patch($interconnectAttachment, $interconnectAttachmentResource, $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 setLabelsTest() + { + $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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + $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.InterconnectAttachments/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionSetLabelsRequestResource(); + $this->assertProtobufEquals($regionSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $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 setLabelsExceptionTest() + { + $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/setLabelsExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/InterconnectLocationsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/InterconnectLocationsClientTest.php new file mode 100644 index 000000000000..b3c01b884ba4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/InterconnectLocationsClientTest.php @@ -0,0 +1,228 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return InterconnectLocationsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new InterconnectLocationsClient($options); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $address = 'address-1147692044'; + $availabilityZone = 'availabilityZone-378410992'; + $city = 'city3053931'; + $continent = 'continent-403427916'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $facilityProvider = 'facilityProvider2143916045'; + $facilityProviderFacilityId = 'facilityProviderFacilityId-1523343611'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $peeringdbFacilityId = 'peeringdbFacilityId-303818'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $supportsPzs = true; + $expectedResponse = new InterconnectLocation(); + $expectedResponse->setAddress($address); + $expectedResponse->setAvailabilityZone($availabilityZone); + $expectedResponse->setCity($city); + $expectedResponse->setContinent($continent); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFacilityProvider($facilityProvider); + $expectedResponse->setFacilityProviderFacilityId($facilityProviderFacilityId); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setPeeringdbFacilityId($peeringdbFacilityId); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $expectedResponse->setSupportsPzs($supportsPzs); + $transport->addResponse($expectedResponse); + // Mock request + $interconnectLocation = 'interconnectLocation-581505978'; + $project = 'project-309310695'; + $response = $gapicClient->get($interconnectLocation, $project); + $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.InterconnectLocations/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInterconnectLocation(); + $this->assertProtobufEquals($interconnectLocation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $interconnectLocation = 'interconnectLocation-581505978'; + $project = 'project-309310695'; + try { + $gapicClient->get($interconnectLocation, $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 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 InterconnectLocation(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InterconnectLocationList(); + $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->list($project); + $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.InterconnectLocations/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/InterconnectRemoteLocationsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/InterconnectRemoteLocationsClientTest.php new file mode 100644 index 000000000000..c28361574d84 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/InterconnectRemoteLocationsClientTest.php @@ -0,0 +1,232 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return InterconnectRemoteLocationsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new InterconnectRemoteLocationsClient($options); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $address = 'address-1147692044'; + $city = 'city3053931'; + $continent = 'continent-403427916'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $facilityProvider = 'facilityProvider2143916045'; + $facilityProviderFacilityId = 'facilityProviderFacilityId-1523343611'; + $id = 3355; + $kind = 'kind3292052'; + $lacp = 'lacp3313826'; + $maxLagSize100Gbps = 828522571; + $maxLagSize10Gbps = 294007573; + $name = 'name3373707'; + $peeringdbFacilityId = 'peeringdbFacilityId-303818'; + $remoteService = 'remoteService-1218658372'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $expectedResponse = new InterconnectRemoteLocation(); + $expectedResponse->setAddress($address); + $expectedResponse->setCity($city); + $expectedResponse->setContinent($continent); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFacilityProvider($facilityProvider); + $expectedResponse->setFacilityProviderFacilityId($facilityProviderFacilityId); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLacp($lacp); + $expectedResponse->setMaxLagSize100Gbps($maxLagSize100Gbps); + $expectedResponse->setMaxLagSize10Gbps($maxLagSize10Gbps); + $expectedResponse->setName($name); + $expectedResponse->setPeeringdbFacilityId($peeringdbFacilityId); + $expectedResponse->setRemoteService($remoteService); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $transport->addResponse($expectedResponse); + // Mock request + $interconnectRemoteLocation = 'interconnectRemoteLocation1363895773'; + $project = 'project-309310695'; + $response = $gapicClient->get($interconnectRemoteLocation, $project); + $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.InterconnectRemoteLocations/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInterconnectRemoteLocation(); + $this->assertProtobufEquals($interconnectRemoteLocation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $interconnectRemoteLocation = 'interconnectRemoteLocation1363895773'; + $project = 'project-309310695'; + try { + $gapicClient->get($interconnectRemoteLocation, $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 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 InterconnectRemoteLocation(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InterconnectRemoteLocationList(); + $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->list($project); + $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.InterconnectRemoteLocations/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/InterconnectsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/InterconnectsClientTest.php new file mode 100644 index 000000000000..b94da3cb0096 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/InterconnectsClientTest.php @@ -0,0 +1,841 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return InterconnectsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new InterconnectsClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $interconnect = 'interconnect-849140594'; + $project = 'project-309310695'; + $response = $gapicClient->delete($interconnect, $project); + $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.Interconnects/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInterconnect(); + $this->assertProtobufEquals($interconnect, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $interconnect = 'interconnect-849140594'; + $project = 'project-309310695'; + $response = $gapicClient->delete($interconnect, $project); + $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 + $adminEnabled = false; + $creationTimestamp = 'creationTimestamp567396278'; + $customerName = 'customerName-2143818164'; + $description = 'description-1724546052'; + $googleIpAddress = 'googleIpAddress1516847778'; + $googleReferenceId = 'googleReferenceId534944469'; + $id = 3355; + $interconnectType = 'interconnectType2125777995'; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $linkType = 'linkType-1624275873'; + $location = 'location1901043637'; + $macsecEnabled = true; + $name = 'name3373707'; + $nocContactEmail = 'nocContactEmail1087814656'; + $operationalStatus = 'operationalStatus1274812671'; + $peerIpAddress = 'peerIpAddress-1939747879'; + $provisionedLinkCount = 1199724171; + $remoteLocation = 'remoteLocation1398130574'; + $requestedLinkCount = 1118793211; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $state = 'state109757585'; + $expectedResponse = new Interconnect(); + $expectedResponse->setAdminEnabled($adminEnabled); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setCustomerName($customerName); + $expectedResponse->setDescription($description); + $expectedResponse->setGoogleIpAddress($googleIpAddress); + $expectedResponse->setGoogleReferenceId($googleReferenceId); + $expectedResponse->setId($id); + $expectedResponse->setInterconnectType($interconnectType); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setLinkType($linkType); + $expectedResponse->setLocation($location); + $expectedResponse->setMacsecEnabled($macsecEnabled); + $expectedResponse->setName($name); + $expectedResponse->setNocContactEmail($nocContactEmail); + $expectedResponse->setOperationalStatus($operationalStatus); + $expectedResponse->setPeerIpAddress($peerIpAddress); + $expectedResponse->setProvisionedLinkCount($provisionedLinkCount); + $expectedResponse->setRemoteLocation($remoteLocation); + $expectedResponse->setRequestedLinkCount($requestedLinkCount); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setState($state); + $transport->addResponse($expectedResponse); + // Mock request + $interconnect = 'interconnect-849140594'; + $project = 'project-309310695'; + $response = $gapicClient->get($interconnect, $project); + $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.Interconnects/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInterconnect(); + $this->assertProtobufEquals($interconnect, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $interconnect = 'interconnect-849140594'; + $project = 'project-309310695'; + try { + $gapicClient->get($interconnect, $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 getDiagnosticsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new InterconnectsGetDiagnosticsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $interconnect = 'interconnect-849140594'; + $project = 'project-309310695'; + $response = $gapicClient->getDiagnostics($interconnect, $project); + $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.Interconnects/GetDiagnostics', $actualFuncCall); + $actualValue = $actualRequestObject->getInterconnect(); + $this->assertProtobufEquals($interconnect, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDiagnosticsExceptionTest() + { + $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 + $interconnect = 'interconnect-849140594'; + $project = 'project-309310695'; + try { + $gapicClient->getDiagnostics($interconnect, $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 getMacsecConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $expectedResponse = new InterconnectsGetMacsecConfigResponse(); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $interconnect = 'interconnect-849140594'; + $project = 'project-309310695'; + $response = $gapicClient->getMacsecConfig($interconnect, $project); + $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.Interconnects/GetMacsecConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getInterconnect(); + $this->assertProtobufEquals($interconnect, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getMacsecConfigExceptionTest() + { + $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 + $interconnect = 'interconnect-849140594'; + $project = 'project-309310695'; + try { + $gapicClient->getMacsecConfig($interconnect, $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 insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $interconnectResource = new Interconnect(); + $project = 'project-309310695'; + $response = $gapicClient->insert($interconnectResource, $project); + $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.Interconnects/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInterconnectResource(); + $this->assertProtobufEquals($interconnectResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $interconnectResource = new Interconnect(); + $project = 'project-309310695'; + $response = $gapicClient->insert($interconnectResource, $project); + $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 Interconnect(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InterconnectList(); + $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->list($project); + $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.Interconnects/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $interconnect = 'interconnect-849140594'; + $interconnectResource = new Interconnect(); + $project = 'project-309310695'; + $response = $gapicClient->patch($interconnect, $interconnectResource, $project); + $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.Interconnects/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInterconnect(); + $this->assertProtobufEquals($interconnect, $actualValue); + $actualValue = $actualApiRequestObject->getInterconnectResource(); + $this->assertProtobufEquals($interconnectResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $interconnect = 'interconnect-849140594'; + $interconnectResource = new Interconnect(); + $project = 'project-309310695'; + $response = $gapicClient->patch($interconnect, $interconnectResource, $project); + $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 setLabelsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + $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.Interconnects/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getGlobalSetLabelsRequestResource(); + $this->assertProtobufEquals($globalSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setLabelsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsExceptionTest'); + $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 + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/LicenseCodesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/LicenseCodesClientTest.php new file mode 100644 index 000000000000..397f8a4870ae --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/LicenseCodesClientTest.php @@ -0,0 +1,207 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return LicenseCodesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new LicenseCodesClient($options); + } + + /** @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'; + $selfLink = 'selfLink-1691268851'; + $state = 'state109757585'; + $transferable = false; + $expectedResponse = new LicenseCode(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setState($state); + $expectedResponse->setTransferable($transferable); + $transport->addResponse($expectedResponse); + // Mock request + $licenseCode = 'licenseCode1612079915'; + $project = 'project-309310695'; + $response = $gapicClient->get($licenseCode, $project); + $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.LicenseCodes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getLicenseCode(); + $this->assertProtobufEquals($licenseCode, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $licenseCode = 'licenseCode1612079915'; + $project = 'project-309310695'; + try { + $gapicClient->get($licenseCode, $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $response = $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + $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.LicenseCodes/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + try { + $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/LicensesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/LicensesClientTest.php new file mode 100644 index 000000000000..161aef43cc95 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/LicensesClientTest.php @@ -0,0 +1,656 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return LicensesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new LicensesClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $license = 'license166757441'; + $project = 'project-309310695'; + $response = $gapicClient->delete($license, $project); + $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.Licenses/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getLicense(); + $this->assertProtobufEquals($license, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $license = 'license166757441'; + $project = 'project-309310695'; + $response = $gapicClient->delete($license, $project); + $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 + $chargesUseFee = true; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $licenseCode = 1612079915; + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $transferable = false; + $expectedResponse = new License(); + $expectedResponse->setChargesUseFee($chargesUseFee); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLicenseCode($licenseCode); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setTransferable($transferable); + $transport->addResponse($expectedResponse); + // Mock request + $license = 'license166757441'; + $project = 'project-309310695'; + $response = $gapicClient->get($license, $project); + $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.Licenses/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getLicense(); + $this->assertProtobufEquals($license, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $license = 'license166757441'; + $project = 'project-309310695'; + try { + $gapicClient->get($license, $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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($project, $resource); + $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.Licenses/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($project, $resource); + // 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 GlobalOperationsClient([ + '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 + $licenseResource = new License(); + $project = 'project-309310695'; + $response = $gapicClient->insert($licenseResource, $project); + $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.Licenses/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getLicenseResource(); + $this->assertProtobufEquals($licenseResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $licenseResource = new License(); + $project = 'project-309310695'; + $response = $gapicClient->insert($licenseResource, $project); + $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'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new License(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new LicensesListResponse(); + $expectedResponse->setId($id); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $response = $gapicClient->list($project); + $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.Licenses/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + $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.Licenses/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getGlobalSetPolicyRequestResource(); + $this->assertProtobufEquals($globalSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + try { + $gapicClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $response = $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + $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.Licenses/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + try { + $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/MachineImagesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/MachineImagesClientTest.php new file mode 100644 index 000000000000..d0385b14d976 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/MachineImagesClientTest.php @@ -0,0 +1,664 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return MachineImagesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new MachineImagesClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $machineImage = 'machineImage1142931299'; + $project = 'project-309310695'; + $response = $gapicClient->delete($machineImage, $project); + $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.MachineImages/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getMachineImage(); + $this->assertProtobufEquals($machineImage, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $machineImage = 'machineImage1142931299'; + $project = 'project-309310695'; + $response = $gapicClient->delete($machineImage, $project); + $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'; + $guestFlush = false; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $satisfiesPzi = false; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $sourceInstance = 'sourceInstance-677426119'; + $status = 'status-892481550'; + $totalStorageBytes = 1528757268; + $expectedResponse = new MachineImage(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setGuestFlush($guestFlush); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSourceInstance($sourceInstance); + $expectedResponse->setStatus($status); + $expectedResponse->setTotalStorageBytes($totalStorageBytes); + $transport->addResponse($expectedResponse); + // Mock request + $machineImage = 'machineImage1142931299'; + $project = 'project-309310695'; + $response = $gapicClient->get($machineImage, $project); + $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.MachineImages/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getMachineImage(); + $this->assertProtobufEquals($machineImage, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $machineImage = 'machineImage1142931299'; + $project = 'project-309310695'; + try { + $gapicClient->get($machineImage, $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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($project, $resource); + $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.MachineImages/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($project, $resource); + // 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 GlobalOperationsClient([ + '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 + $machineImageResource = new MachineImage(); + $project = 'project-309310695'; + $response = $gapicClient->insert($machineImageResource, $project); + $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.MachineImages/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getMachineImageResource(); + $this->assertProtobufEquals($machineImageResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $machineImageResource = new MachineImage(); + $project = 'project-309310695'; + $response = $gapicClient->insert($machineImageResource, $project); + $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 MachineImage(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new MachineImageList(); + $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->list($project); + $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.MachineImages/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + $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.MachineImages/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getGlobalSetPolicyRequestResource(); + $this->assertProtobufEquals($globalSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + try { + $gapicClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $response = $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + $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.MachineImages/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + try { + $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/MachineTypesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/MachineTypesClientTest.php new file mode 100644 index 000000000000..bae54e13ed0f --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/MachineTypesClientTest.php @@ -0,0 +1,309 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return MachineTypesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new MachineTypesClient($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 MachineTypesScopedList(), + ]; + $expectedResponse = new MachineTypeAggregatedList(); + $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.MachineTypes/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 getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $guestCpus = 1754126894; + $id = 3355; + $imageSpaceGb = 461539048; + $isSharedCpu = false; + $kind = 'kind3292052'; + $maximumPersistentDisks = 1033091853; + $maximumPersistentDisksSizeGb = 1993209177; + $memoryMb = 1726613907; + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new MachineType(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setGuestCpus($guestCpus); + $expectedResponse->setId($id); + $expectedResponse->setImageSpaceGb($imageSpaceGb); + $expectedResponse->setIsSharedCpu($isSharedCpu); + $expectedResponse->setKind($kind); + $expectedResponse->setMaximumPersistentDisks($maximumPersistentDisks); + $expectedResponse->setMaximumPersistentDisksSizeGb($maximumPersistentDisksSizeGb); + $expectedResponse->setMemoryMb($memoryMb); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $machineType = 'machineType1838323762'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->get($machineType, $project, $zone); + $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.MachineTypes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getMachineType(); + $this->assertProtobufEquals($machineType, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $machineType = 'machineType1838323762'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->get($machineType, $project, $zone); + // 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 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 MachineType(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new MachineTypeList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->list($project, $zone); + $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.MachineTypes/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + try { + $gapicClient->list($project, $zone); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/NetworkAttachmentsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/NetworkAttachmentsClientTest.php new file mode 100644 index 000000000000..4338ef4d63f8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/NetworkAttachmentsClientTest.php @@ -0,0 +1,892 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return NetworkAttachmentsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NetworkAttachmentsClient($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 NetworkAttachmentsScopedList(), + ]; + $expectedResponse = new NetworkAttachmentAggregatedList(); + $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.NetworkAttachments/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() + { + $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 + $networkAttachment = 'networkAttachment1835256788'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($networkAttachment, $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.NetworkAttachments/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkAttachment(); + $this->assertProtobufEquals($networkAttachment, $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 + $networkAttachment = 'networkAttachment1835256788'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($networkAttachment, $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 + $connectionPreference = 'connectionPreference822688988'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $network = 'network1843485230'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $expectedResponse = new NetworkAttachment(); + $expectedResponse->setConnectionPreference($connectionPreference); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $transport->addResponse($expectedResponse); + // Mock request + $networkAttachment = 'networkAttachment1835256788'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($networkAttachment, $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.NetworkAttachments/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNetworkAttachment(); + $this->assertProtobufEquals($networkAttachment, $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 + $networkAttachment = 'networkAttachment1835256788'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($networkAttachment, $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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($project, $region, $resource); + $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.NetworkAttachments/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($project, $region, $resource); + // 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 + $networkAttachmentResource = new NetworkAttachment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($networkAttachmentResource, $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.NetworkAttachments/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkAttachmentResource(); + $this->assertProtobufEquals($networkAttachmentResource, $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 + $networkAttachmentResource = new NetworkAttachment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($networkAttachmentResource, $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 NetworkAttachment(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NetworkAttachmentList(); + $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.NetworkAttachments/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()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $networkAttachment = 'networkAttachment1835256788'; + $networkAttachmentResource = new NetworkAttachment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patch($networkAttachment, $networkAttachmentResource, $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.NetworkAttachments/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkAttachment(); + $this->assertProtobufEquals($networkAttachment, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkAttachmentResource(); + $this->assertProtobufEquals($networkAttachmentResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $networkAttachment = 'networkAttachment1835256788'; + $networkAttachmentResource = new NetworkAttachment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patch($networkAttachment, $networkAttachmentResource, $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + $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.NetworkAttachments/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRegionSetPolicyRequestResource(); + $this->assertProtobufEquals($regionSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + try { + $gapicClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $response = $gapicClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + $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.NetworkAttachments/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + try { + $gapicClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/NetworkEdgeSecurityServicesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/NetworkEdgeSecurityServicesClientTest.php new file mode 100644 index 000000000000..01719208b154 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/NetworkEdgeSecurityServicesClientTest.php @@ -0,0 +1,591 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return NetworkEdgeSecurityServicesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NetworkEdgeSecurityServicesClient($options); + } + + /** @test */ + public function aggregatedListTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $items = [ + 'itemsKey' => new NetworkEdgeSecurityServicesScopedList(), + ]; + $expectedResponse = new NetworkEdgeSecurityServiceAggregatedList(); + $expectedResponse->setEtag($etag); + $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.NetworkEdgeSecurityServices/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() + { + $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 + $networkEdgeSecurityService = 'networkEdgeSecurityService693882791'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($networkEdgeSecurityService, $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.NetworkEdgeSecurityServices/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEdgeSecurityService(); + $this->assertProtobufEquals($networkEdgeSecurityService, $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 + $networkEdgeSecurityService = 'networkEdgeSecurityService693882791'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($networkEdgeSecurityService, $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'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $region2 = 'region2-690338393'; + $securityPolicy = 'securityPolicy1781695249'; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $expectedResponse = new NetworkEdgeSecurityService(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSecurityPolicy($securityPolicy); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $transport->addResponse($expectedResponse); + // Mock request + $networkEdgeSecurityService = 'networkEdgeSecurityService693882791'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($networkEdgeSecurityService, $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.NetworkEdgeSecurityServices/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNetworkEdgeSecurityService(); + $this->assertProtobufEquals($networkEdgeSecurityService, $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 + $networkEdgeSecurityService = 'networkEdgeSecurityService693882791'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($networkEdgeSecurityService, $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 + $networkEdgeSecurityServiceResource = new NetworkEdgeSecurityService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($networkEdgeSecurityServiceResource, $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.NetworkEdgeSecurityServices/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEdgeSecurityServiceResource(); + $this->assertProtobufEquals($networkEdgeSecurityServiceResource, $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 + $networkEdgeSecurityServiceResource = new NetworkEdgeSecurityService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($networkEdgeSecurityServiceResource, $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 patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $networkEdgeSecurityService = 'networkEdgeSecurityService693882791'; + $networkEdgeSecurityServiceResource = new NetworkEdgeSecurityService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patch($networkEdgeSecurityService, $networkEdgeSecurityServiceResource, $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.NetworkEdgeSecurityServices/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEdgeSecurityService(); + $this->assertProtobufEquals($networkEdgeSecurityService, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkEdgeSecurityServiceResource(); + $this->assertProtobufEquals($networkEdgeSecurityServiceResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $networkEdgeSecurityService = 'networkEdgeSecurityService693882791'; + $networkEdgeSecurityServiceResource = new NetworkEdgeSecurityService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patch($networkEdgeSecurityService, $networkEdgeSecurityServiceResource, $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/owl-bot-staging/Compute/V1/tests/Unit/V1/NetworkEndpointGroupsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/NetworkEndpointGroupsClientTest.php new file mode 100644 index 000000000000..0009d18f1a88 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/NetworkEndpointGroupsClientTest.php @@ -0,0 +1,960 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return NetworkEndpointGroupsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NetworkEndpointGroupsClient($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 NetworkEndpointGroupsScopedList(), + ]; + $expectedResponse = new NetworkEndpointGroupAggregatedList(); + $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.NetworkEndpointGroups/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 attachNetworkEndpointsTest() + { + $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/attachNetworkEndpointsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/attachNetworkEndpointsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $networkEndpointGroupsAttachEndpointsRequestResource = new NetworkEndpointGroupsAttachEndpointsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->attachNetworkEndpoints($networkEndpointGroup, $networkEndpointGroupsAttachEndpointsRequestResource, $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.NetworkEndpointGroups/AttachNetworkEndpoints', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroupsAttachEndpointsRequestResource(); + $this->assertProtobufEquals($networkEndpointGroupsAttachEndpointsRequestResource, $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 attachNetworkEndpointsExceptionTest() + { + $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/attachNetworkEndpointsExceptionTest'); + $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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $networkEndpointGroupsAttachEndpointsRequestResource = new NetworkEndpointGroupsAttachEndpointsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->attachNetworkEndpoints($networkEndpointGroup, $networkEndpointGroupsAttachEndpointsRequestResource, $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 deleteTest() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($networkEndpointGroup, $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.NetworkEndpointGroups/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $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 deleteExceptionTest() + { + $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/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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($networkEndpointGroup, $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 detachNetworkEndpointsTest() + { + $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/detachNetworkEndpointsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/detachNetworkEndpointsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $networkEndpointGroupsDetachEndpointsRequestResource = new NetworkEndpointGroupsDetachEndpointsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->detachNetworkEndpoints($networkEndpointGroup, $networkEndpointGroupsDetachEndpointsRequestResource, $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.NetworkEndpointGroups/DetachNetworkEndpoints', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroupsDetachEndpointsRequestResource(); + $this->assertProtobufEquals($networkEndpointGroupsDetachEndpointsRequestResource, $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 detachNetworkEndpointsExceptionTest() + { + $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/detachNetworkEndpointsExceptionTest'); + $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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $networkEndpointGroupsDetachEndpointsRequestResource = new NetworkEndpointGroupsDetachEndpointsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->detachNetworkEndpoints($networkEndpointGroup, $networkEndpointGroupsDetachEndpointsRequestResource, $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 getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $creationTimestamp = 'creationTimestamp567396278'; + $defaultPort = 650363969; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $network = 'network1843485230'; + $networkEndpointType = 'networkEndpointType118301523'; + $pscTargetService = 'pscTargetService1879744870'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $size = 3530753; + $subnetwork = 'subnetwork-1302785042'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new NetworkEndpointGroup(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDefaultPort($defaultPort); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setNetworkEndpointType($networkEndpointType); + $expectedResponse->setPscTargetService($pscTargetService); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSize($size); + $expectedResponse->setSubnetwork($subnetwork); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->get($networkEndpointGroup, $project, $zone); + $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.NetworkEndpointGroups/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->get($networkEndpointGroup, $project, $zone); + // 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 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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $networkEndpointGroupResource = new NetworkEndpointGroup(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->insert($networkEndpointGroupResource, $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.NetworkEndpointGroups/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroupResource(); + $this->assertProtobufEquals($networkEndpointGroupResource, $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 insertExceptionTest() + { + $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/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 + $networkEndpointGroupResource = new NetworkEndpointGroup(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->insert($networkEndpointGroupResource, $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 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 NetworkEndpointGroup(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NetworkEndpointGroupList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->list($project, $zone); + $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.NetworkEndpointGroups/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + try { + $gapicClient->list($project, $zone); + // 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 listNetworkEndpointsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $itemsElement = new NetworkEndpointWithHealthStatus(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NetworkEndpointGroupsListNetworkEndpoints(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $networkEndpointGroupsListEndpointsRequestResource = new NetworkEndpointGroupsListEndpointsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->listNetworkEndpoints($networkEndpointGroup, $networkEndpointGroupsListEndpointsRequestResource, $project, $zone); + $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.NetworkEndpointGroups/ListNetworkEndpoints', $actualFuncCall); + $actualValue = $actualRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualRequestObject->getNetworkEndpointGroupsListEndpointsRequestResource(); + $this->assertProtobufEquals($networkEndpointGroupsListEndpointsRequestResource, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNetworkEndpointsExceptionTest() + { + $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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $networkEndpointGroupsListEndpointsRequestResource = new NetworkEndpointGroupsListEndpointsRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->listNetworkEndpoints($networkEndpointGroup, $networkEndpointGroupsListEndpointsRequestResource, $project, $zone); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + $response = $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone); + $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.NetworkEndpointGroups/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + try { + $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/NetworkFirewallPoliciesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/NetworkFirewallPoliciesClientTest.php new file mode 100644 index 000000000000..3f1c61a1b26f --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/NetworkFirewallPoliciesClientTest.php @@ -0,0 +1,1636 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return NetworkFirewallPoliciesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NetworkFirewallPoliciesClient($options); + } + + /** @test */ + public function addAssociationTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addAssociationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addAssociationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyAssociationResource = new FirewallPolicyAssociation(); + $project = 'project-309310695'; + $response = $gapicClient->addAssociation($firewallPolicy, $firewallPolicyAssociationResource, $project); + $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.NetworkFirewallPolicies/AddAssociation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyAssociationResource(); + $this->assertProtobufEquals($firewallPolicyAssociationResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function addAssociationExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addAssociationExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyAssociationResource = new FirewallPolicyAssociation(); + $project = 'project-309310695'; + $response = $gapicClient->addAssociation($firewallPolicy, $firewallPolicyAssociationResource, $project); + $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 addRuleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $project = 'project-309310695'; + $response = $gapicClient->addRule($firewallPolicy, $firewallPolicyRuleResource, $project); + $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.NetworkFirewallPolicies/AddRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyRuleResource(); + $this->assertProtobufEquals($firewallPolicyRuleResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function addRuleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addRuleExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $project = 'project-309310695'; + $response = $gapicClient->addRule($firewallPolicy, $firewallPolicyRuleResource, $project); + $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 cloneRulesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/cloneRulesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/cloneRulesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $response = $gapicClient->cloneRules($firewallPolicy, $project); + $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.NetworkFirewallPolicies/CloneRules', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function cloneRulesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/cloneRulesExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $response = $gapicClient->cloneRules($firewallPolicy, $project); + $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 deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $response = $gapicClient->delete($firewallPolicy, $project); + $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.NetworkFirewallPolicies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $response = $gapicClient->delete($firewallPolicy, $project); + $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'; + $displayName = 'displayName1615086568'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $parent = 'parent-995424086'; + $region = 'region-934795532'; + $ruleTupleCount = 388342037; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $shortName = 'shortName1565793390'; + $expectedResponse = new FirewallPolicy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setRegion($region); + $expectedResponse->setRuleTupleCount($ruleTupleCount); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $expectedResponse->setShortName($shortName); + $transport->addResponse($expectedResponse); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $response = $gapicClient->get($firewallPolicy, $project); + $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.NetworkFirewallPolicies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + try { + $gapicClient->get($firewallPolicy, $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 getAssociationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $attachmentTarget = 'attachmentTarget1786386477'; + $displayName = 'displayName1615086568'; + $firewallPolicyId = 'firewallPolicyId1430953673'; + $name2 = 'name2-1052831874'; + $shortName = 'shortName1565793390'; + $expectedResponse = new FirewallPolicyAssociation(); + $expectedResponse->setAttachmentTarget($attachmentTarget); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setFirewallPolicyId($firewallPolicyId); + $expectedResponse->setName($name2); + $expectedResponse->setShortName($shortName); + $transport->addResponse($expectedResponse); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $response = $gapicClient->getAssociation($firewallPolicy, $project); + $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.NetworkFirewallPolicies/GetAssociation', $actualFuncCall); + $actualValue = $actualRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAssociationExceptionTest() + { + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + try { + $gapicClient->getAssociation($firewallPolicy, $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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($project, $resource); + $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.NetworkFirewallPolicies/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($project, $resource); + // 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 getRuleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $action = 'action-1422950858'; + $description = 'description-1724546052'; + $direction = 'direction-962590849'; + $disabled = true; + $enableLogging = false; + $kind = 'kind3292052'; + $priority2 = 978365527; + $ruleName = 'ruleName-2092197394'; + $ruleTupleCount = 388342037; + $securityProfileGroup = 'securityProfileGroup-329459286'; + $tlsInspect = true; + $expectedResponse = new FirewallPolicyRule(); + $expectedResponse->setAction($action); + $expectedResponse->setDescription($description); + $expectedResponse->setDirection($direction); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setEnableLogging($enableLogging); + $expectedResponse->setKind($kind); + $expectedResponse->setPriority($priority2); + $expectedResponse->setRuleName($ruleName); + $expectedResponse->setRuleTupleCount($ruleTupleCount); + $expectedResponse->setSecurityProfileGroup($securityProfileGroup); + $expectedResponse->setTlsInspect($tlsInspect); + $transport->addResponse($expectedResponse); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $response = $gapicClient->getRule($firewallPolicy, $project); + $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.NetworkFirewallPolicies/GetRule', $actualFuncCall); + $actualValue = $actualRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRuleExceptionTest() + { + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + try { + $gapicClient->getRule($firewallPolicy, $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 insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $firewallPolicyResource = new FirewallPolicy(); + $project = 'project-309310695'; + $response = $gapicClient->insert($firewallPolicyResource, $project); + $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.NetworkFirewallPolicies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicyResource(); + $this->assertProtobufEquals($firewallPolicyResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $firewallPolicyResource = new FirewallPolicy(); + $project = 'project-309310695'; + $response = $gapicClient->insert($firewallPolicyResource, $project); + $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 = ''; + $itemsElement = new FirewallPolicy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new FirewallPolicyList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $response = $gapicClient->list($project); + $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.NetworkFirewallPolicies/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyResource = new FirewallPolicy(); + $project = 'project-309310695'; + $response = $gapicClient->patch($firewallPolicy, $firewallPolicyResource, $project); + $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.NetworkFirewallPolicies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyResource(); + $this->assertProtobufEquals($firewallPolicyResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyResource = new FirewallPolicy(); + $project = 'project-309310695'; + $response = $gapicClient->patch($firewallPolicy, $firewallPolicyResource, $project); + $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 patchRuleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $project = 'project-309310695'; + $response = $gapicClient->patchRule($firewallPolicy, $firewallPolicyRuleResource, $project); + $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.NetworkFirewallPolicies/PatchRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyRuleResource(); + $this->assertProtobufEquals($firewallPolicyRuleResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchRuleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchRuleExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $project = 'project-309310695'; + $response = $gapicClient->patchRule($firewallPolicy, $firewallPolicyRuleResource, $project); + $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 removeAssociationTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/removeAssociationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeAssociationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $response = $gapicClient->removeAssociation($firewallPolicy, $project); + $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.NetworkFirewallPolicies/RemoveAssociation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function removeAssociationExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/removeAssociationExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $response = $gapicClient->removeAssociation($firewallPolicy, $project); + $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 removeRuleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/removeRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $response = $gapicClient->removeRule($firewallPolicy, $project); + $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.NetworkFirewallPolicies/RemoveRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function removeRuleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/removeRuleExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $response = $gapicClient->removeRule($firewallPolicy, $project); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + $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.NetworkFirewallPolicies/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getGlobalSetPolicyRequestResource(); + $this->assertProtobufEquals($globalSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + try { + $gapicClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $response = $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + $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.NetworkFirewallPolicies/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + try { + $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/NetworksClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/NetworksClientTest.php new file mode 100644 index 000000000000..f94c2f51fec7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/NetworksClientTest.php @@ -0,0 +1,1192 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return NetworksClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NetworksClient($options); + } + + /** @test */ + public function addPeeringTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addPeeringTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addPeeringTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $network = 'network1843485230'; + $networksAddPeeringRequestResource = new NetworksAddPeeringRequest(); + $project = 'project-309310695'; + $response = $gapicClient->addPeering($network, $networksAddPeeringRequestResource, $project); + $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.Networks/AddPeering', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $actualValue = $actualApiRequestObject->getNetworksAddPeeringRequestResource(); + $this->assertProtobufEquals($networksAddPeeringRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function addPeeringExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addPeeringExceptionTest'); + $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 + $network = 'network1843485230'; + $networksAddPeeringRequestResource = new NetworksAddPeeringRequest(); + $project = 'project-309310695'; + $response = $gapicClient->addPeering($network, $networksAddPeeringRequestResource, $project); + $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 deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $network = 'network1843485230'; + $project = 'project-309310695'; + $response = $gapicClient->delete($network, $project); + $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.Networks/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $network = 'network1843485230'; + $project = 'project-309310695'; + $response = $gapicClient->delete($network, $project); + $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 + $iPv4Range = 'iPv4Range1132976182'; + $autoCreateSubnetworks = true; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $enableUlaInternalIpv6 = true; + $firewallPolicy = 'firewallPolicy1035044177'; + $gatewayIPv4 = 'gatewayIPv4-1431933859'; + $id = 3355; + $internalIpv6Range = 'internalIpv6Range277456807'; + $kind = 'kind3292052'; + $mtu = 108462; + $name = 'name3373707'; + $networkFirewallPolicyEnforcementOrder = 'networkFirewallPolicyEnforcementOrder1617117520'; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $expectedResponse = new Network(); + $expectedResponse->setIPv4Range($iPv4Range); + $expectedResponse->setAutoCreateSubnetworks($autoCreateSubnetworks); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEnableUlaInternalIpv6($enableUlaInternalIpv6); + $expectedResponse->setFirewallPolicy($firewallPolicy); + $expectedResponse->setGatewayIPv4($gatewayIPv4); + $expectedResponse->setId($id); + $expectedResponse->setInternalIpv6Range($internalIpv6Range); + $expectedResponse->setKind($kind); + $expectedResponse->setMtu($mtu); + $expectedResponse->setName($name); + $expectedResponse->setNetworkFirewallPolicyEnforcementOrder($networkFirewallPolicyEnforcementOrder); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $transport->addResponse($expectedResponse); + // Mock request + $network = 'network1843485230'; + $project = 'project-309310695'; + $response = $gapicClient->get($network, $project); + $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.Networks/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $network = 'network1843485230'; + $project = 'project-309310695'; + try { + $gapicClient->get($network, $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 getEffectiveFirewallsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new NetworksGetEffectiveFirewallsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $network = 'network1843485230'; + $project = 'project-309310695'; + $response = $gapicClient->getEffectiveFirewalls($network, $project); + $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.Networks/GetEffectiveFirewalls', $actualFuncCall); + $actualValue = $actualRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEffectiveFirewallsExceptionTest() + { + $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 + $network = 'network1843485230'; + $project = 'project-309310695'; + try { + $gapicClient->getEffectiveFirewalls($network, $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 insertTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $networkResource = new Network(); + $project = 'project-309310695'; + $response = $gapicClient->insert($networkResource, $project); + $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.Networks/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkResource(); + $this->assertProtobufEquals($networkResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $networkResource = new Network(); + $project = 'project-309310695'; + $response = $gapicClient->insert($networkResource, $project); + $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 Network(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NetworkList(); + $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->list($project); + $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.Networks/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 listPeeringRoutesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new ExchangedPeeringRoute(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new ExchangedPeeringRoutesList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $network = 'network1843485230'; + $project = 'project-309310695'; + $response = $gapicClient->listPeeringRoutes($network, $project); + $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.Networks/ListPeeringRoutes', $actualFuncCall); + $actualValue = $actualRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listPeeringRoutesExceptionTest() + { + $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 + $network = 'network1843485230'; + $project = 'project-309310695'; + try { + $gapicClient->listPeeringRoutes($network, $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 patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $network = 'network1843485230'; + $networkResource = new Network(); + $project = 'project-309310695'; + $response = $gapicClient->patch($network, $networkResource, $project); + $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.Networks/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $actualValue = $actualApiRequestObject->getNetworkResource(); + $this->assertProtobufEquals($networkResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $network = 'network1843485230'; + $networkResource = new Network(); + $project = 'project-309310695'; + $response = $gapicClient->patch($network, $networkResource, $project); + $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 removePeeringTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/removePeeringTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removePeeringTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $network = 'network1843485230'; + $networksRemovePeeringRequestResource = new NetworksRemovePeeringRequest(); + $project = 'project-309310695'; + $response = $gapicClient->removePeering($network, $networksRemovePeeringRequestResource, $project); + $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.Networks/RemovePeering', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $actualValue = $actualApiRequestObject->getNetworksRemovePeeringRequestResource(); + $this->assertProtobufEquals($networksRemovePeeringRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function removePeeringExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/removePeeringExceptionTest'); + $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 + $network = 'network1843485230'; + $networksRemovePeeringRequestResource = new NetworksRemovePeeringRequest(); + $project = 'project-309310695'; + $response = $gapicClient->removePeering($network, $networksRemovePeeringRequestResource, $project); + $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 switchToCustomModeTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/switchToCustomModeTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/switchToCustomModeTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $network = 'network1843485230'; + $project = 'project-309310695'; + $response = $gapicClient->switchToCustomMode($network, $project); + $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.Networks/SwitchToCustomMode', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function switchToCustomModeExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/switchToCustomModeExceptionTest'); + $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 + $network = 'network1843485230'; + $project = 'project-309310695'; + $response = $gapicClient->switchToCustomMode($network, $project); + $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 updatePeeringTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/updatePeeringTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/updatePeeringTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $network = 'network1843485230'; + $networksUpdatePeeringRequestResource = new NetworksUpdatePeeringRequest(); + $project = 'project-309310695'; + $response = $gapicClient->updatePeering($network, $networksUpdatePeeringRequestResource, $project); + $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.Networks/UpdatePeering', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $actualValue = $actualApiRequestObject->getNetworksUpdatePeeringRequestResource(); + $this->assertProtobufEquals($networksUpdatePeeringRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updatePeeringExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/updatePeeringExceptionTest'); + $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 + $network = 'network1843485230'; + $networksUpdatePeeringRequestResource = new NetworksUpdatePeeringRequest(); + $project = 'project-309310695'; + $response = $gapicClient->updatePeering($network, $networksUpdatePeeringRequestResource, $project); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/NodeGroupsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/NodeGroupsClientTest.php new file mode 100644 index 000000000000..dcb01c9b25d9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/NodeGroupsClientTest.php @@ -0,0 +1,1606 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return NodeGroupsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NodeGroupsClient($options); + } + + /** @test */ + public function addNodesTest() + { + $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/addNodesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addNodesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupsAddNodesRequestResource = new NodeGroupsAddNodesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->addNodes($nodeGroup, $nodeGroupsAddNodesRequestResource, $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.NodeGroups/AddNodes', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNodeGroup(); + $this->assertProtobufEquals($nodeGroup, $actualValue); + $actualValue = $actualApiRequestObject->getNodeGroupsAddNodesRequestResource(); + $this->assertProtobufEquals($nodeGroupsAddNodesRequestResource, $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 addNodesExceptionTest() + { + $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/addNodesExceptionTest'); + $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 + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupsAddNodesRequestResource = new NodeGroupsAddNodesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->addNodes($nodeGroup, $nodeGroupsAddNodesRequestResource, $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 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 NodeGroupsScopedList(), + ]; + $expectedResponse = new NodeGroupAggregatedList(); + $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.NodeGroups/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() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $nodeGroup = 'nodeGroup1543699970'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($nodeGroup, $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.NodeGroups/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNodeGroup(); + $this->assertProtobufEquals($nodeGroup, $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 deleteExceptionTest() + { + $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/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 + $nodeGroup = 'nodeGroup1543699970'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($nodeGroup, $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 deleteNodesTest() + { + $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/deleteNodesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteNodesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupsDeleteNodesRequestResource = new NodeGroupsDeleteNodesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->deleteNodes($nodeGroup, $nodeGroupsDeleteNodesRequestResource, $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.NodeGroups/DeleteNodes', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNodeGroup(); + $this->assertProtobufEquals($nodeGroup, $actualValue); + $actualValue = $actualApiRequestObject->getNodeGroupsDeleteNodesRequestResource(); + $this->assertProtobufEquals($nodeGroupsDeleteNodesRequestResource, $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 deleteNodesExceptionTest() + { + $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/deleteNodesExceptionTest'); + $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 + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupsDeleteNodesRequestResource = new NodeGroupsDeleteNodesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->deleteNodes($nodeGroup, $nodeGroupsDeleteNodesRequestResource, $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 getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $locationHint = 'locationHint-1796964143'; + $maintenanceInterval = 'maintenanceInterval1477109873'; + $maintenancePolicy = 'maintenancePolicy1065198558'; + $name = 'name3373707'; + $nodeTemplate = 'nodeTemplate323154455'; + $selfLink = 'selfLink-1691268851'; + $size = 3530753; + $status = 'status-892481550'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new NodeGroup(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLocationHint($locationHint); + $expectedResponse->setMaintenanceInterval($maintenanceInterval); + $expectedResponse->setMaintenancePolicy($maintenancePolicy); + $expectedResponse->setName($name); + $expectedResponse->setNodeTemplate($nodeTemplate); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSize($size); + $expectedResponse->setStatus($status); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $nodeGroup = 'nodeGroup1543699970'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->get($nodeGroup, $project, $zone); + $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.NodeGroups/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNodeGroup(); + $this->assertProtobufEquals($nodeGroup, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $nodeGroup = 'nodeGroup1543699970'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->get($nodeGroup, $project, $zone); + // 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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $response = $gapicClient->getIamPolicy($project, $resource, $zone); + $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.NodeGroups/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + try { + $gapicClient->getIamPolicy($project, $resource, $zone); + // 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 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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $initialNodeCount = 1682564205; + $nodeGroupResource = new NodeGroup(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->insert($initialNodeCount, $nodeGroupResource, $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.NodeGroups/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInitialNodeCount(); + $this->assertProtobufEquals($initialNodeCount, $actualValue); + $actualValue = $actualApiRequestObject->getNodeGroupResource(); + $this->assertProtobufEquals($nodeGroupResource, $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 insertExceptionTest() + { + $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/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 + $initialNodeCount = 1682564205; + $nodeGroupResource = new NodeGroup(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->insert($initialNodeCount, $nodeGroupResource, $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 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 NodeGroup(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NodeGroupList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->list($project, $zone); + $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.NodeGroups/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + try { + $gapicClient->list($project, $zone); + // 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 listNodesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new NodeGroupNode(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NodeGroupsListNodes(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $nodeGroup = 'nodeGroup1543699970'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->listNodes($nodeGroup, $project, $zone); + $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.NodeGroups/ListNodes', $actualFuncCall); + $actualValue = $actualRequestObject->getNodeGroup(); + $this->assertProtobufEquals($nodeGroup, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNodesExceptionTest() + { + $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 + $nodeGroup = 'nodeGroup1543699970'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->listNodes($nodeGroup, $project, $zone); + // 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 patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupResource = new NodeGroup(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->patch($nodeGroup, $nodeGroupResource, $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.NodeGroups/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNodeGroup(); + $this->assertProtobufEquals($nodeGroup, $actualValue); + $actualValue = $actualApiRequestObject->getNodeGroupResource(); + $this->assertProtobufEquals($nodeGroupResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupResource = new NodeGroup(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->patch($nodeGroup, $nodeGroupResource, $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 performMaintenanceTest() + { + $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/performMaintenanceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/performMaintenanceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupsPerformMaintenanceRequestResource = new NodeGroupsPerformMaintenanceRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->performMaintenance($nodeGroup, $nodeGroupsPerformMaintenanceRequestResource, $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.NodeGroups/PerformMaintenance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNodeGroup(); + $this->assertProtobufEquals($nodeGroup, $actualValue); + $actualValue = $actualApiRequestObject->getNodeGroupsPerformMaintenanceRequestResource(); + $this->assertProtobufEquals($nodeGroupsPerformMaintenanceRequestResource, $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 performMaintenanceExceptionTest() + { + $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/performMaintenanceExceptionTest'); + $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 + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupsPerformMaintenanceRequestResource = new NodeGroupsPerformMaintenanceRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->performMaintenance($nodeGroup, $nodeGroupsPerformMaintenanceRequestResource, $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $response = $gapicClient->setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource); + $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.NodeGroups/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $actualValue = $actualRequestObject->getZoneSetPolicyRequestResource(); + $this->assertProtobufEquals($zoneSetPolicyRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + try { + $gapicClient->setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource); + // 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 setNodeTemplateTest() + { + $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/setNodeTemplateTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setNodeTemplateTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupsSetNodeTemplateRequestResource = new NodeGroupsSetNodeTemplateRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setNodeTemplate($nodeGroup, $nodeGroupsSetNodeTemplateRequestResource, $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.NodeGroups/SetNodeTemplate', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNodeGroup(); + $this->assertProtobufEquals($nodeGroup, $actualValue); + $actualValue = $actualApiRequestObject->getNodeGroupsSetNodeTemplateRequestResource(); + $this->assertProtobufEquals($nodeGroupsSetNodeTemplateRequestResource, $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 setNodeTemplateExceptionTest() + { + $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/setNodeTemplateExceptionTest'); + $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 + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupsSetNodeTemplateRequestResource = new NodeGroupsSetNodeTemplateRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->setNodeTemplate($nodeGroup, $nodeGroupsSetNodeTemplateRequestResource, $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 simulateMaintenanceEventTest() + { + $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/simulateMaintenanceEventTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/simulateMaintenanceEventTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupsSimulateMaintenanceEventRequestResource = new NodeGroupsSimulateMaintenanceEventRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->simulateMaintenanceEvent($nodeGroup, $nodeGroupsSimulateMaintenanceEventRequestResource, $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.NodeGroups/SimulateMaintenanceEvent', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNodeGroup(); + $this->assertProtobufEquals($nodeGroup, $actualValue); + $actualValue = $actualApiRequestObject->getNodeGroupsSimulateMaintenanceEventRequestResource(); + $this->assertProtobufEquals($nodeGroupsSimulateMaintenanceEventRequestResource, $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 simulateMaintenanceEventExceptionTest() + { + $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/simulateMaintenanceEventExceptionTest'); + $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 + $nodeGroup = 'nodeGroup1543699970'; + $nodeGroupsSimulateMaintenanceEventRequestResource = new NodeGroupsSimulateMaintenanceEventRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->simulateMaintenanceEvent($nodeGroup, $nodeGroupsSimulateMaintenanceEventRequestResource, $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + $response = $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone); + $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.NodeGroups/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + try { + $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/NodeTemplatesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/NodeTemplatesClientTest.php new file mode 100644 index 000000000000..bb0d3e141b20 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/NodeTemplatesClientTest.php @@ -0,0 +1,769 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return NodeTemplatesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NodeTemplatesClient($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 NodeTemplatesScopedList(), + ]; + $expectedResponse = new NodeTemplateAggregatedList(); + $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.NodeTemplates/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() + { + $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 + $nodeTemplate = 'nodeTemplate323154455'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($nodeTemplate, $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.NodeTemplates/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNodeTemplate(); + $this->assertProtobufEquals($nodeTemplate, $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 + $nodeTemplate = 'nodeTemplate323154455'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($nodeTemplate, $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 + $cpuOvercommitType = 'cpuOvercommitType247727959'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $nodeType = 'nodeType465832791'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $statusMessage = 'statusMessage-239442758'; + $expectedResponse = new NodeTemplate(); + $expectedResponse->setCpuOvercommitType($cpuOvercommitType); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNodeType($nodeType); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $expectedResponse->setStatusMessage($statusMessage); + $transport->addResponse($expectedResponse); + // Mock request + $nodeTemplate = 'nodeTemplate323154455'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($nodeTemplate, $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.NodeTemplates/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNodeTemplate(); + $this->assertProtobufEquals($nodeTemplate, $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 + $nodeTemplate = 'nodeTemplate323154455'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($nodeTemplate, $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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($project, $region, $resource); + $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.NodeTemplates/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($project, $region, $resource); + // 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 + $nodeTemplateResource = new NodeTemplate(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($nodeTemplateResource, $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.NodeTemplates/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNodeTemplateResource(); + $this->assertProtobufEquals($nodeTemplateResource, $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 + $nodeTemplateResource = new NodeTemplate(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($nodeTemplateResource, $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 NodeTemplate(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NodeTemplateList(); + $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.NodeTemplates/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()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + $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.NodeTemplates/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRegionSetPolicyRequestResource(); + $this->assertProtobufEquals($regionSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + try { + $gapicClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $response = $gapicClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + $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.NodeTemplates/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + try { + $gapicClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/NodeTypesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/NodeTypesClientTest.php new file mode 100644 index 000000000000..2d47cf5b8dcd --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/NodeTypesClientTest.php @@ -0,0 +1,305 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return NodeTypesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NodeTypesClient($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 NodeTypesScopedList(), + ]; + $expectedResponse = new NodeTypeAggregatedList(); + $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.NodeTypes/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 getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $cpuPlatform = 'cpuPlatform947156266'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $guestCpus = 1754126894; + $id = 3355; + $kind = 'kind3292052'; + $localSsdGb = 1281375158; + $memoryMb = 1726613907; + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new NodeType(); + $expectedResponse->setCpuPlatform($cpuPlatform); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setGuestCpus($guestCpus); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLocalSsdGb($localSsdGb); + $expectedResponse->setMemoryMb($memoryMb); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $nodeType = 'nodeType465832791'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->get($nodeType, $project, $zone); + $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.NodeTypes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNodeType(); + $this->assertProtobufEquals($nodeType, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $nodeType = 'nodeType465832791'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->get($nodeType, $project, $zone); + // 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 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 NodeType(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NodeTypeList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->list($project, $zone); + $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.NodeTypes/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + try { + $gapicClient->list($project, $zone); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/PacketMirroringsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/PacketMirroringsClientTest.php new file mode 100644 index 000000000000..f46c94d1ff7e --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/PacketMirroringsClientTest.php @@ -0,0 +1,738 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return PacketMirroringsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new PacketMirroringsClient($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 PacketMirroringsScopedList(), + ]; + $expectedResponse = new PacketMirroringAggregatedList(); + $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.PacketMirrorings/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() + { + $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 + $packetMirroring = 'packetMirroring22305996'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($packetMirroring, $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.PacketMirrorings/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getPacketMirroring(); + $this->assertProtobufEquals($packetMirroring, $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 + $packetMirroring = 'packetMirroring22305996'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($packetMirroring, $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'; + $enable = 'enable-1298848381'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $priority = 1165461084; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new PacketMirroring(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEnable($enable); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setPriority($priority); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $packetMirroring = 'packetMirroring22305996'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($packetMirroring, $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.PacketMirrorings/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getPacketMirroring(); + $this->assertProtobufEquals($packetMirroring, $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 + $packetMirroring = 'packetMirroring22305996'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($packetMirroring, $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 + $packetMirroringResource = new PacketMirroring(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($packetMirroringResource, $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.PacketMirrorings/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getPacketMirroringResource(); + $this->assertProtobufEquals($packetMirroringResource, $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 + $packetMirroringResource = new PacketMirroring(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($packetMirroringResource, $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 PacketMirroring(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new PacketMirroringList(); + $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.PacketMirrorings/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()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $packetMirroring = 'packetMirroring22305996'; + $packetMirroringResource = new PacketMirroring(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patch($packetMirroring, $packetMirroringResource, $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.PacketMirrorings/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getPacketMirroring(); + $this->assertProtobufEquals($packetMirroring, $actualValue); + $actualValue = $actualApiRequestObject->getPacketMirroringResource(); + $this->assertProtobufEquals($packetMirroringResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $packetMirroring = 'packetMirroring22305996'; + $packetMirroringResource = new PacketMirroring(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patch($packetMirroring, $packetMirroringResource, $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $response = $gapicClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + $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.PacketMirrorings/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + try { + $gapicClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/ProjectsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/ProjectsClientTest.php new file mode 100644 index 000000000000..23244e66a238 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/ProjectsClientTest.php @@ -0,0 +1,1517 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ProjectsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ProjectsClient($options); + } + + /** @test */ + public function disableXpnHostTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/disableXpnHostTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/disableXpnHostTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $response = $gapicClient->disableXpnHost($project); + $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.Projects/DisableXpnHost', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function disableXpnHostExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/disableXpnHostExceptionTest'); + $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 + $project = 'project-309310695'; + $response = $gapicClient->disableXpnHost($project); + $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 disableXpnResourceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/disableXpnResourceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/disableXpnResourceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $projectsDisableXpnResourceRequestResource = new ProjectsDisableXpnResourceRequest(); + $response = $gapicClient->disableXpnResource($project, $projectsDisableXpnResourceRequestResource); + $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.Projects/DisableXpnResource', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getProjectsDisableXpnResourceRequestResource(); + $this->assertProtobufEquals($projectsDisableXpnResourceRequestResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function disableXpnResourceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/disableXpnResourceExceptionTest'); + $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 + $project = 'project-309310695'; + $projectsDisableXpnResourceRequestResource = new ProjectsDisableXpnResourceRequest(); + $response = $gapicClient->disableXpnResource($project, $projectsDisableXpnResourceRequestResource); + $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 enableXpnHostTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/enableXpnHostTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/enableXpnHostTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $response = $gapicClient->enableXpnHost($project); + $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.Projects/EnableXpnHost', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function enableXpnHostExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/enableXpnHostExceptionTest'); + $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 + $project = 'project-309310695'; + $response = $gapicClient->enableXpnHost($project); + $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 enableXpnResourceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/enableXpnResourceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/enableXpnResourceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $projectsEnableXpnResourceRequestResource = new ProjectsEnableXpnResourceRequest(); + $response = $gapicClient->enableXpnResource($project, $projectsEnableXpnResourceRequestResource); + $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.Projects/EnableXpnResource', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getProjectsEnableXpnResourceRequestResource(); + $this->assertProtobufEquals($projectsEnableXpnResourceRequestResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function enableXpnResourceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/enableXpnResourceExceptionTest'); + $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 + $project = 'project-309310695'; + $projectsEnableXpnResourceRequestResource = new ProjectsEnableXpnResourceRequest(); + $response = $gapicClient->enableXpnResource($project, $projectsEnableXpnResourceRequestResource); + $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 + $cloudArmorTier = 'cloudArmorTier-532443860'; + $creationTimestamp = 'creationTimestamp567396278'; + $defaultNetworkTier = 'defaultNetworkTier1545495185'; + $defaultServiceAccount = 'defaultServiceAccount-1848771419'; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $vmDnsSetting = 'vmDnsSetting1132598194'; + $xpnProjectStatus = 'xpnProjectStatus-308451647'; + $expectedResponse = new Project(); + $expectedResponse->setCloudArmorTier($cloudArmorTier); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDefaultNetworkTier($defaultNetworkTier); + $expectedResponse->setDefaultServiceAccount($defaultServiceAccount); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setVmDnsSetting($vmDnsSetting); + $expectedResponse->setXpnProjectStatus($xpnProjectStatus); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $response = $gapicClient->get($project); + $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.Projects/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $project = 'project-309310695'; + try { + $gapicClient->get($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 getXpnHostTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $cloudArmorTier = 'cloudArmorTier-532443860'; + $creationTimestamp = 'creationTimestamp567396278'; + $defaultNetworkTier = 'defaultNetworkTier1545495185'; + $defaultServiceAccount = 'defaultServiceAccount-1848771419'; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $vmDnsSetting = 'vmDnsSetting1132598194'; + $xpnProjectStatus = 'xpnProjectStatus-308451647'; + $expectedResponse = new Project(); + $expectedResponse->setCloudArmorTier($cloudArmorTier); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDefaultNetworkTier($defaultNetworkTier); + $expectedResponse->setDefaultServiceAccount($defaultServiceAccount); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setVmDnsSetting($vmDnsSetting); + $expectedResponse->setXpnProjectStatus($xpnProjectStatus); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $response = $gapicClient->getXpnHost($project); + $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.Projects/GetXpnHost', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getXpnHostExceptionTest() + { + $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->getXpnHost($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 getXpnResourcesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $kind = 'kind3292052'; + $nextPageToken = ''; + $resourcesElement = new XpnResourceId(); + $resources = [ + $resourcesElement, + ]; + $expectedResponse = new ProjectsGetXpnResources(); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setResources($resources); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $response = $gapicClient->getXpnResources($project); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getResources()[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.Projects/GetXpnResources', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getXpnResourcesExceptionTest() + { + $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->getXpnResources($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 listXpnHostsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new Project(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new XpnHostList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $projectsListXpnHostsRequestResource = new ProjectsListXpnHostsRequest(); + $response = $gapicClient->listXpnHosts($project, $projectsListXpnHostsRequestResource); + $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.Projects/ListXpnHosts', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getProjectsListXpnHostsRequestResource(); + $this->assertProtobufEquals($projectsListXpnHostsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listXpnHostsExceptionTest() + { + $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'; + $projectsListXpnHostsRequestResource = new ProjectsListXpnHostsRequest(); + try { + $gapicClient->listXpnHosts($project, $projectsListXpnHostsRequestResource); + // 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 moveDiskTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/moveDiskTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/moveDiskTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $diskMoveRequestResource = new DiskMoveRequest(); + $project = 'project-309310695'; + $response = $gapicClient->moveDisk($diskMoveRequestResource, $project); + $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.Projects/MoveDisk', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDiskMoveRequestResource(); + $this->assertProtobufEquals($diskMoveRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function moveDiskExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/moveDiskExceptionTest'); + $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 + $diskMoveRequestResource = new DiskMoveRequest(); + $project = 'project-309310695'; + $response = $gapicClient->moveDisk($diskMoveRequestResource, $project); + $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 moveInstanceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/moveInstanceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/moveInstanceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceMoveRequestResource = new InstanceMoveRequest(); + $project = 'project-309310695'; + $response = $gapicClient->moveInstance($instanceMoveRequestResource, $project); + $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.Projects/MoveInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceMoveRequestResource(); + $this->assertProtobufEquals($instanceMoveRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function moveInstanceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/moveInstanceExceptionTest'); + $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 + $instanceMoveRequestResource = new InstanceMoveRequest(); + $project = 'project-309310695'; + $response = $gapicClient->moveInstance($instanceMoveRequestResource, $project); + $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 setCloudArmorTierTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setCloudArmorTierTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setCloudArmorTierTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $projectsSetCloudArmorTierRequestResource = new ProjectsSetCloudArmorTierRequest(); + $response = $gapicClient->setCloudArmorTier($project, $projectsSetCloudArmorTierRequestResource); + $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.Projects/SetCloudArmorTier', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getProjectsSetCloudArmorTierRequestResource(); + $this->assertProtobufEquals($projectsSetCloudArmorTierRequestResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setCloudArmorTierExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setCloudArmorTierExceptionTest'); + $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 + $project = 'project-309310695'; + $projectsSetCloudArmorTierRequestResource = new ProjectsSetCloudArmorTierRequest(); + $response = $gapicClient->setCloudArmorTier($project, $projectsSetCloudArmorTierRequestResource); + $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 setCommonInstanceMetadataTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setCommonInstanceMetadataTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setCommonInstanceMetadataTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $metadataResource = new Metadata(); + $project = 'project-309310695'; + $response = $gapicClient->setCommonInstanceMetadata($metadataResource, $project); + $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.Projects/SetCommonInstanceMetadata', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getMetadataResource(); + $this->assertProtobufEquals($metadataResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setCommonInstanceMetadataExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setCommonInstanceMetadataExceptionTest'); + $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 + $metadataResource = new Metadata(); + $project = 'project-309310695'; + $response = $gapicClient->setCommonInstanceMetadata($metadataResource, $project); + $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 setDefaultNetworkTierTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setDefaultNetworkTierTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setDefaultNetworkTierTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $projectsSetDefaultNetworkTierRequestResource = new ProjectsSetDefaultNetworkTierRequest(); + $response = $gapicClient->setDefaultNetworkTier($project, $projectsSetDefaultNetworkTierRequestResource); + $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.Projects/SetDefaultNetworkTier', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getProjectsSetDefaultNetworkTierRequestResource(); + $this->assertProtobufEquals($projectsSetDefaultNetworkTierRequestResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setDefaultNetworkTierExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setDefaultNetworkTierExceptionTest'); + $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 + $project = 'project-309310695'; + $projectsSetDefaultNetworkTierRequestResource = new ProjectsSetDefaultNetworkTierRequest(); + $response = $gapicClient->setDefaultNetworkTier($project, $projectsSetDefaultNetworkTierRequestResource); + $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 setUsageExportBucketTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setUsageExportBucketTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setUsageExportBucketTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $usageExportLocationResource = new UsageExportLocation(); + $response = $gapicClient->setUsageExportBucket($project, $usageExportLocationResource); + $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.Projects/SetUsageExportBucket', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getUsageExportLocationResource(); + $this->assertProtobufEquals($usageExportLocationResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setUsageExportBucketExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setUsageExportBucketExceptionTest'); + $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 + $project = 'project-309310695'; + $usageExportLocationResource = new UsageExportLocation(); + $response = $gapicClient->setUsageExportBucket($project, $usageExportLocationResource); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/PublicAdvertisedPrefixesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/PublicAdvertisedPrefixesClientTest.php new file mode 100644 index 000000000000..6d65801f16f8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/PublicAdvertisedPrefixesClientTest.php @@ -0,0 +1,802 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return PublicAdvertisedPrefixesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new PublicAdvertisedPrefixesClient($options); + } + + /** @test */ + public function announceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/announceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/announceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $publicAdvertisedPrefix = 'publicAdvertisedPrefix-1508738146'; + $response = $gapicClient->announce($project, $publicAdvertisedPrefix); + $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.PublicAdvertisedPrefixes/Announce', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicAdvertisedPrefix(); + $this->assertProtobufEquals($publicAdvertisedPrefix, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function announceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/announceExceptionTest'); + $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 + $project = 'project-309310695'; + $publicAdvertisedPrefix = 'publicAdvertisedPrefix-1508738146'; + $response = $gapicClient->announce($project, $publicAdvertisedPrefix); + $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 deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $publicAdvertisedPrefix = 'publicAdvertisedPrefix-1508738146'; + $response = $gapicClient->delete($project, $publicAdvertisedPrefix); + $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.PublicAdvertisedPrefixes/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicAdvertisedPrefix(); + $this->assertProtobufEquals($publicAdvertisedPrefix, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $publicAdvertisedPrefix = 'publicAdvertisedPrefix-1508738146'; + $response = $gapicClient->delete($project, $publicAdvertisedPrefix); + $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 + $byoipApiVersion = 'byoipApiVersion162683283'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $dnsVerificationIp = 'dnsVerificationIp-1906472267'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $ipCidrRange = 'ipCidrRange-2049366326'; + $kind = 'kind3292052'; + $name = 'name3373707'; + $pdpScope = 'pdpScope1061135697'; + $selfLink = 'selfLink-1691268851'; + $sharedSecret = 'sharedSecret-154938422'; + $status = 'status-892481550'; + $expectedResponse = new PublicAdvertisedPrefix(); + $expectedResponse->setByoipApiVersion($byoipApiVersion); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDnsVerificationIp($dnsVerificationIp); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setIpCidrRange($ipCidrRange); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setPdpScope($pdpScope); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSharedSecret($sharedSecret); + $expectedResponse->setStatus($status); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $publicAdvertisedPrefix = 'publicAdvertisedPrefix-1508738146'; + $response = $gapicClient->get($project, $publicAdvertisedPrefix); + $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.PublicAdvertisedPrefixes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getPublicAdvertisedPrefix(); + $this->assertProtobufEquals($publicAdvertisedPrefix, $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 + $project = 'project-309310695'; + $publicAdvertisedPrefix = 'publicAdvertisedPrefix-1508738146'; + try { + $gapicClient->get($project, $publicAdvertisedPrefix); + // 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 GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $publicAdvertisedPrefixResource = new PublicAdvertisedPrefix(); + $response = $gapicClient->insert($project, $publicAdvertisedPrefixResource); + $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.PublicAdvertisedPrefixes/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicAdvertisedPrefixResource(); + $this->assertProtobufEquals($publicAdvertisedPrefixResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $publicAdvertisedPrefixResource = new PublicAdvertisedPrefix(); + $response = $gapicClient->insert($project, $publicAdvertisedPrefixResource); + $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 PublicAdvertisedPrefix(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new PublicAdvertisedPrefixList(); + $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->list($project); + $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.PublicAdvertisedPrefixes/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $publicAdvertisedPrefix = 'publicAdvertisedPrefix-1508738146'; + $publicAdvertisedPrefixResource = new PublicAdvertisedPrefix(); + $response = $gapicClient->patch($project, $publicAdvertisedPrefix, $publicAdvertisedPrefixResource); + $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.PublicAdvertisedPrefixes/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicAdvertisedPrefix(); + $this->assertProtobufEquals($publicAdvertisedPrefix, $actualValue); + $actualValue = $actualApiRequestObject->getPublicAdvertisedPrefixResource(); + $this->assertProtobufEquals($publicAdvertisedPrefixResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $publicAdvertisedPrefix = 'publicAdvertisedPrefix-1508738146'; + $publicAdvertisedPrefixResource = new PublicAdvertisedPrefix(); + $response = $gapicClient->patch($project, $publicAdvertisedPrefix, $publicAdvertisedPrefixResource); + $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 withdrawTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/withdrawTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/withdrawTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $publicAdvertisedPrefix = 'publicAdvertisedPrefix-1508738146'; + $response = $gapicClient->withdraw($project, $publicAdvertisedPrefix); + $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.PublicAdvertisedPrefixes/Withdraw', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicAdvertisedPrefix(); + $this->assertProtobufEquals($publicAdvertisedPrefix, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function withdrawExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/withdrawExceptionTest'); + $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 + $project = 'project-309310695'; + $publicAdvertisedPrefix = 'publicAdvertisedPrefix-1508738146'; + $response = $gapicClient->withdraw($project, $publicAdvertisedPrefix); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/PublicDelegatedPrefixesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/PublicDelegatedPrefixesClientTest.php new file mode 100644 index 000000000000..717084111dd2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/PublicDelegatedPrefixesClientTest.php @@ -0,0 +1,916 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return PublicDelegatedPrefixesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new PublicDelegatedPrefixesClient($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 PublicDelegatedPrefixesScopedList(), + ]; + $expectedResponse = new PublicDelegatedPrefixAggregatedList(); + $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.PublicDelegatedPrefixes/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 announceTest() + { + $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/announceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/announceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $region = 'region-934795532'; + $response = $gapicClient->announce($project, $publicDelegatedPrefix, $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.PublicDelegatedPrefixes/Announce', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicDelegatedPrefix(); + $this->assertProtobufEquals($publicDelegatedPrefix, $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 announceExceptionTest() + { + $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/announceExceptionTest'); + $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 + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $region = 'region-934795532'; + $response = $gapicClient->announce($project, $publicDelegatedPrefix, $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 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 + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $region = 'region-934795532'; + $response = $gapicClient->delete($project, $publicDelegatedPrefix, $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.PublicDelegatedPrefixes/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicDelegatedPrefix(); + $this->assertProtobufEquals($publicDelegatedPrefix, $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 + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $region = 'region-934795532'; + $response = $gapicClient->delete($project, $publicDelegatedPrefix, $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 + $allocatablePrefixLength = 1649040182; + $byoipApiVersion = 'byoipApiVersion162683283'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $ipCidrRange = 'ipCidrRange-2049366326'; + $isLiveMigration = true; + $kind = 'kind3292052'; + $mode = 'mode3357091'; + $name = 'name3373707'; + $parentPrefix = 'parentPrefix552104903'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $expectedResponse = new PublicDelegatedPrefix(); + $expectedResponse->setAllocatablePrefixLength($allocatablePrefixLength); + $expectedResponse->setByoipApiVersion($byoipApiVersion); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setIpCidrRange($ipCidrRange); + $expectedResponse->setIsLiveMigration($isLiveMigration); + $expectedResponse->setKind($kind); + $expectedResponse->setMode($mode); + $expectedResponse->setName($name); + $expectedResponse->setParentPrefix($parentPrefix); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $region = 'region-934795532'; + $response = $gapicClient->get($project, $publicDelegatedPrefix, $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.PublicDelegatedPrefixes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getPublicDelegatedPrefix(); + $this->assertProtobufEquals($publicDelegatedPrefix, $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 + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $region = 'region-934795532'; + try { + $gapicClient->get($project, $publicDelegatedPrefix, $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 + $project = 'project-309310695'; + $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + $region = 'region-934795532'; + $response = $gapicClient->insert($project, $publicDelegatedPrefixResource, $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.PublicDelegatedPrefixes/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicDelegatedPrefixResource(); + $this->assertProtobufEquals($publicDelegatedPrefixResource, $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 + $project = 'project-309310695'; + $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + $region = 'region-934795532'; + $response = $gapicClient->insert($project, $publicDelegatedPrefixResource, $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 PublicDelegatedPrefix(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new PublicDelegatedPrefixList(); + $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.PublicDelegatedPrefixes/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()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + $region = 'region-934795532'; + $response = $gapicClient->patch($project, $publicDelegatedPrefix, $publicDelegatedPrefixResource, $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.PublicDelegatedPrefixes/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicDelegatedPrefix(); + $this->assertProtobufEquals($publicDelegatedPrefix, $actualValue); + $actualValue = $actualApiRequestObject->getPublicDelegatedPrefixResource(); + $this->assertProtobufEquals($publicDelegatedPrefixResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $publicDelegatedPrefixResource = new PublicDelegatedPrefix(); + $region = 'region-934795532'; + $response = $gapicClient->patch($project, $publicDelegatedPrefix, $publicDelegatedPrefixResource, $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 withdrawTest() + { + $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/withdrawTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/withdrawTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $region = 'region-934795532'; + $response = $gapicClient->withdraw($project, $publicDelegatedPrefix, $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.PublicDelegatedPrefixes/Withdraw', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getPublicDelegatedPrefix(); + $this->assertProtobufEquals($publicDelegatedPrefix, $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 withdrawExceptionTest() + { + $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/withdrawExceptionTest'); + $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 + $project = 'project-309310695'; + $publicDelegatedPrefix = 'publicDelegatedPrefix1814851176'; + $region = 'region-934795532'; + $response = $gapicClient->withdraw($project, $publicDelegatedPrefix, $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/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionAutoscalersClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionAutoscalersClientTest.php new file mode 100644 index 000000000000..c45384ecbc63 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionAutoscalersClientTest.php @@ -0,0 +1,708 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionAutoscalersClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionAutoscalersClient($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 + $autoscaler = 'autoscaler517258967'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($autoscaler, $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.RegionAutoscalers/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAutoscaler(); + $this->assertProtobufEquals($autoscaler, $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 + $autoscaler = 'autoscaler517258967'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($autoscaler, $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'; + $recommendedSize = 1889567899; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $target = 'target-880905839'; + $zone = 'zone3744684'; + $expectedResponse = new Autoscaler(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRecommendedSize($recommendedSize); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $expectedResponse->setTarget($target); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $autoscaler = 'autoscaler517258967'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($autoscaler, $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.RegionAutoscalers/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getAutoscaler(); + $this->assertProtobufEquals($autoscaler, $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 + $autoscaler = 'autoscaler517258967'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($autoscaler, $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 + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($autoscalerResource, $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.RegionAutoscalers/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAutoscalerResource(); + $this->assertProtobufEquals($autoscalerResource, $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 + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($autoscalerResource, $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 Autoscaler(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new RegionAutoscalerList(); + $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.RegionAutoscalers/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()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patch($autoscalerResource, $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.RegionAutoscalers/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAutoscalerResource(); + $this->assertProtobufEquals($autoscalerResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patch($autoscalerResource, $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 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 + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->update($autoscalerResource, $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.RegionAutoscalers/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getAutoscalerResource(); + $this->assertProtobufEquals($autoscalerResource, $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 + $autoscalerResource = new Autoscaler(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->update($autoscalerResource, $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/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionBackendServicesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionBackendServicesClientTest.php new file mode 100644 index 000000000000..d8a0bcda80f5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionBackendServicesClientTest.php @@ -0,0 +1,1237 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionBackendServicesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionBackendServicesClient($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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($backendService, $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.RegionBackendServices/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($backendService, $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 + $affinityCookieTtlSec = 1777486694; + $compressionMode = 'compressionMode-2051962660'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $edgeSecurityPolicy = 'edgeSecurityPolicy-1032704881'; + $enableCDN = false; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $loadBalancingScheme = 'loadBalancingScheme1974502980'; + $localityLbPolicy = 'localityLbPolicy-2016052161'; + $name = 'name3373707'; + $network = 'network1843485230'; + $port = 3446913; + $portName = 'portName1115276169'; + $protocol = 'protocol-989163880'; + $region2 = 'region2-690338393'; + $securityPolicy = 'securityPolicy1781695249'; + $selfLink = 'selfLink-1691268851'; + $serviceLbPolicy = 'serviceLbPolicy1168590609'; + $sessionAffinity = 'sessionAffinity1000759473'; + $timeoutSec = 2067488653; + $expectedResponse = new BackendService(); + $expectedResponse->setAffinityCookieTtlSec($affinityCookieTtlSec); + $expectedResponse->setCompressionMode($compressionMode); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEdgeSecurityPolicy($edgeSecurityPolicy); + $expectedResponse->setEnableCDN($enableCDN); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLoadBalancingScheme($loadBalancingScheme); + $expectedResponse->setLocalityLbPolicy($localityLbPolicy); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setPort($port); + $expectedResponse->setPortName($portName); + $expectedResponse->setProtocol($protocol); + $expectedResponse->setRegion($region2); + $expectedResponse->setSecurityPolicy($securityPolicy); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setServiceLbPolicy($serviceLbPolicy); + $expectedResponse->setSessionAffinity($sessionAffinity); + $expectedResponse->setTimeoutSec($timeoutSec); + $transport->addResponse($expectedResponse); + // Mock request + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($backendService, $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.RegionBackendServices/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($backendService, $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 getHealthTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $kind = 'kind3292052'; + $expectedResponse = new BackendServiceGroupHealth(); + $expectedResponse->setKind($kind); + $transport->addResponse($expectedResponse); + // Mock request + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $resourceGroupReferenceResource = new ResourceGroupReference(); + $response = $gapicClient->getHealth($backendService, $project, $region, $resourceGroupReferenceResource); + $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.RegionBackendServices/GetHealth', $actualFuncCall); + $actualValue = $actualRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResourceGroupReferenceResource(); + $this->assertProtobufEquals($resourceGroupReferenceResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getHealthExceptionTest() + { + $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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $resourceGroupReferenceResource = new ResourceGroupReference(); + try { + $gapicClient->getHealth($backendService, $project, $region, $resourceGroupReferenceResource); + // 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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($project, $region, $resource); + $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.RegionBackendServices/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($project, $region, $resource); + // 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 + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($backendServiceResource, $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.RegionBackendServices/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendServiceResource(); + $this->assertProtobufEquals($backendServiceResource, $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 + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($backendServiceResource, $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 BackendService(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new BackendServiceList(); + $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.RegionBackendServices/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()); + } + + /** @test */ + public function listUsableTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new BackendService(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new BackendServiceListUsable(); + $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->listUsable($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.RegionBackendServices/ListUsable', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listUsableExceptionTest() + { + $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->listUsable($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 patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendService = 'backendService306946058'; + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patch($backendService, $backendServiceResource, $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.RegionBackendServices/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualApiRequestObject->getBackendServiceResource(); + $this->assertProtobufEquals($backendServiceResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $backendService = 'backendService306946058'; + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patch($backendService, $backendServiceResource, $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + $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.RegionBackendServices/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRegionSetPolicyRequestResource(); + $this->assertProtobufEquals($regionSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + try { + $gapicClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + // 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 setSecurityPolicyTest() + { + $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/setSecurityPolicyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setSecurityPolicyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $response = $gapicClient->setSecurityPolicy($backendService, $project, $region, $securityPolicyReferenceResource); + $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.RegionBackendServices/SetSecurityPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyReferenceResource(); + $this->assertProtobufEquals($securityPolicyReferenceResource, $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 setSecurityPolicyExceptionTest() + { + $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/setSecurityPolicyExceptionTest'); + $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 + $backendService = 'backendService306946058'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $response = $gapicClient->setSecurityPolicy($backendService, $project, $region, $securityPolicyReferenceResource); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $response = $gapicClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + $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.RegionBackendServices/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + try { + $gapicClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + // 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 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 + $backendService = 'backendService306946058'; + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->update($backendService, $backendServiceResource, $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.RegionBackendServices/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBackendService(); + $this->assertProtobufEquals($backendService, $actualValue); + $actualValue = $actualApiRequestObject->getBackendServiceResource(); + $this->assertProtobufEquals($backendServiceResource, $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 + $backendService = 'backendService306946058'; + $backendServiceResource = new BackendService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->update($backendService, $backendServiceResource, $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/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionCommitmentsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionCommitmentsClientTest.php new file mode 100644 index 000000000000..fe118575dea1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionCommitmentsClientTest.php @@ -0,0 +1,561 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionCommitmentsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionCommitmentsClient($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 CommitmentsScopedList(), + ]; + $expectedResponse = new CommitmentAggregatedList(); + $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.RegionCommitments/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 getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $autoRenew = false; + $category = 'category50511102'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $endTimestamp = 'endTimestamp1004967602'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $plan = 'plan3443497'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $splitSourceCommitment = 'splitSourceCommitment402611156'; + $startTimestamp = 'startTimestamp-1526966919'; + $status = 'status-892481550'; + $statusMessage = 'statusMessage-239442758'; + $type = 'type3575610'; + $expectedResponse = new Commitment(); + $expectedResponse->setAutoRenew($autoRenew); + $expectedResponse->setCategory($category); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEndTimestamp($endTimestamp); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setPlan($plan); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSplitSourceCommitment($splitSourceCommitment); + $expectedResponse->setStartTimestamp($startTimestamp); + $expectedResponse->setStatus($status); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setType($type); + $transport->addResponse($expectedResponse); + // Mock request + $commitment = 'commitment1019005717'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($commitment, $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.RegionCommitments/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getCommitment(); + $this->assertProtobufEquals($commitment, $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 + $commitment = 'commitment1019005717'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($commitment, $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 + $commitmentResource = new Commitment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($commitmentResource, $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.RegionCommitments/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getCommitmentResource(); + $this->assertProtobufEquals($commitmentResource, $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 + $commitmentResource = new Commitment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($commitmentResource, $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 Commitment(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new CommitmentList(); + $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.RegionCommitments/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()); + } + + /** @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 + $commitment = 'commitment1019005717'; + $commitmentResource = new Commitment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->update($commitment, $commitmentResource, $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.RegionCommitments/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getCommitment(); + $this->assertProtobufEquals($commitment, $actualValue); + $actualValue = $actualApiRequestObject->getCommitmentResource(); + $this->assertProtobufEquals($commitmentResource, $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 + $commitment = 'commitment1019005717'; + $commitmentResource = new Commitment(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->update($commitment, $commitmentResource, $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/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionDiskTypesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionDiskTypesClientTest.php new file mode 100644 index 000000000000..a33e0c969885 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionDiskTypesClientTest.php @@ -0,0 +1,226 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionDiskTypesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionDiskTypesClient($options); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $creationTimestamp = 'creationTimestamp567396278'; + $defaultDiskSizeGb = 807490165; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $validDiskSize = 'validDiskSize-1653521184'; + $zone = 'zone3744684'; + $expectedResponse = new DiskType(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDefaultDiskSizeGb($defaultDiskSizeGb); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setValidDiskSize($validDiskSize); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $diskType = 'diskType93009052'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($diskType, $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.RegionDiskTypes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getDiskType(); + $this->assertProtobufEquals($diskType, $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 + $diskType = 'diskType93009052'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($diskType, $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 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 DiskType(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new RegionDiskTypeList(); + $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.RegionDiskTypes/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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionDisksClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionDisksClientTest.php new file mode 100644 index 000000000000..f36d6d156f86 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionDisksClientTest.php @@ -0,0 +1,1966 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionDisksClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionDisksClient($options); + } + + /** @test */ + public function addResourcePoliciesTest() + { + $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/addResourcePoliciesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addResourcePoliciesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionDisksAddResourcePoliciesRequestResource = new RegionDisksAddResourcePoliciesRequest(); + $response = $gapicClient->addResourcePolicies($disk, $project, $region, $regionDisksAddResourcePoliciesRequestResource); + $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/AddResourcePolicies', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionDisksAddResourcePoliciesRequestResource(); + $this->assertProtobufEquals($regionDisksAddResourcePoliciesRequestResource, $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 addResourcePoliciesExceptionTest() + { + $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/addResourcePoliciesExceptionTest'); + $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'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionDisksAddResourcePoliciesRequestResource = new RegionDisksAddResourcePoliciesRequest(); + $response = $gapicClient->addResourcePolicies($disk, $project, $region, $regionDisksAddResourcePoliciesRequestResource); + $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 bulkInsertTest() + { + $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/bulkInsertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/bulkInsertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $bulkInsertDiskResourceResource = new BulkInsertDiskResource(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->bulkInsert($bulkInsertDiskResourceResource, $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/BulkInsert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBulkInsertDiskResourceResource(); + $this->assertProtobufEquals($bulkInsertDiskResourceResource, $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 bulkInsertExceptionTest() + { + $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/bulkInsertExceptionTest'); + $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 + $bulkInsertDiskResourceResource = new BulkInsertDiskResource(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->bulkInsert($bulkInsertDiskResourceResource, $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 createSnapshotTest() + { + $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/createSnapshotTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/createSnapshotTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $snapshotResource = new Snapshot(); + $response = $gapicClient->createSnapshot($disk, $project, $region, $snapshotResource); + $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/CreateSnapshot', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSnapshotResource(); + $this->assertProtobufEquals($snapshotResource, $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 createSnapshotExceptionTest() + { + $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/createSnapshotExceptionTest'); + $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'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $snapshotResource = new Snapshot(); + $response = $gapicClient->createSnapshot($disk, $project, $region, $snapshotResource); + $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 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 + $disk = 'disk3083677'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($disk, $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/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $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 + $disk = 'disk3083677'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($disk, $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 + $architecture = 'architecture839674195'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $enableConfidentialCompute = true; + $id = 3355; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $lastAttachTimestamp = 'lastAttachTimestamp-2105323995'; + $lastDetachTimestamp = 'lastDetachTimestamp-480399885'; + $locationHint = 'locationHint-1796964143'; + $name = 'name3373707'; + $options = 'options-1249474914'; + $physicalBlockSizeBytes = 1190604793; + $provisionedIops = 1260510932; + $provisionedThroughput = 1600266005; + $region2 = 'region2-690338393'; + $satisfiesPzi = false; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $sizeGb = 2105542105; + $sourceConsistencyGroupPolicy = 'sourceConsistencyGroupPolicy19616093'; + $sourceConsistencyGroupPolicyId = 'sourceConsistencyGroupPolicyId267568957'; + $sourceDisk = 'sourceDisk-85117119'; + $sourceDiskId = 'sourceDiskId-1693292839'; + $sourceImage = 'sourceImage1661056055'; + $sourceImageId = 'sourceImageId-2092155357'; + $sourceInstantSnapshot = 'sourceInstantSnapshot-317668858'; + $sourceInstantSnapshotId = 'sourceInstantSnapshotId-1859900940'; + $sourceSnapshot = 'sourceSnapshot-947679896'; + $sourceSnapshotId = 'sourceSnapshotId-1511650478'; + $sourceStorageObject = 'sourceStorageObject-303818201'; + $status = 'status-892481550'; + $storagePool = 'storagePool897344352'; + $type = 'type3575610'; + $zone = 'zone3744684'; + $expectedResponse = new Disk(); + $expectedResponse->setArchitecture($architecture); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEnableConfidentialCompute($enableConfidentialCompute); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setLastAttachTimestamp($lastAttachTimestamp); + $expectedResponse->setLastDetachTimestamp($lastDetachTimestamp); + $expectedResponse->setLocationHint($locationHint); + $expectedResponse->setName($name); + $expectedResponse->setOptions($options); + $expectedResponse->setPhysicalBlockSizeBytes($physicalBlockSizeBytes); + $expectedResponse->setProvisionedIops($provisionedIops); + $expectedResponse->setProvisionedThroughput($provisionedThroughput); + $expectedResponse->setRegion($region2); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSizeGb($sizeGb); + $expectedResponse->setSourceConsistencyGroupPolicy($sourceConsistencyGroupPolicy); + $expectedResponse->setSourceConsistencyGroupPolicyId($sourceConsistencyGroupPolicyId); + $expectedResponse->setSourceDisk($sourceDisk); + $expectedResponse->setSourceDiskId($sourceDiskId); + $expectedResponse->setSourceImage($sourceImage); + $expectedResponse->setSourceImageId($sourceImageId); + $expectedResponse->setSourceInstantSnapshot($sourceInstantSnapshot); + $expectedResponse->setSourceInstantSnapshotId($sourceInstantSnapshotId); + $expectedResponse->setSourceSnapshot($sourceSnapshot); + $expectedResponse->setSourceSnapshotId($sourceSnapshotId); + $expectedResponse->setSourceStorageObject($sourceStorageObject); + $expectedResponse->setStatus($status); + $expectedResponse->setStoragePool($storagePool); + $expectedResponse->setType($type); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($disk, $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.RegionDisks/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $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 + $disk = 'disk3083677'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($disk, $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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($project, $region, $resource); + $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.RegionDisks/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($project, $region, $resource); + // 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 + $diskResource = new Disk(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($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/Insert', $actualApiFuncCall); + $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 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 + $diskResource = new Disk(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($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()); + } + + /** @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 Disk(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new DiskList(); + $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.RegionDisks/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()); + } + + /** @test */ + public function removeResourcePoliciesTest() + { + $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/removeResourcePoliciesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeResourcePoliciesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionDisksRemoveResourcePoliciesRequestResource = new RegionDisksRemoveResourcePoliciesRequest(); + $response = $gapicClient->removeResourcePolicies($disk, $project, $region, $regionDisksRemoveResourcePoliciesRequestResource); + $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/RemoveResourcePolicies', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionDisksRemoveResourcePoliciesRequestResource(); + $this->assertProtobufEquals($regionDisksRemoveResourcePoliciesRequestResource, $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 removeResourcePoliciesExceptionTest() + { + $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/removeResourcePoliciesExceptionTest'); + $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'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionDisksRemoveResourcePoliciesRequestResource = new RegionDisksRemoveResourcePoliciesRequest(); + $response = $gapicClient->removeResourcePolicies($disk, $project, $region, $regionDisksRemoveResourcePoliciesRequestResource); + $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 resizeTest() + { + $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/resizeTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/resizeTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionDisksResizeRequestResource = new RegionDisksResizeRequest(); + $response = $gapicClient->resize($disk, $project, $region, $regionDisksResizeRequestResource); + $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/Resize', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionDisksResizeRequestResource(); + $this->assertProtobufEquals($regionDisksResizeRequestResource, $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 resizeExceptionTest() + { + $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/resizeExceptionTest'); + $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'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionDisksResizeRequestResource = new RegionDisksResizeRequest(); + $response = $gapicClient->resize($disk, $project, $region, $regionDisksResizeRequestResource); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + $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.RegionDisks/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRegionSetPolicyRequestResource(); + $this->assertProtobufEquals($regionSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + try { + $gapicClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + // 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 setLabelsTest() + { + $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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + $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/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionSetLabelsRequestResource(); + $this->assertProtobufEquals($regionSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $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 setLabelsExceptionTest() + { + $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/setLabelsExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + $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 startAsyncReplicationTest() + { + $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/startAsyncReplicationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/startAsyncReplicationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionDisksStartAsyncReplicationRequestResource = new RegionDisksStartAsyncReplicationRequest(); + $response = $gapicClient->startAsyncReplication($disk, $project, $region, $regionDisksStartAsyncReplicationRequestResource); + $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/StartAsyncReplication', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionDisksStartAsyncReplicationRequestResource(); + $this->assertProtobufEquals($regionDisksStartAsyncReplicationRequestResource, $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 startAsyncReplicationExceptionTest() + { + $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/startAsyncReplicationExceptionTest'); + $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'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionDisksStartAsyncReplicationRequestResource = new RegionDisksStartAsyncReplicationRequest(); + $response = $gapicClient->startAsyncReplication($disk, $project, $region, $regionDisksStartAsyncReplicationRequestResource); + $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 stopAsyncReplicationTest() + { + $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/stopAsyncReplicationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/stopAsyncReplicationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disk = 'disk3083677'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->stopAsyncReplication($disk, $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/StopAsyncReplication', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisk(); + $this->assertProtobufEquals($disk, $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 stopAsyncReplicationExceptionTest() + { + $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/stopAsyncReplicationExceptionTest'); + $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'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->stopAsyncReplication($disk, $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 stopGroupAsyncReplicationTest() + { + $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/stopGroupAsyncReplicationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/stopGroupAsyncReplicationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $disksStopGroupAsyncReplicationResourceResource = new DisksStopGroupAsyncReplicationResource(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->stopGroupAsyncReplication($disksStopGroupAsyncReplicationResourceResource, $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/StopGroupAsyncReplication', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDisksStopGroupAsyncReplicationResourceResource(); + $this->assertProtobufEquals($disksStopGroupAsyncReplicationResourceResource, $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 stopGroupAsyncReplicationExceptionTest() + { + $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/stopGroupAsyncReplicationExceptionTest'); + $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 + $disksStopGroupAsyncReplicationResourceResource = new DisksStopGroupAsyncReplicationResource(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->stopGroupAsyncReplication($disksStopGroupAsyncReplicationResourceResource, $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $response = $gapicClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + $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.RegionDisks/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + try { + $gapicClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + // 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 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/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionHealthCheckServicesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionHealthCheckServicesClientTest.php new file mode 100644 index 000000000000..1ffbadf99eac --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionHealthCheckServicesClientTest.php @@ -0,0 +1,589 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionHealthCheckServicesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionHealthCheckServicesClient($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 + $healthCheckService = 'healthCheckService-665367077'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($healthCheckService, $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.RegionHealthCheckServices/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheckService(); + $this->assertProtobufEquals($healthCheckService, $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 + $healthCheckService = 'healthCheckService-665367077'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($healthCheckService, $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'; + $fingerprint = 'fingerprint-1375934236'; + $healthStatusAggregationPolicy = 'healthStatusAggregationPolicy-820578695'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new HealthCheckService(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setHealthStatusAggregationPolicy($healthStatusAggregationPolicy); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $healthCheckService = 'healthCheckService-665367077'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($healthCheckService, $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.RegionHealthCheckServices/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getHealthCheckService(); + $this->assertProtobufEquals($healthCheckService, $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 + $healthCheckService = 'healthCheckService-665367077'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($healthCheckService, $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 + $healthCheckServiceResource = new HealthCheckService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($healthCheckServiceResource, $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.RegionHealthCheckServices/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheckServiceResource(); + $this->assertProtobufEquals($healthCheckServiceResource, $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 + $healthCheckServiceResource = new HealthCheckService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($healthCheckServiceResource, $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 HealthCheckService(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new HealthCheckServicesList(); + $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.RegionHealthCheckServices/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()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $healthCheckService = 'healthCheckService-665367077'; + $healthCheckServiceResource = new HealthCheckService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patch($healthCheckService, $healthCheckServiceResource, $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.RegionHealthCheckServices/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheckService(); + $this->assertProtobufEquals($healthCheckService, $actualValue); + $actualValue = $actualApiRequestObject->getHealthCheckServiceResource(); + $this->assertProtobufEquals($healthCheckServiceResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $healthCheckService = 'healthCheckService-665367077'; + $healthCheckServiceResource = new HealthCheckService(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patch($healthCheckService, $healthCheckServiceResource, $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/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionHealthChecksClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionHealthChecksClientTest.php new file mode 100644 index 000000000000..e68a1376ac68 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionHealthChecksClientTest.php @@ -0,0 +1,718 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionHealthChecksClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionHealthChecksClient($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 + $healthCheck = 'healthCheck845747557'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($healthCheck, $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.RegionHealthChecks/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheck(); + $this->assertProtobufEquals($healthCheck, $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 + $healthCheck = 'healthCheck845747557'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($healthCheck, $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 + $checkIntervalSec = 345561006; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $healthyThreshold = 133658551; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $timeoutSec = 2067488653; + $type = 'type3575610'; + $unhealthyThreshold = 1838571216; + $expectedResponse = new HealthCheck(); + $expectedResponse->setCheckIntervalSec($checkIntervalSec); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setHealthyThreshold($healthyThreshold); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setTimeoutSec($timeoutSec); + $expectedResponse->setType($type); + $expectedResponse->setUnhealthyThreshold($unhealthyThreshold); + $transport->addResponse($expectedResponse); + // Mock request + $healthCheck = 'healthCheck845747557'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($healthCheck, $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.RegionHealthChecks/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getHealthCheck(); + $this->assertProtobufEquals($healthCheck, $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 + $healthCheck = 'healthCheck845747557'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($healthCheck, $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 + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($healthCheckResource, $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.RegionHealthChecks/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheckResource(); + $this->assertProtobufEquals($healthCheckResource, $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 + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($healthCheckResource, $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 HealthCheck(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new HealthCheckList(); + $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.RegionHealthChecks/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()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $healthCheck = 'healthCheck845747557'; + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patch($healthCheck, $healthCheckResource, $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.RegionHealthChecks/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheck(); + $this->assertProtobufEquals($healthCheck, $actualValue); + $actualValue = $actualApiRequestObject->getHealthCheckResource(); + $this->assertProtobufEquals($healthCheckResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $healthCheck = 'healthCheck845747557'; + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patch($healthCheck, $healthCheckResource, $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 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 + $healthCheck = 'healthCheck845747557'; + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->update($healthCheck, $healthCheckResource, $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.RegionHealthChecks/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getHealthCheck(); + $this->assertProtobufEquals($healthCheck, $actualValue); + $actualValue = $actualApiRequestObject->getHealthCheckResource(); + $this->assertProtobufEquals($healthCheckResource, $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 + $healthCheck = 'healthCheck845747557'; + $healthCheckResource = new HealthCheck(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->update($healthCheck, $healthCheckResource, $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/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionInstanceGroupManagersClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionInstanceGroupManagersClientTest.php new file mode 100644 index 000000000000..936ad892be72 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionInstanceGroupManagersClientTest.php @@ -0,0 +1,2196 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionInstanceGroupManagersClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionInstanceGroupManagersClient($options); + } + + /** @test */ + public function abandonInstancesTest() + { + $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/abandonInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/abandonInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersAbandonInstancesRequestResource = new RegionInstanceGroupManagersAbandonInstancesRequest(); + $response = $gapicClient->abandonInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersAbandonInstancesRequestResource); + $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.RegionInstanceGroupManagers/AbandonInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersAbandonInstancesRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersAbandonInstancesRequestResource, $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 abandonInstancesExceptionTest() + { + $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/abandonInstancesExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersAbandonInstancesRequestResource = new RegionInstanceGroupManagersAbandonInstancesRequest(); + $response = $gapicClient->abandonInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersAbandonInstancesRequestResource); + $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 applyUpdatesToInstancesTest() + { + $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/applyUpdatesToInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/applyUpdatesToInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersApplyUpdatesRequestResource = new RegionInstanceGroupManagersApplyUpdatesRequest(); + $response = $gapicClient->applyUpdatesToInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersApplyUpdatesRequestResource); + $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.RegionInstanceGroupManagers/ApplyUpdatesToInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersApplyUpdatesRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersApplyUpdatesRequestResource, $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 applyUpdatesToInstancesExceptionTest() + { + $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/applyUpdatesToInstancesExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersApplyUpdatesRequestResource = new RegionInstanceGroupManagersApplyUpdatesRequest(); + $response = $gapicClient->applyUpdatesToInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersApplyUpdatesRequestResource); + $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 createInstancesTest() + { + $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/createInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/createInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersCreateInstancesRequestResource = new RegionInstanceGroupManagersCreateInstancesRequest(); + $response = $gapicClient->createInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersCreateInstancesRequestResource); + $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.RegionInstanceGroupManagers/CreateInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersCreateInstancesRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersCreateInstancesRequestResource, $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 createInstancesExceptionTest() + { + $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/createInstancesExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersCreateInstancesRequestResource = new RegionInstanceGroupManagersCreateInstancesRequest(); + $response = $gapicClient->createInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersCreateInstancesRequestResource); + $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 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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($instanceGroupManager, $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.RegionInstanceGroupManagers/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($instanceGroupManager, $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 deleteInstancesTest() + { + $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/deleteInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersDeleteInstancesRequestResource = new RegionInstanceGroupManagersDeleteInstancesRequest(); + $response = $gapicClient->deleteInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersDeleteInstancesRequestResource); + $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.RegionInstanceGroupManagers/DeleteInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersDeleteInstancesRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersDeleteInstancesRequestResource, $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 deleteInstancesExceptionTest() + { + $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/deleteInstancesExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersDeleteInstancesRequestResource = new RegionInstanceGroupManagersDeleteInstancesRequest(); + $response = $gapicClient->deleteInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersDeleteInstancesRequestResource); + $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 deletePerInstanceConfigsTest() + { + $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/deletePerInstanceConfigsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deletePerInstanceConfigsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagerDeleteInstanceConfigReqResource = new RegionInstanceGroupManagerDeleteInstanceConfigReq(); + $response = $gapicClient->deletePerInstanceConfigs($instanceGroupManager, $project, $region, $regionInstanceGroupManagerDeleteInstanceConfigReqResource); + $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.RegionInstanceGroupManagers/DeletePerInstanceConfigs', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagerDeleteInstanceConfigReqResource(); + $this->assertProtobufEquals($regionInstanceGroupManagerDeleteInstanceConfigReqResource, $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 deletePerInstanceConfigsExceptionTest() + { + $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/deletePerInstanceConfigsExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagerDeleteInstanceConfigReqResource = new RegionInstanceGroupManagerDeleteInstanceConfigReq(); + $response = $gapicClient->deletePerInstanceConfigs($instanceGroupManager, $project, $region, $regionInstanceGroupManagerDeleteInstanceConfigReqResource); + $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 + $baseInstanceName = 'baseInstanceName389106439'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $instanceGroup = 'instanceGroup81095253'; + $instanceTemplate = 'instanceTemplate309248228'; + $kind = 'kind3292052'; + $listManagedInstancesResults = 'listManagedInstancesResults832918068'; + $name = 'name3373707'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $targetSize = 2084603409; + $zone = 'zone3744684'; + $expectedResponse = new InstanceGroupManager(); + $expectedResponse->setBaseInstanceName($baseInstanceName); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setInstanceGroup($instanceGroup); + $expectedResponse->setInstanceTemplate($instanceTemplate); + $expectedResponse->setKind($kind); + $expectedResponse->setListManagedInstancesResults($listManagedInstancesResults); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setTargetSize($targetSize); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($instanceGroupManager, $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.RegionInstanceGroupManagers/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($instanceGroupManager, $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 + $instanceGroupManagerResource = new InstanceGroupManager(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($instanceGroupManagerResource, $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.RegionInstanceGroupManagers/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManagerResource(); + $this->assertProtobufEquals($instanceGroupManagerResource, $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 + $instanceGroupManagerResource = new InstanceGroupManager(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($instanceGroupManagerResource, $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 InstanceGroupManager(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new RegionInstanceGroupManagerList(); + $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.RegionInstanceGroupManagers/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()); + } + + /** @test */ + public function listErrorsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $itemsElement = new InstanceManagedByIgmError(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new RegionInstanceGroupManagersListErrorsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->listErrors($instanceGroupManager, $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.RegionInstanceGroupManagers/ListErrors', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listErrorsExceptionTest() + { + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->listErrors($instanceGroupManager, $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 listManagedInstancesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $managedInstancesElement = new ManagedInstance(); + $managedInstances = [ + $managedInstancesElement, + ]; + $expectedResponse = new RegionInstanceGroupManagersListInstancesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setManagedInstances($managedInstances); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->listManagedInstances($instanceGroupManager, $project, $region); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getManagedInstances()[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.RegionInstanceGroupManagers/ListManagedInstances', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listManagedInstancesExceptionTest() + { + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->listManagedInstances($instanceGroupManager, $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 listPerInstanceConfigsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $itemsElement = new PerInstanceConfig(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new RegionInstanceGroupManagersListInstanceConfigsResp(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->listPerInstanceConfigs($instanceGroupManager, $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.RegionInstanceGroupManagers/ListPerInstanceConfigs', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listPerInstanceConfigsExceptionTest() + { + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->listPerInstanceConfigs($instanceGroupManager, $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 patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagerResource = new InstanceGroupManager(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patch($instanceGroupManager, $instanceGroupManagerResource, $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.RegionInstanceGroupManagers/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagerResource(); + $this->assertProtobufEquals($instanceGroupManagerResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagerResource = new InstanceGroupManager(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patch($instanceGroupManager, $instanceGroupManagerResource, $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 patchPerInstanceConfigsTest() + { + $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/patchPerInstanceConfigsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchPerInstanceConfigsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagerPatchInstanceConfigReqResource = new RegionInstanceGroupManagerPatchInstanceConfigReq(); + $response = $gapicClient->patchPerInstanceConfigs($instanceGroupManager, $project, $region, $regionInstanceGroupManagerPatchInstanceConfigReqResource); + $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.RegionInstanceGroupManagers/PatchPerInstanceConfigs', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagerPatchInstanceConfigReqResource(); + $this->assertProtobufEquals($regionInstanceGroupManagerPatchInstanceConfigReqResource, $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 patchPerInstanceConfigsExceptionTest() + { + $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/patchPerInstanceConfigsExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagerPatchInstanceConfigReqResource = new RegionInstanceGroupManagerPatchInstanceConfigReq(); + $response = $gapicClient->patchPerInstanceConfigs($instanceGroupManager, $project, $region, $regionInstanceGroupManagerPatchInstanceConfigReqResource); + $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 recreateInstancesTest() + { + $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/recreateInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/recreateInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersRecreateRequestResource = new RegionInstanceGroupManagersRecreateRequest(); + $response = $gapicClient->recreateInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersRecreateRequestResource); + $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.RegionInstanceGroupManagers/RecreateInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersRecreateRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersRecreateRequestResource, $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 recreateInstancesExceptionTest() + { + $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/recreateInstancesExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersRecreateRequestResource = new RegionInstanceGroupManagersRecreateRequest(); + $response = $gapicClient->recreateInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersRecreateRequestResource); + $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 resizeTest() + { + $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/resizeTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/resizeTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $size = 3530753; + $response = $gapicClient->resize($instanceGroupManager, $project, $region, $size); + $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.RegionInstanceGroupManagers/Resize', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSize(); + $this->assertProtobufEquals($size, $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 resizeExceptionTest() + { + $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/resizeExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $size = 3530753; + $response = $gapicClient->resize($instanceGroupManager, $project, $region, $size); + $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 setInstanceTemplateTest() + { + $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/setInstanceTemplateTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setInstanceTemplateTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersSetTemplateRequestResource = new RegionInstanceGroupManagersSetTemplateRequest(); + $response = $gapicClient->setInstanceTemplate($instanceGroupManager, $project, $region, $regionInstanceGroupManagersSetTemplateRequestResource); + $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.RegionInstanceGroupManagers/SetInstanceTemplate', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersSetTemplateRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersSetTemplateRequestResource, $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 setInstanceTemplateExceptionTest() + { + $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/setInstanceTemplateExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersSetTemplateRequestResource = new RegionInstanceGroupManagersSetTemplateRequest(); + $response = $gapicClient->setInstanceTemplate($instanceGroupManager, $project, $region, $regionInstanceGroupManagersSetTemplateRequestResource); + $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 setTargetPoolsTest() + { + $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/setTargetPoolsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setTargetPoolsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersSetTargetPoolsRequestResource = new RegionInstanceGroupManagersSetTargetPoolsRequest(); + $response = $gapicClient->setTargetPools($instanceGroupManager, $project, $region, $regionInstanceGroupManagersSetTargetPoolsRequestResource); + $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.RegionInstanceGroupManagers/SetTargetPools', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersSetTargetPoolsRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersSetTargetPoolsRequestResource, $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 setTargetPoolsExceptionTest() + { + $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/setTargetPoolsExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersSetTargetPoolsRequestResource = new RegionInstanceGroupManagersSetTargetPoolsRequest(); + $response = $gapicClient->setTargetPools($instanceGroupManager, $project, $region, $regionInstanceGroupManagersSetTargetPoolsRequestResource); + $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 updatePerInstanceConfigsTest() + { + $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/updatePerInstanceConfigsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/updatePerInstanceConfigsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagerUpdateInstanceConfigReqResource = new RegionInstanceGroupManagerUpdateInstanceConfigReq(); + $response = $gapicClient->updatePerInstanceConfigs($instanceGroupManager, $project, $region, $regionInstanceGroupManagerUpdateInstanceConfigReqResource); + $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.RegionInstanceGroupManagers/UpdatePerInstanceConfigs', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagerUpdateInstanceConfigReqResource(); + $this->assertProtobufEquals($regionInstanceGroupManagerUpdateInstanceConfigReqResource, $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 updatePerInstanceConfigsExceptionTest() + { + $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/updatePerInstanceConfigsExceptionTest'); + $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 + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagerUpdateInstanceConfigReqResource = new RegionInstanceGroupManagerUpdateInstanceConfigReq(); + $response = $gapicClient->updatePerInstanceConfigs($instanceGroupManager, $project, $region, $regionInstanceGroupManagerUpdateInstanceConfigReqResource); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionInstanceGroupsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionInstanceGroupsClientTest.php new file mode 100644 index 000000000000..e46672731e89 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionInstanceGroupsClientTest.php @@ -0,0 +1,447 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionInstanceGroupsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionInstanceGroupsClient($options); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $network = 'network1843485230'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $size = 3530753; + $subnetwork = 'subnetwork-1302785042'; + $zone = 'zone3744684'; + $expectedResponse = new InstanceGroup(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSize($size); + $expectedResponse->setSubnetwork($subnetwork); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroup = 'instanceGroup81095253'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($instanceGroup, $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.RegionInstanceGroups/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroup(); + $this->assertProtobufEquals($instanceGroup, $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 + $instanceGroup = 'instanceGroup81095253'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($instanceGroup, $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 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 InstanceGroup(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new RegionInstanceGroupList(); + $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.RegionInstanceGroups/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()); + } + + /** @test */ + public function listInstancesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new InstanceWithNamedPorts(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new RegionInstanceGroupsListInstances(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $instanceGroup = 'instanceGroup81095253'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupsListInstancesRequestResource = new RegionInstanceGroupsListInstancesRequest(); + $response = $gapicClient->listInstances($instanceGroup, $project, $region, $regionInstanceGroupsListInstancesRequestResource); + $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.RegionInstanceGroups/ListInstances', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceGroup(); + $this->assertProtobufEquals($instanceGroup, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRegionInstanceGroupsListInstancesRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupsListInstancesRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listInstancesExceptionTest() + { + $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 + $instanceGroup = 'instanceGroup81095253'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupsListInstancesRequestResource = new RegionInstanceGroupsListInstancesRequest(); + try { + $gapicClient->listInstances($instanceGroup, $project, $region, $regionInstanceGroupsListInstancesRequestResource); + // 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 setNamedPortsTest() + { + $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/setNamedPortsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setNamedPortsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroup = 'instanceGroup81095253'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupsSetNamedPortsRequestResource = new RegionInstanceGroupsSetNamedPortsRequest(); + $response = $gapicClient->setNamedPorts($instanceGroup, $project, $region, $regionInstanceGroupsSetNamedPortsRequestResource); + $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.RegionInstanceGroups/SetNamedPorts', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroup(); + $this->assertProtobufEquals($instanceGroup, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupsSetNamedPortsRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupsSetNamedPortsRequestResource, $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 setNamedPortsExceptionTest() + { + $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/setNamedPortsExceptionTest'); + $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 + $instanceGroup = 'instanceGroup81095253'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupsSetNamedPortsRequestResource = new RegionInstanceGroupsSetNamedPortsRequest(); + $response = $gapicClient->setNamedPorts($instanceGroup, $project, $region, $regionInstanceGroupsSetNamedPortsRequestResource); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionInstanceTemplatesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionInstanceTemplatesClientTest.php new file mode 100644 index 000000000000..d36df6fbf738 --- /dev/null +++ b/owl-bot-staging/Compute/V1/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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionInstancesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionInstancesClientTest.php new file mode 100644 index 000000000000..073699ac6d60 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionInstancesClientTest.php @@ -0,0 +1,184 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionInstancesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionInstancesClient($options); + } + + /** @test */ + public function bulkInsertTest() + { + $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/bulkInsertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/bulkInsertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $bulkInsertInstanceResourceResource = new BulkInsertInstanceResource(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->bulkInsert($bulkInsertInstanceResourceResource, $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.RegionInstances/BulkInsert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getBulkInsertInstanceResourceResource(); + $this->assertProtobufEquals($bulkInsertInstanceResourceResource, $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 bulkInsertExceptionTest() + { + $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/bulkInsertExceptionTest'); + $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 + $bulkInsertInstanceResourceResource = new BulkInsertInstanceResource(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->bulkInsert($bulkInsertInstanceResourceResource, $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/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionInstantSnapshotsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionInstantSnapshotsClientTest.php new file mode 100644 index 000000000000..27ad19ee65e8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionInstantSnapshotsClientTest.php @@ -0,0 +1,828 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionInstantSnapshotsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionInstantSnapshotsClient($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 + $instantSnapshot = 'instantSnapshot1465380450'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($instantSnapshot, $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.RegionInstantSnapshots/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstantSnapshot(); + $this->assertProtobufEquals($instantSnapshot, $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 + $instantSnapshot = 'instantSnapshot1465380450'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($instantSnapshot, $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 + $architecture = 'architecture839674195'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $diskSizeGb = 757478089; + $id = 3355; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $region2 = 'region2-690338393'; + $satisfiesPzi = false; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $sourceDisk = 'sourceDisk-85117119'; + $sourceDiskId = 'sourceDiskId-1693292839'; + $status = 'status-892481550'; + $zone = 'zone3744684'; + $expectedResponse = new InstantSnapshot(); + $expectedResponse->setArchitecture($architecture); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDiskSizeGb($diskSizeGb); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $expectedResponse->setSourceDisk($sourceDisk); + $expectedResponse->setSourceDiskId($sourceDiskId); + $expectedResponse->setStatus($status); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $instantSnapshot = 'instantSnapshot1465380450'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($instantSnapshot, $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.RegionInstantSnapshots/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getInstantSnapshot(); + $this->assertProtobufEquals($instantSnapshot, $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 + $instantSnapshot = 'instantSnapshot1465380450'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($instantSnapshot, $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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($project, $region, $resource); + $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.RegionInstantSnapshots/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($project, $region, $resource); + // 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 + $instantSnapshotResource = new InstantSnapshot(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($instantSnapshotResource, $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.RegionInstantSnapshots/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstantSnapshotResource(); + $this->assertProtobufEquals($instantSnapshotResource, $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 + $instantSnapshotResource = new InstantSnapshot(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($instantSnapshotResource, $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 InstantSnapshot(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new InstantSnapshotList(); + $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.RegionInstantSnapshots/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()); + } + + /** @test */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + $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.RegionInstantSnapshots/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRegionSetPolicyRequestResource(); + $this->assertProtobufEquals($regionSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + try { + $gapicClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + // 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 setLabelsTest() + { + $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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + $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.RegionInstantSnapshots/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionSetLabelsRequestResource(); + $this->assertProtobufEquals($regionSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $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 setLabelsExceptionTest() + { + $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/setLabelsExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $response = $gapicClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + $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.RegionInstantSnapshots/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + try { + $gapicClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionNetworkEndpointGroupsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionNetworkEndpointGroupsClientTest.php new file mode 100644 index 000000000000..08c5404b9f10 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionNetworkEndpointGroupsClientTest.php @@ -0,0 +1,806 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionNetworkEndpointGroupsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionNetworkEndpointGroupsClient($options); + } + + /** @test */ + public function attachNetworkEndpointsTest() + { + $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/attachNetworkEndpointsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/attachNetworkEndpointsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionNetworkEndpointGroupsAttachEndpointsRequestResource = new RegionNetworkEndpointGroupsAttachEndpointsRequest(); + $response = $gapicClient->attachNetworkEndpoints($networkEndpointGroup, $project, $region, $regionNetworkEndpointGroupsAttachEndpointsRequestResource); + $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.RegionNetworkEndpointGroups/AttachNetworkEndpoints', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionNetworkEndpointGroupsAttachEndpointsRequestResource(); + $this->assertProtobufEquals($regionNetworkEndpointGroupsAttachEndpointsRequestResource, $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 attachNetworkEndpointsExceptionTest() + { + $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/attachNetworkEndpointsExceptionTest'); + $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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionNetworkEndpointGroupsAttachEndpointsRequestResource = new RegionNetworkEndpointGroupsAttachEndpointsRequest(); + $response = $gapicClient->attachNetworkEndpoints($networkEndpointGroup, $project, $region, $regionNetworkEndpointGroupsAttachEndpointsRequestResource); + $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 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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($networkEndpointGroup, $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.RegionNetworkEndpointGroups/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($networkEndpointGroup, $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 detachNetworkEndpointsTest() + { + $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/detachNetworkEndpointsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/detachNetworkEndpointsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionNetworkEndpointGroupsDetachEndpointsRequestResource = new RegionNetworkEndpointGroupsDetachEndpointsRequest(); + $response = $gapicClient->detachNetworkEndpoints($networkEndpointGroup, $project, $region, $regionNetworkEndpointGroupsDetachEndpointsRequestResource); + $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.RegionNetworkEndpointGroups/DetachNetworkEndpoints', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionNetworkEndpointGroupsDetachEndpointsRequestResource(); + $this->assertProtobufEquals($regionNetworkEndpointGroupsDetachEndpointsRequestResource, $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 detachNetworkEndpointsExceptionTest() + { + $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/detachNetworkEndpointsExceptionTest'); + $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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionNetworkEndpointGroupsDetachEndpointsRequestResource = new RegionNetworkEndpointGroupsDetachEndpointsRequest(); + $response = $gapicClient->detachNetworkEndpoints($networkEndpointGroup, $project, $region, $regionNetworkEndpointGroupsDetachEndpointsRequestResource); + $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'; + $defaultPort = 650363969; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $network = 'network1843485230'; + $networkEndpointType = 'networkEndpointType118301523'; + $pscTargetService = 'pscTargetService1879744870'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $size = 3530753; + $subnetwork = 'subnetwork-1302785042'; + $zone = 'zone3744684'; + $expectedResponse = new NetworkEndpointGroup(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDefaultPort($defaultPort); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setNetworkEndpointType($networkEndpointType); + $expectedResponse->setPscTargetService($pscTargetService); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSize($size); + $expectedResponse->setSubnetwork($subnetwork); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($networkEndpointGroup, $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.RegionNetworkEndpointGroups/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($networkEndpointGroup, $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 + $networkEndpointGroupResource = new NetworkEndpointGroup(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($networkEndpointGroupResource, $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.RegionNetworkEndpointGroups/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNetworkEndpointGroupResource(); + $this->assertProtobufEquals($networkEndpointGroupResource, $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 + $networkEndpointGroupResource = new NetworkEndpointGroup(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($networkEndpointGroupResource, $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 NetworkEndpointGroup(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NetworkEndpointGroupList(); + $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.RegionNetworkEndpointGroups/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()); + } + + /** @test */ + public function listNetworkEndpointsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $itemsElement = new NetworkEndpointWithHealthStatus(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NetworkEndpointGroupsListNetworkEndpoints(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->listNetworkEndpoints($networkEndpointGroup, $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.RegionNetworkEndpointGroups/ListNetworkEndpoints', $actualFuncCall); + $actualValue = $actualRequestObject->getNetworkEndpointGroup(); + $this->assertProtobufEquals($networkEndpointGroup, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listNetworkEndpointsExceptionTest() + { + $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 + $networkEndpointGroup = 'networkEndpointGroup-639834746'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->listNetworkEndpoints($networkEndpointGroup, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionNetworkFirewallPoliciesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionNetworkFirewallPoliciesClientTest.php new file mode 100644 index 000000000000..f1bb09d89651 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionNetworkFirewallPoliciesClientTest.php @@ -0,0 +1,1776 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionNetworkFirewallPoliciesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionNetworkFirewallPoliciesClient($options); + } + + /** @test */ + public function addAssociationTest() + { + $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/addAssociationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addAssociationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyAssociationResource = new FirewallPolicyAssociation(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->addAssociation($firewallPolicy, $firewallPolicyAssociationResource, $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.RegionNetworkFirewallPolicies/AddAssociation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyAssociationResource(); + $this->assertProtobufEquals($firewallPolicyAssociationResource, $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 addAssociationExceptionTest() + { + $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/addAssociationExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyAssociationResource = new FirewallPolicyAssociation(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->addAssociation($firewallPolicy, $firewallPolicyAssociationResource, $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 addRuleTest() + { + $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/addRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->addRule($firewallPolicy, $firewallPolicyRuleResource, $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.RegionNetworkFirewallPolicies/AddRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyRuleResource(); + $this->assertProtobufEquals($firewallPolicyRuleResource, $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 addRuleExceptionTest() + { + $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/addRuleExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->addRule($firewallPolicy, $firewallPolicyRuleResource, $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 cloneRulesTest() + { + $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/cloneRulesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/cloneRulesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->cloneRules($firewallPolicy, $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.RegionNetworkFirewallPolicies/CloneRules', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $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 cloneRulesExceptionTest() + { + $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/cloneRulesExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->cloneRules($firewallPolicy, $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 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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($firewallPolicy, $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.RegionNetworkFirewallPolicies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($firewallPolicy, $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'; + $displayName = 'displayName1615086568'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $parent = 'parent-995424086'; + $region2 = 'region2-690338393'; + $ruleTupleCount = 388342037; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $shortName = 'shortName1565793390'; + $expectedResponse = new FirewallPolicy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setParent($parent); + $expectedResponse->setRegion($region2); + $expectedResponse->setRuleTupleCount($ruleTupleCount); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $expectedResponse->setShortName($shortName); + $transport->addResponse($expectedResponse); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($firewallPolicy, $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.RegionNetworkFirewallPolicies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($firewallPolicy, $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 getAssociationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $attachmentTarget = 'attachmentTarget1786386477'; + $displayName = 'displayName1615086568'; + $firewallPolicyId = 'firewallPolicyId1430953673'; + $name2 = 'name2-1052831874'; + $shortName = 'shortName1565793390'; + $expectedResponse = new FirewallPolicyAssociation(); + $expectedResponse->setAttachmentTarget($attachmentTarget); + $expectedResponse->setDisplayName($displayName); + $expectedResponse->setFirewallPolicyId($firewallPolicyId); + $expectedResponse->setName($name2); + $expectedResponse->setShortName($shortName); + $transport->addResponse($expectedResponse); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->getAssociation($firewallPolicy, $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.RegionNetworkFirewallPolicies/GetAssociation', $actualFuncCall); + $actualValue = $actualRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAssociationExceptionTest() + { + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->getAssociation($firewallPolicy, $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 getEffectiveFirewallsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $network = 'network1843485230'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->getEffectiveFirewalls($network, $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.RegionNetworkFirewallPolicies/GetEffectiveFirewalls', $actualFuncCall); + $actualValue = $actualRequestObject->getNetwork(); + $this->assertProtobufEquals($network, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getEffectiveFirewallsExceptionTest() + { + $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 + $network = 'network1843485230'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->getEffectiveFirewalls($network, $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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($project, $region, $resource); + $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.RegionNetworkFirewallPolicies/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($project, $region, $resource); + // 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 getRuleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $action = 'action-1422950858'; + $description = 'description-1724546052'; + $direction = 'direction-962590849'; + $disabled = true; + $enableLogging = false; + $kind = 'kind3292052'; + $priority2 = 978365527; + $ruleName = 'ruleName-2092197394'; + $ruleTupleCount = 388342037; + $securityProfileGroup = 'securityProfileGroup-329459286'; + $tlsInspect = true; + $expectedResponse = new FirewallPolicyRule(); + $expectedResponse->setAction($action); + $expectedResponse->setDescription($description); + $expectedResponse->setDirection($direction); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setEnableLogging($enableLogging); + $expectedResponse->setKind($kind); + $expectedResponse->setPriority($priority2); + $expectedResponse->setRuleName($ruleName); + $expectedResponse->setRuleTupleCount($ruleTupleCount); + $expectedResponse->setSecurityProfileGroup($securityProfileGroup); + $expectedResponse->setTlsInspect($tlsInspect); + $transport->addResponse($expectedResponse); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->getRule($firewallPolicy, $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.RegionNetworkFirewallPolicies/GetRule', $actualFuncCall); + $actualValue = $actualRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRuleExceptionTest() + { + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->getRule($firewallPolicy, $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 + $firewallPolicyResource = new FirewallPolicy(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($firewallPolicyResource, $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.RegionNetworkFirewallPolicies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicyResource(); + $this->assertProtobufEquals($firewallPolicyResource, $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 + $firewallPolicyResource = new FirewallPolicy(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($firewallPolicyResource, $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 = ''; + $itemsElement = new FirewallPolicy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new FirewallPolicyList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $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.RegionNetworkFirewallPolicies/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()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyResource = new FirewallPolicy(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patch($firewallPolicy, $firewallPolicyResource, $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.RegionNetworkFirewallPolicies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyResource(); + $this->assertProtobufEquals($firewallPolicyResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyResource = new FirewallPolicy(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patch($firewallPolicy, $firewallPolicyResource, $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 patchRuleTest() + { + $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/patchRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patchRule($firewallPolicy, $firewallPolicyRuleResource, $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.RegionNetworkFirewallPolicies/PatchRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getFirewallPolicyRuleResource(); + $this->assertProtobufEquals($firewallPolicyRuleResource, $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 patchRuleExceptionTest() + { + $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/patchRuleExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $firewallPolicyRuleResource = new FirewallPolicyRule(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->patchRule($firewallPolicy, $firewallPolicyRuleResource, $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 removeAssociationTest() + { + $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/removeAssociationTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeAssociationTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->removeAssociation($firewallPolicy, $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.RegionNetworkFirewallPolicies/RemoveAssociation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $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 removeAssociationExceptionTest() + { + $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/removeAssociationExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->removeAssociation($firewallPolicy, $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 removeRuleTest() + { + $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/removeRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->removeRule($firewallPolicy, $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.RegionNetworkFirewallPolicies/RemoveRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFirewallPolicy(); + $this->assertProtobufEquals($firewallPolicy, $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 removeRuleExceptionTest() + { + $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/removeRuleExceptionTest'); + $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 + $firewallPolicy = 'firewallPolicy1035044177'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->removeRule($firewallPolicy, $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + $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.RegionNetworkFirewallPolicies/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRegionSetPolicyRequestResource(); + $this->assertProtobufEquals($regionSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + try { + $gapicClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $response = $gapicClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + $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.RegionNetworkFirewallPolicies/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + try { + $gapicClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionNotificationEndpointsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionNotificationEndpointsClientTest.php new file mode 100644 index 000000000000..0b6a11474ae7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionNotificationEndpointsClientTest.php @@ -0,0 +1,462 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionNotificationEndpointsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionNotificationEndpointsClient($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 + $notificationEndpoint = 'notificationEndpoint-696934807'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($notificationEndpoint, $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.RegionNotificationEndpoints/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNotificationEndpoint(); + $this->assertProtobufEquals($notificationEndpoint, $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 + $notificationEndpoint = 'notificationEndpoint-696934807'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($notificationEndpoint, $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'; + $expectedResponse = new NotificationEndpoint(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $notificationEndpoint = 'notificationEndpoint-696934807'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($notificationEndpoint, $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.RegionNotificationEndpoints/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNotificationEndpoint(); + $this->assertProtobufEquals($notificationEndpoint, $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 + $notificationEndpoint = 'notificationEndpoint-696934807'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($notificationEndpoint, $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 + $notificationEndpointResource = new NotificationEndpoint(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($notificationEndpointResource, $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.RegionNotificationEndpoints/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getNotificationEndpointResource(); + $this->assertProtobufEquals($notificationEndpointResource, $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 + $notificationEndpointResource = new NotificationEndpoint(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->insert($notificationEndpointResource, $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 NotificationEndpoint(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new NotificationEndpointList(); + $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.RegionNotificationEndpoints/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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionOperationsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionOperationsClientTest.php new file mode 100644 index 000000000000..481159d9eea2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionOperationsClientTest.php @@ -0,0 +1,423 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionOperationsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionOperationsClient($options); + } + + /** @test */ + public function deleteTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new DeleteRegionOperationResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->delete($operation, $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.RegionOperations/Delete', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $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 + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->delete($operation, $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 getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $clientOperationId = 'clientOperationId-239630617'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $endTime = 'endTime1725551537'; + $httpErrorMessage = 'httpErrorMessage1276263769'; + $httpErrorStatusCode = 1386087020; + $id = 3355; + $insertTime = 'insertTime-103148397'; + $kind = 'kind3292052'; + $name = 'name3373707'; + $operationGroupId = 'operationGroupId40171187'; + $operationType = 'operationType-1432962286'; + $progress = 1001078227; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $startTime = 'startTime-1573145462'; + $statusMessage = 'statusMessage-239442758'; + $targetId = 815576439; + $targetLink = 'targetLink-2084812312'; + $user = 'user3599307'; + $zone = 'zone3744684'; + $expectedResponse = new Operation(); + $expectedResponse->setClientOperationId($clientOperationId); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEndTime($endTime); + $expectedResponse->setHttpErrorMessage($httpErrorMessage); + $expectedResponse->setHttpErrorStatusCode($httpErrorStatusCode); + $expectedResponse->setId($id); + $expectedResponse->setInsertTime($insertTime); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setOperationGroupId($operationGroupId); + $expectedResponse->setOperationType($operationType); + $expectedResponse->setProgress($progress); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStartTime($startTime); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setTargetId($targetId); + $expectedResponse->setTargetLink($targetLink); + $expectedResponse->setUser($user); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($operation, $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.RegionOperations/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $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 + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($operation, $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 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 Operation(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new OperationList(); + $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.RegionOperations/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()); + } + + /** @test */ + public function waitTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $clientOperationId = 'clientOperationId-239630617'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $endTime = 'endTime1725551537'; + $httpErrorMessage = 'httpErrorMessage1276263769'; + $httpErrorStatusCode = 1386087020; + $id = 3355; + $insertTime = 'insertTime-103148397'; + $kind = 'kind3292052'; + $name = 'name3373707'; + $operationGroupId = 'operationGroupId40171187'; + $operationType = 'operationType-1432962286'; + $progress = 1001078227; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $startTime = 'startTime-1573145462'; + $statusMessage = 'statusMessage-239442758'; + $targetId = 815576439; + $targetLink = 'targetLink-2084812312'; + $user = 'user3599307'; + $zone = 'zone3744684'; + $expectedResponse = new Operation(); + $expectedResponse->setClientOperationId($clientOperationId); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEndTime($endTime); + $expectedResponse->setHttpErrorMessage($httpErrorMessage); + $expectedResponse->setHttpErrorStatusCode($httpErrorStatusCode); + $expectedResponse->setId($id); + $expectedResponse->setInsertTime($insertTime); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setOperationGroupId($operationGroupId); + $expectedResponse->setOperationType($operationType); + $expectedResponse->setProgress($progress); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStartTime($startTime); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setTargetId($targetId); + $expectedResponse->setTargetLink($targetLink); + $expectedResponse->setUser($user); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->wait($operation, $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.RegionOperations/Wait', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function waitExceptionTest() + { + $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 + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->wait($operation, $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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionSecurityPoliciesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionSecurityPoliciesClientTest.php new file mode 100644 index 000000000000..a80daa027eb9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionSecurityPoliciesClientTest.php @@ -0,0 +1,1031 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionSecurityPoliciesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionSecurityPoliciesClient($options); + } + + /** @test */ + public function addRuleTest() + { + $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/addRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyRuleResource = new SecurityPolicyRule(); + $response = $gapicClient->addRule($project, $region, $securityPolicy, $securityPolicyRuleResource); + $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.RegionSecurityPolicies/AddRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyRuleResource(); + $this->assertProtobufEquals($securityPolicyRuleResource, $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 addRuleExceptionTest() + { + $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/addRuleExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyRuleResource = new SecurityPolicyRule(); + $response = $gapicClient->addRule($project, $region, $securityPolicy, $securityPolicyRuleResource); + $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 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $response = $gapicClient->delete($project, $region, $securityPolicy); + $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.RegionSecurityPolicies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $response = $gapicClient->delete($project, $region, $securityPolicy); + $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'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $type = 'type3575610'; + $expectedResponse = new SecurityPolicy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setType($type); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $response = $gapicClient->get($project, $region, $securityPolicy); + $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.RegionSecurityPolicies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + try { + $gapicClient->get($project, $region, $securityPolicy); + // 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 getRuleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $action = 'action-1422950858'; + $description = 'description-1724546052'; + $kind = 'kind3292052'; + $preview = true; + $priority2 = 978365527; + $expectedResponse = new SecurityPolicyRule(); + $expectedResponse->setAction($action); + $expectedResponse->setDescription($description); + $expectedResponse->setKind($kind); + $expectedResponse->setPreview($preview); + $expectedResponse->setPriority($priority2); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $response = $gapicClient->getRule($project, $region, $securityPolicy); + $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.RegionSecurityPolicies/GetRule', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRuleExceptionTest() + { + $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'; + $securityPolicy = 'securityPolicy1781695249'; + try { + $gapicClient->getRule($project, $region, $securityPolicy); + // 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicyResource = new SecurityPolicy(); + $response = $gapicClient->insert($project, $region, $securityPolicyResource); + $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.RegionSecurityPolicies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyResource(); + $this->assertProtobufEquals($securityPolicyResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicyResource = new SecurityPolicy(); + $response = $gapicClient->insert($project, $region, $securityPolicyResource); + $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 = ''; + $itemsElement = new SecurityPolicy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new SecurityPolicyList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $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.RegionSecurityPolicies/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()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyResource = new SecurityPolicy(); + $response = $gapicClient->patch($project, $region, $securityPolicy, $securityPolicyResource); + $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.RegionSecurityPolicies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyResource(); + $this->assertProtobufEquals($securityPolicyResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyResource = new SecurityPolicy(); + $response = $gapicClient->patch($project, $region, $securityPolicy, $securityPolicyResource); + $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 patchRuleTest() + { + $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/patchRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyRuleResource = new SecurityPolicyRule(); + $response = $gapicClient->patchRule($project, $region, $securityPolicy, $securityPolicyRuleResource); + $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.RegionSecurityPolicies/PatchRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyRuleResource(); + $this->assertProtobufEquals($securityPolicyRuleResource, $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 patchRuleExceptionTest() + { + $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/patchRuleExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyRuleResource = new SecurityPolicyRule(); + $response = $gapicClient->patchRule($project, $region, $securityPolicy, $securityPolicyRuleResource); + $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 removeRuleTest() + { + $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/removeRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $response = $gapicClient->removeRule($project, $region, $securityPolicy); + $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.RegionSecurityPolicies/RemoveRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $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 removeRuleExceptionTest() + { + $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/removeRuleExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicy = 'securityPolicy1781695249'; + $response = $gapicClient->removeRule($project, $region, $securityPolicy); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionSslCertificatesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionSslCertificatesClientTest.php new file mode 100644 index 000000000000..d44d0fd08ffa --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionSslCertificatesClientTest.php @@ -0,0 +1,470 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionSslCertificatesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionSslCertificatesClient($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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslCertificate = 'sslCertificate-1027298332'; + $response = $gapicClient->delete($project, $region, $sslCertificate); + $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.RegionSslCertificates/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSslCertificate(); + $this->assertProtobufEquals($sslCertificate, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslCertificate = 'sslCertificate-1027298332'; + $response = $gapicClient->delete($project, $region, $sslCertificate); + $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 + $certificate = 'certificate1952399767'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $expireTime = 'expireTime-96179731'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $privateKey = 'privateKey1971943843'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $type = 'type3575610'; + $expectedResponse = new SslCertificate(); + $expectedResponse->setCertificate($certificate); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setExpireTime($expireTime); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setPrivateKey($privateKey); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setType($type); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslCertificate = 'sslCertificate-1027298332'; + $response = $gapicClient->get($project, $region, $sslCertificate); + $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.RegionSslCertificates/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getSslCertificate(); + $this->assertProtobufEquals($sslCertificate, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslCertificate = 'sslCertificate-1027298332'; + try { + $gapicClient->get($project, $region, $sslCertificate); + // 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslCertificateResource = new SslCertificate(); + $response = $gapicClient->insert($project, $region, $sslCertificateResource); + $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.RegionSslCertificates/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSslCertificateResource(); + $this->assertProtobufEquals($sslCertificateResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslCertificateResource = new SslCertificate(); + $response = $gapicClient->insert($project, $region, $sslCertificateResource); + $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 SslCertificate(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new SslCertificateList(); + $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.RegionSslCertificates/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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionSslPoliciesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionSslPoliciesClientTest.php new file mode 100644 index 000000000000..6c11ef7aebd6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionSslPoliciesClientTest.php @@ -0,0 +1,654 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionSslPoliciesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionSslPoliciesClient($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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslPolicy = 'sslPolicy-1852293435'; + $response = $gapicClient->delete($project, $region, $sslPolicy); + $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.RegionSslPolicies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSslPolicy(); + $this->assertProtobufEquals($sslPolicy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslPolicy = 'sslPolicy-1852293435'; + $response = $gapicClient->delete($project, $region, $sslPolicy); + $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'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $minTlsVersion = 'minTlsVersion8155943'; + $name = 'name3373707'; + $profile = 'profile-309425751'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new SslPolicy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setMinTlsVersion($minTlsVersion); + $expectedResponse->setName($name); + $expectedResponse->setProfile($profile); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslPolicy = 'sslPolicy-1852293435'; + $response = $gapicClient->get($project, $region, $sslPolicy); + $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.RegionSslPolicies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getSslPolicy(); + $this->assertProtobufEquals($sslPolicy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslPolicy = 'sslPolicy-1852293435'; + try { + $gapicClient->get($project, $region, $sslPolicy); + // 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslPolicyResource = new SslPolicy(); + $response = $gapicClient->insert($project, $region, $sslPolicyResource); + $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.RegionSslPolicies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSslPolicyResource(); + $this->assertProtobufEquals($sslPolicyResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslPolicyResource = new SslPolicy(); + $response = $gapicClient->insert($project, $region, $sslPolicyResource); + $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 SslPolicy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new SslPoliciesList(); + $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.RegionSslPolicies/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()); + } + + /** @test */ + public function listAvailableFeaturesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new SslPoliciesListAvailableFeaturesResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->listAvailableFeatures($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.RegionSslPolicies/ListAvailableFeatures', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAvailableFeaturesExceptionTest() + { + $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->listAvailableFeatures($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 patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslPolicy = 'sslPolicy-1852293435'; + $sslPolicyResource = new SslPolicy(); + $response = $gapicClient->patch($project, $region, $sslPolicy, $sslPolicyResource); + $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.RegionSslPolicies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSslPolicy(); + $this->assertProtobufEquals($sslPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getSslPolicyResource(); + $this->assertProtobufEquals($sslPolicyResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $sslPolicy = 'sslPolicy-1852293435'; + $sslPolicyResource = new SslPolicy(); + $response = $gapicClient->patch($project, $region, $sslPolicy, $sslPolicyResource); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionTargetHttpProxiesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionTargetHttpProxiesClientTest.php new file mode 100644 index 000000000000..37f5b617e5ea --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionTargetHttpProxiesClientTest.php @@ -0,0 +1,594 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionTargetHttpProxiesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionTargetHttpProxiesClient($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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $response = $gapicClient->delete($project, $region, $targetHttpProxy); + $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.RegionTargetHttpProxies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpProxy(); + $this->assertProtobufEquals($targetHttpProxy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $response = $gapicClient->delete($project, $region, $targetHttpProxy); + $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'; + $fingerprint = 'fingerprint-1375934236'; + $httpKeepAliveTimeoutSec = 2057938782; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $proxyBind = true; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $urlMap = 'urlMap-169850228'; + $expectedResponse = new TargetHttpProxy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setHttpKeepAliveTimeoutSec($httpKeepAliveTimeoutSec); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setProxyBind($proxyBind); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setUrlMap($urlMap); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $response = $gapicClient->get($project, $region, $targetHttpProxy); + $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.RegionTargetHttpProxies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getTargetHttpProxy(); + $this->assertProtobufEquals($targetHttpProxy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpProxy = 'targetHttpProxy206872421'; + try { + $gapicClient->get($project, $region, $targetHttpProxy); + // 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpProxyResource = new TargetHttpProxy(); + $response = $gapicClient->insert($project, $region, $targetHttpProxyResource); + $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.RegionTargetHttpProxies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpProxyResource(); + $this->assertProtobufEquals($targetHttpProxyResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpProxyResource = new TargetHttpProxy(); + $response = $gapicClient->insert($project, $region, $targetHttpProxyResource); + $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 TargetHttpProxy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new TargetHttpProxyList(); + $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.RegionTargetHttpProxies/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()); + } + + /** @test */ + public function setUrlMapTest() + { + $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/setUrlMapTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setUrlMapTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $urlMapReferenceResource = new UrlMapReference(); + $response = $gapicClient->setUrlMap($project, $region, $targetHttpProxy, $urlMapReferenceResource); + $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.RegionTargetHttpProxies/SetUrlMap', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpProxy(); + $this->assertProtobufEquals($targetHttpProxy, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMapReferenceResource(); + $this->assertProtobufEquals($urlMapReferenceResource, $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 setUrlMapExceptionTest() + { + $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/setUrlMapExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $urlMapReferenceResource = new UrlMapReference(); + $response = $gapicClient->setUrlMap($project, $region, $targetHttpProxy, $urlMapReferenceResource); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionTargetHttpsProxiesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionTargetHttpsProxiesClientTest.php new file mode 100644 index 000000000000..cf7e39060059 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionTargetHttpsProxiesClientTest.php @@ -0,0 +1,851 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionTargetHttpsProxiesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionTargetHttpsProxiesClient($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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $response = $gapicClient->delete($project, $region, $targetHttpsProxy); + $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.RegionTargetHttpsProxies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $response = $gapicClient->delete($project, $region, $targetHttpsProxy); + $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 + $authorizationPolicy = 'authorizationPolicy-1576667208'; + $certificateMap = 'certificateMap-917278028'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $httpKeepAliveTimeoutSec = 2057938782; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $proxyBind = true; + $quicOverride = 'quicOverride2067189933'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $serverTlsPolicy = 'serverTlsPolicy1906438002'; + $sslPolicy = 'sslPolicy-1852293435'; + $urlMap = 'urlMap-169850228'; + $expectedResponse = new TargetHttpsProxy(); + $expectedResponse->setAuthorizationPolicy($authorizationPolicy); + $expectedResponse->setCertificateMap($certificateMap); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setHttpKeepAliveTimeoutSec($httpKeepAliveTimeoutSec); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setProxyBind($proxyBind); + $expectedResponse->setQuicOverride($quicOverride); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setServerTlsPolicy($serverTlsPolicy); + $expectedResponse->setSslPolicy($sslPolicy); + $expectedResponse->setUrlMap($urlMap); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $response = $gapicClient->get($project, $region, $targetHttpsProxy); + $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.RegionTargetHttpsProxies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + try { + $gapicClient->get($project, $region, $targetHttpsProxy); + // 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpsProxyResource = new TargetHttpsProxy(); + $response = $gapicClient->insert($project, $region, $targetHttpsProxyResource); + $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.RegionTargetHttpsProxies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxyResource(); + $this->assertProtobufEquals($targetHttpsProxyResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpsProxyResource = new TargetHttpsProxy(); + $response = $gapicClient->insert($project, $region, $targetHttpsProxyResource); + $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 TargetHttpsProxy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new TargetHttpsProxyList(); + $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.RegionTargetHttpsProxies/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()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $targetHttpsProxyResource = new TargetHttpsProxy(); + $response = $gapicClient->patch($project, $region, $targetHttpsProxy, $targetHttpsProxyResource); + $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.RegionTargetHttpsProxies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxyResource(); + $this->assertProtobufEquals($targetHttpsProxyResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $targetHttpsProxyResource = new TargetHttpsProxy(); + $response = $gapicClient->patch($project, $region, $targetHttpsProxy, $targetHttpsProxyResource); + $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 setSslCertificatesTest() + { + $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/setSslCertificatesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setSslCertificatesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionTargetHttpsProxiesSetSslCertificatesRequestResource = new RegionTargetHttpsProxiesSetSslCertificatesRequest(); + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $response = $gapicClient->setSslCertificates($project, $region, $regionTargetHttpsProxiesSetSslCertificatesRequestResource, $targetHttpsProxy); + $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.RegionTargetHttpsProxies/SetSslCertificates', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionTargetHttpsProxiesSetSslCertificatesRequestResource(); + $this->assertProtobufEquals($regionTargetHttpsProxiesSetSslCertificatesRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $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 setSslCertificatesExceptionTest() + { + $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/setSslCertificatesExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionTargetHttpsProxiesSetSslCertificatesRequestResource = new RegionTargetHttpsProxiesSetSslCertificatesRequest(); + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $response = $gapicClient->setSslCertificates($project, $region, $regionTargetHttpsProxiesSetSslCertificatesRequestResource, $targetHttpsProxy); + $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 setUrlMapTest() + { + $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/setUrlMapTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setUrlMapTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $urlMapReferenceResource = new UrlMapReference(); + $response = $gapicClient->setUrlMap($project, $region, $targetHttpsProxy, $urlMapReferenceResource); + $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.RegionTargetHttpsProxies/SetUrlMap', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMapReferenceResource(); + $this->assertProtobufEquals($urlMapReferenceResource, $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 setUrlMapExceptionTest() + { + $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/setUrlMapExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $urlMapReferenceResource = new UrlMapReference(); + $response = $gapicClient->setUrlMap($project, $region, $targetHttpsProxy, $urlMapReferenceResource); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionTargetTcpProxiesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionTargetTcpProxiesClientTest.php new file mode 100644 index 000000000000..ca16fb81cffb --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionTargetTcpProxiesClientTest.php @@ -0,0 +1,468 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionTargetTcpProxiesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionTargetTcpProxiesClient($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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetTcpProxy = 'targetTcpProxy503065442'; + $response = $gapicClient->delete($project, $region, $targetTcpProxy); + $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.RegionTargetTcpProxies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetTcpProxy(); + $this->assertProtobufEquals($targetTcpProxy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetTcpProxy = 'targetTcpProxy503065442'; + $response = $gapicClient->delete($project, $region, $targetTcpProxy); + $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'; + $proxyBind = true; + $proxyHeader = 'proxyHeader-1987109506'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $service = 'service1984153269'; + $expectedResponse = new TargetTcpProxy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setProxyBind($proxyBind); + $expectedResponse->setProxyHeader($proxyHeader); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setService($service); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetTcpProxy = 'targetTcpProxy503065442'; + $response = $gapicClient->get($project, $region, $targetTcpProxy); + $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.RegionTargetTcpProxies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getTargetTcpProxy(); + $this->assertProtobufEquals($targetTcpProxy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetTcpProxy = 'targetTcpProxy503065442'; + try { + $gapicClient->get($project, $region, $targetTcpProxy); + // 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetTcpProxyResource = new TargetTcpProxy(); + $response = $gapicClient->insert($project, $region, $targetTcpProxyResource); + $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.RegionTargetTcpProxies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetTcpProxyResource(); + $this->assertProtobufEquals($targetTcpProxyResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetTcpProxyResource = new TargetTcpProxy(); + $response = $gapicClient->insert($project, $region, $targetTcpProxyResource); + $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 TargetTcpProxy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new TargetTcpProxyList(); + $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.RegionTargetTcpProxies/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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionUrlMapsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionUrlMapsClientTest.php new file mode 100644 index 000000000000..d9202ed8a0b0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionUrlMapsClientTest.php @@ -0,0 +1,784 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionUrlMapsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionUrlMapsClient($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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $urlMap = 'urlMap-169850228'; + $response = $gapicClient->delete($project, $region, $urlMap); + $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.RegionUrlMaps/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $urlMap = 'urlMap-169850228'; + $response = $gapicClient->delete($project, $region, $urlMap); + $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'; + $defaultService = 'defaultService1980854967'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new UrlMap(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDefaultService($defaultService); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $urlMap = 'urlMap-169850228'; + $response = $gapicClient->get($project, $region, $urlMap); + $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.RegionUrlMaps/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $urlMap = 'urlMap-169850228'; + try { + $gapicClient->get($project, $region, $urlMap); + // 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $urlMapResource = new UrlMap(); + $response = $gapicClient->insert($project, $region, $urlMapResource); + $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.RegionUrlMaps/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMapResource(); + $this->assertProtobufEquals($urlMapResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $urlMapResource = new UrlMap(); + $response = $gapicClient->insert($project, $region, $urlMapResource); + $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 UrlMap(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new UrlMapList(); + $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.RegionUrlMaps/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()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $urlMap = 'urlMap-169850228'; + $urlMapResource = new UrlMap(); + $response = $gapicClient->patch($project, $region, $urlMap, $urlMapResource); + $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.RegionUrlMaps/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMapResource(); + $this->assertProtobufEquals($urlMapResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $urlMap = 'urlMap-169850228'; + $urlMapResource = new UrlMap(); + $response = $gapicClient->patch($project, $region, $urlMap, $urlMapResource); + $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 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $urlMap = 'urlMap-169850228'; + $urlMapResource = new UrlMap(); + $response = $gapicClient->update($project, $region, $urlMap, $urlMapResource); + $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.RegionUrlMaps/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMapResource(); + $this->assertProtobufEquals($urlMapResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $urlMap = 'urlMap-169850228'; + $urlMapResource = new UrlMap(); + $response = $gapicClient->update($project, $region, $urlMap, $urlMapResource); + $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 validateTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new UrlMapsValidateResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionUrlMapsValidateRequestResource = new RegionUrlMapsValidateRequest(); + $urlMap = 'urlMap-169850228'; + $response = $gapicClient->validate($project, $region, $regionUrlMapsValidateRequestResource, $urlMap); + $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.RegionUrlMaps/Validate', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRegionUrlMapsValidateRequestResource(); + $this->assertProtobufEquals($regionUrlMapsValidateRequestResource, $actualValue); + $actualValue = $actualRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function validateExceptionTest() + { + $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'; + $regionUrlMapsValidateRequestResource = new RegionUrlMapsValidateRequest(); + $urlMap = 'urlMap-169850228'; + try { + $gapicClient->validate($project, $region, $regionUrlMapsValidateRequestResource, $urlMap); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionZonesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionZonesClientTest.php new file mode 100644 index 000000000000..2ee0e1f5614d --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionZonesClientTest.php @@ -0,0 +1,140 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionZonesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionZonesClient($options); + } + + /** @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 Zone(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new ZoneList(); + $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.RegionZones/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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionsClientTest.php new file mode 100644 index 000000000000..7e0938416c2f --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionsClientTest.php @@ -0,0 +1,214 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RegionsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RegionsClient($options); + } + + /** @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'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $supportsPzs = true; + $expectedResponse = new Region(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $expectedResponse->setSupportsPzs($supportsPzs); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $response = $gapicClient->get($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.Regions/Get', $actualFuncCall); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + try { + $gapicClient->get($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 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 Region(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new RegionList(); + $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->list($project); + $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.Regions/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/ReservationsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/ReservationsClientTest.php new file mode 100644 index 000000000000..bc5834b1098e --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/ReservationsClientTest.php @@ -0,0 +1,1016 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ReservationsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ReservationsClient($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 ReservationsScopedList(), + ]; + $expectedResponse = new ReservationAggregatedList(); + $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.Reservations/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() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $reservation = 'reservation-1563081780'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($project, $reservation, $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.Reservations/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getReservation(); + $this->assertProtobufEquals($reservation, $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 deleteExceptionTest() + { + $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/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 + $project = 'project-309310695'; + $reservation = 'reservation-1563081780'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($project, $reservation, $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 getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $commitment = 'commitment1019005717'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $specificReservationRequired = false; + $status = 'status-892481550'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new Reservation(); + $expectedResponse->setCommitment($commitment); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSpecificReservationRequired($specificReservationRequired); + $expectedResponse->setStatus($status); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $reservation = 'reservation-1563081780'; + $zone = 'zone3744684'; + $response = $gapicClient->get($project, $reservation, $zone); + $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.Reservations/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getReservation(); + $this->assertProtobufEquals($reservation, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $project = 'project-309310695'; + $reservation = 'reservation-1563081780'; + $zone = 'zone3744684'; + try { + $gapicClient->get($project, $reservation, $zone); + // 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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $response = $gapicClient->getIamPolicy($project, $resource, $zone); + $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.Reservations/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + try { + $gapicClient->getIamPolicy($project, $resource, $zone); + // 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 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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $reservationResource = new Reservation(); + $zone = 'zone3744684'; + $response = $gapicClient->insert($project, $reservationResource, $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.Reservations/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getReservationResource(); + $this->assertProtobufEquals($reservationResource, $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 insertExceptionTest() + { + $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/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 + $project = 'project-309310695'; + $reservationResource = new Reservation(); + $zone = 'zone3744684'; + $response = $gapicClient->insert($project, $reservationResource, $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 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 Reservation(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new ReservationList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->list($project, $zone); + $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.Reservations/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + try { + $gapicClient->list($project, $zone); + // 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 resizeTest() + { + $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/resizeTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/resizeTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $reservation = 'reservation-1563081780'; + $reservationsResizeRequestResource = new ReservationsResizeRequest(); + $zone = 'zone3744684'; + $response = $gapicClient->resize($project, $reservation, $reservationsResizeRequestResource, $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.Reservations/Resize', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getReservation(); + $this->assertProtobufEquals($reservation, $actualValue); + $actualValue = $actualApiRequestObject->getReservationsResizeRequestResource(); + $this->assertProtobufEquals($reservationsResizeRequestResource, $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 resizeExceptionTest() + { + $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/resizeExceptionTest'); + $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 + $project = 'project-309310695'; + $reservation = 'reservation-1563081780'; + $reservationsResizeRequestResource = new ReservationsResizeRequest(); + $zone = 'zone3744684'; + $response = $gapicClient->resize($project, $reservation, $reservationsResizeRequestResource, $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $response = $gapicClient->setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource); + $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.Reservations/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $actualValue = $actualRequestObject->getZoneSetPolicyRequestResource(); + $this->assertProtobufEquals($zoneSetPolicyRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + try { + $gapicClient->setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + $response = $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone); + $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.Reservations/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + try { + $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone); + // 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 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 + $project = 'project-309310695'; + $reservation = 'reservation-1563081780'; + $reservationResource = new Reservation(); + $zone = 'zone3744684'; + $response = $gapicClient->update($project, $reservation, $reservationResource, $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.Reservations/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getReservation(); + $this->assertProtobufEquals($reservation, $actualValue); + $actualValue = $actualApiRequestObject->getReservationResource(); + $this->assertProtobufEquals($reservationResource, $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 + $project = 'project-309310695'; + $reservation = 'reservation-1563081780'; + $reservationResource = new Reservation(); + $zone = 'zone3744684'; + $response = $gapicClient->update($project, $reservation, $reservationResource, $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/owl-bot-staging/Compute/V1/tests/Unit/V1/ResourcePoliciesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/ResourcePoliciesClientTest.php new file mode 100644 index 000000000000..f205dda055a9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/ResourcePoliciesClientTest.php @@ -0,0 +1,890 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ResourcePoliciesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ResourcePoliciesClient($options); + } + + /** @test */ + public function aggregatedListTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $items = [ + 'itemsKey' => new ResourcePoliciesScopedList(), + ]; + $expectedResponse = new ResourcePolicyAggregatedList(); + $expectedResponse->setEtag($etag); + $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.ResourcePolicies/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() + { + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $resourcePolicy = 'resourcePolicy696111747'; + $response = $gapicClient->delete($project, $region, $resourcePolicy); + $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.ResourcePolicies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getResourcePolicy(); + $this->assertProtobufEquals($resourcePolicy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $resourcePolicy = 'resourcePolicy696111747'; + $response = $gapicClient->delete($project, $region, $resourcePolicy); + $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'; + $status = 'status-892481550'; + $expectedResponse = new ResourcePolicy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resourcePolicy = 'resourcePolicy696111747'; + $response = $gapicClient->get($project, $region, $resourcePolicy); + $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.ResourcePolicies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResourcePolicy(); + $this->assertProtobufEquals($resourcePolicy, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $resourcePolicy = 'resourcePolicy696111747'; + try { + $gapicClient->get($project, $region, $resourcePolicy); + // 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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($project, $region, $resource); + $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.ResourcePolicies/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($project, $region, $resource); + // 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $resourcePolicyResource = new ResourcePolicy(); + $response = $gapicClient->insert($project, $region, $resourcePolicyResource); + $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.ResourcePolicies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getResourcePolicyResource(); + $this->assertProtobufEquals($resourcePolicyResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $resourcePolicyResource = new ResourcePolicy(); + $response = $gapicClient->insert($project, $region, $resourcePolicyResource); + $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 + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new ResourcePolicy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new ResourcePolicyList(); + $expectedResponse->setEtag($etag); + $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.ResourcePolicies/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()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resourcePolicy = 'resourcePolicy696111747'; + $resourcePolicyResource = new ResourcePolicy(); + $response = $gapicClient->patch($project, $region, $resourcePolicy, $resourcePolicyResource); + $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.ResourcePolicies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getResourcePolicy(); + $this->assertProtobufEquals($resourcePolicy, $actualValue); + $actualValue = $actualApiRequestObject->getResourcePolicyResource(); + $this->assertProtobufEquals($resourcePolicyResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $resourcePolicy = 'resourcePolicy696111747'; + $resourcePolicyResource = new ResourcePolicy(); + $response = $gapicClient->patch($project, $region, $resourcePolicy, $resourcePolicyResource); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + $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.ResourcePolicies/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRegionSetPolicyRequestResource(); + $this->assertProtobufEquals($regionSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + try { + $gapicClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $response = $gapicClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + $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.ResourcePolicies/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + try { + $gapicClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/RoutersClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RoutersClientTest.php new file mode 100644 index 000000000000..1aafd084cd54 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RoutersClientTest.php @@ -0,0 +1,1080 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RoutersClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RoutersClient($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 RoutersScopedList(), + ]; + $expectedResponse = new RouterAggregatedList(); + $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.Routers/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() + { + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $response = $gapicClient->delete($project, $region, $router); + $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.Routers/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRouter(); + $this->assertProtobufEquals($router, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $response = $gapicClient->delete($project, $region, $router); + $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'; + $encryptedInterconnectRouter = false; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $network = 'network1843485230'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new Router(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEncryptedInterconnectRouter($encryptedInterconnectRouter); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $response = $gapicClient->get($project, $region, $router); + $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.Routers/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRouter(); + $this->assertProtobufEquals($router, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + try { + $gapicClient->get($project, $region, $router); + // 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 getNatIpInfoTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new NatIpInfoResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $response = $gapicClient->getNatIpInfo($project, $region, $router); + $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.Routers/GetNatIpInfo', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRouter(); + $this->assertProtobufEquals($router, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNatIpInfoExceptionTest() + { + $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'; + $router = 'router-925132983'; + try { + $gapicClient->getNatIpInfo($project, $region, $router); + // 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 getNatMappingInfoTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $resultElement = new VmEndpointNatMappings(); + $result = [ + $resultElement, + ]; + $expectedResponse = new VmEndpointNatMappingsList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setResult($result); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $response = $gapicClient->getNatMappingInfo($project, $region, $router); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getResult()[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.Routers/GetNatMappingInfo', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRouter(); + $this->assertProtobufEquals($router, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getNatMappingInfoExceptionTest() + { + $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'; + $router = 'router-925132983'; + try { + $gapicClient->getNatMappingInfo($project, $region, $router); + // 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 getRouterStatusTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $kind = 'kind3292052'; + $expectedResponse = new RouterStatusResponse(); + $expectedResponse->setKind($kind); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $response = $gapicClient->getRouterStatus($project, $region, $router); + $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.Routers/GetRouterStatus', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRouter(); + $this->assertProtobufEquals($router, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRouterStatusExceptionTest() + { + $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'; + $router = 'router-925132983'; + try { + $gapicClient->getRouterStatus($project, $region, $router); + // 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $routerResource = new Router(); + $response = $gapicClient->insert($project, $region, $routerResource); + $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.Routers/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRouterResource(); + $this->assertProtobufEquals($routerResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $routerResource = new Router(); + $response = $gapicClient->insert($project, $region, $routerResource); + $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 Router(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new RouterList(); + $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.Routers/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()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $routerResource = new Router(); + $response = $gapicClient->patch($project, $region, $router, $routerResource); + $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.Routers/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRouter(); + $this->assertProtobufEquals($router, $actualValue); + $actualValue = $actualApiRequestObject->getRouterResource(); + $this->assertProtobufEquals($routerResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $routerResource = new Router(); + $response = $gapicClient->patch($project, $region, $router, $routerResource); + $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 previewTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new RoutersPreviewResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $routerResource = new Router(); + $response = $gapicClient->preview($project, $region, $router, $routerResource); + $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.Routers/Preview', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRouter(); + $this->assertProtobufEquals($router, $actualValue); + $actualValue = $actualRequestObject->getRouterResource(); + $this->assertProtobufEquals($routerResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function previewExceptionTest() + { + $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'; + $router = 'router-925132983'; + $routerResource = new Router(); + try { + $gapicClient->preview($project, $region, $router, $routerResource); + // 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 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $routerResource = new Router(); + $response = $gapicClient->update($project, $region, $router, $routerResource); + $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.Routers/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRouter(); + $this->assertProtobufEquals($router, $actualValue); + $actualValue = $actualApiRequestObject->getRouterResource(); + $this->assertProtobufEquals($routerResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $router = 'router-925132983'; + $routerResource = new Router(); + $response = $gapicClient->update($project, $region, $router, $routerResource); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/RoutesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/RoutesClientTest.php new file mode 100644 index 000000000000..65fff152e2ff --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RoutesClientTest.php @@ -0,0 +1,468 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return RoutesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new RoutesClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $route = 'route108704329'; + $response = $gapicClient->delete($project, $route); + $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.Routes/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRoute(); + $this->assertProtobufEquals($route, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $route = 'route108704329'; + $response = $gapicClient->delete($project, $route); + $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'; + $destRange = 'destRange918198624'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $network = 'network1843485230'; + $nextHopGateway = 'nextHopGateway-159695614'; + $nextHopHub = 'nextHopHub-1948804429'; + $nextHopIlb = 'nextHopIlb-1948803747'; + $nextHopInstance = 'nextHopInstance1467250071'; + $nextHopIp = 'nextHopIp1184061353'; + $nextHopNetwork = 'nextHopNetwork1872908524'; + $nextHopPeering = 'nextHopPeering-661059074'; + $nextHopVpnTunnel = 'nextHopVpnTunnel-1627639147'; + $priority = 1165461084; + $routeStatus = 'routeStatus955033256'; + $routeType = 'routeType912759664'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new Route(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDestRange($destRange); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setNextHopGateway($nextHopGateway); + $expectedResponse->setNextHopHub($nextHopHub); + $expectedResponse->setNextHopIlb($nextHopIlb); + $expectedResponse->setNextHopInstance($nextHopInstance); + $expectedResponse->setNextHopIp($nextHopIp); + $expectedResponse->setNextHopNetwork($nextHopNetwork); + $expectedResponse->setNextHopPeering($nextHopPeering); + $expectedResponse->setNextHopVpnTunnel($nextHopVpnTunnel); + $expectedResponse->setPriority($priority); + $expectedResponse->setRouteStatus($routeStatus); + $expectedResponse->setRouteType($routeType); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $route = 'route108704329'; + $response = $gapicClient->get($project, $route); + $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.Routes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRoute(); + $this->assertProtobufEquals($route, $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 + $project = 'project-309310695'; + $route = 'route108704329'; + try { + $gapicClient->get($project, $route); + // 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 GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $routeResource = new Route(); + $response = $gapicClient->insert($project, $routeResource); + $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.Routes/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRouteResource(); + $this->assertProtobufEquals($routeResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $routeResource = new Route(); + $response = $gapicClient->insert($project, $routeResource); + $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 Route(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new RouteList(); + $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->list($project); + $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.Routes/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/SecurityPoliciesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/SecurityPoliciesClientTest.php new file mode 100644 index 000000000000..be1bfcfeab3d --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/SecurityPoliciesClientTest.php @@ -0,0 +1,1246 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SecurityPoliciesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SecurityPoliciesClient($options); + } + + /** @test */ + public function addRuleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyRuleResource = new SecurityPolicyRule(); + $response = $gapicClient->addRule($project, $securityPolicy, $securityPolicyRuleResource); + $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.SecurityPolicies/AddRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyRuleResource(); + $this->assertProtobufEquals($securityPolicyRuleResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function addRuleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/addRuleExceptionTest'); + $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 + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyRuleResource = new SecurityPolicyRule(); + $response = $gapicClient->addRule($project, $securityPolicy, $securityPolicyRuleResource); + $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 aggregatedListTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $items = [ + 'itemsKey' => new SecurityPoliciesScopedList(), + ]; + $expectedResponse = new SecurityPoliciesAggregatedList(); + $expectedResponse->setEtag($etag); + $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.SecurityPolicies/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() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $response = $gapicClient->delete($project, $securityPolicy); + $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.SecurityPolicies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $response = $gapicClient->delete($project, $securityPolicy); + $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'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $type = 'type3575610'; + $expectedResponse = new SecurityPolicy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setType($type); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $response = $gapicClient->get($project, $securityPolicy); + $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.SecurityPolicies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $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 + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + try { + $gapicClient->get($project, $securityPolicy); + // 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 getRuleTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $action = 'action-1422950858'; + $description = 'description-1724546052'; + $kind = 'kind3292052'; + $preview = true; + $priority2 = 978365527; + $expectedResponse = new SecurityPolicyRule(); + $expectedResponse->setAction($action); + $expectedResponse->setDescription($description); + $expectedResponse->setKind($kind); + $expectedResponse->setPreview($preview); + $expectedResponse->setPriority($priority2); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $response = $gapicClient->getRule($project, $securityPolicy); + $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.SecurityPolicies/GetRule', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getRuleExceptionTest() + { + $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'; + $securityPolicy = 'securityPolicy1781695249'; + try { + $gapicClient->getRule($project, $securityPolicy); + // 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 GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $securityPolicyResource = new SecurityPolicy(); + $response = $gapicClient->insert($project, $securityPolicyResource); + $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.SecurityPolicies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyResource(); + $this->assertProtobufEquals($securityPolicyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $securityPolicyResource = new SecurityPolicy(); + $response = $gapicClient->insert($project, $securityPolicyResource); + $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 = ''; + $itemsElement = new SecurityPolicy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new SecurityPolicyList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $response = $gapicClient->list($project); + $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.SecurityPolicies/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 listPreconfiguredExpressionSetsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new SecurityPoliciesListPreconfiguredExpressionSetsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $response = $gapicClient->listPreconfiguredExpressionSets($project); + $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.SecurityPolicies/ListPreconfiguredExpressionSets', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listPreconfiguredExpressionSetsExceptionTest() + { + $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->listPreconfiguredExpressionSets($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 patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyResource = new SecurityPolicy(); + $response = $gapicClient->patch($project, $securityPolicy, $securityPolicyResource); + $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.SecurityPolicies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyResource(); + $this->assertProtobufEquals($securityPolicyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyResource = new SecurityPolicy(); + $response = $gapicClient->patch($project, $securityPolicy, $securityPolicyResource); + $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 patchRuleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyRuleResource = new SecurityPolicyRule(); + $response = $gapicClient->patchRule($project, $securityPolicy, $securityPolicyRuleResource); + $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.SecurityPolicies/PatchRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyRuleResource(); + $this->assertProtobufEquals($securityPolicyRuleResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchRuleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchRuleExceptionTest'); + $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 + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $securityPolicyRuleResource = new SecurityPolicyRule(); + $response = $gapicClient->patchRule($project, $securityPolicy, $securityPolicyRuleResource); + $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 removeRuleTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/removeRuleTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeRuleTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $response = $gapicClient->removeRule($project, $securityPolicy); + $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.SecurityPolicies/RemoveRule', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicy(); + $this->assertProtobufEquals($securityPolicy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function removeRuleExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/removeRuleExceptionTest'); + $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 + $project = 'project-309310695'; + $securityPolicy = 'securityPolicy1781695249'; + $response = $gapicClient->removeRule($project, $securityPolicy); + $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 setLabelsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + $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.SecurityPolicies/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getGlobalSetLabelsRequestResource(); + $this->assertProtobufEquals($globalSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setLabelsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsExceptionTest'); + $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 + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/ServiceAttachmentsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/ServiceAttachmentsClientTest.php new file mode 100644 index 000000000000..80aee5f1051a --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/ServiceAttachmentsClientTest.php @@ -0,0 +1,896 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ServiceAttachmentsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ServiceAttachmentsClient($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 ServiceAttachmentsScopedList(), + ]; + $expectedResponse = new ServiceAttachmentAggregatedList(); + $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.ServiceAttachments/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() + { + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $serviceAttachment = 'serviceAttachment-1271655187'; + $response = $gapicClient->delete($project, $region, $serviceAttachment); + $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.ServiceAttachments/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getServiceAttachment(); + $this->assertProtobufEquals($serviceAttachment, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $serviceAttachment = 'serviceAttachment-1271655187'; + $response = $gapicClient->delete($project, $region, $serviceAttachment); + $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 + $connectionPreference = 'connectionPreference822688988'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $enableProxyProtocol = false; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $producerForwardingRule = 'producerForwardingRule-825813935'; + $reconcileConnections = true; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $targetService = 'targetService-1609318905'; + $expectedResponse = new ServiceAttachment(); + $expectedResponse->setConnectionPreference($connectionPreference); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEnableProxyProtocol($enableProxyProtocol); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setProducerForwardingRule($producerForwardingRule); + $expectedResponse->setReconcileConnections($reconcileConnections); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setTargetService($targetService); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $serviceAttachment = 'serviceAttachment-1271655187'; + $response = $gapicClient->get($project, $region, $serviceAttachment); + $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.ServiceAttachments/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getServiceAttachment(); + $this->assertProtobufEquals($serviceAttachment, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $serviceAttachment = 'serviceAttachment-1271655187'; + try { + $gapicClient->get($project, $region, $serviceAttachment); + // 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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($project, $region, $resource); + $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.ServiceAttachments/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($project, $region, $resource); + // 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $serviceAttachmentResource = new ServiceAttachment(); + $response = $gapicClient->insert($project, $region, $serviceAttachmentResource); + $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.ServiceAttachments/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getServiceAttachmentResource(); + $this->assertProtobufEquals($serviceAttachmentResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $serviceAttachmentResource = new ServiceAttachment(); + $response = $gapicClient->insert($project, $region, $serviceAttachmentResource); + $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 ServiceAttachment(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new ServiceAttachmentList(); + $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.ServiceAttachments/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()); + } + + /** @test */ + public function patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $serviceAttachment = 'serviceAttachment-1271655187'; + $serviceAttachmentResource = new ServiceAttachment(); + $response = $gapicClient->patch($project, $region, $serviceAttachment, $serviceAttachmentResource); + $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.ServiceAttachments/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getServiceAttachment(); + $this->assertProtobufEquals($serviceAttachment, $actualValue); + $actualValue = $actualApiRequestObject->getServiceAttachmentResource(); + $this->assertProtobufEquals($serviceAttachmentResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $serviceAttachment = 'serviceAttachment-1271655187'; + $serviceAttachmentResource = new ServiceAttachment(); + $response = $gapicClient->patch($project, $region, $serviceAttachment, $serviceAttachmentResource); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + $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.ServiceAttachments/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRegionSetPolicyRequestResource(); + $this->assertProtobufEquals($regionSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + try { + $gapicClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $response = $gapicClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + $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.ServiceAttachments/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + try { + $gapicClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/SnapshotSettingsServiceClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/SnapshotSettingsServiceClientTest.php new file mode 100644 index 000000000000..526dfcac66ff --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/SnapshotSettingsServiceClientTest.php @@ -0,0 +1,237 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SnapshotSettingsServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SnapshotSettingsServiceClient($options); + } + + /** @test */ + public function getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new SnapshotSettings(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $response = $gapicClient->get($project); + $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.SnapshotSettingsService/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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 + $project = 'project-309310695'; + try { + $gapicClient->get($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 patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $snapshotSettingsResource = new SnapshotSettings(); + $response = $gapicClient->patch($project, $snapshotSettingsResource); + $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.SnapshotSettingsService/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSnapshotSettingsResource(); + $this->assertProtobufEquals($snapshotSettingsResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $snapshotSettingsResource = new SnapshotSettings(); + $response = $gapicClient->patch($project, $snapshotSettingsResource); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/SnapshotsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/SnapshotsClientTest.php new file mode 100644 index 000000000000..185aa211eba7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/SnapshotsClientTest.php @@ -0,0 +1,815 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SnapshotsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SnapshotsClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $snapshot = 'snapshot284874180'; + $response = $gapicClient->delete($project, $snapshot); + $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.Snapshots/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSnapshot(); + $this->assertProtobufEquals($snapshot, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $snapshot = 'snapshot284874180'; + $response = $gapicClient->delete($project, $snapshot); + $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 + $architecture = 'architecture839674195'; + $autoCreated = true; + $chainName = 'chainName-2078839479'; + $creationSizeBytes = 1199141901; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $diskSizeGb = 757478089; + $downloadBytes = 971924980; + $enableConfidentialCompute = true; + $id = 3355; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $locationHint = 'locationHint-1796964143'; + $name = 'name3373707'; + $satisfiesPzi = false; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $snapshotType = 'snapshotType1198091477'; + $sourceDisk = 'sourceDisk-85117119'; + $sourceDiskForRecoveryCheckpoint = 'sourceDiskForRecoveryCheckpoint-713903874'; + $sourceDiskId = 'sourceDiskId-1693292839'; + $sourceInstantSnapshot = 'sourceInstantSnapshot-317668858'; + $sourceInstantSnapshotId = 'sourceInstantSnapshotId-1859900940'; + $sourceSnapshotSchedulePolicy = 'sourceSnapshotSchedulePolicy-837985533'; + $sourceSnapshotSchedulePolicyId = 'sourceSnapshotSchedulePolicyId-2076994601'; + $status = 'status-892481550'; + $storageBytes = 2035244455; + $storageBytesStatus = 'storageBytesStatus1027609994'; + $expectedResponse = new Snapshot(); + $expectedResponse->setArchitecture($architecture); + $expectedResponse->setAutoCreated($autoCreated); + $expectedResponse->setChainName($chainName); + $expectedResponse->setCreationSizeBytes($creationSizeBytes); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDiskSizeGb($diskSizeGb); + $expectedResponse->setDownloadBytes($downloadBytes); + $expectedResponse->setEnableConfidentialCompute($enableConfidentialCompute); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setLocationHint($locationHint); + $expectedResponse->setName($name); + $expectedResponse->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSnapshotType($snapshotType); + $expectedResponse->setSourceDisk($sourceDisk); + $expectedResponse->setSourceDiskForRecoveryCheckpoint($sourceDiskForRecoveryCheckpoint); + $expectedResponse->setSourceDiskId($sourceDiskId); + $expectedResponse->setSourceInstantSnapshot($sourceInstantSnapshot); + $expectedResponse->setSourceInstantSnapshotId($sourceInstantSnapshotId); + $expectedResponse->setSourceSnapshotSchedulePolicy($sourceSnapshotSchedulePolicy); + $expectedResponse->setSourceSnapshotSchedulePolicyId($sourceSnapshotSchedulePolicyId); + $expectedResponse->setStatus($status); + $expectedResponse->setStorageBytes($storageBytes); + $expectedResponse->setStorageBytesStatus($storageBytesStatus); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $snapshot = 'snapshot284874180'; + $response = $gapicClient->get($project, $snapshot); + $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.Snapshots/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getSnapshot(); + $this->assertProtobufEquals($snapshot, $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 + $project = 'project-309310695'; + $snapshot = 'snapshot284874180'; + try { + $gapicClient->get($project, $snapshot); + // 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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($project, $resource); + $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.Snapshots/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($project, $resource); + // 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 GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $snapshotResource = new Snapshot(); + $response = $gapicClient->insert($project, $snapshotResource); + $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.Snapshots/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSnapshotResource(); + $this->assertProtobufEquals($snapshotResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $snapshotResource = new Snapshot(); + $response = $gapicClient->insert($project, $snapshotResource); + $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 Snapshot(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new SnapshotList(); + $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->list($project); + $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.Snapshots/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + $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.Snapshots/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getGlobalSetPolicyRequestResource(); + $this->assertProtobufEquals($globalSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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 + $globalSetPolicyRequestResource = new GlobalSetPolicyRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + try { + $gapicClient->setIamPolicy($globalSetPolicyRequestResource, $project, $resource); + // 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 setLabelsTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + $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.Snapshots/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getGlobalSetLabelsRequestResource(); + $this->assertProtobufEquals($globalSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setLabelsExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setLabelsExceptionTest'); + $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 + $globalSetLabelsRequestResource = new GlobalSetLabelsRequest(); + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($globalSetLabelsRequestResource, $project, $resource); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $response = $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + $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.Snapshots/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + try { + $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/SslCertificatesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/SslCertificatesClientTest.php new file mode 100644 index 000000000000..b8e9fee6d707 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/SslCertificatesClientTest.php @@ -0,0 +1,529 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SslCertificatesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SslCertificatesClient($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 SslCertificatesScopedList(), + ]; + $expectedResponse = new SslCertificateAggregatedList(); + $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.SslCertificates/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() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $sslCertificate = 'sslCertificate-1027298332'; + $response = $gapicClient->delete($project, $sslCertificate); + $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.SslCertificates/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSslCertificate(); + $this->assertProtobufEquals($sslCertificate, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $sslCertificate = 'sslCertificate-1027298332'; + $response = $gapicClient->delete($project, $sslCertificate); + $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 + $certificate = 'certificate1952399767'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $expireTime = 'expireTime-96179731'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $privateKey = 'privateKey1971943843'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $type = 'type3575610'; + $expectedResponse = new SslCertificate(); + $expectedResponse->setCertificate($certificate); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setExpireTime($expireTime); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setPrivateKey($privateKey); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setType($type); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $sslCertificate = 'sslCertificate-1027298332'; + $response = $gapicClient->get($project, $sslCertificate); + $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.SslCertificates/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getSslCertificate(); + $this->assertProtobufEquals($sslCertificate, $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 + $project = 'project-309310695'; + $sslCertificate = 'sslCertificate-1027298332'; + try { + $gapicClient->get($project, $sslCertificate); + // 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 GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $sslCertificateResource = new SslCertificate(); + $response = $gapicClient->insert($project, $sslCertificateResource); + $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.SslCertificates/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSslCertificateResource(); + $this->assertProtobufEquals($sslCertificateResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $sslCertificateResource = new SslCertificate(); + $response = $gapicClient->insert($project, $sslCertificateResource); + $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 SslCertificate(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new SslCertificateList(); + $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->list($project); + $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.SslCertificates/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/SslPoliciesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/SslPoliciesClientTest.php new file mode 100644 index 000000000000..ed2fe6f66114 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/SslPoliciesClientTest.php @@ -0,0 +1,706 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SslPoliciesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SslPoliciesClient($options); + } + + /** @test */ + public function aggregatedListTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $items = [ + 'itemsKey' => new SslPoliciesScopedList(), + ]; + $expectedResponse = new SslPoliciesAggregatedList(); + $expectedResponse->setEtag($etag); + $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.SslPolicies/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() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $sslPolicy = 'sslPolicy-1852293435'; + $response = $gapicClient->delete($project, $sslPolicy); + $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.SslPolicies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSslPolicy(); + $this->assertProtobufEquals($sslPolicy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $sslPolicy = 'sslPolicy-1852293435'; + $response = $gapicClient->delete($project, $sslPolicy); + $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'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $minTlsVersion = 'minTlsVersion8155943'; + $name = 'name3373707'; + $profile = 'profile-309425751'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new SslPolicy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setMinTlsVersion($minTlsVersion); + $expectedResponse->setName($name); + $expectedResponse->setProfile($profile); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $sslPolicy = 'sslPolicy-1852293435'; + $response = $gapicClient->get($project, $sslPolicy); + $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.SslPolicies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getSslPolicy(); + $this->assertProtobufEquals($sslPolicy, $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 + $project = 'project-309310695'; + $sslPolicy = 'sslPolicy-1852293435'; + try { + $gapicClient->get($project, $sslPolicy); + // 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 GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $sslPolicyResource = new SslPolicy(); + $response = $gapicClient->insert($project, $sslPolicyResource); + $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.SslPolicies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSslPolicyResource(); + $this->assertProtobufEquals($sslPolicyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $sslPolicyResource = new SslPolicy(); + $response = $gapicClient->insert($project, $sslPolicyResource); + $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 SslPolicy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new SslPoliciesList(); + $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->list($project); + $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.SslPolicies/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 listAvailableFeaturesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new SslPoliciesListAvailableFeaturesResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $response = $gapicClient->listAvailableFeatures($project); + $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.SslPolicies/ListAvailableFeatures', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAvailableFeaturesExceptionTest() + { + $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->listAvailableFeatures($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 patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $sslPolicy = 'sslPolicy-1852293435'; + $sslPolicyResource = new SslPolicy(); + $response = $gapicClient->patch($project, $sslPolicy, $sslPolicyResource); + $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.SslPolicies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSslPolicy(); + $this->assertProtobufEquals($sslPolicy, $actualValue); + $actualValue = $actualApiRequestObject->getSslPolicyResource(); + $this->assertProtobufEquals($sslPolicyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $sslPolicy = 'sslPolicy-1852293435'; + $sslPolicyResource = new SslPolicy(); + $response = $gapicClient->patch($project, $sslPolicy, $sslPolicyResource); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/StoragePoolTypesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/StoragePoolTypesClientTest.php new file mode 100644 index 000000000000..5e37e604118c --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/StoragePoolTypesClientTest.php @@ -0,0 +1,313 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return StoragePoolTypesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new StoragePoolTypesClient($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 StoragePoolTypesScopedList(), + ]; + $expectedResponse = new StoragePoolTypeAggregatedList(); + $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.StoragePoolTypes/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 getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $maxPoolProvisionedCapacityGb = 1255880909; + $maxPoolProvisionedIops = 1095342084; + $maxPoolProvisionedThroughput = 1302669885; + $minPoolProvisionedCapacityGb = 345848161; + $minPoolProvisionedIops = 1194139030; + $minPoolProvisionedThroughput = 1242850773; + $minSizeGb = 1459020012; + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new StoragePoolType(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setMaxPoolProvisionedCapacityGb($maxPoolProvisionedCapacityGb); + $expectedResponse->setMaxPoolProvisionedIops($maxPoolProvisionedIops); + $expectedResponse->setMaxPoolProvisionedThroughput($maxPoolProvisionedThroughput); + $expectedResponse->setMinPoolProvisionedCapacityGb($minPoolProvisionedCapacityGb); + $expectedResponse->setMinPoolProvisionedIops($minPoolProvisionedIops); + $expectedResponse->setMinPoolProvisionedThroughput($minPoolProvisionedThroughput); + $expectedResponse->setMinSizeGb($minSizeGb); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $storagePoolType = 'storagePoolType1896612025'; + $zone = 'zone3744684'; + $response = $gapicClient->get($project, $storagePoolType, $zone); + $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.StoragePoolTypes/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getStoragePoolType(); + $this->assertProtobufEquals($storagePoolType, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $project = 'project-309310695'; + $storagePoolType = 'storagePoolType1896612025'; + $zone = 'zone3744684'; + try { + $gapicClient->get($project, $storagePoolType, $zone); + // 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 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 StoragePoolType(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new StoragePoolTypeList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->list($project, $zone); + $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.StoragePoolTypes/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + try { + $gapicClient->list($project, $zone); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/StoragePoolsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/StoragePoolsClientTest.php new file mode 100644 index 000000000000..29711d1cdee2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/StoragePoolsClientTest.php @@ -0,0 +1,975 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return StoragePoolsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new StoragePoolsClient($options); + } + + /** @test */ + public function aggregatedListTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $items = [ + 'itemsKey' => new StoragePoolsScopedList(), + ]; + $expectedResponse = new StoragePoolAggregatedList(); + $expectedResponse->setEtag($etag); + $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.StoragePools/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() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $storagePool = 'storagePool897344352'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($project, $storagePool, $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.StoragePools/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getStoragePool(); + $this->assertProtobufEquals($storagePool, $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 deleteExceptionTest() + { + $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/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 + $project = 'project-309310695'; + $storagePool = 'storagePool897344352'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($project, $storagePool, $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 getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $capacityProvisioningType = 'capacityProvisioningType1325352199'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $performanceProvisioningType = 'performanceProvisioningType1542295293'; + $poolProvisionedCapacityGb = 1132075054; + $poolProvisionedIops = 1185834135; + $poolProvisionedThroughput = 1779828376; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $state = 'state109757585'; + $storagePoolType = 'storagePoolType1896612025'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new StoragePool(); + $expectedResponse->setCapacityProvisioningType($capacityProvisioningType); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setPerformanceProvisioningType($performanceProvisioningType); + $expectedResponse->setPoolProvisionedCapacityGb($poolProvisionedCapacityGb); + $expectedResponse->setPoolProvisionedIops($poolProvisionedIops); + $expectedResponse->setPoolProvisionedThroughput($poolProvisionedThroughput); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $expectedResponse->setState($state); + $expectedResponse->setStoragePoolType($storagePoolType); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $storagePool = 'storagePool897344352'; + $zone = 'zone3744684'; + $response = $gapicClient->get($project, $storagePool, $zone); + $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.StoragePools/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getStoragePool(); + $this->assertProtobufEquals($storagePool, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $project = 'project-309310695'; + $storagePool = 'storagePool897344352'; + $zone = 'zone3744684'; + try { + $gapicClient->get($project, $storagePool, $zone); + // 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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $response = $gapicClient->getIamPolicy($project, $resource, $zone); + $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.StoragePools/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + try { + $gapicClient->getIamPolicy($project, $resource, $zone); + // 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 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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $storagePoolResource = new StoragePool(); + $zone = 'zone3744684'; + $response = $gapicClient->insert($project, $storagePoolResource, $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.StoragePools/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getStoragePoolResource(); + $this->assertProtobufEquals($storagePoolResource, $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 insertExceptionTest() + { + $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/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 + $project = 'project-309310695'; + $storagePoolResource = new StoragePool(); + $zone = 'zone3744684'; + $response = $gapicClient->insert($project, $storagePoolResource, $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 listTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = 'nextPageToken-1530815211'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new StoragePoolList(); + $expectedResponse->setEtag($etag); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->list($project, $zone); + $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.StoragePools/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + try { + $gapicClient->list($project, $zone); + // 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 listDisksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = 'nextPageToken-1530815211'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new StoragePoolListDisks(); + $expectedResponse->setEtag($etag); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $storagePool = 'storagePool897344352'; + $zone = 'zone3744684'; + $response = $gapicClient->listDisks($project, $storagePool, $zone); + $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.StoragePools/ListDisks', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getStoragePool(); + $this->assertProtobufEquals($storagePool, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDisksExceptionTest() + { + $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'; + $storagePool = 'storagePool897344352'; + $zone = 'zone3744684'; + try { + $gapicClient->listDisks($project, $storagePool, $zone); + // 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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + $response = $gapicClient->setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource); + $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.StoragePools/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $actualValue = $actualRequestObject->getZoneSetPolicyRequestResource(); + $this->assertProtobufEquals($zoneSetPolicyRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $zone = 'zone3744684'; + $zoneSetPolicyRequestResource = new ZoneSetPolicyRequest(); + try { + $gapicClient->setIamPolicy($project, $resource, $zone, $zoneSetPolicyRequestResource); + // 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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + $response = $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone); + $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.StoragePools/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $zone = 'zone3744684'; + try { + $gapicClient->testIamPermissions($project, $resource, $testPermissionsRequestResource, $zone); + // 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 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 + $project = 'project-309310695'; + $storagePool = 'storagePool897344352'; + $storagePoolResource = new StoragePool(); + $zone = 'zone3744684'; + $response = $gapicClient->update($project, $storagePool, $storagePoolResource, $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.StoragePools/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getStoragePool(); + $this->assertProtobufEquals($storagePool, $actualValue); + $actualValue = $actualApiRequestObject->getStoragePoolResource(); + $this->assertProtobufEquals($storagePoolResource, $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 + $project = 'project-309310695'; + $storagePool = 'storagePool897344352'; + $storagePoolResource = new StoragePool(); + $zone = 'zone3744684'; + $response = $gapicClient->update($project, $storagePool, $storagePoolResource, $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/owl-bot-staging/Compute/V1/tests/Unit/V1/SubnetworksClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/SubnetworksClientTest.php new file mode 100644 index 000000000000..5ea43a4571f1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/SubnetworksClientTest.php @@ -0,0 +1,1240 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return SubnetworksClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new SubnetworksClient($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 SubnetworksScopedList(), + ]; + $expectedResponse = new SubnetworkAggregatedList(); + $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.Subnetworks/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() + { + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetwork = 'subnetwork-1302785042'; + $response = $gapicClient->delete($project, $region, $subnetwork); + $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.Subnetworks/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSubnetwork(); + $this->assertProtobufEquals($subnetwork, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetwork = 'subnetwork-1302785042'; + $response = $gapicClient->delete($project, $region, $subnetwork); + $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 expandIpCidrRangeTest() + { + $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/expandIpCidrRangeTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/expandIpCidrRangeTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetwork = 'subnetwork-1302785042'; + $subnetworksExpandIpCidrRangeRequestResource = new SubnetworksExpandIpCidrRangeRequest(); + $response = $gapicClient->expandIpCidrRange($project, $region, $subnetwork, $subnetworksExpandIpCidrRangeRequestResource); + $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.Subnetworks/ExpandIpCidrRange', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSubnetwork(); + $this->assertProtobufEquals($subnetwork, $actualValue); + $actualValue = $actualApiRequestObject->getSubnetworksExpandIpCidrRangeRequestResource(); + $this->assertProtobufEquals($subnetworksExpandIpCidrRangeRequestResource, $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 expandIpCidrRangeExceptionTest() + { + $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/expandIpCidrRangeExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetwork = 'subnetwork-1302785042'; + $subnetworksExpandIpCidrRangeRequestResource = new SubnetworksExpandIpCidrRangeRequest(); + $response = $gapicClient->expandIpCidrRange($project, $region, $subnetwork, $subnetworksExpandIpCidrRangeRequestResource); + $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'; + $enableFlowLogs = true; + $externalIpv6Prefix = 'externalIpv6Prefix1749911926'; + $fingerprint = 'fingerprint-1375934236'; + $gatewayAddress = 'gatewayAddress-77003527'; + $id = 3355; + $internalIpv6Prefix = 'internalIpv6Prefix-30600856'; + $ipCidrRange = 'ipCidrRange-2049366326'; + $ipv6AccessType = 'ipv6AccessType-569083171'; + $ipv6CidrRange = 'ipv6CidrRange-1874342390'; + $kind = 'kind3292052'; + $name = 'name3373707'; + $network = 'network1843485230'; + $privateIpGoogleAccess = true; + $privateIpv6GoogleAccess = 'privateIpv6GoogleAccess1122018830'; + $purpose = 'purpose-220463842'; + $region2 = 'region2-690338393'; + $reservedInternalRange = 'reservedInternalRange-787493070'; + $role = 'role3506294'; + $selfLink = 'selfLink-1691268851'; + $stackType = 'stackType2036521617'; + $state = 'state109757585'; + $expectedResponse = new Subnetwork(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEnableFlowLogs($enableFlowLogs); + $expectedResponse->setExternalIpv6Prefix($externalIpv6Prefix); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setGatewayAddress($gatewayAddress); + $expectedResponse->setId($id); + $expectedResponse->setInternalIpv6Prefix($internalIpv6Prefix); + $expectedResponse->setIpCidrRange($ipCidrRange); + $expectedResponse->setIpv6AccessType($ipv6AccessType); + $expectedResponse->setIpv6CidrRange($ipv6CidrRange); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setPrivateIpGoogleAccess($privateIpGoogleAccess); + $expectedResponse->setPrivateIpv6GoogleAccess($privateIpv6GoogleAccess); + $expectedResponse->setPurpose($purpose); + $expectedResponse->setRegion($region2); + $expectedResponse->setReservedInternalRange($reservedInternalRange); + $expectedResponse->setRole($role); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStackType($stackType); + $expectedResponse->setState($state); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetwork = 'subnetwork-1302785042'; + $response = $gapicClient->get($project, $region, $subnetwork); + $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.Subnetworks/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getSubnetwork(); + $this->assertProtobufEquals($subnetwork, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetwork = 'subnetwork-1302785042'; + try { + $gapicClient->get($project, $region, $subnetwork); + // 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 getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($project, $region, $resource); + $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.Subnetworks/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIamPolicyExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($project, $region, $resource); + // 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetworkResource = new Subnetwork(); + $response = $gapicClient->insert($project, $region, $subnetworkResource); + $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.Subnetworks/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSubnetworkResource(); + $this->assertProtobufEquals($subnetworkResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetworkResource = new Subnetwork(); + $response = $gapicClient->insert($project, $region, $subnetworkResource); + $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 Subnetwork(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new SubnetworkList(); + $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.Subnetworks/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()); + } + + /** @test */ + public function listUsableTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = ''; + $selfLink = 'selfLink-1691268851'; + $itemsElement = new UsableSubnetwork(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new UsableSubnetworksAggregatedList(); + $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->listUsable($project); + $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.Subnetworks/ListUsable', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listUsableExceptionTest() + { + $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->listUsable($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 patchTest() + { + $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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetwork = 'subnetwork-1302785042'; + $subnetworkResource = new Subnetwork(); + $response = $gapicClient->patch($project, $region, $subnetwork, $subnetworkResource); + $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.Subnetworks/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSubnetwork(); + $this->assertProtobufEquals($subnetwork, $actualValue); + $actualValue = $actualApiRequestObject->getSubnetworkResource(); + $this->assertProtobufEquals($subnetworkResource, $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 patchExceptionTest() + { + $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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetwork = 'subnetwork-1302785042'; + $subnetworkResource = new Subnetwork(); + $response = $gapicClient->patch($project, $region, $subnetwork, $subnetworkResource); + $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 setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $etag = 'etag3123477'; + $iamOwned = false; + $version = 351608024; + $expectedResponse = new Policy(); + $expectedResponse->setEtag($etag); + $expectedResponse->setIamOwned($iamOwned); + $expectedResponse->setVersion($version); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + $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.Subnetworks/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getRegionSetPolicyRequestResource(); + $this->assertProtobufEquals($regionSetPolicyRequestResource, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setIamPolicyExceptionTest() + { + $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'; + $regionSetPolicyRequestResource = new RegionSetPolicyRequest(); + $resource = 'resource-341064690'; + try { + $gapicClient->setIamPolicy($project, $region, $regionSetPolicyRequestResource, $resource); + // 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 setPrivateIpGoogleAccessTest() + { + $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/setPrivateIpGoogleAccessTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setPrivateIpGoogleAccessTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetwork = 'subnetwork-1302785042'; + $subnetworksSetPrivateIpGoogleAccessRequestResource = new SubnetworksSetPrivateIpGoogleAccessRequest(); + $response = $gapicClient->setPrivateIpGoogleAccess($project, $region, $subnetwork, $subnetworksSetPrivateIpGoogleAccessRequestResource); + $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.Subnetworks/SetPrivateIpGoogleAccess', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSubnetwork(); + $this->assertProtobufEquals($subnetwork, $actualValue); + $actualValue = $actualApiRequestObject->getSubnetworksSetPrivateIpGoogleAccessRequestResource(); + $this->assertProtobufEquals($subnetworksSetPrivateIpGoogleAccessRequestResource, $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 setPrivateIpGoogleAccessExceptionTest() + { + $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/setPrivateIpGoogleAccessExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $subnetwork = 'subnetwork-1302785042'; + $subnetworksSetPrivateIpGoogleAccessRequestResource = new SubnetworksSetPrivateIpGoogleAccessRequest(); + $response = $gapicClient->setPrivateIpGoogleAccess($project, $region, $subnetwork, $subnetworksSetPrivateIpGoogleAccessRequestResource); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $response = $gapicClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + $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.Subnetworks/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + try { + $gapicClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetGrpcProxiesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetGrpcProxiesClientTest.php new file mode 100644 index 000000000000..09c2f2f7378c --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetGrpcProxiesClientTest.php @@ -0,0 +1,568 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TargetGrpcProxiesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TargetGrpcProxiesClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetGrpcProxy = 'targetGrpcProxy-1605592453'; + $response = $gapicClient->delete($project, $targetGrpcProxy); + $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.TargetGrpcProxies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetGrpcProxy(); + $this->assertProtobufEquals($targetGrpcProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetGrpcProxy = 'targetGrpcProxy-1605592453'; + $response = $gapicClient->delete($project, $targetGrpcProxy); + $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'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $selfLink = 'selfLink-1691268851'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $urlMap = 'urlMap-169850228'; + $validateForProxyless = true; + $expectedResponse = new TargetGrpcProxy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $expectedResponse->setUrlMap($urlMap); + $expectedResponse->setValidateForProxyless($validateForProxyless); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $targetGrpcProxy = 'targetGrpcProxy-1605592453'; + $response = $gapicClient->get($project, $targetGrpcProxy); + $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.TargetGrpcProxies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getTargetGrpcProxy(); + $this->assertProtobufEquals($targetGrpcProxy, $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 + $project = 'project-309310695'; + $targetGrpcProxy = 'targetGrpcProxy-1605592453'; + try { + $gapicClient->get($project, $targetGrpcProxy); + // 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 GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetGrpcProxyResource = new TargetGrpcProxy(); + $response = $gapicClient->insert($project, $targetGrpcProxyResource); + $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.TargetGrpcProxies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetGrpcProxyResource(); + $this->assertProtobufEquals($targetGrpcProxyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetGrpcProxyResource = new TargetGrpcProxy(); + $response = $gapicClient->insert($project, $targetGrpcProxyResource); + $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 TargetGrpcProxy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new TargetGrpcProxyList(); + $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->list($project); + $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.TargetGrpcProxies/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetGrpcProxy = 'targetGrpcProxy-1605592453'; + $targetGrpcProxyResource = new TargetGrpcProxy(); + $response = $gapicClient->patch($project, $targetGrpcProxy, $targetGrpcProxyResource); + $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.TargetGrpcProxies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetGrpcProxy(); + $this->assertProtobufEquals($targetGrpcProxy, $actualValue); + $actualValue = $actualApiRequestObject->getTargetGrpcProxyResource(); + $this->assertProtobufEquals($targetGrpcProxyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $targetGrpcProxy = 'targetGrpcProxy-1605592453'; + $targetGrpcProxyResource = new TargetGrpcProxy(); + $response = $gapicClient->patch($project, $targetGrpcProxy, $targetGrpcProxyResource); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetHttpProxiesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetHttpProxiesClientTest.php new file mode 100644 index 000000000000..85730354ed1c --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetHttpProxiesClientTest.php @@ -0,0 +1,766 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TargetHttpProxiesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TargetHttpProxiesClient($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 TargetHttpProxiesScopedList(), + ]; + $expectedResponse = new TargetHttpProxyAggregatedList(); + $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.TargetHttpProxies/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() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $response = $gapicClient->delete($project, $targetHttpProxy); + $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.TargetHttpProxies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpProxy(); + $this->assertProtobufEquals($targetHttpProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $response = $gapicClient->delete($project, $targetHttpProxy); + $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'; + $fingerprint = 'fingerprint-1375934236'; + $httpKeepAliveTimeoutSec = 2057938782; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $proxyBind = true; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $urlMap = 'urlMap-169850228'; + $expectedResponse = new TargetHttpProxy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setHttpKeepAliveTimeoutSec($httpKeepAliveTimeoutSec); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setProxyBind($proxyBind); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setUrlMap($urlMap); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $response = $gapicClient->get($project, $targetHttpProxy); + $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.TargetHttpProxies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getTargetHttpProxy(); + $this->assertProtobufEquals($targetHttpProxy, $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 + $project = 'project-309310695'; + $targetHttpProxy = 'targetHttpProxy206872421'; + try { + $gapicClient->get($project, $targetHttpProxy); + // 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 GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetHttpProxyResource = new TargetHttpProxy(); + $response = $gapicClient->insert($project, $targetHttpProxyResource); + $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.TargetHttpProxies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpProxyResource(); + $this->assertProtobufEquals($targetHttpProxyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetHttpProxyResource = new TargetHttpProxy(); + $response = $gapicClient->insert($project, $targetHttpProxyResource); + $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 TargetHttpProxy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new TargetHttpProxyList(); + $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->list($project); + $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.TargetHttpProxies/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $targetHttpProxyResource = new TargetHttpProxy(); + $response = $gapicClient->patch($project, $targetHttpProxy, $targetHttpProxyResource); + $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.TargetHttpProxies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpProxy(); + $this->assertProtobufEquals($targetHttpProxy, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpProxyResource(); + $this->assertProtobufEquals($targetHttpProxyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $targetHttpProxyResource = new TargetHttpProxy(); + $response = $gapicClient->patch($project, $targetHttpProxy, $targetHttpProxyResource); + $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 setUrlMapTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setUrlMapTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setUrlMapTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $urlMapReferenceResource = new UrlMapReference(); + $response = $gapicClient->setUrlMap($project, $targetHttpProxy, $urlMapReferenceResource); + $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.TargetHttpProxies/SetUrlMap', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpProxy(); + $this->assertProtobufEquals($targetHttpProxy, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMapReferenceResource(); + $this->assertProtobufEquals($urlMapReferenceResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setUrlMapExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setUrlMapExceptionTest'); + $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 + $project = 'project-309310695'; + $targetHttpProxy = 'targetHttpProxy206872421'; + $urlMapReferenceResource = new UrlMapReference(); + $response = $gapicClient->setUrlMap($project, $targetHttpProxy, $urlMapReferenceResource); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetHttpsProxiesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetHttpsProxiesClientTest.php new file mode 100644 index 000000000000..171f4bc876c9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetHttpsProxiesClientTest.php @@ -0,0 +1,1252 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TargetHttpsProxiesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TargetHttpsProxiesClient($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 TargetHttpsProxiesScopedList(), + ]; + $expectedResponse = new TargetHttpsProxyAggregatedList(); + $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.TargetHttpsProxies/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() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $response = $gapicClient->delete($project, $targetHttpsProxy); + $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.TargetHttpsProxies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $response = $gapicClient->delete($project, $targetHttpsProxy); + $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 + $authorizationPolicy = 'authorizationPolicy-1576667208'; + $certificateMap = 'certificateMap-917278028'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $httpKeepAliveTimeoutSec = 2057938782; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $proxyBind = true; + $quicOverride = 'quicOverride2067189933'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $serverTlsPolicy = 'serverTlsPolicy1906438002'; + $sslPolicy = 'sslPolicy-1852293435'; + $urlMap = 'urlMap-169850228'; + $expectedResponse = new TargetHttpsProxy(); + $expectedResponse->setAuthorizationPolicy($authorizationPolicy); + $expectedResponse->setCertificateMap($certificateMap); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setHttpKeepAliveTimeoutSec($httpKeepAliveTimeoutSec); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setProxyBind($proxyBind); + $expectedResponse->setQuicOverride($quicOverride); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setServerTlsPolicy($serverTlsPolicy); + $expectedResponse->setSslPolicy($sslPolicy); + $expectedResponse->setUrlMap($urlMap); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $response = $gapicClient->get($project, $targetHttpsProxy); + $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.TargetHttpsProxies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $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 + $project = 'project-309310695'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + try { + $gapicClient->get($project, $targetHttpsProxy); + // 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 GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetHttpsProxyResource = new TargetHttpsProxy(); + $response = $gapicClient->insert($project, $targetHttpsProxyResource); + $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.TargetHttpsProxies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxyResource(); + $this->assertProtobufEquals($targetHttpsProxyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetHttpsProxyResource = new TargetHttpsProxy(); + $response = $gapicClient->insert($project, $targetHttpsProxyResource); + $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 TargetHttpsProxy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new TargetHttpsProxyList(); + $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->list($project); + $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.TargetHttpsProxies/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $targetHttpsProxyResource = new TargetHttpsProxy(); + $response = $gapicClient->patch($project, $targetHttpsProxy, $targetHttpsProxyResource); + $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.TargetHttpsProxies/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxyResource(); + $this->assertProtobufEquals($targetHttpsProxyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $targetHttpsProxyResource = new TargetHttpsProxy(); + $response = $gapicClient->patch($project, $targetHttpsProxy, $targetHttpsProxyResource); + $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 setCertificateMapTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setCertificateMapTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setCertificateMapTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetHttpsProxiesSetCertificateMapRequestResource = new TargetHttpsProxiesSetCertificateMapRequest(); + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $response = $gapicClient->setCertificateMap($project, $targetHttpsProxiesSetCertificateMapRequestResource, $targetHttpsProxy); + $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.TargetHttpsProxies/SetCertificateMap', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxiesSetCertificateMapRequestResource(); + $this->assertProtobufEquals($targetHttpsProxiesSetCertificateMapRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setCertificateMapExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setCertificateMapExceptionTest'); + $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 + $project = 'project-309310695'; + $targetHttpsProxiesSetCertificateMapRequestResource = new TargetHttpsProxiesSetCertificateMapRequest(); + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $response = $gapicClient->setCertificateMap($project, $targetHttpsProxiesSetCertificateMapRequestResource, $targetHttpsProxy); + $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 setQuicOverrideTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setQuicOverrideTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setQuicOverrideTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetHttpsProxiesSetQuicOverrideRequestResource = new TargetHttpsProxiesSetQuicOverrideRequest(); + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $response = $gapicClient->setQuicOverride($project, $targetHttpsProxiesSetQuicOverrideRequestResource, $targetHttpsProxy); + $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.TargetHttpsProxies/SetQuicOverride', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxiesSetQuicOverrideRequestResource(); + $this->assertProtobufEquals($targetHttpsProxiesSetQuicOverrideRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setQuicOverrideExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setQuicOverrideExceptionTest'); + $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 + $project = 'project-309310695'; + $targetHttpsProxiesSetQuicOverrideRequestResource = new TargetHttpsProxiesSetQuicOverrideRequest(); + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $response = $gapicClient->setQuicOverride($project, $targetHttpsProxiesSetQuicOverrideRequestResource, $targetHttpsProxy); + $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 setSslCertificatesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setSslCertificatesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setSslCertificatesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetHttpsProxiesSetSslCertificatesRequestResource = new TargetHttpsProxiesSetSslCertificatesRequest(); + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $response = $gapicClient->setSslCertificates($project, $targetHttpsProxiesSetSslCertificatesRequestResource, $targetHttpsProxy); + $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.TargetHttpsProxies/SetSslCertificates', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxiesSetSslCertificatesRequestResource(); + $this->assertProtobufEquals($targetHttpsProxiesSetSslCertificatesRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setSslCertificatesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setSslCertificatesExceptionTest'); + $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 + $project = 'project-309310695'; + $targetHttpsProxiesSetSslCertificatesRequestResource = new TargetHttpsProxiesSetSslCertificatesRequest(); + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $response = $gapicClient->setSslCertificates($project, $targetHttpsProxiesSetSslCertificatesRequestResource, $targetHttpsProxy); + $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 setSslPolicyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setSslPolicyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setSslPolicyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $sslPolicyReferenceResource = new SslPolicyReference(); + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $response = $gapicClient->setSslPolicy($project, $sslPolicyReferenceResource, $targetHttpsProxy); + $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.TargetHttpsProxies/SetSslPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSslPolicyReferenceResource(); + $this->assertProtobufEquals($sslPolicyReferenceResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setSslPolicyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setSslPolicyExceptionTest'); + $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 + $project = 'project-309310695'; + $sslPolicyReferenceResource = new SslPolicyReference(); + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $response = $gapicClient->setSslPolicy($project, $sslPolicyReferenceResource, $targetHttpsProxy); + $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 setUrlMapTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setUrlMapTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setUrlMapTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $urlMapReferenceResource = new UrlMapReference(); + $response = $gapicClient->setUrlMap($project, $targetHttpsProxy, $urlMapReferenceResource); + $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.TargetHttpsProxies/SetUrlMap', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetHttpsProxy(); + $this->assertProtobufEquals($targetHttpsProxy, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMapReferenceResource(); + $this->assertProtobufEquals($urlMapReferenceResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setUrlMapExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setUrlMapExceptionTest'); + $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 + $project = 'project-309310695'; + $targetHttpsProxy = 'targetHttpsProxy-2095146900'; + $urlMapReferenceResource = new UrlMapReference(); + $response = $gapicClient->setUrlMap($project, $targetHttpsProxy, $urlMapReferenceResource); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetInstancesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetInstancesClientTest.php new file mode 100644 index 000000000000..37beeae60bb5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetInstancesClientTest.php @@ -0,0 +1,671 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TargetInstancesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TargetInstancesClient($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 TargetInstancesScopedList(), + ]; + $expectedResponse = new TargetInstanceAggregatedList(); + $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.TargetInstances/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() + { + $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/deleteTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/deleteTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetInstance = 'targetInstance826640259'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($project, $targetInstance, $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.TargetInstances/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetInstance(); + $this->assertProtobufEquals($targetInstance, $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 deleteExceptionTest() + { + $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/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 + $project = 'project-309310695'; + $targetInstance = 'targetInstance826640259'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($project, $targetInstance, $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 getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $id = 3355; + $instance = 'instance555127957'; + $kind = 'kind3292052'; + $name = 'name3373707'; + $natPolicy = 'natPolicy-1637703152'; + $network = 'network1843485230'; + $securityPolicy = 'securityPolicy1781695249'; + $selfLink = 'selfLink-1691268851'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new TargetInstance(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setInstance($instance); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setNatPolicy($natPolicy); + $expectedResponse->setNetwork($network); + $expectedResponse->setSecurityPolicy($securityPolicy); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $targetInstance = 'targetInstance826640259'; + $zone = 'zone3744684'; + $response = $gapicClient->get($project, $targetInstance, $zone); + $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.TargetInstances/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getTargetInstance(); + $this->assertProtobufEquals($targetInstance, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $project = 'project-309310695'; + $targetInstance = 'targetInstance826640259'; + $zone = 'zone3744684'; + try { + $gapicClient->get($project, $targetInstance, $zone); + // 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 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/insertTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/insertTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetInstanceResource = new TargetInstance(); + $zone = 'zone3744684'; + $response = $gapicClient->insert($project, $targetInstanceResource, $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.TargetInstances/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetInstanceResource(); + $this->assertProtobufEquals($targetInstanceResource, $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 insertExceptionTest() + { + $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/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 + $project = 'project-309310695'; + $targetInstanceResource = new TargetInstance(); + $zone = 'zone3744684'; + $response = $gapicClient->insert($project, $targetInstanceResource, $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 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 TargetInstance(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new TargetInstanceList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->list($project, $zone); + $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.TargetInstances/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + try { + $gapicClient->list($project, $zone); + // 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 setSecurityPolicyTest() + { + $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/setSecurityPolicyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setSecurityPolicyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $targetInstance = 'targetInstance826640259'; + $zone = 'zone3744684'; + $response = $gapicClient->setSecurityPolicy($project, $securityPolicyReferenceResource, $targetInstance, $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.TargetInstances/SetSecurityPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyReferenceResource(); + $this->assertProtobufEquals($securityPolicyReferenceResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetInstance(); + $this->assertProtobufEquals($targetInstance, $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 setSecurityPolicyExceptionTest() + { + $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/setSecurityPolicyExceptionTest'); + $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 + $project = 'project-309310695'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $targetInstance = 'targetInstance826640259'; + $zone = 'zone3744684'; + $response = $gapicClient->setSecurityPolicy($project, $securityPolicyReferenceResource, $targetInstance, $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/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetPoolsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetPoolsClientTest.php new file mode 100644 index 000000000000..69f37757eae2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetPoolsClientTest.php @@ -0,0 +1,1365 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TargetPoolsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TargetPoolsClient($options); + } + + /** @test */ + public function addHealthCheckTest() + { + $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/addHealthCheckTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addHealthCheckTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $targetPoolsAddHealthCheckRequestResource = new TargetPoolsAddHealthCheckRequest(); + $response = $gapicClient->addHealthCheck($project, $region, $targetPool, $targetPoolsAddHealthCheckRequestResource); + $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.TargetPools/AddHealthCheck', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPool(); + $this->assertProtobufEquals($targetPool, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPoolsAddHealthCheckRequestResource(); + $this->assertProtobufEquals($targetPoolsAddHealthCheckRequestResource, $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 addHealthCheckExceptionTest() + { + $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/addHealthCheckExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $targetPoolsAddHealthCheckRequestResource = new TargetPoolsAddHealthCheckRequest(); + $response = $gapicClient->addHealthCheck($project, $region, $targetPool, $targetPoolsAddHealthCheckRequestResource); + $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 addInstanceTest() + { + $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/addInstanceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/addInstanceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $targetPoolsAddInstanceRequestResource = new TargetPoolsAddInstanceRequest(); + $response = $gapicClient->addInstance($project, $region, $targetPool, $targetPoolsAddInstanceRequestResource); + $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.TargetPools/AddInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPool(); + $this->assertProtobufEquals($targetPool, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPoolsAddInstanceRequestResource(); + $this->assertProtobufEquals($targetPoolsAddInstanceRequestResource, $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 addInstanceExceptionTest() + { + $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/addInstanceExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $targetPoolsAddInstanceRequestResource = new TargetPoolsAddInstanceRequest(); + $response = $gapicClient->addInstance($project, $region, $targetPool, $targetPoolsAddInstanceRequestResource); + $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 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 TargetPoolsScopedList(), + ]; + $expectedResponse = new TargetPoolAggregatedList(); + $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.TargetPools/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() + { + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $response = $gapicClient->delete($project, $region, $targetPool); + $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.TargetPools/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPool(); + $this->assertProtobufEquals($targetPool, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $response = $gapicClient->delete($project, $region, $targetPool); + $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 + $backupPool = 'backupPool1119626361'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $failoverRatio = -2221401; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $region2 = 'region2-690338393'; + $securityPolicy = 'securityPolicy1781695249'; + $selfLink = 'selfLink-1691268851'; + $sessionAffinity = 'sessionAffinity1000759473'; + $expectedResponse = new TargetPool(); + $expectedResponse->setBackupPool($backupPool); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setFailoverRatio($failoverRatio); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region2); + $expectedResponse->setSecurityPolicy($securityPolicy); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSessionAffinity($sessionAffinity); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $response = $gapicClient->get($project, $region, $targetPool); + $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.TargetPools/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getTargetPool(); + $this->assertProtobufEquals($targetPool, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + try { + $gapicClient->get($project, $region, $targetPool); + // 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 getHealthTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $kind = 'kind3292052'; + $expectedResponse = new TargetPoolInstanceHealth(); + $expectedResponse->setKind($kind); + $transport->addResponse($expectedResponse); + // Mock request + $instanceReferenceResource = new InstanceReference(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $response = $gapicClient->getHealth($instanceReferenceResource, $project, $region, $targetPool); + $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.TargetPools/GetHealth', $actualFuncCall); + $actualValue = $actualRequestObject->getInstanceReferenceResource(); + $this->assertProtobufEquals($instanceReferenceResource, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getTargetPool(); + $this->assertProtobufEquals($targetPool, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getHealthExceptionTest() + { + $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 + $instanceReferenceResource = new InstanceReference(); + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + try { + $gapicClient->getHealth($instanceReferenceResource, $project, $region, $targetPool); + // 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPoolResource = new TargetPool(); + $response = $gapicClient->insert($project, $region, $targetPoolResource); + $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.TargetPools/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPoolResource(); + $this->assertProtobufEquals($targetPoolResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPoolResource = new TargetPool(); + $response = $gapicClient->insert($project, $region, $targetPoolResource); + $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 TargetPool(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new TargetPoolList(); + $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.TargetPools/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()); + } + + /** @test */ + public function removeHealthCheckTest() + { + $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/removeHealthCheckTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeHealthCheckTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $targetPoolsRemoveHealthCheckRequestResource = new TargetPoolsRemoveHealthCheckRequest(); + $response = $gapicClient->removeHealthCheck($project, $region, $targetPool, $targetPoolsRemoveHealthCheckRequestResource); + $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.TargetPools/RemoveHealthCheck', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPool(); + $this->assertProtobufEquals($targetPool, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPoolsRemoveHealthCheckRequestResource(); + $this->assertProtobufEquals($targetPoolsRemoveHealthCheckRequestResource, $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 removeHealthCheckExceptionTest() + { + $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/removeHealthCheckExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $targetPoolsRemoveHealthCheckRequestResource = new TargetPoolsRemoveHealthCheckRequest(); + $response = $gapicClient->removeHealthCheck($project, $region, $targetPool, $targetPoolsRemoveHealthCheckRequestResource); + $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 removeInstanceTest() + { + $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/removeInstanceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/removeInstanceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $targetPoolsRemoveInstanceRequestResource = new TargetPoolsRemoveInstanceRequest(); + $response = $gapicClient->removeInstance($project, $region, $targetPool, $targetPoolsRemoveInstanceRequestResource); + $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.TargetPools/RemoveInstance', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPool(); + $this->assertProtobufEquals($targetPool, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPoolsRemoveInstanceRequestResource(); + $this->assertProtobufEquals($targetPoolsRemoveInstanceRequestResource, $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 removeInstanceExceptionTest() + { + $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/removeInstanceExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $targetPoolsRemoveInstanceRequestResource = new TargetPoolsRemoveInstanceRequest(); + $response = $gapicClient->removeInstance($project, $region, $targetPool, $targetPoolsRemoveInstanceRequestResource); + $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 setBackupTest() + { + $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/setBackupTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setBackupTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $targetReferenceResource = new TargetReference(); + $response = $gapicClient->setBackup($project, $region, $targetPool, $targetReferenceResource); + $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.TargetPools/SetBackup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPool(); + $this->assertProtobufEquals($targetPool, $actualValue); + $actualValue = $actualApiRequestObject->getTargetReferenceResource(); + $this->assertProtobufEquals($targetReferenceResource, $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 setBackupExceptionTest() + { + $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/setBackupExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetPool = 'targetPool-2084687350'; + $targetReferenceResource = new TargetReference(); + $response = $gapicClient->setBackup($project, $region, $targetPool, $targetReferenceResource); + $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 setSecurityPolicyTest() + { + $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/setSecurityPolicyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setSecurityPolicyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $targetPool = 'targetPool-2084687350'; + $response = $gapicClient->setSecurityPolicy($project, $region, $securityPolicyReferenceResource, $targetPool); + $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.TargetPools/SetSecurityPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getSecurityPolicyReferenceResource(); + $this->assertProtobufEquals($securityPolicyReferenceResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetPool(); + $this->assertProtobufEquals($targetPool, $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 setSecurityPolicyExceptionTest() + { + $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/setSecurityPolicyExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $securityPolicyReferenceResource = new SecurityPolicyReference(); + $targetPool = 'targetPool-2084687350'; + $response = $gapicClient->setSecurityPolicy($project, $region, $securityPolicyReferenceResource, $targetPool); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetSslProxiesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetSslProxiesClientTest.php new file mode 100644 index 000000000000..e32ea7115a32 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetSslProxiesClientTest.php @@ -0,0 +1,1045 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TargetSslProxiesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TargetSslProxiesClient($options); + } + + /** @test */ + public function deleteTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetSslProxy = 'targetSslProxy875666765'; + $response = $gapicClient->delete($project, $targetSslProxy); + $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.TargetSslProxies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxy(); + $this->assertProtobufEquals($targetSslProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetSslProxy = 'targetSslProxy875666765'; + $response = $gapicClient->delete($project, $targetSslProxy); + $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 + $certificateMap = 'certificateMap-917278028'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $proxyHeader = 'proxyHeader-1987109506'; + $selfLink = 'selfLink-1691268851'; + $service = 'service1984153269'; + $sslPolicy = 'sslPolicy-1852293435'; + $expectedResponse = new TargetSslProxy(); + $expectedResponse->setCertificateMap($certificateMap); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setProxyHeader($proxyHeader); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setService($service); + $expectedResponse->setSslPolicy($sslPolicy); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $targetSslProxy = 'targetSslProxy875666765'; + $response = $gapicClient->get($project, $targetSslProxy); + $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.TargetSslProxies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getTargetSslProxy(); + $this->assertProtobufEquals($targetSslProxy, $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 + $project = 'project-309310695'; + $targetSslProxy = 'targetSslProxy875666765'; + try { + $gapicClient->get($project, $targetSslProxy); + // 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 GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetSslProxyResource = new TargetSslProxy(); + $response = $gapicClient->insert($project, $targetSslProxyResource); + $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.TargetSslProxies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxyResource(); + $this->assertProtobufEquals($targetSslProxyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetSslProxyResource = new TargetSslProxy(); + $response = $gapicClient->insert($project, $targetSslProxyResource); + $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 TargetSslProxy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new TargetSslProxyList(); + $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->list($project); + $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.TargetSslProxies/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 setBackendServiceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setBackendServiceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setBackendServiceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetSslProxiesSetBackendServiceRequestResource = new TargetSslProxiesSetBackendServiceRequest(); + $targetSslProxy = 'targetSslProxy875666765'; + $response = $gapicClient->setBackendService($project, $targetSslProxiesSetBackendServiceRequestResource, $targetSslProxy); + $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.TargetSslProxies/SetBackendService', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxiesSetBackendServiceRequestResource(); + $this->assertProtobufEquals($targetSslProxiesSetBackendServiceRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxy(); + $this->assertProtobufEquals($targetSslProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setBackendServiceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setBackendServiceExceptionTest'); + $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 + $project = 'project-309310695'; + $targetSslProxiesSetBackendServiceRequestResource = new TargetSslProxiesSetBackendServiceRequest(); + $targetSslProxy = 'targetSslProxy875666765'; + $response = $gapicClient->setBackendService($project, $targetSslProxiesSetBackendServiceRequestResource, $targetSslProxy); + $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 setCertificateMapTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setCertificateMapTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setCertificateMapTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetSslProxiesSetCertificateMapRequestResource = new TargetSslProxiesSetCertificateMapRequest(); + $targetSslProxy = 'targetSslProxy875666765'; + $response = $gapicClient->setCertificateMap($project, $targetSslProxiesSetCertificateMapRequestResource, $targetSslProxy); + $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.TargetSslProxies/SetCertificateMap', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxiesSetCertificateMapRequestResource(); + $this->assertProtobufEquals($targetSslProxiesSetCertificateMapRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxy(); + $this->assertProtobufEquals($targetSslProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setCertificateMapExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setCertificateMapExceptionTest'); + $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 + $project = 'project-309310695'; + $targetSslProxiesSetCertificateMapRequestResource = new TargetSslProxiesSetCertificateMapRequest(); + $targetSslProxy = 'targetSslProxy875666765'; + $response = $gapicClient->setCertificateMap($project, $targetSslProxiesSetCertificateMapRequestResource, $targetSslProxy); + $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 setProxyHeaderTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setProxyHeaderTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setProxyHeaderTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetSslProxiesSetProxyHeaderRequestResource = new TargetSslProxiesSetProxyHeaderRequest(); + $targetSslProxy = 'targetSslProxy875666765'; + $response = $gapicClient->setProxyHeader($project, $targetSslProxiesSetProxyHeaderRequestResource, $targetSslProxy); + $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.TargetSslProxies/SetProxyHeader', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxiesSetProxyHeaderRequestResource(); + $this->assertProtobufEquals($targetSslProxiesSetProxyHeaderRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxy(); + $this->assertProtobufEquals($targetSslProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setProxyHeaderExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setProxyHeaderExceptionTest'); + $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 + $project = 'project-309310695'; + $targetSslProxiesSetProxyHeaderRequestResource = new TargetSslProxiesSetProxyHeaderRequest(); + $targetSslProxy = 'targetSslProxy875666765'; + $response = $gapicClient->setProxyHeader($project, $targetSslProxiesSetProxyHeaderRequestResource, $targetSslProxy); + $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 setSslCertificatesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setSslCertificatesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setSslCertificatesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetSslProxiesSetSslCertificatesRequestResource = new TargetSslProxiesSetSslCertificatesRequest(); + $targetSslProxy = 'targetSslProxy875666765'; + $response = $gapicClient->setSslCertificates($project, $targetSslProxiesSetSslCertificatesRequestResource, $targetSslProxy); + $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.TargetSslProxies/SetSslCertificates', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxiesSetSslCertificatesRequestResource(); + $this->assertProtobufEquals($targetSslProxiesSetSslCertificatesRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxy(); + $this->assertProtobufEquals($targetSslProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setSslCertificatesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setSslCertificatesExceptionTest'); + $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 + $project = 'project-309310695'; + $targetSslProxiesSetSslCertificatesRequestResource = new TargetSslProxiesSetSslCertificatesRequest(); + $targetSslProxy = 'targetSslProxy875666765'; + $response = $gapicClient->setSslCertificates($project, $targetSslProxiesSetSslCertificatesRequestResource, $targetSslProxy); + $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 setSslPolicyTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setSslPolicyTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setSslPolicyTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $sslPolicyReferenceResource = new SslPolicyReference(); + $targetSslProxy = 'targetSslProxy875666765'; + $response = $gapicClient->setSslPolicy($project, $sslPolicyReferenceResource, $targetSslProxy); + $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.TargetSslProxies/SetSslPolicy', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getSslPolicyReferenceResource(); + $this->assertProtobufEquals($sslPolicyReferenceResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetSslProxy(); + $this->assertProtobufEquals($targetSslProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setSslPolicyExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setSslPolicyExceptionTest'); + $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 + $project = 'project-309310695'; + $sslPolicyReferenceResource = new SslPolicyReference(); + $targetSslProxy = 'targetSslProxy875666765'; + $response = $gapicClient->setSslPolicy($project, $sslPolicyReferenceResource, $targetSslProxy); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetTcpProxiesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetTcpProxiesClientTest.php new file mode 100644 index 000000000000..749f4a00a68b --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetTcpProxiesClientTest.php @@ -0,0 +1,765 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TargetTcpProxiesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TargetTcpProxiesClient($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 TargetTcpProxiesScopedList(), + ]; + $expectedResponse = new TargetTcpProxyAggregatedList(); + $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.TargetTcpProxies/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() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetTcpProxy = 'targetTcpProxy503065442'; + $response = $gapicClient->delete($project, $targetTcpProxy); + $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.TargetTcpProxies/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetTcpProxy(); + $this->assertProtobufEquals($targetTcpProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetTcpProxy = 'targetTcpProxy503065442'; + $response = $gapicClient->delete($project, $targetTcpProxy); + $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'; + $proxyBind = true; + $proxyHeader = 'proxyHeader-1987109506'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $service = 'service1984153269'; + $expectedResponse = new TargetTcpProxy(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setProxyBind($proxyBind); + $expectedResponse->setProxyHeader($proxyHeader); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setService($service); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $targetTcpProxy = 'targetTcpProxy503065442'; + $response = $gapicClient->get($project, $targetTcpProxy); + $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.TargetTcpProxies/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getTargetTcpProxy(); + $this->assertProtobufEquals($targetTcpProxy, $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 + $project = 'project-309310695'; + $targetTcpProxy = 'targetTcpProxy503065442'; + try { + $gapicClient->get($project, $targetTcpProxy); + // 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 GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetTcpProxyResource = new TargetTcpProxy(); + $response = $gapicClient->insert($project, $targetTcpProxyResource); + $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.TargetTcpProxies/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetTcpProxyResource(); + $this->assertProtobufEquals($targetTcpProxyResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $targetTcpProxyResource = new TargetTcpProxy(); + $response = $gapicClient->insert($project, $targetTcpProxyResource); + $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 TargetTcpProxy(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new TargetTcpProxyList(); + $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->list($project); + $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.TargetTcpProxies/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 setBackendServiceTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setBackendServiceTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setBackendServiceTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetTcpProxiesSetBackendServiceRequestResource = new TargetTcpProxiesSetBackendServiceRequest(); + $targetTcpProxy = 'targetTcpProxy503065442'; + $response = $gapicClient->setBackendService($project, $targetTcpProxiesSetBackendServiceRequestResource, $targetTcpProxy); + $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.TargetTcpProxies/SetBackendService', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetTcpProxiesSetBackendServiceRequestResource(); + $this->assertProtobufEquals($targetTcpProxiesSetBackendServiceRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetTcpProxy(); + $this->assertProtobufEquals($targetTcpProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setBackendServiceExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setBackendServiceExceptionTest'); + $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 + $project = 'project-309310695'; + $targetTcpProxiesSetBackendServiceRequestResource = new TargetTcpProxiesSetBackendServiceRequest(); + $targetTcpProxy = 'targetTcpProxy503065442'; + $response = $gapicClient->setBackendService($project, $targetTcpProxiesSetBackendServiceRequestResource, $targetTcpProxy); + $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 setProxyHeaderTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setProxyHeaderTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setProxyHeaderTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $targetTcpProxiesSetProxyHeaderRequestResource = new TargetTcpProxiesSetProxyHeaderRequest(); + $targetTcpProxy = 'targetTcpProxy503065442'; + $response = $gapicClient->setProxyHeader($project, $targetTcpProxiesSetProxyHeaderRequestResource, $targetTcpProxy); + $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.TargetTcpProxies/SetProxyHeader', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getTargetTcpProxiesSetProxyHeaderRequestResource(); + $this->assertProtobufEquals($targetTcpProxiesSetProxyHeaderRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getTargetTcpProxy(); + $this->assertProtobufEquals($targetTcpProxy, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function setProxyHeaderExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/setProxyHeaderExceptionTest'); + $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 + $project = 'project-309310695'; + $targetTcpProxiesSetProxyHeaderRequestResource = new TargetTcpProxiesSetProxyHeaderRequest(); + $targetTcpProxy = 'targetTcpProxy503065442'; + $response = $gapicClient->setProxyHeader($project, $targetTcpProxiesSetProxyHeaderRequestResource, $targetTcpProxy); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetVpnGatewaysClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetVpnGatewaysClientTest.php new file mode 100644 index 000000000000..48aecdcca295 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetVpnGatewaysClientTest.php @@ -0,0 +1,669 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return TargetVpnGatewaysClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new TargetVpnGatewaysClient($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 TargetVpnGatewaysScopedList(), + ]; + $expectedResponse = new TargetVpnGatewayAggregatedList(); + $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.TargetVpnGateways/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() + { + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetVpnGateway = 'targetVpnGateway-4358069'; + $response = $gapicClient->delete($project, $region, $targetVpnGateway); + $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.TargetVpnGateways/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetVpnGateway(); + $this->assertProtobufEquals($targetVpnGateway, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetVpnGateway = 'targetVpnGateway-4358069'; + $response = $gapicClient->delete($project, $region, $targetVpnGateway); + $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'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $network = 'network1843485230'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $expectedResponse = new TargetVpnGateway(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetVpnGateway = 'targetVpnGateway-4358069'; + $response = $gapicClient->get($project, $region, $targetVpnGateway); + $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.TargetVpnGateways/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getTargetVpnGateway(); + $this->assertProtobufEquals($targetVpnGateway, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetVpnGateway = 'targetVpnGateway-4358069'; + try { + $gapicClient->get($project, $region, $targetVpnGateway); + // 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetVpnGatewayResource = new TargetVpnGateway(); + $response = $gapicClient->insert($project, $region, $targetVpnGatewayResource); + $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.TargetVpnGateways/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getTargetVpnGatewayResource(); + $this->assertProtobufEquals($targetVpnGatewayResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $targetVpnGatewayResource = new TargetVpnGateway(); + $response = $gapicClient->insert($project, $region, $targetVpnGatewayResource); + $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 TargetVpnGateway(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new TargetVpnGatewayList(); + $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.TargetVpnGateways/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()); + } + + /** @test */ + public function setLabelsTest() + { + $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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + $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.TargetVpnGateways/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionSetLabelsRequestResource(); + $this->assertProtobufEquals($regionSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $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 setLabelsExceptionTest() + { + $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/setLabelsExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/UrlMapsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/UrlMapsClientTest.php new file mode 100644 index 000000000000..738bd6e667d8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/UrlMapsClientTest.php @@ -0,0 +1,948 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return UrlMapsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new UrlMapsClient($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 UrlMapsScopedList(), + ]; + $expectedResponse = new UrlMapsAggregatedList(); + $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.UrlMaps/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() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $urlMap = 'urlMap-169850228'; + $response = $gapicClient->delete($project, $urlMap); + $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.UrlMaps/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $urlMap = 'urlMap-169850228'; + $response = $gapicClient->delete($project, $urlMap); + $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'; + $defaultService = 'defaultService1980854967'; + $description = 'description-1724546052'; + $fingerprint = 'fingerprint-1375934236'; + $id = 3355; + $kind = 'kind3292052'; + $name = 'name3373707'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new UrlMap(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDefaultService($defaultService); + $expectedResponse->setDescription($description); + $expectedResponse->setFingerprint($fingerprint); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $urlMap = 'urlMap-169850228'; + $response = $gapicClient->get($project, $urlMap); + $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.UrlMaps/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $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 + $project = 'project-309310695'; + $urlMap = 'urlMap-169850228'; + try { + $gapicClient->get($project, $urlMap); + // 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 GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $urlMapResource = new UrlMap(); + $response = $gapicClient->insert($project, $urlMapResource); + $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.UrlMaps/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMapResource(); + $this->assertProtobufEquals($urlMapResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function insertExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $urlMapResource = new UrlMap(); + $response = $gapicClient->insert($project, $urlMapResource); + $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 invalidateCacheTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/invalidateCacheTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/invalidateCacheTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $cacheInvalidationRuleResource = new CacheInvalidationRule(); + $project = 'project-309310695'; + $urlMap = 'urlMap-169850228'; + $response = $gapicClient->invalidateCache($cacheInvalidationRuleResource, $project, $urlMap); + $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.UrlMaps/InvalidateCache', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getCacheInvalidationRuleResource(); + $this->assertProtobufEquals($cacheInvalidationRuleResource, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function invalidateCacheExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/invalidateCacheExceptionTest'); + $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 + $cacheInvalidationRuleResource = new CacheInvalidationRule(); + $project = 'project-309310695'; + $urlMap = 'urlMap-169850228'; + $response = $gapicClient->invalidateCache($cacheInvalidationRuleResource, $project, $urlMap); + $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 UrlMap(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new UrlMapList(); + $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->list($project); + $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.UrlMaps/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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 patchTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/patchTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $urlMap = 'urlMap-169850228'; + $urlMapResource = new UrlMap(); + $response = $gapicClient->patch($project, $urlMap, $urlMapResource); + $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.UrlMaps/Patch', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMapResource(); + $this->assertProtobufEquals($urlMapResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function patchExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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/patchExceptionTest'); + $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 + $project = 'project-309310695'; + $urlMap = 'urlMap-169850228'; + $urlMapResource = new UrlMap(); + $response = $gapicClient->patch($project, $urlMap, $urlMapResource); + $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 updateTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $urlMap = 'urlMap-169850228'; + $urlMapResource = new UrlMap(); + $response = $gapicClient->update($project, $urlMap, $urlMapResource); + $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.UrlMaps/Update', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $actualValue); + $actualValue = $actualApiRequestObject->getUrlMapResource(); + $this->assertProtobufEquals($urlMapResource, $actualValue); + $expectedOperationsRequestObject = new GetGlobalOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $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.GlobalOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new GlobalOperationsClient([ + '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 + $project = 'project-309310695'; + $urlMap = 'urlMap-169850228'; + $urlMapResource = new UrlMap(); + $response = $gapicClient->update($project, $urlMap, $urlMapResource); + $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 validateTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new UrlMapsValidateResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $urlMap = 'urlMap-169850228'; + $urlMapsValidateRequestResource = new UrlMapsValidateRequest(); + $response = $gapicClient->validate($project, $urlMap, $urlMapsValidateRequestResource); + $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.UrlMaps/Validate', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getUrlMap(); + $this->assertProtobufEquals($urlMap, $actualValue); + $actualValue = $actualRequestObject->getUrlMapsValidateRequestResource(); + $this->assertProtobufEquals($urlMapsValidateRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function validateExceptionTest() + { + $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'; + $urlMap = 'urlMap-169850228'; + $urlMapsValidateRequestResource = new UrlMapsValidateRequest(); + try { + $gapicClient->validate($project, $urlMap, $urlMapsValidateRequestResource); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/VpnGatewaysClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/VpnGatewaysClientTest.php new file mode 100644 index 000000000000..5c63daec6eb0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/VpnGatewaysClientTest.php @@ -0,0 +1,810 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return VpnGatewaysClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new VpnGatewaysClient($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 VpnGatewaysScopedList(), + ]; + $expectedResponse = new VpnGatewayAggregatedList(); + $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.VpnGateways/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() + { + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnGateway = 'vpnGateway-1203928583'; + $response = $gapicClient->delete($project, $region, $vpnGateway); + $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.VpnGateways/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getVpnGateway(); + $this->assertProtobufEquals($vpnGateway, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnGateway = 'vpnGateway-1203928583'; + $response = $gapicClient->delete($project, $region, $vpnGateway); + $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'; + $gatewayIpVersion = 'gatewayIpVersion1138816667'; + $id = 3355; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $network = 'network1843485230'; + $region2 = 'region2-690338393'; + $selfLink = 'selfLink-1691268851'; + $stackType = 'stackType2036521617'; + $expectedResponse = new VpnGateway(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setGatewayIpVersion($gatewayIpVersion); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setNetwork($network); + $expectedResponse->setRegion($region2); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStackType($stackType); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnGateway = 'vpnGateway-1203928583'; + $response = $gapicClient->get($project, $region, $vpnGateway); + $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.VpnGateways/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getVpnGateway(); + $this->assertProtobufEquals($vpnGateway, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnGateway = 'vpnGateway-1203928583'; + try { + $gapicClient->get($project, $region, $vpnGateway); + // 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 getStatusTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new VpnGatewaysGetStatusResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnGateway = 'vpnGateway-1203928583'; + $response = $gapicClient->getStatus($project, $region, $vpnGateway); + $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.VpnGateways/GetStatus', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getVpnGateway(); + $this->assertProtobufEquals($vpnGateway, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getStatusExceptionTest() + { + $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'; + $vpnGateway = 'vpnGateway-1203928583'; + try { + $gapicClient->getStatus($project, $region, $vpnGateway); + // 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnGatewayResource = new VpnGateway(); + $response = $gapicClient->insert($project, $region, $vpnGatewayResource); + $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.VpnGateways/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getVpnGatewayResource(); + $this->assertProtobufEquals($vpnGatewayResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnGatewayResource = new VpnGateway(); + $response = $gapicClient->insert($project, $region, $vpnGatewayResource); + $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 VpnGateway(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new VpnGatewayList(); + $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.VpnGateways/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()); + } + + /** @test */ + public function setLabelsTest() + { + $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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + $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.VpnGateways/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionSetLabelsRequestResource(); + $this->assertProtobufEquals($regionSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $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 setLabelsExceptionTest() + { + $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/setLabelsExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + $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 testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + $response = $gapicClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + $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.VpnGateways/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getTestPermissionsRequestResource(); + $this->assertProtobufEquals($testPermissionsRequestResource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function testIamPermissionsExceptionTest() + { + $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'; + $resource = 'resource-341064690'; + $testPermissionsRequestResource = new TestPermissionsRequest(); + try { + $gapicClient->testIamPermissions($project, $region, $resource, $testPermissionsRequestResource); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/VpnTunnelsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/VpnTunnelsClientTest.php new file mode 100644 index 000000000000..37ce7c9acaba --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/VpnTunnelsClientTest.php @@ -0,0 +1,691 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return VpnTunnelsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new VpnTunnelsClient($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 VpnTunnelsScopedList(), + ]; + $expectedResponse = new VpnTunnelAggregatedList(); + $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.VpnTunnels/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() + { + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnTunnel = 'vpnTunnel-2003662317'; + $response = $gapicClient->delete($project, $region, $vpnTunnel); + $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.VpnTunnels/Delete', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getVpnTunnel(); + $this->assertProtobufEquals($vpnTunnel, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnTunnel = 'vpnTunnel-2003662317'; + $response = $gapicClient->delete($project, $region, $vpnTunnel); + $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'; + $detailedStatus = 'detailedStatus-740240799'; + $id = 3355; + $ikeVersion = 1292118044; + $kind = 'kind3292052'; + $labelFingerprint = 'labelFingerprint714995737'; + $name = 'name3373707'; + $peerExternalGateway = 'peerExternalGateway384956173'; + $peerExternalGatewayInterface = 620973433; + $peerGcpGateway = 'peerGcpGateway281867452'; + $peerIp = 'peerIp-690492124'; + $region2 = 'region2-690338393'; + $router = 'router-925132983'; + $selfLink = 'selfLink-1691268851'; + $sharedSecret = 'sharedSecret-154938422'; + $sharedSecretHash = 'sharedSecretHash935752803'; + $status = 'status-892481550'; + $targetVpnGateway = 'targetVpnGateway-4358069'; + $vpnGateway = 'vpnGateway-1203928583'; + $vpnGatewayInterface = 632850035; + $expectedResponse = new VpnTunnel(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setDetailedStatus($detailedStatus); + $expectedResponse->setId($id); + $expectedResponse->setIkeVersion($ikeVersion); + $expectedResponse->setKind($kind); + $expectedResponse->setLabelFingerprint($labelFingerprint); + $expectedResponse->setName($name); + $expectedResponse->setPeerExternalGateway($peerExternalGateway); + $expectedResponse->setPeerExternalGatewayInterface($peerExternalGatewayInterface); + $expectedResponse->setPeerGcpGateway($peerGcpGateway); + $expectedResponse->setPeerIp($peerIp); + $expectedResponse->setRegion($region2); + $expectedResponse->setRouter($router); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSharedSecret($sharedSecret); + $expectedResponse->setSharedSecretHash($sharedSecretHash); + $expectedResponse->setStatus($status); + $expectedResponse->setTargetVpnGateway($targetVpnGateway); + $expectedResponse->setVpnGateway($vpnGateway); + $expectedResponse->setVpnGatewayInterface($vpnGatewayInterface); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnTunnel = 'vpnTunnel-2003662317'; + $response = $gapicClient->get($project, $region, $vpnTunnel); + $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.VpnTunnels/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualRequestObject->getVpnTunnel(); + $this->assertProtobufEquals($vpnTunnel, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnTunnel = 'vpnTunnel-2003662317'; + try { + $gapicClient->get($project, $region, $vpnTunnel); + // 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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnTunnelResource = new VpnTunnel(); + $response = $gapicClient->insert($project, $region, $vpnTunnelResource); + $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.VpnTunnels/Insert', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getVpnTunnelResource(); + $this->assertProtobufEquals($vpnTunnelResource, $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $vpnTunnelResource = new VpnTunnel(); + $response = $gapicClient->insert($project, $region, $vpnTunnelResource); + $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 VpnTunnel(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new VpnTunnelList(); + $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.VpnTunnels/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()); + } + + /** @test */ + public function setLabelsTest() + { + $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/setLabelsTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/setLabelsTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + $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.VpnTunnels/SetLabels', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionSetLabelsRequestResource(); + $this->assertProtobufEquals($regionSetLabelsRequestResource, $actualValue); + $actualValue = $actualApiRequestObject->getResource(); + $this->assertProtobufEquals($resource, $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 setLabelsExceptionTest() + { + $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/setLabelsExceptionTest'); + $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 + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + $resource = 'resource-341064690'; + $response = $gapicClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + $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/owl-bot-staging/Compute/V1/tests/Unit/V1/ZoneOperationsClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/ZoneOperationsClientTest.php new file mode 100644 index 000000000000..f591d53d6521 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/ZoneOperationsClientTest.php @@ -0,0 +1,423 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ZoneOperationsClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ZoneOperationsClient($options); + } + + /** @test */ + public function deleteTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new DeleteZoneOperationResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->delete($operation, $project, $zone); + $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.ZoneOperations/Delete', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function deleteExceptionTest() + { + $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 + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->delete($operation, $project, $zone); + // 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 getTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $clientOperationId = 'clientOperationId-239630617'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $endTime = 'endTime1725551537'; + $httpErrorMessage = 'httpErrorMessage1276263769'; + $httpErrorStatusCode = 1386087020; + $id = 3355; + $insertTime = 'insertTime-103148397'; + $kind = 'kind3292052'; + $name = 'name3373707'; + $operationGroupId = 'operationGroupId40171187'; + $operationType = 'operationType-1432962286'; + $progress = 1001078227; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $startTime = 'startTime-1573145462'; + $statusMessage = 'statusMessage-239442758'; + $targetId = 815576439; + $targetLink = 'targetLink-2084812312'; + $user = 'user3599307'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new Operation(); + $expectedResponse->setClientOperationId($clientOperationId); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEndTime($endTime); + $expectedResponse->setHttpErrorMessage($httpErrorMessage); + $expectedResponse->setHttpErrorStatusCode($httpErrorStatusCode); + $expectedResponse->setId($id); + $expectedResponse->setInsertTime($insertTime); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setOperationGroupId($operationGroupId); + $expectedResponse->setOperationType($operationType); + $expectedResponse->setProgress($progress); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStartTime($startTime); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setTargetId($targetId); + $expectedResponse->setTargetLink($targetLink); + $expectedResponse->setUser($user); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->get($operation, $project, $zone); + $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.ZoneOperations/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->get($operation, $project, $zone); + // 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 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 Operation(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new OperationList(); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setItems($items); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->list($project, $zone); + $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.ZoneOperations/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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'; + $zone = 'zone3744684'; + try { + $gapicClient->list($project, $zone); + // 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 waitTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $clientOperationId = 'clientOperationId-239630617'; + $creationTimestamp = 'creationTimestamp567396278'; + $description = 'description-1724546052'; + $endTime = 'endTime1725551537'; + $httpErrorMessage = 'httpErrorMessage1276263769'; + $httpErrorStatusCode = 1386087020; + $id = 3355; + $insertTime = 'insertTime-103148397'; + $kind = 'kind3292052'; + $name = 'name3373707'; + $operationGroupId = 'operationGroupId40171187'; + $operationType = 'operationType-1432962286'; + $progress = 1001078227; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $startTime = 'startTime-1573145462'; + $statusMessage = 'statusMessage-239442758'; + $targetId = 815576439; + $targetLink = 'targetLink-2084812312'; + $user = 'user3599307'; + $zone2 = 'zone2-696322977'; + $expectedResponse = new Operation(); + $expectedResponse->setClientOperationId($clientOperationId); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setEndTime($endTime); + $expectedResponse->setHttpErrorMessage($httpErrorMessage); + $expectedResponse->setHttpErrorStatusCode($httpErrorStatusCode); + $expectedResponse->setId($id); + $expectedResponse->setInsertTime($insertTime); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setOperationGroupId($operationGroupId); + $expectedResponse->setOperationType($operationType); + $expectedResponse->setProgress($progress); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStartTime($startTime); + $expectedResponse->setStatusMessage($statusMessage); + $expectedResponse->setTargetId($targetId); + $expectedResponse->setTargetLink($targetLink); + $expectedResponse->setUser($user); + $expectedResponse->setZone($zone2); + $transport->addResponse($expectedResponse); + // Mock request + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->wait($operation, $project, $zone); + $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.ZoneOperations/Wait', $actualFuncCall); + $actualValue = $actualRequestObject->getOperation(); + $this->assertProtobufEquals($operation, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function waitExceptionTest() + { + $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 + $operation = 'operation1662702951'; + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->wait($operation, $project, $zone); + // 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()); + } +} diff --git a/owl-bot-staging/Compute/V1/tests/Unit/V1/ZonesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/ZonesClientTest.php new file mode 100644 index 000000000000..51b8355611a5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/ZonesClientTest.php @@ -0,0 +1,216 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return ZonesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new ZonesClient($options); + } + + /** @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'; + $region = 'region-934795532'; + $selfLink = 'selfLink-1691268851'; + $status = 'status-892481550'; + $supportsPzs = true; + $expectedResponse = new Zone(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setRegion($region); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setStatus($status); + $expectedResponse->setSupportsPzs($supportsPzs); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->get($project, $zone); + $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.Zones/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualRequestObject->getZone(); + $this->assertProtobufEquals($zone, $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 + $project = 'project-309310695'; + $zone = 'zone3744684'; + try { + $gapicClient->get($project, $zone); + // 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 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 Zone(); + $items = [ + $itemsElement, + ]; + $expectedResponse = new ZoneList(); + $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->list($project); + $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.Zones/List', $actualFuncCall); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $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'; + try { + $gapicClient->list($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()); + } +}